Wireless sketch upload to Arduino FIO using XBee

Im trying upload my sketch my FIO wirelessly but i keep getting the following error:

avrdude: stk500_paged_load(): (a) protocol error, expect=0x14, resp=0x74
avrdude: stk500_cmd(): programmer is out of sync

I followed the instructions from ladyada Xbee Adapter - wireless Arduino programming
I have checked the following:
57600 baud on both radios
soldered the little jumper on the Xbee explorer between RTS and DIO3
checked the set RTS on close in the device manager
I have checked that the configuration in the XBees is permanent by replugging them and reading the config.
I do have communication between the radios (serial) if i upload the sketch with a USB cable.

I found this from Nathan Seidle who says its a problem with AVRdude Wireless XBee/AVR Bootloading - SparkFun Electronics but i dont really understand.
Do i need to burn a new bootloader to the FIO? Or just use screamer 2.0 instead of the Arduino IDE?
I tried but it only works for 19200 baud which was intended for the 168 chip as i understand.

Has anyone done it successfully with a FIO?

I got it working! 8)
I can now upload sketches wirelessly, using the standard Arduino 1.0.1 IDE and i did not need to update the bootloader on the FIO or anything!
I had to do the following:

  • disable CTS on DIO7 on both XBees
  • on the base unit: change setting "DIO Change Detect" to 08 instead of FF. This means only pin 3 is monitored for changes instead of all 8 pins.

I didn't try each one individually so can say if both are required. :slight_smile:
Thanks to King7 for his post on Nate's tutorial.

I am struggling with this. I hope I missed something obvious.

I followed these instructions: http://arduino.cc/en/Main/ArduinoBoardFioProgramming

The arduino board is the OSEPP Fio which, as far as I can tell, is a clone of the Arduino brand Fio
Both Xbee modules are XBee S1
Both Xbee modules have firmware 10EC (the latest)
I'm using a XBee USB Adapter made by Parallax which seems very close to the XBee Explorer board

I jumpered IO3 to RTS (see attached photo)
I put a check next to Set RTS On Close in the properties of the COM port (COM 11)

I am able to read and configure both XBee modules successfully using X-CTU and FioXBeeConfigTool
I used FioXBeeConfigTool to configure both modules with the settings recommended in the tutorial.
I kept the default PAN ID (3332) for both radios.
I set both to 57600
MY ID is 0000 for the Programming module and 0001 for the Fio module
DL ID is FFFF for the Programming module and 0000 for the Fio module

This all went smoothly. I am able to read and write to the modules using the USB Adapter with no problems.

When I attempt up upload a sketch (Blink) using the Arduino 1.0.3 IDE, I never get a complete process.
I have Board set to Fio and COM Port set to 11.
It always results in the error code "avrdude: stk500_getsync(): not in sync: resp=0x00"

Sometimes the RSSI light on the Fio will come on. Sometimes it comes on when the transmission begins. Sometimes it comes on when it ends. Once it stayed on for ~5 seconds but the upload still failed.

I checked both modules and saw that DIO Change Detect was set to 8, not FF.
I changed both modules so that DI07 has CTS disabled.

I haven't found any other things to try.

I also went through these instructions:

Which are pretty much the same thing. One difference is it calls for closing the solder jumper near the power switch on the Fio board. I did that just now and still no improvement.

Well it works now.

I think I figured out that you can't power the Fio with the USB cable. That's only for charging (like the instructions say). I powered the board with a FTDI breakout board. But this didn't fix the problem at first.

First I had to upload a sketch over the FTDI cable (which means removing the wireless card). After that it started uploading sketches over XBee.

This is good news but it's also annoying because connecting via FTDI means soldering on the header pins, which I wanted to avoid. Oh well, better than not working.

Are you getting it to work with the XBee baudrate set to 57600?

Yes, 57600. I think it has to be that speed for it to work right.

RevMen: You soldered the header pins on the x-bee explorer right? A solder sucker will remove that if you need to in future. Otherwise you could use 2 header pins and put a standard PC style jumper between them. If you use right angle pins it wont even stick out too much.

You can also power the fio using a battery... the standard battery connector works a treat. It lasts a couple of hours like this (depending on how much serial work the xbee is doing i suppose). I prefer it this way because then i can have the whole thing mounted in my project, on the other work bench. It helps the imagination flow. I have even had it charging while I'm programming (although i think this is not recommended).

You definitely need to have the baud rate set to 57600, as this is what the fio bootloader is expecting. I would recommend using 57600 in your project too. Its fast enough for most things.

Are you using x-ctu to configure the xbees? I seriously recommend it! That way you can see all the possible settings etc...