S17motor: add startup motor position. Thanks @Grntrenchman

This commit is contained in:
gtxaspec
2023-09-20 16:19:10 -07:00
parent 1a1cd03a64
commit c4c10e65cd
5 changed files with 36 additions and 10 deletions

View File

@@ -1,21 +1,39 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides:
# Short-Description: Disable Motor
# Description: Disable Motor on specified devices
# Short-Description: Set motor parameters
# Description: Disable Motor, or set specified motor position on boot on motorized devices.
### END INIT INFO
. /opt/wz_mini/etc/rc.common
. /opt/wz_mini/wz_mini.conf
motor_position() {
wait_for_icamera
if [ -n "$MOTOR_DEFAULT_X" ]; then
if [ -n "$MOTOR_DEFAULT_Y" ]; then
echo "Moving to user-defined default position"
cmd move $MOTOR_DEFAULT_X $MOTOR_DEFAULT_Y
else
echo "Default position not defined for Y-axis"
fi
else
echo "Default position not defined for X-axis"
fi
}
case "$1" in
start)
echo "#####$(basename "$0")#####"
if [[ "$DISABLE_MOTOR" == "true" ]]; then
if [[ "$MOTOR_DISABLE" == "true" ]]; then
echo "Motor Disabled"
touch /opt/wz_mini/tmp/.ms
else
echo "Motor enabled"
motor_position &
fi
;;

View File

@@ -51,6 +51,11 @@ BONDING_FAIL_OVER_MAC="0"
#####ACCESSORIES#####
REMOTE_SPOTLIGHT="false"
####MOTOR OPTIONS####
MOTOR_DISABLE="false"
MOTOR_DEFAULT_X=""
MOTOR_DEFAULT_Y=""
#####VIDEO STREAM#####
RTSP_LOGIN="admin"
RTSP_PASSWORD=""
@@ -101,7 +106,6 @@ DISABLE_FW_UPGRADE="false"
AUDIO_PROMPT_VOLUME="50"
ENABLE_MP4_WRITE="false"
NIGHT_DROP_DISABLE="false"
DISABLE_MOTOR="false"
ENABLE_FSCK_ON_BOOT="false"
ENABLE_CAR_DRIVER="false"
ENABLE_LOCAL_DNS="false"

View File

@@ -1 +1 @@
Tue Sep 19 04:43:33 PM PDT 2023
Wed Sep 20 04:17:50 PM PDT 2023

View File

@@ -51,6 +51,11 @@ BONDING_FAIL_OVER_MAC="0"
#####ACCESSORIES#####
REMOTE_SPOTLIGHT="false"
####MOTOR OPTIONS####
MOTOR_DISABLE="false"
MOTOR_DEFAULT_X=""
MOTOR_DEFAULT_Y=""
#####VIDEO STREAM#####
RTSP_LOGIN="admin"
RTSP_PASSWORD=""
@@ -101,7 +106,6 @@ DISABLE_FW_UPGRADE="false"
AUDIO_PROMPT_VOLUME="50"
ENABLE_MP4_WRITE="false"
NIGHT_DROP_DISABLE="false"
DISABLE_MOTOR="false"
ENABLE_FSCK_ON_BOOT="false"
ENABLE_CAR_DRIVER="false"
ENABLE_LOCAL_DNS="false"