-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enabling MQTT in WLED 0.14.0 resets every couple minutes #3435
Comments
As there were no changes in MQTT in several months and it appears that MQTT is working on my installs I would suspect something odd in your configuration (broker or client) or messages destined for WLED device. It would also be very helpful if you can use PIO to build & flash your ESP and then use exception decoder to disassemble backtrace. |
Thank you very much for your help. I'm still newbie in this coding, pio things. I thought maybe the problem could come from the fact I use MQTT anonymous without any user/pass, which, I believe, is not that common these days. I've been using Mosquito broker windows service since 2018-19 and I use HA, Tasmota, Z2M, esphome, etc all using MQTT for all that time. I doubt my mqtt config is the culprit but who knows. I'm going to ask a friend to try WLED on an ESP32 wiht MQTT enabled. He has the MQTT HA Addon installed with user/pass. Also I will try to flash older version of WLED... Thanks again. |
I am not using authenticated MQTT myself. I also use Mosquitto, though it is hosted on Linux machine. Wireshark and MQTT explorer are simple tools with plenty of tutorial videos on-line so it should not be too difficult to obtain packets from them. |
Hello again, I tried yesterday night the versions 0.14.0 b4 and also b1 and enabling MQTT creates the self-reseting problem with these versions. Then I tried the 0.13.3 release with MQTT enabled and it has been working very well for many hours now. |
Please provide MQTT packets destined for WLED. |
When I figure out how to achieve that, I'll post it. |
MQTT explorer or Mosquitto client. |
I use MQTT Explorer. So I'm not sure what you need here. If I change the brightness, with b6, sometime I'll see the change in MQTT, sometime not. But if I do not touch WLED, there is nothing to see in MQTT explorer and wled will still self reset every couple of minutes. |
13:39:20 - Preset 0, effect solid, Brightness at 128 Eventually, MQTT publishing almost stops working even after self resets. Then after a reboot (from info screen reboot button), MQTT publishing comes back very responsive to brightness changes for ex. |
My Mosquitto broker (Windows service) was 2.0.14 and I just upgraded to the latest 2.0.18. Now the ESP32 with wled b6 and MQTT enabled seems to hold with no self resets for over 10 minutes now... Thank you for your help and patience. |
Please close the issue then. |
So the ESP32 ran all night with MQTT enabled with no self resets. Thanks again. Closing... |
I'm going to re-open this issue even if it appears I'm the only one having this problem. So after updating my Mosquito broker, I thought it solved the problem but the day after, I tried the latest WLED on an ESP32 and the self resetting problem was there. So I guess the rebooting of my NUC, hosting the Mosquitto Service and also the HA Virtualbox, corrected the problem just for a little while... Actually, when the self resetting seems to be gone, if I cycle power to the esp, the problem comes back. I don't need to wait long after a reboot of the NUC. (I even wonder if the reboot is related) As I said earlier, the same ESP32 with a previous release (0.13.x) and MQTT enabled is working perfectly fine. I will still do some tests and report back. |
I compiled the 0.14.0 source with Debug option. `Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled. ELF file SHA256: 0000000000000000 Backtrace: 0x4015ae90:0x3ffb5bd0 0x4015af84:0x3ffb5bf0 0x4015afce:0x3ffb5c10 0x40195285:0x3ffb5c40 0x4019b44f:0x3ffb5c60 0x4019fc12:0x3ffb5c90 0x4018a0eb:0x3ffb5cb0 0x4008b7e6:0x3ffb5ce0 Rebooting... rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) |
Unfortunately backtrace shows no WLED code. |
I tried to tweak a bit my wifi config in the router after reading some tips... So I deactivated Mosquito windows service and setup the Mosquito addon in Home Assistant. Up to now, the problem seems gone... Very strange... |
MQTT reconnect only happens when library detects disconnect from MQTT broker. There is nothing fancy in WLED. ...
if (mqtt == nullptr) {
mqtt = new AsyncMqttClient();
mqtt->onMessage(onMqttMessage);
mqtt->onConnect(onMqttConnect);
}
if (mqtt->connected()) return true;
DEBUG_PRINTLN(F("Reconnecting MQTT"));
... I know it may sound corny but please try another broker. It happened many times in the past that Windows versions of Mosquitto caused WLED reset. |
Many thanks for your reply. As I wrote, I also tried with bevywise mqtt broker with same result.
Regards, Thomas
…________________________________
From: Blaž Kristan ***@***.***>
Sent: Saturday, February 24, 2024 10:26:46 AM
To: Aircoookie/WLED ***@***.***>
Cc: Thomas Hajek ***@***.***>; Comment ***@***.***>
Subject: Re: [Aircoookie/WLED] Enabling MQTT in WLED 0.14.0 resets every couple minutes (Issue #3435)
MQTT reconnect only happens when library detects disconnect from MQTT broker. There is nothing fancy in WLED.
``c++
...
if (mqtt == nullptr) {
mqtt = new AsyncMqttClient();
mqtt->onMessage(onMqttMessage);
mqtt->onConnect(onMqttConnect);
}
if (mqtt->connected()) return true;
DEBUG_PRINTLN(F("Reconnecting MQTT"));
...
I know it may sound corny but please try another broker. It happened many times in the past that Windows versions of Mosquitto caused WLED reset.
-
Reply to this email directly, view it on GitHub<#3435 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BGNHDL4PWPVJCSJZWDC5GNTYVGW5NAVCNFSM6AAAAAA5ZSC3MSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRSGMYDSNBZGM>.
You are receiving this because you commented.Message ID: ***@***.***>
|
What happened?
Installed latest version of WLED 0.14.0-b6 (Tried AR and non AR) from web installer on a ESP32 Dev board (ESP32-WROOM-32D)
(Also tried on another ESP32 dev board (32D) and also on a ESP32 mini board).
Was working great until I enable MQTT using my Mosquito server IP. (User/Pass empty as I use mosquito anonymously).
With MQTT Enabled, MQTT seemed to work fine for not very long. (Using MQTT Explorer to monitor).
Then, no msg were sent from WLED and after few minutes (1-2), WLED resets itself (Back to default preset)...
It keeps doing this in a loop.
To Reproduce Bug
1- Install WLED 0.14.0-b6 on a ESP32 board.
2- Make a preset with ColorTwinkle effect for example. Leave default preset to 0 (Solid).
3- Enable MQTT (No user/pass, anonymous)
4- After reboot of WLED, choose Preset 1.
Expected Behavior
1- After about 2 minutes (could be from 1 to 5 minutes), it should reset by itself and revert back to preset 0 (Solid).
2- Will keep doing this indefinitely.
Install Method
Binary from WLED.me
What version of WLED?
WLED 0.14.0-b6 Build 2310010
Which microcontroller/board are you seeing the problem on?
ESP32
Relevant log/trace output
Anything else?
I'm using an ASUS Router RT-AC68U with ASUSWRT-MERLIN
Code of Conduct
The text was updated successfully, but these errors were encountered: