Does LTE work in the USA?



  • I have the following code:

    def lte_attach():
        print("lte trying to attach")
        #lte.attach(band=13)
        lte.attach()
        while not lte.isattached():
            time.sleep(0.5)
            #print('Attaching...')
            print('Attaching...', end='')
            send_at_cmd_pretty('AT+CEREG?')         # get the System FSM
    
        print('**** lte attached ***********************')
        time.sleep(5)
    

    My output is simply:

    Attaching...
    +CEREG: 2,4
    
    OK
    
    Attaching...
    +CEREG: 2,4
    
    OK
    

    Sometimes, it will say CEREG: 2,0. I've rebooted the device, power cycled, and tried this on multiple days and its the same result. A few months ago, this same code actually worked. Nothing has changed on my end. Although at that time, I had to run this code for long periods of time before it would actually connect. I thought I was in the same situation now, but it has never resolved.



  • This last FSM report seems to have connected perfectly fine? The last message:

    [(2, 1, 0, '', ('18.195.176.111', 80))]
    

    Is the output of the socket.getaddrinfo() meaning the modem is able to do DNS lookup!
    Best,
    Gijs



  • Just to confirm this lockup has happened more than once.

    +--------------------------+--------------------+
    |            FSM           |        STATE       |
    +--------------------------+--------------------+
    | RRC TOP FSM              |CONNECTED           |
    | RRC SEARCH FSM           |CAMPED              |
    | RRC ACTIVE FSM           |CONNECTED           |
    | PMM PLMN FSM             |NORM_CAMPED         |
    | EMM MAIN FSM             |REGISTERED_INIT     |
    | EMM AUTH FSM             |KASME_DEFINED       |
    | EMM CONN FSM             |AS_ESTABLISHED      |
    | EMM TAU FSM              |NULL                |
    | EMM TEST FSM             |NULL                |
    | ESM BEARER FSM           |BEARER_NULL_PENDING_ACTIVE|
    | SMS MT FSM               |IDLE                |
    | SMS MO FSM               |IDLE                |
    | HP MAIN FSM              |IDLE                |
    | HP USIM FSM              |READY               |
    | HP SMS MO FSM            |IDLE                |
    | HP SMS MT FSM            |IDLE                |
    | HP CAT FSM               |IDLE                |
    +--------------------------+--------------------+


  • @Gijs As you suggested, I have tried the examples again. Here they are with my results.

    From https://docs.pycom.io/tutorials/networks/lte/

    Example One

    Changes from original are identified with # JFD

    def example_one():
        lte = LTE()
        lte.init()
        #some carriers have special requirements, check print(lte.send_at_cmd("AT+SQNCTM=?")) to see if your carrier is listed.
        #when using verizon, use 
        #lte.init(carrier=verizon)
        #when usint AT&T use, 
        #lte.init(carrier=at&t)
    
        #some carriers do not require an APN
        #also, check the band settings with your carrier
        #lte.attach(band=20, apn="your apn") 
        lte.attach()  #JFD Unknown 
            print("attaching..",end='')
        # JFD while not lte.isattached()
        while not lte.isattached():
            # JFD time.delay(0.25)
            utime.sleep_ms(25)
            print('.',end='')
            print(lte.send_at_cmd('AT!="fsm"'))         # get the System FSM
        print("attached!")
    
        lte.connect()
        print("connecting [##",end='')
        while not lte.isconnected():
            # JFD time.sleep(0.25)
            utime.sleep_ms(250)
            print('#',end='')
            #print(lte.send_at_cmd('AT!="showphy"'))
            print(lte.send_at_cmd('AT!="fsm"'))
        print("] connected!")
    
        # JFD Add delay
        utime.sleep_ms(250)
    
        # JFD print(socket.getaddrinfo('pycom.io', 80))  
        print(usocket.getaddrinfo('pycom.io', 80))  
        lte.deinit()
        #now we can safely machine.deepsleep()
    

    The above code loops continously in the while not let.attached(): stanza. It has the following output:

    SYSTEM FSM
    ==========
        +--------------------------+--------------------+
        |            FSM           |        STATE       |
        +--------------------------+--------------------+
        | RRC TOP FSM              |SCANNING            |
        | RRC SEARCH FSM           |WAIT_RSSI           |
        | RRC ACTIVE FSM           |NULL                |
        | PMM PLMN FSM             |ANY_WAITCELL        |
        | 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                |
        | HP MAIN FSM              |IDLE                |
        | HP USIM FSM              |READY               |
        | HP SMS MO FSM            |IDLE                |
        | HP SMS MT FSM            |IDLE                |
        | HP CAT FSM               |IDLE                |
        +--------------------------+--------------------+
    
    OK
    

    Since this is a hologram code, I have also tried with the following modification to the example: lte.attach(apn="hologram") . In this case, it worked!!! (Possibly it also helped that during the time letting it run until lockup I also physically straightened the antenna fingers. They were curled so I put a sticky on each side of the fingers to hold straight.) The status settings are as below. In the all caps case, its the state when the code locked up.:

    • RRC TOP FSM: [CONNECTING], Scanning, Syncing, Camped, Camping,
    • RRC SEARCH FSM: [CAMPED], Wait RSSI, Wait Cell ID, Wait SIBX, Camped_Any,
    • RRC ACTIVE FSM: [Wait_SMC], Wait RSSI, Wait Cell ID, Wait SIBX, Camped_Any,
    • PMM PLMN FSM: [NORM CAMPED]
    • EMM MAIN FSM: [DEREG REGISTERING]
    • EMM AUTH FSM NULL
    • EMM CONN FSM [AS_ESTABLISHING]
    • EMM TAU FSM [NULL]
    • EMM TEST FSM [NULL]
    • ESM BEARER FSM [BEARER NULL PENDING ACTIVE]
    • SMS MT FSM [IDLE]
    • SMS MO FSM [IDLE]
    • HP MAIN FSM [IDLE]
    • HP USIM FSM [READY]
    • HP SMS NO FSM [IDLE]
    • HP SMS MT FSM [IDLE]
    • HP CAT FSM [IDLE]

    What are these settings? Any references for the ignorant? I'm guessing FSM is finite state machine and these are possible states.

    Afterwards, this happened at end.

    [(2, 1, 0, '', ('18.195.176.111', 80))]
    

    Many thanks.



  • Maybe check out the example here: https://docs.pycom.io/tutorials/networks/lte/. Below, there is some sort of guide on the attaching sequence. Let me know of your result!

    Best,
    Gijs



  • @jcaron

    Do you have good coverage in your area?
    

    The signal is poor.

    What SIM are you using?
    

    It was provided to me by someone else. I believe it is a hologram sim card.

    What service (CAT-M1 or NB-IoT)?
    

    You got me. I don't know what that means. I am using the example code from the website on a pyfi. This is all that I am doing:

    def lte_init():
        lte.reset()
        lte.init()
    
    def lte_attach():
        print("lte trying to attach")
        #lte.attach(band=13)
        lte.attach()
        while not lte.isattached():
            time.sleep(0.5)
            #print('Attaching...')
            print('Attaching...', end='')
            send_at_cmd_pretty('AT+CEREG?')         # get the System FSM
    
        print('**** lte attached ***********************')
        time.sleep(5)
    
    
    def lte_connect():
        print("lte trying to connect")
        #lte.connect(cid=3)
        lte.connect()
        while not lte.isconnected():
            time.sleep(0.5)
            print('Connecting...')
    
        # Now use sockets as usual...
        print('**** lte connected ***********************')
        time.sleep(5)
    
    def do_lte():
        lte_init()
        lte_attach()
        lte_connect()
    

    This code worked earlier. Maybe two months ago. I haven't really tested it or modified it since then.

    What antenna are you using?
    

    I don't know how to describe. It was provided to me. It appears to be this one:

    https://pycom.io/product/lte-m-antenna-kit/



  • @netskink Do you have good coverage in your area? What SIM are you using? What service (CAT-M1 or NB-IoT)? What antenna are you using? Is it connected to the right port?


Log in to reply
 

Pycom on Twitter