andrewrapp / xbee-arduino

Arduino library for communicating with XBee radios in API mode
GNU General Public License v2.0
334 stars 162 forks source link

XBee S2C with ZigBee firmware #93

Open IFlickerz opened 2 years ago

IFlickerz commented 2 years ago

Hi!

First of all, I want to introduce a little about the results that I want. My objective is to get the RSSI between a Coordinator and all the Routers that he can find. So my original idea was to send a Broadcast Frame with the Coordinator, read the Frame with the Routers that received it. After that, get the Coordinator (Sender) MAC address and send a Response Frame to this MAC. With that Response Frame, now will be possible to send a AT Command Frame with Coordinator (to himself), with the Parameter "DB", to get the RSSI from the last message received.

With that, I'm facing two problems:

First one is: How am I going to create that frame with this Library?

I've tried a lot to send the frames with code, but just can't understand how this Lib works (with the XCTU everything is working). I'm kind'a new to Xbee and Arduino, so the first problem is how to code the idea.

The second problem is the amount of responses I'll get in the Coordinator, because the AT Command "DB" Frame just give me the RSSI from the last Frame, so if get too much responses, it maybe not that fast to send the AT Commands.

The Xbees is the S2C Pro, with ZigBee firmware (I'm allowed to change the firmware).

The configuration that I'm using on XBees right now:

Routers:

ID: 3332 JV: 1 (Enabled) NI: Router (Router Number) AP: 2 (API Enabled With Escaping)

Coordinator:

ID: 3332 CE: 1 (Enabled) DL: FFFF NI: Coordinator AP: 2 (API Enabled With Escaping)

If you have any idea of how to proceed, I'm willing to do anything to make this work, I just need to get the RSSI between the Coordinator and every Router he finds.

If possible, can you guys give this Issue a fraction of your precious time? I'm really in need of help. Thanks.

IonianIronist commented 2 years ago

Hey @IFlickerz ,

For general stuff about sending and receiving messages you can check out this code, and I apologize for the lack of comments.

For the rss AT Command I am quite sure that this should work, although I did not write that. As for the amount of the responses and the delay of the AT command you can solve it by simply keeping an array of the neighbor addresses and send direct messages to one node at a time instead of broadcasting.

Also after a year of using this library I just found out that there are examples here, so there is that too.

I'll be around if you need anything else, just @ me.