Difference between revisions of "Create SD Image Version 0.8.4"

From HiveTool
Jump to: navigation, search
(Remove packages we don't need)
(Install packages we need)
Line 113: Line 113:
  
 
=== Install packages we need ===
 
=== Install packages we need ===
 
  
 
  sudo apt-get -y install gawk bc apache2 libusb-dev libgd-graph-perl libexpat1-dev sqlite3
 
  sudo apt-get -y install gawk bc apache2 libusb-dev libgd-graph-perl libexpat1-dev sqlite3
 
  sudo apt-get install dh-autoreconf libudev-dev
 
  sudo apt-get install dh-autoreconf libudev-dev
 +
 +
 +
=== Install perl modules ===
 +
 +
sudo cpan GD::Text GD::Graph Date::Format XML::Simple DBI DBD::SQLite
 +
sudo cpan CGI
 +
 +
 +
Install perl DateTime module
 +
apt-get install libdatetime-perl

Revision as of 17:56, 26 March 2019

Bug fixes

  1. Fix problem with config.pl taking a long time to load
  2. Fix problem with data on charts not aligning properly.

Features

  1. Change graph generation to gnuplot.
  2. Added additional graphs for wind and battery voltage.
  3. Add support for BME680
  4. Add support for DS18B20
  5. Increase resolution of the weight from xxx.xx to xxx.xxx

Install gnuplot

sudo apt-get install gnuplot


add -r Retries option to driver wrappers

The maximum number of retries to read a sensor before giving up can be specified.

The shell script wrappers around the sensor drivers (dht22.sh, hx711.sh, hx711py.sh, etc) now accept a -r retries command line argument.

#
# Get the command line options (which device/GPIO pin to read), maximum number of times to try reading the sensor
#
while getopts "d:r:" option
do
        case "${option}"
        in
                d) DEVICE=${OPTARG};;
                r) MAXRETRIES=${OPTARG};;
        esac
done 

#
# If max number of retires not specified, default to 10
#
if [ -z $MAXRETRIES ]
then
  MAXRETRIES=10
fi 

#echo "DEVICE = $DEVICE"
#echo "MAXRETRIES = $MAXRETRIES"
#
# Loop up to MAXRETRIES times trying to read the sensor
#

DATA_GOOD=0
COUNTER=0
while [ $COUNTER -lt $MAXRETRIES ] && [ $DATA_GOOD -eq 0 ]
do



In config.pl, the -r1 option is added to the command line when the driver is called:


  if ( $hive_weight_sensor eq "cpw200plus" ) {
           $raw_hive_weight=`/usr/bin/sudo /home/hivetool/cpw200plus.sh -r1 -d $hive_weight_device`;
       }
  elsif ( $hive_weight_sensor eq "HX711") {
      $raw_hive_weight=`/usr/bin/sudo /home/hivetool/hx711.sh -r1 2>&1`;
       }
   elsif ( $hive_weight_sensor eq "HX711py") {
      $raw_hive_weight=`/usr/bin/sudo /home/hivetool/hx711py.sh -r1 2>&1`;
       }


How the image was created

Get latest Stretch image

Download, verify the SHA256 checksum, unzip, burn image.

Version: November 2018
Release date: 2018-11-13
Kernel version: 4.14

Verify the checksum:

$ openssl dgst -sha256 -hex 2018-11-13-raspbian-stretch-full.zip

SHA256(2018-11-13-raspbian-stretch-full.zip)= 0ca644539fdaf4e19ec7cebf9e61c049b82ba45b1a21cdec91fa54bd59d660d2

Unzip the image

$ unzip 2018-11-13-raspbian-stretch-full.zip
Archive:  2018-11-13-raspbian-stretch-full.zip
  inflating: 2018-11-13-raspbian-stretch-full.img

Copy it to the SD card

# dd bs=40M if=2018-11-13-raspbian-stretch-full.img of=/dev/sdc
126+1 records in
126+1 records out
5297405952 bytes (5.3 GB, 4.9 GiB) copied, 890.612 s, 5.9 MB/s

Boot

Stretch boots directly into the window system.

                     ....

Remove packages we don't need

sudo apt-get remove --purge penguinspuzzle scratch dillo squeak-vm squeak-plugins-scratch sonic-pi netsurf-gtk netsurf-common
sudo apt-get autoremove
sudo apt-get clean
rm -rf /home/pi/python_games
sudo rm -rf /opt/minecraft-pi


sudo apt-get remove --purge scratch dillo squeak-vm squeak-plugins-scratch sonic-pi netsurf-gtk netsurf-common


Install packages we need

sudo apt-get -y install gawk bc apache2 libusb-dev libgd-graph-perl libexpat1-dev sqlite3
sudo apt-get install dh-autoreconf libudev-dev


Install perl modules

sudo cpan GD::Text GD::Graph Date::Format XML::Simple DBI DBD::SQLite
sudo cpan CGI


Install perl DateTime module

apt-get install libdatetime-perl