digidotcom / xbee_ansic_library

A collection of portable ANSI C code for communicating with Digi International's XBee wireless radio modules in API mode.
204 stars 116 forks source link

No samples for sending/receiving messages in API mode #6

Closed ronsmith closed 6 years ago

ronsmith commented 8 years ago

This isn't a code issue, it's really more of a documentation issue.

I am new to using xbees so maybe I am missing something, but shouldn't there be some documentation or simple examples for sending and receiving a message in API mode? The existing samles are not very helpful since XCTU allows me to configure the device and install firmware updates, etc. I have looked for something similar to the book "Building Wireless Sensor Networks Using Arduino". It is a great beginner's guide, but as the name suggests, it expects everything to be done in the Arduino using the xbee-arduino library which appears to have no correlation at all to the xbee_ansic_library. Is there anything comparable, since it is the official library? If documentation exists, can you point me to it?

pahanela commented 8 years ago

Hello @ronsmith, I think you need to refer to the official product manual for documentation. There you can find all information about supported API frames. Also it is ultimately useful to use sniffer, as you will able to see what is happening in ZigBee communication between nodes.

tomlogic commented 8 years ago

@ronsmith, there is a README in samples/win32 and samples/posix subdirectories that describe the various samples. Take a look at the "transparent client" sample program. It uses API frames to stream data to other modules, in a method compatible with the "AT mode" firmware. You might also want to take a look at my fork of this repo, it includes some bug fixes and support for the XBee Wi-Fi.

ronsmith commented 8 years ago

I read the readme and, from other documentation I have read, it was my understanding that API mode and transparent mode are different, that transparent mode AT commands were for simple point-to-point communication. I need to be able to do broadcast messages and communicate with clients so I did not bother with this sample program you mention. So I am confused about how you can mix API frames with AT commands. On Apr 10, 2016 8:36 AM, Tom Collins notifications@github.com wrote:@ronsmith, there is a README in samples/win32 and samples/posix subdirectories that describe the various samples. Take a look at the "transparent client" sample program. It uses API frames to stream data to other modules, in a method compatible with the "AT mode" firmware. You might also want to take a look at my fork of this repo, it includes some bug fixes and support for the XBee Wi-Fi.

—You are receiving this because you were mentioned.Reply to this email directly or view it on GitHub

tomlogic commented 8 years ago

Yes, "API mode" and "AT mode" are different. AT mode uses something called "transparent serial" to pass serial data to the device whose serial number is stored in DH/DL. It also dumps data out of the serial port that it receives on the transparent serial cluster.

API mode can send and receive transparent serial frames as well, addressing them using the transparent serial cluster. It can also send AT commands and receive AT responses via API frames.

The "AT Interactive" sample shows how to send AT commands inside of API frames. The "Transparent Client" sample shows how to use the transparent serial cluster to send and receive streams of data to one or more devices. It might be possible to use broadcast addressing to send transparent serial frames.

The terminology is definitely confusing, and as you can see there's lots of overlap in terminology (AT mode vs. API mode sending AT Request frames). Hope this clears things up a bit, and reading through the Transparent Client sample will make things clearer.

ronsmith commented 8 years ago

Thanks to both of you. @pahanela, I knew there had to be some detailed documentation somewhere, and @tomlogic, thank you for getting me on the right path with the sample files. It's not quite as simple as the xbee-arduino llbrary, is it.