JAndrassy / ArduinoOTA

Arduino library to upload sketch over network to Arduino board with WiFi or Ethernet libraries
GNU Lesser General Public License v2.1
457 stars 92 forks source link

LittleFS Conflict with Stored Code? #256

Open gatordevin opened 3 months ago

gatordevin commented 3 months ago

Problem with ArduinoOTA Firmware Updates on Pico W

I'm running into an issue with firmware updates. Here's what's going on: I'm using ArduinoOTA for updates, and I've also got LittleFS in the for storing config stuff. The update process starts fine, downloads the new firmware, but then it stops. The problem happens right at this part of the code:

void FirmwareUpdater::updateFirmware() {
// ... (earlier parts of the update process)
CopySerial.println("Sketch update apply and reset.");
Serial.flush();
InternalStorage.apply(); // This is where things go sideways
}

When it gets to InternalStorage.apply(), it's supposed to apply the update and reset the board. But... it's not doing that. The board just sits there, no reset, no new firmware. If I use a simple test script to trigger the update, it works fine. But when I try to update from my main program, no dice. I'm wondering if maybe LittleFS is causing some kind of conflict? Or maybe there's something about running the update from the main program that's messing things up? Some extra details:

This is on a RP2040 WIZNet W5100s EVB I'm using the Arduino framework LittleFS is used for config storage. Has anyone run into something like this before? Any ideas on what might be going on or how to troubleshoot it? Things I'm particularly curious about:

Could LittleFS be interfering with the update somehow? Is there a known issue with ArduinoOTA and LittleFS on the Pico? Any special considerations for updating when using both internal storage and LittleFS? Might running the update from the main program be causing problems?

If you need any more info, just let me know. Thanks for any help you can offer!

JAndrassy commented 3 months ago

did you try the Updater library? it is bundled with the core

in the title you write Pico W and in the text a Pico with W5100