npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-red-subflow-axis-provisioning

v1.1.8

Published

Axis device staging and mass configuration

Downloads

17

Readme

Axis Device Provisioning

This is a subflow published as an Node-RED node that is used to simplify multi-device provisioning/staging and mass-configuration when it is not possible to use AXIS ADM or ADMx.

Usage

You must import/update node-red-contrib-axis-com as this subflow depnds on it.
The subflow requires two input properties:

  1. msg.config
  2. msg.inventory

You can import a Template Flow as a starting point, example and inspiration.

There are three outputs:

  1. Status: A message when each configuration in a device is set
  2. Complete: When a device is configured
  3. Error: A message on every error that may occur

Example of msg.inventory

A list of devices that will be provisioned. If static is set it will set static IPv4 address.

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"
      }
  }    
]

Change log

1.1.8

  • Added support for DNS
  • Aded more exception handling
  • Added support for "wait" in ACAP install to provide time for the ACAP to start before sending configugurations.

1.1.7

  • Fixed a flaw in config/vapix

1.1.6

  • Improved and fixed exception handling

1.1.5

  • Added support for device specific VAPIX requests in inventory.properties.vapix[]

1.1.4

  • Bug fixes

1.1.3

  • Fixed clumsy mistake that prevented the node to run

1.1.2

  • Fixed flaw in Overlay
  • Added exemple flow to download ACAP
  • Added example flow to upload a CSV into Node-RED and parse it. Useful for processing into msg.inventory

1.1.1

  • Fixed a flaw in the example code

1.1.0

  • Adjust config.time to support ntp server
  • Added support for generic VAPIX request

1.0.0

  • Initial commit