Search found 4 matches

by LagomBra
Tue Jun 23, 2020 7:29 pm
Forum: ESP32 Arduino
Topic: Reliable WiFi and MQTT connection and reconnection?
Replies: 5
Views: 16667

Re: Reliable WiFi and MQTT connection and reconnection?

I'm using the Adafruit MQTT library, so MQTTclient.setKeepAlive is not available. I also don't find a "semaphore". But I'm happy as it is, as the again modified "Urs-code" is reliable, when either power or Internet drops out. Always reconnects, so I can now leave my set-up alone and drive away ; ) v...
by LagomBra
Tue Jun 16, 2020 8:48 am
Forum: ESP32 Arduino
Topic: The Proper Way to Reconnect to WiFi?
Replies: 7
Views: 40273

Re: The Proper Way to Reconnect to WiFi?

To reliably (re)connect WLAN and MQTT services after power or router outage, I use this state machine function void connectToWLANAndMQTT(). It works well on my end. I am using a Metro Mini with an external AirLift FeatherWing. Here is a complete example that publishes dummy data to a test feed. #inc...
by LagomBra
Sat Jun 13, 2020 3:45 pm
Forum: ESP32 Arduino
Topic: Reliable WiFi and MQTT connection and reconnection?
Replies: 5
Views: 16667

Re: Reliable WiFi and MQTT connection and reconnection?

As I read in several places, the ESP32 and various brands/models of routers cause all sorts of issues. I used to have disconnects a few times per day or week and finally found out that it was TP-Link powerline devices a neighbour used to expand his WiFi network. Once removed, no more disconnects, in...
by LagomBra
Fri Jun 12, 2020 7:47 pm
Forum: ESP32 Arduino
Topic: Reliable WiFi and MQTT connection and reconnection?
Replies: 5
Views: 16667

Reliable WiFi and MQTT connection and reconnection?

I modified Urs Eppenberger's state machine code from this post https://esp32.com/viewtopic.php?f=19&t=3851 for the Adafruit IO WiFi and MQTT libraries, nothing special. I am using an Adafruit Metro Mini with an Adafruit AirLift FeatherWing ESP32. Two problems. 1. When connected and powered from USB,...