robertklep / name.klep.sonoff

Homey driver for Sonoff devices
7 stars 7 forks source link

Sonoff basic stops working randomly #32

Closed hannuf1 closed 4 years ago

hannuf1 commented 4 years ago

Hi,

I got one sonoff basic with tasamota firmware. Sometimes it just stops working when I try to turn on the device in homey pro and gives error message "Something went wrong, please try again. (client has alredy ended). After restarting the sonoff app it will work again for sometime.

robertklep commented 4 years ago

Perhaps the app is losing its connection to the MQTT broker. Are you using the MQTT Broker app for Homey? If so, can you check if that apps is being restarted for some reason (I can't remember if the Homey mobile app will show if apps that crashed get restarted)?

hannuf1 commented 4 years ago

Thanks for the quick answer! I'm using mosquitto running in raspberry pi. I also just remembered that I have a scheduled router restart at 05 on wednesday so maybe that is causing the problem? Can't remember if this always happens this same day..

robertklep commented 4 years ago

It would be worthwhile to check :) I think there's a good chance that these two incidents are related.

hannuf1 commented 4 years ago

It was the router reboot. Now it has worked over a week without problems. Maybe you could still implement somekind of mqtt server reconnect feature loop?

robertklep commented 4 years ago

In my case, the MQTT connection is reconnected when it gets lost, but that's typically because the broker has gone offline, not that my router is rebooted. So I'm not sure what makes the latter case so special that the reconnect doesn't work (perhaps that after an X amount of time, it stops retrying).