Show Posts
Pages: 1 2 [3] 4 5 6
31  Forum 2005-2010 (read only) / Interfacing / Re: XBee Arduino Library for API mode on: November 12, 2009, 12:58:09 pm
I can't get anything but FFFE for the 16-bit address (see below).  Can you send me the code you are using to produce that?

As for setFrameData(pos, byte), it's not really possible since there is no backing array.  getFrameData pulls from the object variables.  You can simply call request.setXXX to change anything:

      void setRemoteAddress16(uint16_t remoteAddress16);
      void setRemoteAddress64(XBeeAddress64 &remoteAddress64);
      void setApplyChanges(bool applyChanges);

You really shouldn't have to worry about what byte goes in what position  -- that's what the library is for.

I plan to add a GenericRequest class that will allow you to have full control over the packet.  This is intended for support any packet that the library doesn't support directly.


print(): byte is [0x7e]
print(): byte is [0x00]
print(): byte is [0x10]
print(): byte is [0x17]
print(): byte is [0x01]
print(): byte is [0x00]
print(): byte is [0x7d]
print(): byte is [0x33]
print(): byte is [0xa2]
print(): byte is [0x00]
print(): byte is [0x40]
print(): byte is [0x0a]
print(): byte is [0x3e]
print(): byte is [0x02]
print(): byte is [0xff]
print(): byte is [0xfe]
print(): byte is [0x02]
print(): byte is [0x44]
print(): byte is [0x30]
print(): byte is [0x02]
print(): byte is [0x33]
32  Forum 2005-2010 (read only) / Interfacing / Re: XBee Arduino Library for API mode on: November 12, 2009, 12:16:05 pm
Mike,

Yep, that's a bug.  Thanks for finding it.  For the time being you can call request.setApplyChanges(false).  This will set the byte to 0 and will be legal.  You can follow this with an AC (apply changes) command.

Andrew
33  Forum 2005-2010 (read only) / Interfacing / Re: XBee Arduino Library for API mode on: November 11, 2009, 07:01:47 pm
There should be no possibility of interference.  Do you have the NSS serial device sharing a common ground with the Arduino and XBee?  If not you will get spurious output.
34  Forum 2005-2010 (read only) / Interfacing / Re: XBee Arduino Library for API mode on: November 11, 2009, 12:48:10 pm
Try holding the reset pin to GND, then release just before you hit the write button.  Of course, on the "pc setting" tab you should not have the "use escape chars..." checkbox checked.  After successful AP=2 write, check this checkbox.
35  Forum 2005-2010 (read only) / Interfacing / Re: XBee Arduino Library for API mode on: November 11, 2009, 11:38:55 am
The library must escape certain bytes.  See the #2 item on my FAQ http://code.google.com/p/xbee-api/wiki/FAQ Anytime you see a 7D, it's an escape sequence and you need to XOR 0x20 the next byte to get the original value.
36  Forum 2005-2010 (read only) / Interfacing / Re: XBee Arduino Library for API mode on: November 11, 2009, 11:01:50 am
Mike,

Can you post your configuration for coord. and remote?  You can use X-CTU -- hit the save button in the modem config tab and it will save as a text file

Andrew
37  Forum 2005-2010 (read only) / Interfacing / Re: XBee Arduino Library for API mode on: November 10, 2009, 05:39:19 pm
Mike,

Version 1020 is ZNet coordinator AT (Transparent Mode) firmware.  Since this is AT firmware, you can't be in API mode, and that would explain the problem.  You need to load ZNet or ZB Pro API firmware, then set AP=2.

Andrew
38  Forum 2005-2010 (read only) / Interfacing / Re: XBee Arduino Library for API mode on: November 10, 2009, 04:45:44 pm
Mike,

Can you tell me what type of XBees (series1/freescale or series2/ember) and what firmware you are using?  You need at least 10c8 for series 1 to do remote at.  If you can send me the code I can test it on my end.

Andrew
39  Forum 2005-2010 (read only) / Interfacing / XBee Arduino Library for API mode on: October 28, 2009, 10:17:26 pm
I have released a new version of my XBee Arduino Library.  This release introduces support for the following packets: AT Command, Remote AT and I/O samples, for both series 1 and 2 radios.  You can download it here http://code.google.com/p/xbee-arduino/

Andrew
40  Forum 2005-2010 (read only) / Interfacing / Re: understanding xbee and arduino serial on: November 05, 2009, 11:56:52 am
I always unplug the usb cable before switching jumpers.  Never had any problems.  It is a pain -- I wish they used a switch instead of jumpers.
41  Forum 2005-2010 (read only) / Interfacing / Re: understanding xbee and arduino serial on: November 04, 2009, 03:05:53 pm
Try now.  The svn:mime-type was not set properly on all files.  You can also download the docs if you like.
42  Forum 2005-2010 (read only) / Interfacing / Re: understanding xbee and arduino serial on: November 03, 2009, 01:47:03 pm
Hey Mike,

Did you upgrade the library from a previous version?  If so you need to delete XBee.o.  Otherwise it won't compile the new library.  I think they changed this in Arduino 17 so that it always recompiles libraries.

Andrew
43  Forum 2005-2010 (read only) / Interfacing / Re: understanding xbee and arduino serial on: November 03, 2009, 12:14:02 pm
FYI, I have since updated the xbee-arduino library (http://code.google.com/p/xbee-arduino/) to support i/o samples.  See this example for series 1:

http://code.google.com/p/xbee-arduino/source/browse/trunk/examples/Series1_IoSamples/Series1_IoSamples.pde

and this one for series 2:

http://code.google.com/p/xbee-arduino/source/browse/trunk/examples/Series2_IoSamples/Series2_IoSamples.pde
44  Forum 2005-2010 (read only) / Interfacing / Re: understanding xbee and arduino serial on: August 20, 2009, 06:03:26 pm
sorry, that should be

if ((xbee.getResponse().getFrameData()[8] & (1 << 4)) {
// it's on

}

of course arrays start at 0
45  Forum 2005-2010 (read only) / Interfacing / Re: understanding xbee and arduino serial on: August 20, 2009, 05:53:09 pm
You should be able to use the xbee-arduino library to do this.  Although it doesn't implement i/o samples yet, it should parse any valid xbee packet.

In your loop:

xbee.readPacket();
   if (xbee.getResponse().isAvailable()) {
      
      if (xbee.getResponse().getApiId() == RX_16_IO_RESPONSE) {
// got a i/o sample
// now we just need to pick out the relevant parts
// we can access the packet with xbee.getResponse().getFrameData()
// per the doc http://xbee-arduino.googlecode.com/svn/trunk/docs/api/class_x_bee_response.html#d958f0b5200138545bdd762111299a94
// the frame data starts with the byte  that follows the api id
// now open your manual to page 62 http://ftp1.digi.com/support/documentation/90000982_A.pdf
// we can see the fifth byte takes us to the RF data -- the meat of the packet.
// now go to page 12.  the first byte is # samples, then the channel indicators.  you're looking for dio4 and that's the fifth bit of the fifth byte (not making this up). So really byte # 9.  So this should do it:

if ((xbee.getResponse().getFrameData()[9] & (1 << 4)) {
// it's on

}
}
}

Let me know if this works.  Hopefully I got the correct byte.  I can look into adding this feature to the library if there's enough interest.
Pages: 1 2 [3] 4 5 6