Wifi connected but no data flow recognition

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
nikanta
Posts: 5
Joined: Sun Jun 16, 2019 10:28 am

Wifi connected but no data flow recognition

Post by nikanta » Fri Aug 02, 2019 8:52 pm

Hello,
I am using an ESP32 running latest version of micropython.
The idea is to have ESP32 boards transferring their sensor data to a mqtt server.
Firstly i am testing ways to achieve a good connection between the ESP32 and my local network.
What i am thinking of is using the isconnected() function to check at some certain points of my code that the connection is TRUE.
So if it is FALSE i will be calling a reconnect function until connection is good and then the code will continue at the same point.
So far when the wireless connection is lost the ESP32 tries to reconnect until it's done successfully.
BUT i noticed that there are times where i have a wifi connection but no data(let's say some error with my internet provider)
So at that moment the ESP32 board is connected to the network so it will continue with the rest code thinking that everything is working.
Is there any way i can check if the wifi connection also has data flow?

User avatar
pythoncoder
Posts: 3538
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Wifi connected but no data flow recognition

Post by pythoncoder » Sat Aug 03, 2019 6:33 am

See this doc for an explanation of the issues and this repo for a possible solution.
Peter Hinch

Post Reply