Forum Tiny Control Solution
MQTT setting output value - Wersja do druku

+- Forum Tiny Control Solution (https://forum.tinycontrol.pl)
+-- Dział: LanKontroler - sprzęt i wersje wsadów, problemy, zastosowanie (https://forum.tinycontrol.pl/forumdisplay.php?fid=3)
+--- Dział: LanKontroler V3 (https://forum.tinycontrol.pl/forumdisplay.php?fid=27)
+--- Wątek: MQTT setting output value (/showthread.php?tid=864)



MQTT setting output value - Jung - 11-10-2017

Hi there,
How I can set output on/off with mqtt protocol? Any example about this?
Thank you in advance for any help!


Re: MQTT setting output value - wilkxt - 11-14-2017

Yes
mosquito klient example for our serwer
mosquitto_pub -h mqtt.ats.pl -p 1883 -t prefix/cmd -m "out0 1"
mosquitto_pub -h mqtt.ats.pl -p 1883 -t prefix/cmd -m "out0 0"
mosquitto_pub -h mqtt.ats.pl -p 1883 -t prefix/cmd -m "out1 1"
mosquitto_pub -h mqtt.ats.pl -p 1883 -t prefix/cmd -m "out0 0" etc.

for pwm in on/off mode
mosquitto_pub -h mqtt.ats.pl -p 1883 -t prefix/cmd -m "pwm0 1"
mosquitto_pub -h mqtt.ats.pl -p 1883 -t prefix/cmd -m "pwm0 0"
mosquitto_pub -h mqtt.ats.pl -p 1883 -t prefix/cmd -m "pwm1 0"
mosquitto_pub -h mqtt.ats.pl -p 1883 -t prefix/cmd -m "pwm1 1"