10 years, 4 months ago.

Sample broadcast example

Hi, i am trying to use this sample. But i am having a hard time using it, to start the sample program you provided to test broadcast does not work on my mbed. When i look at the TX data sent to the xbee, i see does not have the address and frame ID in the data.

Did you encounter such problem?

I have tested my xbees with the X-CTU software and they are properly set to communicate.

Thanks

Question relating to:

API for communicating with XBee devices. wireless, xbee

1 Answer

10 years, 4 months ago.

Hi Christian,

The example works OK for me on the particular board that I'm using. I've got a more fully features version of the example which includes more diagnostics - I wanted to keep the example you've been looking at simple and to the point but I'll upload the other one later.

When you say that the TX to the XBee doesn't include the address and frame ID, can I ask how you're monitoring the transfer? The library uses the XBee's API mode, so the address and frame ID aren't transferred as strings - if you're using a terminal emulator or somesuch which only displays ASCII that may be why you don't see them.

Thanks,

John

Accepted Answer

Hi, i am monitoring the TX pin of the mbed. I am seeing the start byte, size, frameid ans message... I dont see the address and option bytes.

posted by christian b 27 Jun 2014

OK - let me take a look and I'll get back to you.

posted by John Bailey 27 Jun 2014

That makes me remember, i forgot to mention that i get a compiler warning about the virtual fonction call for this line: /* Get the next chunk of data from the frame object */ p_cmd->getDataPtr( written, &cmdData, &buffer_len ); in XbeeDevice.cpp

I don't know if this helps you or not. Also i am using the mbed.

posted by christian b 27 Jun 2014

Hi Christian,

That's a good spot - I've been using GCC for development recently and it doesn't get unhappy about that glitch - Keil compiler spots it for the problem it is.

I've updated the library and tested the broadcast example using the on-line compiler rather than GCC - seems to be working again (XBee interfacing to XCTU on the other end sees the message).

Thanks for letting me know about the issue and sorry if you've wasted time on it - do let me know if you run in to anything else.

John

posted by John Bailey 27 Jun 2014

I've also posted the other example code that I mentioned - see https://mbed.org/users/johnb/code/XBeeApiBroadcastExample/

posted by John Bailey 27 Jun 2014

Thanks for your help!

posted by christian b 30 Jun 2014