Axis device staging and mass configuration
npm install node-red-subflow-axis-provisioning
msg.invenetory = [
{
"address":"2.3.4.5",
"properties": {
"name": "some-hostname",
[OPTIONAL: Set static IP address]
"static": {
"address": "1.2.3.4",
"router": "1.2.3.1"
}
}
},
{
"address":"some.fqdn.org",
"properties": {
"name": "some-hostname",
[OPTIONAL: VAPIX Request only for this device]
"vapix:" [
{
"method": "post",
"cgi": "/axis-cgi/param.cgi",
"body": "action=update&root.ImageSource.I0.Rotation=180"
}
]
}
}
]
`
Example msg.config
The config holds all configuration. You can remove properties that you do not want or set them to false. Values with empty data will not be commited to the provisioning nor will they produce an error.
accounts
Up to three accounts can be set. The first account is the main account that will be used for all configurations. This means that the device must have this user/password. If the device is at factory default state, the device will be initiated with the main account.
`
msg.config.accounts = [
{
"name": "root",
"password": "pass",
"privileges": "Admin"
},
[OPTIONAL: Add additional accounts]
{
"name": "account2",
"password": "account2",
"privileges": "Operatror"
},
{
"name": "account3",
"password": "account3",
"privileges": "Viewer"
}
]
`
time
Set the device timezone and NTP server. Lookup on https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
`
msg.config.time: {
timezone: "Europe/Stockholm",
[OPTIONAL: Specific NTP servers]
ntp: ["ntp.pool.org"]
}
`
DNS
Set the Dynamic Name Server.
`
msg.config.dns: "8.8.8.8"
[OPTIONAL:]
msg.config.dns: ["8.8.8.8","1.2.3.4"]
`
zipstream
Set zipstream and minimum fps
Values:
* Disable = "off"
* Low = 10
* Medium = 20
* High = 30
* Higher = 40
* Extreme = 50
`
msg.config.zipstream = {
"strength": 20,
[OPTIONAL: Minimum FPS on low motion]
"minfps": 15
}
`
tls
Set the cconnection policy
Values are "Http","Https" & "HttpAndHttps"
Connection poicy. Values may be "Http","Https" & "HttpAndHttps"
`
msg.config.tls = {
"policy": "HttpAndHttps"
}
`
textOverlays
Up to two text overlay can be set
`
[
{
"text": "%F %X",
"position": "topLeft",
"textColor": "white",
"textBGColor": "black",
"fontSize": 48
},
{
"text": "#n",
"position": "topRight",
"textColor": "white",
"textBGColor": "transparent",
"fontSize": 48
}
]
`
imageOverlay
The image file needs to stored under directory Provisioning/smiley.png.
Node-RED on Windows: C:\\Users\\user\\Provisioning\\smiley.png
Node-RED on Linux: /home/user/Provisioning/smiley.png
`
msg.config.imageOverlay = {
"filepath": "Provisioning/smiley.png",
"position":"bottomRight",
"scale": true
}
`
onvif
Up to three ONVIF Accpunts can be set
`
[
{
"name": "user1",
"password": "user1",
"privileges": "Administrator"
},
{
"name": "user2",
"password": "user2",
"privileges": "Administrator"
},
{
"name": "user3",
"password": "user3",
"privileges": "Administrator"
}
]
`
mqtt
Set the device MQTT client. It is also possible to set mqtt publishing
`
msg.config.mqtt = {
"address":"",
"user": "",
"password":"",
[OPTIONAL]
"publish": [
{
"qos": 0,
"retain": "none",
"topicFilter": "axis:CameraApplicationPlatform/ObjectAnalytics/Device1Scenario1"
},
{
"qos": 0,
"retain": "none",
"topicFilter": "axis:CameraApplicationPlatform/ObjectAnalytics/Device1Scenario2"
}
]
}
`
ssh
Enable or disable SSH
`
msg.config.ssh = {
"name": "",
"password":""
}
`
`
msg.config.ssh = false
`
acaps
Installs and starts ACAPS. The eap-files needs to be store on local directory. If the device already has the ACAP installed with the version defied in payload, it will not install, just start.
Property "wait", will pause X seconds after ACAP started. Use this when settings ACAP configurations witrh a VAPIX call. The time needed dependds on ACAP.
`
msg.config.acap = [
{
"package": "motionguard", //Must be the correct package id
"version": "2.3.2",
"armv7hf": "Provisioning/MotionGuard/armv7hf.eap",
"aarch64": "Provisioning/MotionGuard/aarch64.eap",
[OPTIONAL]
"wait": 5
}
]
`
Vapix
For settings not supported in the config JSON it is possible to add VAPIX API request.
The VAPIX response is available in the status output with msg.response.
`
msg.config.vapix = [
{
"method": "get",
"cgi": "/axis-cgi/param.cgi?action=update&ImageSource.I0.Color=50"
},
{
"method": "post",
"cgi": "/axis-cgi/basicdeviceinfo.cgi",
"body": {
"apiVersion": "1.0",
"context":"nodered",
"method": "getAllProperties"
}
}
]
``