GPy LTE Modem does not respond



  • I've done what I can to search this issue and found plenty of posts regarding modems that won't connect or won't attach, but I'm pretty sure I'm not even getting that far. If I use the tutorial code (https://docs.pycom.io/tutorials/lte/cat-m1/) my program hangs on the lte.attach() line, it doesn't even get into the "while not lte.isattached()" line.

    I get the error: "ValueError: Modem did not respond!"

    Does this mean my antenna or the LTE pin on the Gpy is defective/fried?

    Thanks



  • @kjm

    Yep, LTE antenna. I finally got a connection to go through. Only thing I changed is to remove my lines specifying bands (4, 12, 13) so it may have been happier with another band.

    To anybody that finds this post down the road, this is what I added to the LTE example documentation code to get it to work:

    lte = LTE() 
    lte.send_at_cmd('AT^RESET')
    lte.send_at_cmd('AT+CFUN=0')
    lte.send_at_cmd('AT+CEREG=2')
    lte.send_at_cmd('AT!="clearscanconfig"')
    lte.send_at_cmd('AT+CGDCONT=1,"IP","hologram"')
    lte.send_at_cmd('AT+CFUN=1')
    lte.attach()
    


  • @nakovi And it definitely an lte antena not a wifi/loran antenna?



  • @kjm

    Ha yeah the antenna came from Pycom and is connected to the LTE socket (next to LED)

    I've let it run a while longer and seen: +CEREG 2,4 a few times (I understand it should say 2,5).

    Putting your mood line in there gives me a return of: mood +CPIN: READY

    Thanks for your help so far, I appreciate it.



  • @nakovi cereg=2 means 'not attached but trying to'. Do you get a '1' from either the at+cind? service availability indicator or the at+creg? registration indicator? If not lets see what mood your modem is in with

    mood=lte.send_at_cmd('at+cpin?').split('\r\n')[1]; print('mood', mood)
    

    Is your lte antenna of known provenance & connected to the correct socket (the one closest to the RGB led)?



  • @kjm

    Well I've graduated from the modem not responding to the modem not attaching. Progress?

    I've tried to follow some of what I found in: https://forum.pycom.io/topic/3021/gpy-with-hologram-io-sim but the thread kind of died without any resolution.

    AT+CEREG? and AT+CSQ commands in my not attached loop give me +CSQ: 26,99 and +CEREG 2,0 (not that I fully understand what those mean)

    Doesn't seem to make any difference if I let it run for 10 minutes as I've seen suggested. Just can't get it to attach. Hologram dashboard shows the SIM card as activated.

    Really wish there was some better documentation for this.



  • @kjm

    It's definitely the attach line, and no I've not successfully attached yet. My SIM provider is hologram. I just saw another post recommending your line, I'll stick that ahead of lte.attach and see what happens.



  • @nakovi So line 43 or 44 is lte.attach() ? What happens if you insert these 2 lines before it?

    simreg=lte.send_at_cmd('at+creg?').split(',')[1][:1]; print('sim reg =', simreg, end=' ')          
    service=lte.send_at_cmd('AT+cind?').split(': ')[1][2]; print('service =', service)
    

    Have you ever had an attachment? If no, do you have a first time setup line somewhere in your code? Something like

    lte.send_at_cmd('at+cgdcont=1, "IP", "your sim supplier"')
    


  • @securigy

    If I run this, I get the same issue:

    Attaching to LTE network Traceback (most recent call last):
    File "<stdin>", line 7, in <module>
    File "<stdin>", line 44, in getLTE
    ValueError: Modem did not respond!



  • @kjm

    Copying the response to that command below:

    Welcome to the SQN3330 firmware updater [1.2.6]
    GPy with firmware version 1.20.1.r2
    Your modem is in application mode. Here is the current version:
    UE5.0.0.0d
    LR5.1.1.0-43818

    IMEI: 354347099617737



  • @nakovi Does your modem respond to

    import sqnsupgrade; sqnsupgrade.info()
    


  • @nakovi I am using the following code and it works on FiPy. I am located on the West coast (USA) and every single time it picks up AT&T network although lately in some cases the attaching takes longer than it used to be... and sometimes too long... As you can see I commented out the AT code and it still works - you may try with and without it...

    to init LTE-M you call:

    lte = getLTE()
    print("getLTE returned lte: {}".format(lte))
    
    # Returns a network.LTE object with an active Internet connection.
    def getLTE():
    
        # If already used, the lte device will have an active connection.
        # If not, need to set up a new connection.
        if lte.isconnected():
            return lte
    
         # Modem does not connect successfully without first being reset.
        print("Resetting LTE modem ... ", end="")
        lte.send_at_cmd('AT^RESET')
        print("OK")
        time.sleep(1)
        #print(".\n")
    
        # From Pycom Documentation
        # https://docs.pycom.io/firmwareapi/pycom/network/lte/
        #
        # Fipy/GPy v1.0 ==> supports 6 bands only (3, 4, 12, 13, 20, 28)
        # Fipy/GPy v1.2 with Sequans modem Firmware (41xxx) ==> Supports Full range of 17 bands (1, 2, 3, 4, 5, 8, 12, 13, 14, 17, 18, 19, 20, 25, 26, 28, 66)
        # Fipy/GPy v1.2 with Sequans older modem Firmwares (39xxx)==> Supports 8 Bands (3, 4, 5, 8, 12, 13, 20, 28)
        #Fipy/GPy v1.2 with Sequans old modem Firmwares < (39xxx)==> Supports 6 Bands (3, 4, 12, 13, 20, 28)
        
        # This worked OK but not really necessary...
        # # While the configuration of the CGDCONT register survives resets,
        # # the other configurations don't. So just set them all up every time.
        # print("Configuring LTE ", end='')
        # lte.send_at_cmd('AT+CGDCONT=1,"IP","hologram"')  # Changed this from origninal
        # print(".", end='')
        # lte.send_at_cmd('AT!="RRC::addscanfreq band=4 dl-earfcn=9410"') # changed band from 28 to 4. I dont know what earfcn=9410 is;
        # print(".", end='')
        # lte.send_at_cmd('AT+CFUN=1')
        # print(" OK")
    
        # If correctly configured for carrier network, attach() should succeed.
        if not lte.isattached():
            print("Attaching to LTE network ", end='')
            lte.attach()
            while(True):
                if lte.isattached():
                    print(" OK")
                    break
                print('.', end='')
                time.sleep(1)
    
        # Once attached, connect() should succeed.
        if not lte.isconnected():
            print("Connecting to LTE network ", end='')
            try:
                lte.connect()
            except Exception as ex:
                print("Connecting to LTE-M network failed: {}".format(ex.args[0]))
    
            while(True):
                if lte.isconnected():
                    print(" OK")
                    break
                print('.', end='')
                time.sleep(1)
    
        # Once connect() succeeds, any call requiring Internet access will
        # use the active LTE connection.
     
        return lte
    
    # Clean disconnection of the LTE network is required for future
    # successful connections without a complete power cycle between.
    def endLTE():
    
        print("Disonnecting LTE ... ", end='')
        if lte.isconnected():
            lte.disconnect()
        print("OK")
        time.sleep(1)
        print("Detaching LTE ... ", end='')
        if lte.isattached():
            lte.dettach()
        print("OK")
        pycom.heartbeat(True)
    


  • Thanks securigy,

    I've updated the firmware for the expansion board, the gPy, and the modem (the modem actually shipped with a more recent firmware than Pycom has on their update page so it remained the same). The SIM card is in there haha, I triple checked while losing my mind that it was in the correct orientation.

    I'll check out some of the github code. It just seems from the error that the Gpy isn't able to talk to the modem at all, let alone attempt to find a network.



  • @nakovi Start with updating firmware on whatever expansion board you are using and then updating GPy firmware.
    If you past this stage then search this forum for AT commands for configuring the modem (although they in some cases - like mine - not really needed).
    Also, search the forum for a better examples of the CAT-M1 code and then download the latest code library from github. The working example is the one has functions like getLTE and endLTE.
    I did not hear on this forum the antenna problems...
    Also, make sure that you are using the right band. Did you remember to insert the SIM card? ;-)


Log in to reply
 

Pycom on Twitter