Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    urequests and timeout?

    Scheduled Pinned Locked Moved MicroPython
    3 Posts 3 Posters 379 Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Z Offline
      zmaier
      last edited by

      Hi everyone.

      when loosing the wlan-connection (e.g. i turn of the router) my programm hangs at :
      response = urequests.post(db, data=payload,timeout=timeout_sec)

      It is not raising a exception, the program hangs for ever at this line.

      Any idea why?

      How do you implement a simple post-command with a timeout option?

      THX
      Martin

      I am using this urequests.py :
      https://github.com/micropython/micropyt ... equests.py

      1 Reply Last reply Reply Quote 0
      • A Offline
        andreas
        last edited by

        Dear @zmaier,

        maybe @kjm has something to say about timeouts with the urequests module. Within [1], it looks like he worked around it using the watchdog timer.

        With kind regards,
        Andreas.

        [1] https://forum.pycom.io/topic/5617/delays-delays

        1 Reply Last reply Reply Quote 0
        • K Offline
          kjm
          last edited by kjm

          Andreas is right Martin. I had to resort to a wdt to get around urequest hangs. I tried adding a timeout to urequests, putting urequests in a different thread & setting interrupt timers, nothing worked. Try import urequests; response=urequests.post(your_url, data=payload)

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • 1 / 1
          • First post
            Last post

          Pycom on Twitter

          Pycom