Wiren Board NETNOM-1 Software

Материал из Wiren Board
Это утверждённая версия страницы. Она же — наиболее свежая версия.
Другие языки:

Main article Wiren Board NETMON-1

Restart SCU (rear relays)

The daemon dbic-pcycle.py is responsible for controlling the rear relays.

Start/stop daemon:

/etc/init.d/wb-dbic-pcycle start
/etc/init.d/wb-dbic-pcycle stop

The daemon listens to commands on the bus MQTT. There are three different ways to trigger a SCU reboot, i.e. send an MQTT command to the daemon:

  • Via the web interface in the Back relays section
  • With the command dbic_invoke_pcycle.sh in the console
  • By sending a command via MQT
mosquitto_pub -h <ip-адрес МКА> -t "/devices/dbic-power-cycle/controls/power/on" -m "0" -q 2


Configuration mechanism

Configuration

Package wb-dbic establishes and maintains templates of the configuration files in the directory /etc/wb-dbic/templates/. For example the template for the file /etc/network/interfaces is stored in the file /etc/wb-dbic/templates/etc/network/interfaces.template.

Configuration files are generated by calling the dbic_gen_conf script. The script gets the variables for the configuration from the SCU, and then processes the files in the directory /etc/wb-dbic/templates. Only files with the .template extension are processed.

If it becomes impossible to get all necessary variables for substitution for a given file, the file is not updated.

Changes to configuration files are not saved. Changes in templates in /etc/wb-dbic/templates directory are processed the standard conffiles mechanism in dpkg: when installing an updated package and if there are local edits, the user will be offered options for further action.


Network setup

Since getting variables for substituting in templates is happening on the network, the initial file with network settings - /etc/network/interfaces is provided separately.


Adding configuration files to the system

Other configuration files must be added to the autoconfiguration system through WB-dbic package upgrade (with version increase). In this case, if the desired file is provided by any package, then you must use the dpkg-divert or dpkg-divert functionality in conjunction with ucf to prevent overwriting of the file when upgrading source package.