JAndrassy / ArduinoOTA

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

SDStorage open issue on Uno R4 #233

Closed n1coh closed 8 months ago

n1coh commented 8 months ago

Hello, I tried the OTA update via InternalStorage and it works fine. I need the OTA update via SDStorage for space reasons. So I tried the WiFi101_SD_OTA example but I still get the error: Failed uploading: uploading error: exit status 1

I've added some debugging in sendHttpResponse: Serial.print("OTA upload response: "); Serial.println(status);

I went up to the to pollServer function and the error come from: !_storage->open(contentLength, dataUpload)

My knowledge stops here, do you have any idea why writing doesn't work?

The SD exemples sketch work well btw

JAndrassy commented 8 months ago

the status is printed in IDE console with verbose mode set in Preferences. what was the status?

there is just this in open()

  virtual int open(int length) {
    _file = SD.open(updateFileName, O_CREAT | O_WRITE);
    if (!_file)
      return 0;
    return 1;
  }
n1coh commented 8 months ago

Fast response thank you In my console: Connecting to board ... done Uploading sketch ... done Flashing sketch ... Error flashing the sketch Failed uploading: uploading error: exit status 1

n1coh commented 8 months ago

Other informations : I'm on Arduino IDE v2, when I use internal storage logs in console show Failed uploading: uploading error: exit status 1 but with previous debug OTA upload response: OK and update is applied. May my arduino IDE conf is wrong.

JAndrassy commented 8 months ago

could it be timeout of the upload tool? it is only 10 seconds. newer version of the arduinoOTA tool allows a timeout parameter

n1coh commented 8 months ago

I think you are right, sometimes there is no error with InternalStorage. I'm on version 1.3.0, is there a newer version?

JAndrassy commented 8 months ago

https://github.com/arduino/arduinoOTA/releases

replace the 1.3.0 exe and in platform.local.txt add the -t option in seconds

n1coh commented 8 months ago

Binary was hard to find but now everything is ok

Thank you for your time and work

JAndrassy commented 8 months ago

Binary was hard to find

??? it is right there on the release page

n1coh commented 8 months ago

I searched for many time the binary before you give me the link. My message wasn't clear my bad