使用python-xbee发送远程AT命令到远程Xbee
问题描述:
我已经将协调器xbee连接到beaglebone的串行端口,即, beaglebone的tx和rx。我的路由器的D0引脚连接到继电器。我想远程禁用或启用D0引脚。为此,我使用python-xbee库。我所做的是(我的Python代码片段)使用python-xbee发送远程AT命令到远程Xbee
myRouter='\x00\x13\xA2\x00\x40\xE4\x29\xB3'
#For Off
xbee.remote_at(dest_addr_long=myRouter,command='D0',parameter='\x04')
#For switch ON
xbee.remote_at(dest_addr_long=myRouter,command='D0',parameter='\x05')
代码是没有错误工作正常,但我没有得到的输出。 我试过它没有使用beaglebone,即使用USB浏览器它的工作原理。这里是link of example @ digi。我正在使用python-xbee library。会有什么错误?
答
在python-xbee库中,remote_at的“frame-id”默认为'0x0'。如果id为0,则不会收到回复。
http://www.digi.com/blog/wp-content/uploads/2013/11/techtip10.png。
帧ID是01,在XCTU。您需要将“id”更改为除零以外的任何值才能接收响应。
谢谢。我会尽力让你知道 –