Read temperature of a 1-wire device connected to a HA7E
<p>I am trying to read the temperature of a 1-wire device by issuing ascii commands to the 1-wire adapter. The problem is the ser.write('W0144') requires a carriage return  but the code isn't sending it for some reason. The command ser.read(32) returns A69000001CFD7E328 when it should return 44 (from HA7E ascii commands/manual. If I enter the two ser.write commands (without the /r) in Windows XP Hyper Terminal, it works fine.</p>

<p>I've been on this a week (yes I'm a newbie) and I'm stumped. I've tried different timeouts and time.sleeps but no joy. Can anyone make a suggestion?</p>

<pre><code>import serial
import time
ser = serial.Serial(port = 'COM1', baudrate=9600, bytesize=8, parity=serial.PARITY_NONE, stopbits=1, timeout=0)
#show the port is open
print ser.isOpen()
ser.write('A69000001CFD7E328')
time.sleep(1)
ser.write('WO144/r')
ser.read(32)
ser.close()
</code></pre>
