1
0
mirror of https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks.git synced 2025-09-03 05:02:40 +02:00

Merge branch 'master' into beta

This commit is contained in:
Julian Tatsch
2021-03-13 20:13:59 +01:00
6 changed files with 16 additions and 7 deletions

View File

@@ -20,6 +20,7 @@ fi
if [ -z "${CODEC+x}" ]; then
CODEC="H264"
fi
status()
{
pid="$(cat "$PIDFILE" 2>/dev/null)"
@@ -97,10 +98,17 @@ start()
fi
}
# now the .pid file will now be removed and you can start it again from the web UI
stop_dependents()
{
/system/sdcard/controlscripts/recording stop
}
stop()
{
pid="$(cat "$PIDFILE" 2>/dev/null)"
if [ "$pid" ]; then
stop_dependents
kill "$pid"
rm "$PIDFILE" 1> /dev/null 2>&1
fi

View File

@@ -68,8 +68,8 @@
$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 }}\"}"
$MQTT_COMMAND "$AUTODISCOVERY_PREFIX/cover/$DEVICE_NAME/motor_left_right/config" ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -r -m "{\"name\": \"$DEVICE_NAME Move Left/Right\", \"unique_id\": \"$MAC_SIMPLE-move-left-right\", $DEVICE_INFO, \"set_position_topic\": \"$TOPIC/motors/horizontal/set\", \"position_topic\": \"$TOPIC/motors/horizontal\", \"command_topic\": \"$TOPIC/motors/horizontal/set\", \"payload_close\": \"right\", \"payload_open\": \"left\", \"optimistic\": \"false\", \"value_template\": \"{{ ((value|int)/($MAX_X/$STEP))|round }}\", \"set_position_template\": \"{{ ((position|int)*($MAX_X/$STEP))|round }}\"}"
$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\", \"position_template\": \"{{ ((value|int)/($MAX_Y/$STEP))|round }}\", \"set_position_template\": \"{{ ((position|int)*($MAX_Y/$STEP))|round }}\"}"
$MQTT_COMMAND "$AUTODISCOVERY_PREFIX/cover/$DEVICE_NAME/motor_left_right/config" ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -r -m "{\"name\": \"$DEVICE_NAME move left/right\", \"unique_id\": \"$MAC_SIMPLE-move-left-right\", $DEVICE_INFO, \"set_position_topic\": \"$TOPIC/motors/horizontal/set\", \"position_topic\": \"$TOPIC/motors/horizontal\", \"command_topic\": \"$TOPIC/motors/horizontal/set\", \"payload_close\": \"right\", \"payload_open\": \"left\", \"optimistic\": \"false\", \"position_template\": \"{{ ((value|int)/($MAX_X/$STEP))|round }}\", \"set_position_template\": \"{{ ((position|int)*($MAX_X/$STEP))|round }}\"}"
# Recording on/off switch
$MQTT_COMMAND "$AUTODISCOVERY_PREFIX/switch/$DEVICE_NAME/recording/config" ${MOSQUITTOPUBOPTS} ${MOSQUITTOOPTS} -r -m "{\"name\": \"$DEVICE_NAME Recording\", \"unique_id\": \"$MAC_SIMPLE-recording\", $DEVICE_INFO, \"icon\": \"mdi:video\", \"state_topic\": \"$TOPIC/recording\", \"command_topic\": \"$TOPIC/recording/set\"}"

View File

@@ -66,7 +66,7 @@ respond() {
/imagealerts) imageAlerts;;
/videoalerts) videoAlerts;;
/help | /start) $TELEGRAM m "######### Bot commands #########\n# /mem - show memory information\n# /shot - take a snapshot\n# /on - motion detection on\n# /off - motion detection off\n# /nighton - night mode on\n# /nightoff - night mode off\n# /textalerts - Text alerts on motion detection\n# /imagealerts - Image alerts on motion detection\n# /videoalerts - Video alerts on motion detection";;
*) $TELEGRAM m "I can't respond to '$cmd' command"
/*) $TELEGRAM m "I can't respond to '$cmd' command"
esac
}

View File

@@ -80,7 +80,7 @@ $.get("cgi-bin/state.cgi", {cmd: "hostname"}, function(hostname){document.title
<p>No notifications</p>
</div>
</div>
</div>
</div>
<div id="content" class="w3-container">
@@ -99,7 +99,7 @@ $.get("cgi-bin/state.cgi", {cmd: "hostname"}, function(hostname){document.title
<p id="about">
<strong>Dafang Hacks : </strong><br />
Version: <em id="version">VERSION</em><br />
<a href="https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/issues" target="_blank">Report and view issues</a> |
<a href="https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/issues" target="_blank">Report and view issues</a> |
</p>
</div>
</div>

View File

@@ -81,6 +81,7 @@ Remove the "run.sh" file from the microSD card.
2. If the bootloader step is not working, double check the microSD card again for files or folders created by the stock firmware. (Sometimes if your timing is off with the setup press the camera will create a time stamp related folder that needs to be deleted before trying again).
3. Make a note of the MAC for the camera and if possible set up DHCP to assign a specific IP address that can be monitored visually in DHCP logs.
4. Start with fewer entries in your wpa_supplicant.conf to isolate WiFi issues.
5. SD card troubles may be fixed by formatting the card using the <a href = 'https://www.sdcard.org/downloads/formatter/'>official SD Memory Card Formatter</a>
```
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0

View File

@@ -31,6 +31,6 @@
[Old Development Repository - deprecated](https://github.com/EliasKotlyar/Xiaomi-Dafang-Software)
## Original Firmware:
[5.5.1.177](/firmware_original/demo_5.5.1.177.bin)
[5.5.1.177](/firmware_original/dafang/demo_5.5.1.177.bin)
[5.5.1.194](/firmware_original/demo_5.5.1.194.bin)
[5.5.1.194](/firmware_original/dafang/demo_5.5.1.194.bin)