<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to interrupt urequests if it hangs]]></title><description><![CDATA[<p dir="auto">The urequests.request() method does not implement e timeout parameter (like its big brother). So if there is not response to a certain request, the method will hang forever.</p>
<p dir="auto">To work around this I am starting a timer just before the urequests.request() call and stop it directly after it. So if the method does not return within a define time, the timer will fire and I can do something.</p>
<p dir="auto">So the question is, when the timer fires, which means urequests.request() is stuck, what can I do to recover? One thing could be to reset the device. But is there a more soft way to do this and continue with the application?</p>
<p dir="auto">Thanks, Ondrej</p>
]]></description><link>https://community.m5stack.com/topic/3986/how-to-interrupt-urequests-if-it-hangs</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 15:36:50 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/3986.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 01 Feb 2022 18:13:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to interrupt urequests if it hangs on Wed, 02 Feb 2022 14:39:54 GMT]]></title><description><![CDATA[<p dir="auto">Yes, watchdog timer could be an idea. The same can be done with a normal timer and calling machine.reset() when it fires.</p>
<p dir="auto">However I was wondering if there was a more graceful way of handling this, e.g. interrupting just the hanging urequests.request() method and then continuing  with the program without rebooting the whole device.</p>
]]></description><link>https://community.m5stack.com/post/16486</link><guid isPermaLink="true">https://community.m5stack.com/post/16486</guid><dc:creator><![CDATA[ondrej1024]]></dc:creator><pubDate>Wed, 02 Feb 2022 14:39:54 GMT</pubDate></item><item><title><![CDATA[Reply to How to interrupt urequests if it hangs on Wed, 02 Feb 2022 06:18:09 GMT]]></title><description><![CDATA[<p dir="auto">Are you using a normal timer or a watchdog timer?<br />
A watchdog timer will trigger a reboot if something fail to respond for example urequests.request()</p>
<p dir="auto">You set the watchdog to run at the beginning and place feed watchdog at the end of the main program loop. If the loop does not complete, feed watchdog doesn't get passed which triggers a reboot.</p>
]]></description><link>https://community.m5stack.com/post/16476</link><guid isPermaLink="true">https://community.m5stack.com/post/16476</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Wed, 02 Feb 2022 06:18:09 GMT</pubDate></item></channel></rss>