digidotcom / xbee-python

Python library to interact with Digi International's XBee radio frequency modules.
Mozilla Public License 2.0
183 stars 93 forks source link

Broadcast other node information in a mesh network #297

Closed sandeep1404 closed 9 months ago

sandeep1404 commented 9 months ago

Hi all,

I am new to using Zigbee and networking, I tried implementing mesh network with xbee pro s2c modules using digimesh firmware in broadcast mode, and every node use to send its information to all other directly connected nodes. But my question is as follows:

As shown in the figure, How can every router here get the information from all other routers? Let’s say I want Router 8 information to be sent to all other routers. If I set router 8 in the broadcast mode, it can only send the information to the nearest router(Router 1), and Router 8 cannot able to send the information to Router 2, Router 3, or any other router. My idea is that router 8 can send the information to directly connected nodes here to router 1; in the actual broadcast mode, router 1 can send only its(router1) information to all other directly connected nodes, but I want router 1 to send its information as well as router 8 information in broadcast mode to all other connected routers to router 1 since its receiving the information from router 8 and router 8 is not reachable to other routers except router 1. My aim is to have every router information available with all other routers if they are connected directly using a direct transmission or use the saved information of other nodes and send other node's information also along with sending its node information if not connected by a direct link. How to achieve this. Any help in this regard would be highly appreciated. Thank you in advance.

zigbee_network drawio (1)

tatianaleon commented 9 months ago

Hi @sandeep1404,

First thing to note is that Zigbee and DigiMesh are different protocols. You must select which one you want to use. To send broadcast data, refer to https://xbplib.readthedocs.io/en/stable/user_doc/communicating_with_xbee_devices.html#send-data-to-all-devices-of-the-network

But before, the recommendation is to read, XBee/XBee-PRO S2C Zigbee RF Module User Guide and/or XBee S2C DigiMesh 2.4 User Guide to decide the protocol and get information about broadcast transmissions.

sandeep1404 commented 9 months ago

Hi @tatianaleon ,

Thanks for the reply , I am using DigiMesh firmware with my xbee pro s2c modules, I referred to the following xbplib github and tried broadcasting my information between six different xbee pro modules where every router xbee is connected to all other router xbees and i implemented that, but my question is as stated in the above figure, if router 2 is not reachable to router 8 , how can router 8 can send its information to router 2 via router 1. I thought of a solution since router 1 is getting information of router 8, now router 1 can send both router 1 and router 8 information together in one packet to router 2. Is this possible in broadcast mode if yes how to achieve this. My end goal is every router in the above network need to have information about all other routers even if they are not directly connected. How can we do this?Thanks in advance.

tatianaleon commented 9 months ago

Hi @sandeep1404,

You are asking how broadcast work in DigiMesh, see the DigiMesh manual, for example Broadcast addressing or BH (Broadcast Hops).

Best Regards

sandeep1404 commented 9 months ago

Hi @tatianaleon ,

Not exactly, as per my knowledge lets take a simple Network with three xbee nodes A<-->B<-->C , here A is connected with B, and B is connected to C, and A and C are not directly connected, so usually in a standard broadcast mode my router A can broadcast information to B and router B can broadcast its own information to router C. But my question here is , since router B can only broadcast its own information to router C, but router C required both A and B information together, so is it possible for router B to not only broadcast B information but also send router A information to router C, once when B receives the A information. My goal here is C should have Both A and B information , and A should have B and C information i.e. every node can have other nodes information.

tatianaleon commented 9 months ago

Hi @sandeep1404,

From Broadcast addressing

All of the routers in a network receive and repeat broadcast transmissions. Broadcast transmissions do not use ACKs, so the sending device sends the broadcast multiple times. By default, the sending device sends a broadcast transmission four times. The transmissions become automatic retries without acknowledgments. This results in all nodes repeating the transmission four times as well.

sandeep1404 commented 9 months ago

Hi @tatianaleon ,

I checked Broadcasting addressing, but it can only broadcast that particular node(router) information not other nodes information.I want to broadcast other node information that are not directly connected, as said in the previous message.

rubenmoral commented 9 months ago

Hi @sandeep1404,

As stated in the CONTRIBUTING file, the GitHub issue tracker is to report bugs in the library. Requests for help and questions should be asked using the Digi Forum.