Go Down

Topic: OTA functionalty needed (Read 2468 times) previous topic - next topic

GeirFrimann

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:https://www.hackster.io/flower-platform/program-mkr-over-the-air-goodies-voice-control-etc-562e9a?f=1#_=_.
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..


smgs

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.


sandeepmistry

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: https://github.com/arduino/ArduinoCore-samd/blob/master/libraries/SDU/examples/Usage/Usage.ino

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

smgs

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?

sandeepmistry

Code: [Select]
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.

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.

Juraj

#6
Dec 10, 2018, 02:10 pm Last Edit: Dec 10, 2018, 02:16 pm by Juraj
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.

Modiot

#7
Jan 09, 2019, 01:03 pm Last Edit: Jan 09, 2019, 01:04 pm by 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!!).

Juraj

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

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 :)

Juraj

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 :)
you can store the downloaded bin in flash memory and apply it from there. see the InternalStorage class in WiFi101OTA library
https://github.com/arduino-libraries/WiFi101OTA/blob/master/src/InternalStorage.cpp

Modiot

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!

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?

Juraj

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

Go Up