Added 'self-hosted' iCamera patch option to fix intermittent network issues (#312)

* Added iCamera patch option to fix intermittent network issues

This commit adds a ENABLE_ICAMERA_PATCH option to wz_mini.conf which
will patch the iCamera binary on the most recent firmware version so
that the device doesn't try bouncing the wireless interface when
iCamera is unable to reach the internet.

The iCamera program will be patched as part of the boot process when
`ENABLE_ICAMERA_PATCH=true` is set in wz_mini.conf. This patch can
be undone by setting `ENABLE_ICAMERA_PATCH=false` and then rebooting.

* Updated iCamera patch boot script to uninstall patch on failure

In case of an unsupported firmware update / downgrade, the iCamera
patch will uninstall itself and revert back to the stock executable.

* Set ENABLE_ICAMERA_PATCH default to false

The iCamera patch shouldn't be enabled unless network issues are
present. The user can toggle this option if they intend to run
the Wyze Cam on an isolated network.

* Fixed wait_for_icamera pgrep when running patched iCamera

The iCamera process may not be at /system/bin/iCamera if we run
the patched version of it.

This function is used to ensure that iCamera's running before
certain things happen. A search for just 'iCamera' should be
sufficient for this use case.

* Updated the iCamera patch feature as ENABLE_SELFHOSTED_MODE

This should make it clear this option should only be used in self-hosted
scenarios as it will break functionality with the Wyze App or other Cloud
services.

* Added iCamera patch support for v2 firmware 4.9.8.1002

This iCamera patch should handle the Wyze Cam v2 firmware 4.9.8.1002
and prevent the firmware from restarting the wireless network after
being unable to connect to the Wyze servers.

* Fixed iCamera build date check

Check was grepping for 'Build' which may include the build time
instead of build date.

* Updated readme for selfhosted iCamera patch feature

* Patched LED lights for v2 firmware

After connecting to WiFi, the blue LED status light will no longer blink.

* Changed the v2 status LED to remain on when connected

Looking at Wyze's documentation, the LED is supposed to be on when
it's connected and working. The off state from the last commit was
for the powered off state only.
This commit is contained in:
Leo
2022-09-27 18:48:46 -06:00
committed by GitHub
parent 4cb55cbb1e
commit 10dba022a5
6 changed files with 327 additions and 1 deletions

View File

@@ -540,6 +540,20 @@ ENABLE_CRONTAB="true"
Enable crontab. Located at `wz_mini/etc/cron/root`
---
### Self-Hosted / Isolated Mode
```
ENABLE_SELFHOSTED_MODE="true"
```
When enabled, the `iCamera` program will be patched to work nicely in a self-hosted environment. This can be reverted by setting the value to `false` and rebooting. Intended for advanced users only! Do not enable if you use the Wyze App. Disabled by default.
Normally, the firmware will restart the network interface periodically when it is unable to reach Wyze's servers which results in intermittent network drops. For advanced users that intend to run the Wyze Cam without internet access or on a controlled network, this option will patch the `iCamera` process to function without the Wyze servers.
Feature supported on:
* Wyze Cam v3 firmware: 4.36.9.139, 4.61.0.1
* Wyze Cam v2 firmware: 4.9.8.1002
---
## Latest Updates