petervojtek / usb-thermometer Goto Github PK
View Code? Open in Web Editor NEWRead temperature from cheap usb thermometers (based on pcsensor0.0.1 binary)
Read temperature from cheap usb thermometers (based on pcsensor0.0.1 binary)
elektron@x61s-4280:~/code/usb-thermometer$ make
cc -DUNIT_TEST -o pcsensor pcsensor.c -lusb
elektron@x61s-4280:~/code/usb-thermometer$ ./pcsensor -h
pcsensor version 0.0.1
Aviable options:
-h help
-v verbose
-l[n] loop every 'n' seconds, default value is 5s
-s<f> substract 'f' °C (float) from measured temperature
-c output only in Celsius
-f output only in Fahrenheit
-m output for mrtg integration
-n only display value in Celsius for Nagios
elektron@x61s-4280:~/code/usb-thermometer$ ./pcsensor -l1
./pcsensor: invalid option -- '1'
pcsensor version 0.0.1
Aviable options:
-h help
-v verbose
-l[n] loop every 'n' seconds, default value is 5s
-s<f> substract 'f' °C (float) from measured temperature
-c output only in Celsius
-f output only in Fahrenheit
-m output for mrtg integration
-n only display value in Celsius for Nagios
elektron@x61s-4280:~/code/usb-thermometer$ ./pcsensor -l 1
Non-option ARGV-elements, try -h for help.
I've got a TEMPer USB device (TEMPer1F_V1.3) running on Centos. I cloned your code and ran it, but am having odd timeout behaviour. The first time it runs, it works fine (if I just run it once or in a loop, everything is as expected), but the process exits and I run it again I just get timeouts when reading from the USB device:
USB interrupt read: Connection timed out
It seems to be sending the control message fine, but timesout when it tries to read from the USB as if there is no data to read. Any ideas why this could happen? I've not done any USB development but read through the code and it seemed to be OK. All return values from closing the interfaces and USB device from the previous run were 0 (success) so it seemed to close down OK, but the next time it runs I get the timeout. Any help would be appreciated!
Hi peter,
just updated the blog post using your git patch.
http://bailey.st/blog/2012/04/12/dirt-cheap-usb-temperature-sensor-with-python-sms-alerting-system/
apt-get install libusb-dev
git clone https://github.com/petervojtek/usb-thermometer.git
cd usb-thermometer/
cp 99-tempsensor.rules /etc/udev/rules.d/
make
cp pcsensor /usr/local/bin/
Im having a hell of a time getting collectd to get data from this thermometer. Tried a variety of different things to no avail. It's working from the command line. Could anyone assist by sharing more details of how they achieved working collectd integration? Even just configs might be better than randomly trying stuff. ty
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.