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.

6
  • Describe "remote location", 10 meter, 1 km, 10 km away for the user? Commented May 16, 2017 at 7:56
  • @BenceKaulics we are using GPRS module to send request to the micro-controller which is around 10 Km away.
    – Ashish K
    Commented May 16, 2017 at 9:27
  • 3
    You need to describe your use case more clearly, including the software stack. Have a look at the other over-the-air-updates questions. Commented May 16, 2017 at 10:25
  • Is this a new development, or are you trying to retrofit in an existing product? Commented May 16, 2017 at 10:38
  • @ SeanHoulihane It is a new development. I could go for any choice of micro-controller (cost being the only limit) which can send data to a server on a remote location (10 Km) around. I have used a GPRS module to send data and the only challenge I am presently facing how would I update the firmware remotely.
    – Ashish K
    Commented May 16, 2017 at 10:43

2 Answers 2

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.

3
  • Thankyou so much @Helmar , I will update the question with as much detailing as possible. For micro-controllers that do not support an OS running over it, remote firmware update is still vague and a good clear solution would not only help me but for many who are working on low-end development boards. I would request you to check it after the update as well.
    – Ashish K
    Commented May 17, 2017 at 9:10
  • 1
    Possible, so long as the platform permits flash to be split into at least 3 regions (or you fancy running from RAM whilst you re-flash, and have lots of spares, or a remotely deployable JTAG). Commented May 17, 2017 at 10:59
  • @SeanHoulihane the ATmega series cannot run from RAM. Commented May 24, 2017 at 6:29
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.