10

I am working on Arduino Nano (32Kb flash memory of which 2Kb used by boot loader, 2Kb SRAM, 1Kb EEPROM).

The micro-controller takes input from an electrical device via RS485 module and posts the data read to a remote server using GPRS A6 module. The product is supposed to interact with the remote server, posting data at intervals.

I have completed the integration part and the device works fine, collecting data and posting on the server (appx 10-15 Km away). The only challenge I am facing is that if there are 100 such devices and I need to update the firmware, using the remote server (or any other suitable mechanism), how should I proceed with it.

I have been through many posts that suggest using another Arduino as ISP, this could be my last approach (as it would increase the final cost of product).

Over the air firmware update is still unclear as on Stack Exchange community for low-end micro-controllers. Any discussion can be a great help for many.

Aurora0001
  • 18,520
  • 13
  • 55
  • 169
Ashish K
  • 233
  • 1
  • 10

2 Answers2

12

Short answer: It's possible.

Long answer: It's complicated. That's why so many many very bad implementations are out there.

At the very least you have two steps in any remote / over-the-air update process.

  1. Transmitting firmware
  2. Installing firmware.

Of course, this is the absolute bare minimum. If you're working in iterations it's also a very valid first step. If you have more than one device you'll have to be able to associate the correct firmware to the correct device. If you want to to reduce the chance of bricking your device you'll want a way to verify your device's state before and after the update, you'll also want to secure the transport and make the transport as reliable as possible and—naturally—have a fallback strategy in case of update error.

That's five more steps that bring you towards a reliable product. There are best practices out there for these things but they depend on your project surroundings. Maybe it's something cheap and 5% failure rate on updates is okay, maybe it's a pacemaker and even one error in total is unacceptable because it leads to a fatal scenario. You'll have to find solutions to those basics that fit your product.

Furthermore, there are dozens of different things to consider. Will you have customers? Do you have to inform them? Do they have a say in update timing/installation? Are your devices in different countries? Do legal restrictions apply? Do normative standards apply? How many devices are you updating? 1? A dozen? Hundreds? Millions?

If you update five devices the process can be very chatty. If you're updating millions that could turn very expensive. And yes, that impacts what I listed above as step one, transmitting the firmware. Maybe you do create a pacemaker and a process cost of hundreds of messages per update is okay considering the alternative.

Those are only the questions I wrote down in two minutes, so this list is certainly not exhaustive. My point is without information regarding the scenario we can't really help you properly.

Helmar
  • 8,450
  • 6
  • 36
  • 84
1

This question has been answered, but perhaps this will be valuable for others.

You can wire an ESP32-based board or module to your Arduino, and use https://vcon.io for a remote OTA. vcon firmware can act as an AVR (and not just AVR) programmer, and reflash your Arduino remotely.

Also, as a side-effect, you'll get remote control capability for your Arduino. https://dash.vcon.io cloud service gives you device dashboard and an API for remote control and OTA.

Disclaimer: I do represent https://vcon.io product.

valenok
  • 111
  • 1