OTA functionalty needed

I have been looking around for a solution to do OTA updates on the MKR 1400 boarsd, the only solution I have found close is the flower-platform, that doesn't seems to be developed anymore.
It supports the Zero and the MKR 1000 boards only, according to this blog:Program MKR Over-the-Air + Goodies: Voice Control, etc. - Hackster.io.
Are there any plans to support OTA updates on the newer MKR boards??
Without it, I guess the boards will be used in just DIY projects, and not in any large scale deployments..

I had a bit of a look about doing some over the air updates to the board and from what I can see it's possible, but the recommended route tends to be to program in the functions you think you might need at compile time if you can.

It seems like you can also get an AVR bootloader module for use (without needing a whole pc) which can do something like read a file from an SD card and that file can then be loaded onto the Arduino via the bootloader module.

so you can potentially do all this now, it's just finding the right External bootloader module or setting up an Arduino ISP type of thing.

Just thinking out loud here, I wonder if you could you also make a function that reads the content of a web page or file on a website, and then runs that content as a new function? I guess you might be able to, hmm, I think I remember seeing someone say that it would run much slower though as it's not compiled.

Just my thoughts anyway, will be interested to hear what you do.

If you have an SD card shield attached and use the SAMD core's bundled SDU library, you can perform an update by saving an UPDATE.bin file to the SD card and restarting the board.

See: ArduinoCore-samd/Usage.ino at master ยท arduino/ArduinoCore-samd ยท GitHub

Might not be exactly what you are looking for however ...

so potentially with the MKR GSM 1400, you could setup a function that downloads an "UPDATE.bin" file from a website or similar, and saves that file to your local SD card and then complete a soft reset on the device to re-flash it (what's the right terminology there, just update?)

That would be really neat, and as long as the new .bin file included the same function you could do that as many times as you like.

Very cool, will have to have a look into that one. Thanks sandeepmistry. Hopefully that helps the OP as well, it's certainly giving me some ideas...

Are there any drawbacks to trying to use the SAMD core bundled SDU library with the MKR GSM 1400?

Are there any drawbacks to trying to use the SAMD core bundled SDU library with the MKR GSM 1400?
  • It takes 16 kB of flash to use the SDU library, there's a secondary boot phase added after the boot loader to check the SD card for the update file.

  • If the update becomes corrupt or invalid, you'll need physical address to recover it via sketch upload over USB. You could use SHA256 or CRC etc, to validate the downloaded file before applying the update to avoid corruption during transport or storage.

I am trying to implement this on a Feather M0 WiFi and can't get it to work.

It seems SDCARD_SS_PIN for the SD is set to 4, which in the Feather M0 WiFi is already in use by the ATWINC1500 WiFi module.

From what I can work out, I need change the SDCARD_SS_PIN in SDUBoot.ini then build via command line with build.sh but on my Mac this is failing.

Can anyone help please?

FYI: I already have working code that downloads the updated firmware to SD card as update.bin but it will never use it as the SS pin is wrong.

gjt211:
I am trying to implement this on a Feather M0 WiFi and can't get it to work.

It seems SDCARD_SS_PIN for the SD is set to 4, which in the Feather M0 WiFi is already in use by the ATWINC1500 WiFi module.

From what I can work out, I need change the SDCARD_SS_PIN in SDUBoot.ini then build via command line with build.sh but on my Mac this is failing.

Can anyone help please?

FYI: I already have working code that downloads the updated firmware to SD card as update.bin but it will never use it as the SS pin is wrong.

SDU supports M0 in new version of Arduino SAMD core (1.6.20). It was in GitHub version from Aug 30.

Do you have any news related to OTA funtionality?

I am also working on that, so If someone wants to colaborate, we can share our progress (or work together!!).

Modiot:
Do you have any news related to OTA funtionality?

I am also working on that, so If someone wants to colaborate, we can share our progress (or work together!!).

you need only download the update file to SD card and have SDU library in sketch as described in comments above

I got my MKR MEM shield in the mail the other week and am planning to do some work on this with a MKR GSM 1400 in the near future. Will start a post about it when I do :slight_smile:

smgs:
I got my MKR MEM shield in the mail the other week and am planning to do some work on this with a MKR GSM 1400 in the near future. Will start a post about it when I do :slight_smile:

you can store the downloaded bin in flash memory and apply it from there. see the InternalStorage class in WiFi101OTA library

Juraj:
you need only download the update file to SD card and have SDU library in sketch as described in comments above

I tested it and it works well. So easy!

Thanks!

sandeepmistry, can the SDU perform the update from the serial flash memory on board the MKR MEM shield, or must UPDATE.bin reside on the SD card?

alanoatwork:
sandeepmistry, can the SDU perform the update from the serial flash memory on board the MKR MEM shield, or must UPDATE.bin reside on the SD card?

you could use the InternalStorage method if your sketch takes less then half of the flash memory.

the WiFi101OTA library contains a SerialFlashStorage method similar to SDStorage, but I didn't see a library to load the update from the serial flash after the reboot.

I hope @sandeepmistry answers