Closed jrrdev closed 1 month ago
Thanks for the detailed description.
I think this is due to the LittleFS update. The on-flash format will be the changed 2.6.0+ version while the ota was built using the original flash format and won't be able to mount the filesystem.
@jrrdev can you give the rebuilt OTA in #2199 a try and report back? I'd like to do a hotfix release ASAP.
@jrrdev can you give the rebuilt OTA in #2199 a try and report back? I'd like to do a hotfix release ASAP.
OK I will give it a try. I can confirm that OTA is working in 3.9.0 so you must be right about the littleFS version problem
And to be clear, you need to flash using USB, not OTA, the first time on your Pico since it's already running the later LittleFS and in an inconsistent state.
OTA is properly working after rebuilding the sketch with #2199 and uploading it first through USB. Do you want me to perform some more tests ? For instance try a direct upgrade from 3.9.0 through OTA only ?
IF it's easy, that would be great. But just thinking through an upgrade from 3.9.0 to the latest should be fine.
The 3.9.0 app will write to a LFS-old filesystem and reboot, the OTA will be overwritten as well as the app in the next one with both at LFS-2.6 format. When the 3.9.2 app starts up it will migrate the FS to 2.6.0 format on flash, and the OTA already will have 2.6.0 support (and LFS-old since 2.9.3 can always read earlier LFS versions).
You are right, I can confirm through test that upgrade from 3.9.0 through OTA works. So the only users who will need to perform the upgrade through USB will be the ones who have upgraded to 3.9.1 first
Summary
When uploading a sketch through OTA with Arduino IDE, the process seems to end successfully. But when the Rpi Pico W reboots, the old sketch is still running, not the new one. I can't see any errors during upload and in the debug logs (see details below)
Steps to reproduce
Board: Raspberry Pi Pico W
Arduino IDE 1.8.19
arduino-pico 3.9.1
Arduino IDE board config:![image](https://github.com/earlephilhower/arduino-pico/assets/17674081/87b7ca24-fc48-4fcd-97e9-7cd383c76313)
Sketch : BasicOTA example with this modifications:
setup()
and commented / uncommented to see if the new sketch is running:1) Upload the sketch through Serial Port 2) After reboot, the Rpi is connected to Wifi, the LED is on and the Rpi is visible in "Network Ports" in the IDE 3) Comment the lines related to lighting up the LED 4) Upload sketch through Arduino IDE OTA 5) OTA process complete successfully. But after Rpi reboot, the LED is still on indicating that the old sketch is still running 6) Upload the sketch through Serial Port 7) After Rpi reboot, the LED is now off indicating that the new sketch is now running
Logs
Arduino IDE:
Serial Debug (only relevant parts, see ota_serial_debug_rpi_pico.log for full log):