简体   繁体   English

如何使用XBee快速向其他XBee广播信息?

[英]How to quickly broadcast information with a XBee to other XBee?

I am using several XBee Zigbee with some Arduino modules (or microcontrollers, Arduino is not mandatory). 我正在使用几个XBee Zigbee和一些Arduino模块(或微控制器,Arduino不是强制性的)。 I configured my XBees in AT/transparent mode. 我在X /透明模式下配置了我的XBees。

I need to broadcast information: when one module is touched, every other module must react at the same time and immediately. 我需要广播信息:当触摸一个模块时,每个其他模块必须同时立即做出反应。

Unfortunately, if I have good speed results in unicast mode, there are lots of latencies in broadcast mode. 不幸的是,如果我在单播模式下获得良好的速度效果,则广播模式中存在大量延迟。 It is something known and documented, see XBee ZigBee Addressing . 这是已知和记录的内容,请参阅XBee ZigBee寻址

No data is lost, but they are sometimes buffered for a few seconds by an XBee before being sent again or delivered to my Arduino. 没有数据丢失,但它们有时会被XBee缓冲几秒钟,然后再次发送或传送到我的Arduino。

It seems it is not a configuration problem, it is the way the broadcast protocol work. 它似乎不是配置问题,它是广播协议的工作方式。 Any idea on how I could speed-up the process? 关于如何加快这个过程的任何想法?

The only one I have would be to use the API mode, to make each Arduino keep a list of the XBee addresses, and unicast information to the list of these addresses... but I lose the comfort of the broadcasting method, and I cannot easily add a new module without updating every Arduino. 我唯一的一个就是使用API​​模式,让每个Arduino保留一份XBee地址列表,并将单播信息列入这些地址列表......但我失去了广播方法的舒适度,我不能轻松添加新模块而不更新每个Arduino。

Transmitting data using broadcast addressing with XBee ZB modules will generally give you much, much less performance than transmitting an individual unicast to each node you want to talk to. 使用XBee ZB模块的广播寻址传输数据通常会比向每个要通话的节点传输单个单播提供更多,更少的性能。 This is because broadcasting works very differently on the XBee ZB modules than with the XBee 802.15.4 modules. 这是因为XBee ZB模块上的广播与XBee 802.15.4模块的工作方式完全不同。

When you send a broadcast with the XBee 802.15.4 modules, a single 802.15.4 frame is transmitted to the network and all the nodes that can hear the transmission pick it up and send the information out of their serial UARTs. 当您使用XBee 802.15.4模块发送广播时,单个802.15.4帧将传输到网络,所有可以听到传输的节点都会将其拾取并从其串行UART发送信息。 The 802.15.4 network is a simple star network and no implicit repeating of the broadcast is performed by any of the nodes on the network. 802.15.4网络是一个简单的星型网络,并且网络上的任何节点都不会执行广播的隐式重复。 With XBee ZB, this is different. 使用XBee ZB,这是不同的。 The XBee ZB modules are acting in a mesh topology and need to repeat the information to the other nodes that are out of range of the original transmission. XBee ZB模块在网状拓扑中起作用,并且需要将信息重复到超出原始传输范围的其他节点。

When you send a broadcast with the XBee ZB modules, each node that receives the broadcast will re-broadcast it 3 times, causing a lot of data to be transmitted between nodes. 当您使用XBee ZB模块发送广播时,接收广播的每个节点将重新广播3次,导致在节点之间传输大量数据。 Additionally, there can only be a certain number of broadcasts which are "live" on a network at any given time. 另外,在任何给定时间,网络上只能存在一定数量的“直播”广播。 This often surprises people into thinking that the network is dropping their data when in fact the XBee is rejecting the transmission request. 当XBee实际上拒绝传输请求时,这通常会使人们认为网络正在丢弃其数据。

Unless you are sending data very infrequently--perhaps a broadcast once per minute or more slowly--it is often better to follow this procedure: 除非您不经常发送数据 - 可能每分钟播放一次或更慢 - 通常最好遵循以下过程:

  1. Built a list of all nodes by performing a network discovery or collecting route record packets by enabling the AR feature 通过启用AR功能,通过执行网络发现或收集路由记录数据包构建所有节点的列表
  2. Send a unicast to each node you wish to transmit to 向您要传输的每个节点发送单播

If you're sending information to a nodes on a large ZB network (ie greater than 30 notes) you may want to read this article: Large Networks and Source Routing 如果您要向大型ZB网络上的节点发送信息(即大于30个音符),您可能需要阅读本文: 大型网络和源路由

I don't think you can optimize it much more, unless only some of the modules need to receive the message. 我不认为你可以更多地优化它,除非只有一些模块需要接收消息。 In this case you could use a multicast ( might only be available with Xbee 2) instead of a broadcast, which would bring some very minor improvement on the overall speed of your network when it grows big enough (greater than 16 nodes, ie the basic routing table). 在这种情况下,您可以使用多播可能仅适用于Xbee 2)而不是广播,当网络变得足够大时(大于16个节点,即基本网络),这会对网络的整体速度带来一些非常小的改进。路由表)。

Have you tried a comparison between unicast, multicast and broadcast? 您是否尝试过单播,多播和广播之间的比较? It may be that making a dozen unicasts is on average faster or at least more reliable, especially if you have many hops in your specific network (ex: a 12-node network with 8 hops). 可能是制作十几个单播平均更快或至少更可靠,特别是如果您的特定网络中有许多跳(例如:具有8跳的12节点网络)。

With unicast you can get a confirmation or ack so you know the overall time and success of the operation, and whether you need to retry or not. 使用单播,您可以获得确认或确认,以便了解操作的总体时间和成功,以及是否需要重试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM