首页 文章

使用Python和python-xbee时识别从XBee传输的数据

提问于
浏览
2

路由器AT配置中的Xbee系列2,其电位器抽头输出连接到XBee的引脚20 AD0 ,应该每100 ms发送一次模拟数据 . 它设置为 ATD02ATIR64 .

协调器API配置中的Xbee Series 2连接到计算机 .

使用XCTU终端,我们可以看到协调器不断从路由器接收 Explicit RX Indicator 帧 . 但是,路由器XBee上没有包含 AD0 读取的模拟数据的帧 .

enter image description here

enter image description here

使用Python与 XBee 模块,我们也注意到同样的事情,只收到 rx_explicit 帧,没有包含模拟数据样本!

{'profile': '\xc1\x05', 'source_addr': '6T', 'dest_endpoint': '\xe8', 'rf_data': '\x01\x00\x00\x01\x02(', 'source_endpoint': '\xe8', 'options': '\x01', 'source_addr_long': '\x00\x13\xa2\x00@\xb1\x92\x13', 'cluster': '\x00\x92', 'id': 'rx_explicit'}

{'profile': '\xc1\x05', 'source_addr': '6T', 'dest_endpoint': '\xe8', 'rf_data': '\x01\x00\x00\x01\x02I', 'source_endpoint': '\xe8', 'options': '\x01', 'source_addr_long': '\x00\x13\xa2\x00@\xb1\x92\x13', 'cluster': '\x00\x92', 'id': 'rx_explicit'}

{'profile': '\xc1\x05', 'source_addr': '6T', 'dest_endpoint': '\xe8', 'rf_data': '\x01\x00\x00\x01\x01\xeb', 'source_endpoint': '\xe8', 'options': '\x01', 'source_addr_long': '\x00\x13\xa2\x00@\xb1\x92\x13', 'cluster': '\x00\x92', 'id': 'rx_explicit'}

{'profile': '\xc1\x05', 'source_addr': '6T', 'dest_endpoint': '\xe8', 'rf_data': '\x01\x00\x00\x01\x01\xce', 'source_endpoint': '\xe8', 'options': '\x01', 'source_addr_long': '\x00\x13\xa2\x00@\xb1\x92\x13', 'cluster': '\x00\x92', 'id': 'rx_explicit'}

您认为可能发生了什么?通过用Arduino读取它来检查 AD0 的值,确实有一个值可以读取 .

1 回答

  • 1

    你期待什么样的框架类型? rx_explicit 帧将具有您的I / O数据 . 您可能需要更改 ATAO (API选项)设置以控制帧是以RX Explicit还是其他帧类型进入 .

    在您收到的帧上提供有效负载的十六进制转储,我们可能会弄清楚数据的格式 . 我想它看起来像 ATIS 响应的格式 .

相关问题