ATOM-DTU-NB-IOT no connect to sim7020G Module
-
Hi
I try to run the following code on a Atom-DTU NB-IOTfrom m5stack import *
from m5ui import *
from uiflow import *
from base.DTU_NB import DTU_NB
import timeprint('init module.....')
dtu_nb = DTU_NB()
print('dtu initialized.....')"dtu initialized..." is never printed, if i connect via usb/serial and enter ctrl-C i get the following output:
init module.....
Traceback (most recent call last):
File "main.py", line 30, in <module>
File "base/DTU_NB.py", line 31, in init
File "base/DTU_NB.py", line 42, in ischeck_IP
File "libs/simcom/common.py", line 265, in send_at_cmd
File "libs/simcom/common.py", line 274, in wait_at_cmd_ok
KeyboardInterrupt:
MicroPython d725c2ac8-dirty on 2022-10-13; M5Stack with ESP32
Type "help()" for more information.while i'm not shure if my sim card is working for nb-iot and not just for LTE, was hoping to be able to communicate with the sim7020G to get some information.
what could be wrong? -
Hello @roadfox
the Init NB-IoT DTU block (aka
dtu_nb = DTU_NB()
) executes the below conversation with the modem and if it doesn't get the proper responses repeats the commands forever.> ATE0 < OK > AT+CPIN? < +CPIN: READY < OK > AT+CGCONTRDP < +CGCONTRDP: 1,5,"myapn","10.10.10.84.255.255.255.0",,"10.10.20.210","10.10.20.211" < OK
So make sure that your SIM card doesn't have a PIN set and works for NB-IoT.
From my experience SIM cards for NB-IoT are different from SIM cards for smartphones.
Thanks
Felix -
Hi Felix
Thanks for the fast response!
I'm pretty sure it is the SIM, while pin is removed the card is probably not valid for NB-IOT. I can also not figure out how to get an NB-IOT compatible SIM card here in Switzerland, seems to be an "enterprise thing" :-(Before i return the Device and try with the Lora version, is there an easy way for me to test if communication with the sim7020G is ok, so setting up the correct serial and issue an AT command in mycropython by hand?
Tried to find the source code for base/DTU_NB.py but without success.
danke
Andi -
Hello @roadfox
I've put together an example which sends an AT command when the M5Atom button is pressed and then waits for the OK response or times out.
BTW: I am using an NB-IoT SIM card from IoT Creators - they offer a free testkit.
Thanks
Felix -
@felmue
thank you so much. was able to verify that the sim7020G is respondingAT
< AT
9900
< OK
foundso next to find a sim card which works...
-
Hello @roadfox
you are welcome. I am glad it worked for you.
Please let me know what you find regarding NB-IoT SIM card.
Thanks
Felix -