Portenta OTA from the Arduino Cloud

Portenta OTA from the Arduino Cloud

If you go to libraries --> Manage Libraries and type Portenta you see my Portenta-Pro-Community-solutions (shameless plug for my library of beginner examples :smiley:) but you also see "Arduino_Portenta_OTA" for which the github explains that you need the sd card version of the shields or breakout board.

It seems fairly obvious that you send a binary to the sd card that on reboot loads the binary into memory. Sort of like how micropython loads a program from the sd card on reboot.

Before I spend another deep dive of wasted time, I wonder if anyone has tried this and can touch base about it. Here is the example code;

#include <Arduino_Portenta_OTA.h>
#include <WiFi.h>
#include "arduino_secrets.h"
/* ... */
void setup()
{
  if (WiFi.status() == WL_NO_SHIELD)
    return;

  int status = WL_IDLE_STATUS;
  while (status != WL_CONNECTED)
  {
    status = WiFi.begin(SSID, PASS);
    delay(10000);
  }

  Arduino_Portenta_OTA_QSPI ota(QSPI_FLASH_FATFS_MBR, 2);
  Arduino_Portenta_OTA::Error ota_err = Arduino_Portenta_OTA::Error::None;

  if (!ota.isOtaCapable())
    return;

  if ((ota_err = ota.begin()) != Arduino_Portenta_OTA::Error::None)
    return;

  int const ota_download = ota.download("http://downloads.arduino.cc/ota/OTA_Usage_Portenta.ino.PORTENTA_H7_M7.ota", false /* is_https */);
  if (ota_download <= 0)
    return;

  int const ota_decompress = ota.decompress();
  if (ota_decompress < 0)
    return;

  if ((ota_err = ota.update()) != Arduino_Portenta_OTA::Error::None)
    return;

  ota.reset();
}

void loop()
{

}

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.