Home/Support/Support Forum/Reading Watchport/H through Xbee sensor adapter
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Reading Watchport/H through Xbee sensor adapter

0 votes
Hello!

My setup is following:

-ConnectPort X4
-Xbee sensor adapter
-Watchport/H sensor

I have succeeded reading temperature and humidity from the sensor using "Use DDO to Read Temperature from XBee Sensor" example. But i dont want to poll the temperature, so i have set up "I/O sample rate (IR)" parameter to 5000ms in Xbee sensor adapter settings and also i configured my ConnectPort X4 address as destination. So now my xbee adapter is sampling every 5 seconds and sending the data, at least that is what i suppose its doing.

I have made following simple program to read the data:
Code:
import sys, os, time, myFunctions,zigbee,socket, xbee_sensor running = True sd = socket.socket(socket.AF_ZIGBEE, socket.SOCK_DGRAM, socket.ZBS_PROT_TRANSPORT) sd.bind(('', 0xe8, 0, 0)) sd.settimeout(1) while running: try: packet, source = sd.recvfrom(255) print myFunctions.getRTCTime() print packet print source print "Read %d bytes" % len(packet) print "\r\n" except socket.timeout: #Ignore the timeout exception pass except: print "Unexpected error:", sys.exc_info()[0] sd.close running = False


this is what i get every 5 seconds:
2011-10-30 14:24:05
€
('[00:13:a2:00:40:6f:8c:1f]!', 232, 49413, 146, 1, 0)
Read 8 bytes

How should I proceed to convert the data to human readable values. In this case temperature, sensor_rh and true_rh?



Juha
asked Oct 30, 2011 in Python by juha.autioniemi New to the Community (23 points)

Please log in or register to answer this question.

1 Answer

0 votes
I have the same hardware, but i can't connect them. Can you give me some tips?
answered Jun 24, 2019 by Martin91 New to the Community (5 points)
...