🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    ATOM-DTU-NB-IOT no connect to sim7020G Module

    SOFTWARE
    2
    7
    5.8k
    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.
    • R
      roadfox
      last edited by

      Hi
      I try to run the following code on a Atom-DTU NB-IOT

      from m5stack import *
      from m5ui import *
      from uiflow import *
      from base.DTU_NB import DTU_NB
      import time

      print('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?

      1 Reply Last reply Reply Quote 0
      • felmueF
        felmue
        last edited by

        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

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        1 Reply Last reply Reply Quote 0
        • R
          roadfox
          last edited by roadfox

          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

          1 Reply Last reply Reply Quote 0
          • felmueF
            felmue
            last edited by

            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

            GPIO translation table M5Stack / M5Core2
            Information about various M5Stack products.
            Code examples

            R 1 Reply Last reply Reply Quote 0
            • R
              roadfox @felmue
              last edited by

              @felmue
              thank you so much. was able to verify that the sim7020G is responding

              AT
              < AT
              9900
              < OK
              found

              so next to find a sim card which works...

              1 Reply Last reply Reply Quote 0
              • felmueF
                felmue
                last edited by

                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

                GPIO translation table M5Stack / M5Core2
                Information about various M5Stack products.
                Code examples

                1 Reply Last reply Reply Quote 0
                • felmueF
                  felmue
                  last edited by

                  Hello @roadfox

                  in case you are still looking for a suitable NB-IoT SIM card. I recently got one from Miotiq which works fine for me. See here for more detail.

                  Thanks
                  Felix

                  GPIO translation table M5Stack / M5Core2
                  Information about various M5Stack products.
                  Code examples

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post