Thank you contacting Teltonika Crowd Support.
Please note that when monitoring input/output via MQTT, the parameters digital2 and pin3 corresponds to pin 2 of the Input/ Output pinout (Digital galvanically isolated input [0-4VDC: low logic level/ 9-30 VDC: high logic level]) and pin 3 of the 4 pin power pinout (Input [0-5VDC: logic level/ 8-40 VDC: high logic level) respectively.
Kindly refer to the attached diagram which consist of the mapping of all MQTT monitoring input/output parameters with the corresponding pinouts.
Further details on RUT955 input/output pinout could be found by following the link below:
Great thanks for this information.
Parameter names are inputs :
while the Parameter name Digital2 and pin4 are outputs.
Can you help me to Subscribe and publish with mosquitto the digital2 output
$ mosquitto_pub -h 10.10.252.1 -p 1833 -u user -P pass -t router/get m \"digital2\":1
$ mosquitto_sub -h 10.10.252.1 -p 1833 -u user -P pass -t router/110xxxx/digtal2
Thank you for the response.
Please be advised that digital2 is a digital input whereas pin4 is a digital output. Kindly refer to the attached screenshots.
Kindly find detailed descriptions of parameters digital2 and pin4 below:
The screenshots below show publish and subscribe for digital2 input with mosquito.
Can you give me the command for pin4 ?
$ mosquitto_pub -h 10.10.252.1 -p 1833 -u user -P pass -t router/get m \"pin4\":1
$ mosquitto_sub -h 10.10.252.1 -p 1833 -u user -P pass -t router/110xxxx/pin4
If you would like to monitor the status of pin4 (Digital open collector (OC) output; 30 V, 300 mA), you could use the publish and subscribe commands for pin4 output with mosquito as shown below:
You could set the digital output pin4 by using MQTT gateway feature on your RUT955 router. This will enable you to publish MQTT messages to control pin4's output.
In the configuration below, the RUT955 router has been configured as the Modbus TCP Slave, MQTT Gateway and MQTT Broker and the PC has been setup as the MQTT Publisher/Subscriber.
Below are the RUT955 configuration settings:
Kindly refer to the link below for further details:
It is important to take note of the "Message format for MQTT publisher" section in the link provided above.
In this case the command below was used to set the output of pin4 to "High",
mosquitto_pub -h 192.168.1.1 -p 1883 -m '0 65432 0 192.168.1.1 502 5 1 6 326 1' -t request
and the command below was used to set the output of pin4 to "Low".
mosquitto_pub -h 192.168.1.1 -p 1883 -m '0 65432 0 192.168.1.1 502 5 1 6 326 0' -t request
You could refer to the link below for more details about the corresponding modbus get/set parameters: