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 NB-IoT won't connect to T-Mobile NL

    Scheduled Pinned Locked Moved GPy
    8 Posts 2 Posters 162 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.
    • R Offline
      rfinkers
      last edited by

      Hello,

      My GPy won't attach to the t-mobile nb-iot network anymore.
      I'm running to following code:

      lte.attach(band=8, apn="cdp.iot.t-mobile.nl")
      

      Then I wait for lte.isattached() becomes True, but it doesn't.

      When I'm sending 'AT+SQNMONI=9', I'll get:

      '\r\n+SQNMONI: vodafone NL Cc:204 Nc:04 RSRP:-74.60 CINR:0.00 RSRQ:-11.10 TAC:12407 Id:36 EARFCN:6254 PWR:-55.72 PAGING:256\r\n\r\nOK\r\n'
      

      I'm expecting T-Mobile NL or "LMN ID: 20416 (20416 is T-Mobile NL - MCC - MNC)"
      Yesterday my project was working fine and sending battery status.
      Does someone has an solution for me?

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

        You can check your modem with m=lte.send_at_cmd('at+cpin?'); m=m.split('\r\n'); print(m), it should attach if m has READY or SYSSTART in it

        1 Reply Last reply Reply Quote 0
        • R Offline
          rfinkers
          last edited by

          The response is:

          ['', '+CPIN: READY', '', 'OK', '']
          

          It still won't attach...

          1 Reply Last reply Reply Quote 0
          • R Offline
            rfinkers
            last edited by

            The following code will give this output.

            
            import os
            from network import LTE
            import usocket
            import time
            
            
            def send_at_cmd_pretty(cmd):
                response = lte.send_at_cmd(cmd).split('\r\n')
                print('Sent to modem: \'{}\''.format(cmd))
                for line in response:
                    if line.strip() != '':
                        print(line)
            
            
            # Print module details
            un = os.uname()
            print('Sysname:', un.sysname)
            print('Release:', un.release)
            print('Version:', un.version)
            print('Machine:', un.machine)
            
            # Initialize LTE object
            lte = LTE()
            time.sleep(5)
            
            # Pre attaching debugging
            print('Query LTE modem imei...', lte.imei()[:5] + '*' * 10)
            print('Query SIM iccid...', lte.iccid()[:5] + '*' * 15)
            send_at_cmd_pretty('ATI1')
            send_at_cmd_pretty('AT!="showver"')
            send_at_cmd_pretty('AT!="RRC:setDbgPerm full"')
            send_at_cmd_pretty('AT!="RRC:showcaps"')
            time.sleep(5)
            send_at_cmd_pretty('AT+SQNCTM?')
            
            # Attach LTE
            print('LTE attaching...')
            lte.attach(band=8, apn="cdp.iot.t-mobile.nl")
            attempts = 0
            while not lte.isattached():
                time.sleep(5)
                attempts = attempts + 1
                print('Attaching...', attempts)
                if attempts % 15 == 0:
                    send_at_cmd_pretty('AT+SQNMONI=9')
                    send_at_cmd_pretty('AT+CEREG?')
                    send_at_cmd_pretty('AT+CFUN?')
                    send_at_cmd_pretty('AT+CSQ')
                    send_at_cmd_pretty('AT!="showphy"')
                    send_at_cmd_pretty('AT!="fsm"')
            print('LTE attach succeeded!')
            
            # Debug attached state
            send_at_cmd_pretty('AT+CEREG?')
            send_at_cmd_pretty('AT+SQNMONI=9')
            send_at_cmd_pretty('AT+CSQ')
            send_at_cmd_pretty('AT!="showphy"')
            send_at_cmd_pretty('AT!="fsm"')
            send_at_cmd_pretty('AT+CGPADDR')
            send_at_cmd_pretty('AT+PING="172.27.131.100"', delay=5000)
            
            # Connect LTE
            lte.connect()
            attempts = 0
            while not lte.isconnected():
                time.sleep(5)
                attempts = attempts + 1
                print('Connecting...', attempts)
            print('LTE connection succeeded!')
            
            # Test DNS
            try:
                usocket.dnsserver(0, '8.8.8.8')
                usocket.dnsserver(1, '1.1.1.1')
                usocket.dnsserver()
                print(usocket.getaddrinfo('www.google.com', 80)[0][-1])
            except Exception:
                print('DNS over NB-IoT failed...')
            
            # Send message to dashboard
            s = usocket.socket(usocket.AF_INET, usocket.SOCK_DGRAM)
            s.setsockopt(usocket.SOL_SOCKET, usocket.SO_REUSEADDR, 1)
            # s.settimeout(5)
            # s.setblocking(False)
            s.sendto(bytearray('Hello World!'), ('172.27.131.100', 15683))
            s.close()
            
            # Shutdown LTE
            print("Disonnecting LTE ... ")
            lte.disconnect()
            print("Detaching LTE ... ")
            lte.dettach()
            print("Shuttting down LTE...")
            lte.deinit()
            
            

            Output:

            Sysname: GPy
            Release: 1.20.2.rc6
            Version: v1.11-01f49f7 on 2020-02-28
            Machine: GPy with ESP32
            Query LTE modem imei... 35434**********
            Query SIM iccid... 89882***************
            Sent to modem: 'ATI1'
            UE6.0.0.0
            LR6.0.0.0-41019
            OK
            Sent to modem: 'AT!="showver"'
            SYSTEM VERSION
            ==============
              FIRMWARE VERSION
                Bootloader0  : 5.1.1.0 [39529]
                Bootloader1* : 6.0.0.0 [41019]
                Bootloader2  : NA
                NV Info      : 1.1,0,0
                Software     : 6.0.0.0 [41019] by robot-soft at 2018-12-13 21:41:15
                UE           : 6.0.0.0
              COMPONENTS
                ZSP0         : 1.0.99-3171
                ZSP1         : 1.0.98-3170
            OK
            Sent to modem: 'AT!="RRC:setDbgPerm full"'
            OK
            Sent to modem: 'AT!="RRC:showcaps"'
            == CAPS config =============================
              .Lock UE on SRV band    : false
              .MFBI support           : true
              .TM8 TDD support        : false
            ============================================
            == CAPS ====================================
              . access stratum: R13
              . catM          : 1
              . nb-IoT        : 1
            -- EUTRA bands --
              . supported     : 66/28/26/25/20/19/18/17/14/13/12/8/5/4/3/2/1
              . board         : 1/2/3/4/5/8/12/13/14/17/18/19/20/25/26/28/66
              . admin         : 
              . pending admin : 
            -- EUTRA carriers --
              . admin         : 
              . pending admin : 
            ============================================
            OK
            Sent to modem: 'AT+SQNCTM?'
            +SQNCTM: standard
            OK
            LTE attaching...
            Attaching... 1
            Attaching... 2
            Attaching... 3
            Attaching... 4
            Attaching... 5
            Attaching... 6
            Attaching... 7
            Attaching... 8
            Attaching... 9
            Attaching... 10
            Attaching... 11
            Attaching... 12
            Attaching... 13
            Attaching... 14
            Attaching... 15
            Sent to modem: 'AT+SQNMONI=9'
            +SQNMONI: 20416 Cc:204 Nc:16 RSRP:-84.80 CINR:0.00 RSRQ:-11.70 TAC:1552 Id:97 EARFCN:3747 PWR:-65.32 PAGING:1024
            OK
            Sent to modem: 'AT+CEREG?'
            +CEREG: 2,0
            OK
            Sent to modem: 'AT+CFUN?'
            +CFUN: 1
            OK
            Sent to modem: 'AT+CSQ'
            +CSQ: 23,99
            OK
            Sent to modem: 'AT!="showphy"'
            DL SYNCHRO STATISTICS
            =====================
                Synchro state                         : CELL_ACQUIRED
                PPU SIB1 ACQ watchdog                 : 0
                Frequency Hypothesis RF  (Hz)         : 0
                RSRP (dBm)                            : -84.63
                RSRQ  (dB)                            : -11.64
                Channel estimation state (Cell-spec.) : HIGH CINR
                Channel estimation state (UE-spec.)   : LOW CINR
                Channel estimation state (MBSFN)      : LOW CINR
                Channel estimation CINR               : 8.65
                Channel length                        : SHORT
              AGC
                AGC RX gain (dB)                      : 46.39
                RX PSD BO (dBFs)                      : -20.92
                RX PSD (dBm)                          : -87.20
                Noise level RS (dBm)                  : -92.59
                Digital gain (dB)                     : 4.30
                CINR RS (dB)                          : 7.96
              NARROWBANDS
                Last DL NB                            : Central
                Last UL NB                            : 0
              AFC
                Frequency offset RF  (Hz)             : -1286
                Frequency offset BB  (Hz)             : 0
              PBCH
                MIB received quantity                 : 0
                MIB timeout quantity                  : 0
            OK
            Sent to modem: 'AT!="fsm"'
            SYSTEM FSM
            ==========
                +--------------------------+--------------------+
                |            FSM           |        STATE       |
                +--------------------------+--------------------+
                | RRC TOP FSM              |CAMPED              |
                | RRC SEARCH FSM           |CAMPED_ANY          |
                | RRC ACTIVE FSM           |IDLE                |
                | PMM PLMN FSM             |ANY_CAMPED          |
                | EMM MAIN FSM             |NULL                |
                | EMM AUTH FSM             |NULL                |
                | EMM CONN FSM             |NULL                |
                | EMM TAU FSM              |NULL                |
                | EMM TEST FSM             |NULL                |
                | ESM BEARER FSM           |BEARER_NULL         |
                | SMS MT FSM               |IDLE                |
                | SMS MO FSM               |IDLE                |
                | LPP FSM                  |IDLE                |
                | HP MAIN FSM              |IDLE                |
                | HP USIM FSM              |READY               |
                | HP SMS MO FSM            |IDLE                |
                | HP SMS MT FSM            |IDLE                |
                | HP CAT FSM               |IDLE                |
                +--------------------------+--------------------+
            OK
            Attaching... 16
            etc
            
            K 1 Reply Last reply Reply Quote 0
            • K Offline
              kjm @rfinkers
              last edited by

              @rfinkers Unreal!

              1. Are you sure the sim is current?
              2. What does it say for sim=lte.send_at_cmd('at+creg?').split(',')[1][:1]; ser=lte.send_at_cmd('AT+cind?').split(': ')[1][2]; print('simreg =', sim, 'service =', ser)
              R 1 Reply Last reply Reply Quote 0
              • R Offline
                rfinkers @kjm
                last edited by

                @kjm Thnx for your support.

                The sim was working properly, but I start to doubt it.
                I get the following response:
                simreg = 0 service = 0

                I'll also contact T-mobile if they know a solution.

                1 Reply Last reply Reply Quote 0
                • R Offline
                  rfinkers
                  last edited by

                  Okay, my problem is fixed.

                  I flashed the sequans modem again and I tested my code again. But it was still not working.

                  I wiggled the cable of the antenna a bit and it connected to the network!
                  I think the antenna of my gpy wasn't connected properly or the antenna cable is broken or something.

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

                    @rfinkers We had a similar problem last week with an sma to ipx adapter cable. Inspection with a magnifying glass showed one of the bifurcated connectors in the ipx plug that mates with the centre pin of the gpy lte antenna socket was missing leading to intermittent lte reliability. Those miniature RF connectors are not well suited to the repeated plug/unplug cycles typical of development work.

                    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