Git Product home page Git Product logo

wyzehacks's Introduction

WyzeHacks

This project contains a set of scripts trying to provide additional features not implemented by the official firmware. Currently, it provides the following functions:

  1. Enable telnetd on your camera.
  2. Customize the default root password for telnet login.
  3. Redirect all the recordings to an NFS share.
  4. Redirect console logs into an NFS share.
  5. Automatically reboot the camera at certain time.
  6. Automatically archive the recordings.

Release notes

0.5.08

  • Fixing device hostname
  • Including device model in hostname
  • BREAKING CHANGE: The custom hostname config variable is renamed to CUSTOM_HOSTNAME due to naming conflict with some device models
  • Merged PR130 for large NFS partition support

0.5.07

  • Fixing the "network disconnected" issue on latest v2/pan beta firmware.

0.5.06

  • Support v3 cameras with root fs version 4.36.0.112 and 4.36.0.56.

0.5.05:

  • Including v3 init into the default installation process.

0.5.04:

  • Fixing hack not persisting through 4.X.6.241 update.
  • Getting rid of all the init file specific modifications.
  • Supporting the new logging method used in 4.X.6.241.
  • Stopping spamming log messages.

0.5.03:

  • Fixing broken SD card simuation on latest v3 firmware (4.36.0.252)

0.5.02:

  • Fixing an install issue with RTSP firmware.
  • Fixing an issue with NFS connectivity detection.
  • Adding a customizable threshold for NFS connectivity detection.
  • Making sure telnetd is enabled before NFS mount.

0.5.01:

  • Auto update and auto config are now checked every minute.
  • Fixing config update mechanism.
  • Changing auto reboot to use local time.
  • Moving logs to a different directory.
  • Support telnetd and physical SD card when NFS_ROOT is not specified.
  • Refreshing ifconfig.txt every minute.
  • Better method for SD card insertion simulation.
  • Removing dummymmc kernel module and uevent_recv/uevent_send binaries.
  • Adding uninstallation method.
  • Moving v2 installation location from /params to /configs.
  • WIP v3 camera support (require special steps, see tools/v3/README.md).
  • Tested on firmware 4.9.6.224 (V2), 4.6.10.224 (PAN) and 4.36.0.228 (V3).
  • Reducing wyzehack binary size by excluding some sound files.

0.4.04:

  • Adding support for latest firmware (4.9.6.218, 4.10.6.218).
  • Adding support of custom script.
  • Adding support for automatic config and wyzehack update.
  • Adding support of customized hostname.

Note: Wyze made some changes in version 4.x.6.218 cuasing it really hard to install wyze hacks non-intrusively. So I have to make some version specific changes, and there may be more version specific changes coming later if they changed it again. This means we may need more frequently releases than before (worst case for every stable firmware). This is why I added auto-update mechanism in this release to make my (and others) lives easier in future.

0.4.03:

  • Adding notification volume control.
  • Reducing the emulated SD card to 128GB to avoid issues.

0.4.02:

  • Adding an option to prevent wifi disconnecting.
  • Integrating TOTP based 2FA.
  • Supporting camera directory name containing space characters
  • Detecting stale NFS connection.

0.4.01:

  • Detecting NFS unmount and automatically reboot the camera.
  • Fixing SD card size to properly support large NFS shares.
  • Fixing config.inc.TEMPLATE comments

0.4.00:

  • Support firmware version 4.9.6.156 (WyzeCamV2) and 4.10.6.156 (WyzeCam Pan).
  • Due to new firmware blocking SD card installation, a new remote installation method has to be used.
  • SD card size emulation to make sure the hack works with large NFS shares.
  • Support NFS mount command line options in config file.

Download and installation

The latest release archive can be found in the [release folder] (https://github.com/HclX/WyzeHacks/tree/master/release). You will need to unzip the release archive before proceed. Depending on the firmware version your camera is running, you may have two or three different approaches to install the hack.

Remote install using remote_install.sh

This installation method emulates the Wyze App protocol to push the update to a running camera. You will need the following for installation:

  • A Linux-like environment with Python3.7 installed. If you are using linux, it shouldn't be a problem. MacOS might also work but I didn't test that. WSL on Windows, unfortunately, doesn't work due to its isolated network settings.
  • The target camera should be in the same network to which your Linux environment connects. If your camera is running in isolated vLAN, you may need to adjust it temporarily.
  • The target camera should be in a working condition which means you can see it alive from the Wyze App.

To do the installation, please follow these steps:

  1. Unzip your release archive a directory, and change your current working directory to there.
  2. Rename "config.inc.TEMPLATE" to "config.inc", and then update the content properly.
  3. Run "./remote_install.sh"
  4. First time, it will ask your Wyze account and password, and it may also ask for 2FA authentication.
  5. The login credentials will be stored in a local file named ".tokens" for future use so you don't need to enter username and password and 2FA everytime. Make sure you don't share this file with anyone you don't trust.
  6. The token seems to have an expiration period. So next time if you run into error with something like "Access token error" please delete ".tokens" file and restart.
  7. Once correctly authenticated, it will go through all the Wyze Cameras under your account, asking you for each of them if you want to push the wyzehack onto that camera. Enter 'Y' if yes, otherwise 'N'. Press "Ctrl + C" twice to interrupt the process.
  8. Once confirmed, you will hear "installation begins" from the target camera, and then "installation finished" confirming the installation.
  9. When you are done, make sure delete ".tokens" file from that archive folder to avoid accidental leak of your logins.

SD card install

SD card install only works when your camera is running firmware before version 4.9.6.156 (WyzeCamV2) or 4.10.6.156 (WyzeCam Pan). You will need an SD card for this purpose. Size of the SD card doesn't matter.

To do the installation, follow these steps:

  1. Prepare an SD card with FAT32 format.
  2. Extract the release archive to the root directory of SD card.
  3. Make a copy of config.inc-TEMPLATE to the root of SD card, rename it to config.inc, and update the content accordingly.
  4. Insert the SD card into camera.
  5. Wait until it says "installation finished, please remove the SD card"
  6. Make sure you remove the SD card before the camera reboots as I've seen strange behavior with SD card in it.
  7. Now you should have telnet, and also the NFS recording functionality.

Remote install using telnet_install.sh

This method works when you have telnet access, which is usually enabled after you installed older version wyze hacks.

Here are the steps to follow:

  1. Unzip the release archive to a NFS share where you can access from the camera.
  2. telnet into the device, and run telnet_install.sh from the NFS share.
  3. Wait until it says "installation finished, please remove the SD card"
  4. The device should reboot by itself in less than a minute and you should have the latest hack installed.

Automatically install a release on NFS share

In version 0.4.04 I added the "auto-update" mechanism allowing the camera to automatically install a release from NFS share. This feature is by default disabled so you have to manually enable it. Please check the config.inc.TEMPLATE on how to use it.

Uninstalling the wyzehacks

You can use one of the following ways to uninstall this hack:

Use the built-in uninstall feature

Starting with version 0.5.01, you can tell the camera to uninstall wyzehacks by placing a file at the following location: <CamDir>/wyzehacks/uninstall Once the uninstallation finished, you will see a file uninstall.done confirming the success of uninstallation, or a file uninstall.failed telling something went wrong with the uninstallation.

Do a manual telnet uninstall

With wyzehacks installed, you should have the telnet access available. You can log into the camera and perform the following steps (for v1, v2 and PAN):

  cp /system/init/app_init_orig.sh /system/init/app_init.sh 
  rm /params/wyze_hack.*

Once you verified the above commands finished successfully you are no longer having any wyzehacks related stuff on the camera.

NOTE: To telnet into the camera, you need the login with root user and its password, default one for v1/v2 is ismart12. PAN's default password is unknown so you will have to set your password shadow to allow you login. Check the PASSWD_SHADOW section in config.inc.TEMPLATE on how to do that.

Perform a SD card firmware recovery

This removes the wyzehacks boot straping code from the camera so that it will not be loaded by the camera firmware. However, your configuration file remains on the camera. Luckily there is not much sensentive information in that file.

Features:

NFS share naming:

The per camera NFS share was named by the camera's MAC address, but it's very inconvinent to manage if you have many cameras. As a result, a recent change now supports customizing folder names. All you need is renaming the folder from desktop to whatever you want and reboot the camera. The camera should remember whatever folder is using and will continue recording into the renamed folder. This feature is automatically enabled with latest version so no need to change anything in the configuration file to use this feature.

Auto rebooting:

Now you can control rebooting your camera at a specific time of each day. I found it's useful when you notice sometimes the device is not behaving very well after running for a couple days. You will need to uncomment a variable in the configuration file to use this feature.

Password shadowing:

The default root password for WyzeCam is wellknown. Since this hack will enable telnetd it may pose a new threat. To avoid that, customize the password to something only you know. You will need to uncomment a variable in the configuration file to use this feature.

Log syncing:

For debugging purpose, I improved the log syncing mechanism so now you can sync the boot console log into the NFS share at almost realtime. However, this has some security concerns as the boot log contains your credentials. To avoid that, this feature is only enabled if you uncomment a variable in the configuration file.

!!!NEVER SHARE YOUR BOOT LOG FILE WITH OTHERS OR YOUR ACCOUNT CAN BE COMPROMISED!!!

Auto archiving:

I noticed after accumulating many days of recordings, the camera is behaving strangely when you try to playback the recordings from Wyze app. To avoid that, now you can enable "auto archiving" feature by uncommenting a config variable. Older recordings will be moved to a different location which is not discoverable by the Wyze app. You can always review them from your desktop.

SD card size emulation

People reports the hack doesn't work with NFS shares bigger than a certain size. So I added a SD card size emulation so that no matter how big your NFS share is, the hack will always report an acceptable size with used space set to zero unless your free space is less than 16GB, in which case, it will report a 16GB SD card with the correct free space information.

Disclaimer:

  • This is just a personal fun project without extensive test, so use it at your own risk.
  • Be nice to Wyze: Because of their effort we have a cheap platform to play around. If you run into issues after installing this hack, make sure you verify the issue is not caused by the hack itself before you call Wyze's customer support or return the device.
  • The NFS share will need to be writable. Things can happen to the files in that share. For example, if you do a "format SD card" from the camera. In theory the operations should be limitted to the specific directory mapped for a particular camera, but I wouldn't rely on that. It's always good to setup a separate NFS share just for this purpose and isolate it from all your other important documents.
  • It is usually tested working on latest stable firmware and I don't have time to do full testing for every older versions.
  • Once installed, physical SD card will no longer be recognized by the camera.
  • The log file contains sensitive account information, so do not share with others unless you don't mind your account being compromised.
  • This hack enables telnetd on your camera. Since the username/password is wellknown, this may be a security concern if others can connect into your wifi network.
  • I didn't test what will happen if your NFS server dies, so you are on your own...

FAQ:

My camera died, how can I recover it?

You will need to perform a SD card recovery with the following steps:

  1. Download the matching firmware from wyze.com
  2. Extract it to the root directory of an SD card, and make sure it's named "demo.bin".
  3. Unplug the camera, and then insert the SD card
  4. Hold the reset button while you plugin the camera
  5. Wait for a couple seconds, release the reset button
  6. After some time, your camera should have the factory firmware installed.
  7. Please note this doesn't erase your configurations, which needs to be done through a factory reset method.

How do I uninstall the hack?

To uninstall the hack, I recommend you go through the SD card recovery method in #1 and then perform a factory reset.

It keeps saying "installation failed", anyway to debug?

On SD card there should be a file named "install.log" containing every command executed during the installation. It should give you a rough idea why it's failing. The most likely failure reason would be missing configuration file. Depending on how you install, you need to put the config.inc file to the right location for the installer to pickup.

My NFS share has more than 1TB space, why does it say only 128GB in the app?

The firwmare is designed to handle SD card, which usually has a much smaller size. With large size like this, the firmware will behave incorrectly. To avoid issues, the hack limits the emulated SD card to maximum 512GB. If your NFS share has more than 16GB free space, you will see an SD card with the size set to your available free space (capped to 128). If your share has a free space lower than 16GB, the device will see a 16GB SD card, with free space set to your actual free space.

I don't get anything on my NFS share. What can go wrong?

If you hear the "installation finished successfully" message, but still don't get any video recordings in the expected NFS share, it's very likely something wrong with your NFS share configuration. A couple ways to debug this:

  1. Check the SD card information from the app, if it says SD card not installed, there is something wrong with your NFS config.
  2. At this moment, you should have telnet enabled, try telnet into the camera and run "mount" to see if you have the NFS share correctly mounted.
  3. If mount shows no NFS file system is mounted, try to mount the share manually with the following commands and see what error message you get:
source /params/wyze_hack.cfg
mount $NFS_OPTIONS $NFS_ROOT /mnt
  1. At this point you will need to figure out what's wrong with your config file, and try to see if you can fix it by tweaking NFS_ROOT and NFS_OPTIONS in file /params/wyze_hack.cfg. You can edit this file over telnet with vi command.

I see files but no recordings on my NFS shares.

People report this kind of behavior and it seems to be caused by NFS share with size larger than a certain amount. Try make a smaller share or use "NFS quota" to limit the size. Issue #19 might be a related one.

Known issues.

  1. With release 0.4.00 and firmware 4.9.6.156 (WyzeCamV2) and 4.10.6.156 (WyzeCam Pan), I noticed sometimes the NFS share will be unmounted. The root cause is still unclear, but I believe it may have something to do with firmware's bad SD card detection.

wyzehacks's People

Contributors

beaverdude avatar cessna avatar hclx avatar johnfoconnor avatar kdvlr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wyzehacks's Issues

Install issue running remote_install.sh

i renamed the config file to config.inc and then i ran ./remote_install.sh and i keep getting an error that says

cp: cannot stat './FIRMWARE_660R.bin': No such file or directory
Found local config file, including into firmware update archive...
Upgrade/config.inc
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (2.22.0)
python3: can't open file './wyze_updater.py': [Errno 2] No such file or directory

Unable to install

I am unable to install. I unzip the appropriate files and edit the config file. I go through the install process and the voice prompts. Then the installation fails and the log returns:

Starting wyze hack installer...
Enabling telnetd...
umount: can't umount /etc: Invalid argument
Current Wyze software version is 4.9.5.111
Installing WyzeHacks version 0.3.00
Configuration file not found, aborting...

Please help.

Restart Wyze if NFS Mount is stale or not reachable ?

What's the best way to restart the camera if the NFS is not working?

For now,I am using if ! timeout -t 10 df -h | grep -q /media/mmcblk0p1 ; then reboot -f -d 10;fi to reboot if NFS connection is stale or if my NFS server had restarted. However, if NFS is unreachable for a while then there is a reboot loop unless there is a local file to keep track of restarts.

Is there a better way to test if an NFS share is available again after a disruption and only then restart the camera. Normally you could do this with showmount, but that does not exist on the wyzecam.

NFS mounted but nothing appears

I verified that the NFS share is mounted on the camera with telnet and on my server using the logs. I cant enable local recording in the app because it doesnt think there is an sd card installed. I tried it on a 4tb drive, and then I went down to a 500gb drive hoping it would fix. What troubleshooting steps can I take?

SD Card not Available 4.9.6.218

I have the latest firmware installed on my Wyze cams and i also have the latest hack installed on the cameras but the cameras show SD Card not available when trying to view playback. Telnet shows the share is mounted and it will update the share with the Mac and IfConfig files. The share is around 40TB. It used to work before the update.

WyzeHacks does not install on FW 4.9.6.104 (beta)

This is the first time I am attempting to install WyzeHacks on my cameras.

WyzeCam2
FW: 4.9.6.104 (beta)

I have followed the install procedure. A 32 GB SD card is formatted for FAT32, and the only files on the root are:

  • FIRMWARE_660R.bin
  • version.ini
  • config.inc (configured)
  • install.sh

When the SD card is inserted after a few seconds the camera will chime twice (I believe this is the normal "card inserted" notification). After that there is never a voice announcement. If I go to the camera in the Wyze app it lists the SD card as available and in use for local recording. If I then eject the card and check it there are new folders for the recording files but no log or other changes.

I have attempted to install WyzeHacks on several of my cameras with the same results.


Other things to note:

The cameras are running beta firmware. It has recently started frequently losing connection with Wyze servers (app says they are offline but it can successfully directly connect to them regardless). This is fixed for about 24 hours by physically power-cycling them (reboot commend in the app does not work at this point). This is likely a bug in the beta FW and I will be rolling back, but it is not obvious if the incompatibility with the WyzeHacks install is due to a bug or an intentional change in the FW.

I already rolled back the beta Wyze app, as it was frequently freezing when opening camera settings.

Private key

I was looking through the firmware, running strings on the iCamera binary and saw "KeyN:" and "KeyE:" followed by a series of hex strings. I recognized the terms as being related to RSA. I took the hex strings and with a little python found they are very likely for a private key. I have no idea what it is used for, but I thought you might have an idea or find it interesting.

-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQDhC+pJHrxrZd4OKzI2b8qKUSvswWj39YKe8mBHOsJ1en6kMtg3
Hnoq8Kzv6sihKMeXjEX8k00Z623KJjTMmLQtTUWq6ylKzr/0u5Q4xL12o+rbS7eu
GLyZqVsKoWty08S1LxC4ocXrYJaRYVQIZa7PwWqHKF/FIFKFIda+JEThHwIDAQAB
AoGAWI2Ttwn9IlWHNxQQQhNjI2IlYpgIcemNaHX/JIgelJOK2ZmYMrgvYk4p/o3o
PGILh7qOn4Bmylg1b2HxTMCZxKyt90/lGYzUu8i+jvxvcsvrwejJwVluk4bXhGJC
pw4brXNQzngIBHstPhjfo6aiQXKpK3a+dSL9q1ooxE7CgoECQQD4TkLthpW3oQsd
fceIrszD+sD8vfqTUlrXL8/XBONejmkCmVUMe6WHlMzAHrpCib+jb0K4mznsLOzY
Igk1sm7vAkEA6AUlOPSw3K/hvZfGdXOR+gA+9DSRTPNPKrA4gnVl9H11mXuzEjAj
vwU/8WblUwOgr69xYyk+1IBOJ2+1c+yw0QJBAK31VlpGQbnGb50Xs6UEoZxjnrTy
/AweVFoRuxCu8gQazWLuvXDjZ1KXYuLuJBvdmY8MsbfXuDrINp4tKjqeaa0CQFN4
LmjsFoh+Oc70QDBW0GhJGFzQYIl3ar6nwNymEXTAgcMirkxXxzRcViGpa8zOnEs3
6anL18+pDPTBCl1XBFECQHcXY2P8emOGbZzI6Mz2nEOwV3HdQ0YzNZHlF7yqtVtv
ky3Air5FKHWoFNu1pOGwTxyllxMCwhP0EtBY3SHHPvk=
-----END RSA PRIVATE KEY-----

Just a note: I'm fairly confident the numbers I found are a private key since the python script I used didn't require inputting the exponents, but if you run openssl rsa -text -in wyze_private.pem, the exponents match. Meaning the hex strings are internally consistent with those stored in a private key struct.

FTP Access

How difficult would it be to make a fork that leaves the SD card intact but runs an FTP server so that we get both local storage and the opportunity to grab the recordings for more redundancy instead of relying on the NFS share availability?

No video recordings on NFS share but other files are created

There are multiple reports that on certain setups the NFS share is mounted correctly, some files are created, however, no video recordings. I suspect this has something to do with the NFS share size but will need more information on this since I don't have a large enough NFS share to test this out.

Flashed Multiple times but still no NFS

I've flashed the hack multiple times and each time with a different response. Seems as though the hack runs into errors and doesn't have an error catch. Sometimes I flash the hack on 4.9.5.36 and get telnetd and NFS but not mounted in the SDCARD location, other times I get only telnetd and other times the camera reboots without applying anything.

Not really sure what's needed or how to execute the hack when I get the camera to boot again with only telnetd. I've tried to look through the source code here trying to apply the hack manually at times when I only get telnet but I have not had success.

4.9.6.207 beta Firmware

Updating to 4.9.6.207 beta firmware causes the camera to not detect the NFS connection as an SD card even though the mount is still active and valid.

Downgrading to 4.9.6.199 works fine.

RTSP Server

Hello @HclX, thanks for your work.

I have a small suggestion, adding optional support to the RTSP server in your hack will be awesome.

If the problem is space, you can store it on NFS.

wyze hack doesn't persist through the update of 4.10.5.98

I was checking the latest update and noticed that it's using a rather complicated approach which causes wyzehack no longer persist through the update, will looking for solutions.

At this moment, I think the solution would be re-install the hack: for camv2 the telnet interface should still open after update so you can simply telnet into it and install the hack. However, for cam pan, even though the telnet is still active, the credential is unknown so you will have to use the SD card method.

Sftp?

Does the firmware ship with sshd and ssh? I would love to use sftp to upload files to my NAS, and ssh rather than telnet to connect to it.

incorrect sd size handing in firmware

// If there are more than 16GB free space, we will emulate an
// empty SD card whose total space equals to the free space up
// to 512GB
if (buf->f_bavail > blocks_per_gb * 512) {
// Limit free space to 512GB
buf->f_bavail = blocks_per_gb * 512;
}

tl;dr please limit the SD card emulation to 128GB.

I've noticed a very strange behavior on every recent firmware regarding record deletion. It periodically removes old mp4 even if there is a plenty of space. The root cause is in the math how they count free SD space and it's % compared to total space.
First of all there is a nice QWORD->DWORD conversion (uint overflow) when firmware counts total/free/available bytes:
(uint)((ulonglong)stack.f_bsize * (ulonglong)stack.f_blocks);
which, according to an unsigned overflow rule, literally comes to TotalBytes % 0x100000000 resulting wrong numbers in log when SD size > 4GB. It looks like a leftover from older versions and later in code they recalculate sizes in KB, so theoretically up to 4TB sizes should be supported, BUT:
Secondly, when a firmware decides whether to clean space or not it checks sizes in KB:
if ((0x32000 < (uint)FreeKB) && ((uint)TotalKB < (uint)FreeKB * 0x1e)) then return else delete
meaning 'run cleanup if less then either ~204MB or 1/30 left free' <- here is the issue.
obviously, (uint)FreeKB * 0x1e will overflow DWORD if FreeKB > 0x888888, or roughly 136GB, leaving a 4-byte register with only a little remainder, making the condition false and starting a records cleanup.

Since wyze has no feedback form or bug hunting, let's fix in this lib.

Cannot upgrade hack using remote install

Just decided to share my experience, it might be useful for somebody. Also, there might be a bug with perms.

Goal: make some changes in hack sources (specifically, apply the change to adjust the volume via config from dev branch), build and upgrade some cam.

I've made some changes, then bumped version in wyze_hack/hack_ver.inc, then run build.sh script. Everything worked smooth, I've got release/<MY_NEW_VER>.

I tried the way with remote install, it worked pretty neatly for me for the initial install. So, I've run remote_install.sh in a new folder with a new version, run the process, it worked fine. But it didn't upgrade anything on camera.

So, I've tried the way with telnet install. I've copied the folder into NFS, and from camera run telnet_install.sh from that NFS folder. Then I saw this error:
/tmp/Upgrade/upgraderun.sh: line 8: /tmp/Upgrade/wyze_hack.sh: Permission denied
So, I went to telnet_install.sh and added one line:

chmod +x /tmp/Upgrade/wyze_hack.sh
/tmp/Upgrade/upgraderun.sh

Then I run it again and it worked this time. The camera rebooted and I've got updated stuff in /tmp/run/wyze_hack/hack_ver.inc and all other files.

NFS share being unmounted randomly with release 0.4.00

I've seen multiple cases that the NFS share being unmounted. There is no specific pattern or anything predictable so far. It seems that the latest firmware will think the "SD card" is not working so it dismounts it.

Adjust Volume of "Network connection lost" speaker output prompt

Hi - As of 0.4.02 there was the addition of a voice prompt when network connection is lost. Is it possible to adjust the volume / remove the prompt? Some cameras are placed indoors and the volume seems high for something that could go off at night.

Thanks!

Stream quality suggestion

Hi, not an issue, just a suggestion.
I've noticed there is a dev trace left from cam tuning:
/system/bin/impdbg

it's a simply encoder on-the-fly setup (I used recommended calculated bitrate for 1080p 15fps)

/system/bin/impdbg --enc_rc_s 0:28:4:2240
/system/bin/impdbg --enc_rc_s 0:40:4:1

to increase compression quality and bitrate. Please be aware - you have to provide strong wifi connection to handle more data.

Hope you can include that into sh and make configurable. Just in case.

HD->SD and back setting via app change will reset this hack, unfortunately.

SD card shows as "0.05 GB" on some cameras

Install works, folder appears on NAS, however the SD card shows a capacity of 0.05 GB instead of the 14TB that the others show. Still shows the same after rebooting a dozen times.

Running Wyze Cam v2 on latest commit on newest Wyze firmware (4.9.5.35)

root password

What is the root default password? Or do I have to generate one in order to use telnet?

Voice alerts VERY loud

The voice alerts are very loud (ex: when network connectivity is lost).

Is there a way to make these alerts quieter? or completely disable them?

Modify naming of stored folder from just the MAC address?

Now that I've gotten this working quite well on my cameras, one glaring issue I see is relying on just the MAC address for naming of the stored folder on the NFS share and making it hard to track down if going in manually and not through the Wyze app.

I imagine the MAC is pulled on-camera after it has been flashed and used internally during the NFS mounting/writing process. Is it possible the 'friendly name' per the Wyze app is stored on camera somewhere and can be used? Maybe an additional config option for people to choose how they want it named. Or I'd even be happy with something like '_'.

Cameras rebooting

This is a weird one: I noticed when log syncing is enabled the camera reboots quite often. It seems to have something to do with log syncing because the reboot is quite unpredictable and is really hard to notice without log syncing enabled.

"No SD card" once SD card removed

I'm using the newest commit, never had any hacks installed. Followed instruction, once SD card is removed, Wyze cam shows no SD card inserted.

Unable to get hacks to install. remote_installer.sh confirms firmware bin was pushed, but no change from cam

So I have a few v2's in my house, about half have SD cards, the others do not. So far tested on 2 cams with no SD cards installed (one cannot due to, I assume, a failed SD card slot or connecting hardware. The rest of the cam is fully functional). After doing some trial and error I have come as far as having the remote_installer script work and confirming the cam has pulled the firmware from the local server but the camera doesn't reboot, no audible announcements, and the live feed from the Wyze app continues to run.

Currently operating from an Ubuntu WSL install on my Windows 10 v2004 machine. All dependencies properly installed, python 3.8.2.

I started with the most recent FW version, 4.9.6.199 for the v2's but even downgraded to the noted last confirmed working version on the README page of 4.9.6.156 just to rule things out. Both do the same. Even tried rebooting the cams amidst all this. Here's a snippet below of the script on one cam I have attempted to hack.

Device type: Camera (WYZEC1-JZ)
Device name: Kitchen
Firmware version: 4.9.6.156
IP Address: 192.168.1.167

Pushing firmware to this device? [y/N]:y
INFO:root:Serving firmware file './firmware.bin' as 'http://192.168.1.107:11808/firmware.bin', md5=68e279ca2d3208bbb55111ac6d38c432
192.168.1.167 - - [24/Oct/2020 15:31:51] "GET /firmware.bin HTTP/1.1" 200 -
INFO:root:Checking device, mac=XXXXXXXXXX

Any thoughts on where I should look next or additional troubleshooting steps I can try? Ultimately I'd like to remove the SD cards altogether and just have everything fed over NFS and leave it at that.

Wyze Cam v2 v4.9.6.199 No NFS or Telnet on v0.4.04

I really like the idea of storing the files on a NFS mount. I tried with v 0.4.03 then with v04.04 and both get to the "installation finished" voice and reboot but no NFS mount or telnet access. I've tested the NFS mount (EXT2, 700GB Avail) from my workstation and it's works from there. I'm using the default config template with only the NFS line updated.

The install log was created the first time. Which I didn't save :( Now every install since it hasn't created the install log.

Suggestions?

"Configuration file not found, aborting"

So I was updating my cameras and wyzehack where uninstalled. I still have access to telnet and I was wondering if I could reinstall the hack without having to take down my cameras. I still have access to telnet and I was able to wget the files to system folder but I can't seem to finish the install as it can't find my configuration files which causes it to abort the install. Is there a way to get around this and then later re insert the configuration files.

This is what my console shows when running the install.sh

wyze_hack/
wyze_hack/app_ver.inc
wyze_hack/auto_archive.sh
wyze_hack/auto_reboot.sh
wyze_hack/bin/
wyze_hack/bin/audioplay
wyze_hack/bin/blkid
wyze_hack/bin/dummy_mmc.ko
wyze_hack/bin/mount
wyze_hack/bin/reboot
wyze_hack/bin/uevent_recv
wyze_hack/bin/uevent_send
wyze_hack/bind_etc.sh
wyze_hack/hack_ver.inc
wyze_hack/hook_init.sh
wyze_hack/install.sh
wyze_hack/log_sync.sh
wyze_hack/mount_nfs.sh
wyze_hack/playwav.sh
wyze_hack/run.sh
wyze_hack/snd/
wyze_hack/snd/begin.wav
wyze_hack/snd/failed.wav
wyze_hack/snd/finished.wav
Starting wyze hack installer...
Enabling telnetd...
Current Wyze software version is 4.9.5.111
Installing WyzeHacks version 0.3.00
Configuration file not found, aborting...

Enable telnet access only

Is it possible within the current config file to enable telnet access only, without making other modifications? Iโ€™m wanting to poke around the camera OS a bit, without losing the ability to record to the local SD card. If not, could this be considered for a later enhancement?

Camera not recording to NFS Share

So I went through the complete process, and all seems to be good. I am able to connect to the camera, and confirmed the NFS share is mounted. However, video is not being recorded to the NFS share. I did confirm the "Continues Recording" option is selected. I can see in the folder "Alarm" images are being recorded so it seems it is not a permissions issue. But I do not see video anywhere. Also, then I go to video playback it shows no video is available. I'm assuming this is user error in some way shape or form but I do not know where to look to resolve. Can someone shed some light on what the issue may be? Thanks in advance.

4.9.4.175

Does this work with the latest firmware update?

/mnt is read only, getting permission denied when trying to mount

I can mount my NFS manually with mount -o port=2049,nolock,proto=tcp 192.168.10.20:/volume1/cameras /tmp/test via telnet in the camera. However, whenever I try to modify mount_nfs.sh to add the required options, I always get permission denied when I try to run the script. Not sure if i'm just not editing the script correctly.

I can't create a directory in /mnt as it's read-only, wondering if that's the issue (though I can mount by hand)? Really want to take advantage of this hack, any help would be appreciated.

How to detect a notification/alarm

I have enabled the person detection and am recording to nfs, in the event of a person detected I would like to be able to execute a custom script. Do you have any idea where the events are recorded?

After going back to factory firmware, telnet still enabled with default root password

I got one of my cameras updated to WyzeHacks firmware. But I was having some problems.

So I decided to go back to factory 4.9.5.36. After following official instructions https://support.wyzecam.com/hc/en-us/articles/360031490871-How-to-flash-firmware-manually, I noticed that I can still telnet into the camera. But now with the default root password. I'm definitely back on the stock firmware, because there is no /tmp/boot.log like there was with the WyzeHacks firmware. So it seems like my cam is on a mix of this and factory firmware? How do I get all the way back to factory firmware? Or at least turn off telnet?

NFS Filesystem Type - FAT32 or NTFS

Are you using FAT32 or NTFS for your NFS share. I can get my share to mount but no record folder is created. I run 'df -h' I get the error 'Value too large for defined data type'. This leads me to think large file support is not part of the Wyze firmware. Any thoughts?

I am using NFS4 with a 8 TB drive.

Can't telnet after installing

I think I followed the instructions correctly to update my WyzeCam v2, but putty telnet says "connection refused". Probably user error on my part, but I can't spot my problem.

More details ...

  1. Started with WyzeCam v2 running stock 4.9.5.36 firmware.

  2. Copied the appropriate files from https://github.com/HclX/WyzeHacks/tree/master/release into the root folder of an empty 2GB sd card with FAT32 format. Including rename+edit of config.inc.TEMPLATE, the root of the sd card looks like this:

g:\>dir
 Volume in drive G is SD2GB
 Volume Serial Number is 5CBA-50FE

 Directory of g:\

12/31/2019  12:42 PM           112,640 FIRMWARE_660R.bin
12/31/2019  12:42 PM                65 version.ini
12/31/2019  12:34 PM             1,347 config.inc
               3 File(s)        114,052 bytes
               0 Dir(s)   1,969,696,768 bytes free
  1. With WyzeCam unplugged from power, inserted SD card.

  2. Plugged in WyzeCam, waited for solid blue light

  3. After solid blue light, camera working fine in app.

  4. Used app's "device info" to get IP address of cam.

  5. Used putty to try and telnet to that IP address. Result is "connection refused"

==============

Issue is probably user error on my part, but I can't spot what I'm doing wrong.

[Solution] Windows NFS Server

Hello,

After much headache, I've found a solution for hosting a NFS share on Windows and getting Wyze Hacks to work with it. I'm hoping this info could be added to the setup information somewhere.

Grab a copy of haneWIN NFS Server for Windows:
https://www.hanewin.net/nfs-e.htm

Edit the "exports" file, and place a # at the beginning of each line (to comment out the default lines).
Add a new line similar to the `following:

A:\NFS -name:nfsroot -umask:000 -public -mapall:0

(Edit/Change "A:\NFS" to the folder you want to be the root of your NFS share.

Run "nfssrv.exe" to start the NFS Server.
Edit > Preferences
NFS tab:
----- Change "Maximum NFS transfer size (bytes)" to 32768
Server tab:
----- Check "Save attributes/uid/gid on NTFS volumes"

For your cam, edit the /params/wyze_hack.cfg and set the following:

export NFS_ROOT='192.168.1.147:/nfsroot'
(Edit/Change "192.168.1.147" to the IP of your NFS Server's IP)

export NFS_OPTIONS='-o nolock -o tcp -o rsize=32768,wsize=32768'

You should now have a fully functional NFS Share on Windows ๐Ÿ˜Ž

Edit:
I was having issues with my NFS server randomly dying or failing to start. I found out this is because Windows has "float" ports, where Windows will use some of the needed ports for it's own operations randomly. To stop this, we have to reserve (exclude) the ports listed blow that are needed for NFS so that they won't be used by the Windows subsystem:

111 (TCP & UDP) - PortMapper Service
1058 (TCP & UDP) - Mount Daemon Port
2049 (TCP & UDP) - NFS Server Port

Run the following commands from an Administrative command prompt to reserve ports on both protocols:
netsh int ipv4 add excludedportrange protocol=tcp startport=111 numberofports=1
netsh int ipv4 add excludedportrange protocol=udp startport=111 numberofports=1
netsh int ipv4 add excludedportrange protocol=tcp startport=1058 numberofports=1
netsh int ipv4 add excludedportrange protocol=udp startport=1058 numberofports=1
netsh int ipv4 add excludedportrange protocol=tcp startport=2049 numberofports=1
netsh int ipv4 add excludedportrange protocol=udp startport=2049 numberofports=1

NFS Connection Refused error

I was getting connection refused error while trying to mount my nfs server when I tried to manually mount my NFS drive. I thought it was an error on my linux server, so I tried my old NAS and that still showed a problem. Other clients were connecting, but WyzeCamPan was not connecting.

I forced it to connect via UDP using -o port=2049,nolock,proto=tcp and this mounted the drive immediately.

no nfs mounted, but root is working

I followed your instructions

cd /system/bin/

cat mount.sh
#mount -o nolock,rw 192.168.31.218:/home/xuxuequan/Ingenicwork/sharenfs /mnt

Looks like my NFS from the config file was ignored??

Install Trouble

I have prepared the SD card as indicated in the README. Format FAT32. Extract the release to the root of the card, modify config.inc.

The instructions are slightly less clear on what to do next. I've tried the following.

  1. With the camera powered on, just insert the card and wait. Nothing happens.

  2. With the camera off, insert the card. Then power the camera. Firmware does not get installed.

  3. With the camera off, insert the card. Then hold "RESET" while powering the camera until the LED changes colors. After a very long time, this resulted in the "Installation complete. Remove SD Card" message.

If step 3 is the correct procedure, the README should be updated to reflect that.

Continuing from 3, the instructions say to remove the card. I removed it, but was unable to connect via telnet. So then I restarted the camera, and I'm still unable to connect.

No Video on NFS

Having the same issue as documented here: #18 but mine hasn't gone away.

I see a time_lapse, alarm directory and a few text files in the target NFS share- so I know its writing files fine. within the alarm directory, I see new directories created every day, with a couple of jpgs in them.

Any idea what gives?
thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.