Sorry this will be a dumb newbie question for the experts but I cant see how to control ESP8266 NodeMCU GPIO pins on/off using MQTT over the internet
Im Running ESPEasy Mega and publishing and subscribing through a public MQTT broker (Hive)
FWIW - I can turn the GPIO pins/on off with a local Http command
Connectivity is OK, To confirm, I can see the ESP WiFi strength over MQTT using MQTTlens
Can someone share some example configs/settings to get me on track ?
Thanks
How to switch GPIO output using MQTT
Moderators: grovkillen, Stuntteam, TD-er
Re: How to switch GPIO output using MQTT
When defining the MQTT controller, there is the setting "Controller Subscribe" which most likely is set to %sysname%/#
%sysname% is "Unit Name" in config tab.
To send an MQTT command, you need to send it to %sysname%/cmd. Command is the same as with http.
For example, I have an esp named esp230. To switch gpio 5 to 1, I publish gpio,5,1 on esp230/cmd.
In the config tab, you may also want to uncheck "Append Unit Number to hostname" as it modifiers %sysname% (or change accordingly).
%sysname% is "Unit Name" in config tab.
To send an MQTT command, you need to send it to %sysname%/cmd. Command is the same as with http.
For example, I have an esp named esp230. To switch gpio 5 to 1, I publish gpio,5,1 on esp230/cmd.
In the config tab, you may also want to uncheck "Append Unit Number to hostname" as it modifiers %sysname% (or change accordingly).
Sébastien - espRFLinkMQTT gateway RFLink MQTT on esp
Re: How to switch GPIO output using MQTT
Thanks - that worked first time.
I didnt find the "Append Unit Number to hostname" checkbox but it seemed to work ok anyway
I really appreciate your help.
I didnt find the "Append Unit Number to hostname" checkbox but it seemed to work ok anyway
I really appreciate your help.
Who is online
Users browsing this forum: No registered users and 97 guests