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

    lte attachment

    Scheduled Pinned Locked Moved GPy
    3 Posts 2 Posters 295 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

      I've got a gpy in a wakeup-lteattach-connect-upload-disconnect-detach-deeplseep cycle. There is an lte modem reset cmd in the attachment routine

            if not lte.isattached():
              print('lte attaching ', end=''); lte.attach()
              for i in range (10):
                if lte.isattached(): print ('attached'); break
                if i==5:  print('modem reset'); lte.send_at_cmd('AT^RESET')
                print(i, ' ', end='')                         
      

      it works OK with the reset in the middle of the 10 trys but if I remove the rest line then attachment failure can persist indefinitely. The reason the modem is sometimes not attaching & needs the modem reset is because it's already attached, which is possible if the previous deepsleep cycle ended without proper detachment. What I can't figure out is how an already attached modem gets past the if not lte.isattached() test?

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jcaron @kjm
        last edited by

        @kjm haven’t checked the internals of those functions, but it’s quite possible the firmware maintains a state rather than checking what the modem says.

        In that case, it would start considering (possibly incorrectly) that the modem is not attached.

        One option could be to perform the reset in all cases to make sure the firmware and modem are in sync?

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

          I think you're correct, seeing a register rather than the actual modem state. What complicates this issue further is that reading the register also seems to clear it. So that

          print('checking LTE')
          c='connected' if lte.isconnected() else 'not connected'; print('modem is', c)
          a='attached' if lte.isattached() else 'not attached'; print('modem is', a)
          a='attached' if lte.isattached() else 'not attached'; print('modem is', a)
          

          produces

          checking LTE
          modem is connected
          modem is attached
          modem is not attached
          
          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