<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://hurlster.com/wiki/index.php?action=history&amp;feed=atom&amp;title=TEMPerHUM</id>
	<title>TEMPerHUM - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://hurlster.com/wiki/index.php?action=history&amp;feed=atom&amp;title=TEMPerHUM"/>
	<link rel="alternate" type="text/html" href="https://hurlster.com/wiki/index.php?title=TEMPerHUM&amp;action=history"/>
	<updated>2026-05-27T18:58:52Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.38.4</generator>
	<entry>
		<id>https://hurlster.com/wiki/index.php?title=TEMPerHUM&amp;diff=2584&amp;oldid=prev</id>
		<title>Gqwill69: /* MRTG Setup */</title>
		<link rel="alternate" type="text/html" href="https://hurlster.com/wiki/index.php?title=TEMPerHUM&amp;diff=2584&amp;oldid=prev"/>
		<updated>2014-08-13T21:38:59Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;MRTG Setup&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;USB temperature and humidity stick.&lt;br /&gt;
&lt;br /&gt;
=== How to compile on Ubuntu Precise ===&lt;br /&gt;
*Pre build requirements&lt;br /&gt;
 add-apt-repository ppa:mlba-team/stable&lt;br /&gt;
&lt;br /&gt;
 apt-get update &amp;amp;&amp;amp; apt-get install libhidapi-dev -y&lt;br /&gt;
&lt;br /&gt;
*Get TEMPered&lt;br /&gt;
 #cd /usr/local/src/ &amp;amp;&amp;amp; git clone https://github.com/edorfaus/TEMPered.git&lt;br /&gt;
&lt;br /&gt;
 #cd TEMPered/&lt;br /&gt;
&lt;br /&gt;
* Custom cmake it&lt;br /&gt;
This is necessary because of some shared library issue. Thanks http://edorfaus.wordpress.com/2012/04/28/devices-arrived/&lt;br /&gt;
 root@server:/usr/local/src/TEMPered# cmake&lt;br /&gt;
 Would you like to see advanced options? [No]:&lt;br /&gt;
 Please wait while cmake processes CMakeLists.txt files....&lt;br /&gt;
 &lt;br /&gt;
 CMake Error: The following variables are used in this project, but they are set to NOTFOUND.&lt;br /&gt;
 Please set them or make sure they are set and tested correctly in the CMake files:&lt;br /&gt;
 HIDAPI_LIB&lt;br /&gt;
    linked by target &amp;quot;hid-query&amp;quot; in directory /usr/local/src/TEMPered/utils&lt;br /&gt;
    linked by target &amp;quot;tempered-exe&amp;quot; in directory /usr/local/src/TEMPered/utils&lt;br /&gt;
    linked by target &amp;quot;enumerate&amp;quot; in directory /usr/local/src/TEMPered/examples&lt;br /&gt;
    linked by target &amp;quot;read-all&amp;quot; in directory /usr/local/src/TEMPered/examples&lt;br /&gt;
    linked by target &amp;quot;read-repeat&amp;quot; in directory /usr/local/src/TEMPered/examples&lt;br /&gt;
 &lt;br /&gt;
 Variable Name: BUILD_HIDAPI_SHARED&lt;br /&gt;
 Description: Build with shared version of HIDAPI&lt;br /&gt;
 Current Value: ON&lt;br /&gt;
 New Value (Enter to keep current value): &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;b&amp;gt;OFF&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 Variable Name: BUILD_SHARED_LIB&lt;br /&gt;
 Description: Build shared version of tempered library&lt;br /&gt;
 Current Value: ON&lt;br /&gt;
 New Value (Enter to keep current value): &lt;br /&gt;
 &lt;br /&gt;
 Variable Name: BUILD_STATIC_LIB&lt;br /&gt;
 Description: Build static version of tempered library&lt;br /&gt;
 Current Value: OFF&lt;br /&gt;
 New Value (Enter to keep current value): &lt;br /&gt;
 &lt;br /&gt;
 Variable Name: BUILD_UTILITIES&lt;br /&gt;
 Description: Build the utilities&lt;br /&gt;
 Current Value: ON&lt;br /&gt;
 New Value (Enter to keep current value): &lt;br /&gt;
 &lt;br /&gt;
 Variable Name: CMAKE_BUILD_TYPE&lt;br /&gt;
 Description: Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.&lt;br /&gt;
 Current Value: &lt;br /&gt;
 New Value (Enter to keep current value): &lt;br /&gt;
 &lt;br /&gt;
 Variable Name: CMAKE_INSTALL_PREFIX&lt;br /&gt;
 Description: Install path prefix, prepended onto install directories.&lt;br /&gt;
 Current Value: /usr/local&lt;br /&gt;
 New Value (Enter to keep current value): &lt;br /&gt;
 &lt;br /&gt;
 Variable Name: HIDAPI_HEADER_DIR&lt;br /&gt;
 Description: The location of HIDAPI&amp;#039;s header file&lt;br /&gt;
 Current Value: /usr/include/hidapi&lt;br /&gt;
 New Value (Enter to keep current value): &lt;br /&gt;
 &lt;br /&gt;
 Variable Name: HIDAPI_LIB&lt;br /&gt;
 Description: The location of the HIDAPI shared library file&lt;br /&gt;
 Current Value: HIDAPI_LIB-NOTFOUND&lt;br /&gt;
 New Value (Enter to keep current value): &lt;br /&gt;
 &lt;br /&gt;
 Variable Name: UTILS_USE_SHARED_LIB&lt;br /&gt;
 Description: Utilities use the shared tempered library&lt;br /&gt;
 Current Value: ON&lt;br /&gt;
 New Value (Enter to keep current value):  &lt;br /&gt;
 &lt;br /&gt;
 Please wait while cmake processes CMakeLists.txt files....&lt;br /&gt;
 &lt;br /&gt;
 Variable Name: HIDAPI_OBJECT&lt;br /&gt;
 Description: The location of the HIDAPI static object file&lt;br /&gt;
 Current Value: /usr/local/src/hidapi/linux/hid-libusb.o&lt;br /&gt;
 New Value (Enter to keep current value): &lt;br /&gt;
 &lt;br /&gt;
 Please wait while cmake processes CMakeLists.txt files....&lt;br /&gt;
 &lt;br /&gt;
* Make it!&lt;br /&gt;
 root@server:/usr/local/src/TEMPered# make&lt;br /&gt;
 Scanning dependencies of target tempered-shared&lt;br /&gt;
 [  7%] Building C object libtempered/CMakeFiles/tempered-shared.dir/core.c.o&lt;br /&gt;
 [ 14%] Building C object libtempered/CMakeFiles/tempered-shared.dir/temper_type.c.o&lt;br /&gt;
 [ 21%] Building C object libtempered/CMakeFiles/tempered-shared.dir/type_hid/fm75.c.o&lt;br /&gt;
 [ 28%] Building C object libtempered/CMakeFiles/tempered-shared.dir/type_hid/common.c.o&lt;br /&gt;
 [ 35%] Building C object libtempered/CMakeFiles/tempered-shared.dir/type_hid/ntc.c.o&lt;br /&gt;
 /usr/local/src/TEMPered/libtempered/type_hid/ntc.c: In function â€˜tempered_type_hid_read_sensor_group_ntcâ€™:&lt;br /&gt;
 /usr/local/src/TEMPered/libtempered/type_hid/ntc.c:8:66: warning: unused parameter â€˜groupâ€™ [-Wunused-parameter]&lt;br /&gt;
 /usr/local/src/TEMPered/libtempered/type_hid/ntc.c:9:41: warning: unused parameter â€˜group_dataâ€™ [-Wunused-parameter]&lt;br /&gt;
 /usr/local/src/TEMPered/libtempered/type_hid/ntc.c: In function â€˜tempered_type_hid_get_temperature_ntcâ€™:&lt;br /&gt;
 /usr/local/src/TEMPered/libtempered/type_hid/ntc.c:20:60: warning: unused parameter â€˜tempCâ€™ [-Wunused-parameter]&lt;br /&gt;
 [ 42%] Building C object libtempered/CMakeFiles/tempered-shared.dir/type_hid/sht1x.c.o&lt;br /&gt;
 Linking C shared library libtempered.so&lt;br /&gt;
 [ 42%] Built target tempered-shared&lt;br /&gt;
 Scanning dependencies of target tempered-util-shared&lt;br /&gt;
 [ 50%] Building C object libtempered-util/CMakeFiles/tempered-util-shared.dir/temp-scale.c.o&lt;br /&gt;
 [ 57%] Building C object libtempered-util/CMakeFiles/tempered-util-shared.dir/dew-point.c.o&lt;br /&gt;
 [ 64%] Building C object libtempered-util/CMakeFiles/tempered-util-shared.dir/calibration.c.o&lt;br /&gt;
 Linking C shared library libtempered-util.so&lt;br /&gt;
 [ 64%] Built target tempered-util-shared&lt;br /&gt;
 Scanning dependencies of target hid-query&lt;br /&gt;
 [ 71%] Building C object utils/CMakeFiles/hid-query.dir/hid-query.c.o&lt;br /&gt;
 Linking C executable hid-query&lt;br /&gt;
 [ 71%] Built target hid-query&lt;br /&gt;
 Scanning dependencies of target tempered-exe&lt;br /&gt;
 [ 78%] Building C object utils/CMakeFiles/tempered-exe.dir/tempered.c.o&lt;br /&gt;
 Linking C executable tempered&lt;br /&gt;
 [ 78%] Built target tempered-exe&lt;br /&gt;
 Scanning dependencies of target enumerate&lt;br /&gt;
 [ 85%] Building C object examples/CMakeFiles/enumerate.dir/enumerate.c.o&lt;br /&gt;
 Linking C executable enumerate&lt;br /&gt;
 [ 85%] Built target enumerate&lt;br /&gt;
 Scanning dependencies of target read-all&lt;br /&gt;
 [ 92%] Building C object examples/CMakeFiles/read-all.dir/read-all.c.o&lt;br /&gt;
 Linking C executable read-all&lt;br /&gt;
 [ 92%] Built target read-all&lt;br /&gt;
 Scanning dependencies of target read-repeat&lt;br /&gt;
 [100%] Building C object examples/CMakeFiles/read-repeat.dir/read-repeat.c.o&lt;br /&gt;
 Linking C executable read-repeat&lt;br /&gt;
 [100%] Built target read-repeat&lt;br /&gt;
&lt;br /&gt;
* Install it!&lt;br /&gt;
 root@server:/usr/local/src/TEMPered# make install&lt;br /&gt;
 [ 42%] Built target tempered-shared&lt;br /&gt;
 [ 64%] Built target tempered-util-shared&lt;br /&gt;
 [ 71%] Built target hid-query&lt;br /&gt;
 [ 78%] Built target tempered-exe&lt;br /&gt;
 [ 85%] Built target enumerate&lt;br /&gt;
 [ 92%] Built target read-all&lt;br /&gt;
 [100%] Built target read-repeat&lt;br /&gt;
 Install the project...&lt;br /&gt;
 -- Install configuration: &amp;quot;&amp;quot;&lt;br /&gt;
 -- Installing: /usr/local/include/tempered.h&lt;br /&gt;
 -- Installing: /usr/local/lib/libtempered.so.0&lt;br /&gt;
 -- Installing: /usr/local/lib/libtempered.so&lt;br /&gt;
 -- Installing: /usr/local/include/tempered-util.h&lt;br /&gt;
 -- Installing: /usr/local/lib/libtempered-util.so.0&lt;br /&gt;
 -- Installing: /usr/local/lib/libtempered-util.so&lt;br /&gt;
 -- Installing: /usr/local/bin/hid-query&lt;br /&gt;
 -- Installing: /usr/local/bin/tempered&lt;br /&gt;
 -- Removed runtime path from &amp;quot;/usr/local/bin/tempered&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Use it!&lt;br /&gt;
 root@server# tempered -s Fahrenheit&lt;br /&gt;
 0004:0003:01 0: temperature 77.90 Â°F, relative humidity 47.2%, dew point 56.1 Â°F&lt;br /&gt;
&lt;br /&gt;
=== MRTG Setup ===&lt;br /&gt;
* SNMPD.conf&lt;br /&gt;
 exec temp /usr/local/sbin/gettemp.sh&lt;br /&gt;
 exec wundertemp /usr/local/sbin/getwundertemp.php&lt;br /&gt;
* gettemp.sh&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 &amp;lt;strike&amp;gt;temp=`/usr/local/bin/tempered -s F | cut -c29-33`&amp;lt;/strike&amp;gt;&lt;br /&gt;
 temp=`/usr/local/bin/tempered -s F | awk &amp;#039;NR==1{ print $4; }&amp;#039;&lt;br /&gt;
 echo $temp&lt;br /&gt;
* getwundertemp.php&lt;br /&gt;
 #!/usr/bin/php&lt;br /&gt;
 &amp;lt;?php&lt;br /&gt;
 &lt;br /&gt;
 //$zipcode = $argv[1];&lt;br /&gt;
 $zipcode = 12345;&lt;br /&gt;
 $page = file_get_contents(&amp;quot;http://www.wunderground.com/cgi-bin/findweather/getForecast?query=$zipcode&amp;amp;wuSelect=WEATHER&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
 $current_temp = 0;&lt;br /&gt;
 if (preg_match(&amp;#039;#pwsvariable=&amp;quot;tempf&amp;quot; english=&amp;quot;&amp;amp;deg;F&amp;quot; metric=&amp;quot;&amp;amp;deg;C&amp;quot; value=&amp;quot;([0-9\.]+)&amp;quot;&amp;gt;#&amp;#039;, $page, $matches)) {&lt;br /&gt;
     $current_temp = $matches[1];&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 if (preg_match(&amp;#039;#Heat Index:&amp;lt;/td&amp;gt;.*?&amp;lt;span class=&amp;quot;nobr&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;b&amp;quot;&amp;gt;([0-9\.]+)&amp;lt;/span&amp;gt;#s&amp;#039;, $page, $matches)) {&lt;br /&gt;
     $heat_index = $matches[1];&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 //echo &amp;quot;$current_temp\n$heat_index\non\non\n&amp;quot;;&lt;br /&gt;
 echo &amp;quot;$current_temp\n&amp;quot;;&lt;br /&gt;
 ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remote Config&lt;br /&gt;
 Target[temper]: extOutput.11&amp;amp;extOutput.13:STRING@SERVER.com&lt;br /&gt;
 AbsMax[temper]: 120&lt;br /&gt;
 MaxBytes[temper]: 100&lt;br /&gt;
 Options[temper]: nopercent,growright,nobanner,nolegend,noinfo,expscale,gauge&lt;br /&gt;
 Title[temper]: Server Room and Outside Temp&lt;br /&gt;
 PageTop[temper]: &amp;lt;B&amp;gt;Server Room and Outside Temp&amp;lt;/b&amp;gt;           &lt;br /&gt;
 YLegend[temper]: Temperature F&lt;br /&gt;
 ShortLegend[temper]: &amp;amp;nbsp;&amp;amp;deg;F      &lt;br /&gt;
 LegendI[temper]: Inside &amp;amp;nbsp;          &lt;br /&gt;
 LegendO[temper]: Outside &amp;amp;nbsp;&lt;br /&gt;
 Unscaled[temper]: dwmy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>Gqwill69</name></author>
	</entry>
</feed>