Skip to content
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

Hanging after setting MQTT settings with HA discovery toggle #420

Closed
JeGr opened this issue Dec 1, 2023 · 5 comments
Closed

Hanging after setting MQTT settings with HA discovery toggle #420

JeGr opened this issue Dec 1, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@JeGr
Copy link

JeGr commented Dec 1, 2023

Bug report

Describe the bug

I have already read (#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

  • Devices involved:
    • Model: Ulanzi Awtrix Smart Pixel Clock 2882 (TC001)
    • AWTRIX-LIGHT version: 0.9
    • Target: Mosquitto broker v2.0.13 (running on FreeBSD)

To Reproduce

Steps to reproduce the behavior:

  • Flashed AWTRIX light 0.9
  • minimal setup
  • device is working
  • enter MQTT credentials
  • device enters reboot-loop which can be watched in DHCP logs by retrieving DHCPrequests every 10s
  • no web server available

Expected behavior

  • login into MQTT broker
  • boot to completion
  • reachability via HTTP

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

@JeGr JeGr added the bug Something isn't working label Dec 1, 2023
@Blueforcer
Copy link
Owner

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

@JeGr
Copy link
Author

JeGr commented Dec 1, 2023

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.

@JeGr JeGr changed the title Rebooting after setting MQTT settings Hanging after setting MQTT settings with HA discovery toggle Dec 1, 2023
@Blueforcer
Copy link
Owner

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
Copy link
Author

JeGr commented Dec 1, 2023

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:

  • set up static IP, switched it on, set up IP, mask, DNS, GW
  • set up MQTT host, user, pass but disabled HA discovery
  • uploaded dev.json to enable debug mode

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants