Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Sqnsupgrade via UART fails on FiPy: object 'LTE' has no attribute 'modem_upgrade_mode' #72

Open
pirate opened this issue Sep 2, 2018 · 6 comments
Labels
bug Something isn't working LTE question Further information is requested

Comments

@pirate
Copy link

pirate commented Sep 2, 2018

I'm trying to get my FiPy to work with the Hologram SIM card in Canada. I've tested the SIM in my iPhone and it works fine, it hops around between networks for a few min but eventually successfully joins ROGERS and receives SMS and data over LTE. However, when I put the SIM in my FiPy and try connecting I just get the following on repeat, and it never manages to attach:

modem command: AT+CEREG?
response=['+CEREG: 2,0', 'OK']
tac=0
modem command: AT+CSQ
response=['+CSQ: 99,99', 'OK']
not attached: 5 secs

...many seconds later...

modem command: AT+CEREG?
response=['+CEREG: 2,4', 'OK']
tac=4
modem command: AT+CSQ
response=['+CSQ: 99,99', 'OK']
not attached: 465 secs

In the process of trying to get it to work I'm attempting an SQNS upgrade, but hit this error while following these instructions: https://docs.pycom.io/tutorials/lte/firmware
(fyi there's also a broken link in those docs: https://github.com/pycom/pycom-libraries/lib/sqnsupgrade​ should be /tree/...)

Uploading project (main folder)...
Not safe booting, disabled in settings
Reading file status
[1/5] Writing file lib/sqnsbr.py
[2/5] Writing file lib/sqnscodec.py
[3/5] Writing file lib/sqnscrc.py
[4/5] Writing file lib/sqnstp.py
[5/5] Writing file lib/test_sd.py
Upload done, resetting board...
OKets Jun  8 2016 00:22:57

rst:0x7 (TG0WDT_SYS_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff8028,len:8
load:0x3fff8030,len:1728
load:0x4009fa00,len:0
load:0x4009fa00,len:14584
entry 0x400a059c
Pybytes library: v0.9.0
Preparing modem for upgrade...
Attempting AT wakeup...
Starting STP (DO NOT DISCONNECT POWER!!!)
Session opened: version 1, max transfer 8192 bytes
Sending 54854 bytes: [########################################] 100%
Bootrom updated successfully, switching to upgrade mode
Attempting AT auto-negotiation...
Going into MIRROR mode... please close this terminal to resume the upgrade via UART
Traceback (most recent call last):
  File "main.py", line 2, in <module>
  File "/flash/lib/sqnsupgrade.py", line 575, in uart
  File "/flash/lib/sqnsupgrade.py", line 503, in upgrade_uart
  File "/flash/lib/sqnsupgrade.py", line 309, in __run
  File "/flash/lib/sqnsupgrade.py", line 461, in uart_mirror
AttributeError: type object 'LTE' has no attribute 'modem_upgrade_mode'
Pycom MicroPython 1.18.0.r1 [v1.8.6-849-9569a73] on 2018-07-20; FiPy with ESP32
Type "help()" for more information.

After a power cycle it gets stuck here:

Your modem is in recovery mode. You will need to use updater.elf file to upgrade.
Preparing modem for upgrade...
Attempting AT auto-negotiation...

Attempting the computer side of the upgrade at this point fails as well:

>>> sqnsupgrade.run('/dev/tty.usbmodemPy1197bb', '/Users/squash/Downloads/CATM1-38638/CATM1-38638.dup', '/Users/squash/Downloads/CATM1-38638/updater.elf')
<<< Welcome to the SQN3330 firmware updater >>>
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/squash/Documents/Code/pycom/pycom-libraries/lib/sqnsupgrade/sqnsupgrade.py", line 585, in run
    sqnup.upgrade_ext(port, ffile, mfile, resume, debug, False)
  File "/Users/squash/Documents/Code/pycom/pycom-libraries/lib/sqnsupgrade/sqnsupgrade.py", line 515, in upgrade_ext
    success = self.__run(file_path=mfile, load_ffh=True, port=port, debug=debug, pkgdebug=pkgdebug)
  File "/Users/squash/Documents/Code/pycom/pycom-libraries/lib/sqnsupgrade/sqnsupgrade.py", line 271, in __run
    response = self.return_pretty_response(self.read_rsp(size=7))
  File "/Users/squash/Documents/Code/pycom/pycom-libraries/lib/sqnsupgrade/sqnsupgrade.py", line 81, in return_pretty_response
    lines = rsp.decode('ascii').split('\r\n')
UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0: ordinal not in range(128)
@danspndl
Copy link
Contributor

danspndl commented Sep 3, 2018

Hi @pirate 👋

Thanks for reporting the link, I've fixed it. Have you tried both (SD card and UART) methods? Just to confirm, your modem is not bricked, right?

@danspndl danspndl added the bug Something isn't working label Sep 3, 2018
@pirate
Copy link
Author

pirate commented Sep 5, 2018 via email

@GuilRies
Copy link

Same problem here.
Any luck?

@danspndl
Copy link
Contributor

Hi @pirate and @GuilRies 👋

Could you make sure that you use the stable firmware? The latest version is 1.18.1.r1. Let me know if that fixes your issue

@danspndl danspndl added the question Further information is requested label Sep 19, 2018
@danspndl danspndl self-assigned this Sep 19, 2018
@danspndl danspndl added the LTE label Sep 24, 2018
@firew0rks
Copy link

Using the latest firmware, as per @sdaniel55 suggestion worked. I upgraded my device using the Pycom Firmware Tool and upgraded the modem firmware using the UART method. I found that it only worked using the recovery method and referencing the updater.elf file on my computer instead of flashing it onto the device.

@pirate
Copy link
Author

pirate commented Oct 12, 2018

I wont have a chance to check this for another month or so (I'm traveling now), you're welcome to close it and I can reopen if I'm still having issues.

@danspndl danspndl removed their assignment Nov 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working LTE question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants