Decided to make this post in the off chance someone else has happen to know about a solution for my fairly niche requirements. These are not questions about how to use some specific library.
Micropython ports can differ a bit. Especially when it come to low level details.
- Is there any good reading material regarding the lower level stuff of MicroPython and the system it run on?
- More specifically; I looking for a MicroPython system that has the TCP_KEEPIDLE socket option or an equivalent. Is there one?
I'm working on a project programmed in Python where an embedded computer program another piece of hardware over a TCP socket and lightly digest what is coming back from it before sending the data to a more capable machine. The problem is that the target machine is hard coded to drop any connection that has been silent for more than 2 seconds, which is not very long. This is a problem as the communication is expected to be silent for up to several hours in a real scenario.
The current way I have had to solve this issue is to set the TCP_KEEPIDLE socket option to 1 second. This option is not readily available on all systems. Notably it has been a part of Linux for a long time and exist on Windows 10 revisions younger than 2 years. It does not exist on MacOS nor is available on Android for example.
As the Python program itself doesn't really do much it would be very interesting to see if I could make it run on a MicroPython board. For it to be successful in this instance there need to be a way to keep the communication open.