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

After some time of operation, no MQTT states topics are emitted any more #328

Closed
HenkDemper opened this issue Sep 3, 2018 · 13 comments
Closed

Comments

@HenkDemper
Copy link

Hello Chris. The 2nd issue I encounter when using V1.8.1 of the Gateway that after some usage (days, weeks ?) there are no MQTT state topics emitted anymore, only updates. For instance for group 1-4 using a FUT006 remote I then only see the .../update/.../1-4 etc MQTT topics, but no .../states/.../1-4 ones. Command topics are working Ok during this state. As part of my openHAB automation (keeping the items in sync) depends on correct states messages, this is now broken...

When I restart the MiLight hub, it directly emits both MQTT update and states topics again. It seems like a resource problem or some internal deadlock/timeout. I am happy to debug something specific when it happens again (I noticed it about 3 times now). Thanks for any help.

@sidoh
Copy link
Owner

sidoh commented Sep 3, 2018

Are you able to collect serial logs?

@HenkDemper
Copy link
Author

HenkDemper commented Sep 3, 2018

Not in my current setup. I will need to compile myself and keep my NodeMCU attached to always-on computer via USB (and wait till it happens) likely to achieve this ? Any instruction how to setup ?

@sidoh
Copy link
Owner

sidoh commented Sep 3, 2018

A bit here:

https://github.com/sidoh/esp8266_milight_hub#setting-up-the-esp

Compile flags are in platformio.ini. The relevant flags are MQTT_DEBUG and STATE_DEBUG.

I don't have updates enabled in my setup, but I've been running 1.8.1 since it was released, and haven't noticed interruptions to the state topic.

@HenkDemper
Copy link
Author

HenkDemper commented Sep 3, 2018

...and if I make that build, then that would always log serial -> USB -> (always-on) computer, right (no logging possible over WiFi / Web GUI or alike) ?

Also the Setting - Auto-restart period is tempting to set to 1 day or so (now 0 = disabled), but not the right way to solve this I guess...

@sidoh
Copy link
Owner

sidoh commented Sep 4, 2018

Correct. Unfortunately no way to receive serial logs except through a computer the ESP8266 is attached to.

Agreed it doesn't feel clean. This definitely shouldn't be happening.

@HenkDemper
Copy link
Author

Maybe the bug you found in issue #327 also fixes this issue (after all, if memory gets corrupted, anything can happen) ? I think it is best I wait for the #327 fix, then try if this issue #328 still exists...

@sidoh
Copy link
Owner

sidoh commented Sep 5, 2018

Totally plausible. Do you use group 0 anywhere in your setup?

@HenkDemper
Copy link
Author

I my setup I never send a command to group 0 using MQTT .../command/.... But when a button for group 0 on a remote like FUT006 or B2 is pressed, I do read the MQTT .../update/... topic for it and process it to keep the items in my automation in sync. So group 0 messages are being sniffed and result in issue #327.

@sidoh
Copy link
Owner

sidoh commented Sep 5, 2018

Got it. Then yes, this could totally be the issue. Hopefully I'm able to get a fix out soon =)

@sidoh
Copy link
Owner

sidoh commented Sep 8, 2018

@HenkDemper how's it been looking so far?

@HenkDemper
Copy link
Author

I haven't used the lights via remote / automation a terrible lot the past 4 days, but I just tried to break it by frequently turning them On/Off via the remotes group 1-4 and 0 and I keep getting the correct MQTT topics for both updates as well as states, so looking good so far 👍

@sidoh sidoh mentioned this issue Sep 9, 2018
@sidoh
Copy link
Owner

sidoh commented Sep 10, 2018

Cool. I'm going to close in hopes that this was the issue. Please feel free to re-open if you notice it again.

@sidoh sidoh closed this as completed Sep 10, 2018
@HenkDemper
Copy link
Author

Hi Chris. Unfortunately I'm noticing the issue is still appearing: I don't get any state changes anymore, while I do get update changes (both state and update changes are configured). For instance:

>mosquitto_sub -v -t milight/#

milight/commands/0x887E/rgb_cct/1 {"state":ON}
milight/updates/0x887E/rgb_cct/1 {"state":"ON"}
milight/commands/0x887E/rgb_cct/1 {"state":OFF}
milight/updates/0x887E/rgb_cct/1 {"state":"OFF"}

I was running v1.8.2 of the Gateway, just updated to latest v1.8.5, but given the changes doubt that this will help... Because of the reboot it now works again, for the same ON & OFF commands we now get:

milight/commands/0x887E/rgb_cct/1 {"state":ON}
milight/updates/0x887E/rgb_cct/1 {"state":"ON"}
milight/states/0x887E/rgb_cct/1 {"state":"ON","level":100,"kelvin":65,"bulb_mode":"white"}
milight/commands/0x887E/rgb_cct/1 {"state":OFF}
milight/updates/0x887E/rgb_cct/1 {"state":"OFF"}
milight/states/0x887E/rgb_cct/1 {"state":"OFF","level":100,"kelvin":65,"bulb_mode":"white"}

Will keep monitoring the issue...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants