Viability of Programming Arduino OTA?

Hi guys,

So say that I have a system of two microcontrollers, one connected to the actual application and the other connected to a bluetooth module. Would it be possible to connect the one with the bluetooth module to an Android phone and then be able to push new code over to the 2nd microcontroller?

For the bluetooth MC, I was looking at the RFDuino as it is small, arduino based, cheap and has integrated bluetooth. Most likely the main MC would be one of the Atmel ATTINYs.

Thanks in advance for all the responses!

Define “push new code”.
What is that supposed to mean ?
Define nature of data transfer.

If you imagine doing what you say with a PC and an Uno programmed as an ISP I think it should work if you connect the BT Rx/Tx to the Rx/Tx (or is it Tx/Rx) pins and select the bluetooth serial port on your PC within the Arduino IDE.

If it can work like that then the questions for your proposed setup include such things as

Can you use the Arduino IDE (or equivalent) on your phone? Can an RFduino act as an ISP?

...R

I don't think you can use an UNO in Arduino as ISP mode if your only control is a bluetooth module. To operate as ArduinoISP, an UNO first has have the ArduinoISP sketch loaded. Then you have to open the ATtiny85 sketch, change the board to the tiny board , and then select Load. There is no way (AFAIK) to execute the Load (program) command using serial commands coming from a bluetooth module. In short, the android phone is not the same as the IDE GUI. I don't know of any way to change the board or execute the Program LOAD command using only serial commands. Maybe it is possible but I have never heard of it being done. I think it can only be done using a pc.

raschemmel: I don't think you can use an UNO in Arduino as ISP mode if your only control is a bluetooth module. To operate as ArduinoISP, an UNO first has have the ArduinoISP sketch loaded. Then you have to open the ATtiny85 sketch, change the board to the tiny board , and then select Load. There is no way (AFAIK) to execute the Load (program) command using serial commands coming from a bluetooth module.

I freely admit I haven't tested this idea. I had assumed that the ArduinoISP sketch is loaded in the normal way - by USB cable. I just wondered if, after that, you select the serial port that is the bluetooth connection whether the IDE would know the difference?

I guess what was really in my mind was that if you can't do this with an Uno the OP won't be able to do it with any othe Arduino.

And just to clarify, I'm talking about bluetooth comms between the PC and the Uno as ISP.

...R

I know what your talking about but do you have a serial command for RUN ? (the equivilent of clicking the IDE RUN button ) My point is that when you program an ATtiny85 with an UNO as ISP there are several steps, the first of which is loading the ArduinoISP sketch, followed by changing the board type (do you have a serial command to do that ?), followed by opening the ATtiny85 sketch you want to load and last but not least clicking the LOAD (RUN) button in the IDE. Are there serial commands to do all of these steps ?

Have you looked at the Arduino Fio? I think that supports over the air programming.

raschemmel:
I know what your talking about but do you have a serial command for RUN ? (the equivilent of clicking the IDE RUN button )
My point is that when you program an ATtiny85 with an UNO as ISP there are several steps, the first of which is loading the ArduinoISP sketch, followed by changing the board type (do you have a serial command to do that ?), followed by opening the ATtiny85 sketch you want to load and last but not least clicking the LOAD (RUN) button in the IDE. Are there serial commands to do all of these steps ?

This is probably all too theoretical to bother with but I will make one more comment …

The things you mention (RUN and changing the board type, opening the Attiny sketch) all happen in the IDE which is on the PC.

In the normal scheme of things the IDE sends a sketch to an Arduino over whatever serial connection you choose. So why wouldn’t it send over bluetooth to the Arduino that has the ISP loaded onto it?

I’m not saying it WILL work because I haven’t tried it. I just think your objections are as theoretical as my idea.

…R

Let me put it a different way. If you can use the mouse and the pc do everything that you normally do , ie: (RUN and changing the board type, opening the Attiny sketch) then what do you need the bluetooth for ? You can't load a sketch using serial commands (can you?) so I guess I am a little confused about how this is supposed to work. If someone can walk me through it maybe I will get it but I don't see how bluetooth serial is any help doing the things in parenthesis above. Maybe it is clear as a bell to CrossRoads but I don't have a clue at the moment.

PC (Arduino IDE) — Bluetooth — Arduino (as ISP) ---- wires — Arduino being programmed

The OP would like to use an Android phone where I show the PC.

…R

Hi, I know this thread is old but I have a project I've developed for Arduino on the RedBear Duo which allows for Bluetooth OTA of signed binary files using Nordic Semiconductor's Android and iPhone aps and libraries. I'm currently evaluating which platform to target next. Please contact me if you have any interest.

See https://trellis-logic.github.io/sdu/platforms/redbear_duo/platform.html