From 5dd7a4b463e422c35d6fcc4d2a44a6f87341715b Mon Sep 17 00:00:00 2001 From: Bryan Date: Sat, 2 Jan 2021 14:33:28 -0600 Subject: [PATCH] add some echos for testing --- chipmonk.cfg | 19 ++++++++++++++----- chipmonk.sh | 7 ++++--- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/chipmonk.cfg b/chipmonk.cfg index 381183c..dca0d71 100644 --- a/chipmonk.cfg +++ b/chipmonk.cfg @@ -1,14 +1,23 @@ # chipmonk.cfg # Configuration for /usr/local/bin/chipmonk.sh which is normally # installed as a service started at bootup. -# See https://github.com/ondsinet/chipmonk SENSOR_READ_FREQUENCY=5 # Period for polling sensors in seconds -#BATTERY_SHUT_VALUE=7 # When battery percentage is below this, shut down. +BATTERY_SHUT_VALUE=7 # When battery percentage is below this, shut down. BATTERY_WARN_VALUE=20 # When battery percentage is below this, assert warning. -#TEMPERATURE_SHUT_VALUE=800 # Shutdown temperature in tenths of a degree C. +TEMPERATURE_SHUT_VALUE=800 # Shutdown temperature in tenths of a degree C. TEMPERATURE_WARN_VALUE=650 # Warning temperature in tenths of a degree C. -#TEMPERATURE_WARN_GPIO=XIO_P6 # When temperature warning, activate this GPIO. -#TEMPERATURE_WARN_GPIO_VALUE=0 # Warning value to write to WARN_TEMPERATURE_GPIO. +GOTIFY_TOKEN="AXNh7yz0zMOfqSO" + +gotify_alert() { +# takes: <message> [<priority>] + if [ -z $3 ]; then + priority=$3 + else + priority="4" + fi + + curl -X POST "https://ths.tnet.space/gotify/message?token=${GOTIFY_TOKEN}" -F "title=${1}" -F "message=${2}" -F "priority=${priority}" +} diff --git a/chipmonk.sh b/chipmonk.sh index b1e4d6e..fd70856 100755 --- a/chipmonk.sh +++ b/chipmonk.sh @@ -274,9 +274,10 @@ compile_warnings(){ WARN_BATT=0 echo "ok batt" fi - # echo $BATTERY_WARN_VALUE - # echo $BATTERY_VALUE - # echo $WARN_BATT + + echo "temp: $TEMPERATURE_VALUE" + echo "power source: $POWER_SOURCE" + echo "battery value: $BATTERY_VALUE" #power disconnected