Difference between revisions of "Software: Overview"

From HiveTool
Jump to: navigation, search
(Logging the Data)
(Scale)
Line 11: Line 11:
  
 
Talking to the scale is straight forward. Usually send a short character string to the scale and listen for a reply. For the Adam Equipment:  
 
Talking to the scale is straight forward. Usually send a short character string to the scale and listen for a reply. For the Adam Equipment:  
 +
<pre>
 
echo "G\r\n" > /dev/ttyS0
 
echo "G\r\n" > /dev/ttyS0
 
read -t 1 SCALE < /dev/ttyS0  
 
read -t 1 SCALE < /dev/ttyS0  
 +
</pre>
  
 
To use the Cisco Linksys WRT160NL wireless router to talk to the My Weigh HD300 scale, first detach a process that sleeps for a second and sends a carriage return. Then read the data. The detached bit sleeps for a second, allowing the read to get latched onto the serial port, and then sends the command, which promptly returns data.  
 
To use the Cisco Linksys WRT160NL wireless router to talk to the My Weigh HD300 scale, first detach a process that sleeps for a second and sends a carriage return. Then read the data. The detached bit sleeps for a second, allowing the read to get latched onto the serial port, and then sends the command, which promptly returns data.  
 +
 +
<pre>
 
'sleep 1;echo -e "\r" > /dev/ttyUSB0' &   
 
'sleep 1;echo -e "\r" > /dev/ttyUSB0' &   
read -t 3 SCALE /dev/ttyUSB0.
+
read -t 3 SCALE /dev/ttyUSB0.
 +
</pre>
  
 
=== Temperature Sensors ===
 
=== Temperature Sensors ===

Revision as of 04:52, 21 December 2013

This project uses free open source software (FOSS). The operating system is Linux although everything should run under Windows. The Perl module GD::Graph is used to plot the data. The graphs and data are displayed with a web server, usually Apache. More detailed installation instructions are on the Forums. The code will be available at GitHub.

Linux Distributions

Linux distros that have been tested are:

  1. Debian Wheezy
  2. Lubuntu (lightweight Ubuntu)
  3. Slackware 13.0

Reading the Sensors

Scale

Talking to the scale is straight forward. Usually send a short character string to the scale and listen for a reply. For the Adam Equipment:

echo "G\r\n" > /dev/ttyS0
read -t 1 SCALE < /dev/ttyS0 

To use the Cisco Linksys WRT160NL wireless router to talk to the My Weigh HD300 scale, first detach a process that sleeps for a second and sends a carriage return. Then read the data. The detached bit sleeps for a second, allowing the read to get latched onto the serial port, and then sends the command, which promptly returns data.

'sleep 1;echo -e "\r" > /dev/ttyUSB0' &  
read -t 3 SCALE /dev/ttyUSB0.

Temperature Sensors

Logging the Data

Every 5 minutes cron kicks off the bash script hive.sh that reads the sensors. The data is appended to a flat text log file hive.log and written to the temporary file hive.xml in xml format. cURL is used to send the xml file to a hosted web server where a row is inserted into a database.

Graphing the Data

GD::Graph

The Perl module GD::Graph is used to plot the data.

Displaying the Data

Apache Web Server

IceCast

ffserver