0
\$\begingroup\$

I have connected coordinator xbee to serial port of beaglebone i.e . tx and rx of beaglebone. My router's D0 pin is connected to relay. I want to remotely disable or enable the D0 pin. For that i am using python-xbee library. What I did is (my python code snippet)

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')

code is working fine without error but I am not getting the output. I tried it using without beaglebone i.e. using usb explorer it works. Here is the link of example @ digi.

I am using python-xbee library. What would be the error?

asked Feb 14, 2016 at 8:14
\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

I had the same problem as you with my beaglebone. I got success only after I specify the frame_id.

xbee.remote_at(frame_id='\x01',dest_addr_long=myRouter,command='D0',parameter='\x04')

This is my whole code that works. Note that I broadcast (address FFFF) the command.

#! /usr/bin/python
import serial
from xbee import ZigBee
import time
ser = serial.Serial('/dev/ttyO2', 9600)
xbee=ZigBee(ser)
myRouter = '\x00\x00\x00\x00\x00\x00\xFF\xFF'
xbee.remote_at(frame_id='\x01',dest_addr_long=myRouter,command='D0',parameter='\x04')
time.sleep(1)
response = xbee.wait_read_frame()
print response
answered Feb 19, 2016 at 1:46
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.