Forum Tiny Control Solution

Pełna wersja: MQTT setting output value
Aktualnie przeglądasz uproszczoną wersję forum. Kliknij tutaj, by zobaczyć wersję z pełnym formatowaniem.

Jung

Hi there,
How I can set output on/off with mqtt protocol? Any example about this?
Thank you in advance for any help!
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"