I've been searching a little for self-updating the ARDuino, and most i've come about is updating it using a wifi / lan shield.

Now I have a GPRS shield that can connect it to the internet. Say that I want to remotely update the shield - how would I go about doing that?

I'm guessing I need some kind of bootloader - but is that extra hardware?

Actually the question boils down to:

  • How can I flash the ARDuino Uno with new software, that I'll receive over a GPRS connection using a GPRS shield?
  • 1
    It sound a lot like the OverTheAir update system used by Moteino. They use an external SPI flash chip to store any updates. The main program check for updates and downloads them (and then reset the board). The bootloader only has to read the flash chip to see if there is an update. This will make the bootloader a lot smaller. Imagine having to load the GPRS library in both your main program and the bootloader. It also makes things less likely to go wrong. – Gerben Nov 23 '15 at 13:18
  • 1
    Thanks, thats interesting. I might be able to use some information from that system. I have some information to get me started :) Thanks a ton guys! – Rob Nov 23 '15 at 13:50
  • @RobQuist Did you managed to update the arduino using GPRS? – Muzahir Hussain Jan 20 '18 at 13:02
  • 1
    @MuzahirHussain No, sorry! It was a fun project to work on but never came around on doing it. I did manage to write a ATMEGA328P chip to flash other ATMEGA328P chips, so it probably is doable just like described up here :) – Rob Jan 26 '18 at 23:06

You would either have to replace the bootloader on your chip (software) with one that knows about your GPRS shield (I don't know if there is one, so you would most likely have to write your own and that is not a trivial task), or use a second microcontroller to act as a programming interface between the GPRS shield and the main Arduino. That could be another Arduino.

The second option is probably the simplest to create:

  1. The GPRS is connected to Arduino A.
  2. Your main software runs on Ardiuno B.
  3. Both Arduinos are connected by serial
  4. Normal operation Arduino A passes all serial verbatim through to Arduno B
  5. Arduino A receives programming instructions and downloads the new code - maybe storing it on an SD card temporarily (not enough RAM in an Arduino) then resets Arduino B into the bootloader.
  6. Arduino A then sends the serial instructions in the same way that avrdude does to program the downloaded HEX file.

Arduino A is then a proxy between the GPRS and Arduino B. Arduino A does all the control of the GPRS and sends data between Arduino A and the internet and vice versa - it's up to you to decide how best to achieve that, depending on what information you have going backwards and forwards.

Both solutions require a certain level of programming knowledge and skill and aren't trivial, but are perfectly possible if you set your mind to it.

  • Cool! Thats the answer I was looking for. But instead of using an extra Arduino, wouldn't it be possible to download the hex file to some persistant storage, and tell the bootloader to restart, and write that hex file to the ATMega, and restart the arduino? I've seen some external bootloader thingsies like these; learn.sparkfun.com/tutorials/installing-an-arduino-bootloader/… - would it be possible to use that? It would require less space and save me an arduino :) – Rob Nov 23 '15 at 9:57
  • 2
    You could do it with one Arduino, but you will need to write a custom bootloader which knows what you are doing - you could download to SD card then reboot into a bootloader that understands what an SD card is and can find your file on it, but again it's not a trivial bit of programming. By the way, the "bootloader" is just a special sketch that runs on the Arduino before your sketch runs. It's not an external thing. It's just software that has to be installed on the main chip before it becomes an Arduino. – Majenko Nov 23 '15 at 10:02
  • Cool, thanks. That'll help me get started :) – Rob Nov 23 '15 at 10:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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