Hi Paul,
First of all many thanks for the new package.
I do have a question on the usage of it.
Using series 2 ZigBees, I worked on the receive_samples example and can receive info from one route and 2 end devices.
So far so good. I also wanted to test the ability to remotely set ports and used a small example Harold Kubota made in 2011.
Yesterday It worked, but today it does not.
Also the remote reprogramming of some of the ports does not work.
Since I am new to both Python and your software, I wonder. What goes wrong here.
Regards,
Bert
Here is the example code:
#!/usr/bin/python
# This is a simple demo to remotely turn a LED on and off
# 2011-02-11 Harald Kubota
import serial
from xbee import ZigBee
import time
PORT='//./COM5'
BAUD_RATE=9600
ser = serial.Serial(PORT, BAUD_RATE)
# ZB XBee here. If you have Series 1 XBee, try XBee(ser) instead
xbee=ZigBee(ser, escaped=True)
#MAC, number written on the back of the XBee module
# CO3 = my coordinator
# EP1 = my endpoint with the LED on pin 11
device={ "CO3":'\x00\x13\xa2\x00\x40\x3a\x3d\x59',
"EP1":'\x00\x13\xa2\x00\x40\x3a\xa1\x0c' }
#64 bit address
led=False
#change remote device function
xbee.remote_at(dest_addr_long=device["EP1"],command='D2',parameter='\x02')
xbee.remote_at(dest_addr_long=device["EP1"],command='D1',parameter='\x03')
xbee.remote_at(dest_addr_long=device["EP1"],command='IR',parameter='\x04\x00')
xbee.remote_at(dest_addr_long=device["EP1"],command='IC',parameter='\x02')
while 1:
#set led status
led=not led
if led:
xbee.remote_at(dest_addr_long=device["EP1"],command='D4',parameter='\x04')
else:
xbee.remote_at(dest_addr_long=device["EP1"],command='D4',parameter='\x05')
# wait 1 second
time.sleep(1)
ser.close()