Gpy + Pytrack - Modem won't attach after firmware upgrade



  • I successfully upgraded the Gpy firmware to the latest stable version 1.18.2.r7 using the Pycom Firmware Updater app for OS X.

    I then upgraded the modem firmware to CATM1-41065.

    I uploaded updater.elf to /flash

    On the Gpy I ran the following commands:

    >>> import sqnsupgrade
    >>> sqnsupgrade.uart(True,'/flash/updater.elf')
    <<< Welcome to the SQN3330 firmware updater [1.2.5] >>>
    >>> GPy with firmware version 1.18.2.r7
    Preparing modem for upgrade...
    FFH mode is not necessary... ignoring!
    Do not specify updater.elf when updating!
    Attempting AT wakeup...
    Going into MIRROR mode... please close this terminal to resume the upgrade via UART
    

    Closed Atom and ran the following commands from the terminal on my Mac:

    PBM:CATM1-41065 prs$ python3
    Python 3.7.3 (default, May  7 2019, 21:44:49) 
    [Clang 10.0.1 (clang-1001.0.46.4)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sqnsupgrade
    >>> sqnsupgrade.run('/dev/tty.usbmodemPy9254bb1', '/Users/prs/Desktop/CATM1-41065/CATM1-41065.dup', debug=True)
    <<< Welcome to the SQN3330 firmware updater [1.2.4] >>>
    File /Users/prs/Desktop/CATM1-41065/CATM1-41065.dup has size 6160982
    mirror? False  recover? False  resume? False  direct? False  atneg_only? False bootrom? False load_fff? True
    baudrate: 921600 target_baudrate: 921600
    Setting port /dev/tty.usbmodemPy9254bb1
    Setting baudrate to 921600
    Initial prepartion complete...
    Loading /Users/prs/Desktop/CATM1-41065/CATM1-41065.dup
    Firmware file is too big to load via FFF method. Using ON_THE_FLY
    Attempting AT wakeup...with baudrate 921600
    b''
    count=1
    b''
    count=2
    b''
    count=3
    b''
    count=4
    b''
    count=5
    b''
    count=6
    b''
    count=7
    b''
    count=8
    b''
    count=9
    b''
    count=10
    b''
    >>> 
    

    Nothing happened to I tried:

    >>> sqnsupgrade.run('/dev/tty.usbmodemPy9254bb1', '/Users/prs/Desktop/CATM1-41065/CATM1-41065.dup', '/Users/prs/Desktop/CATM1-41065/updater.elf', debug=True)
    <<< Welcome to the SQN3330 firmware updater [1.2.4] >>>
    File /Users/prs/Desktop/CATM1-41065/updater.elf has size 430284
    File /Users/prs/Desktop/CATM1-41065/CATM1-41065.dup has size 6160982
    mirror? False  recover? True  resume? True  direct? True  atneg_only? False bootrom? False load_fff? False
    baudrate: 921600 target_baudrate: 921600
    Setting port /dev/tty.usbmodemPy9254bb1
    Setting baudrate to 921600
    Initial prepartion complete...
    Loading /Users/prs/Desktop/CATM1-41065/updater.elf
    Entering recovery mode
    AT+SMOD? returned 
    Starting STP mode...
    Failed to start STP mode!
    PBM:CATM1-41065 prs$ 
    

    So then I tried:

    >>> import sqnsupgrade
    >>> sqnsupgrade.run('/dev/tty.usbmodemPy9254bb1', '/Users/prs/Desktop/CATM1-41065/upgdiff_39529-to-41065.dup')
    <<< Welcome to the SQN3330 firmware updater [1.2.4] >>>
    Attempting AT wakeup...
    ^CTraceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/Users/prs/Desktop/CATM1-41065/sqnsupgrade.py", line 1012, in run
        sqnup.upgrade_ext(port=port, ffile=ffile, mfile=mfile, resume=resume, debug=debug, pkgdebug=False, verbose=verbose, load_fff=load_fff)
      File "/Users/prs/Desktop/CATM1-41065/sqnsupgrade.py", line 889, in upgrade_ext
        if self.__run(file_path=ffile, resume=True if mfile is not None else resume, direct=False, port=port, debug=debug, pkgdebug=pkgdebug, verbose=verbose, load_fff=load_fff):
      File "/Users/prs/Desktop/CATM1-41065/sqnsupgrade.py", line 419, in __run
        if not self.wakeup_modem(baudrate, port, 10, 1, debug):
      File "/Users/prs/Desktop/CATM1-41065/sqnsupgrade.py", line 736, in wakeup_modem
        response = self.read_rsp(size=25)
      File "/Users/prs/Desktop/CATM1-41065/sqnsupgrade.py", line 81, in read_rsp
        time.sleep(0.001)
    KeyboardInterrupt
    >>> 
    

    Seemed frozen to I stopped it and tried:

    >>> sqnsupgrade.run('/dev/tty.usbmodemPy9254bb1', '/Users/prs/Desktop/CATM1-41065/upgdiff_39529-to-41065.dup', '/Users/prs/Desktop/CATM1-41065/updater.elf', debug=True)
    <<< Welcome to the SQN3330 firmware updater [1.2.4] >>>
    File /Users/prs/Desktop/CATM1-41065/updater.elf has size 430284
    File /Users/prs/Desktop/CATM1-41065/upgdiff_39529-to-41065.dup has size 455057
    mirror? False  recover? True  resume? True  direct? True  atneg_only? False bootrom? False load_fff? False
    baudrate: 921600 target_baudrate: 921600
    Setting port /dev/tty.usbmodemPy9254bb1
    Setting baudrate to 921600
    Initial prepartion complete...
    Loading /Users/prs/Desktop/CATM1-41065/updater.elf
    Entering recovery mode
    AT+SMOD? returned 
    Starting STP mode...
    Failed to start STP mode!
    PBM:CATM1-41065 prs$ 
    


  • Any update on this? I am receiving the same infinite LTE attach loop. I was once able to get things working by re-running the CATM1-41065.dup but the problem is back and running the modem firmware upgrade does not fix it. Any help is awesome!



  • @shaunix

    ordered 2 gpy that came in yesterday and 1 fipy. the fipy updated just the firmware and left the modem stock worked fine.
    the 2 gpy wouldnt connect with the same code as the fipy. so i updated to the same firware you did. I also wasnt able to connect and get all the same things you mention. just endless loop at the lte.attach()



  • Does any of this information help?

    >>> print(lte.send_at_cmd("ATI"))
    
    PYCOM
    FiPy
    UE5.0.0.0d
    
    OK
    
    >>> print(lte.send_at_cmd('AT!="showphy"'))
    
    DL SYNCHRO STATISTICS
    =====================
        Synchro state                         : OFF
        PPU SIB1 ACQ watchdog                 : 0
        Frequency Hypothesis RF  (Hz)         : 0
        RSRP (dBm)                            : 0.00
        RSRQ  (dB)                            : 0.00
        Channel estimation state (Cell-spec.) : LOW CINR
        Channel estimation state (UE-spec.)   : LOW CINR
        Channel estimation state (MBSFN)      : LOW CINR
        Channel estimation CINR               : 0.00
        Channel length                        : SHORT
      AGC
        AGC RX gain (dB)                      : 0.00
        RX PSD BO (dBFs)                      : 0.00
        RX PSD (dBm)                          : 0.00
        Noise level RS (dBm)                  : 0.00
        Digital gain (dB)                     : 0.00
        CINR RS (dB)                          : 0.00
      NARROWBANDS
        Last DL NB                            : 0
        Last UL NB                            : 0
      AFC
        Frequency offset RF  (Hz)             : 0
        Frequency offset BB  (Hz)             : 0
      PBCH
        MIB received quantity                 : 0
        MIB timeout quantity                  : 0
    
    OK
    
    >>> print(lte.send_at_cmd('AT!="fsm"'))
    
    SYSTEM FSM
    ==========
        +--------------------------+--------------------+
        |            FSM           |        STATE       |
        +--------------------------+--------------------+
        | RRC TOP FSM              |STOPPED             |
        | RRC SEARCH FSM           |NULL                |
        | RRC ACTIVE FSM           |NULL                |
        | PMM PLMN FSM             |NULL                |
        | 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              |NULL                |
        | HP USIM FSM              |NULL                |
        | HP SMS MO FSM            |IDLE                |
        | HP SMS MT FSM            |IDLE                |
        | HP CAT FSM               |NULL                |
        +--------------------------+--------------------+
    
    OK
    
    >>>
    

    The one thing that I noticed was:

    PYCOM
    FiPy
    UE5.0.0.0d
    

    Does it think my Gpy is a FiPy? Could that be the problem?

    Other info to note: I'm using Bell Canada and it worked flawlessly before I upgraded the firmware. Tried this on 2 different Gpy's and both are experiencing this issue.



  • >>> from network import LTE
    >>> lte = LTE()
    >>> lte.attach()
    >>> lte.connect()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OSError: modem not attached
    >>> lte.attach()
    >>> lte.connect()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OSError: modem not attached
    >>> lte.connect()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OSError: modem not attached
    >>> lte.connect()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OSError: LTE modem version not read
    >>> lte.connect()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OSError: modem not attached
    >>> lte.attach()
    >>> lte.connect()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OSError: modem not attached
    >>> lte.connect()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OSError: LTE modem version not read
    >>>
    


  • I managed to successfully update the Gpy firmware to the latest stable version 1.18.2.r7

    I also managed to successfully update the modem firmware to version CATM1-41065

    >>> import sqnsupgrade
    >>> sqnsupgrade.run('/dev/tty.usbmodemPy9254bb1', '/Users/prs/Desktop/CATM1-41065/CATM1-41065.dup', '/Users/prs/Desktop/CATM1-41065/updater.elf', debug=True)
    <<< Welcome to the SQN3330 firmware updater [1.2.5] >>>
    File /Users/prs/Desktop/CATM1-41065/updater.elf has size 430284
    File /Users/prs/Desktop/CATM1-41065/CATM1-41065.dup has size 6160982
    mirror? False  recover? True  resume? True  direct? True  atneg_only? False bootrom? False load_fff? False
    baudrate: 921600 target_baudrate: 921600
    Setting port /dev/tty.usbmodemPy9254bb1
    Setting baudrate to 921600
    Initial prepartion complete...
    Loading /Users/prs/Desktop/CATM1-41065/updater.elf
    Entering recovery mode
    AT+SMOD? returned 0
    Starting STP mode...
    Starting STP code upload
    running m.wipe
    running m.reset
    magic=0x74736166, op=0x80, sid=0x0, plen=0x0, tid=0x0, hcrc=0x0, pcrc=0xFEEC
    Correct SRSP signature: 0x74736166
    running m.open_session
    Session opened: version 1, max transfer 2048 bytes
    running push(m)
    Sending 430284 bytes: [########################################] 100%
    running dev.set_timeout(2)
    running m.reset(True)
    Waiting for updater to load... [921600]
    b'\r\nOK\r\n'
    Upgrader loaded successfully, modem is in update mode
    mirror? False  recover? False  resume? True  direct? False  atneg_only? False bootrom? False load_fff? True
    baudrate: 921600 target_baudrate: 921600
    Setting port /dev/tty.usbmodemPy9254bb1
    Setting baudrate to 921600
    Initial prepartion complete...
    Loading /Users/prs/Desktop/CATM1-41065/CATM1-41065.dup
    Firmware file is too big to load via FFF method. Using ON_THE_FLY
    Attempting AT wakeup... [921600]
    b'\r\nOK\r\n'
    Entering recovery mode
    AT+SMOD? returned 4
    Starting STP ON_THE_FLY
    Sending AT+SMSTPU="ON_THE_FLY"
    Starting STP code upload
    running m.wipe
    running m.reset
    magic=0x74736166, op=0x80, sid=0x0, plen=0x0, tid=0x0, hcrc=0x0, pcrc=0x0
    Correct SRSP signature: 0x74736166
    running m.open_session
    Session opened: version 1, max transfer 8192 bytes
    running push(m)
    Sending 6160982 bytes: [########################################] 100%
    running dev.set_timeout(2)
    running m.reset(True)
    Code download done, returning to user mode
    Waiting for modem to finish the update...
    <<<=== DO NOT DISCONNECT POWER ===>>> [921600]
    b''
    count=1
    b'\r\nOK\r\n\r\nOK\r\n'
    AT+SMUPGRADE? returned b'+SMUPGRADE: success\r\n\r\nOK\r\n' [timeout: 0.4593789577484131]
    AT+SMSWBOOT? returned b'FFH\r\nOK\r\n'
    AT+SMUPGRADE? returned b'+SMUPGRADE: success\r\n\r\nOK\r\n'
    This is my result: success
    Resetting.AT+SMSWBOOT=1,1 returned b'+SMUPGRADE: success\r\n\r\nOK\r\n'
    ......................
    Sending AT+SQNSUPGRADENTF="success"
    AT+SQNSUPGRADENTF="success" returned b'\r\nOK'
    Sending AT+FSRDFILE="/fs/crashdump"
    AT+FSRDFILE="/fs/crashdump" returned b'\r\nOK'
    Your modem has been successfully updated.
    Here is the current firmware version:
    
    mirror? False  recover? False  resume? True  direct? True  atneg_only? False bootrom? False load_fff? False
    baudrate: 921600 target_baudrate: 921600
    Setting port /dev/tty.usbmodemPy9254bb1
    Setting baudrate to 921600
    SYSTEM VERSION
    ==============
      FIRMWARE VERSION
        Bootloader0  : 5.1.1.0 [41065]
        Bootloader1* : 5.1.1.0 [41065]
        Bootloader2  : 5.1.1.0 [38638]
        NV Info      : 1.1,0,0
        Software     : 5.1.1.0 [41065] by robot-soft at 2018-12-17 13:03:40
        UE           : 5.0.0.0d
      COMPONENTS
        ZSP0         : 1.0.99-13616
        ZSP1         : 1.0.99-12376
    
    IMEI: 354347091745387
    >>> quit()
    PBM:CATM1-41065 prs$ 
    

    But it still won't attach.

    import time
    from network import LTE
    lte = LTE()
    lte.attach() 
    while not lte.isattached():
        time.sleep(0.25)
    

    Loops forever...



  • Did a hard reset and now back to square one

    >>> from network import LTE
    >>> lte = LTE()
    >>> lte.attach()
    >>> lte.connect()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OSError: modem not attached
    >>> lte.attach()
    >>> lte.connect()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OSError: modem not attached
    >>>
    

    So I tried to downgrade the modem again.

    >>> import sqnsupgrade
    >>> sqnsupgrade.run('/dev/tty.usbmodemPy8ac71d1', '/Users/prs/Desktop/CATM1-39529/CATM1-39529.dup')
    <<< Welcome to the SQN3330 firmware updater [1.2.4] >>>
    Firmware file is too big to load via FFF method. Using ON_THE_FLY
    Attempting AT wakeup...
    Session opened: version 1, max transfer 8192 bytes
    Sending 6059510 bytes: [########################################] 100%
    Waiting for modem to finish the update...
    <<<=== DO NOT DISCONNECT POWER ===>>>
    Resetting.................
    Your modem has been successfully updated.
    Here is the current firmware version:
    
    UE5.0.0.0d
    LR5.1.1.0-39529
    
    IMEI: 
    ERROR
    354347099436476
    >>> 
    

    But still...modem won't attach.



  • I decided to upgrade to the latest development release version 1.20.0.rc11

    After that I was able to update the modem firmware successfully:

    PBM:CATM1-41065 prs$ python3
    Python 3.7.3 (default, May  7 2019, 21:44:49) 
    [Clang 10.0.1 (clang-1001.0.46.4)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sqnsupgrade
    >>> sqnsupgrade.run('/dev/tty.usbmodemPy8ac71d1', '/Users/prs/Desktop/CATM1-41065/CATM1-41065.dup', debug=True)
    <<< Welcome to the SQN3330 firmware updater [1.2.4] >>>
    File /Users/prs/Desktop/CATM1-41065/CATM1-41065.dup has size 6160982
    mirror? False  recover? False  resume? False  direct? False  atneg_only? False bootrom? False load_fff? True
    baudrate: 921600 target_baudrate: 921600
    Setting port /dev/tty.usbmodemPy8ac71d1
    Setting baudrate to 921600
    Initial prepartion complete...
    Loading /Users/prs/Desktop/CATM1-41065/CATM1-41065.dup
    Firmware file is too big to load via FFF method. Using ON_THE_FLY
    Attempting AT wakeup...with baudrate 921600
    b'\r\nERROR\r\n'
    count=1
    b'\r\nOK\r\n'
    AT+BIND=AT returned b'\r\nOK\r\n'
    ATE0 returned b'\r\nOK\r\n'
    Entering upgrade mode...
    AT+SMOD? returned 2
    AT+SMSWBOOT=3,1 returned: b'\r\nOK\r\n'
    Response after reset: b'\x00'
    Starting STP ON_THE_FLY
    Sending AT+CFUN=4
    AT+CFUN=4 returned 2
    Sending AT+SMSTPU="ON_THE_FLY"
    Starting STP code upload
    running m.wipe
    running m.reset
    magic=0x74736166, op=0x80, sid=0x0, plen=0x0, tid=0x0, hcrc=0x0, pcrc=0x0
    Correct SRSP signature: 0x74736166
    running m.open_session
    Session opened: version 1, max transfer 8192 bytes
    running push(m)
    Sending 6160982 bytes: [########################################] 100%
    running dev.set_timeout(2)
    running m.reset(True)
    Code download done, returning to user mode
    Waiting for modem to finish the update...
    <<<=== DO NOT DISCONNECT POWER ===>>>with baudrate 921600
    b''
    count=1
    b'\r\nOK\r\n\r\nOK\r\n'
    AT+SMUPGRADE? returned b'+SMUPGRADE: success\r\n\r\nOK\r\n' [timeout: 0.21889209747314453]
    AT+SMSWBOOT? returned b'RECOVERY\r\nOK\r\n'
    AT+SMUPGRADE? returned b'+SMUPGRADE: success\r\n\r\nOK\r\n'
    This is my result: success
    Resetting.AT+SMSWBOOT=1,1 returned b'+SMUPGRADE: success\r\n\r\nOK\r\n'
    .........................
    Your modem has been successfully updated.
    Here is the current firmware version:
    
    mirror? False  recover? False  resume? True  direct? True  atneg_only? False bootrom? False load_fff? False
    baudrate: 921600 target_baudrate: 921600
    Setting port /dev/tty.usbmodemPy8ac71d1
    Setting baudrate to 921600
    SYSTEM VERSION
    ==============
      FIRMWARE VERSION
        Bootloader0  : 5.1.1.0 [41065]
        Bootloader1* : 5.1.1.0 [41065]
        Bootloader2  : 5.1.1.0 [41065]
        NV Info      : 1.1,0,0
        Software     : 5.1.1.0 [41065] by robot-soft at 2018-12-17 13:03:40
        UE           : 5.0.0.0d
      COMPONENTS
        ZSP0         : 1.0.99-13616
        ZSP1         : 1.0.99-12376
    
    IMEI: 
    ERROR
    354347099436476
    >>> 
    

    But now I get:

    >>> import sqnsupgrade
    >>> sqnsupgrade.info()
    <<< Welcome to the SQN3330 firmware updater [1.2.5] >>>
    >>> GPy with firmware version 1.20.0.rc11
    Your modem is in application mode. Here is the current version:
    UE5.0.0.0d
    LR5.1.1.0-41065
    
    IMEI: 354347099436476
    >>> from network import LTE
    >>> lte = LTE()
    >>> lte.attach()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OSError: the requested operation failed
    >>> lte.attach()
    >>> lte.connect()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OSError: LTE modem version not read
    >>>
    


  • Pycom MicroPython 1.18.2.r7 [v1.8.6-849-df9f237] on 2019-05-14; GPy with ESP32
    Type "help()" for more information.
    >>> from network import LTE
    >>> lte = LTE()
    >>> lte.attach()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OSError: the requested operation failed
    >>> lte.attach()
    >>> lte.connect()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OSError: modem not attached
    >>>
    

    I tried downgrading back to CATM1-39529 but that didn't work.


Log in to reply
 

Pycom on Twitter