Skip to content
This repository has been archived by the owner on Aug 22, 2021. It is now read-only.

Mqtt commands don't work after Mosquito is restarted #66

Closed
nospam2k opened this issue Dec 19, 2019 · 12 comments
Closed

Mqtt commands don't work after Mosquito is restarted #66

nospam2k opened this issue Dec 19, 2019 · 12 comments
Labels
bug bugfix Fix to resolve an internal or dependency bug question release Issues that are set to be fixed in a release
Milestone

Comments

@nospam2k
Copy link

When I restart Mosquitto, the bulbs no longer respond to MQTT command until I restart the bulbs. Is there something I need to do to resync the bulbs with Mosquito? This is with the latest version of AiLight

@stelgenhof
Copy link
Owner

Unfortunately this is indeed how it works. See for more details this issue: #56

@stelgenhof
Copy link
Owner

@nospam2k I managed to do some preliminary changes that will check at regular intervals if the connection to the MQTT server is still present.

If you like to try these out, please check the branch https://github.com/stelgenhof/AiLight/tree/feature/mqtt_reconnect and compile/upload this version.
Although I tested it and can confirm it works, be aware that issues may appear.

Cheers! Sacha

@stelgenhof stelgenhof added this to the 0.7 milestone Dec 23, 2019
@nospam2k
Copy link
Author

Nice! I'll give it try when I have some free time.

@stelgenhof stelgenhof added the bug label Dec 23, 2019
@stelgenhof
Copy link
Owner

@nospam2k The 'develop' branch now contains the latest changes which you may want to use instead. The other MQTT_Reconnect branch has been merged into the 'develop' branch.

Cheers! Sacha

@nospam2k
Copy link
Author

I'll try it out after the holidays.

@nospam2k
Copy link
Author

Had some time today to try out current dev. Not sure what happened but MQTT isn't working at all. Messages are being passed but nothing happening on the light. Tried just ON and OFF and no response although the web interface is working fine. Reverted back to 0.6.1-dev. Working as before.

@stelgenhof
Copy link
Owner

@nospam2k Can you change the INIT_HASH number in the main.h file to some other number? It is on line 72. (e.g change 0x5F to 0x62). The number itself doesn't matter as long as it is different.

This number is an internal check for the EEPROM configuration. If your EEPROM doesn't match the firmware code, the light may not work. By changing this code, it will enforce the new config to be initialized.

Thanks! Sacha

@nospam2k
Copy link
Author

Tried that. No change, same problem.

@stelgenhof
Copy link
Owner

@nospam2k Just made some changes in the 'develop' branch. I could replicate the issue that MQTT wasn't working. Basically a connection to the MQTT broker was never made in the code due to a change I made previously to the order when the connections (WiFi and MQTT) are made. I reverted that and should work now. I tested it on two different bulbs and a ESP8266 module.

@donkawechico
Copy link
Contributor

donkawechico commented Feb 3, 2020

1 week ago: I completely switched out my home network hardware to Unisys stack, and moved home assistant to a new RPi4. AiBulbs (OLD firmware) appeared fine, but restarting was still making them lose connection, as expected.

4 days ago: I set up several WiFi networks (main, guest, IoT, and "NoT" (non-internet devices)). I assigned all bulbs to the "NoT" network. Bulbs continued to work fine.

2-3 days ago: I pushed the latest from develop branch to all bulbs. Tried restarting router, bulbs came back on their own and reconnected to MQTT server. All seemed well!

Today: I logged into my router and found all the bulbs are now missing. I'm not aware of any router restarts or outages between yesterday and today.


This could be due to the new networking hardware, or all the new ssids creating interference, or maybe the fact that my AP transmits at 22db, but my bulbs are all set to 1-3?

The only thing that makes me suspect the firmware still being the cause is that they all seemed to disappear at once. If it was just network interference, I would expect them to come in and out of existence.

I'll keep poking and update here.

@stelgenhof stelgenhof added the bugfix Fix to resolve an internal or dependency bug label Mar 4, 2020
@github-actions
Copy link

github-actions bot commented Apr 4, 2020

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

@stelgenhof stelgenhof added release Issues that are set to be fixed in a release and removed no-issue-activity labels Apr 4, 2020
@stelgenhof
Copy link
Owner

Closing as considered resolved in v1.0.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug bugfix Fix to resolve an internal or dependency bug question release Issues that are set to be fixed in a release
Projects
None yet
Development

No branches or pull requests

3 participants