add remote spotlight and fix library paths

This commit is contained in:
Alfonso Gamboa 2022-04-17 21:02:58 -07:00
parent 3f85828621
commit 0bb91bd8fb
7 changed files with 52 additions and 14 deletions

View File

@ -1,7 +1,7 @@
# wz_mini_hacks
### v3/PANv2 devices ONLY
Run whatever firmware you want on your cameras and have root access to the device. This is in early stages of testing, use CAUTION if you are unsure of what you are doing. No support whatsoever is offered with this release.
Run whatever firmware you want on your v3/PANv2 and have root access to the device. This is in early stages of testing, use CAUTION if you are unsure of what you are doing. No support whatsoever is offered with this release.
**Do not contact the manufacturer for information or support, they will not be able to assist you!**
### Related Projects:
@ -11,9 +11,9 @@ Run whatever firmware you want on your cameras and have root access to the devic
## Features
* No modification is done to the system. **_Zero!_**
* Custom kernel loads all required files from micro-sd card
* Wireguard, and ipv6 support enabled
* No modification is done to the device filesystem. **_Zero!_**
* Custom kernel loads all required files from micro-sd card at boot time
* Wireguard and IPv6 support enabled
* Supports the following USB Ethernet adapters:
* ASIX AX88xxx Based USB 2.0 Ethernet Adapters
* ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet
@ -25,8 +25,6 @@ Run whatever firmware you want on your cameras and have root access to the devic
* Ability to block remote AND app initiated firmware updates
* Works on ANY firmware release (so far!)
* DNS Spoofing or Telnet mod are *not* required prior to installation
* *NEW* Installation-Free! Put files on the micro sd card and wait for the unit to boot!
* PAN v2 now supported
* Inspired by HclX and WyzeHacks! Bless you for all your work! You are the master!
@ -34,11 +32,12 @@ Run whatever firmware you want on your cameras and have root access to the devic
* Enable tethering to android phones (RNDIS)
* RTSP Streaming Server ( test @ https://github.com/gtxaspec/wz_mini_hacks_rtsp )
## Prerequisites
* Person
* Computer
* Micro-SD Card is required!
* 256MB or larger Micro-SD Card is required!
## Setup
@ -49,17 +48,17 @@ Run whatever firmware you want on your cameras and have root access to the devic
1. Turn off the camera
2. Insert the micro sd memory card into the camera
3. Turn on the camera
4. The camera will boot, then you may connect via the IP address of your device using SSH, port 22. username is root password is WYom2020. It may take a few minutes for the device to finish booting and connect to wifi, then launch the SSH server. Be patient.
4. The camera will proceed to boot, then you may connect via the IP address of your device using SSH, port 22. username is root password is WYom2020. It may take a few minutes for the device to finish booting and connect to Wi-Fi, then launch the SSH server. Be patient.
## Removal
1. Delete the files you copied to the memory card. The next time you boot the camera, you will return to stock firmware.
1. Delete the files you copied to the memory card, or remove the memory card all together. The next time you boot the camera, you will return to stock firmware.
## Customization
Edit run_mmc.sh, this is a script stored on the micro sd card that is run when the camera boots. You can change the hostname of the camera, mount NFS, add ping commands, anything you like.
---
**DO NOT ENABLE FIRMWARE UPDATES, CURRENTLY THERE IS A BOOTLOADER BUG WHICH RESULTS IN A BROKEN SYSTEM. currently set to true by default.**
**DO NOT ENABLE FIRMWARE UPDATES (unless you know what you are doing), CURRENTLY THERE IS A BOOTLOADER BUG WHICH RESULTS IN A BROKEN SYSTEM. currently set to true by default.**
To disable automatic firmware updates, edit run_mmc.sh in the wz_mini directory on your micro sd card,
change:
```
@ -108,16 +107,32 @@ the next time you boot your camera, make sure your USB cable is connected to the
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!
---
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.
---
## Latest Updates
* 04-17-22: Add remote spotlight accessory capability
* 04-15-22: Enable USB Direct functionality. Allows you to connect camera using a USB cable to a device supporting CDC_NCM devices to get an internet connection, no USB Ethernet Adapter required.
* 04-14-22: Fix kernel command line memory mappings, resolves stability issues
* 04-14-22: Possible memory leak with some USB adapters used, added 128MB swap file and logic as workaround to prevent oom killing
* 04-13-22: Firmware updates are disabled by default, there is a bug in the bootloader that corrupts the kernel partition requiring the re-flash of the camera if an update is processed and the memory card is removed before next boot. The bootloader proceeds to copy the partitions and the system will not boot unless re-flashed. pending investigation.
* 04-12-22: Updated, custom kernel loads all required items from micro sd card. System modification no longer needed.
* 04-05-22: Update readme to indicate that telnet mod nor DNS spoofing is required for installation, and add pre-requisites section.
* 04-05-22: Update readme to indicate that telnet mod nor DNS spoofing is required for installation, and add per-requisites section.
* 04-02-22: Update to automatic install method, remove manual install.
## BYO

BIN
SD_ROOT/wz_mini/bin/socat Executable file

Binary file not shown.

View File

@ -0,0 +1,13 @@
#!/bin/sh
if [[ "$1" == "on_high" ]]; then
echo -ne "\xaa\x55\x43\x05\x16\xff\x07\x02\x63" > /dev/ttyUSB0
elif [[ "$1" == "on_low" ]]; then
echo -ne "\xaa\x55\x43\x05\x16\x33\x07\x01\x97" > /dev/ttyUSB0
elif [[ "$1" == "off" ]]; then
echo -ne "\xaa\x55\x43\x05\x16\x00\x07\x01\x64" > /dev/ttyUSB0
else
echo "usage: spotlight_ctl on_high"
echo "usage: spotlight_ctl on_low"
echo "usage: spotlight_ctl off"
fi

BIN
SD_ROOT/wz_mini/bin/strace Executable file

Binary file not shown.

BIN
SD_ROOT/wz_mini/bin/tcpdump Executable file

Binary file not shown.

View File

@ -10,7 +10,7 @@ fi
# Set terminal env
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/media/mmc/wz_mini/bin
export PATH=/system/bin:$PATH
export LD_LIBRARY_PATH=/system/lib
export LD_LIBRARY_PATH=/system/lib:/media/mmc/wz_mini/lib
export LD_LIBRARY_PATH=/thirdlib:$LD_LIBRARY_PATH
#export TZ=UTC-8

View File

@ -12,6 +12,9 @@ ENABLE_USB_ETH="false"
ENABLE_USB_DIRECT="false"
USB_DIRECT_MAC_ADDR="02:01:02:03:04:08"
REMOTE_SPOTLIGHT="false"
REMOTE_SPOTLIGHT_HOST="0.0.0.0"
echo "run_mmc.sh start" > /dev/kmsg
if [[ -d /configs/.ssh ]]; then
@ -73,10 +76,17 @@ if [[ "$DISABLE_FW_UPGRADE" == "true" ]]; then
mount --bind /tmp/.hosts_wz /etc/hosts
fi
echo set hostname
if [[ "$REMOTE_SPOTLIGHT" == "true" ]]; then
socat pty,link=/dev/ttyUSB0,raw tcp:$REMOTE_SPOTLIGHT_HOST:9000
fi
echo "set hostname"
hostname $HOSTNAME
echo Run dropbear ssh server
echo "bind /etc/profile for local shell"
mount --bind /media/mmc/wz_mini/etc/profile /etc/profile
echo "Run dropbear ssh server"
/media/mmc/wz_mini/bin/dropbearmulti dropbear -R -m
sleep 3