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

    CAT-M1 cannot Attached

    Scheduled Pinned Locked Moved GPy
    2 Posts 2 Posters 259 Views 3 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.
    • T Offline
      Terry666
      last edited by

      Device using: Gpy
      SIM card: Hologram

      I activated some hologram sim cards and test it on my Gpy but it cannot attach to the network. I test "at+cereg" in the loop of attaching, and the result is:

      ^EXIT: Assertion failed
      +SYSSTART
      +CEREG: 2,0
      

      I tested Gpy that can work perfectly with the newly activated sim card, and it can connect.
      But the same code on a new board with the same sim card, it cannot attach to the network. So I guess it is probably not the problem of sim cards.

      My lte connection code is

      lte.init()
      lte.send_at_cmd('AT+CFUN=0')
      lte.send_at_cmd('AT!="clearscanconfig"')
      print("Hologram use"+lte.send_at_cmd('at+cgdcont=1,"IP","hologram"'))
      lte.send_at_cmd('AT+CFUN=1')    
      while not lte.isattached():
             time.sleep(0.5)
             attachTimeout += 1
             print(lte.send_at_cmd('AT+CEREG?')[:-1], end='')
             if attachTimeout == 15:
                      print(" LTE Failed")
                      time.sleep(0.750)
                      #
                      # Shutdown the LTE system
                      if lte.isconnected:
                          lte.disconnect()
                          time.sleep(2)
                      if lte.isattached():
                          lte.dettach()
                          time.sleep(2)
                      lte.deinit(reset=True)
                      machine.reset()
              print("lte is attached")
      
              ##
              # Now we busy wait for the Internet connection
              print("Start to connect")
              lte.connect()
              connectTimeout = 0
              while not lte.isconnected():
                  time.sleep(1)
                  connectTimeout += 1
                  if connectTimeout == 15:
                      # pycom.rgbled(ucot.LED_RED)
                      time.sleep(0.750)
                      # pycom.rgbled(ucot.LED_BLACK)
                      print("lte is not connected")
      
                      #
                      # Shutdown the LTE system
                      lte_off()
                      
                      # #
                      # # Go to deepsleep for one tenth of a reporting interval
                      # pySense.setup_sleep((REPORTING_INTERVAL/10) * 60)
                      # pySense.go_to_sleep()
                      machine.reset()
                      time.sleep(1)
              print("lte is connected")
      

      Is there any problem of this usage or do I need to specially config anything?

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

        @Terry666 Can you try to set the timeout to a much larger value? For the first time, that may be needed.

        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