I did some bench testing this morning with a few different configurations. Note that the two XBees are sitting less than six inches away from one another; not sure if that makes a difference...
I tried to be consistent in how I did these tests, but I started out using the Arduino IDE and then switched to just using avrdude (copying the command from the IDE with "upload.verbose=true") in the terminal because it was faster.
- Code: Select all
small sketch (blink, 1124 bytes) [4/9 succeeded]
• attempt 1: failed, "programmer not responding". (weird: led on 13 always on afterwards)
• attempt 2: succeeded
• attempt 3: failed
• attempt 4: failed
• attempt 5: failed
• attempt 6: succeeded
• attempt 7: succeeded
• attempt 8: failed
• attempt 9: succeeded
a couple of failed attempts actually worked, even though IDE responded with error above
"large" sketch (furnace monitor, 2980 bytes) [1/9 succeeded]
• attempt 1: failed
avrdude: stk500_loadaddr(): (a) protocol error, expect=0x14, resp=0x3d
avrdude: stk500_paged_load(): (a) protocol error, expect=0x14, resp=0x3d
avrdude: stk500_cmd(): programmer is out of sync
• attempt 2: failed
avrdude: stk500_read_sig_bytes(): (a) protocol error, expect=0x14, resp=0x3d
avrdude: error reading signature data for part "ATMEGA168", rc=-2
avrdude: error reading signature data, rc=-1
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x65
• attempt 3: failed (upload might have worked)
avrdude: stk500_cmd(): programmer is out of sync
• attempt 4: failed
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x3d
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x3d
• attempt 5: failed
avrdude: stk500_loadaddr(): (a) protocol error, expect=0x14, resp=0x3d
avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x3d
avrdude: failed to write flash memory, rc=-4
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x3e
• attempt 6: failed (same as above)
• attempt 7: failed
avrdude: stk500_read_sig_bytes(): (a) protocol error, expect=0x14, resp=0x3d
avrdude: error reading signature data for part "ATMEGA168", rc=-2
avrdude: error reading signature data, rc=-1
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x65
• attempt 8: SUCCESS!
• attempt 9: failed
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x3d
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x3d
"large" sketch (furnace monitor, 2980 bytes); baud rate of local XBee set to 115200 [no success]
• attempt 1: failed
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x3d
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x3d
• attempt 2: failed
avrdude: stk500_cmd(): programmer is out of sync
• attempt 3: failed
avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x3d
avrdude: failed to write flash memory, rc=-4
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x3d
• attempt 4: failed
avrdude: stk500_getsync(): not in sync: resp=0x3d
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x5a
• attempt 5: failed
avrdude: stk500_getsync(): not in sync: resp=0x3d
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x5a
• attempt 6: failed
avrdude: stk500_getsync(): not in sync: resp=0x3d
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x5a
• attempt 7: failed
avrdude: stk500_getsync(): not in sync: resp=0x3d
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x5a
• attempt 8: failed
avrdude: stk500_getsync(): not in sync: resp=0x3d
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x5a
• attempt 9: failed
avrdude: stk500_getsync(): not in sync: resp=0x3d
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x5a
"large" sketch (furnace monitor, 2980 bytes); baud rate of local XBee set to 38400 [2/9 succeeded]
• attempt 1: failed, but upload happened
avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x3d
avrdude: failed to write flash memory, rc=-4
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x3e
• attempt 2: failed
avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x20
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x65
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x61
• attempt 3: failed
• attempt 4: succeeded!
• attempt 5: failed
avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x3d
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x3d
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x3e
• attempt 6: failed
avrdude: stk500_loadaddr(): (a) protocol error, expect=0x14, resp=0x3d
avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x3d
avrdude: failed to write flash memory, rc=-4
avrdude: stk500_cmd(): programmer is out of sync
• attempt 7: succeeded. reset FTDI cable before upload
• attempt 8: failed
avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x3d
avrdude: failed to write flash memory, rc=-4
avrdude: stk500_cmd(): programmer is out of sync
• attempt 9: failed
avrdude: stk500_loadaddr(): (a) protocol error, expect=0x14, resp=0x3d
avrdude: stk500_paged_load(): (a) protocol error, expect=0x14, resp=0x3d
avrdude: stk500_cmd(): programmer is out of sync
"large" sketch (furnace monitor, 2980 bytes); adaboot_8h13, 19200 [2/10 succeeded]
• attempt 1: failed
avrdude: stk500_recv(): programmer is not responding
• attempt 2: failed
avrdude: Device signature = 0x1e9406
avrdude: stk500_recv(): programmer is not responding
• attempt 3: failed
avrdude: Device signature = 0x1e9406
avrdude: stk500_recv(): programmer is not responding
• attempt 4: failed. started writing flash, at least
avrdude: stk500_recv(): programmer is not responding
• attempt 5: success!
• attempt 6: success!
• attempt 7: failed (did not unplug FTDI cable)
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x3d
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x3d
• attempt 8: failed (*did* unplug FTDI cable)
avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x3d
avrdude: failed to write flash memory, rc=-4
avrdude: stk500_cmd(): programmer is out of sync
• attempt 9: failed?
avrdude: verifying ...
avrdude: 2980 bytes of flash verified
avrdude: stk500_cmd(): programmer is out of sync
• attempt 10: failed.
avrdude: stk500_loadaddr(): (a) protocol error, expect=0x14, resp=0x3d
avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x3d
avrdude: failed to write flash memory, rc=-4
avrdude: stk500_cmd(): programmer is out of sync
Rob Faludi had suggested changing the baud rate on the local (transmitting) XBee. That doesn't seem to have helped any. Small sketches work more of the time, but still not every time. I'm also having weird issues with my FTDI cable. It occasionally seems to lock up; it'll still read incoming serial data (and transmit the DTR line) but I can't get its attention with "+++" or seemingly transmit any data. Unplugging it from my MacBook and plugging it back in seems to reset it, so I started doing that with some of the uploads above. I'm fairly certain that may be responsible for some of the upload failures above.
I guess I'm just going to give up on wireless uploads for now.
