ESP Easy Mega MQTT issues

Moderators: grovkillen, TD-er, Stuntteam

Post Reply
Message
Author
_Cyber_
Normal user
Posts: 19
Joined: 20 Oct 2019, 09:46

ESP Easy Mega MQTT issues

#1 Post by _Cyber_ » 16 Mar 2020, 15:06

hi,

I am struggling with a quite simple thing, but it drives me crazy.
I have connected a relay to GPIO2 on a wemos D1 mini.
I have flashed mega-20200310 "normal"

controlling the GPIO via http://<IP>/control?cmd=GPIO,2,1 works well. Altough, as the response has added an additional "OK" it is not clean json and node red needs additional parsing for it.
So, as already configured and working here, I have set up Domoticz MQTT (as first and only controller).

Configuration:
MQTT.png
MQTT.png (16.48 KiB) Viewed 2247 times
so, my assumption would be, if I send "mosquitto_pub -t smartswitch/cmd -m "gpio,2,1" " by MQTT I should turn the GPIO to high and get on ...status the json response.
But I do not get anything.
I can see the device is connecting as I can see on booting the ESP: smartswitch/global/running true
I have tried already: with leading slash, with "%sysname%" after "smartswitch", different topics, etc, I cannot get it working.

I have also tried to set up a "switch input - switch" as device (currently the "devices" are empty), there I could see the "status" on the device, but it always stays "0" and therefore also does not toggle on turing on by HTTP. But as far as I read this is WAD.

hopefully somebody points me in the right direction. :-)

Thanks!

Best regards

User avatar
grovkillen
Core team member
Posts: 3582
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESP Easy Mega MQTT issues

#2 Post by grovkillen » 16 Mar 2020, 16:11

The response shouldn't add the extra ok. It's been addressed but apparently not released yet.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

_Cyber_
Normal user
Posts: 19
Joined: 20 Oct 2019, 09:46

Re: ESP Easy Mega MQTT issues

#3 Post by _Cyber_ » 16 Mar 2020, 18:58

thank you. :-)
any hints for the mqtt issue?

Thanks!

Alois

BTW: it drives me crazy. have tried now (feels like) 100 approaches and none is working.
viewtopic.php?t=320
viewtopic.php?t=5642
viewtopic.php?t=3525

so I assume I am not the first one trying to get it work... :ugeek:

chemmex
Normal user
Posts: 16
Joined: 15 Feb 2019, 16:18

Re: ESP Easy Mega MQTT issues

#4 Post by chemmex » 18 Mar 2020, 08:22

I think you should check the command reference first to find which commands may work through mqtt subscription. As far as I remember, gpio is not among them. However, you can initiate the event with event command, pass any arguments such as gpio# and state and then use it in rules for activation

_Cyber_
Normal user
Posts: 19
Joined: 20 Oct 2019, 09:46

Re: ESP Easy Mega MQTT issues

#5 Post by _Cyber_ » 18 Mar 2020, 10:58

according to the table here https://www.letscontrolit.com/wiki/inde ... O#Commands
MQTT should work.

also the overall command reference here https://www.letscontrolit.com/wiki/inde ... _Reference
tells me for GPIO "Plugin" : Plugin - Can be run from serial, rules engine, HTTP, MQTT

nevertheless grovkillen ' s comment pointed me out in a direction: I fould the bug on github https://github.com/letscontrolit/ESPEasy/issues/2892 and also there a version with clean json output for http which now lets handle me the response clear in node red. So I do parsing and translation to MQTT now there and it is working: :-)

Thanks!

BR
Alois

TD-er
Core team member
Posts: 2620
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP Easy Mega MQTT issues

#6 Post by TD-er » 18 Mar 2020, 11:13

You are now using the test build I linked in that issue?

_Cyber_
Normal user
Posts: 19
Joined: 20 Oct 2019, 09:46

Re: ESP Easy Mega MQTT issues

#7 Post by _Cyber_ » 18 Mar 2020, 13:40

@TD-er no I am using mega-20190805
I did not install the testbuild, there is a comment the build only returns text: https://github.com/letscontrolit/ESPEas ... -587071587

If there are other test-builds you would like to have verified just tell me (or better send me a link to them), I can install them and test. :-)

I also saw https://github.com/letscontrolit/ESPEasy/pull/2778 but I am a bit confused regarding it's state, I think there are some parts open until it will get merged? If you want, I also can test a build out of this.

Best regards
Alois

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 13 guests