Page 1 of 1

[Solved] Trying to use MQTT to control a servo

Posted: 09 Nov 2019, 20:41
by dynamicdave
I'm trying to use MQTT (from Node-RED) to control a servo - not working.

The topic in the MQTT-Out node in NR is.... node68/servo/1/14 with a msg.payload of 120

The on-board blue LEDon the Wemos flashes to indicate a transfer has taken place, just seems the command is not understood.

However, if I use HTTP, as follows it works (which indicates the wiring is correct and the servo is fine).

http://192.168.1.68/control?cmd=servo,1,14,120

Any suggestions as to what I'm doing wrong?
Is my syntax correct?

The FW I'm using is... ESP_Easy_mega-20191104_normal_ESP8266_4M1M.bin on a Wemos D1 Mini.

[Solved] Re: Trying to use MQTT to control a servo

Posted: 09 Nov 2019, 21:13
by dynamicdave
With some help from a friend I've got it working.

The MQTT topic should be... node68/cmd

And the payload should be... servo,1,14,120 (to move to 120 degrees)

Re: [Solved] Trying to use MQTT to control a servo

Posted: 08 Jun 2023, 22:40
by Captayne
Hi Dynamic Dave,
I just hit the same task you already solved.
I wand to control a valve with a servo using ioBroker using ESP-Easy using MQTT.
Several devices are running nicely so far (Sonoff, Tasmota, Shelly) but I can't get ESP-Easy clients connect to ioBroker. Not even a temperature-sensor. Possibly I will manage it soon on my own, but then I still don't know about how to drive a Servo.
Any more detailed hints, please? That would be soo great, Thank you.

Re: [Solved] Trying to use MQTT to control a servo

Posted: 08 Jun 2023, 23:10
by Ath
A few questions/remarks:
- What MQTT Controller have you got configured in ESPEasy? Most generic one is the 'Home Assistant (openHAB) MQTT' Controller
- Do you use a very long username or password for the MQTT server (> 32 characters)? Then the 'Use Extended Credentials' checkbox should be enabled
- Be aware that ESPEasy doesn't support SSL/TLS in MQTT connections