horvathgergo / uPurifier

Firmware for ESP8266-based custom PCBs that connects IKEA Air Purifiers to Home Assistant via MQTT
GNU General Public License v3.0
15 stars 0 forks source link

Doesn't run without being reset #5

Open lukasmalkmus opened 1 year ago

lukasmalkmus commented 1 year ago

I have received a batch of PCBs and went on to try them. There is some odd behaviour I couldn't resolve: When being plugged in (either via 24V when plugged into the Uppåtvind or 5V when programming/testing via USB) they get stuck. Also the status/change filter LED doesn't turn off. It is only after I press the reset button, that they start connecting to my WiFi and to the MQTT broker and the LED turns off.

Also I observed them getting stuck a couple of times during operation. They get "Unavailable" in Home Assistant and I can see in my router, that they re-connected to WiFi. But the LED doesn't change state in that case. this also needs a press on the reset button to make it work again and show up in Home Assistant.

Both of those scenarios are not ideal since once being built into the case, I don't have physical access to the reset button anymore :/

I also had some similar problems as described in #2. The README should probably mention that MQTT might need admin rights (for me, it does!). I spent hours trying to figure out why the board won't show up and already suspected my IoT WiFi network. Interestingly, the code shows that WiFi is connected before MQTT: https://github.com/horvathgergo/uPurifier/blob/main/upurifier.py#L350-L351.

But until I gave the MQTT user admin rights, the boards weren't showing up on my router 🤔

--

Apart from the issues I face: Thanks for making this project and providing the Gerber files for free! I'll buy you a coffee :)

horvathgergo commented 1 year ago

I assume IoT Wifi networks can be a bit tricky, so thanks sharing your issue. I'm going to update the README with your experience later. As for the wifi/mqtt, I don't see any issue connecting to wifi before mqtt as the device has to be on the same network to communicate with the broker.

So eventually you managed to operate the device but it keeps disconnecting during operation, right? I assume it is in connection with the new Mosquitto version with the keep alive parameter. Previously I tried to adjust this setting and ping the broker in order to keep the connection but maybe the set ping period is too long. I'm going to update the source code to handle these situation as they are damage user experience.

lukasmalkmus commented 1 year ago

As for the wifi/mqtt, I don't see any issue connecting to wifi before mqtt as the device has to be on the same network to communicate with the broker.

Ah yeah, my bad 🤦 I think the "non-admin" problem might have crashed the board so fast after connecting to WiFi that my router didn't bother listing it as a connected device.

Also to rule out a hardware fault, I tried ESPHome which works as intended.