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

    Corner Cases

    Scheduled Pinned Locked Moved Discussion
    2 Posts 2 Posters 15 Views 2 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.
    • K Offline
      kjm
      last edited by

      Experience has taught me that if the lte modem is going to connect it will do so in under a second, so I give it 3 just to be sure

      10  for i in range(3):
      11    print(i, ' ', end=''); time.sleep(1)
      12    if lte.isconnected(): break
      13  else: lte.send_at_cmd('AT^RESET')
      

      then reset it if it doesn't make it. This works in 99% of cases where the modem doesn't connect, which in turn is 1% of all connection attempts. But in 1% of the 1% (1 in 10,000!) I get an OSError (modem in data state, AT cmd not allowed) from line 13. Surely the damn thing doesn't connect in the millisecond between line 12 & line 13?

      robert-hhR 1 Reply Last reply Reply Quote 0
      • robert-hhR Offline
        robert-hh @kjm
        last edited by

        @kjm The time is a little bit longer, since it is the span between i being 3 and the moment, the command string "AT^RESET" is finally parsed & executed by the modem firmware. Since that event is relatively rare, it may happen in that time.

        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