xbee sensor XBeeWatchportH reading value error ?!

Hi everyboy;

Here is my problem, I have follow the sample code to
read XbeeWatchportT with no error .
But reading XbeeWatchportH temperature with errors,
here is my code

#config known destination
#Xbeewatchport T
DESTINATION=“[00:13:a2:00:40:0a:39:97]!”
#XbeewatchportH
DESTINATION2=“[00:13:a2:00:40:31:4d:b4]!”

#ensure sensor is power on from adater
#zigbee.ddo_set_param(DESTINATION, ‘D2’, 5);
#zigbee.ddo_set_param(DESTINATION, ‘AC’, ‘’);

#get and parse sample

sample = zigbee.ddo_get_param(DESTINATION, ‘1S’)
xbee_temp = xbee_sensor.XBeeWatchportT()
xbee_temp.parse_sample(sample)

print “Temperature is: %f degrees C” %(xbee_temp.temperature)

sample1 = zigbee.ddo_get_param(DESTINATION2, ‘1S’)
xbee_temp = xbee_sensor.XBeeWatchportH()
xbee_temp.parse_sample(sample1)
==>

traceback (most recent call last):
File “”, line 24, in ?
File “WEB/python/xbee_sensor.py”, line 191, in parse_sample
self.sensor_rh = (1 / 0.0062) * ((v_output / v_supply) - 0.16)
TypeError: unsupported operand type(s) for /: ‘NoneType’ and ‘NoneType’

The reading to XbeewatchportH temperature xbee_temp.parse_sample(sample1)
has errors , how should I modify it ?!

Thanks for you kndly help

Message was edited by: john01

Message was edited by: john01

John,

Try this.

I got it working with my WatchportH here.

Quick summary:

The difference between what you two posted was that on the 1-wire sensor the DIO line 2 was being driven high (D2=5). This provides extra current to the attached 1-wire sensor, in this case the Watchport/H, and allows it to take sensor samples without error.

The device may be returning something without D2=5, but its undefined about what that is, and the underlying xbee_sensor.py library throws an exception when encountering the bad data.

Still get error using watchportH, please me !!!

I use this watchportH.py but still get errors
xbee_temp = xbee_sensor.XBeeWatchportH()
xbee_temp.parse_sample(sample)
==>

traceback (most recent call last):
File “”, line 24, in ?
File “WEB/python/xbee_sensor.py”, line 191, in parse_sample
self.sensor_rh = (1 / 0.0062) * ((v_output / v_supply) - 0.16)
TypeError: unsupported operand type(s) for /: ‘NoneType’ and ‘NoneType’

But if I change XBeeWatchportH to XBeeWatchportT, then
the temperature is Ok.

Do I have to configre the adapter that the attched sensor
is H not T type , so the adapter can recognize it ?!

Message was edited by: john01