Downgrading firmware (advanced users)



  • Hello everyone,

    We’re creating this sticky post to give some feedback to the people that for any valid reason want to downgrade their firmware. You'll find two sections, one for versions higher than 1.0.0.b1, and the other for versions older than that. Each section includes notes on the procedure to follow.

    Important note: take into account that these older versions lack many features added in time, and they are also unsupported, so please only downgrade if you know what you're doing. For regular users we recommend sticking to the latest available version, that will be automatically installed by the tool available here.

    1.0.0.b1 and higher

    For versions higher than 1.0.0.b1 (inclusive), the upgrader directly fetches the latest available version, so sadly, the process to downgrade to these versions requires some manual work.

    You’ll need

    1. This version of the installer.
    2. A tar.gz file that contains a valid firmware upgrade (see links bellow).
    3. Python 2 with pyserial installed.
    4. Find out the name of the serial port you’ll be using:
      • Windows use a COM# (where # is a number)
      • MacOS will use something like /dev/tty.usbserial-XXXXXXXX (where XXXXXXXX is a value specific to your expansion board)
      • Linux will use something like /dev/ttyUSB# (where # is a number).

    Note: Users trying to upgrade without an expansion port may get different names.

    Steps

    1. Extract the downloaded installer into a temporary directory.
    2. Copy the firmware tar.gz file into that directory.
    3. Prepare the board as usual:
      a. Turn off your device.
      b. Connect a jumper cable between G23 and GND on the expansion board (see note bellow).
      c. Connect the expansion board to the computer using the USB cable.
    4. From the temporary directory, run: python bin/updater.py -t FIRMWARE_FILE_NAME.tar.gz -p SERIAL_PORT -s 921600 flash

    Note : Looking at the device with the LED on the top side, G23 is the 4th pin from top on the left side. GND is the 2nd pin from top on the right side.

    Firmware files

    Note: highest version can always be installed automatically with the installer.

    Before 1.0.0.b1

    Before version 1.0.0.b1 the upgrade tool and the firmware came as an integral package. You only need to download the one specific for your OS and follow the instructions in the screen. Here are the links:



  • To download higher firmware versions that are not present in the above list; use the below link with the firmware version of choice:

    https://software.pycom.io/downloads/LoPy_868-1.6.7.b1.tar.gz

    I am adding this here to keep downgrading related information in one place for future reference.



  • Updater Version 1.1.1 on LopY doesn't work anymore

    d:\Pycom>"c:\Program Files (x86)\Pycom\Pymakr\Python27\python.exe" pyupgrade/bin/updater.py -t 1.5.0.b1-LoPy_868.tar.gz -p COM14 -s 115200 flash
    Connecting...........................................
    Exception: Failed to connect to ESP32: Timed out waiting for packet header, on line 157



  • @PCA, just upgraded the original list up to the last release :)



  • @abilio Where can we find 1.4.0 and 1.5.1.b1 releases ?
    Thanks
    Pascal



  • Works fine here as well, with Windows 10.



  • @abilio
    The latest updater on Windows 7 worked for me.
    No more:
    Exception: Error -3 while decompressing: invalid literal/length code, on line 124



  • @toribios_people, @sakis, @Knoahlr, @livius, the problem for (up/downgrading) versions 1.0.0.b1 and higher under Windows should be fixed now.

    Can you please download the latest version of the tool, retry the procedure and post your feedbacks?



  • @toribios_people

    That could be the case (usage of VM). Thanks all for the testing, it seems that this is a Windows-specific issue. I'll report it to our firmware updater expert.



  • @sakis I have tried with linux through VirtualBox and I don't get that error any more, althought the flashing process is not very stable. Took me 6 attempts to get the WiPy flashed, on the other 5 I got this error at ramdom completion percentages:

    Writing at 0x0009400... (80%) Exception: Failed to write compressed data to flash after seq 33 (result was 0xc1, 0x0), on line 132

    Maybe the problem is beacuse of flashing it through a virtual machine.



  • i try downgrade my wipy to version 1.3.0.b1 but - on Windows 10 64 bit:

    C:\Program Files (x86)\Pycom\Pycom Firmware Update\Python27\pyupgrade>"C:\Program Files (x86)\Pycom\Pycom Firmware Update\Python27\python" "bin\updater.py" -t WiPy.tar.gz -p COM3
    Namespace(file=None, port='COM3', speed=115200, tar='WiPy.tar.gz')
    Connecting...
    Uploading stub...
    Running stub...
    Stub running...
    Changing baud rate to 115200
    Changed.
    Exception: Error -3 while decompressing: invalid stored block lengths, on line 131
    


  • @sakis seem to be getting the same error code as @toribios_people
    I`m also doing this from a windows machine.

    Namespace(file=None, port='COM7', speed=115200, tar='1.1.0.b1-WiPy.tar.gz')
    Connecting...
    Uploading stub...
    Running stub...
    Stub running...
    Changing baud rate to 115200
    Changed.
    Exception: Error -3 while decompressing: invalid literal/length code, on line 124



  • @toribios_people

    It could be a corrupted file, a Windows-specific issue, or something else...

    I just downgraded from the latest version (1.4.0.b1) to 1.1.0.b1 on macOS and it worked flawlessly.

    I'd advice you to retry and if it still fails try doing it on Linux to see if it's Windows-specific. That way we can try to resolve it.



  • Trying to downgrade on windows I get the following error, any idea why? Thanks.

    C:\pyupgrade>c:\python27\python bin\updater.py -t 1.2.2.b1-WiPy.tar.gz -p COM8
    Namespace(file=None, port='COM8', speed=115200, tar='1.2.2.b1-WiPy.tar.gz')
    Connecting...
    Uploading stub...
    Running stub...
    Stub running...
    Changing baud rate to 115200
    Changed.
    Exception: Error -3 while decompressing: invalid stored block lengths, on line 131


  • Pybytes Beta

    for me 0.9.7.b1 works with SSL (including certificate based client auth). It did not erase files when I downgraded with the respective installer - I diid nevertheless save files via FTP before - just to be sure.

    best regards
    Ralf



  • @abilio Which firmware version was the last to properly support ssl? And will dowgrading firmware using updater.py erase any files?


Log in to reply
 

Looks like your connection to Pycom Forum was lost, please wait while we try to reconnect.