12 063
правки
(Новая страница: «==== Managing devices from the command line====») |
(Новая страница: « To control the device (change the channel value), you need to send a message to the topic "/devices/<device-id>/controls/<control-id>/on" This is done using t…») |
||
Строка 100: | Строка 100: | ||
==== Managing devices from the command line==== | ==== Managing devices from the command line==== | ||
To control the device (change the channel value), you need to send a message to the topic | |||
"/devices/<device-id>/controls/<control-id>/on" This is done using the '''mosquitto_pub''' console command. Example: | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
root@wirenboard:~# mosquitto_pub -t "/devices/wb-mrm2_130/controls/Relay 1/on" -m "1" | root@wirenboard:~# mosquitto_pub -t "/devices/wb-mrm2_130/controls/Relay 1/on" -m "1" | ||
</syntaxhighlight> | </syntaxhighlight> | ||
the command sends the message "1" (logical unit, "turn on") to the topic corresponding to the connected via RS-485 relay module WM-MRM2 with the address '''130'''. | |||
==== Слежение за состоянием устройства / подписка на топик ==== | ==== Слежение за состоянием устройства / подписка на топик ==== |
правки