CAT-M1 cannot Attached
-
Device using: Gpy
SIM card: HologramI 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?
-
@Terry666 Can you try to set the timeout to a much larger value? For the first time, that may be needed.