Hi all,
I’ve been developing [libxbee for some time now.
I had previously written a piece of software that creates a pseudo terminal so that I can effectively multiplex communications between my PC and multiple endpoints (e.g: an arduino) through one XBee. It worked, though verification for avrdude failed (a lot), and I never investigated it because the write was always successful.
I’ve recently re-written this bit of software and included it with libxbee, and it works really well…
Unfortunately, running avrdude via this pseudo terminal still has issues with verification, and I decided to investigate it properly.
When running XBee modules in API mode 2, the module should escape the special bytes. It does to this, most of the time…
I have noticed some strange behavior, that I’ve detailed below. I am curious to know if anyone else has observed this.
At some point during the verify stage, the XBee will transmit a frame to the PC that is invalid.
Somewhere in the invalid frame there will be an ‘invalid’ escape sequence (it has escaped a value other than 0x7E, 0x7D, 0x11, and 0x13), and the checksum won’t validate. I’m fairly sure that I haven’t missed / hopped over a byte because there is no corruption in/before the next frame.
If I ignore the checksum and restore these invalid escaped bytes back to their original value, then avrdude will complete the verify, and then raise an issue stating something similar to:
avrdude: verification error, first mismatch at byte 0x1ab4
0x11 != 0x31
This looks like software flow control has made it’s way through (XON/XOFF), but I don’t think it’s as simple as that (also, my XBee is configured for hardware flow control).
This behavior only seems to occur when the following conditions are met exactly:
-
During the verify step of avrdude - it is 95% recreatable when using a write/verify or just verify
-
Only with API frames that have a payload of either 41 or 111 bytes in length
If I switch to API mode 1, then everything is great and works (seemingly) 100% reliably.
I have also tried running at 9600 baud instead of my default of 57600. In this case it succeeds, very, very slowly.
I also remember reading somewhere that some XBees had a firmware bug, so I tried updating to the latest firmware (10ED).
I am using XBee Series 1.
An XBee Pro connected to a Sparkfun FTDI board to the PC.
An XBee (not Pro) connected to an Arduino FIO with the Arduino bootloader.
Has anyone experienced this? or got any info?
Thanks in advance! and apologies for the long post…](Google Code Archive - Long-term storage for Google Code Project Hosting.)