micropython-lib
micropython-lib copied to clipboard
urequests timeout
I currently have a problem that if the wifi is not great a request will hang and hold up the whole script. Is there a way to add a timeout to the request? I don't want to use async requests as the program shouldn't keep running without the current data but i would like to retry the requests until a response is received from the server.
Is there a way to do that?
+1
Hi
I have rewritten the library, with some improvements and timeouts.
Do you want to test it ?
After your feedback, I will open source it and propose the new version to the Micropython mantainers.
Hi
I have rewritten the library, with some improvements and timeouts.
Do you want to test it ?
After your feedback, I will open source it and propose the new version to the Micropython mantainers.
Sure. Is it your repo?
Hi I have rewritten the library, with some improvements and timeouts. Do you want to test it ? After your feedback, I will open source it and propose the new version to the Micropython mantainers.
Sure. Is it your repo?
Hi Taylor It isn't published on a public repo.
For these first users' feedback, I prefer to "talk" by email. Write me: massimo.sala.71 AT gmail.com
+1 on wanting a settable timeout. I suspect an os -2 I'm getting is because of a (short) timeout (hard coded) value.
So a try
/ except
block stops the -2 from crashing the script. I could still use a shorter timeout. My failures are generally because the server I'm GETting from and POSTing to are on the wrong network in the house. Should be quick to establish and the current timeout isn't.