I have an Arduino Mega and a HC-07 bluetooth module (currently connected to the RX1/TX1 lines). I can send and receive data very well (using HyperTerminal actually but I plan to write my own program).
Now the next step, I would like to be able to upload sketch directly by bluetooth. Is it possible? I've read few things about it, but I'm confused... do I need a programmer to first reprogram my Arduino to use an alternative bootloader (optiboot) ? I'm a little affraid to do that...
I'm also a little worried about what will happen if there is data corruption when uploading by bluetooth. Can the Arduino be damaged or something?
Also, I'm using Windows so please don't link me to a Linux tutorial, I don't know a thing about Linux...
The problem you might run into is how to reset the Arduino to start the bootloader. Theoretically it's possible but with standard BT modules (the HC-07 too) you don't have a separate signal to reset the board (like DTR) so you have to write your main sketch so that you're able to reset your Arduino, at least on a software level.
do I need a programmer to first reprogram my Arduino to use an alternative bootloader (optiboot) ?
No, the standard bootloader is OK (which is optiboot on the common UNO), you just loose the convenience of the familiar upload process where the opening of the serial device on the PC does automatically reset the Arduino to enter the bootloader.
pylon:
The problem you might run into is how to reset the Arduino to start the bootloader. Theoretically it's possible but with standard BT modules (the HC-07 too) you don't have a separate signal to reset the board (like DTR) so you have to write your main sketch so that you're able to reset your Arduino, at least on a software level.
Would you mind telling me, how to write the main sketch to reset the Arduino?
Would you mind telling me, how to write the main sketch to reset the Arduino?
How to do it complete in software is explained on this page:
With some additional hardware you might get better results, just connecting a digital pin to reset and pulling it to GND is not reliable though (according to Atmel), you might need a bit more hardware that hold the reset to GND for a few ms even though the digital output goes to tri-state almost immediately.
pylon:
With some additional hardware you might get better results, just connecting a digital pin to reset and pulling it to GND is not reliable though (according to Atmel), you might need a bit more hardware that hold the reset to GND for a few ms even though the digital output goes to tri-state almost immediately.