Repository navigation
Make the IP camera variant build and pair again - #151
Open
codecoder01 wants to merge 6 commits into
Open
codecoder01 wants to merge 6 commits into
codecoder01 wants to merge 6 commits into
Conversation
Commit ccd3ea7 reorganised pairing/flow.rs around the raspberry, test and android features and left `ip` out of the cfg gates, so `cargo build --features ip` fails: the TcpStreamTransport/CONFIG imports, the `msg_transport` initialisation, `receive_credentials_full` and `decrypt_msg` were all missing for that variant. Treat the IP hub like the test variant: plain TCP transport on port 12348, receive the relay credentials over the config group, no hotspot and no timestamp step.
Follow-ups to the pairing/flow.rs fix, all fallout from ccd3ea7: - Cargo.toml: the IP- and Raspberry-specific dependencies had ended up under the `[target.'cfg(target_os = "android")']` section, so rpassword, http-auth and linfa were never linked on Linux. Move the Android section to the end of the file (same layout as jk-cargo-clippy-ci). - ip/ip_camera.rs: fmp4 and mp4 moved under the mp4 module; the state directory constants moved into core.rs. Update the imports and make the constants pub(crate). - mp4/mod.rs: mp4_camera.rs only has motion-detection bodies for the raspberry and android features and nothing else uses it, so compile it only for those features.
camera_hub pinned ndarray to =0.17.2 (1574468) but linfa 0.8.1 is built against ndarray 0.16, so the ip build ended up with two ndarray versions and Dataset::new rejected the arrays. ndarray is only used by the IP motion detection, so follow linfa's line. motion_ai keeps its own 0.17.
The app's QR parser only recognised Raspberry Pi camera QR codes (which carry a hotspot password) and rejected an IP hub's QR code. Add an explicit kind field so the app can route IP camera QR codes to the IP camera flow without guessing. The field is omitted from Raspberry Pi, Android and add-app QR codes, so those are byte-for-byte unchanged.
The version marker path defaulted to /var/lib/secluso/current_version, which only exists (and is only writable) on Secluso OS where the hub runs as root. On a user-run IP hub this made run() fail with EACCES before pairing. The ip variant has no updater, so store the marker locally like the test variant does.
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.
The ip feature of camera_hub stopped compiling with the Android camera change (ccd3ea7), and an IP hub's QR code could not be recognised by the mobile app. This PR brings the IP variant back to a working state. Companion app change: secluso/mobile_client#110
What changed
pairing/flow.rs: add the ip feature to the cfg gates for the TCP transport, receive_credentials_full and decrypt_msg. The IP hub pairs like the test variant: TCP on port 12348, relay credentials over the config group, no hotspot, no timestamp step.Cargo.toml: the IP- and Raspberry-specific dependencies had ended up under the [target.'cfg(target_os = "android")'] section, so rpassword, http-auth and linfa were never linked on Linux. The Android section now sits at the end of the file (same layout as the clippy branch).ip/ip_camera.rs: update imports for the mp4 module move and for the state-directory constants, which are now pub(crate) in core.rs.mp4/mod.rs: compile mp4_camera.rs only for raspberry/android; its is_there_motion has no body for other variants and nothing else uses it.client_lib/pairing.rs: IP camera QR codes carry "t": "ip" so the app can route them. Raspberry Pi, Android and add-app QR codes are byte-for-byte unchanged (the field is omitted when absent).core.rs: the ip variant keeps its version marker in its working directory instead of /var/lib/secluso, which only exists on Secluso OS.Tested
Cargo.tomland mp4 changes.