From 914b46e78a199a80d51ed50c75b049b6d006f883 Mon Sep 17 00:00:00 2001 From: Julian Tatsch Date: Thu, 12 Nov 2020 08:56:23 +0100 Subject: [PATCH 1/6] Fix a typo in camera.cgi so that setconf is called correctly when saving OSD. Thanks @thehijacker --- firmware_mod/www/cgi-bin/ui_camera.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware_mod/www/cgi-bin/ui_camera.cgi b/firmware_mod/www/cgi-bin/ui_camera.cgi index dcff984..595a23d 100755 --- a/firmware_mod/www/cgi-bin/ui_camera.cgi +++ b/firmware_mod/www/cgi-bin/ui_camera.cgi @@ -238,7 +238,7 @@ if [ -n "$F_cmd" ]; then fi if [ -n "${F_osdY+x}" ]; then echo "POSY=${F_osdY}" >> /system/sdcard/config/osd.conf - system/sdcard/bin/setconf -k x -v "${F_osdY}" + /system/sdcard/bin/setconf -k x -v "${F_osdY}" echo "Set OSD Y position to ${F_osdY}
" fi if [ -n "${F_osdFixW+x}" ]; then From 61a02eaec941b8f2193855b05709754252ce444c Mon Sep 17 00:00:00 2001 From: Julian Tatsch Date: Sat, 14 Nov 2020 11:18:25 +0100 Subject: [PATCH 2/6] Remove traces of distinction between rtsp_h264 and rtsp_mjpeg because everything is handled now by rtsp service and both cant run at the same time anyhow. --- firmware_mod/controlscripts/rtsp-h264 | 123 ------------------- firmware_mod/controlscripts/rtsp-mjpeg | 115 ----------------- firmware_mod/scripts/common_functions.sh | 31 +---- firmware_mod/scripts/mqtt-autodiscovery.sh | 4 +- firmware_mod/scripts/mqtt-control.sh | 30 ++--- firmware_mod/scripts/mqtt-status-interval.sh | 3 +- firmware_mod/www/cgi-bin/action.cgi | 31 +---- firmware_mod/www/cgi-bin/state.cgi | 8 +- firmware_mod/www/cgi-bin/ui_motion.cgi | 13 +- integration/homeassistant/homeassistant.md | 5 +- 10 files changed, 28 insertions(+), 335 deletions(-) delete mode 100755 firmware_mod/controlscripts/rtsp-h264 delete mode 100644 firmware_mod/controlscripts/rtsp-mjpeg diff --git a/firmware_mod/controlscripts/rtsp-h264 b/firmware_mod/controlscripts/rtsp-h264 deleted file mode 100755 index 1cd7a0e..0000000 --- a/firmware_mod/controlscripts/rtsp-h264 +++ /dev/null @@ -1,123 +0,0 @@ -#!/bin/sh -PIDFILE="/run/rtsp-h264.pid" -export LD_LIBRARY_PATH='/system/sdcard/lib/:/thirdlib:/system/lib' - -if [ ! -f /system/sdcard/config/rtspserver.conf ]; then - cp /system/sdcard/config/rtspserver.conf.dist /system/sdcard/config/rtspserver.conf -fi - -if [ -f /system/sdcard/config/rtspserver.conf ]; then - . /system/sdcard/config/rtspserver.conf -fi - -if [ "$LOG" != true ] ; then - LOGPATH="/dev/null" -fi - -if [ -f /system/sdcard/config/osd.conf ]; then - . /system/sdcard/config/osd.conf 2>/dev/null -fi - -status() -{ - pid="$(cat "$PIDFILE" 2>/dev/null)" - if [ "$pid" ]; then - # return current pid if pidfile exists and contained pid is alive - # return 1 if pidfile existed but the contained pid is dead - kill -0 "$pid" >/dev/null && echo "PID: $pid" || return 1 - else - # return 2 if pidfile did not exist - return 2 - fi -} - -start() -{ - if [ "$(status)" != "" ]; then - echo "A v4l2rtspserver is already running, please stop it or reboot" - else - echo "Starting v4l2rtspserver-master" - /system/sdcard/controlscripts/rtsp-mjpeg stop - - ## Configure OSD - if [ -f /system/sdcard/controlscripts/configureOsd ]; then - . /system/sdcard/controlscripts/configureOsd 2>/dev/null - fi - - ## Configure Motion - if [ -f /system/sdcard/controlscripts/configureMotion ]; then - . /system/sdcard/controlscripts/configureMotion 2>/dev/null - fi - ## Bitrate - /system/sdcard/bin/setconf -k b -v ${BITRATE} 2>/dev/null - - ## Framerate - if [ "$FRAMERATE_DEN" != "" ] && [ "$FRAMERATE_NUM" != "" ]; then - /system/sdcard/bin/setconf -k d -v "$FRAMERATE_NUM,$FRAMERATE_DEN" 2>/dev/null - fi - - ## Audio - if [ "$AUDIOFORMAT" != "OFF" ] ; then - AUDIOPARAM="-E $AUDIOFORMAT:$AUDIOINBR:$AUDIOOUTBR" - /system/sdcard/bin/setconf -k h -v "$HWVOLUME" 2>/dev/null - /system/sdcard/bin/setconf -k i -v "$SWVOLUME" 2>/dev/null - /system/sdcard/bin/setconf -k q -v "$FILTER" 2>/dev/null - /system/sdcard/bin/setconf -k l -v "$HIGHPASSFILTER" 2>/dev/null - /system/sdcard/bin/setconf -k a -v "$AECFILTER" 2>/dev/null - else - AUDIOPARAM="-A" - fi - - ## Video format - if [ "$VIDEOFORMAT" != "" ]; then - VIDEOFORMAT="-r $VIDEOFORMAT -F $FRAMERATE_NUM" - fi - - ## UserName and password - if [ "$USERNAME" != "" ]; then - CREDENTIAL="-U $USERNAME:$USERPASSWORD" - fi - - ## Port - if [ "$PORT" != "" ]; then - PORT="-P $PORT" - fi - - ## Multicast - if [ "$MULTICASTDEST" != "" ]; then - MULTICASTDEST="-M $MULTICASTDEST" - fi - - ## FLIP - if [ "$FLIP" == "ON" ]; then - /system/sdcard/bin/setconf -k f -v 1 - elif [ "$FLIP" == "OFF" ]; then - /system/sdcard/bin/setconf -k f -v 0 - fi - - echo "================== START ===============" >> "$LOGPATH" - echo "/system/sdcard/bin/v4l2rtspserver-master $RTSPOPTS $AUDIOPARAM $VIDEOFORMAT $CREDENTIAL $PORT $MULTICASTDEST" >> "$LOGPATH" - cd /system/sdcard/hls - /system/sdcard/bin/v4l2rtspserver-master $RTSPOPTS $AUDIOPARAM $VIDEOFORMAT $CREDENTIAL $PORT $MULTICASTDEST 2>> "$LOGPATH" >> "$LOGPATH" & - echo "$!" > "$PIDFILE" - fi -} - -stop() -{ - pid="$(cat "$PIDFILE" 2>/dev/null)" - if [ "$pid" ]; then - kill "$pid" - rm "$PIDFILE" 1> /dev/null 2>&1 - - fi -} - -if [ $# -eq 0 ]; then - start -else - case $1 in start|stop|status) - $1 - ;; - esac -fi diff --git a/firmware_mod/controlscripts/rtsp-mjpeg b/firmware_mod/controlscripts/rtsp-mjpeg deleted file mode 100644 index aa35aa8..0000000 --- a/firmware_mod/controlscripts/rtsp-mjpeg +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/sh -PIDFILE="/run/rtsp-mpjeg.pid" -LOGDIR="/tmp" -LOGPATH="$LOGDIR/v4l2rtspserver-master.log" -export LD_LIBRARY_PATH='/system/sdcard/lib:/thirdlib:/system/lib' - -if [ ! -f /system/sdcard/config/rtspserver.conf ]; then - cp /system/sdcard/config/rtspserver.conf.dist /system/sdcard/config/rtspserver.conf -fi - -if [ -f /system/sdcard/config/rtspserver.conf ]; then - . /system/sdcard/config/rtspserver.conf -fi - -if [ -f /system/sdcard/config/osd.conf ]; then - . /system/sdcard/config/osd.conf 2>/dev/null -fi - -status() -{ - pid="$(cat "$PIDFILE" 2>/dev/null)" - if [ "$pid" ]; then - # Prints PID: $pid if exists and returns 0(no error) else returns 1(error condition) - kill -0 "$pid" >/dev/null && echo "PID: $pid" || return 1 - fi -} - -start() -{ - if [ "$(status)" != "" ]; then - echo "A v4l2rtspserver is already running, please stop it or reboot" - else - echo "Starting v4l2rtspserver-master with parameter -fMJPG" - /system/sdcard/controlscripts/rtsp-h264 stop - - ## Configure OSD - if [ -f /system/sdcard/controlscripts/configureOsd ]; then - . /system/sdcard/controlscripts/configureOsd 2>/dev/null - fi - - ## Configure Motion - if [ -f /system/sdcard/controlscripts/configureMotion ]; then - . /system/sdcard/controlscripts/configureMotion 2>/dev/null - fi - ## Bitrate - /system/sdcard/bin/setconf -k b -v ${BITRATE} 2>/dev/null - - ## Framerate - if [ "$FRAMERATE_DEN" != "" ] && [ "$FRAMERATE_NUM" != "" ]; then - /system/sdcard/bin/setconf -k d -v "$FRAMERATE_NUM,$FRAMERATE_DEN" 2>/dev/null - fi - - ## Audio - if [ "$AUDIOFORMAT" != "OFF" ] ; then - AUDIOPARAM="-E $AUDIOFORMAT:$AUDIOINBR:$AUDIOOUTBR" - /system/sdcard/bin/setconf -k h -v "$HWVOLUME" 2>/dev/null - /system/sdcard/bin/setconf -k i -v "$SWVOLUME" 2>/dev/null - /system/sdcard/bin/setconf -k q -v "$FILTER" 2>/dev/null - /system/sdcard/bin/setconf -k l -v "$HIGHPASSFILTER" 2>/dev/null - /system/sdcard/bin/setconf -k a -v "$AECFILTER" 2>/dev/null - else - AUDIOPARAM="-A" - fi - - ## Video format - if [ "$VIDEOFORMAT" != "" ]; then - VIDEOFORMAT="-r $VIDEOFORMAT -F $FRAMERATE_NUM" - fi - - ## UserName and password - if [ "$USERNAME" != "" ]; then - CREDENTIAL="-U $USERNAME:$USERPASSWORD" - fi - - ## Port - if [ "$PORT" != "" ]; then - PORT="-P $PORT" - fi - - ## Multicast - if [ "$MULTICASTDEST" != "" ]; then - MULTICASTDEST="-M $MULTICASTDEST" - fi - - ## FLIP - if [ "$FLIP" == "ON" ]; then - /system/sdcard/bin/setconf -k f -v 1 - elif [ "$FLIP" == "OFF" ]; then - /system/sdcard/bin/setconf -k f -v 0 - fi - - echo "================== START ===============" >> "$LOGPATH" - echo "/system/sdcard/bin/v4l2rtspserver-master -fMJPG $RTSPOPTS $AUDIOPARAM $VIDEOFORMAT $CREDENTIAL $PORT $MULTICASTDEST" >> "$LOGPATH" - /system/sdcard/bin/v4l2rtspserver-master -fMJPG $RTSPOPTS $AUDIOPARAM $VIDEOFORMAT $CREDENTIAL $PORT $MULTICASTDEST 2>> "$LOGPATH" >> "$LOGPATH" & - echo "$!" > "$PIDFILE" - fi -} - -stop() -{ - pid="$(cat "$PIDFILE" 2>/dev/null)" - if [ "$pid" ]; then - kill "$pid" - rm "$PIDFILE" 1> /dev/null 2>&1 - fi -} - -if [ $# -eq 0 ]; then - start -else - case $1 in start|stop|status) - $1 - ;; - esac -fi diff --git a/firmware_mod/scripts/common_functions.sh b/firmware_mod/scripts/common_functions.sh index 4ff823f..2558c13 100755 --- a/firmware_mod/scripts/common_functions.sh +++ b/firmware_mod/scripts/common_functions.sh @@ -274,37 +274,18 @@ http_password(){ echo "$user:$realm:$hash" > /system/sdcard/config/lighttpd.user } -# Control the RTSP h264 server -rtsp_h264_server(){ - case "$1" in - on) - /system/sdcard/controlscripts/rtsp-h264 start - ;; - off) - /system/sdcard/controlscripts/rtsp-h264 stop - ;; - status) - if /system/sdcard/controlscripts/rtsp-h264 status | grep -q "PID" - then - echo "ON" - else - echo "OFF" - fi - ;; - esac -} -# Control the RTSP mjpeg server -rtsp_mjpeg_server(){ +# Control the RTSP server +rtsp_server(){ case "$1" in on) - /system/sdcard/controlscripts/rtsp-mjpeg start + /system/sdcard/controlscripts/rtsp start ;; off) - /system/sdcard/controlscripts/rtsp-mjpeg stop + /system/sdcard/controlscripts/rtsp stop ;; status) - if /system/sdcard/controlscripts/rtsp-mjpeg status | grep -q "PID" + if /system/sdcard/controlscripts/rtsp status | grep -q "PID" then echo "ON" else @@ -836,4 +817,4 @@ getFonts() { if [ "$fontName" == "$i" ] ; then echo selected; fi echo -n ">`/system/sdcard/bin/busybox basename $i` " done -} \ No newline at end of file +} diff --git a/firmware_mod/scripts/mqtt-autodiscovery.sh b/firmware_mod/scripts/mqtt-autodiscovery.sh index 8bfb560..fec070f 100644 --- a/firmware_mod/scripts/mqtt-autodiscovery.sh +++ b/firmware_mod/scripts/mqtt-autodiscovery.sh @@ -65,9 +65,7 @@ $MQTT_COMMAND "$AUTODISCOVERY_PREFIX/switch/$DEVICE_NAME/auto_night_mode/config" ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -r -m "{\"name\": \"$DEVICE_NAME night mode auto\", \"unique_id\": \"$MAC_SIMPLE-night-mode-auto\", $DEVICE_INFO, \"icon\": \"mdi:weather-night\", \"state_topic\": \"$TOPIC/night_mode/auto\", \"command_topic\": \"$TOPIC/night_mode/auto/set\"}" # RTSP Server - $MQTT_COMMAND "$AUTODISCOVERY_PREFIX/switch/$DEVICE_NAME/rtsp_h264_server/config" ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -r -m "{\"name\": \"$DEVICE_NAME h264 rtsp server\", \"unique_id\": \"$MAC_SIMPLE-h264-rtsp-server\", $DEVICE_INFO, \"icon\": \"mdi:cctv\", \"state_topic\": \"$TOPIC/rtsp_h264_server\", \"command_topic\": \"$TOPIC/rtsp_h264_server/set\"}" - $MQTT_COMMAND "$AUTODISCOVERY_PREFIX/switch/$DEVICE_NAME/rtsp_mjpeg_server/config" ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -r -m "{\"name\": \"$DEVICE_NAME mjpeg rtsp server\", \"unique_id\": \"$MAC_SIMPLE-mjpeg-rtsp-server\", $DEVICE_INFO, \"icon\": \"mdi:cctv\", \"state_topic\": \"$TOPIC/rtsp_mjpeg_server\", \"command_topic\": \"$TOPIC/rtsp_mjpeg_server/set\"}" - + $MQTT_COMMAND "$AUTODISCOVERY_PREFIX/switch/$DEVICE_NAME/rtsp_server/config" ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -r -m "{\"name\": \"$DEVICE_NAME rtsp server\", \"unique_id\": \"$MAC_SIMPLE-rtsp-server\", $DEVICE_INFO, \"icon\": \"mdi:cctv\", \"state_topic\": \"$TOPIC/rtsp_server\", \"command_topic\": \"$TOPIC/rtsp_server/set\"}" # Motor up/down/left/right $MQTT_COMMAND "$AUTODISCOVERY_PREFIX/cover/$DEVICE_NAME/motor_up_down/config" ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -r -m "{\"name\": \"$DEVICE_NAME move up/down\", \"unique_id\": \"$MAC_SIMPLE-move-up-down\", $DEVICE_INFO, \"set_position_topic\": \"$TOPIC/motors/vertical/set\", \"position_topic\": \"$TOPIC/motors/vertical\", \"command_topic\": \"$TOPIC/motors/vertical/set\", \"payload_close\": \"down\", \"payload_open\": \"up\", \"optimistic\": \"false\", \"value_template\": \"{{ ((value|int)/($MAX_Y/$STEP))|round }}\", \"set_position_template\": \"{{ ((position|int)*($MAX_Y/$STEP))|round }}\"}" diff --git a/firmware_mod/scripts/mqtt-control.sh b/firmware_mod/scripts/mqtt-control.sh index f508427..0f045c3 100755 --- a/firmware_mod/scripts/mqtt-control.sh +++ b/firmware_mod/scripts/mqtt-control.sh @@ -111,32 +111,18 @@ done fi ;; - "${TOPIC}/rtsp_h264_server") - /system/sdcard/bin/mosquitto_pub.bin -h "$HOST" -p "$PORT" -u "$USER" -P "$PASS" -t "${TOPIC}"/rtsp_h264_server ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -m "$(rtsp_h264_server status)" + "${TOPIC}/rtsp_server") + /system/sdcard/bin/mosquitto_pub.bin -h "$HOST" -p "$PORT" -u "$USER" -P "$PASS" -t "${TOPIC}"/rtsp_server ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -m "$(rtsp_server status)" ;; - "${TOPIC}/rtsp_h264_server/set ON") - rtsp_h264_server on - /system/sdcard/bin/mosquitto_pub.bin -h "$HOST" -p "$PORT" -u "$USER" -P "$PASS" -t "${TOPIC}"/rtsp_h264_server ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -m "$(rtsp_h264_server status)" + "${TOPIC}/rtsp_server/set ON") + rtsp_server on + /system/sdcard/bin/mosquitto_pub.bin -h "$HOST" -p "$PORT" -u "$USER" -P "$PASS" -t "${TOPIC}"/rtsp_server ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -m "$(rtsp_server status)" ;; - "${TOPIC}/rtsp_h264_server/set OFF") - rtsp_h264_server off - /system/sdcard/bin/mosquitto_pub.bin -h "$HOST" -p "$PORT" -u "$USER" -P "$PASS" -t "${TOPIC}"/rtsp_h264_server ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -m "$(rtsp_h264_server status)" - ;; - - "${TOPIC}/rtsp_mjpeg_server") - /system/sdcard/bin/mosquitto_pub.bin -h "$HOST" -p "$PORT" -u "$USER" -P "$PASS" -t "${TOPIC}"/rtsp_mjpeg_server ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -m "$(rtsp_mjpeg_server status)" - ;; - - "${TOPIC}/rtsp_mjpeg_server/set ON") - rtsp_mjpeg_server on - /system/sdcard/bin/mosquitto_pub.bin -h "$HOST" -p "$PORT" -u "$USER" -P "$PASS" -t "${TOPIC}"/rtsp_mjpeg_server ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -m "$(rtsp_mjpeg_server status)" - ;; - - "${TOPIC}/rtsp_mjpeg_server/set OFF") - rtsp_mjpeg_server off - /system/sdcard/bin/mosquitto_pub.bin -h "$HOST" -p "$PORT" -u "$USER" -P "$PASS" -t "${TOPIC}"/rtsp_mjpeg_server ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -m "$(rtsp_mjpeg_server status)" + "${TOPIC}/rtsp_server/set OFF") + rtsp_server off + /system/sdcard/bin/mosquitto_pub.bin -h "$HOST" -p "$PORT" -u "$USER" -P "$PASS" -t "${TOPIC}"/rtsp_server ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -m "$(rtsp_server status)" ;; "${TOPIC}/night_mode") diff --git a/firmware_mod/scripts/mqtt-status-interval.sh b/firmware_mod/scripts/mqtt-status-interval.sh index 4aed865..cf8bf29 100644 --- a/firmware_mod/scripts/mqtt-status-interval.sh +++ b/firmware_mod/scripts/mqtt-status-interval.sh @@ -21,8 +21,7 @@ do /system/sdcard/bin/mosquitto_pub.bin -h "$HOST" -p "$PORT" -u "$USER" -P "$PASS" -t "${TOPIC}"/brightness ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -r -m "$(exposure status)" fi - /system/sdcard/bin/mosquitto_pub.bin -h "$HOST" -p "$PORT" -u "$USER" -P "$PASS" -t "${TOPIC}"/rtsp_h264_server ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -r -m "$(rtsp_h264_server status)" - /system/sdcard/bin/mosquitto_pub.bin -h "$HOST" -p "$PORT" -u "$USER" -P "$PASS" -t "${TOPIC}"/rtsp_mjpeg_server ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -r -m "$(rtsp_mjpeg_server status)" + /system/sdcard/bin/mosquitto_pub.bin -h "$HOST" -p "$PORT" -u "$USER" -P "$PASS" -t "${TOPIC}"/rtsp_server ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -r -m "$(rtsp_server status)" /system/sdcard/bin/mosquitto_pub.bin -h "$HOST" -p "$PORT" -u "$USER" -P "$PASS" -t "${TOPIC}"/night_mode ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -r -m "$(night_mode status)" /system/sdcard/bin/mosquitto_pub.bin -h "$HOST" -p "$PORT" -u "$USER" -P "$PASS" -t "${TOPIC}"/night_mode/auto ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -r -m "$(auto_night_mode status)" /system/sdcard/bin/mosquitto_pub.bin -h "$HOST" -p "$PORT" -u "$USER" -P "$PASS" -t "${TOPIC}"/motion/detection ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -r -m "$(motion_detection status)" diff --git a/firmware_mod/www/cgi-bin/action.cgi b/firmware_mod/www/cgi-bin/action.cgi index 6026686..37eaa0c 100755 --- a/firmware_mod/www/cgi-bin/action.cgi +++ b/firmware_mod/www/cgi-bin/action.cgi @@ -148,7 +148,7 @@ case "$F_cmd" in ir_cut off ;; -ir_cut_status) + ir_cut_status) ir_cut status return ;; @@ -187,35 +187,12 @@ ir_cut_status) return ;; - h264_start) - /system/sdcard/controlscripts/rtsp-h264 start - ;; - - h264_noseg_start) - /system/sdcard/controlscripts/rtsp-h264 start - ;; - - mjpeg_start) - /system/sdcard/controlscripts/rtsp-mjpeg start - ;; - - h264_nosegmentation_start) - /system/sdcard/controlscripts/rtsp-h264 start + rtsp_start) + /system/sdcard/controlscripts/rtsp start ;; rtsp_stop) - /system/sdcard/controlscripts/rtsp-mjpeg stop - /system/sdcard/controlscripts/rtsp-h264 stop - ;; - - h264_status) - rtsp_h264_server status - return - ;; - - mjpeg_status) - rtsp_mjpeg_server status - return + /system/sdcard/controlscripts/rtsp stop ;; settz) diff --git a/firmware_mod/www/cgi-bin/state.cgi b/firmware_mod/www/cgi-bin/state.cgi index 12a656c..d059035 100755 --- a/firmware_mod/www/cgi-bin/state.cgi +++ b/firmware_mod/www/cgi-bin/state.cgi @@ -81,12 +81,8 @@ if [ -n "$F_cmd" ]; then echo $(night_mode status) ;; - rtsp_h264) - echo $(rtsp_h264_server status) - ;; - - rtsp_mjpeg) - echo $(rtsp_mjpeg_server status) + rtsp) + echo $(rtsp_server status) ;; auto_night_detection) diff --git a/firmware_mod/www/cgi-bin/ui_motion.cgi b/firmware_mod/www/cgi-bin/ui_motion.cgi index aae9336..4f0f60b 100755 --- a/firmware_mod/www/cgi-bin/ui_motion.cgi +++ b/firmware_mod/www/cgi-bin/ui_motion.cgi @@ -225,15 +225,10 @@ if [ -n "$F_cmd" ]; then rewrite_config /system/sdcard/config/motion.conf region_of_interest $F_regions echo "Regions set to $F_regions
" fi - if [ "$(rtsp_h264_server status)" = "ON" ]; then - echo "Restart H264 rtsp server" - rtsp_h264_server off - rtsp_h264_server on - fi - if [ "$(rtsp_mjpeg_server status)" = "ON" ]; then - echo "Restart MJPEG rtsp server" - rtsp_mjpeg_server off - rtsp_mjpeg_server on + if [ "$(rtsp_server status)" = "ON" ]; then + echo "Restarting rtsp server" + rtsp_server off + rtsp__server on fi ;; *) diff --git a/integration/homeassistant/homeassistant.md b/integration/homeassistant/homeassistant.md index 5288456..963c829 100644 --- a/integration/homeassistant/homeassistant.md +++ b/integration/homeassistant/homeassistant.md @@ -2,7 +2,7 @@ ### On the Home Assistant side -First let's set up your camera stream. Make sure the _rtsp-h264_ service in the _Services control panel_ is running and you can connect to it via a media player (like [VLC](https://www.videolan.org/)) using the address `rtsp://dafang:8554/unicast`. +First let's set up your camera stream. Make sure the _rtsp_ service in the _Services control panel_ is running and you can connect to it via a media player (like [VLC](https://www.videolan.org/)) using the address `rtsp://dafang:8554/unicast`. ![rtsp-h264](rtsp_h264.png) @@ -85,8 +85,7 @@ To put all the sensors & actors conveniently into one group you can use the foll ```yaml Dafang3: - camera.dafang3 - - switch.dafang3_h264_rtsp_server - - switch.dafang3_mjpeg_rtsp_server + - switch.dafang3_rtsp_server - sensor.dafang3 - device_tracker.dafang3 - sensor.dafang3_light_sensor From 853a3927f5a83a6f3288e74fd7e01f89782309da Mon Sep 17 00:00:00 2001 From: Julian Tatsch Date: Sat, 14 Nov 2020 11:25:08 +0100 Subject: [PATCH 3/6] fix autostart of rtsp --- firmware_mod/config/autostart/rtsp | 2 ++ firmware_mod/config/autostart/rtsp-h264 | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100755 firmware_mod/config/autostart/rtsp delete mode 100755 firmware_mod/config/autostart/rtsp-h264 diff --git a/firmware_mod/config/autostart/rtsp b/firmware_mod/config/autostart/rtsp new file mode 100755 index 0000000..6fda0e8 --- /dev/null +++ b/firmware_mod/config/autostart/rtsp @@ -0,0 +1,2 @@ +#!/bin/sh +/system/sdcard/controlscripts/rtsp diff --git a/firmware_mod/config/autostart/rtsp-h264 b/firmware_mod/config/autostart/rtsp-h264 deleted file mode 100755 index babb1e9..0000000 --- a/firmware_mod/config/autostart/rtsp-h264 +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -/system/sdcard/controlscripts/rtsp-h264 From b590eef2933b3a165866f602902ec67393eb022d Mon Sep 17 00:00:00 2001 From: jmtatsch Date: Sat, 14 Nov 2020 12:14:26 +0100 Subject: [PATCH 4/6] Update index.html make light blue the default theme --- firmware_mod/www/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware_mod/www/index.html b/firmware_mod/www/index.html index 850c22f..a521d48 100644 --- a/firmware_mod/www/index.html +++ b/firmware_mod/www/index.html @@ -27,7 +27,7 @@ //Check if theme configured var css = localStorage.getItem('theme') if ( css == null ) - css = "w3-theme-teal"; + css = "w3-theme-night-blue"; $('head').append(""); $.get("cgi-bin/state.cgi", {cmd: "hostname"}, function(hostname){document.title = hostname;}); From f299b6cefd0e03d36024cd52828f41b58648bda9 Mon Sep 17 00:00:00 2001 From: jmtatsch Date: Sat, 14 Nov 2020 12:17:04 +0100 Subject: [PATCH 5/6] Update osd.conf make osd text white by default and slighly smaller --- firmware_mod/config/osd.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware_mod/config/osd.conf b/firmware_mod/config/osd.conf index 98aef9b..ace06e7 100644 --- a/firmware_mod/config/osd.conf +++ b/firmware_mod/config/osd.conf @@ -1,8 +1,8 @@ ENABLE_OSD=true OSD="%H:%M:%S %d.%m.%Y" DISPLAY_AXIS=false -COLOR=3 -SIZE=18 +COLOR=0 +SIZE=12 SPACE= POSY= FIXEDW=false From 1c92630953a749b0dd8a608732df553a891089c3 Mon Sep 17 00:00:00 2001 From: jmtatsch Date: Tue, 8 Dec 2020 15:05:52 +0100 Subject: [PATCH 6/6] Full master fixes also into beta (#1639) * Fixed the timezone: Europe/Amsterdam * Fix 'rtsp-h264' still set as an autostart entry when 'rtsp' is now the (#1636) service to use In 1e2f96612f4ad7852697609669d72532aea2a314 the services 'rtsp-h264' and 'rtsp-mjpeg' were combined into a single 'rtsp' service, however an entry for 'rtsp-h264' still remained in the autostart folder. This is a problem for the user because this entry does not appear in the Web UI which means it cannot be easily removed, and also appears as if an RTSP server is not running when it is. * Added button to the live page that downloads a JPEG screenshot (#1638) * Fixed a missing line break and spelling mistake * Added button to the live page that downloads a JPEG screenshot Co-authored-by: OhMyGuus Co-authored-by: Ben Russell --- firmware_mod/www/cgi-bin/downloadpic.cgi | 8 ++++++++ firmware_mod/www/cgi-bin/ui_camera.cgi | 2 +- firmware_mod/www/js/control.js | 2 +- firmware_mod/www/js/live.js | 5 +++++ firmware_mod/www/json/timezone.json | 2 +- firmware_mod/www/json/timezones.tsv | 2 +- firmware_mod/www/live.html | 1 + 7 files changed, 18 insertions(+), 4 deletions(-) create mode 100755 firmware_mod/www/cgi-bin/downloadpic.cgi diff --git a/firmware_mod/www/cgi-bin/downloadpic.cgi b/firmware_mod/www/cgi-bin/downloadpic.cgi new file mode 100755 index 0000000..2ebc34c --- /dev/null +++ b/firmware_mod/www/cgi-bin/downloadpic.cgi @@ -0,0 +1,8 @@ +#!/bin/sh + +FILE_NAME="$(date +%Y-%m-%d-%H-%M-%S)" + +echo "Content-type: image/jpeg" +echo "Content-Disposition: attachment; filename=\"$FILE_NAME.jpeg\"" +echo "" +exec /system/sdcard/bin/getimage diff --git a/firmware_mod/www/cgi-bin/ui_camera.cgi b/firmware_mod/www/cgi-bin/ui_camera.cgi index 595a23d..39bb142 100755 --- a/firmware_mod/www/cgi-bin/ui_camera.cgi +++ b/firmware_mod/www/cgi-bin/ui_camera.cgi @@ -109,7 +109,7 @@ if [ -n "$F_cmd" ]; then if [ -n "${F_videoPort+x}" ]; then videoport=$(echo "${F_videoPort}"| tr '\n') rewrite_config /system/sdcard/config/rtspserver.conf PORT "$videoport" - echo "Set video port tp ${videoport}" + echo "Set video port tp ${videoport}
" fi if [ -n "${F_autoNightMode+x}" ]; then rewrite_config /system/sdcard/config/autonight.conf autonight_mode $F_autoNightMode diff --git a/firmware_mod/www/js/control.js b/firmware_mod/www/js/control.js index ab3c59a..d447af3 100755 --- a/firmware_mod/www/js/control.js +++ b/firmware_mod/www/js/control.js @@ -57,7 +57,7 @@ function showupdatepage(result) { var update_status = parseInt(update[1],10); if (update_status == 0) { - $('#updatemsg').html("You have already the lastest version from the " + update[0] + " branch") + $('#updatemsg').html("You have already the latest version from the " + update[0] + " branch") if (update[0] == "master") { $('#updatemsg').append(' \

\ diff --git a/firmware_mod/www/js/live.js b/firmware_mod/www/js/live.js index fa26c4d..865ead8 100755 --- a/firmware_mod/www/js/live.js +++ b/firmware_mod/www/js/live.js @@ -13,6 +13,11 @@ function refreshLiveImage() { $("#liveview").attr("src", "/cgi-bin/currentpic.cgi?" + ts); } +//Function to download a screenshot +function downloadScreenshot() { + var ts = new Date().getTime(); + window.location.href = "/cgi-bin/downloadpic.cgi?" + ts; +} //Function to refresh side bar buttons function refreshSideBar() { diff --git a/firmware_mod/www/json/timezone.json b/firmware_mod/www/json/timezone.json index 8194e63..bfd637f 100644 --- a/firmware_mod/www/json/timezone.json +++ b/firmware_mod/www/json/timezone.json @@ -293,7 +293,7 @@ "Australia/Melbourne":"EST-10EST,M10.1.0,M4.1.0/3", "Australia/Perth":"WST-8", "Australia/Sydney":"EST-10EST,M10.1.0,M4.1.0/3", -"Europe/Amsterdam":"CET-1CEST,M3.5.0,M10.5.0/3", +"Europe/Amsterdam":"CET-1CEST-2,M3.5.0,M10.5.0/3", "Europe/Andorra":"CET-1CEST,M3.5.0,M10.5.0/3", "Europe/Athens":"EET-2EEST,M3.5.0/3,M10.5.0/4", "Europe/Belgrade":"CET-1CEST,M3.5.0,M10.5.0/3", diff --git a/firmware_mod/www/json/timezones.tsv b/firmware_mod/www/json/timezones.tsv index a26d231..5571e55 100755 --- a/firmware_mod/www/json/timezones.tsv +++ b/firmware_mod/www/json/timezones.tsv @@ -295,7 +295,7 @@ Australia/Lord_Howe LHST-10:30LHST-11,M10.1.0,M4.1.0 Australia/Melbourne EST-10EST,M10.1.0,M4.1.0/3 Australia/Perth WST-8 Australia/Sydney EST-10EST,M10.1.0,M4.1.0/3 -Europe/Amsterdam CET-1CEST,M3.5.0,M10.5.0/3 +Europe/Amsterdam CET-1CEST-2,M3.5.0,M10.5.0/3 Europe/Andorra CET-1CEST,M3.5.0,M10.5.0/3 Europe/Athens EET-2EEST,M3.5.0/3,M10.5.0/4 Europe/Belgrade CET-1CEST,M3.5.0,M10.5.0/3 diff --git a/firmware_mod/www/live.html b/firmware_mod/www/live.html index 3eb25ab..49e75fa 100755 --- a/firmware_mod/www/live.html +++ b/firmware_mod/www/live.html @@ -24,6 +24,7 @@
+