Remotely program Arduino over GPRS

Hi all,

I want to be able to remotely program an Arduino over GPRS, and also use the GPRS for application specific data transfer.

I have had a Google around and haven't found much relating to this, but some people seem to have remotely programmed via other wireless connections.

I was just hoping that you guys could provide some suggestions as to how I would go about doing this. I'm not against having a second processor to act as a programmer if that is a good approach.

I look forward to hearing back from you all.

Regards,
-Steve-

stevensam2012:
I'm not against having a second processor to act as a programmer if that is a good approach.

I think that one of Nick Gammon's many tutorials covered that - it has definitely been done, anyway, so is a safe option. I know there's also an FTP bootloader which enables uploading over the network but this would obviously depend on having a compatible network interface and I think that was targeted at an Ethernet shield rather than a GPRS modem. So, it might be possible but would probably involve a considerable amount of work to make it compatible with your network interface - and since you're probably the first to do it, you may find it's not actually feasible.

Thanks for the quick response.

I think the tutorial you're referring to uses an Arduino as a programmer to program an AVR over the ICSP pins, is that the one you meant?

I was thinking of something more along the lines of to uC's with Arduino bootloaders, one of which would take the role that a PC normally does when programming an Arduino. So I could possible send a hex file to my target system, and the Programming uC would then write this to the main uC. I was thinking that if I did it this way, then I could also have a 'Default' sketch stored in the system, so if a remote programming attempt failed, the programming uC could detect this and write the default sketch to the main uC, and perhaps send a notification of this back over the GPRS link, so the server knows to try again.

I think that this is probably the most reliable way to do it, but I have no idea as to how feasible this is...?

I'd love to hear your thought on this, or any better suggestions.

Cheers,
-Steve-

After a bit more research, this is looking quite feasible. It turns out someone has implemented the STK500 protocol on an Arduino. Meaning one Arduino can write to another over the serial lines, all it needs is the HEX.

My thoughts are to use GPRS to receive the HEX file of the sketch I want to remotely upload, then store it. The programmer uC can read the HEX file and write it to my main uC using an implementation of the STK500 protocol, similar to what is done in the above sketch.

I'm pretty confident that this is achievable, but if anyone can see any potential problems please let me know.

Cheers,
-Steve-

Just curious if you found a solution to this. I've recently run into the same problem myself, I'm looking to deploy a remote arduino device which will only be accessible via its GSM shield and it may need program updates from time to time.

The Arduino GSM shield is already connected to the same serial pins that are used for programming through the bootloader. Dont think it's quite this simple, but shouldnt you be able to just pull the reset pin low then send the compiled program file over GPRS (which is forwarded to the UART serial pins)? This seems to be what is done here: Xbee Adapter - wireless Arduino programming (if you filter out all the xbee configurations) but I'm not sure.

I suspect your best bet would be to build a piggy-back system, with one Arduino with a GPRS interface which has the job of receiving the sketch and uploading it to the other Arduino which runs it.

PeterH:
I suspect your best bet would be to build a piggy-back system, with one Arduino with a GPRS interface which has the job of receiving the sketch and uploading it to the other Arduino which runs it.

You may be right. I've decided to delay this particular part of the project indefinitely but using 2 Arduinos seems like the approach that's most likely to work. Thanks!