MicroPython RP2040 Machine.WDT and socket.getaddrinfo (WDT not fed in time!) #18491
Replies: 3 comments 8 replies
-
|
You might use one of the DNS client libs, e.g. https://github.com/vshymanskyy/aiodns and look up the hostname/address using these. However, I think I don't grasp your problem in full. |
Beta Was this translation helpful? Give feedback.
-
|
Unfortunately DNS lookup via |
Beta Was this translation helpful? Give feedback.
-
|
thank you @jomasnash , I modified your modification because I do not want to utilize asyncio, and i only want a IP address returned. The timeout feature is exactly what i need. I have it jump out at 5 seconds. If it doesn't catch it by then, it aborts out returning null and allowing me to feed the WDT and prevent un wanted reboot. The code also doesn't add any additional overhead to what i already have within existing code. Thank you. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Situation : Pico continually reboot.
Replication to create reboot:
o NO INTERNET SCENARIO
o WDT(timeout=8000)
o socket.getaddrinfo()
GetAddrinfo hangs for what appears to be about 15 seconds, well beyond the max WDT timeout allotment. System reboots before the getaddrinfo returns.
I attempted to use asyncio to make the call, but the same scenario occurs, the getaddrinfo gets hung within the function for 14 seconds. Pico reboots before getaddrinfo returns.
I did google and AI searching, and there seems to be no timeout setting for getaddrinfo.
Im using getaddrinfo before setting the time on the PICO using a NTP server. I suppose i could use the direct IP address for NTP servers, instead of using "pool.ntp.org" , but pool.ntp.org of course frowns upon that.
Any thoughts?
Beta Was this translation helpful? Give feedback.
All reactions