App, service and mqtt crashes when wifi disconnects and wont reconnect
I'm making an app with a mqtt client and a background service that makes a notification when I get certain mqtt message. I use Paho library and service as the client and everything works perfectly as long as I am connected to wifi and the broker is on. I don't want access to the broker over internet so when no wifi is available the client is disconnected, the problem is that when the wifi connects again the mqtt client wont reconnect. I have tried many things but the latest test was to make a handler check if there is internet and if its via wifi, and if it is I start the mqtt server again. I