T-Mobile NB-IoT in the Netherlands? [SOLVED]



  • Has anyone gotten T-Mobile NB-IoT in the Netherlands working on FiPy or GPy?

    I have updated my GPy to version 1.18.1.r7 and the LTE modem to version NB1-40343.



  • OK. So my GPy's hardware was to blame. (Link)

    Since I also have a more recent FiPy I upgraded that one to NB1 40343.

    Success! I can read the 'Hello World!' message on the T-Mobile Netherlands dashboard.

    If this code does not attach for you, check that the CAPS show that your band is supported. My GPy was missing band 8 and I have requested an RMA...

    Testing code:

    import os
    from network import LTE
    import usocket
    import time
    
    
    def send_at_cmd_pretty(cmd, delay=1000):
        response = lte.send_at_cmd(cmd, delay=delay).split('\r\n')
        print('Sent to modem: \'{}\', delay {} ms'.format(cmd, delay))
        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: FiPy
    Release: 1.20.0.rc7
    Version: v1.9.4-2833cf5 on 2019-02-08
    Machine: FiPy with ESP32
    Query LTE modem imei... 35434**********
    Query SIM iccid... 89882***************
    Sent to modem: 'ATI1', delay 1000 ms
    UE6.0.0.0
    LR6.0.0.0-40343
    OK
    Sent to modem: 'AT!="showver"', delay 1000 ms
    SYSTEM VERSION
    ==============
      FIRMWARE VERSION
        Bootloader0  : 5.1.1.0 [39529]
        Bootloader1* : 6.0.0.0 [40343]
        Bootloader2  : NA
        NV Info      : 1.1,0,0
        Software     : 6.0.0.0 [40343] by robot-soft at 2018-11-07 13:57:00
        UE           : 6.0.0.0
      COMPONENTS
        ZSP0         : 1.0.99-3171
        ZSP1         : 1.0.98-3170
    OK
    Sent to modem: 'AT!="RRC:setDbgPerm full"', delay 1000 ms
    OK
    Sent to modem: 'AT!="RRC:showcaps"', delay 1000 ms
    == 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     : 28/20/13/12/8/5/4/3
      . board         : 3/4/5/8/12/13/20/28
      . admin         : 
      . pending admin : 
    -- EUTRA carriers --
      . admin         : 
      . pending admin : 
    ============================================
    OK
    Sent to modem: 'AT+SQNCTM?', delay 1000 ms
    +SQNCTM: standard
    OK
    LTE attaching...
    Attaching... 1
    Attaching... 2
    LTE attach succeeded!
    Sent to modem: 'AT+CEREG?', delay 1000 ms
    +CEREG: 2,5,"04F5","00710C67",9
    OK
    Sent to modem: 'AT+SQNMONI=9', delay 1000 ms
    +SQNMONI: 20416 Cc:204 Nc:16 RSRP:-78.30 CINR:5.60 RSRQ:-12.00 TAC:1269 Id:287 EARFCN:3747 PWR:-58.52 PAGING:1024
    OK
    Sent to modem: 'AT+CSQ', delay 1000 ms
    +CSQ: 27,99
    OK
    Sent to modem: 'AT!="showphy"', delay 1000 ms
    DL SYNCHRO STATISTICS
    =====================
        Synchro state                         : CELL_ACQUIRED
        PPU SIB1 ACQ watchdog                 : 0
        Frequency Hypothesis RF  (Hz)         : 0
        RSRP (dBm)                            : -79.52
        RSRQ  (dB)                            : -12.22
        Channel estimation state (Cell-spec.) : LOW CINR
        Channel estimation state (UE-spec.)   : LOW CINR
        Channel estimation state (MBSFN)      : LOW CINR
        Channel estimation CINR               : 3.51
        Channel length                        : SHORT
      AGC
        AGC RX gain (dB)                      : 42.49
        RX PSD BO (dBFs)                      : -21.15
        RX PSD (dBm)                          : -81.08
        Noise level RS (dBm)                  : -83.83
        Digital gain (dB)                     : 1.85
        CINR RS (dB)                          : 4.31
      NARROWBANDS
        Last DL NB                            : Central
        Last UL NB                            : 0
      AFC
        Frequency offset RF  (Hz)             : -737
        Frequency offset BB  (Hz)             : 0
      PBCH
        MIB received quantity                 : 0
        MIB timeout quantity                  : 0
    OK
    Sent to modem: 'AT!="fsm"', delay 1000 ms
    SYSTEM FSM
    ==========
        +--------------------------+--------------------+
        |            FSM           |        STATE       |
        +--------------------------+--------------------+
        | RRC TOP FSM              |CONNECTED           |
        | RRC SEARCH FSM           |CAMPED              |
        | RRC ACTIVE FSM           |CONNECTED           |
        | PMM PLMN FSM             |NORM_CAMPED         |
        | EMM MAIN FSM             |REGISTERED          |
        | EMM AUTH FSM             |KASME_DEFINED       |
        | EMM CONN FSM             |EMM_CONNECTED       |
        | EMM TAU FSM              |NULL                |
        | EMM TEST FSM             |NULL                |
        | ESM BEARER FSM           |BEARER_ACTIVE       |
        | 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
    Sent to modem: 'AT+CGPADDR', delay 1000 ms
    +CGPADDR: 1,"10.0.1.100"
    OK
    Sent to modem: 'AT+PING="172.27.131.100"', delay 5000 ms
    +PING: 1,172.27.131.100,360,253
    LTE connection succeeded!
    DNS over NB-IoT failed...
    Disonnecting LTE ... 
    Detaching LTE ... 
    Shuttting down LTE...
    
    Pycom MicroPython 1.20.0.rc7 [v1.9.4-2833cf5] on 2019-02-08; FiPy with ESP32
    Type "help()" for more information.
    


  • Still never attaching...

    Added suggested commands 'AT+SQNCTM?', 'AT+SQNMONI=9', 'AT+CEREG?', 'AT+CFUN?' by @Xykon in threads 'Modem's radio showphy, all zeros, is bad?' and 'FiPy LTE not connecting after Upgrade Firmware'.

    This is my latest test code:

    import os
    from network import LTE
    import time
    
    def send_at_cmd_pretty(cmd, delay=1000):
        response = lte.send_at_cmd(cmd, delay=delay).split('\r\n')
        print('Sent to modem: \'{}\', delay {} ms'.format(cmd, delay))
        for line in response:
            if line.strip() != '':
                print(line)
    
    un = os.uname()
    print('Sysname:', un.sysname);
    print('Release:', un.release);
    print('Version:', un.version);
    print('Machine:', un.machine);
    
    lte = LTE()
    time.sleep(5)
    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"')
    time.sleep(5)
    send_at_cmd_pretty('AT+SQNCTM?')
    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 % 5 == 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!')
    lte.connect()
    attempts = 0
    while not lte.isconnected():
        time.sleep(5)
        attempts = attempts + 1
        print('Connecting...', attempts)
    print('LTE connection succeeded!')
    
    time.sleep(30)
    
    print("Disonnecting LTE ... ")
    lte.disconnect()
    print("Detaching LTE ... ")
    lte.dettach()
    print("Shuttting down LTE...")
    lte.deinit()
    

    This is the output that it generates:

    Sysname: GPy
    Release: 1.20.0.rc4
    Version: v1.9.4-1444e48 on 2019-01-07
    Machine: GPy with ESP32
    
    Query LTE modem imei... 35434**********
    Query SIM iccid... 89882***************
    Sent to modem: 'ATI1', delay 1000 ms
    UE6.0.0.0
    LR6.0.0.0-40343
    OK
    Sent to modem: 'AT!="showver"', delay 1000 ms
    SYSTEM VERSION
    ==============
      FIRMWARE VERSION
        Bootloader0  : 5.1.1.0 [33080]
        Bootloader1  : 6.0.0.0 [40343]
        Bootloader2* : 5.1.1.0 [38638]
        NV Info      : 1.1,0,0
        Software     : 6.0.0.0 [40343] by robot-soft at 2018-11-07 13:57:00
        UE           : 6.0.0.0
      COMPONENTS
        ZSP0         : 1.0.99-3171
        ZSP1         : 1.0.98-3170
    OK
    Sent to modem: 'AT+SQNCTM?', delay 1000 ms
    +SQNCTM: standard
    OK
    LTE attaching...
    Attaching... 1
    Attaching... 2
    Attaching... 3
    Attaching... 4
    Attaching... 5
    Sent to modem: 'AT+SQNMONI=9', delay 1000 ms
    ERROR
    Sent to modem: 'AT+CEREG?', delay 1000 ms
    +CEREG: 2,0
    OK
    Sent to modem: 'AT+CFUN?', delay 1000 ms
    +CFUN: 1
    OK
    Sent to modem: 'AT+CSQ', delay 1000 ms
    +CSQ: 99,99
    OK
    Sent to modem: 'AT!="showphy"', delay 1000 ms
    DL SYNCHRO STATISTICS
    =====================
        Synchro state                         : OFF
        PPU SIB1 ACQ watchdog                 : 0
        Frequency Hypothesis RF  (Hz)         : 0
        RSRP (dBm)                            : -21474836.00
        RSRQ  (dB)                            : -15.21
        Channel estimation state (Cell-spec.) : LOW CINR
        Channel estimation state (UE-spec.)   : LOW CINR
        Channel estimation state (MBSFN)      : LOW CINR
        Channel estimation CINR               : 0.08
        Channel length                        : SHORT
      AGC
        AGC RX gain (dB)                      : 38.56
        RX PSD BO (dBFs)                      : -19.87
        RX PSD (dBm)                          : -77.16
        Noise level RS (dBm)                  : -76.63
        Digital gain (dB)                     : 3.14
        CINR RS (dB)                          : -3.17
      NARROWBANDS
        Last DL NB                            : Central
        Last UL NB                            : 0
      AFC
        Frequency offset RF  (Hz)             : 2061
        Frequency offset BB  (Hz)             : 0
      PBCH
        MIB received quantity                 : 0
        MIB timeout quantity                  : 0
    OK
    Sent to modem: 'AT!="fsm"', delay 1000 ms
    SYSTEM FSM
    ==========
        +--------------------------+--------------------+
        |            FSM           |        STATE       |
        +--------------------------+--------------------+
        | RRC TOP FSM              |INITIAL             |
        | RRC SEARCH FSM           |INITIAL             |
        | RRC ACTIVE FSM           |NULL                |
        | PMM PLMN FSM             |PARKING             |
        | 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... 6
    Attaching... 7
    Attaching... 8
    Attaching... 9
    Attaching... 10
    Sent to modem: 'AT+SQNMONI=9', delay 1000 ms
    +SQNMONI: Cc: Nc: RSRP:-1 CINR:-1 RSRQ:-1 TAC:11811 Id:226 EARFCN:6290 PWR:-1 PAGING:256
    OK
    Sent to modem: 'AT+CEREG?', delay 1000 ms
    +CEREG: 2,0
    OK
    Sent to modem: 'AT+CFUN?', delay 1000 ms
    +CFUN: 1
    OK
    Sent to modem: 'AT+CSQ', delay 1000 ms
    +CSQ: 27,99
    OK
    Sent to modem: 'AT!="showphy"', delay 1000 ms
    DL SYNCHRO STATISTICS
    =====================
        Synchro state                         : DRX_SLEEP
        PPU SIB1 ACQ watchdog                 : 0
        Frequency Hypothesis RF  (Hz)         : 0
        RSRP (dBm)                            : -76.21
        RSRQ  (dB)                            : -11.07
        Channel estimation state (Cell-spec.) : HIGH CINR
        Channel estimation state (UE-spec.)   : LOW CINR
        Channel estimation state (MBSFN)      : LOW CINR
        Channel estimation CINR               : 10.64
        Channel length                        : SHORT
      AGC
        AGC RX gain (dB)                      : 44.69
        RX PSD BO (dBFs)                      : -27.27
        RX PSD (dBm)                          : -82.46
        Noise level RS (dBm)                  : -88.05
        Digital gain (dB)                     : 1.18
        CINR RS (dB)                          : 11.84
      NARROWBANDS
        Last DL NB                            : Central
        Last UL NB                            : 0
      AFC
        Frequency offset RF  (Hz)             : -467
        Frequency offset BB  (Hz)             : 0
      PBCH
        MIB received quantity                 : 0
        MIB timeout quantity                  : 0
    OK
    Sent to modem: 'AT!="fsm"', delay 1000 ms
    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... 11
    Attaching... 12
    Attaching... 13
    Attaching... 14
    ...
    

    Does the new output make sense to anyone and does anyone have suggestions what to try next?



  • Hello @paul-thornton,

    It is failing to attach. Functions lte.imei() and lte.iccid() return sensible values. AT+CSQ returns 27,99.

    >>> import sqnsupgrade
    >>> sqnsupgrade.info()
    <<< Welcome to the SQN3330 firmware updater [1.2.1] >>> 
    >>> GPy with firmware version 1.20.0.rc4
    Your modem is in application mode. Here is the current version:
    UE6.0.0.0
    LR6.0.0.0-40343
    

    My test code:

    import os
    from network import LTE
    import time
    
    lte = None
    
    def get_LTE():
        global lte
        if lte == None:
            lte = LTE()
        if lte.isconnected():
            return True
        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)
        print('LTE attach succeeded!')
        lte.connect()
        attempts = 0
        while not lte.isconnected():
            time.sleep(5)
            attempts = attempts + 1
            print('Connecting...', attempts)
        print('LTE connection succeeded!')
        return True
    
    def end_LTE():
        global lte
        if lte == None:
            return
        print("Disonnecting LTE ... ")
        lte.disconnect()
        print("Detaching LTE ... ")
        lte.dettach()
        print("Shuttting down LTE...")
        lte.deinit()
        lte = None
    
    def test_LTE():
        os.uname()
        get_LTE()
        time.sleep(60)
        end_lte()
    
    if __name__ == "__main__":
        test_LTE()
    

    After more than an hour it is still not attached.

    The T-Mobile Netherlands IoT page only describes how to connect other platforms. (Link).

    What can I try next?



  • Hey.

    What issue are you having? Is it failing to attach, or attaching but failing to make any external connections?



Pycom on Twitter