I'd greatly appreciate it if you guys could read this doc at least to the end of section 1.
My background is in electronics hardware/firmware and my knowledge of internet protocols is sketchy. My observations about detecting loss of network connectivity are based more on empirical observation than on theoretical understanding. Am I missing something obvious? Is there an easier way than relying on timeouts?
Calling network/socket programmers
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Calling network/socket programmers
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Calling network/socket programmers
I also only have empricial experience with socket programming on a multitude of devices and just like you have used timeouts on 'ping' calls and write buffers filling up for detecting outages. There are other ways: depending on hardware platform you can query WiFi outage directly on the WiFi and/or network driver for instance. Likewise for amount of free space in the write buffer etc. But while usually reliable, it's too hardware-dependent for generic code though, and it's not done on socket-level.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Calling network/socket programmers
Alas, as I explain in the doc, querying the WiFi status of the interface is insufficient as it's a property of the interface rather than of the link. WiFi conditions at the "far end" of the link may be completely different. Long running tests in my house showed that brief outages can be very localised. The other case that it can't catch is a code failure at the far end e.g. an AP outage.
Is there a way to query the write buffer status of an ESP8266 nonblocking socket?
Is there a way to query the write buffer status of an ESP8266 nonblocking socket?
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.