diff --git a/projects/ssc333_lite_tapo-c110/general/overlay/etc/init.d/S94dn-monitor b/projects/ssc333_lite_tapo-c110/general/overlay/etc/init.d/S94dn-monitor new file mode 100755 index 0000000..54ed275 --- /dev/null +++ b/projects/ssc333_lite_tapo-c110/general/overlay/etc/init.d/S94dn-monitor @@ -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 diff --git a/projects/ssc333_lite_tapo-c110/general/overlay/usr/bin/dn-monitor.sh b/projects/ssc333_lite_tapo-c110/general/overlay/usr/bin/dn-monitor.sh new file mode 100755 index 0000000..d83fe70 --- /dev/null +++ b/projects/ssc333_lite_tapo-c110/general/overlay/usr/bin/dn-monitor.sh @@ -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 diff --git a/workplace/scripts/flasher_imou-f22ap b/workplace/scripts/flasher_imou-f22ap new file mode 100755 index 0000000..788a3da --- /dev/null +++ b/workplace/scripts/flasher_imou-f22ap @@ -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 + diff --git a/workplace/scripts/flasher_surveyorlabs b/workplace/scripts/flasher_surveyorlabs new file mode 100755 index 0000000..d47d7ca --- /dev/null +++ b/workplace/scripts/flasher_surveyorlabs @@ -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