mirror of
https://github.com/gtxaspec/wz_mini_hacks.git
synced 2025-08-09 20:14:04 +00:00
New init system (#216)
* new init system * update new init scripts * update checksum * fix broken audio promps with new init scripts * fix debug/upgrade mode * fix bonding and eth0 hw addr * add checksum * fix bonding setup * add rtsp auth disable * adjust network init scripts path * recreated repo and re added cron scripts (#211) * recreated repo and re added cron scripts * rename cron script and move it to the right folder. * Delete .vs directory remove .vs directory * add deubg message to bonding rc.d script * add crontab variable to wz_mini.conf * fix mp4write * add syslog debug feature * fix syslog init blocking * fix syslog save function * increase imp_helper rerun delay * update init scripts * fix bonding and usb-direct * update checksum * add netmon for bonding * fix supervisor function * update model detection * fix debugging injection on T20 devices Co-authored-by: sideup66 <47700565+sideup66@users.noreply.github.com>
This commit is contained in:
@@ -1 +1 @@
|
||||
Wed Aug 3 07:53:41 PM PDT 2022
|
||||
Sun Aug 7 06:32:44 PM PDT 2022
|
@@ -9,146 +9,146 @@ export WZMINI_CFG=/opt/wz_mini/wz_mini.conf
|
||||
[ -f $WZMINI_CFG ] && source $WZMINI_CFG
|
||||
|
||||
DELAY_BETWEEN=2
|
||||
RE_RUN_DELAY=45
|
||||
RE_RUN_DELAY=60
|
||||
PARM=1
|
||||
|
||||
hi_res_monitor() {
|
||||
if [[ "$RTSP_HI_RES_ENABLED" == "true" ]]; then
|
||||
if [[ "$RTSP_HI_RES_ENABLED" == "true" ]]; then
|
||||
|
||||
if [[ "$RTSP_HI_RES_ENC_PARAMETER" != "" ]]; then
|
||||
if [ -f /opt/wz_mini/tmp/.T20 ]; then
|
||||
if [[ $RTSP_HI_RES_ENC_PARAMETER =~ "^[0|1|2|4|8]$" ]]; then
|
||||
/system/bin/impdbg --enc_rc_s 0:0:4:$RTSP_HI_RES_ENC_PARAMETER
|
||||
sleep $DELAY_BETWEEN
|
||||
PARM=$((PARM+1))
|
||||
else
|
||||
echo "Invalid encoder value"
|
||||
fi
|
||||
else
|
||||
if [[ $RTSP_HI_RES_ENC_PARAMETER =~ "^[0|1|2|4|8]$" ]]; then
|
||||
/system/bin/impdbg --enc_rc_s 0:44:4:$RTSP_HI_RES_ENC_PARAMETER
|
||||
sleep $DELAY_BETWEEN
|
||||
PARM=$((PARM+1))
|
||||
else
|
||||
echo "Invalid encoder value"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [[ "$RTSP_HI_RES_ENC_PARAMETER" != "" ]]; then
|
||||
if [ -f /opt/wz_mini/tmp/.T20 ]; then
|
||||
if [[ $RTSP_HI_RES_ENC_PARAMETER =~ "^[0|1|2|4|8]$" ]]; then
|
||||
/system/bin/impdbg --enc_rc_s 0:0:4:$RTSP_HI_RES_ENC_PARAMETER
|
||||
sleep $DELAY_BETWEEN
|
||||
PARM=$((PARM+1))
|
||||
else
|
||||
echo "Invalid encoder value"
|
||||
fi
|
||||
else
|
||||
if [[ $RTSP_HI_RES_ENC_PARAMETER =~ "^[0|1|2|4|8]$" ]]; then
|
||||
/system/bin/impdbg --enc_rc_s 0:44:4:$RTSP_HI_RES_ENC_PARAMETER
|
||||
sleep $DELAY_BETWEEN
|
||||
PARM=$((PARM+1))
|
||||
else
|
||||
echo "Invalid encoder value"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$RTSP_HI_RES_MAX_BITRATE" != "" ]]; then
|
||||
if [ -f /opt/wz_mini/tmp/.T20 ]; then
|
||||
/system/bin/impdbg --enc_rc_s 0:28:4:$RTSP_HI_RES_MAX_BITRATE
|
||||
if [[ "$RTSP_HI_RES_MAX_BITRATE" != "" ]]; then
|
||||
if [ -f /opt/wz_mini/tmp/.T20 ]; then
|
||||
/system/bin/impdbg --enc_rc_s 0:28:4:$RTSP_HI_RES_MAX_BITRATE
|
||||
sleep $DELAY_BETWEEN
|
||||
PARM=$((PARM+1))
|
||||
else
|
||||
/system/bin/impdbg --enc_rc_s 0:52:4:$RTSP_HI_RES_MAX_BITRATE
|
||||
else
|
||||
/system/bin/impdbg --enc_rc_s 0:52:4:$RTSP_HI_RES_MAX_BITRATE
|
||||
sleep $DELAY_BETWEEN
|
||||
PARM=$((PARM+1))
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$RTSP_HI_RES_TARGET_BITRATE" != "" ]]; then
|
||||
if [ -f /opt/wz_mini/tmp/.T20 ]; then
|
||||
echo "not supported on T20"
|
||||
else
|
||||
/system/bin/impdbg --enc_rc_s 0:48:4:$RTSP_HI_RES_TARGET_BITRATE
|
||||
if [[ "$RTSP_HI_RES_TARGET_BITRATE" != "" ]]; then
|
||||
if [ -f /opt/wz_mini/tmp/.T20 ]; then
|
||||
echo "not supported on T20"
|
||||
else
|
||||
/system/bin/impdbg --enc_rc_s 0:48:4:$RTSP_HI_RES_TARGET_BITRATE
|
||||
sleep $DELAY_BETWEEN
|
||||
PARM=$((PARM+1))
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$RTSP_HI_RES_FPS" != "" ]]; then
|
||||
if [ -f /opt/wz_mini/tmp/.T20 ]; then
|
||||
/system/bin/impdbg --enc_rc_s 0:8:4:$RTSP_HI_RES_FPS
|
||||
if [[ "$RTSP_HI_RES_FPS" != "" ]]; then
|
||||
if [ -f /opt/wz_mini/tmp/.T20 ]; then
|
||||
/system/bin/impdbg --enc_rc_s 0:8:4:$RTSP_HI_RES_FPS
|
||||
sleep $DELAY_BETWEEN
|
||||
PARM=$((PARM+1))
|
||||
else
|
||||
/system/bin/impdbg --enc_rc_s 0:80:4:$RTSP_HI_RES_FPS
|
||||
else
|
||||
/system/bin/impdbg --enc_rc_s 0:80:4:$RTSP_HI_RES_FPS
|
||||
sleep $DELAY_BETWEEN
|
||||
PARM=$((PARM+1))
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $PARM == 1 ]; then
|
||||
echo "No Hi-Res imp variables enabled, check Low-Res"
|
||||
if [ $PARM == 1 ]; then
|
||||
echo "No Hi-Res imp variables enabled, check Low-Res"
|
||||
fi
|
||||
|
||||
low_res_monitor
|
||||
else
|
||||
echo "Hi-Res RTSP not enabled"
|
||||
low_res_monitor
|
||||
fi
|
||||
|
||||
low_res_monitor
|
||||
else
|
||||
echo "Hi-Res RTSP not enabled"
|
||||
low_res_monitor
|
||||
fi
|
||||
}
|
||||
|
||||
low_res_monitor () {
|
||||
if [[ "$RTSP_LOW_RES_ENABLED" == "true" ]]; then
|
||||
if [[ "$RTSP_LOW_RES_ENABLED" == "true" ]]; then
|
||||
|
||||
if [[ "$RTSP_LOW_RES_ENC_PARAMETER" != "" ]]; then
|
||||
if [ -f /opt/wz_mini/tmp/.T20 ]; then
|
||||
if [[ $RTSP_LOW_RES_ENC_PARAMETER =~ "^[0|1|2|4|8]$" ]]; then
|
||||
/system/bin/impdbg --enc_rc_s 1:0:4:$RTSP_LOW_RES_ENC_PARAMETER
|
||||
sleep $DELAY_BETWEEN
|
||||
PARM=$((PARM+1))
|
||||
else
|
||||
echo "Invalid encoder value"
|
||||
fi
|
||||
else
|
||||
if [[ $RTSP_LOW_RES_ENC_PARAMETER =~ "^[0|1|2|4|8]$" ]]; then
|
||||
/system/bin/impdbg --enc_rc_s 1:44:4:$RTSP_LOW_RES_ENC_PARAMETER
|
||||
sleep $DELAY_BETWEEN
|
||||
PARM=$((PARM+1))
|
||||
else
|
||||
echo "Invalid encoder value"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [[ "$RTSP_LOW_RES_ENC_PARAMETER" != "" ]]; then
|
||||
if [ -f /opt/wz_mini/tmp/.T20 ]; then
|
||||
if [[ $RTSP_LOW_RES_ENC_PARAMETER =~ "^[0|1|2|4|8]$" ]]; then
|
||||
/system/bin/impdbg --enc_rc_s 1:0:4:$RTSP_LOW_RES_ENC_PARAMETER
|
||||
sleep $DELAY_BETWEEN
|
||||
PARM=$((PARM+1))
|
||||
else
|
||||
echo "Invalid encoder value"
|
||||
fi
|
||||
else
|
||||
if [[ $RTSP_LOW_RES_ENC_PARAMETER =~ "^[0|1|2|4|8]$" ]]; then
|
||||
/system/bin/impdbg --enc_rc_s 1:44:4:$RTSP_LOW_RES_ENC_PARAMETER
|
||||
sleep $DELAY_BETWEEN
|
||||
PARM=$((PARM+1))
|
||||
else
|
||||
echo "Invalid encoder value"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$RTSP_LOW_RES_MAX_BITRATE" != "" ]]; then
|
||||
if [ -f /opt/wz_mini/tmp/.T20 ]; then
|
||||
/system/bin/impdbg --enc_rc_s 1:28:4:$RTSP_LOW_RES_MAX_BITRATE
|
||||
if [[ "$RTSP_LOW_RES_MAX_BITRATE" != "" ]]; then
|
||||
if [ -f /opt/wz_mini/tmp/.T20 ]; then
|
||||
/system/bin/impdbg --enc_rc_s 1:28:4:$RTSP_LOW_RES_MAX_BITRATE
|
||||
sleep $DELAY_BETWEEN
|
||||
PARM=$((PARM+1))
|
||||
else
|
||||
/system/bin/impdbg --enc_rc_s 1:52:4:$RTSP_LOW_RES_MAX_BITRATE
|
||||
else
|
||||
/system/bin/impdbg --enc_rc_s 1:52:4:$RTSP_LOW_RES_MAX_BITRATE
|
||||
sleep $DELAY_BETWEEN
|
||||
PARM=$((PARM+1))
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$RTSP_LOW_RES_TARGET_BITRATE" != "" ]]; then
|
||||
if [ -f /opt/wz_mini/tmp/.T20 ]; then
|
||||
echo "not supported on T20"
|
||||
else
|
||||
/system/bin/impdbg --enc_rc_s 1:48:4:$RTSP_LOW_RES_TARGET_BITRATE
|
||||
if [[ "$RTSP_LOW_RES_TARGET_BITRATE" != "" ]]; then
|
||||
if [ -f /opt/wz_mini/tmp/.T20 ]; then
|
||||
echo "not supported on T20"
|
||||
else
|
||||
/system/bin/impdbg --enc_rc_s 1:48:4:$RTSP_LOW_RES_TARGET_BITRATE
|
||||
sleep $DELAY_BETWEEN
|
||||
PARM=$((PARM+1))
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$RTSP_LOW_RES_FPS" != "" ]]; then
|
||||
if [ -f /opt/wz_mini/tmp/.T20 ]; then
|
||||
/system/bin/impdbg --enc_rc_s 1:8:4:$RTSP_LOW_RES_FPS
|
||||
if [[ "$RTSP_LOW_RES_FPS" != "" ]]; then
|
||||
if [ -f /opt/wz_mini/tmp/.T20 ]; then
|
||||
/system/bin/impdbg --enc_rc_s 1:8:4:$RTSP_LOW_RES_FPS
|
||||
sleep $DELAY_BETWEEN
|
||||
PARM=$((PARM+1))
|
||||
else
|
||||
/system/bin/impdbg --enc_rc_s 1:80:4:$RTSP_LOW_RES_FPS
|
||||
else
|
||||
/system/bin/impdbg --enc_rc_s 1:80:4:$RTSP_LOW_RES_FPS
|
||||
sleep $DELAY_BETWEEN
|
||||
PARM=$((PARM+1))
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $PARM == 1 ]; then
|
||||
echo "No Low-Res imp variables enabled, exit"
|
||||
break
|
||||
fi
|
||||
else
|
||||
echo "Low-Res RTSP not enabled"
|
||||
if [[ "$RTSP_HI_RES_ENABLED" == "true" ]] && [ $PARM -gt 1 ]; then
|
||||
hi_res_monitor
|
||||
if [ $PARM == 1 ]; then
|
||||
echo "No Low-Res imp variables enabled, exit"
|
||||
break
|
||||
fi
|
||||
else
|
||||
break
|
||||
echo "Low-Res RTSP not enabled"
|
||||
if [[ "$RTSP_HI_RES_ENABLED" == "true" ]] && [ $PARM -gt 1 ]; then
|
||||
hi_res_monitor
|
||||
else
|
||||
break
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
while true; do
|
||||
|
14
SD_ROOT/wz_mini/usr/bin/netmon.sh
Normal file
14
SD_ROOT/wz_mini/usr/bin/netmon.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /opt/wz_mini/wz_mini.conf
|
||||
. /opt/wz_mini/etc/rc.common
|
||||
|
||||
if [[ "$ENABLE_USB_DIRECT" == "true" ]]; then
|
||||
wait_for_wlan_ip $(basename "$0")
|
||||
sleep 5
|
||||
gateway_supervisor $(basename "$0") &
|
||||
fi
|
||||
|
||||
echo "kill udhcpc extra"
|
||||
kill $(pgrep -f 'udhcpc -i wlan0 -H WyzeCam')
|
||||
|
3
SD_ROOT/wz_mini/usr/bin/restart_wlan0.sh
Normal file
3
SD_ROOT/wz_mini/usr/bin/restart_wlan0.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "up"
|
Reference in New Issue
Block a user