Shop OBEX P1 Docs P2 Docs Learn Events
Xbee API Mode — Parallax Forums

Xbee API Mode

LightfootLightfoot Posts: 228
edited 2010-06-03 01:47 in Propeller 1
I am attempting to use the API mode so I can transmit data to particular XBEES (a total of six on the network). The object I think makes you build a packet before you send it (hard to tell just by looking at the code). I for now just want to transmit and receive single bytes. In the future I will want packets of multiple bytes. Can you post examples of how to properly send API data and retrieve it at the other end? I set the 16 bit source addresses from 1 to 6, 0 is the transmitter unit. I tried this code, but I think you have to build a packet, as the object probably does not do this automatically:

'Transmitter:


XB.API_Tx(1,5) 'Transmit 5 to XBEE address 1.

'Receiver:

repeat
     outa[noparse][[/noparse]8..15] := XB.API_Rx  'Set LEDs to received data.





Thanks

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

Comments

  • Invent-O-DocInvent-O-Doc Posts: 768
    edited 2010-06-03 01:47
    I haven't really used API mode because I've had so much luck with transparent. there should be commands in that mode to specify at recipient address, but you do have a delay with the attention signal.

    Another strategy is to transmit to every unit and include a unique identifier code in your transmitted data that indicates the intended recipient. This strategy was useful for me using SX chips amd XBee and allowed me to avoid API mode and having to build out whole packets (which might be your problem).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Talbot
    New Market, MD, USA
Sign In or Register to comment.