Add dn-monitor for test on Tapo and some experimental scripts

pull/7/head
Igor Zalatov (from Citadel PC) 2023-11-15 16:29:07 +03:00
parent 50a8caa635
commit 1902965647
4 changed files with 81 additions and 0 deletions

View File

@ -0,0 +1,10 @@
#!/bin/sh
if [ /usr/bin/dn-monitor.sh ]; then
/usr/bin/dn-monitor.sh > /dev/null 2>&1 &
else
echo "The day/night monitor DISABLED"
fi
exit 0

View File

@ -0,0 +1,50 @@
#!/bin/sh
again_high_target=120
again_low_target=50
pollingInterval=4
led_state=0
again_led=0
led_on(){
curl http://localhost/night/on && \
echo LIGHT IS ON
}
led_off(){
curl http://localhost/night/off && \
echo LIGHT IS OFF
}
main(){
echo "...................."
echo "Watching at isp_again > ${again_high_target} to LED ON"
echo "Watching at isp_again < ${again_low_target} to LED OFF"
echo "Polling interval: ${pollingInterval} sec"
echo "...................."
sleep 10
led_off
while true; do
led_state=$(curl -s http://localhost/metrics | grep ^night_enabled | cut -d' ' -f2)
again_led=$(curl -s http://localhost/metrics | grep ^isp_again | cut -d' ' -f2)
echo "again_led: "$again_led
if [ $again_led -lt $again_low_target -a $led_state -eq 1 ] ;then
led_off
fi
if [ $again_led -gt $again_high_target -a $led_state -eq 0 ] ;then
led_on
fi
sleep ${pollingInterval}
echo "...................."
done
}
main

View File

@ -0,0 +1,11 @@
#!/bin/bash
# https://github.com/OpenIPC/firmware/releases/download/latest/u-boot-ssc325-nor.bin
UBOOT=../../archive/ssc325_lite_imou-f22ap/u-boot-ssc325-nor.bin
KERNEL=../../archive/ssc325_lite_imou-f22ap/current/uImage.ssc325
ROOTFS=../../archive/ssc325_lite_imou-f22ap/current/rootfs.squashfs.ssc325
../../openipc/general/scripts/compile4programmer.sh ${UBOOT} ${KERNEL} ${ROOTFS} 8

View File

@ -0,0 +1,10 @@
#!/bin/bash
# https://github.com/OpenIPC/firmware/releases/download/latest/u-boot-gk7205v300-universal.bin
UBOOT=../../archive/gk7205v300_ultimate_surveyorlabs/u-boot-gk7205v300-universal.bin
KERNEL=../../archive/gk7205v300_ultimate_surveyorlabs/current/uImage.gk7205v300
ROOTFS=../../archive/gk7205v300_ultimate_surveyorlabs/current/rootfs.squashfs.gk7205v300
../../openipc/general/scripts/compile4programmer.sh ${UBOOT} ${KERNEL} ${ROOTFS} 16