mqtt import disabled on reboot?

Moderators: Voyager, BertB, rtenklooster, Stuntteam, Martinus, grovkillen, TD-er

Post Reply
Message
Author
hamster
Normal user
Posts: 61
Joined: 27 Sep 2015, 21:01
Location: UK

mqtt import disabled on reboot?

#1 Post by hamster » 16 Sep 2018, 10:29

I notice on the latest nightly fw : ESP_Easy_mega-20180916_normal_ESP8266_4096 also ESP_Easy_mega-20180915_dev_ESP8266_4096
after a reboot mqtt import, the enable box becomes unchecked. tried on different devices with the same result?

TD-er
Normal user
Posts: 1051
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: mqtt import disabled on reboot?

#2 Post by TD-er » 16 Sep 2018, 11:00

There is a problem with MQTT import. See https://github.com/letscontrolit/ESPEasy/issues/1722

So therefore I added a 'recovery' plan, which simply detects a crash and counts them.
Every new crash (above crashcount of 10) will disable the next plugin, controller, notification.
So your node crashed at least 10 times at boot when you see your MQTT import disabled.
Before this recovery option, you had to start all over again (or flash an older image), which I have done way too often the last week :(

So please move back to before 20180908 if you use MQTT import

hamster
Normal user
Posts: 61
Joined: 27 Sep 2015, 21:01
Location: UK

Re: mqtt import disabled on reboot?

#3 Post by hamster » 16 Sep 2018, 11:26

thanks for the quick reply !

sasso
Normal user
Posts: 9
Joined: 16 Mar 2017, 21:48

Re: mqtt import disabled on reboot?

#4 Post by sasso » 17 Sep 2018, 22:44

TD-er

I saw this post and downloaded the20180908 release, made an update via web gui, updated ok followed by the automated reboot of the node and was back to bootloop, even after the erase of the settings and enabling all back the bootloop is still present.

I have only enabled the next things:
- controller open hab mqtt
- plugin mqtt import
- plugin nextion
- ntp

Also noticed something but will put on github as bug: command wifissid with 2 words and a space between saves only first word and the output after save is no AP found, of course because the wifi name is 2 words not 1.

Will test this a little deeper with the 0908 build which is supposed to be working ok with mqtt import.

reinhold
Normal user
Posts: 6
Joined: 19 Jun 2017, 22:52
Location: Vienna, Austria
Contact:

Re: mqtt import disabled on reboot?

#5 Post by reinhold » 18 Sep 2018, 00:23

I ran into this problem with my own custom plugin, which I'm currently developing and which is based on the mqtt import plugin. I tracked the issue down to the MQTT subscription function, thanks to the EspStackTraceDecoder.

It appears that trying to access the first enabled mqtt controller in PLUGIN_INIT is the culprit (or looping through all tasks in MQTTSubscribe_037, I'm not really sure, but at least something doesn't seem to be properly initialized in PLUGIN_INIT).
I was able to solve the problem by moving the whole MQTT connection setup from PLUGIN_INIT to PLUGIN_ONCE_A_SECOND. If the MQTTclient object has not been created (i.e. is NULL) in PLUGIN_ONCE_A_SECOND, then I create the PubSubClient, connect and subscribe to MQTT. This also makes sense, as in my tests, the wifi connection was never set up in PLUGIN_INIT, so the mqtt connection couldn't be established at that time anyway.

I haven't run into a crash since then.

Here are the changes that I did to my own plugin:
https://github.com/kainhofer/ESPEasy/co ... 0752cd908c
And this is the full code of the plugin (under development and unfinished, but the crash is gone):
https://github.com/kainhofer/ESPEasy/bl ... Bridge.ino

Post Reply

Who is online

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