Newbie question : how to toggle a led with MQTT
-
Hello.
I am newbie with Mysensors and iot world. So I am reading a lot actually. I am trying to do basics tests for learning. So my confiuration is
- MySensors lib 1.4, all arduino nano, nrf24
- Gateway : I use the MQTT broker gateway
- for debugging MQTT, I use MQTTLens (maybe there is a better tool)
My first test was using just one node with a DHT11. I am able to read the infos in MQTTLens.
Now I am trying to toggle a led with MQTT.
So, I removed the DHT11, and connected a led. I verified that hardware is ok by using a simple blink led sketch.
I am using the MySensors relay example.-
I added this line in Setup(). Is it ok?
gw.request(sensor, V_LIGHT,0); -
Here is my problem, maybe a silly question, but I am learning so
in MQTTLens, what command must I send ?? Is it in the subscribe or publish field? I thought that subscribe was just for receiving and publish for sending info. Maybe not?
In subscribe field, if I do MyMQTT/20/1/V_LIGHT my Led toggle on. But How to toggle off?
I think I do not understand how MQTT works yet but I will get it!Thanks for your help I hope my english is not too bad...
Have a good day.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login