# xbee sensor XBeeWatchportH reading value error ?!

**URL:** <https://forums.digi.com/t/xbee-sensor-xbeewatchporth-reading-value-error/2639>\
**Category:** Python\
**Created:** [July 23, 2009, 8:16am UTC](https://forums.digi.com/t/xbee-sensor-xbeewatchporth-reading-value-error/2639 "2009-07-23T08:16:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![john01](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@john01](https://forums.digi.com/u/john01)\
**Post date:** [July 23, 2009, 8:16am UTC](https://forums.digi.com/t/xbee-sensor-xbeewatchporth-reading-value-error/2639/1 "2009-07-23T08:16:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kjensen8](https://avatars.discourse-cdn.com/v4/letter/k/8e8cbc/32.png) [@kjensen8](https://forums.digi.com/u/kjensen8)\
**Post date:** [July 23, 2009, 5:57pm UTC](https://forums.digi.com/t/xbee-sensor-xbeewatchporth-reading-value-error/2639/2 "2009-07-23T17:57:04Z")

</div>

John,

Try this.

I got it working with my WatchportH here.

---

<div class="post-metadata">

**Author:** ![mkotasek](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@mkotasek](https://forums.digi.com/u/mkotasek)\
**Post date:** [July 23, 2009, 6:03pm UTC](https://forums.digi.com/t/xbee-sensor-xbeewatchporth-reading-value-error/2639/3 "2009-07-23T18:03:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![john01](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@john01](https://forums.digi.com/u/john01)\
**Post date:** [July 27, 2009, 2:27am UTC](https://forums.digi.com/t/xbee-sensor-xbeewatchporth-reading-value-error/2639/4 "2009-07-27T02:27:24Z")

</div>

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
