GithubHelp home page GithubHelp logo

sledparking-axis / opc-ua-server-acap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from axiscommunications/opc-ua-server-acap

0.0 0.0 0.0 124 KB

Small ACAP application that gets temperature sensor data on an Axis device via D-Bus and exposes it via OPC UA.

License: Apache License 2.0

Dockerfile 1.48% Makefile 4.47% C 94.05%

opc-ua-server-acap's Introduction

Copyright (C) 2022, Axis Communications AB, Lund, Sweden. All Rights Reserved.

OPC UA Server ACAP

Build ACAPs GitHub Super-Linter

This repository contains the source code to build a small example ACAP version 3 application that uses D-Bus to get

  • temperature sensor data from com.axis.TemperatureController
  • IO port states from com.axis.IOControl.State

and expose them as OPC UA with an open62541 server. It serves as an example of how easy it actually is to integrate any Axis device in an OPC UA system.

Architectural overview

Please note that even if this ACAP would fit right into your usecase, its purpose is above all to serve as an example and boilerplate rather than being ready for production.

Build

On developer computer with ACAP SDK installed

# With the environment initialized, use:
acap-build .

Using ACAP SDK build container and Docker

The handling of this is integrated in the Makefile, so if you have Docker and make on your computer all you need to do is:

make dockerbuild

or perhaps build in parallel:

make -j dockerbuild

If you do have Docker but no make on your system:

# 32-bit ARM, e.g. ARTPEC-6- and ARTPEC-7-based devices
DOCKER_BUILDKIT=1 docker build --build-arg ARCH=armv7hf -o type=local,dest=. .
# 64-bit ARM, e.g. ARTPEC-8-based devices
DOCKER_BUILDKIT=1 docker build --build-arg ARCH=aarch64 -o type=local,dest=. .

Setup

Manual installation and configuration

Upload the ACAP file (the file with the .eap extension for the camera's architecture) through the camera's web UI: Apps->Add app

The OPC UA Server port (default is 4840) can be set through the ACAP's parameter settings, found in the three vertical dots menu:

Web UI Screenshot

Web UI Screenshot

Scripted installation and configuration

Use the camera's applications/upload.cgi to upload the ACAP file (the file with the .eap extension for the camera's architecture):

curl -k --anyauth -u root:<password> \
    -F packfil=@OPC_UA_Server_<version>_<architecture>.eap \
    https://<camera hostname/ip>/axis-cgi/applications/upload.cgi

To start (or stop/restart/remove) the ACAP, you can make a call like this:

curl -k --anyauth -u root:<password> \
    'https://<camera hostname/ip>/axis-cgi/applications/control.cgi?package=opcuaserver&action=start'

Use the camera's param.cgi to get or set the OPC UA server port number.

The call

curl -k --anyauth -u root:<password> \
    'https://<camera hostname/ip>/axis-cgi/param.cgi?action=list&group=opcuaserver'

will list the current setting:

root.Opcuaserver.port=4840

If you want to set the OPC UA server port to e.g. 4842:

curl -k --anyauth -u root:<password> \
    'https://<camera hostname/ip>/axis-cgi/param.cgi?action=update&opcuaserver.port=4842'

Usage

Attach an OPC UA client to the port set in the ACAP. The client will then be able to read the values (and their timestamps) from the ACAP's OPC UA server.

The ACAP will also log the values in the camera's syslog.

License

Apache 2.0

opc-ua-server-acap's People

Contributors

joakimr-axis avatar renovate[bot] avatar sledparking-axis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.