Blueforcer / awtrix3

Custom firmware for the Ulanzi Smart Pixel clock or self made awtrix. Getting started is easy as 1-2-3
https://blueforcer.github.io/awtrix3/
Other
1.41k stars 112 forks source link

Hanging after setting MQTT settings with HA discovery toggle #420

Closed JeGr closed 7 months ago

JeGr commented 11 months ago

Bug report

Describe the bug

I have already read (https://github.com/Blueforcer/awtrix-light/issues/165) but that didn't seem to be my problem? Anyway as per my title I have the problem of a reboot loop every time I enter the MQTT settings. I can configure every part of AWTRIX but as soon as I touch MQTT, the device is gone, doesn't get anywhere near getting configurable again (no HTTP available anymore/not responding). Newest 0.9 firmware flashed. MQTT Broker is on the same network as the device (a separate VLAN where IoT stuff is housed) and is a simple mosquitto instance that was set up without much configuration at all. Simple setup, configured user/passwords to test. I already connected several Tasmota devices to test with the broker which do just fine and pop up as soon as I save the settings.

But as soon as I enter the MQTT host, user, pass in AWTRIX, the device reboots and after checking my DHCP server logs, I see it reconnect/getting an IP around every 10s so the device doesn't even get in a usable state anymore where I could reach the HTTP server.

So I'm open to debugging but at a loss what to provide to get it to talk to my broker.

Edit: seems the device just hangs, not reboots - my bad!

Additional information

To Reproduce

Steps to reproduce the behavior:

Expected behavior

Happy to provide any other data I've available, mosquitto is just freshly installed, no special configuration besides pwfile.

Blueforcer commented 11 months ago

Check serial console, and check your mqtt messages via mqtt explorer. I'm pretty sure you're sending a reboot command.

JeGr commented 11 months ago

Thanks for the response!

Sorry, my bad, it seems it isn't a reboot loop, the device I identified getting a DHCPoffer every few seconds wasn't the MAC of the TC001 but a very similar one. Should have checked better.

The problem seems to be in the toggle of "Homeassistant Discovery". If I save MQTT credentials without that toggle and reboot, the device comes up fine and I see it responding in MQTT explorer. If I toggle the discovery to on and reboot, the device seems to hang with MQTT... on screen doing nothing. Also the HTTP server is not responding. After more then 5min it suddenly flips to the date/time view with the calendar icon but doesn't respond to any input (no buttons respond, HTTP still not available).

The only thing that is responding is the IP via ping, but nothing else. Also I doesn't seem to get any console output out of the device. Perhaps wrong settings? Haven't found any that produce any output at all.

Blueforcer commented 11 months ago

10 seconds is the interval of the mqtt reconnect, so maybe awtrix can't connect and do a reconnect wich isn't asynchronous, so the Programm stops in that time.

You're writing "Newest 0.9 firmware flashed". But newest is 0.91. is it a typo?

JeGr commented 11 months ago

As the device hang with MQTT... again there was no going forward, so I re-flashed and erased again.

So it's definetly 0.91 now. What is puzzling (I didn't think about it earlier), if I set up network with static IP settings (toggle is definetly on) the device does still does DHCP:

Dec 1 11:45:03 | dhcpd | 89984 | DHCPACK on 172.27.2.190 to c4:de:e2:fa:9c:6c via igb2.272
Dec 1 11:45:03 | dhcpd | 89984 | DHCPREQUEST for 172.27.2.190 (172.27.2.1) from c4:de:e2:fa:9c:6c via igb2.272

Reconfigured the base settings of the clock after flashing 0.91 again:

then restarted the device.

RESTART
[2085] [setup]: Setup periphery
[2240] [loadSettings]: Webserver configuration loaded
[2240] [setMatrixLayout]: Set matrix layout to 0
Framebuffer_GFX::begin Width: 32 Height: 8 Num Pixels: 256
Connecting to XY-IoT
.[3189] [setup]: My IP: 172.27.2.190
[6903] [setup]: Webserver loaded
Homeassistant discovery disabled
[11060] [connect]: Connecting to MQTT with login
[11080] [onMqttConnected]: MQTT Connected
[11081] [onMqttConnected]: Subscribe to topic /brightness
...
...
...

so the boot worked. But DHCP server showed:

Time           | Process | PID   | Message
Dec 1 11:53:16 | dhcpd   | 30531 | DHCPACK on 172.27.2.190 to c4:de:e2:fa:9c:6c via igb2.272
Dec 1 11:53:16 | dhcpd   | 30531 | DHCPREQUEST for 172.27.2.190 (172.27.2.1) from c4:de:e2:fa:9c:6c via igb2.272
Dec 1 11:53:16 | dhcpd   | 30531 | DHCPOFFER on 172.27.2.190 to c4:de:e2:fa:9c:6c via igb2.272
Dec 1 11:53:16 | dhcpd   | 30531 | DHCPDISCOVER from c4:de:e2:fa:9c:6c via igb2.272

So it still asks DHCP for IP even with static IP toggle on. MQTT connect seems to work without the HA discovery.

If I can toggle some deeper debugging mode before trying the HA discovery toggle again, I'm up for it?

Thanks, Jens

Blueforcer commented 8 months ago

DHCP has nothing to to with homeassistant discovery. Does you problem still exist with 0.94 or can we close this issue?