Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'downloadOTA' command to download OTA file and verify length/CRC #124

Merged
merged 4 commits into from
Aug 6, 2020

Conversation

aentinger
Copy link
Contributor

@aentinger aentinger commented Aug 4, 2020

Test sketch ...

#include <WiFiNINA.h>

void setup() {

  Serial.begin(115200);
  while (!Serial) { }
  
  int status = WL_IDLE_STATUS;
  do {
    status = WiFi.begin("SSID", "PASS");
    delay(5000);
  } while ( status != WL_CONNECTED);

  /* Download new files. */
  if (!WiFiStorage.downloadOTA("https://downloads.arduino.cc/test/wifi1010-sha256-remote.ota")) {
    Serial.println("WiFiStorage.downloadOTA(...) error");
    return;
  }
  Serial.println("Download complete");

  /* Read length. */
  len = 0;
  if (WiFiStorage.exists("/fs/UPDATE.BIN.LZSS", &len)) {
    Serial.print("File size = ");
    Serial.println(len);
  } else {
    Serial.println("WiFiStorage.open(...) error");
  }
}

void loop()
{

}

Related PRs:

…nd, to the overhead bytes are 5 instead of 6
…ring OTA download:

  typedef enum OTA_Error {
    ERR_NO_ERROR = 0,
    ERR_OPEN     = 1,
    ERR_LENGTH   = 2,
    ERR_CRC      = 3,
    ERR_RENAME   = 4,
  };
@aentinger aentinger merged commit a8d4745 into master Aug 6, 2020
@aentinger aentinger deleted the nina-download-ota branch August 6, 2020 06:33
khoih-prog added a commit to khoih-prog/WiFiNINA_Generic that referenced this pull request Aug 6, 2020
### New in v1.7.0

1. Sync with [Arduino WiFiNINA Library v1.7.0](https://github.com/arduino-libraries/WiFiNINA/releases/tag/1.7.0). See [Add 'downloadOTA' command to download OTA file and verify length/CRC](arduino-libraries/WiFiNINA#124)
2. Add Arduino SAMD Packages_Patches to fix Arduino SAMD compiler error when using STL. See [Improve Arduino compatibility with the STL (min and max macro)](arduino/ArduinoCore-samd#399)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant