Add multi-WiFi network support for slim version#470
Open
pawelma wants to merge 10 commits intoalienatedsec:masterfrom
Open
Add multi-WiFi network support for slim version#470pawelma wants to merge 10 commits intoalienatedsec:masterfrom
pawelma wants to merge 10 commits intoalienatedsec:masterfrom
Conversation
When DISABLE_CLOUD=yes, the cloud process still runs (required by rmm) and repeatedly calls cloudAPI for time sync (cmd 136). Each call spawns two shell processes: cloudAPI -> cloudAPI_fake, and the inner ntpd call blocks indefinitely waiting for NTP response (no internet access). This causes ~75 zombie/stuck processes in 17 minutes, leading to load averages >6 on a single-core ARM device, memory exhaustion (656KB free of 18.5MB), and eventual RTSP server crashes after 50-80 minutes. Changes: - cloudAPI: use 'exec' to replace shell process instead of spawning a child, halving the process count per invocation - cloudAPI_fake: add 10-second timeout to ntpd sync call to prevent indefinite blocking when no internet is available
The watchdog unconditionally checks if mqttv4 is running and restarts it every cycle. When MQTT=no in config, mqttv4 is never started and doesn't exist, causing the watchdog to attempt restarts every ~2 seconds in a tight loop. This wastes CPU cycles and floods the log with hundreds of failed restart attempts per minute. Gate the check_mqttv4 call on the MQTT configuration setting.
Increase net.core.rmem_max, wmem_max, rmem_default, and wmem_default from 163840 (160KB) to 524288 (512KB). The small default buffers can cause RTSP packet drops under load on this memory-constrained system. This change was recommended by roleoroleo (yi-hack-MStar maintainer) in roleoroleo/yi-hack-MStar#414
Check that h264grabber keeps the FIFO fd open, which validates the data pipeline is intact. rRTSPServer opens the FIFO lazily (only on client connect), so we only verify the grabber side. Uses 'ls -la /proc/PID/fd/ | grep FIFO_NAME' because busybox on this device has no readlink applet. Replaces the earlier nc-based RTSP OPTIONS probe which always timed out on this busybox.
mqttv4 was launched unconditionally at startup regardless of the MQTT config setting, wasting 3.3MB of RAM on devices that don't use MQTT. Move the mqttv4 launch into the existing MQTT=yes conditional block.
Set default config to minimal RTSP-only mode: cloud disabled, HTTPD off, MQTT off, swap enabled, SSH password set, snapshots off. Update README with slim fork description, process table, and quick start guide.
Include nmap scan, router DHCP, and Yi Home app methods to find the camera IP. Add stream URL table for high/low resolution endpoints.
Fix RTSP stream freeze and slim down for dedicated RTSP use
Allow the camera to connect to multiple pre-configured WiFi networks with automatic failover, useful for portable monitoring across locations. New files: - etc/wpa_supplicant.conf: template config with multiple network blocks - script/wifi_connect.sh: replaces stock wpa_supplicant with multi-network config Modified files: - system.sh: integrate multi-WiFi startup when WIFI_MULTI=yes - check_conf.sh: add WIFI_MULTI=no default parameter - system.conf: add WIFI_MULTI=no default - wd_rtsp.sh: add WiFi connectivity watchdog (check_wifi) - README.md: document the multi-WiFi feature and setup instructions
# Conflicts: # src/static/static/home/yi-hack-v5/script/wd_rtsp.sh Co-authored-by: pawelma <1849200+pawelma@users.noreply.github.com>
Owner
|
@pawelma sorry I have missed this. Have you had a chance to test it? |
Author
|
I did, it's polluted with the changes from the fork of mine where I disabled default configs like webUI, I can clean it up to keep original defaults if you want to merge it. It does work with 3 different locations as a pet monitor without an issue. |
Owner
|
Please update the pull request by commiting to your branch and I'll test it at some point. Thanks for your contribution. |
1 similar comment
Owner
|
Please update the pull request by commiting to your branch and I'll test it at some point. Thanks for your contribution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow the camera to connect to multiple pre-configured WiFi networks with automatic failover, useful for portable monitoring across locations.
New files:
Modified files: