Home/Support/Support Forum/Send a request with a coordinator to a end device via a router
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Send a request with a coordinator to a end device via a router

0 votes
Hi, i'm a newbee girl in here and i would like to know something,

For now I have three xbees (two pro s2c and one s2c). I have set the xbees to a coordinator (pro s2c), a router (pro s2c), and a end device (s2c). I have a project for them.

I want to link the coordinator to my computer, and the rooter and end device would be remote devices. I want to know the rssi value between the router and the end device, and I would like to know if, first, that's possible, and then what kind of command (and in which mode : API so a frame, or AT) the coordinator can send in order to have a response from the router. Once this is done, I would like to put these values in a python program, or even send the command thanks to a python program too.

I have one (i found on a website called http://8p-tech.net/?p=448&lang=fr) here it is :

import serial
import string
import math

from time import time

ser = serial.Serial(port='/dev/ttyUSB0', baudrate=9600, timeout=1)
log = open("xbee_rssi_"+str(time())+".log", 'w')

while 1:
if ord(ser.read())==0x7E: #start byte
length=(ord(ser.read())<<8 ) | (ord(ser.read()))
i=0
while i<3:
plop=ser.read()
i=i+1
rssi=ord(ser.read()) #RSSI (Received Signal Strength Indicator)
log.write('%d\t' %rssi)
print('%d '%rssi)
i=0
while i<length-3:
plop=ser.read()
i=i+1
ser.close
log.close

It works, not very well because the value doesn't change when i move the xbee, but at least I have a value. It works just for two xbee, coordinator and router.

Can someone help me with it ?

Thanks!


(sorry for bad English)
asked Nov 24, 2015 in Python by leamp New to the Community (0 points)
edited Nov 25, 2015 by leamp

Please log in or register to answer this question.

...