Go Down

Topic: MQTT Node MCU - Publish on High Pin (Read 357 times) previous topic - next topic

benjaminhuson

Hello

First ever post on here so I'm sorry if I have asked anything I shouldn't.

I'm trying to set up an MQTT topic publish on a NodeMCU when a digital pin goes high.

I have only ever done this the other way round, where I subscribe to an MQTT topic and set a pin to high for a relay.

Any help would be appreciated. I currently have no sketch but I'm hoping someone might be able to point me to an example I'm yet to find.

Or maybe this isn't even possible. Sorry for my noobness.. :o

Regards

ElCaron

#1
Nov 30, 2017, 10:58 am Last Edit: Nov 30, 2017, 10:58 am by ElCaron
Where is your problem in calling the publish function when the pin gets changed? If you are already able to connect, that are literally additional 2-4 lines.

Go Up