Some days ago I was looking for a temperature monitoring solution for some rooms and 19"-racks at the university. The Arexx TL-500 looked promising and I bought it. Unfortunately there are only Windows drivers available. But some people already analyzed the communication protocol and hacked a simple version of a linux driver:
http://www.algorithm-forge.com/techblog/2010/01/linux-usb-driver-for-the-arexx-tl-500-–-part-ii/
There's even a small logger hardware (ARM-based) using this device:
http://rndhax.blogspot.com/2010/03/friendlyarm-mini2440-arexx-tl-500.html
As a python fan I couldn't resist porting this to python to get a small and flexible script. It can be easily extended to save the data, create charts (maybe using matplotlib) or present a web interface.
By looking at the raw data I noticed that bytes 6 and 7 (maybe more?) contain a time value. Maybe it counts the seconds since the initialization of the device?
The first version of my script is mainly a port of the C program. The script uses pyusb 1.0, a python wrapper for libusb 1.0. You may have to install it manually, most linux distributions come with older versions.
#!/usr/bin/env python import usb.core, array, time def getData(rawData): sensor = rawData[3] * 256 + rawData[2] tempRaw = rawData[4] * 256 + rawData[5] clock = rawData[7] * 256 + rawData[6] temp = 0.0078 * tempRaw return clock, sensor, tempRaw, temp def collect(dev): dataDown = array.array('B', [0]*64) dataDown[0] = 4 dev.write(0x1, dataDown, 0) dataDown[0] = 3 while True: dev.write(0x1, dataDown, 0) rd = dev.read(0x81, 64, 0) if rd[1] != 0: d = getData(rd) print d logData(d, rd) time.sleep(10) def logData(d, rd): tmp = "\t".join([str(i) for i in rd]) logfile.write("%s\t%d\t%d\t%d\t%g\t%s\n" % (time.time(), d[0], d[1], d[2], d[3], tmp)) if __name__ == "__main__": dev = usb.core.find(idVendor=0x0451, idProduct=0x3211) logfile = open("temp.txt", "a") collect(dev)
I plan to extend this to a python package using OO, cleaner interfaces, better error handling and more.