I'm trying to wirelessly program the arduino mega 2560 using two XBee S1 chips. I have one hooked up to the computer and one on the arduino via wireless proto shield.
Everytime I program the Xbee chip I get the following warning:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
I believe I have all the settings of the XBee chips right (like the configurations and stuff).
I upload the code (sketch) via Arduino program...
Is there something I'm doing wrong ? Please help
The code I'm using is
int myData = 0;
int const ledpin = 13;
void setup(){
// Start up our serial port, we configured our XBEE devices for 9600 bps.
Serial.begin(57600);
pinMode(ledpin, OUTPUT);
}
cjl1194:
I'm sorry, I don't think I understand...Could you elaborate?
Before you can begin to wirelessly program an Arduino, you MUST understand exactly what happens when you upload a sketch. When uploading via a USB cable, the avrdude application triggers the DTR line, which resets the Arduino. When you replace the wire with a pair or radios, the DTR line is NOT pulled LOW, so the Arduino does not reset. Not resetting the Arduino means that the bootloader does not run. When the bootloader does run, it provides responses to the commands that avrdude sends, which is how avrdude knows that it is talking to an Arduino and that the Arduino is doing what it is supposed to.
If you are going to program the Arduino wirelessly, YOU must trigger the reset, so the bootloader starts running. And, you must do it at the right time.
Ohhh I see what you mean. I connected a wire from DIO3 to RTS on the XBee explorer..so that when I upload code onto it, it triggers the reset button on the Arduino.
Is there something I'm missing ?