revise paths, add ethernet deps

This commit is contained in:
Alfonso Gamboa 2022-04-12 23:26:15 -07:00
parent b63fe86438
commit 448941ba59
10 changed files with 74 additions and 34 deletions

View File

@ -1,26 +1,27 @@
# wz_mini_hacks
### v3 devices ONLY
### v3/PANv2 devices ONLY
Run the latest stable ( 4.36.8.32 ) firmware on your v3 cam 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 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.
**Do not contact the manufacturer for information or support, they will not be able to assist you!**
### Related Projects:
* wz_mini_debian: run full debian in a chroot, on the v3!
* wz_mini_utils: various statically compiled binaries for use with the v3 (mipsel)
* wz_mini_debian: run full debian in a chroot, on the camera!
* wz_mini_utils: various statically compiled binaries for use with the camera (mipsel)
## Features
* No modification is done to the system. **_Zero!_**
* Custom kernel loads all required files from micro-sd card
* Wireguard, and ipv6 support enabled
* Easy uninstall, just remove files from micro-sd card, or don't use a micro-sd card at all!
* Add your own changes to run at boot into the script on the micro sd card located at /media/mmc/run_mmc.sh, mount nfs, run ping, whatever you want
* Ability to update to the latest stable or beta firmware, this mod should survive updates as long as the bootloader remains the same
* Ability to block remote AND app initiated firmware updates
* Works on ANY ( tested up to 4.36.8.32, even RTSP ) v3 firmware release
* Works on ANY firmware release (so far!)
* DNS Spoofing or Telnet mod are *not* required prior to installation
* *NEW* Automated installer, put files on the micro sd card and wait for the unit to reboot
* PAN v2 Support coming soon
* PAN v2 now supported
* Inspired by HclX and WyzeHacks, borrowed busybox and dropbearmulti from his v2 repo. Bless you for all your work! You are the master!
## Prerequisites
@ -35,9 +36,9 @@ Run the latest stable ( 4.36.8.32 ) firmware on your v3 cam and have root access
2. copy all the files inside of SD_ROOT to your micro sd card
## Installation
1. Turn off the v3 camera
2. Insert the micro sd memory card into the v3 camera
3. Turn on the v3 camera
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.
## Removal

BIN
SD_ROOT/factory_t31_ZMC6tiIDQN Executable file → Normal file

Binary file not shown.

Binary file not shown.

BIN
SD_ROOT/wz_mini/bin/dropbearmulti Executable file → Normal file

Binary file not shown.

View File

@ -0,0 +1,13 @@
#!/bin/sh
echo 'wlan0 IEEE 802.11bgn ESSID:"ethernet" Nickname:"<WIFI@REALTEK>"'
echo ' Mode:Managed Frequency:2.472 GHz Access Point: 70:8B:CD:86::E8'
echo ' Bit Rate:72.2 Mb/s Sensitivity:0/0 '
echo ' Retry:off RTS thr:off Fragment thr:off'
echo ' Encryption key:****-****-****-****-****-****-****-**** Security mode:open'
echo ' Power Management:off'
echo ' Link Quality=92/100 Signal level=100/100 Noise level=0/100'
echo ' Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0'
echo ' Tx excessive retries:0 Invalid misc:0 Missed beacon:0'

BIN
SD_ROOT/wz_mini/bin/wg Normal file

Binary file not shown.

View File

@ -0,0 +1,4 @@
#!/bin/sh
echo 'wpa_state=COMPLETED'
echo ip_addresss=`ifconfig wlan0 | awk '/inet / {print $2}' | awk -F: '{print $2}'`

View File

@ -0,0 +1,18 @@
# Set PS1
if [ "$PS1" ]; then
if [ "`id -u`" -eq 0 ]; then
export PS1='[\u@\h:\W]# '
else
export PS1='[\u@\h:\W]$ '
fi
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=/thirdlib:$LD_LIBRARY_PATH
#export TZ=UTC-8
# Set directoty and file default create permission
umask 022

View File

@ -1,52 +1,56 @@
#!/bin/sh
DISABLE_FW_UPGRADE="false"
HOSTNAME="WCV3_spare_test"
echo "run_mmc.sh start" > /dev/kmsg
echo "check if ethernet adapter is present"
if [[ ! -d /sys/class/net/eth* ]]; then
echo "usb ethernet not present"
if [[ ! -d /sys/class/net/usb0* ]]; then
echo "usb host not present"
else
ifconfig usb0 down
ifconfig wlan0 down
/media/mmc/busybox ip link set wlan0 address 02:01:02:03:04:08
/media/mmc/busybox ip link set wlan0 name wlanold
/media/mmc/busybox ip link set usb0 name wlan0
ifconfig wlan0 up
udhcpc -i wlan0
/media/mmc/dropbearmulti dropbear -R -m &
sleep 5
mount -o bind /media/mmc/wpa_cli.sh /bin/wpa_cli
##ONLY WORKS WITH g_ethernet enabled kernel
ifconfig usb0 down
ifconfig wlan0 down
/media/mmc/wz_mini/bin/busybox ip link set wlan0 address 02:01:02:03:04:08
/media/mmc/wz_mini/bin/busybox ip link set wlan0 name wlanold
/media/mmc/wz_mini/bin/busybox ip link set usb0 name wlan0
ifconfig wlan0 up
udhcpc -i wlan0
/media/mmc/wz_mini/bin/dropbearmulti dropbear -R -m &
sleep 5
mount -o bind /media/mmc/wz_mini/bin/wpa_cli.sh /bin/wpa_cli
fi
else
ifconfig eth0 down
ifconfig wlan0 down
/media/mmc/busybox ip link set wlan0 name wlanold
/media/mmc/busybox ip link set eth0 name wlan0
/media/mmc/wz_mini/bin/busybox ip link set wlan0 name wlanold
/media/mmc/wz_mini/bin/busybox ip link set eth0 name wlan0
ifconfig wlan0 up
udhcpc -i wlan0
/media/mmc/dropbearmulti dropbear -R -m &
/media/mmc/wz_mini/bin/dropbearmulti dropbear -R -m &
sleep 5
mount -o bind /media/mmc/wpa_cli.sh /bin/wpa_cli
mount -o bind /media/mmc/wz_mini/bin/wpa_cli.sh /bin/wpa_cli
fi
echo set hostname
hostname WCV3_spare_test
if [[ "$DISABLE_FW_UPGRADE" == "true" ]]; then
mkdir /tmp/Upgrade
mount -t tmpfs -o size=1,nr_inodes=1 none /tmp/Upgrade
echo -e "127.0.0.1 localhost \n127.0.0.1 wyze-upgrade-service.wyzecam.com" > /tmp/hosts_wz
mount --bind /tmp/hosts_wz /etc/hosts
fi
echo Store dmesg logs
dmesg > /media/mmc/wz_mini/logs/dmesg.log
echo set hostname
hostname $HOSTNAME
echo Run dropbear ssh server
/media/mmc/wz_mini/bin/dropbearmulti dropbear -R -m
#echo Disable remote firmware upgrade, uncomment lines below to enable
#mkdir /tmp/Upgrade
#mount -t tmpfs -o size=1,nr_inodes=1 none /tmp/Upgrade
#echo -e 127.0.0.1 localhost n127.0.0.1 wyze-upgrade-service.wyzecam.com > /tmp/hosts_wz
#mount --bind /tmp/hosts_wz /etc/hosts
sleep 3
#Place commands here to run 30 seconds after boot