[Solved] Trying to use MQTT to control a servo

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
dynamicdave
Normal user
Posts: 257
Joined: 30 Jan 2017, 20:25
Location: Hampshire, UK

[Solved] Trying to use MQTT to control a servo

#1 Post by dynamicdave » 09 Nov 2019, 20:41

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.
Last edited by dynamicdave on 09 Nov 2019, 21:13, edited 1 time in total.

User avatar
dynamicdave
Normal user
Posts: 257
Joined: 30 Jan 2017, 20:25
Location: Hampshire, UK

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

#2 Post by dynamicdave » 09 Nov 2019, 21:13

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)

Captayne
New user
Posts: 1
Joined: 08 Jun 2023, 22:35

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

#3 Post by Captayne » 08 Jun 2023, 22:40

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.

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

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

#4 Post by Ath » 08 Jun 2023, 23:10

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
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 38 guests