mirror of
https://github.com/gtxaspec/wz_mini_hacks.git
synced 2024-12-23 04:33:36 +00:00
updates to config.cgi and jpeg.cgi (#196)
This commit is contained in:
parent
3302897fd1
commit
f0d8c03792
23
SD_ROOT/wz_mini/www/cgi-bin/BONDING_ENABLED.md
Normal file
23
SD_ROOT/wz_mini/www/cgi-bin/BONDING_ENABLED.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
Network Interface Bonding Support
|
||||||
|
|
||||||
|
BONDING_ENABLED="false"
|
||||||
|
BONDING_PRIMARY_INTERFACE="eth0"
|
||||||
|
BONDING_SECONDARY_INTERFACE="wlan0"
|
||||||
|
BONDING_LINK_MONITORING_FREQ_MS="100"
|
||||||
|
BONDING_DOWN_DELAY_MS="5000"
|
||||||
|
BONDING_UP_DELAY_MS="5000"
|
||||||
|
Bonding description is best described here: https://wiki.debian.org/Bonding#Configuration_-_Example_2_.28.22Laptop-Mode.22.29:
|
||||||
|
|
||||||
|
("Laptop-Mode")
|
||||||
|
|
||||||
|
Tie cable and wireless network interfaces (RJ45/WLAN) together to define a single, virtual (i.e. bonding) network interface (e.g. bond0). As long as the network cable is connected, its interface (e.g. eth0) is used for the network traffic. If you pull the RJ45-plug, ifenslave switches over to the wireless interface (e.g. wlan0) transparently, without any loss of network packages. After reconnecting the network cable, ifenslave switches back to eth0 ("failover mode"). From the outside (=network) view it doesn't matter which interface is active. The bonding device presents its own software-defined (i.e. virtual) MAC address, different from the hardware defined MACs of eth0 or wlan0. The dhcp server will use this MAC to assign an ip address to the bond0 device. So the computer has one unique ip address under which it can be identified. Without bonding each interface would have its own ip address. Currenly supported with ethernet adapters and usb-direct mode.
|
||||||
|
|
||||||
|
BONDING_PRIMARY_INTERFACE Specifies the interface that should be the primary. Typically "eth0".
|
||||||
|
|
||||||
|
BONDING_SECONDARY_INTERFACE Specifies the interface that should be the secondary. Typically "wlan0".
|
||||||
|
|
||||||
|
BONDING_LINK_MONITORING_FREQ_MS Specifies the MII link monitoring frequency in milliseconds. This determines how often the link state of each slave is inspected for link failures.
|
||||||
|
|
||||||
|
BONDING_DOWN_DELAY_MS Specifies the time, in milliseconds, to wait before disabling a slave after a link failure has been detected. This option is only valid for the miimon link monitor. The downdelay value should be a multiple of the miimon value; if not, it will be rounded down to the nearest multiple.
|
||||||
|
|
||||||
|
BONDING_UP_DELAY_MS Specifies the time, in milliseconds, to wait before enabling a slave after a link recovery has been detected. This option is only valid for the miimon link monitor. The updelay value should be a multiple of the miimon value; if not, it will be rounded down to the nearest multiple.
|
4
SD_ROOT/wz_mini/www/cgi-bin/ENABLE_MP4_WRITE.md
Normal file
4
SD_ROOT/wz_mini/www/cgi-bin/ENABLE_MP4_WRITE.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
ENABLE_MP4_WRITE="false"
|
||||||
|
Forces the camera to skip writing files to /tmp, and write them directly to your storage medium or network mount, prevents trashing. Normally videos are written to /tmp then moved using mv, which can overload camera and or remote network connections. Useful for NFS/CIFS remote video storage.
|
||||||
|
|
||||||
|
|
5
SD_ROOT/wz_mini/www/cgi-bin/ENABLE_USB_DIRECT.md
Normal file
5
SD_ROOT/wz_mini/www/cgi-bin/ENABLE_USB_DIRECT.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
the next time you boot your camera, make sure your USB cable is connected to the router. Remember, the camera has to be setup initially with Wi-Fi for this to work. After setup, Wi-Fi is no longer needed. Note that using USB Direct disables the onboard Wi-Fi. Change the MAC Address if you desire via USB_DIRECT_MAC_ADDR variable.
|
||||||
|
|
||||||
|
Connectivity is supported using a direct USB connection only... this means a single cable from the camera, to a supported host (An OpenWRT router, for example) that supports the usb-cdc-ncm specification. (NCM, not ECM) If you have an OpenWrt based router, install the kmod-usb-net-cdc-ncm package. The camera should automatically pull the IP from the router with most configurations. You can also use any modern linux distro to provide internet to the camera, provided it supports CDC_NCM. enjoy!
|
||||||
|
|
||||||
|
Note: In my testing, the micro-usb cables included with the various cameras do not pass data, so they will not work. Make sure you have a micro-usb cable that passes data!
|
6
SD_ROOT/wz_mini/www/cgi-bin/ENABLE_USB_STORAGE.md
Normal file
6
SD_ROOT/wz_mini/www/cgi-bin/ENABLE_USB_STORAGE.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
USB Mass Storage Support:
|
||||||
|
|
||||||
|
ENABLE_USB_STORAGE="true"
|
||||||
|
If you would like to mount an EXT3/4 filesystem, also change:
|
||||||
|
|
||||||
|
ENABLE_EXT4="true"
|
8
SD_ROOT/wz_mini/www/cgi-bin/REMOTE_SPOTLIGHT.md
Normal file
8
SD_ROOT/wz_mini/www/cgi-bin/REMOTE_SPOTLIGHT.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
When USB Direct connectivity is enabled, the camera will be unable to communicate with accessories. To enable remote spotlight accessory support, enable the following variable and set the IP Address of the host as follows:
|
||||||
|
|
||||||
|
REMOTE_SPOTLIGHT="true"
|
||||||
|
REMOTE_SPOTLIGHT_HOST="0.0.0.0"
|
||||||
|
Then, run the following command on the host where the spotlight is attached to:
|
||||||
|
|
||||||
|
socat TCP4-LISTEN:9000,reuseaddr,fork /dev/ttyUSB0,raw,echo=0
|
||||||
|
Change /dev/ttyUSB0 to whatever path your spotlight enumerated to if necessary. The camera will now be able to control the spotlight.
|
10
SD_ROOT/wz_mini/www/cgi-bin/RTMP_STREAM_ENABLED.md
Normal file
10
SD_ROOT/wz_mini/www/cgi-bin/RTMP_STREAM_ENABLED.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
RTMP Streaming:
|
||||||
|
|
||||||
|
RTMP_STREAM_ENABLED="true"
|
||||||
|
RTMP_STREAM_FEED="video1_unicast"
|
||||||
|
RMTP_STREAM_SERVICE="youtube"
|
||||||
|
RTMP_STREAM_DISABLE_AUDIO="false"
|
||||||
|
RTMP_STREAM_YOUTUBE_KEY="xxx-xxx-xxx-xxx"
|
||||||
|
RTMP_STREAM_TWITCH_KEY=""
|
||||||
|
RTMP_STREAM_FACEBOOK_KEY=""
|
||||||
|
Live stream DIRECTLY from the camera's local RTSP server to: youtube / twitch / facebook live. Audio must be enabled in the RTSP section of the configuration for this to work.
|
25
SD_ROOT/wz_mini/www/cgi-bin/RTSP_HI_RES_ENABLED.md
Normal file
25
SD_ROOT/wz_mini/www/cgi-bin/RTSP_HI_RES_ENABLED.md
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
RTSP streaming: The RTSP server supports the two video streams provided by the camera, 1080p/360p (1296p/480p for the DB3). You can choose to enable a single stream of your choice, or both. Audio is also available. Set your login credentials here, server listening port, and the stream bitrate. (ENC_PARAMETER variable accepts numbers only. 0=FIXQP, 1=CBR, 2=VBR, 4=CAPPED VBR, 8=CAPPED QUALITY. Currently only 2, 4, and 8 are working)
|
||||||
|
|
||||||
|
RTSP_LOGIN="admin"
|
||||||
|
RTSP_PASSWORD=""
|
||||||
|
RTSP_PORT="8554"
|
||||||
|
|
||||||
|
RTSP_HI_RES_ENABLED="true"
|
||||||
|
RTSP_HI_RES_ENABLE_AUDIO="true"
|
||||||
|
RTSP_HI_RES_MAX_BITRATE="2048"
|
||||||
|
RTSP_HI_RES_TARGET_BITRATE="1024"
|
||||||
|
RTSP_HI_RES_ENC_PARAMETER="2"
|
||||||
|
RTSP_HI_RES_FPS="15"
|
||||||
|
|
||||||
|
RTSP_LOW_RES_ENABLED="false"
|
||||||
|
RTSP_LOW_RES_ENABLE_AUDIO="false"
|
||||||
|
RTSP_LOW_RES_MAX_BITRATE=""
|
||||||
|
RTSP_LOW_RES_TARGET_BITRATE=""
|
||||||
|
RTSP_LOW_RES_ENC_PARAMETER=""
|
||||||
|
RTSP_LOW_RES_FPS=""
|
||||||
|
|
||||||
|
the singular stream will be located at rtsp://login:password@IP_ADDRESS:8554/unicast multiple streams are located at rtsp://login:password@IP_ADDRESS:8554/video1_unicast and rtsp://login:password@IP_ADDRESS:8554/video2_unicast
|
||||||
|
|
||||||
|
Note: If you don't set the password, the password will be set to the unique MAC address of the camera, in all uppercase, including the colons... for example:. AA:BB:CC:00:11:22. It's typically printed on the camera. Higher video bitrates may overload your Wi-Fi connection, so a wired connection is recommended.
|
||||||
|
|
||||||
|
Huge credit to @mnakada for his libcallback library: https://github.com/mnakada/atomcam_tools
|
7
SD_ROOT/wz_mini/www/cgi-bin/WEB_CAM_ENABLE.md
Normal file
7
SD_ROOT/wz_mini/www/cgi-bin/WEB_CAM_ENABLE.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
Use as a USB Video Class (UVC) Web Camera for your PC is supported. I have tested with Windows 10, Linux, and Android TV, and it appears as a Generic HD Camera. Audio is supported. This mode disables all other functionality, and only works as a USB Web Camera for your PC. Experimental. Note that the cables typically included with the camera do not data, use a known working micro-usb cable which supports data.
|
||||||
|
|
||||||
|
Supported modes: MJPG,Video 360p/720p/1080p
|
||||||
|
|
||||||
|
WEB_CAM_ENABLE="true"
|
||||||
|
WEB_CAM_BIT_RATE="8000"
|
||||||
|
WEB_CAM_FPS_RATE="25"
|
@ -6,8 +6,7 @@ www_dir=/opt/wz_mini/www/cgi-bin/
|
|||||||
camver=V3
|
camver=V3
|
||||||
camfirmware=$(tail -n1 /configs/app.ver | cut -f2 -d= )
|
camfirmware=$(tail -n1 /configs/app.ver | cut -f2 -d= )
|
||||||
hackver=$(cat /opt/wz_mini/usr/bin/app.ver)
|
hackver=$(cat /opt/wz_mini/usr/bin/app.ver)
|
||||||
hostname=$(uname -n)
|
title="Wyze $camver on $camfirmware running wz_mini $hackver as $HOSTNAME"
|
||||||
title="Wyze $camver on $camfirmware running wz_mini $hackver as $hostname"
|
|
||||||
|
|
||||||
echo "HTTP/1.1 200"
|
echo "HTTP/1.1 200"
|
||||||
echo -e "Content-type: text/html\n\n"
|
echo -e "Content-type: text/html\n\n"
|
||||||
@ -126,13 +125,16 @@ function ini_to_html_tf
|
|||||||
#function to handle camera feed
|
#function to handle camera feed
|
||||||
function html_cam_feed
|
function html_cam_feed
|
||||||
{
|
{
|
||||||
printf '<img src="/cgi-bin/jpeg.cgi" class="feed" >'
|
printf '<img id="current_feed" src="/cgi-bin/jpeg.cgi?channel=1" class="feed" />'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo -ne "<html><head><title>$title</title>"
|
echo -ne "<html><head><title>$title</title>"
|
||||||
echo -ne "<style type=\"text/css\">"
|
echo -ne "<style type=\"text/css\">"
|
||||||
cat wz_mini_web.css
|
cat wz_mini_web.css
|
||||||
echo -ne '</style>';
|
echo -ne '</style>';
|
||||||
|
echo '<script type="text/javascript" src="/config.js" ></script>'
|
||||||
echo -ne "</head>"
|
echo -ne "</head>"
|
||||||
|
|
||||||
|
|
||||||
@ -164,4 +166,7 @@ echo -ne '<input type="submit" name="update" value="Update" />'
|
|||||||
echo -ne '</form>'
|
echo -ne '</form>'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
html_cam_feed_js
|
||||||
|
|
||||||
echo -ne '</body></html>'
|
echo -ne '</body></html>'
|
||||||
|
@ -1,3 +1,29 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cmd jpeg 0
|
|
||||||
|
|
||||||
|
#test for jpeg
|
||||||
|
if [[ $REQUEST_METHOD = 'GET' ]]; then
|
||||||
|
|
||||||
|
echo "entered GET"
|
||||||
|
#since ash does not handle arrays we create variables using eval
|
||||||
|
IFS='&'
|
||||||
|
for PAIR in $QUERY_STRING
|
||||||
|
do
|
||||||
|
K=$(echo $PAIR | cut -f1 -d=)
|
||||||
|
VA=$(echo $PAIR | cut -f2 -d=)
|
||||||
|
#VB=${VA//%3A/:}
|
||||||
|
#echo "<div>$K=$VA</div>"
|
||||||
|
eval GET_$K=$VA
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$GET_channel" ];
|
||||||
|
then
|
||||||
|
echo "X-Channel-Override: 0"
|
||||||
|
GET_channel=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "X-Channel: $GET_channel"
|
||||||
|
|
||||||
|
cmd jpeg "$GET_channel"
|
||||||
|
|
||||||
|
@ -38,4 +38,48 @@ H1 {
|
|||||||
height:calc(108px * var(--feed_ratio));
|
height:calc(108px * var(--feed_ratio));
|
||||||
z-index:10;
|
z-index:10;
|
||||||
}
|
}
|
||||||
|
.ii_explain {
|
||||||
|
height:25px;
|
||||||
|
overflow:hidden;
|
||||||
|
width:25px;
|
||||||
|
position:relative;
|
||||||
|
}
|
||||||
|
.ii_explain:hover {
|
||||||
|
height: auto;
|
||||||
|
position: absolute;
|
||||||
|
left: 10%;
|
||||||
|
width: 80%;
|
||||||
|
border-radius: 3px;
|
||||||
|
padding: 5px;
|
||||||
|
background-color: #ccc;
|
||||||
|
z-index: 10;
|
||||||
|
border: 3px solid blue;
|
||||||
|
font-family: monospace;
|
||||||
|
white-space:pre-wrap;
|
||||||
|
}
|
||||||
|
.ii_explain:hover PRE {
|
||||||
|
white-space:pre-wrap;
|
||||||
|
}
|
||||||
|
.ii_explain:hover:after {
|
||||||
|
content:"";
|
||||||
|
border:none;
|
||||||
|
margin:0;
|
||||||
|
padding:0;
|
||||||
|
width:0;
|
||||||
|
height:0;
|
||||||
|
}
|
||||||
|
.ii_explain:after {
|
||||||
|
color:white;
|
||||||
|
content:"?";
|
||||||
|
text-align:center;
|
||||||
|
background-color:blue;
|
||||||
|
border:2px solid #ccc;
|
||||||
|
border-radius:3px;
|
||||||
|
padding-left:2px;
|
||||||
|
padding-right:2px;
|
||||||
|
position:absolute;
|
||||||
|
left:0;
|
||||||
|
top:0;
|
||||||
|
width:100%;
|
||||||
|
height:100%;
|
||||||
|
}
|
||||||
|
10
SD_ROOT/wz_mini/www/config.js
Normal file
10
SD_ROOT/wz_mini/www/config.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
window.onload = function()
|
||||||
|
{
|
||||||
|
var feed = document.getElementById("current_feed");
|
||||||
|
function update_image()
|
||||||
|
{
|
||||||
|
feed.src = feed.src.split("&")[0] + "&load=" + new Date().getTime();
|
||||||
|
}
|
||||||
|
setInterval(update_image, 1000);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user