Aggiornato driver rainsensorqty alla versione 0.2.0
This commit is contained in:
@@ -1,2 +1,98 @@
|
|||||||
# Fake driver for sample and testing
|
#
|
||||||
|
# Driver rainsensorqty - driver for measure the rain volume
|
||||||
|
# Author: androtto
|
||||||
|
# file README.md
|
||||||
|
# Version: 0.2.0
|
||||||
|
# Data: 11/Aug/2019
|
||||||
|
|
||||||
|
|
||||||
|
FILE DI CONFIGURAZIONE /etc/piGarden.conf:
|
||||||
|
-----------------------------------------
|
||||||
|
NOTA: vedere nella directory conf_example il file esempio piu' aggiornato!
|
||||||
|
|
||||||
|
per attivare il driver è necessario inserire la seguente variabile nel file di configurazion
|
||||||
|
RAIN_GPIO="drv:rainsensorqty:25" # Physical 22 - wPi 6
|
||||||
|
|
||||||
|
la variabile seguente è impiegata anche da drvrainsensorqty per rilevare la chiusura del contatto magnetico che, in un circuito pull-up, è lo stato 1.
|
||||||
|
# Valore in ingresso sul gpio definito in RAIN_GPIO che indica lo stato di pioggia
|
||||||
|
RAIN_GPIO_STATE=1
|
||||||
|
le seguenti variabili controllano il driver come descritto:
|
||||||
|
RAINSENSORQTY_LOOPSFORSETRAINING=16 # dopo 10 impulsi, 10 vaschette riempite si considera pioggia
|
||||||
|
RAINSENSORQTY_SECSBETWEENRAINEVENT=10800 # =3h, significa che dopo 3 si resetta il numero di vaschette da riempire e solo dopo il riempimento del numero di vaschette si considera una nuova pioggia
|
||||||
|
infine la variabile seguente è la quantita' di acqua espressa in mm di precipitazioni:
|
||||||
|
RAINSENSORQTY_MMEACH=0.33 # see RAINSENSORQTY driver readme for details
|
||||||
|
|
||||||
|
CALIBRAZIONE SENSORE PIOGGIA
|
||||||
|
----------------------------
|
||||||
|
secondo il seguente processo da me effettuato sul mio misuratore di pioggia:
|
||||||
|
Ho erogato 18 ml di acqua nel rain gauge che hanno prodotto 10 impulsi; pertanto il riempimento di 1.8 ml ha causato un impulso, 1 ml = 1000 mmc (mm cubici),
|
||||||
|
1.8 ml sono pari a 1800 mmc
|
||||||
|
la superficie della vaschetta in mmq è pari a 110 mm x 55 mm = 5500 mmq
|
||||||
|
volume / superficie mi da' l'altezza, quindi 1800 mmc / 5500 mmq = 0.32727273 mm
|
||||||
|
se fossero stati 1.7 ml di acqua per ogni impulso/vaschetta riempita, la varibile sarebbe stata impostata a 0.30909091 mm
|
||||||
|
|
||||||
|
COMANDI SPECIALI
|
||||||
|
----------------
|
||||||
|
nella sottidirectory command sono prensenti:
|
||||||
|
commands/rainsensorqty_CHECK.sh
|
||||||
|
chiama la funzione di verifica piggio, la medesima chiamata da check_rain_sensor
|
||||||
|
commands/rainsensorqty_HISTORY.sh
|
||||||
|
visualizza lo storico della pioggia
|
||||||
|
commands/rainsensorqty_INIT.sh
|
||||||
|
inizializza il driver eseguendo lo script di monitoring - normalmente tale processo avviene da piGarden.sh
|
||||||
|
utile quando si vuole testare dei cambiamenti o se necessario riavviare dopo il kill del comando successivo
|
||||||
|
commands/rainsensorqty_KILL.sh
|
||||||
|
killa i processi di monitoring ed eventuali figli
|
||||||
|
commands/rainsensorqty_RAINNOW.sh
|
||||||
|
simula una pioggia
|
||||||
|
|
||||||
|
ULTERIORI VARIABILI in config.include.sh
|
||||||
|
----------------------------------------
|
||||||
|
esistono ulteriori variabili che potrebbe essere necessario variare
|
||||||
|
|
||||||
|
RAINSENSOR_ANTIBOUNCE=0.3 # 0.3 seconds for manage antibounce of reed contact
|
||||||
|
server per ritardare la lettura di un secondo impulso falso causato dal rimbalzo del contatto magnetico
|
||||||
|
|
||||||
|
RAINSENSORQTY_verbose="yes"
|
||||||
|
aumenta il livello di verbosita' nei file di log
|
||||||
|
|
||||||
|
RAINSENSORQTY_LASTRAIN="$STATUS_DIR/rainsensorqty_lastrain"
|
||||||
|
memorizza l'ultima pioggia
|
||||||
|
RAINSENSORQTY_HISTORY="$STATUS_DIR/rainsensorqty_history"
|
||||||
|
memorizza tutte le piogge permettendo di visualizzarlo storico (commands/rainsensorqty_HISTORY.sh)
|
||||||
|
|
||||||
|
RAINSENSORQTY_MONITORLOG="$DIR_SCRIPT/log/rainsensorqty_monitor.log"
|
||||||
|
log del script di monitoring, popolato solo se RAINSENSORQTY_verbose="yes"
|
||||||
|
|
||||||
|
RAINSENSORQTY_MONPID="$TMP_PATH/rainsensorqty_monitor.pid"
|
||||||
|
file che viene popolato con il pid dello script di monitoring
|
||||||
|
|
||||||
|
RAINSENSORQTY_DIR="$DIR_SCRIPT/drv/rainsensorqty"
|
||||||
|
home directory del driver
|
||||||
|
|
||||||
|
monitor_sh="$RAINSENSORQTY_DIR/drv_rainsensorqty_monitor.sh"
|
||||||
|
script di monitoring
|
||||||
|
lo script eredita le varibili di ambiente da .set_var in $RAINSENSORQTY_DIR
|
||||||
|
|
||||||
|
#rising means waiting for 1 status (from 0)
|
||||||
|
#falling means waiting for 0 status (from 1)
|
||||||
|
#RAINSENSORQTY_PULSE=rising # pull-down circuit (rest status is 0)
|
||||||
|
#RAINSENSORQTY_PULSE=falling # pull-up circuit (rest status is 1)
|
||||||
|
if (( RAIN_GPIO_STATE = 1 )) ; then
|
||||||
|
RAINSENSORQTY_PULSE=rising # pull-down circuit (rest status is 0)
|
||||||
|
fi
|
||||||
|
if (( RAIN_GPIO_STATE = 0 )) ; then
|
||||||
|
RAINSENSORQTY_PULSE=falling # pull-up circuit (rest status is 1)
|
||||||
|
fi
|
||||||
|
if [[ -z $RAINSENSORQTY_PULSE ]] ; then
|
||||||
|
echo "ERROR: RAIN_GPIO_STATE non set in piGarden.conf"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
lo script di monitoring ascolta il cambiamento di stato da quello di riposo allo stato di impulso (chiusura del contatto reed).
|
||||||
|
dipendentemente dal circuto implementato, se lo stato di riposo e' 0, lo script attende la variazione verso 1 (rising)
|
||||||
|
se lo stato di riposo e' 1, lo script attende la variazione verso 0 (falling)
|
||||||
|
la variabile RAINSENSORQTY_PULSE viene impostata secondo il valore di RAIN_GPIO_STATE presente in /etc/piGarden.conf
|
||||||
|
cioe' il valore che ci si aspetta per registrare lo stato di pioggia
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
40
drv/rainsensorqty/commands/rainsensorqty_CHECK.sh
Executable file
40
drv/rainsensorqty/commands/rainsensorqty_CHECK.sh
Executable file
@@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Driver rainsensorqty - driver for measure the rain volume
|
||||||
|
# Author: androtto
|
||||||
|
# file "test_rainsensorqty_CHECK.sh"
|
||||||
|
# test script for checking rain status using drv_rainsensorqty_rain_sensor_get function
|
||||||
|
# Version: 0.2.0
|
||||||
|
# Data: 11/Aug/2019
|
||||||
|
|
||||||
|
SCRIPTDIR="$(cd `dirname $0` ; pwd )"
|
||||||
|
SCRIPTNAME=${0##*/}
|
||||||
|
cd $SCRIPTDIR/.. # command is a subdirectory of driver
|
||||||
|
|
||||||
|
DIR_SCRIPT=/home/pi/piGarden # home directory of piGarden
|
||||||
|
CONFIG_ETC="/etc/piGarden.conf"
|
||||||
|
TMP_PATH="/run/shm"
|
||||||
|
if [ ! -d "$TMP_PATH" ]; then
|
||||||
|
TMP_PATH="/tmp"
|
||||||
|
fi
|
||||||
|
|
||||||
|
LOG_OUTPUT_DRV_FILE="$DIR_SCRIPT/log/$LOG_OUTPUT_DRV_FILE"
|
||||||
|
|
||||||
|
. $CONFIG_ETC
|
||||||
|
|
||||||
|
. ./common.include.sh
|
||||||
|
. ./config.include.sh
|
||||||
|
. ./init.include.sh
|
||||||
|
. ./rainsensor.include.sh
|
||||||
|
|
||||||
|
# restituisce 0 se piove, e nell'output di testo il valore di "$RAIN_GPIO_STATE"
|
||||||
|
# restituisce 99 se non piove, output "norain"
|
||||||
|
# esce con 1 se non c'e' il monitoring, output "ERROR"
|
||||||
|
|
||||||
|
drv_rainsensorqty_rain_sensor_get
|
||||||
|
case $? in
|
||||||
|
0) echo "NORMAL: it's raining" ;;
|
||||||
|
99) echo "NORMAL: it's not raining" ;;
|
||||||
|
1) echo "ERROR: monitor process $DIR_SCRIPT/drv/rainsensorqty/drv_rainsensorqty_monitor.sh is not running" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
40
drv/rainsensorqty/commands/rainsensorqty_HISTORY.sh
Executable file
40
drv/rainsensorqty/commands/rainsensorqty_HISTORY.sh
Executable file
@@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Driver rainsensorqty - driver for measure the rain volume
|
||||||
|
# Author: androtto
|
||||||
|
# file "test_rainsensorqty_CHECK.sh"
|
||||||
|
# test script for checking rain status using drv_rainsensorqty_rain_sensor_get function
|
||||||
|
# Version: 0.2.0
|
||||||
|
# Data: 11/Aug/2019
|
||||||
|
|
||||||
|
SCRIPTDIR="$(cd `dirname $0` ; pwd )"
|
||||||
|
SCRIPTNAME=${0##*/}
|
||||||
|
cd $SCRIPTDIR/.. # command is a subdirectory of driver
|
||||||
|
|
||||||
|
DIR_SCRIPT=/home/pi/piGarden # home directory of piGarden
|
||||||
|
CONFIG_ETC="/etc/piGarden.conf"
|
||||||
|
TMP_PATH="/run/shm"
|
||||||
|
if [ ! -d "$TMP_PATH" ]; then
|
||||||
|
TMP_PATH="/tmp"
|
||||||
|
fi
|
||||||
|
|
||||||
|
LOG_OUTPUT_DRV_FILE="$DIR_SCRIPT/log/$LOG_OUTPUT_DRV_FILE"
|
||||||
|
|
||||||
|
. $CONFIG_ETC
|
||||||
|
|
||||||
|
. ./common.include.sh
|
||||||
|
. ./config.include.sh
|
||||||
|
. ./init.include.sh
|
||||||
|
. ./rainsensor.include.sh
|
||||||
|
|
||||||
|
echo "RAIN HISTORY"
|
||||||
|
rain_history
|
||||||
|
|
||||||
|
cat $RAINSENSORQTY_HISTORY | while read line
|
||||||
|
do
|
||||||
|
set -- ${line//:/ }
|
||||||
|
when=$1
|
||||||
|
howmuch=$2
|
||||||
|
printf "RAINED on %s for %.2f mm\n" "$(date --date="@$1")" $( $JQ -n "$howmuch * $RAINSENSORQTY_MMEACH" )
|
||||||
|
done
|
||||||
|
|
||||||
29
drv/rainsensorqty/commands/rainsensorqty_INIT.sh
Executable file
29
drv/rainsensorqty/commands/rainsensorqty_INIT.sh
Executable file
@@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Driver rainsensorqty - driver for measure the rain volume
|
||||||
|
# Author: androtto
|
||||||
|
# file "test_rainsensorqty_INIT.sh"
|
||||||
|
# test script for initialize driver and executing monitor process
|
||||||
|
# Version: 0.2.0
|
||||||
|
# Data: 11/Aug/2019
|
||||||
|
|
||||||
|
SCRIPTDIR="$(cd `dirname $0` ; pwd )"
|
||||||
|
SCRIPTNAME=${0##*/}
|
||||||
|
cd $SCRIPTDIR/.. # command is a subdirectory of driver
|
||||||
|
|
||||||
|
DIR_SCRIPT=/home/pi/piGarden # home directory of piGarden
|
||||||
|
CONFIG_ETC="/etc/piGarden.conf"
|
||||||
|
TMP_PATH="/run/shm"
|
||||||
|
if [ ! -d "$TMP_PATH" ]; then
|
||||||
|
TMP_PATH="/tmp"
|
||||||
|
fi
|
||||||
|
|
||||||
|
. $CONFIG_ETC
|
||||||
|
|
||||||
|
. ./config.include.sh
|
||||||
|
. ./common.include.sh
|
||||||
|
. ./init.include.sh
|
||||||
|
. ./rainsensor.include.sh
|
||||||
|
|
||||||
|
drv_rainsensorqty_rain_sensor_init
|
||||||
|
|
||||||
|
drv_rainsensorqty_init
|
||||||
48
drv/rainsensorqty/commands/rainsensorqty_KILL.sh
Executable file
48
drv/rainsensorqty/commands/rainsensorqty_KILL.sh
Executable file
@@ -0,0 +1,48 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
SCRIPTDIR="$(cd `dirname $0` ; pwd )"
|
||||||
|
SCRIPTNAME=${0##*/}
|
||||||
|
cd $SCRIPTDIR/.. # command is a subdirectory of driver
|
||||||
|
|
||||||
|
DIR_SCRIPT=/home/pi/piGarden # home directory of piGarden
|
||||||
|
CONFIG_ETC="/etc/piGarden.conf"
|
||||||
|
TMP_PATH="/run/shm"
|
||||||
|
if [ ! -d "$TMP_PATH" ]; then
|
||||||
|
TMP_PATH="/tmp"
|
||||||
|
fi
|
||||||
|
|
||||||
|
. $CONFIG_ETC
|
||||||
|
|
||||||
|
. ./config.include.sh
|
||||||
|
. ./common.include.sh
|
||||||
|
. ./init.include.sh
|
||||||
|
. ./rainsensor.include.sh
|
||||||
|
|
||||||
|
# check if rain monitor process is running...
|
||||||
|
if [[ -f "$RAINSENSORQTY_MONPID" ]] ; then
|
||||||
|
pid="$( < "$RAINSENSORQTY_MONPID" )"
|
||||||
|
if ps -fp $pid >/dev/null ; then
|
||||||
|
echo "process $pid pid and its child(ren)"
|
||||||
|
children_pid="$(ps -ef| awk "\$3==$pid {print \$2}")"
|
||||||
|
ps -fp $pid
|
||||||
|
ps -fp $children_pid | tail +2
|
||||||
|
echo -e "\nsending TERM signal to $pid and its child(ren)"
|
||||||
|
echo kill $children_pid
|
||||||
|
echo kill $pid
|
||||||
|
kill $children_pid
|
||||||
|
kill $pid
|
||||||
|
echo -e "\nchecking $pid pid and its child(ren) are still alive"
|
||||||
|
for process in $pid $children_pid
|
||||||
|
do
|
||||||
|
if ps -fp $process >/dev/null ; then
|
||||||
|
echo "$process is still alive"
|
||||||
|
else
|
||||||
|
echo "$process is dead"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "no RAIN process alive"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
27
drv/rainsensorqty/commands/rainsensorqty_RAINNOW.sh
Executable file
27
drv/rainsensorqty/commands/rainsensorqty_RAINNOW.sh
Executable file
@@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Driver rainsensorqty - driver for measure the rain volume
|
||||||
|
# Author: androtto
|
||||||
|
# file "test_rainsensorqty_RAINNOW.sh"
|
||||||
|
# test script for simulate rain ... now!
|
||||||
|
# Version: 0.2.0
|
||||||
|
# Data: 11/Aug/2019
|
||||||
|
|
||||||
|
SCRIPTDIR="$(cd `dirname $0` ; pwd )"
|
||||||
|
SCRIPTNAME=${0##*/}
|
||||||
|
cd $SCRIPTDIR/.. # command is a subdirectory of driver
|
||||||
|
|
||||||
|
DIR_SCRIPT=/home/pi/piGarden # home directory of piGarden
|
||||||
|
CONFIG_ETC="/etc/piGarden.conf"
|
||||||
|
TMP_PATH="/run/shm"
|
||||||
|
if [ ! -d "$TMP_PATH" ]; then
|
||||||
|
TMP_PATH="/tmp"
|
||||||
|
fi
|
||||||
|
|
||||||
|
. $CONFIG_ETC
|
||||||
|
|
||||||
|
. ./config.include.sh
|
||||||
|
. ./common.include.sh
|
||||||
|
. ./init.include.sh
|
||||||
|
. ./rainsensor.include.sh
|
||||||
|
|
||||||
|
echo "$(date +%s):$RAINSENSORQTY_LOOPSFORSETRAINING" > ${RAINSENSORQTY_LASTRAIN}
|
||||||
@@ -1,17 +1,37 @@
|
|||||||
#
|
#
|
||||||
# Funzioni comuni utilizzate dal driver
|
# Driver rainsensorqty - driver for measure the rain volume
|
||||||
#
|
# Author: androtto
|
||||||
|
# file "common.include.sh"
|
||||||
|
# common functions used by driver
|
||||||
|
# Version: 0.2.0
|
||||||
|
# Data: 11/Aug/2019
|
||||||
|
|
||||||
|
|
||||||
|
#note:
|
||||||
#RAINSENSORQTY_MONPID="$TMP_PATH/rainsensorqty_monitor.pid"
|
#RAINSENSORQTY_MONPID="$TMP_PATH/rainsensorqty_monitor.pid"
|
||||||
#
|
#
|
||||||
|
|
||||||
|
d() # short date & time
|
||||||
function drv_rainsensorqty_writelog {
|
{
|
||||||
#2 variables - $1 function, $2 message
|
date '+%X-%x'
|
||||||
echo -e "$1 - `date`\t\t$2" >> "$LOG_OUTPUT_DRV_FILE"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function drv_rainsensorqty_check () {
|
drv_rainsensorqty_writelog()
|
||||||
|
{
|
||||||
|
#2 variables - $1 function, $2 message
|
||||||
|
if [[ $2 =~ ERROR || $2 =~ WARNING || $2 =~ RAIN || $RAINSENSORQTY_verbose = yes ]] ; then
|
||||||
|
echo -e "$1 - `d`\t\t$2" >> "$LOG_OUTPUT_DRV_FILE"
|
||||||
|
# if [[ $($WC -c <"$LOG_OUTPUT_DRV_FILE") > $LOG_FILE_MAX_SIZE )) ; then
|
||||||
|
# $GZIP "$LOG_OUTPUT_DRV_FILE"
|
||||||
|
# $MV "${LOG_OUTPUT_DRV_FILE}.gz" "${LOG_OUTPUT_DRV_FILE}.$(date +%Y%m%d%H%M).gz"
|
||||||
|
# fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
drv_rainsensorqty_check()
|
||||||
|
{
|
||||||
local f="drv_rainsensorqty_check"
|
local f="drv_rainsensorqty_check"
|
||||||
|
|
||||||
if [[ -f "$RAINSENSORQTY_MONPID" ]] ; then
|
if [[ -f "$RAINSENSORQTY_MONPID" ]] ; then
|
||||||
@@ -21,7 +41,7 @@ function drv_rainsensorqty_check () {
|
|||||||
drv_rainsensorqty_writelog $f "NORMAL: $pid pid is running"
|
drv_rainsensorqty_writelog $f "NORMAL: $pid pid is running"
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
drv_rainsensorqty_writelog $f "$pid pid monitor process NOT running - $RAINSENSORQTY_MONPID file contains $pid"
|
drv_rainsensorqty_writelog $f "ERROR: $pid pid monitor process NOT running - $RAINSENSORQTY_MONPID file contains $pid"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
@@ -29,3 +49,21 @@ function drv_rainsensorqty_check () {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
en_echo() # enhanched echo - check verbose variable
|
||||||
|
{
|
||||||
|
[[ $RAINSENSORQTY_verbose = yes ]] && echo "$(d) $*"
|
||||||
|
}
|
||||||
|
|
||||||
|
rain_history()
|
||||||
|
{
|
||||||
|
[[ ! -f $RAINSENSORQTY_HISTORY ]] && touch $RAINSENSORQTY_HISTORY
|
||||||
|
[[ ! -f $RAINSENSORQTY_LASTRAIN ]] && return 1
|
||||||
|
if grep -q ^$(<$RAINSENSORQTY_LASTRAIN)$ $RAINSENSORQTY_HISTORY ; then
|
||||||
|
: # do nothing
|
||||||
|
return 2
|
||||||
|
else
|
||||||
|
cat $RAINSENSORQTY_LASTRAIN >> $RAINSENSORQTY_HISTORY
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# cfg file version 0.2.0
|
||||||
|
# Id del gpio usato per collegare il sensore di rilevamento pioggia
|
||||||
|
# attraverso il driver rainsensorqty
|
||||||
|
RAIN_GPIO="drv:rainsensorqty:25" # Physical 22 - wPi 6
|
||||||
|
|
||||||
|
# Valore in ingresso sul gpio definito in RAIN_GPIO che indica lo stato di pioggia
|
||||||
|
# variabile usata anche da drv:rainsensorqty, se e' a 1, significa che il reed contact e' collegato ad un circuito pull-down, vuol dire che attende l'impulso a 1 per contare le vaschette, normalmente e' a 0.
|
||||||
|
# se e' a 0, significa che il reed contact e' collegato ad un circuito pull-up, vuol dire che attende l'impulso a 0 per contare le vaschette, normalmente e' a 0.
|
||||||
|
RAIN_GPIO_STATE=0
|
||||||
|
|
||||||
|
RAINSENSORQTY_LOOPSFORSETRAINING=16 # dopo 16 impulsi, 16 vaschette riempite si considera pioggia
|
||||||
|
RAINSENSORQTY_SECSBETWEENRAINEVENT=10800 # =3h, significa che dopo 3 ore si resetta il numero di vaschette riempire e solo dopo un nuovo ciclo di riempimento si considera una nuova pioggia
|
||||||
|
|
||||||
|
RAINSENSORQTY_MMEACH=0.33 # see RAINSENSORQTY driver readme for details
|
||||||
@@ -1,30 +1,39 @@
|
|||||||
#
|
#
|
||||||
# File di configurazione del driver
|
# Driver rainsensorqty - driver for measure the rain volume
|
||||||
#
|
# Author: androtto
|
||||||
|
# file "config.include.sh"
|
||||||
|
# specific driver config file
|
||||||
|
# Version: 0.2.0
|
||||||
|
# Data: 11/Aug/2019
|
||||||
|
|
||||||
|
RAINSENSOR_ANTIBOUNCE=0.3 # 0.3 seconds for manage antibounce of reed contact
|
||||||
|
|
||||||
|
RAINSENSORQTY_verbose="no" # yes/no
|
||||||
|
|
||||||
declare -g RAINSENSORQTY_LASTRAIN
|
|
||||||
RAINSENSORQTY_LASTRAIN="$STATUS_DIR/rainsensorqty_lastrain"
|
RAINSENSORQTY_LASTRAIN="$STATUS_DIR/rainsensorqty_lastrain"
|
||||||
|
RAINSENSORQTY_HISTORY="$STATUS_DIR/rainsensorqty_history"
|
||||||
|
|
||||||
#not used, to be checked
|
|
||||||
#declare -g RAINSENSORQTY_LOG
|
|
||||||
#RAINSENSORQTY_LOG="$DIR_SCRIPT/log/rainsensorqty.log"
|
|
||||||
|
|
||||||
declare -g RAINSENSORQTY_MONITORLOG
|
|
||||||
RAINSENSORQTY_MONITORLOG="$DIR_SCRIPT/log/rainsensorqty_monitor.log"
|
RAINSENSORQTY_MONITORLOG="$DIR_SCRIPT/log/rainsensorqty_monitor.log"
|
||||||
|
|
||||||
declare -g RAINSENSORQTY_PID
|
|
||||||
RAINSENSORQTY_MONPID="$TMP_PATH/rainsensorqty_monitor.pid"
|
RAINSENSORQTY_MONPID="$TMP_PATH/rainsensorqty_monitor.pid"
|
||||||
|
|
||||||
declare -g RAINSENSORQTY_DIR
|
|
||||||
RAINSENSORQTY_DIR="$DIR_SCRIPT/drv/rainsensorqty"
|
RAINSENSORQTY_DIR="$DIR_SCRIPT/drv/rainsensorqty"
|
||||||
|
|
||||||
declare -g RAINSENSORQTY_PULSE
|
monitor_sh="$RAINSENSORQTY_DIR/drv_rainsensorqty_monitor.sh"
|
||||||
RAINSENSORQTY_PULSE=falling
|
|
||||||
|
|
||||||
declare -g RAINSENSORQTY_WAIT
|
|
||||||
RAINSENSORQTY_WAIT=rising
|
|
||||||
|
|
||||||
# mm of water for each pulse - default
|
#rising means waiting for 1 status (from 0)
|
||||||
declare -g RAINSENSORQTY_MMEACH
|
#falling means waiting for 0 status (from 1)
|
||||||
RAINSENSORQTY_MMEACH=0.303030303
|
#RAINSENSORQTY_PULSE=rising # pull-down circuit (rest status is 0)
|
||||||
|
#RAINSENSORQTY_PULSE=falling # pull-up circuit (rest status is 1)
|
||||||
|
if (( RAIN_GPIO_STATE = 1 )) ; then
|
||||||
|
RAINSENSORQTY_PULSE=rising # pull-down circuit (rest status is 0)
|
||||||
|
fi
|
||||||
|
if (( RAIN_GPIO_STATE = 0 )) ; then
|
||||||
|
RAINSENSORQTY_PULSE=falling # pull-up circuit (rest status is 1)
|
||||||
|
fi
|
||||||
|
if [[ -z $RAINSENSORQTY_PULSE ]] ; then
|
||||||
|
echo "ERROR: RAIN_GPIO_STATE non set in piGarden.conf"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|||||||
75
drv/rainsensorqty/drv_rainsensorqty_monitor.sh
Executable file
75
drv/rainsensorqty/drv_rainsensorqty_monitor.sh
Executable file
@@ -0,0 +1,75 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Driver rainsensorqty - driver for measure the rain volume
|
||||||
|
# Author: androtto
|
||||||
|
# file "drv_rainsensorqty_monitor.sh"
|
||||||
|
# monitor script
|
||||||
|
# Version: 0.2.0
|
||||||
|
# Data: 11/Aug/2019
|
||||||
|
|
||||||
|
###############
|
||||||
|
# MAIN #
|
||||||
|
###############
|
||||||
|
|
||||||
|
DIRNAME="$( dirname $0 )"
|
||||||
|
f="$(basename $0)"
|
||||||
|
. $DIRNAME/common.include.sh
|
||||||
|
set_var="$DIRNAME/.set_var"
|
||||||
|
|
||||||
|
if [[ -f "$set_var" ]] ; then
|
||||||
|
en_echo "NORMAL: file $set_var found - getting variables"
|
||||||
|
. "$set_var"
|
||||||
|
else
|
||||||
|
echo "ERROR: $set_var not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
#drvt="$( echo $RAIN_GPIO | $CUT -f 1 -d: )"
|
||||||
|
#drv="$( echo $RAIN_GPIO | $CUT -f 2 -d: )"
|
||||||
|
gpio_port="$( echo $RAIN_GPIO | $CUT -f 3 -d: )"
|
||||||
|
|
||||||
|
# check if no other rain monitor process running...
|
||||||
|
if [[ -f "$RAINSENSORQTY_MONPID" ]] ; then
|
||||||
|
pid="$( < "$RAINSENSORQTY_MONPID" )"
|
||||||
|
if ps -fp $pid >/dev/null ; then
|
||||||
|
drv_rainsensorqty_writelog $f "ERROR monitor process already running\n$( ps -fp $pid )"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $$ > $RAINSENSORQTY_MONPID
|
||||||
|
drv_rainsensorqty_writelog $f "NORMAL - $$ pid monitor process started - see $RAINSENSORQTY_MONPID"
|
||||||
|
|
||||||
|
# init variables
|
||||||
|
MMEACH="$RAINSENSORQTY_MMEACH"
|
||||||
|
(( counter=0 ))
|
||||||
|
rain_history
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
en_echo "---- NEW RUN "
|
||||||
|
|
||||||
|
# loop forever
|
||||||
|
while true
|
||||||
|
do
|
||||||
|
before=`date +%s`
|
||||||
|
sleep $RAINSENSOR_ANTIBOUNCE
|
||||||
|
en_echo "WAITING FOR PULSE"
|
||||||
|
$GPIO -g wfi $gpio_port $RAINSENSORQTY_PULSE
|
||||||
|
now=`date +%s`
|
||||||
|
(( elapsed = now - before ))
|
||||||
|
if (( elapsed >= RAINSENSORQTY_SECSBETWEENRAINEVENT )) ; then
|
||||||
|
(( counter=0 ))
|
||||||
|
drv_rainsensorqty_writelog $f "first drops after $elapsed seconds since last rain ( greater than $RAINSENSORQTY_SECSBETWEENRAINEVENT )- new cycle - waiting for $( $JQ -n "$RAINSENSORQTY_LOOPSFORSETRAINING * $MMEACH" )" &
|
||||||
|
rain_history
|
||||||
|
fi
|
||||||
|
(( counter+=1 ))
|
||||||
|
en_echo "PULSE RECEIVED (counter $counter)"
|
||||||
|
MMWATER=$( $JQ -n "$counter*$MMEACH" )
|
||||||
|
text=$(printf "%.2f mm height (loop %d)" $MMWATER $counter )
|
||||||
|
if (( counter >= RAINSENSORQTY_LOOPSFORSETRAINING )) ; then
|
||||||
|
drv_rainsensorqty_writelog $f "RAINING - $text" &
|
||||||
|
echo "$(date +%s):$counter" > ${RAINSENSORQTY_LASTRAIN}
|
||||||
|
else
|
||||||
|
drv_rainsensorqty_writelog $f "now is $text" &
|
||||||
|
fi
|
||||||
|
done
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
#
|
#
|
||||||
|
# Driver rainsensorqty - driver for measure the rain volume
|
||||||
|
# Author: androtto
|
||||||
|
# file "init.include.sh"
|
||||||
# Inizializza il driver, viene richiamata nella funzione init di piGarden
|
# Inizializza il driver, viene richiamata nella funzione init di piGarden
|
||||||
#
|
# Version: 0.2.0
|
||||||
# variables from general config file /etc/piGarden.conf
|
# Data: 11/Aug/2019
|
||||||
#RAINSENSORQTY_LOOPSFORSETRAINING=10 # dopo 10 impulsi, 10 vaschette riempite si considera pioggia
|
|
||||||
#RAINSENSORQTY_SECSBETWEENRAINEVENT=10800 # =3h, significa che dopo 3 si resetta il numero di vaschette da riempire e solo dopo il riempimento del numero di vaschette si considera una nuova pioggia
|
|
||||||
|
|
||||||
function drv_rainsensorqty_init {
|
function drv_rainsensorqty_init {
|
||||||
local f="drv_rainsensorqty_init"
|
local f="drv_rainsensorqty_init"
|
||||||
local monitor_sh="$RAINSENSORQTY_DIR/rainsensorqty_monitor.sh"
|
|
||||||
|
|
||||||
# format RAIN_GPIO="drv:rainsensorqty:25"
|
# format RAIN_GPIO="drv:rainsensorqty:25"
|
||||||
|
|
||||||
drv_rainsensorqty_writelog $f "NORMAL - executing $monitor_sh"
|
drv_rainsensorqty_writelog $f "NORMAL: executing $monitor_sh"
|
||||||
|
|
||||||
# esegue rainmonitor
|
# esegue rainmonitor
|
||||||
if [ -x "$monitor_sh" ] ; then
|
if [ -x "$monitor_sh" ] ; then
|
||||||
@@ -21,8 +21,6 @@ function drv_rainsensorqty_init {
|
|||||||
else
|
else
|
||||||
drv_rainsensorqty_writelog $f "ERROR: cannot find \"\$monitor_sh \" "
|
drv_rainsensorqty_writelog $f "ERROR: cannot find \"\$monitor_sh \" "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
set | $GREP -e ^GPIO -e ^LOG -e ^CUT -e ^JQ -e ^RAIN -e ^SCR -e ^TMP > "$RAINSENSORQTY_DIR/set_var"
|
set | $GREP -e ^GPIO -e ^LOG -e ^CUT -e ^JQ -e ^RAIN -e ^SCR -e ^TMP > "${RAINSENSORQTY_DIR}/.set_var"
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Driver rainsensorqty - driver for measure the rain volume, for rain meter, for rain gauge
|
||||||
|
# Author: androtto
|
||||||
|
# file "rainsensor.include.sh"
|
||||||
|
# functions called by piGarden.sh
|
||||||
|
# Version: 0.1.2
|
||||||
|
# Data: 19/Mar/2019
|
||||||
|
# fixed output drv_rainsensorqty_rain_sensor_get
|
||||||
|
|
||||||
#
|
#
|
||||||
# Inizializza il sensore di rilevamento pioggia
|
# Inizializza il sensore di rilevamento pioggia
|
||||||
#
|
#
|
||||||
# $1 identificativo gpio del sensore di pioggia
|
# $1 identificativo gpio del sensore di pioggia
|
||||||
#
|
#
|
||||||
function drv_rainsensorqty_rain_sensor_init {
|
drv_rainsensorqty_rain_sensor_init()
|
||||||
|
{
|
||||||
drv_rainsensorqty_writelog "drv_rainsensorqty_rain_sensor_init" $1
|
drv_rainsensorqty_writelog "drv_rainsensorqty_rain_sensor_init" $1
|
||||||
|
|
||||||
local drvt="$( echo $RAIN_GPIO | $CUT -f 1 -d: )"
|
local drvt="$( echo $RAIN_GPIO | $CUT -f 1 -d: )"
|
||||||
@@ -19,35 +29,49 @@ function drv_rainsensorqty_rain_sensor_init {
|
|||||||
#
|
#
|
||||||
# $1 identificativo gpio del sensore di pioggia
|
# $1 identificativo gpio del sensore di pioggia
|
||||||
#
|
#
|
||||||
function drv_rainsensorqty_rain_sensor_get {
|
# restituisce 0 se piove, e nell'output di testo il valore di "$RAIN_GPIO_STATE"
|
||||||
|
# restituisce 99 se non piove, output "norain"
|
||||||
|
# esce con 1 se non c'e' il monitoring, output "ERROR"
|
||||||
|
drv_rainsensorqty_rain_sensor_get()
|
||||||
|
{
|
||||||
local now=$(date +%s)
|
local now=$(date +%s)
|
||||||
local interval=100 # 100 secondi > 1 minuto frequenza di verifica da parte di, come da seguente schedulazione
|
local interval=60 # because check_rain_sensor is scheduled once a minute ... to changed if schedule is modified, from crontab:
|
||||||
#* * * * * /home/pi/piGarden/piGarden.sh check_rain_sensor 2> /tmp/check_rain_sensor.err
|
#* * * * * /home/pi/piGarden/piGarden.sh check_rain_sensor 2> /tmp/check_rain_sensor.err
|
||||||
local f="drv_rainsensorqty_check"
|
|
||||||
drv_rainsensorqty_writelog $f $1
|
|
||||||
|
|
||||||
# verifica se lo script di monitorin e' attivo
|
local f="drv_rainsensorqty_check"
|
||||||
|
|
||||||
|
# script called with:
|
||||||
|
#drv_rainsensorqty_writelog $f $1
|
||||||
|
# ignora il parametro di $1, lo recupera dal file di configurazione
|
||||||
|
|
||||||
|
# verifica se lo script di monitoring e' attivo
|
||||||
if drv_rainsensorqty_check ; then
|
if drv_rainsensorqty_check ; then
|
||||||
drv_rainsensorqty_writelog $f "NORMAL - drv_rainsensorqty_check ok, monitor process running"
|
drv_rainsensorqty_writelog $f "NORMAL - drv_rainsensorqty_check ok, monitor process running"
|
||||||
if [ -f "$RAINSENSORQTY_LASTRAIN" ] ; then
|
if [ -f "$RAINSENSORQTY_LASTRAIN" ] ; then
|
||||||
local lastrain="$( < "$RAINSENSORQTY_LASTRAIN" )"
|
local lastrain="$( cat "$RAINSENSORQTY_LASTRAIN" | $CUT -f 1 -d: )"
|
||||||
|
local counter="$( cat "$RAINSENSORQTY_LASTRAIN" | $CUT -f 2 -d: )"
|
||||||
|
LEVEL=$( $JQ -n "$counter/$RAINSENSORQTY_LOOPSFORSETRAINING" | $JQ 'floor' )
|
||||||
(( diff = now - lastrain ))
|
(( diff = now - lastrain ))
|
||||||
drv_rainsensorqty_writelog $f "NORMAL: last rain $( date --date="@$lastrain" ) "
|
drv_rainsensorqty_writelog $f "NORMAL: last rain $( date --date="@$lastrain" ) - LEVEL $LEVEL rain"
|
||||||
drv_rainsensorqty_writelog $f "NORMAL: check rain $( date --date="@$now" ) "
|
drv_rainsensorqty_writelog $f "NORMAL: check rain $( date --date="@$now" ) "
|
||||||
if (( diff <= interval )) ; then
|
if (( diff <= interval )) ; then
|
||||||
drv_rainsensorqty_writelog $f "RAIN : check rain - diff $diff < $interval - return $RAIN_GPIO_STATE"
|
drv_rainsensorqty_writelog $f "RAIN - return \$RAIN_GPIO_STATE = $RAIN_GPIO_STATE as output"
|
||||||
return $RAIN_GPIO_STATE
|
drv_rainsensorqty_writelog $f "DEBUG : check rain - diff $diff < $interval - return $RAIN_GPIO_STATE"
|
||||||
|
msg="$RAIN_GPIO_STATE"
|
||||||
|
echo $msg
|
||||||
|
return 0
|
||||||
else
|
else
|
||||||
drv_rainsensorqty_writelog $f "NO_RAIN : check rain - diff $diff < $interval - return 99"
|
drv_rainsensorqty_writelog $f "NO_RAIN - return \"norain\" as output"
|
||||||
|
drv_rainsensorqty_writelog $f "DEBUG : check rain - diff $diff < $interval - return 99"
|
||||||
|
msg="norain"
|
||||||
|
echo $msg
|
||||||
return 99
|
return 99
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
drv_rainsensorqty_writelog $f "ERROR - drv_rainsensorqty_check failed, no monitor process running"
|
drv_rainsensorqty_writelog $f "ERROR: drv_rainsensorqty_check failed, no monitor process running ($monitor_sh)"
|
||||||
exit 1
|
msg="ERROR"
|
||||||
|
echo $msg
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,84 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# Bash monitor script to measure rainfall
|
|
||||||
# Author: androtto
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
###############
|
|
||||||
# MAIN #
|
|
||||||
###############
|
|
||||||
|
|
||||||
|
|
||||||
DIRNAME="$( dirname $0 )"
|
|
||||||
f="$(basename $0)"
|
|
||||||
. $DIRNAME/common.include.sh
|
|
||||||
|
|
||||||
echo "$(date) ---------------- NEW RUN "
|
|
||||||
|
|
||||||
if [[ -f "$DIRNAME/set_var" ]] ; then
|
|
||||||
echo "NORMAL: file $DIRNAME/set_var found - getting variables"
|
|
||||||
. "$DIRNAME/set_var"
|
|
||||||
else
|
|
||||||
echo "ERROR: $DIRNAME/set_var not found"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
#drvt="$( echo $RAIN_GPIO | $CUT -f 1 -d: )"
|
|
||||||
#drv="$( echo $RAIN_GPIO | $CUT -f 2 -d: )"
|
|
||||||
gpio_port="$( echo $RAIN_GPIO | $CUT -f 3 -d: )"
|
|
||||||
|
|
||||||
#got from config file above:
|
|
||||||
#RAINSENSORQTY_LASTRAIN="$STATUS_DIR/rainsensorqty_lastrain"
|
|
||||||
#RAINSENSORQTY_LOG="$DIR_SCRIPT/log/rainsensorqty.log"
|
|
||||||
#RAINSENSORQTY_MONPID="$TMP_PATH/rainsensorqty_monitor.pid"
|
|
||||||
#RAINSENSORQTY_DIR="$DIR_SCRIPT/drv/rainsensorqty"
|
|
||||||
#RAINSENSORQTY_PULSE=falling
|
|
||||||
#RAINSENSORQTY_WAIT=rising
|
|
||||||
|
|
||||||
|
|
||||||
# no other monitor process running...
|
|
||||||
if [[ -f "$RAINSENSORQTY_MONPID" ]] ; then
|
|
||||||
pid="$( < "$RAINSENSORQTY_MONPID" )"
|
|
||||||
if ps -fp $pid >/dev/null ; then
|
|
||||||
drv_rainsensorqty_writelog $f "ERROR monitor process already running\n$( ps -fp $pid )"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
#drv_rainsensorqty_writelog $f "NORMAL - no rainmonitor process already running"
|
|
||||||
echo $$ > $RAINSENSORQTY_MONPID
|
|
||||||
drv_rainsensorqty_writelog $f "NORMAL - $$ pid monitor process started - see $RAINSENSORQTY_MONPID"
|
|
||||||
#echo "NORMAL: no raining monitor process $( echo ; ps -ef | grep rain | grep monitor)"
|
|
||||||
|
|
||||||
# init variables
|
|
||||||
MMEACH="$RAINSENSORQTY_MMEACH"
|
|
||||||
counter=0
|
|
||||||
|
|
||||||
while true
|
|
||||||
do
|
|
||||||
before=`date +%s`
|
|
||||||
echo $GPIO -g wfi $gpio_port $RAINSENSORQTY_PULSE # falling 1->0
|
|
||||||
$GPIO -g wfi $gpio_port $RAINSENSORQTY_PULSE # falling 1->0
|
|
||||||
#sleep $(</tmp/secs_to_wait) # for testing only
|
|
||||||
now=`date +%s`
|
|
||||||
(( elapsed = now - before ))
|
|
||||||
if (( $elapsed >= $RAINSENSORQTY_SECSBETWEENRAINEVENT )) ; then
|
|
||||||
counter=0
|
|
||||||
drv_rainsensorqty_writelog $f "$elapsed seconds elapsed ( greater than $RAINSENSORQTY_SECSBETWEENRAINEVENT set ) since last rain, first $MMEACH mm rain"
|
|
||||||
echo "$elapsed seconds elapsed ( greater than $RAINSENSORQTY_SECSBETWEENRAINEVENT set ) since last rain, first $MMEACH mm rain (first loop)"
|
|
||||||
fi
|
|
||||||
counter=$(( counter+=1 ))
|
|
||||||
MMWATER=$( $JQ -n "$counter*$MMEACH" )
|
|
||||||
drv_rainsensorqty_writelog $f "now is $MMWATER mm rain"
|
|
||||||
echo "now is $MMWATER mm rain (loop $counter)"
|
|
||||||
if (( $counter >= $RAINSENSORQTY_LOOPSFORSETRAINING )) ; then
|
|
||||||
drv_rainsensorqty_writelog $f "$MMWATER mm - irrigation to be stopped"
|
|
||||||
echo "$MMWATER mm - irrigation to be stopped (loop $counter)"
|
|
||||||
date +%s > ${RAINSENSORQTY_LASTRAIN}
|
|
||||||
date > ${RAINSENSORQTY_LASTRAIN}_date
|
|
||||||
fi
|
|
||||||
echo $GPIO -g wfi $gpio_port $RAINSENSORQTY_WAIT # rising 0->1
|
|
||||||
$GPIO -g wfi $gpio_port $RAINSENSORQTY_WAIT # rising 0->1
|
|
||||||
done
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
DIR_SCRIPT=/home/pi/piGarden
|
|
||||||
NAME_SCRIPT="not_needed"
|
|
||||||
CONFIG_ETC="/etc/piGarden.conf"
|
|
||||||
TMP_PATH="/run/shm"
|
|
||||||
if [ ! -d "$TMP_PATH" ]; then
|
|
||||||
TMP_PATH="/tmp"
|
|
||||||
fi
|
|
||||||
|
|
||||||
LOG_OUTPUT_DRV_FILE="$DIR_SCRIPT/log/LOG_OUTPUT_DRV_FILE"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
. $CONFIG_ETC
|
|
||||||
|
|
||||||
. ./common.include.sh
|
|
||||||
. ./config.include.sh
|
|
||||||
. ./init.include.sh
|
|
||||||
. ./rainsensor.include.sh
|
|
||||||
|
|
||||||
drv_rainsensorqty_rain_sensor_get
|
|
||||||
echo "drv_rainsensorqty_rain_sensor_get $?"
|
|
||||||
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
DIR_SCRIPT=/home/pi/piGarden
|
|
||||||
NAME_SCRIPT="not_needed"
|
|
||||||
CONFIG_ETC="/etc/piGarden.conf"
|
|
||||||
TMP_PATH="/run/shm"
|
|
||||||
if [ ! -d "$TMP_PATH" ]; then
|
|
||||||
TMP_PATH="/tmp"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
. $CONFIG_ETC
|
|
||||||
|
|
||||||
. ./config.include.sh
|
|
||||||
. ./common.include.sh
|
|
||||||
. ./init.include.sh
|
|
||||||
. ./rainsensor.include.sh
|
|
||||||
|
|
||||||
drv_rainsensorqty_rain_sensor_init
|
|
||||||
|
|
||||||
drv_rainsensorqty_init
|
|
||||||
|
|
||||||
drv_rainsensorqty_rain_sensor_get
|
|
||||||
echo "drv_rainsensorqty_rain_sensor_get $?"
|
|
||||||
Reference in New Issue
Block a user