Skip to content

Commit cc822ee

Browse files
committed
Update README instructions
1 parent af8728b commit cc822ee

File tree

7 files changed

+162
-91
lines changed

7 files changed

+162
-91
lines changed

axevent/README.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
*Copyright (C) 2020, Axis Communications AB, Lund, Sweden. All Rights Reserved.*
1+
*Copyright (C) 2022, Axis Communications AB, Lund, Sweden. All Rights Reserved.*
2+
3+
# ACAP applications interacting with event system on an edge device
24

3-
# ACAP3 applications interacting with event system on an edge device
45
This README file explains how to use the axevent library, which provides an interface to the event system found in Axis device.
56

67
The purpose is to provide applications a mechanism to send and receive events.
8+
79
* **Producer** - Application sends events.
810
* **Consumer** - Application subscribe events.
911

@@ -13,9 +15,10 @@ The first example will create an application that subscribes to events, which ar
1315
The second example will create an application that declares and sends an ONVIF event that the application in the third example is subscribed to.
1416

1517
A wrapper "get_eventlist.py" is also available for testing the applications. The wrapper supports different ONVIF APIs.
16-
APIs specification is available on https://www.onvif.org/specs/core/ONVIF-Core-Specification.pdf
18+
APIs specification is available on <https://www.onvif.org/specs/core/ONVIF-Core-Specification.pdf>
1719

1820
## Getting started
21+
1922
Below is the structure and scripts of the files and folders on the top level:
2023

2124
```bash
@@ -29,11 +32,12 @@ axevent
2932

3033
* **get_eventlist.py** - Wrapper to find declared and sent events, using ONVIF APIs.
3134
* **README.md** - Step by step instructions on how to use the examples.
32-
* **send_event** - Folder containing files for building ACAP3 application "send_event".
33-
* **subscribe_to_event** - Folder containing files for building ACAP3 application "subscribe_to_event".
34-
* **subscribe_to_events** - Folder containing files for building ACAP3 application "subscribe_to_events".
35+
* **send_event** - Folder containing files for building ACAP application "send_event".
36+
* **subscribe_to_event** - Folder containing files for building ACAP application "subscribe_to_event".
37+
* **subscribe_to_events** - Folder containing files for building ACAP application "subscribe_to_events".
3538

3639
### Example applications
40+
3741
Each example has as a README file in its directory which shows overview, example directory structure and step-by-step instructions on how to run applications on the device.
3842
Below is the list of examples available in the repository.
3943

@@ -45,32 +49,37 @@ Below is the list of examples available in the repository.
4549
* The example code is written in C which subscribes to different predefined events.
4650

4751
### Find events using wrapper
52+
4853
> [!IMPORTANT]
4954
> *The wrapper needs an ONVIF user with password in case wrapper is being used. Browse to the following page (replace <axis_device_ip> with the IP number of your Axis video device)*
5055
>
5156
> ```bash
5257
> http://<axis_device_ip>/#settings/system/security/onvif
5358
> ```
54-
> *Goto your device web page above > Click on Add **(+)** sign below the **ONVIF users** in the device GUI > Add >**Username**, **New password** and **Repeat password** > Click **Save** button*
59+
60+
*Goto your device web page above > Click on Add **(+)** sign below the **ONVIF users** in the device GUI > Add >**Username**, **New password** and **Repeat password** > Click **Save** button*
5561
5662
#### Find declared events using wrapper
63+
5764
The wrapper "get_eventlist.py" helps you save the declared eventlist to an XML-file called "onviflist.xml.new".
5865
5966
```bash
6067
./get_eventlist.py getlist -h
6168
```
6269
6370
#### Find sent events using wrapper
71+
6472
The wrapper also helps you save the sent eventlist to an XML-file called "sentonviflist.xml.new".
6573

6674
```bash
6775
./get_eventlist.py getsent -h
6876
```
6977

7078
### Find events using GStreamer
79+
7180
> [!IMPORTANT]
7281
> *Install GStreamer on your machine by following the instructions here:
73-
https://gstreamer.freedesktop.org/documentation/installing/on-linux.html?gi-language=c*
82+
<https://gstreamer.freedesktop.org/documentation/installing/on-linux.html?gi-language=c>*
7483
7584
It is also possible to use GStreamer tools for monitoring events, as a complement to the wrapper
7685
(replace <user>, <password> and <axis_device_ip> with the username, password and IP number of your Axis video device).
@@ -80,4 +89,5 @@ gst-launch-1.0 rtspsrc location="rtsp://<user>:<password>@<axis_device_ip>/axis-
8089
```
8190

8291
## License
92+
8393
**[Apache License 2.0](../LICENSE)**

axevent/send_event/README.md

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
*Copyright (C) 2020, Axis Communications AB, Lund, Sweden. All Rights Reserved.*
22

3-
# ACAP3 application sending an ONVIF event on an edge device
4-
This README file explains how to build an ACAP3 application that uses axevent library for sending a stateful ONVIF event.
3+
# ACAP application sending an ONVIF event on an edge device
4+
5+
This README file explains how to build an ACAP application that uses axevent library for sending a stateful ONVIF event.
56

67
An ONVIF event is using the namespace "tns1" as the namespace.
78
Different namespaces is used for a custom defined stateful event. Axis is using namespace "tnsaxis" for Axis defined events.
89

910
This example shows an ProcessorUsage ONVIF event with topic namespace "tns1:Monitoring/ProcessorUsage",
1011
according to chapter "8.8.1 Processor Usage" in
11-
https://www.onvif.org/specs/core/ONVIF-Core-Specification.pdf
12+
<https://www.onvif.org/specs/core/ONVIF-Core-Specification.pdf>
1213

1314
The ONVIF event is being sent with an updated processor usage value every 10th second.
1415

15-
Building the application is achieved by using the containerized Axis API and toolchain images.
16+
Building the application is achieved by using the containerized API and toolchain images.
1617

1718
Together with this README file you should be able to find a directory called app.
1819
That directory contains the "send_event" application source code, which can easily
1920
be compiled and run with the help of the tools and step by step below.
2021

2122
## Getting started
23+
2224
These instructions will guide you on how to execute the code. Below is the structure and scripts used in the example:
2325

2426
```bash
@@ -32,24 +34,27 @@ send_event
3234
```
3335

3436
* **app/LICENSE** - Text file which lists all open source licensed source code distributed with the application.
35-
* **app/Makefile** - Makefile containing the build and link instructions for building the ACAP3 application "send_event".
37+
* **app/Makefile** - Makefile containing the build and link instructions for building the ACAP application "send_event".
3638
* **app/send_event.c** - Application which sends events, written in C.
3739
* **Dockerfile** - Docker file with the specified Axis toolchain and API container to build the example "send_event".
3840
* **README.md** - Step by step instructions on how to run the example.
3941

4042
### Limitations
43+
4144
* The example is done for the armv7hf architecture, but it is possible to update to aarch64 architecture.
4245

4346
### How to run the code
47+
4448
Below is the step by step instructions on how to execute the program. So basically starting with the generation of the .eap files to running it on a device:
4549

4650
#### Build the application
51+
4752
Standing in your working directory run the following commands:
4853

4954
> [!IMPORTANT]
5055
> *Depending on the network you are connected to.
51-
The file that needs those settings is: *~/.docker/config.json.*
52-
For reference please see: https://docs.docker.com/network/proxy/ and a
56+
The file that needs those settings is:* ~/.docker/config.json. *For
57+
reference please see: <https://docs.docker.com/network/proxy/> and a
5358
[script for Axis device here](../FAQs.md#HowcanIset-upnetworkproxysettingsontheAxisdevice?).*
5459

5560
```bash
@@ -61,6 +66,7 @@ docker build --tag <APP_IMAGE> .
6166
Default architecture is **armv7hf**. To build for **aarch64** it's possible to
6267
update the *ARCH* variable in the Dockerfile or to set it in the docker build
6368
command via build argument:
69+
6470
```bash
6571
docker build --build-arg ARCH=aarch64 --tag <APP_IMAGE> .
6672
```
@@ -101,6 +107,7 @@ send_event
101107
* **build/send_event_1_0_0_LICENSE.txt** - Copy of LICENSE file.
102108

103109
#### Install your application
110+
104111
Installing your application on an Axis video device is as simple as:
105112

106113
Browse to the following page (replace <axis_device_ip> with the IP number of your Axis video device)
@@ -115,9 +122,10 @@ the newly built **send_event_1_0_0_armv7hf.eap** > Click **Install** > Run the a
115122
Application is now available as an application on the device and has been started to send events.
116123

117124
#### The expected output
125+
118126
Application log can be found directly at:
119127

120-
```
128+
```sh
121129
http://<axis_device_ip>/axis-cgi/admin/systemlog.cgi?appname=send_event
122130
```
123131

@@ -127,13 +135,13 @@ in the terminal.
127135
*> Please make sure SSH is enabled on the device to run the
128136
following commands.*
129137

130-
```
138+
```sh
131139
ssh root@<axis_device_ip>
132140
cd /var/log/
133141
head -200 info.log
134142
```
135143

136-
```
144+
```sh
137145
----- Contents of SYSTEM_LOG for 'send_event' -----
138146

139147
16:23:56.628 [ INFO ] send_event[0]: starting send_event
@@ -146,11 +154,13 @@ head -200 info.log
146154
A stateful event will be sent every 10th second, changing its value.
147155

148156
### Find events using wrapper
157+
149158
See general information about wrapper "get_eventlist.py" in [README](../README.md).
150159

151160
Replace <onvifuser>, <onvifpassword> and <axis_device_ip> with the ONVIF user, ONVIF password and IP number of your Axis video device.
152161

153162
#### Find declared events using wrapper
163+
154164
The wrapper helps you save the declared eventlist to an XML-file.
155165

156166
```bash
@@ -164,11 +174,11 @@ In this case ONVIF API is used and an ONVIF username and password needs to be ad
164174
```
165175

166176
This output could be compared to the ONVIF event specification chapter "8.8.1 Processor Usage" in
167-
https://www.onvif.org/specs/core/ONVIF-Core-Specification.pdf
177+
<https://www.onvif.org/specs/core/ONVIF-Core-Specification.pdf>
168178

169179
XML file "onviflist.xml.new" contains:
170180

171-
```
181+
```xml
172182
<tns1:Monitoring>
173183
<ProcessorUsage wstop:topic="true">
174184
<tt:MessageDescription IsProperty="true">
@@ -184,9 +194,10 @@ XML file "onviflist.xml.new" contains:
184194
```
185195

186196
#### Find sent events using wrapper
197+
187198
The wrapper helps you save the sent eventlist to an XML-file.
188199

189-
```bash
200+
```sh
190201
../get_eventlist.py getsent -h
191202
```
192203

@@ -198,7 +209,7 @@ In this case ONVIF APIs are used, which means that an ONVIF username and passwor
198209

199210
XML file "sentonviflist.xml.new" contains:
200211

201-
```
212+
```xml
202213
<wsnt:NotificationMessage>
203214
<wsnt:Topic Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Simple">tns1:Monitoring/ProcessorUsage</wsnt:Topic>
204215
<wsnt:ProducerReference>
@@ -219,18 +230,19 @@ XML file "sentonviflist.xml.new" contains:
219230
```
220231

221232
### Find events using GStreamer
233+
222234
See general information about GStreamer tools in [README](../README.md).
223235

224236
If using GStreamer tools for monitoring events
225237
(replace <user>, <password> and <axis_device_ip> with the username, password and IP number of your Axis video device).
226238

227-
```bash
239+
```sh
228240
gst-launch-1.0 rtspsrc location="rtsp://<user>:<password>@<axis_device_ip>/axis-media/media.amp?video=0&audio=0&event=on" ! fdsink
229241
```
230242

231243
Output in XML, which has been formatted manually to show topic "tns1:Monitoring/ProcessorUsage":
232244

233-
```
245+
```xml
234246
<?xml version="1.0" encoding="UTF-8"?>
235247
<tt:MetadataStream xmlns:tt="http://www.onvif.org/ver10/schema">
236248
<tt:Event>
@@ -256,4 +268,5 @@ Output in XML, which has been formatted manually to show topic "tns1:Monitoring/
256268
```
257269

258270
## License
271+
259272
**[Apache License 2.0](../../LICENSE)**

axevent/subscribe_to_event/README.md

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
*Copyright (C) 2020, Axis Communications AB, Lund, Sweden. All Rights Reserved.*
1+
*Copyright (C) 2022, Axis Communications AB, Lund, Sweden. All Rights Reserved.*
22

3-
# ACAP3 application subscribing to an ONVIF event on an edge device
4-
This README file explains how to build an ACAP3 application that uses axevent library for subscribing to an ONVIF event.
3+
# ACAP application subscribing to an ONVIF event on an edge device
54

6-
It is achieved by using the containerized Axis API and toolchain images.
5+
This README file explains how to build an ACAP application that uses axevent library for subscribing to an ONVIF event.
6+
7+
It is achieved by using the containerized API and toolchain images.
78

89
Together with this README file you should be able to find a directory called app.
910
That directory contains the "subscribe_to_event" application source code, which can easily
1011
be compiled and run with the help of the tools and step by step below.
1112

1213
## Getting started
14+
1315
These instructions will guide you on how to execute the code. Below is the structure and scripts used in the example:
1416

1517
```bash
@@ -23,24 +25,27 @@ subscribe_to_event
2325
```
2426

2527
* **app/LICENSE** - Text file which lists all open source licensed source code distributed with the application.
26-
* **app/Makefile** - Makefile containing the build and link instructions for building the ACAP3 application "subscribe_to_event".
28+
* **app/Makefile** - Makefile containing the build and link instructions for building the ACAP application "subscribe_to_event".
2729
* **app/subscribe_to_event.c** - Application which subscribes for event, written in C.
2830
* **Dockerfile** - Docker file with the specified Axis toolchain and API container to build the example "subscribe_to_event".
2931
* **README.md** - Step by step instructions on how to run the example.
3032

3133
### Limitations
34+
3235
* The example is done for the armv7hf architecture, but it is possible to update to aarch64 architecture.
3336

3437
### How to run the code
38+
3539
Below is the step by step instructions on how to execute the program. So basically starting with the generation of the .eap files to running it on a device:
3640

3741
#### Build the application
42+
3843
Standing in your working directory run the following commands:
3944

4045
> [!IMPORTANT]
4146
> *Depending on the network you are connected to.
42-
The file that needs those settings is: *~/.docker/config.json.*
43-
For reference please see: https://docs.docker.com/network/proxy/ and a
47+
The file that needs those settings is:* ~/.docker/config.json. *For
48+
reference please see: <https://docs.docker.com/network/proxy/> and a
4449
[script for Axis device here](../FAQs.md#HowcanIset-upnetworkproxysettingsontheAxisdevice?).*
4550

4651
```bash
@@ -52,6 +57,7 @@ docker build --tag <APP_IMAGE> .
5257
Default architecture is **armv7hf**. To build for **aarch64** it's possible to
5358
update the *ARCH* variable in the Dockerfile or to set it in the docker build
5459
command via build argument:
60+
5561
```bash
5662
docker build --build-arg ARCH=aarch64 --tag <APP_IMAGE> .
5763
```
@@ -92,11 +98,12 @@ subscribe_to_event
9298
* **build/subscribe_to_event_1_0_0_LICENSE.txt** - Copy of LICENSE file.
9399

94100
#### Install your application
101+
95102
Installing your application on an Axis video device is as simple as:
96103

97104
Browse to the following page (replace <axis_device_ip> with the IP number of your Axis video device)
98105

99-
```bash
106+
```sh
100107
http://<axis_device_ip>/#settings/apps
101108
```
102109

@@ -114,15 +121,16 @@ the newly built **send_event_1_0_0_armv7hf.eap** > Click **Install** > Run the a
114121
Application is now available as an application on the device and has been started to send events.
115122

116123
#### The expected output
124+
117125
Application logs can be found directly at:
118126

119-
```
127+
```sh
120128
http://<axis_device_ip>/axis-cgi/admin/systemlog.cgi?appname=send_event
121129
```
122130

123131
or
124132

125-
```
133+
```sh
126134
http://<axis_device_ip>/axis-cgi/admin/systemlog.cgi?appname=subscribe_to_event
127135
```
128136

@@ -132,15 +140,16 @@ in the terminal.
132140
*> Please make sure SSH is enabled on the device to run the
133141
following commands.*
134142

135-
```
143+
```sh
136144
ssh root@<axis_device_ip>
145+
137146
cd /var/log/
138147
head -200 info.log
139148
```
140149

141150
##### Output
142151

143-
```
152+
```sh
144153
16:23:51.242 [ INFO ] subscribe_to_event[0]: starting subscribe_to_event
145154
16:23:51.280 [ INFO ] subscribe_to_event[20408]: Started logging from subscribe event application
146155
16:23:51.281 [ INFO ] subscribe_to_event[20408]: And here's the token: 1234
@@ -160,4 +169,5 @@ the initial state of the property. This is the reason why there is one log stati
160169
log stating "Send stateful event with value: 0.000000".
161170

162171
## License
172+
163173
**[Apache License 2.0](../../LICENSE)**

0 commit comments

Comments
 (0)