From 606c978a86a844a3f7abc939dae85365395befb2 Mon Sep 17 00:00:00 2001 From: vfdev Date: Mon, 6 Nov 2023 00:06:13 +0100 Subject: [PATCH 01/12] Fixed typos --- src/rtsp/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rtsp/mod.rs b/src/rtsp/mod.rs index 4fc231e..1d5bf43 100644 --- a/src/rtsp/mod.rs +++ b/src/rtsp/mod.rs @@ -104,7 +104,7 @@ pub(crate) async fn main(_opt: Opt, reactor: NeoReactor) -> Result<()> { loop { thread_config.changed().await?; if let Err(e) = thread_rtsp.set_up_tls(&thread_config.borrow().clone()) { - log::error!("Could not seup TLS: {e}"); + log::error!("Could not setup TLS: {e}"); } } } => v @@ -128,7 +128,7 @@ pub(crate) async fn main(_opt: Opt, reactor: NeoReactor) -> Result<()> { let config = thread_config.borrow().clone(); if let Err(e) = apply_users(&thread_rtsp, &curr_users).await { - log::error!("Could not seup TLS: {e}"); + log::error!("Could not setup TLS: {e}"); } if config.certificate.is_none() && !curr_users.is_empty() { @@ -162,7 +162,7 @@ pub(crate) async fn main(_opt: Opt, reactor: NeoReactor) -> Result<()> { for name in config_names.iter() { if ! cameras.contains_key(name) { - log::info!("{name}: Rtsp Staring"); + log::info!("{name}: Rtsp Starting"); let local_cancel = CancellationToken::new(); cameras.insert(name.clone(),local_cancel.clone() ); let thread_global_cancel = thread_cancel2.clone(); @@ -186,7 +186,7 @@ pub(crate) async fn main(_opt: Opt, reactor: NeoReactor) -> Result<()> { for (running_name, token) in cameras.iter() { if ! config_names.contains(running_name) { - log::debug!("Rtsp::main Cancel1"); + log::debug!("Rtsp::main Cancel!"); token.cancel(); } } From 311b8b03d8071d6965031cd0674119dc8e123093 Mon Sep 17 00:00:00 2001 From: Tj Date: Sun, 19 Nov 2023 11:04:20 +0000 Subject: [PATCH 02/12] dissector: add instructions on building and using --- dissector/README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 dissector/README.md diff --git a/dissector/README.md b/dissector/README.md new file mode 100644 index 0000000..66055fb --- /dev/null +++ b/dissector/README.md @@ -0,0 +1,25 @@ +# Using the dissector + +The dissector can be used with `wireshark` and `tshark`. It requires another wireshark module [`luagcrypt`](https://github.com/Lekensteyn/luagcrypt) which is not packaged in most Linux distributions and needs building from source. Instructions here are suitable for Debian and its derivatives (tested on Debian 12 Bookworm amd64). + +## Build `luagcrypt.so` +``` +sudo apt install lua5.2 liblua5.2-dev libgcrypt20-dev libgpg-error-dev +git clone https://github.com/Lekensteyn/luagcrypt.git +cd luagcrypt +make LUA_DIR=/usr +``` +## Install `luagcrypt.so` +The shared object library should be copied to `/usr/local/lib/lua/5.2/` +``` +mkdir --parents /usr/local/lib/lua/5.2/ +cp luagcypt.so /usr/local/lib/lua/5.2/ +``` +Additionally, the system where the dissector is used needs these packages installing (if not already present): `libgcrypt20 libgpg-error0` +## Install `baichuan.lua` +Copy the dissector to the host where `wireshark` (or `tshark`) will be used to analyse the captured packets: +``` +mkdir --parents $HOME/.local/lib/wireshark/plugins/ +cp baichuan.lua $HOME/.local/lib/wireshark/plugins/ +``` + From 9cd5551156cd297a4cf1d26450ca82b4dac29ad8 Mon Sep 17 00:00:00 2001 From: Frans-Willem Hardijzer Date: Fri, 1 Dec 2023 13:40:45 +0100 Subject: [PATCH 03/12] Properly handle response of TALK command, such that receive buffer doesn't fill up. If receive buffer fills up, neolink will never exit as the response to TALK_STOP will not get handled correctly. --- crates/core/src/bc_protocol/talk.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/core/src/bc_protocol/talk.rs b/crates/core/src/bc_protocol/talk.rs index df787ab..785ba66 100644 --- a/crates/core/src/bc_protocol/talk.rs +++ b/crates/core/src/bc_protocol/talk.rs @@ -323,7 +323,7 @@ impl BcCamera { let full_block_size = block_size + 4; // Block size + predictor state let msg_num = self.new_message_num(); - let sub = connection.subscribe(MSG_ID_TALK, msg_num).await?; + let mut sub = connection.subscribe(MSG_ID_TALK, msg_num).await?; const BLOCK_PER_PAYLOAD: usize = 1; const BLOCK_HEADER_SIZE: usize = 4; @@ -398,6 +398,7 @@ impl BcCamera { }; sub.send(msg).await?; + let _ = sub.recv().await?; std::thread::sleep(std::time::Duration::from_secs_f32(play_length * 0.95)); } From b6c7cff6a7cb80ab45a23beaed550d44051f9205 Mon Sep 17 00:00:00 2001 From: Frans-Willem Hardijzer Date: Fri, 1 Dec 2023 13:44:22 +0100 Subject: [PATCH 04/12] Better timing of sending chunks, works well for files, might not for streams (e.g. microphone) --- crates/core/src/bc_protocol/talk.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/core/src/bc_protocol/talk.rs b/crates/core/src/bc_protocol/talk.rs index 785ba66..2dad9ec 100644 --- a/crates/core/src/bc_protocol/talk.rs +++ b/crates/core/src/bc_protocol/talk.rs @@ -335,6 +335,7 @@ impl BcCamera { let mut payload_bytes = vec![]; let mut end_of_stream = false; + let mut message_end = std::time::Instant::now(); while !end_of_stream { while payload_bytes.len() < target_chunks { let mut buffer = vec![255; target_chunks - payload_bytes.len()]; @@ -397,12 +398,19 @@ impl BcCamera { }), }; + // Wait until 100ms before message end + let sleep_until = message_end - std::time::Duration::from_secs_f32(0.1); + std::thread::sleep(sleep_until - std::time::Instant::now()); sub.send(msg).await?; + // TODO: What to do against drift ? + message_end += std::time::Duration::from_secs_f32(play_length); let _ = sub.recv().await?; - std::thread::sleep(std::time::Duration::from_secs_f32(play_length * 0.95)); } + // Wait for the full message to play + 100ms to be sure, before issuing talk stop. + std::thread::sleep((message_end - std::time::Instant::now()) + std::time::Duration::from_secs_f32(0.1)); + self.talk_stop().await?; Ok(()) From ce4e4f2f5d44ddc4777702ca920e488623e3b695 Mon Sep 17 00:00:00 2001 From: Frans-Willem Hardijzer Date: Fri, 1 Dec 2023 14:47:57 +0100 Subject: [PATCH 05/12] Move payload_bytes into loop, instead of constantly re-setting it. --- crates/core/src/bc_protocol/talk.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/core/src/bc_protocol/talk.rs b/crates/core/src/bc_protocol/talk.rs index 2dad9ec..fcb97ab 100644 --- a/crates/core/src/bc_protocol/talk.rs +++ b/crates/core/src/bc_protocol/talk.rs @@ -333,10 +333,10 @@ impl BcCamera { let target_chunks = full_block_size as usize * BLOCK_PER_PAYLOAD; - let mut payload_bytes = vec![]; let mut end_of_stream = false; let mut message_end = std::time::Instant::now(); while !end_of_stream { + let mut payload_bytes = vec![]; while payload_bytes.len() < target_chunks { let mut buffer = vec![255; target_chunks - payload_bytes.len()]; if let Ok(read) = buffered_recv.read(&mut buffer) { @@ -374,8 +374,6 @@ impl BcCamera { break; }; - payload_bytes = vec![]; - // Time to play the sample in seconds let play_length = samples_sent as f32 / sample_rate as f32; From afabd05cef9096bebfaa4ec75d973df4054b4d84 Mon Sep 17 00:00:00 2001 From: Frans-Willem Hardijzer Date: Fri, 1 Dec 2023 14:48:33 +0100 Subject: [PATCH 06/12] No need to time sending the blocks, the response message will be delayed if the buffer on the device is full. --- crates/core/src/bc_protocol/talk.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/crates/core/src/bc_protocol/talk.rs b/crates/core/src/bc_protocol/talk.rs index fcb97ab..54e7bea 100644 --- a/crates/core/src/bc_protocol/talk.rs +++ b/crates/core/src/bc_protocol/talk.rs @@ -269,6 +269,7 @@ impl BcCamera { let block_size = talk_config.audio_config.length_per_encoder / 2; let sample_rate = talk_config.audio_config.sample_rate; + let block_duration = talk_config.audio_config.length_per_encoder as f32 / talk_config.audio_config.sample_rate as f32; let msg = Bc { meta: BcMeta { @@ -334,7 +335,6 @@ impl BcCamera { let target_chunks = full_block_size as usize * BLOCK_PER_PAYLOAD; let mut end_of_stream = false; - let mut message_end = std::time::Instant::now(); while !end_of_stream { let mut payload_bytes = vec![]; while payload_bytes.len() < target_chunks { @@ -396,18 +396,17 @@ impl BcCamera { }), }; - // Wait until 100ms before message end - let sleep_until = message_end - std::time::Duration::from_secs_f32(0.1); - std::thread::sleep(sleep_until - std::time::Instant::now()); sub.send(msg).await?; - // TODO: What to do against drift ? - message_end += std::time::Duration::from_secs_f32(play_length); let _ = sub.recv().await?; } - // Wait for the full message to play + 100ms to be sure, before issuing talk stop. - std::thread::sleep((message_end - std::time::Instant::now()) + std::time::Duration::from_secs_f32(0.1)); + // By observation in the Reolink Doorbell POE the buffer seems to be roughly 10 chunks, + // Wait until those buffers are fully flushed out to the audio device before issuing a + // talk_stop + let buffer_duration = block_duration * (BLOCK_PER_PAYLOAD as f32) * 10.0f32; + std::thread::sleep(std::time::Duration::from_secs_f32(buffer_duration)); + log::info!("Block: {}s, Buffer: {}s", block_duration, buffer_duration); self.talk_stop().await?; From 261e45894778b6c86bdc425f21ea5f1d09b1ab45 Mon Sep 17 00:00:00 2001 From: Frans-Willem Hardijzer Date: Fri, 1 Dec 2023 15:02:47 +0100 Subject: [PATCH 07/12] Stop making assumptions around buffer size, just use expected message duration instead. --- crates/core/src/bc_protocol/talk.rs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/crates/core/src/bc_protocol/talk.rs b/crates/core/src/bc_protocol/talk.rs index 54e7bea..6cee5ff 100644 --- a/crates/core/src/bc_protocol/talk.rs +++ b/crates/core/src/bc_protocol/talk.rs @@ -269,7 +269,6 @@ impl BcCamera { let block_size = talk_config.audio_config.length_per_encoder / 2; let sample_rate = talk_config.audio_config.sample_rate; - let block_duration = talk_config.audio_config.length_per_encoder as f32 / talk_config.audio_config.sample_rate as f32; let msg = Bc { meta: BcMeta { @@ -335,6 +334,7 @@ impl BcCamera { let target_chunks = full_block_size as usize * BLOCK_PER_PAYLOAD; let mut end_of_stream = false; + let mut expected_stream_end = std::time::Instant::now(); while !end_of_stream { let mut payload_bytes = vec![]; while payload_bytes.len() < target_chunks { @@ -396,17 +396,22 @@ impl BcCamera { }), }; + let time_sent = std::time::Instant::now(); sub.send(msg).await?; + let play_length = std::time::Duration::from_secs_f32(play_length); + if time_sent > expected_stream_end { + expected_stream_end = time_sent + play_length; + } else { + expected_stream_end += play_length; + } let _ = sub.recv().await?; } - // By observation in the Reolink Doorbell POE the buffer seems to be roughly 10 chunks, - // Wait until those buffers are fully flushed out to the audio device before issuing a - // talk_stop - let buffer_duration = block_duration * (BLOCK_PER_PAYLOAD as f32) * 10.0f32; - std::thread::sleep(std::time::Duration::from_secs_f32(buffer_duration)); - log::info!("Block: {}s, Buffer: {}s", block_duration, buffer_duration); + // Chunks are still being played, while talk_stop will interrupt them. Wait until we expect + // the stream to end (+ and extra 100ms) before issuing talk_stop. + let remaining_stream_duration = expected_stream_end - std::time::Instant::now(); + std::thread::sleep(remaining_stream_duration + std::time::Duration::from_secs_f32(0.1)); self.talk_stop().await?; From b13db1227d9754a81bb9fca196e5f638b8ee81cf Mon Sep 17 00:00:00 2001 From: Cian Gallagher Date: Sun, 3 Dec 2023 12:37:22 +0000 Subject: [PATCH 08/12] feat: add support for running neolink in k8s. add related documentation. --- kubernetes/README.md | 50 ++++++++++++ kubernetes/manifest.yaml | 172 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 222 insertions(+) create mode 100644 kubernetes/README.md create mode 100644 kubernetes/manifest.yaml diff --git a/kubernetes/README.md b/kubernetes/README.md new file mode 100644 index 0000000..e603e55 --- /dev/null +++ b/kubernetes/README.md @@ -0,0 +1,50 @@ +### Neolink in Kubernetes + +#### Introduction + +This README provides guidance on deploying the NeoLink application on Kubernetes using the provided manifest files. The deployment is designed to set up a NeoLink application within its own namespace, with a specific configuration for node affinity, resource limits, and service exposure. + +#### Prerequisites + +- Kubernetes Cluster +- Command-line tool (kubectl) +- Basic understanding of Kubernetes concepts (Pods, Services, Deployments, ConfigMaps) + +#### Deployment Overview + +The deployment consists of four main parts: + +1. Namespace Creation: A new namespace neolink is created to isolate the resources. + +2. Deployment Configuration: The neolink-app-deployment is set up with: + - A single replica. + - Affinity to arm64 nodes (Though this is optional). + - Resource limits and requests for CPU and memory. + - A custom command and args to use a specific configuration file. + +3. Service Exposure: A LoadBalancer type service named neolink exposes the application on port 8554. + +4. ConfigMap: Contains the application configuration neolink.toml. + +#### Steps to Deploy + +```bash +kubectl apply -f manifest.yaml +``` + +### Configuration Details + +- The neolink.toml file in the ConfigMap provides the application configuration. Customize it as per your requirements. +- The deployment is set to favor arm64 architecture nodes via a `nodeAffinity`. This is a personal preference as in my cluster all my raspberrpis (except one) run 32bit raspian OS. And to try and get more bang for my buck I was to run neolink on my arm64 8Gb node. Again, this is totaly optional for you. +- Resource limits are set to ensure efficient use of cluster resources. +- The LoadBalancer service will make the application accessible externally. + +#### Troubleshooting + +- If the pod fails to start, check the pod logs and describe the pod for more details. +- Ensure that the arm64 node is available and schedulable in your cluster (if you're using nodeAffinity). +- Verify that the ConfigMap is correctly applied and mounted. + +#### Conclusion + +This guide provides a step-by-step approach to deploying the NeoLink application on a Kubernetes cluster. Modify the manifests as necessary to fit your specific requirements and environment. diff --git a/kubernetes/manifest.yaml b/kubernetes/manifest.yaml new file mode 100644 index 0000000..f6ced5d --- /dev/null +++ b/kubernetes/manifest.yaml @@ -0,0 +1,172 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: neolink +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: neolink-app-deployment + namespace: neolink + labels: + app: neolink +spec: + replicas: 1 + selector: + matchLabels: + app: neolink + template: + metadata: + labels: + app: neolink + spec: + containers: + - name: neolink + image: quantumentangledandy/neolink + ports: + - containerPort: 8554 + command: ["/bin/sh", "-c"] + args: ["cp /config/neolink.toml /etc/neolink.toml && /usr/local/bin/neolink rtsp --config /etc/neolink.toml"] + volumeMounts: + - name: config-volume + mountPath: /config + resources: + limits: + memory: "600Mi" + cpu: "300m" + requests: + memory: "200Mi" + cpu: "150m" + volumes: + - name: config-volume + configMap: + name: default-config +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: neolink + name: neolink + namespace: neolink +spec: + ports: + - name: tcp-interface-neolink + port: 8554 + protocol: TCP + targetPort: 8554 + selector: + app: neolink + type: LoadBalancer +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: default-config + namespace: neolink +data: + neolink.toml: | + # A bind value of 0.0.0.0 means any network this computer can access + # You can chage this to a specfic network e.g. "192.168.1.101" here + # Or to no networks e.g. this computer only "127.0.0.1" + bind = "0.0.0.0" + + # Default port is 8554 but you can change it by uncommenting the following + # bind_port = 8554 + + # Uncomment the following and supply a path to a valid PEM + # to activate TLS encryption. + # The PEM should contain the certificate and the private key + # If TLS is activated you must connect with "rtsps://" and not "rtsp://" + # certificate = "/path/to/pem/with/cert/and/key" + + # Choose if the client is required to provide a certificate signed by the server's CA. + # none|requested|required - default none + # tls_client_auth = "required" + + # You can password protect the rtsp server mount points by adding users + # like the following me and someone. If you do not add [[users]] + # then anyone can connect without a password or username + # To access such a stream try using a url such as "rtsp://me:mepass@192.168.1.101/driveway" + + # [[users]] + # name = "me" + # pass = "mepass" + # + # [[users]] + # name = "someone" + # pass = "someonepass" + + # Uncomment to enable MQTT + #[mqtt] + # mqtt.broker_addr = "192.168.1.122" + # mqtt.port = 1883 + # mqtt.credentials = ["mqtt_user", "mqtt_password"] + + + [[cameras]] + name = "driveway" + username = "admin" + password = "12345678" + address = "192.168.1.187:9000" + # MQTT Discovery: https://www.home-assistant.io/integrations/mqtt/#mqtt-discovery + # mqtt.discovery.topic = "homeassistant" # Uncomment to enable + # If using discovery, _ characters are replaced with spaces in the name and title case is applied + # mqtt.discovery.features = ["floodlight"] # Uncomment if this camera has a spotlight/floodlight + + # If you use a battery camera: **Instead** of an `address` supply the uid + # as follows + # uid = "ABCD01234567890EFG" + + # By default any of the users can connect (or anyone at all if no users are specfied) + # You can uncomment the following to permit only specfic users + # permitted_users = [ "me" ] + + # By default "both" "mainStream" and "subStream" are connected + # If your device has user connection limits try a single stream instead. + # stream = "mainStream" + + # By default neolink will use any means to connect to the camera + # from a UID + # This include relaying via reolink servers + # This variable `discovery` controls the method of UID discovery + # - Possible values + # "relay" # Any means including connecting and transmitting through reolink + # "map" # Register our local ip address with reolink and ask the camera to connect to us but don't relay data through reolink + # "remote" # Register our local ip address with reolink but only permit same network connections (useful if broadcast is not possible) + # "local" # Do not contact reolink servers at all. Rely soley on local UDP broadcast based discovery + # + # "cellular" # Cellular camera only support Relay and Map to speed up connecting to them this option will skip the local/remote + # + # discovery = "relay" + + # Certain types of camera emit status messages (such as battery levels) + # + # By default we hide these status messages from the user but you can instead requst that + # they be printed to stdout using print_format + # + # Valid values are: + # - None + # - Human + # - Xml + # + # print_format = "None" + + + [[cameras]] + name = "storage shed" + username = "admin" + password = "987654321" + address = "192.168.1.245:9000" + # If you use a battery camera: **Instead** of an `address` supply the uid + # as follows + # uid = "ABCD01234567890EFG" + + # If you use an NVR that relays several camera connections you can choose which + # camera to connect to with by setting the `channel_id` + # + # By default channel_id = 0. Eg the first connected camera on the device + # **Note**: that unlike in the offical client the numbering starts from 0 not 1. + # An 8 channel NVR would have channels 0 through 7 + # channel_id = 0 From 1a020e5788eb60a52aa85f4ad8c01ad923083e99 Mon Sep 17 00:00:00 2001 From: developersteve Date: Wed, 17 Jan 2024 14:01:06 +1100 Subject: [PATCH 09/12] Update Dockerfile to include a NEO_LINK_MODE This enables the ability to change the neolink mode type using an env var so that it's not locked to RTSP but will default to RTSP if the env var is not set. --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 34c52ed..c262b75 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,7 @@ FROM docker.io/rust:slim-bookworm AS build ARG TARGETPLATFORM ENV DEBIAN_FRONTEND=noninteractive +ENV NEO_LINK_MODE rtsp WORKDIR /usr/local/src/neolink @@ -85,6 +86,6 @@ RUN gst-inspect-1.0; \ "/usr/local/bin/neolink" --version && \ mkdir -m 0700 /root/.config/ # Location that the push notifications are cached to -CMD ["/usr/local/bin/neolink", "rtsp", "--config", "/etc/neolink.toml"] +CMD ["/usr/local/bin/neolink", "${NEO_LINK_MODE}", "--config", "/etc/neolink.toml"] ENTRYPOINT ["/entrypoint.sh"] EXPOSE 8554 From 8205b652d3681318166b1f0d7002ae4f5b6c1550 Mon Sep 17 00:00:00 2001 From: developersteve Date: Thu, 18 Jan 2024 17:36:31 +1100 Subject: [PATCH 10/12] Update Dockerfile with env vars --- Dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index c262b75..376aa1e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,9 +8,6 @@ FROM docker.io/rust:slim-bookworm AS build ARG TARGETPLATFORM ENV DEBIAN_FRONTEND=noninteractive -ENV NEO_LINK_MODE rtsp - - WORKDIR /usr/local/src/neolink COPY . /usr/local/src/neolink @@ -86,6 +83,8 @@ RUN gst-inspect-1.0; \ "/usr/local/bin/neolink" --version && \ mkdir -m 0700 /root/.config/ # Location that the push notifications are cached to -CMD ["/usr/local/bin/neolink", "${NEO_LINK_MODE}", "--config", "/etc/neolink.toml"] +ENV NEO_LINK_MODE="rtsp" NEO_LINK_PORT=8554 + +CMD /usr/local/bin/neolink ${NEO_LINK_MODE} --config /etc/neolink.toml ENTRYPOINT ["/entrypoint.sh"] -EXPOSE 8554 +EXPOSE ${NEO_LINK_PORT} From fcc559885a15ae59a485279fc081e5a25263b6f6 Mon Sep 17 00:00:00 2001 From: developersteve Date: Thu, 18 Jan 2024 17:40:57 +1100 Subject: [PATCH 11/12] Update README.md with env var changes added README information about the added `NEO_LINK_MODE` and `NEO_LINK_PORT` variables --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 7d69c01..dedf71e 100644 --- a/README.md +++ b/README.md @@ -456,6 +456,10 @@ docker pull quantumentangledandy/neolink # network=host, notably macos lacks this option. docker run --network host --volume=$PWD/config.toml:/etc/neolink.toml quantumentangledandy/neolink ``` +#### Environmental Variables +There are currently 2 environmental variables available as part of the container: +- `NEO_LINK_MODE`: defaults to `"rtsp"` if not set, other options are "mqtt" or "mqtt-rtsp". +- `NEO_LINK_PORT`: defaults to `8554`, set this to your required port value. ### Image From 37f560cf6602021d296976e5cbaedc30544350e3 Mon Sep 17 00:00:00 2001 From: Espen Hovlandsdal Date: Thu, 14 Mar 2024 10:24:16 -0700 Subject: [PATCH 12/12] Fix typos in comments and code --- README.md | 12 ++++++------ crates/core/src/bc/de.rs | 6 +++--- crates/core/src/bc/xml.rs | 16 ++++++++-------- crates/core/src/bc_protocol/abilityinfo.rs | 2 +- .../core/src/bc_protocol/connection/discovery.rs | 2 +- crates/core/src/bc_protocol/credentials.rs | 2 +- crates/core/src/bc_protocol/errors.rs | 6 +++--- crates/core/src/bc_protocol/floodlight.rs | 4 ++-- crates/core/src/bc_protocol/keepalive.rs | 2 +- crates/core/src/bc_protocol/ledstate.rs | 2 +- crates/core/src/bc_protocol/link.rs | 2 +- crates/core/src/bc_protocol/pirstate.rs | 6 +++--- crates/core/src/bc_protocol/ptz.rs | 2 +- crates/core/src/bc_protocol/pushinfo.rs | 2 +- crates/core/src/bc_protocol/siren.rs | 2 +- crates/core/src/bc_protocol/snap.rs | 4 ++-- crates/core/src/bc_protocol/stream.rs | 10 +++++----- crates/core/src/bc_protocol/stream_info.rs | 2 +- crates/core/src/bc_protocol/support.rs | 2 +- crates/core/src/bc_protocol/time.rs | 2 +- crates/core/src/bc_protocol/uid.rs | 2 +- crates/core/src/bc_protocol/version.rs | 2 +- crates/core/src/bcmedia/codex.rs | 2 +- crates/core/src/bcudp/codex.rs | 2 +- sample_config.toml | 2 +- src/common/instance.rs | 2 +- src/mqtt/mod.rs | 4 ++-- src/rtsp/stream.rs | 2 +- 28 files changed, 53 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index 7d69c01..f25d0b4 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ features not yet in upstream master. **Minor Features**: - Improved error messages when missing gstreamer plugins -- Protocol more closely follows offical reolink format +- Protocol more closely follows official reolink format - Possibly can handle more simulatenous connections - More ways to connect to the camera. Including Relaying through reolink servers @@ -50,7 +50,7 @@ Install the latest [gstreamer](https://gstreamer.freedesktop.org/download/) (1.20.5 as of writing this). - **Windows**: ensure you install `full` when prompted in the MSI options. -- **Mac**: Install the dpkg version on the offical gstreamer website over +- **Mac**: Install the dpkg version on the official gstreamer website over the brew version - **Ubuntu/Debian**: These packages should work @@ -269,7 +269,7 @@ reflected in the rtsp These include changing the: -- Avaliable users +- Available users ```toml [[users]] @@ -284,7 +284,7 @@ These include changing the: permitted_users = [ "me" ] ``` -- Avaliable streams +- Available streams ```toml [[cameras]] @@ -324,7 +324,7 @@ enable_motion = false # motion detection # (limited battery drain since it # is a passive listening connection) # -enable_light = false # flood lights only avaliable on some camera +enable_light = false # flood lights only available on some camera # (limited battery drain since it # is a passive listening connection) # @@ -355,7 +355,7 @@ must be manually specified. features = ["floodlight"] ``` -Avaliable features are: +Available features are: - `floodlight`: This adds a light control to home assistant - `camera`: This adds a camera preview to home assistant. It is only updated diff --git a/crates/core/src/bc/de.rs b/crates/core/src/bc/de.rs index 473c7df..20b0c15 100644 --- a/crates/core/src/bc/de.rs +++ b/crates/core/src/bc/de.rs @@ -439,7 +439,7 @@ mod tests { #[test] // B800 seems to have a different header to the E1 and swann cameras - // the stream_type and message_num do not seem to set in the offical clients + // the stream_type and message_num do not seem to set in the official clients // // They also have extra streams fn test_bc_b800_externstream() { @@ -481,7 +481,7 @@ mod tests { #[test] // B800 seems to have a different header to the E1 and swann cameras - // the stream_type and message_num do not seem to set in the offical clients + // the stream_type and message_num do not seem to set in the official clients // // They also have extra streams fn test_bc_b800_substream() { @@ -523,7 +523,7 @@ mod tests { #[test] // B800 seems to have a different header to the E1 and swann cameras - // the stream_type and message_num do not seem to set in the offical clients + // the stream_type and message_num do not seem to set in the official clients // // They also have extra streams fn test_bc_b800_mainstream() { diff --git a/crates/core/src/bc/xml.rs b/crates/core/src/bc/xml.rs index dccacba..acce7ad 100644 --- a/crates/core/src/bc/xml.rs +++ b/crates/core/src/bc/xml.rs @@ -91,10 +91,10 @@ pub struct BcXml { /// Recieved on request for battery info #[yaserde(rename = "BatteryInfo")] pub battery_info: Option, - /// Recieved on request for a users persmissions/capabilitoes + /// Recieved on request for a users permissions/capabilities #[yaserde(rename = "AbilityInfo")] pub ability_info: Option, - /// Recieved on request for a users persmissions/capabilitoes + /// Recieved on request for a users permissions/capabilities #[yaserde(rename = "PushInfo")] pub push_info: Option, /// Recieved on request for a link type @@ -112,7 +112,7 @@ pub struct BcXml { /// The floodlight settings for automatically turning on/off on schedule/motion #[yaserde(rename = "FloodlightTask")] pub floodlight_task: Option, - /// For geting the zoom anf focus of the camera + /// For getting the zoom and focus of the camera #[yaserde(rename = "PtzZoomFocus")] pub ptz_zoom_focus: Option, /// For zooming the camera @@ -268,11 +268,11 @@ pub struct Extension { /// XML Version #[yaserde(attribute)] pub version: String, - /// If the subsequent payload is binary this will be set to 1. Otherwise it is ommited + /// If the subsequent payload is binary this will be set to 1. Otherwise it is omitted #[yaserde(rename = "binaryData")] pub binary_data: Option, /// Certain requests such `AbilitySupport` require to know which user this - /// ability support request is for (why camera dosen't know this based on who + /// ability support request is for (why camera doesn't know this based on who /// is logged in is unknown... Possible security hole) #[yaserde(rename = "userName")] pub user_name: Option, @@ -497,7 +497,7 @@ pub struct TalkConfig { /// audioStreamMode known values `"followVideoStream"` #[yaserde(rename = "audioStreamMode")] pub audio_stream_mode: String, - /// AudioConfig contans the details of the audio to follow + /// AudioConfig contains the details of the audio to follow #[yaserde(rename = "audioConfig")] pub audio_config: AudioConfig, } @@ -541,7 +541,7 @@ pub struct TalkAbility { /// audioStreamModes known values `"followVideoStream"` #[yaserde(rename = "audioStreamModeList")] pub audio_stream_mode_list: Vec, - /// AudioConfigs contans the details of the audio to follow + /// AudioConfigs contains the details of the audio to follow #[yaserde(rename = "audioConfigList")] pub audio_config_list: Vec, } @@ -706,7 +706,7 @@ pub struct AbilityInfo { pub image: Option, /// Video permissions pub video: Option, - /// Secutiry permissions + /// Security permissions pub security: Option, /// Replay permissions pub replay: Option, diff --git a/crates/core/src/bc_protocol/abilityinfo.rs b/crates/core/src/bc_protocol/abilityinfo.rs index ff82529..5103dee 100644 --- a/crates/core/src/bc_protocol/abilityinfo.rs +++ b/crates/core/src/bc_protocol/abilityinfo.rs @@ -30,7 +30,7 @@ impl BcCamera { sub_get.send(get).await?; let msg = sub_get.recv().await?; if msg.meta.response_code != 200 { - return Err(Error::CameraServiceUnavaliable(msg.meta.response_code)); + return Err(Error::CameraServiceUnavailable(msg.meta.response_code)); } if let BcBody::ModernMsg(ModernMsg { diff --git a/crates/core/src/bc_protocol/connection/discovery.rs b/crates/core/src/bc_protocol/connection/discovery.rs index 0b91b0f..1a5d93c 100644 --- a/crates/core/src/bc_protocol/connection/discovery.rs +++ b/crates/core/src/bc_protocol/connection/discovery.rs @@ -248,7 +248,7 @@ impl Discoverer { tokio::select! { v = async { loop { - let (reply, addr) = reply.next().await.ok_or(Error::ConnectionUnavaliable)??; + let (reply, addr) = reply.next().await.ok_or(Error::ConnectionUnavailable)??; if let Some(result) = map(reply, addr) { return Ok(result); } diff --git a/crates/core/src/bc_protocol/credentials.rs b/crates/core/src/bc_protocol/credentials.rs index ccff7e2..19eb411 100644 --- a/crates/core/src/bc_protocol/credentials.rs +++ b/crates/core/src/bc_protocol/credentials.rs @@ -7,7 +7,7 @@ use std::convert::TryInto; pub struct Credentials { /// The username to login to the camera with pub username: String, - /// The password to use for login. Some camera allow this to be ommited + /// The password to use for login. Some camera allow this to be omitted pub password: Option, } diff --git a/crates/core/src/bc_protocol/errors.rs b/crates/core/src/bc_protocol/errors.rs index 47471d6..2378cd7 100644 --- a/crates/core/src/bc_protocol/errors.rs +++ b/crates/core/src/bc_protocol/errors.rs @@ -36,8 +36,8 @@ pub enum Error { }, /// Raised when the camera responds with a status code over than OK - #[error(display = "Camera responded with Service Unavaliable: {}", _0)] - CameraServiceUnavaliable(u16), + #[error(display = "Camera responded with Service Unavailable: {}", _0)] + CameraServiceUnavailable(u16), /// Raised when the camera responds with a status code over than OK during login #[error(display = "Camera responded with Err during login")] @@ -115,7 +115,7 @@ pub enum Error { /// Raised when the camera cannot be found #[error(display = "Camera Not Findable")] - ConnectionUnavaliable, + ConnectionUnavailable, /// Raised when the subscription id dropped too soon #[error(display = "Dropped Subscriber")] diff --git a/crates/core/src/bc_protocol/floodlight.rs b/crates/core/src/bc_protocol/floodlight.rs index 76b320f..0e59715 100644 --- a/crates/core/src/bc_protocol/floodlight.rs +++ b/crates/core/src/bc_protocol/floodlight.rs @@ -129,7 +129,7 @@ impl BcCamera { sub_get.send(get).await?; let msg = sub_get.recv().await?; if msg.meta.response_code != 200 { - return Err(Error::CameraServiceUnavaliable(msg.meta.response_code)); + return Err(Error::CameraServiceUnavailable(msg.meta.response_code)); } if let BcBody::ModernMsg(ModernMsg { @@ -181,7 +181,7 @@ impl BcCamera { sub_get.send(get).await?; let msg = sub_get.recv().await?; if msg.meta.response_code != 200 { - return Err(Error::CameraServiceUnavaliable(msg.meta.response_code)); + return Err(Error::CameraServiceUnavailable(msg.meta.response_code)); } Ok(()) diff --git a/crates/core/src/bc_protocol/keepalive.rs b/crates/core/src/bc_protocol/keepalive.rs index 3de5cbc..b1c7f31 100644 --- a/crates/core/src/bc_protocol/keepalive.rs +++ b/crates/core/src/bc_protocol/keepalive.rs @@ -2,7 +2,7 @@ use super::{BcCamera, Result}; use crate::bc::model::*; impl BcCamera { - /// Create a handller to respond to keep alive messages + /// Create a handler to respond to keep alive messages /// These messages are sent by the camera so we listen to /// a message ID rather than setting a message number and /// responding to it diff --git a/crates/core/src/bc_protocol/ledstate.rs b/crates/core/src/bc_protocol/ledstate.rs index a2a8d26..c6a01da 100644 --- a/crates/core/src/bc_protocol/ledstate.rs +++ b/crates/core/src/bc_protocol/ledstate.rs @@ -29,7 +29,7 @@ impl BcCamera { sub_get.send(get).await?; let msg = sub_get.recv().await?; if msg.meta.response_code != 200 { - return Err(Error::CameraServiceUnavaliable(msg.meta.response_code)); + return Err(Error::CameraServiceUnavailable(msg.meta.response_code)); } if let BcBody::ModernMsg(ModernMsg { diff --git a/crates/core/src/bc_protocol/link.rs b/crates/core/src/bc_protocol/link.rs index f81c0ec..10db6ff 100644 --- a/crates/core/src/bc_protocol/link.rs +++ b/crates/core/src/bc_protocol/link.rs @@ -27,7 +27,7 @@ impl BcCamera { sub_get.send(get).await?; let msg = sub_get.recv().await?; if msg.meta.response_code != 200 { - return Err(Error::CameraServiceUnavaliable(msg.meta.response_code)); + return Err(Error::CameraServiceUnavailable(msg.meta.response_code)); } if let BcBody::ModernMsg(ModernMsg { diff --git a/crates/core/src/bc_protocol/pirstate.rs b/crates/core/src/bc_protocol/pirstate.rs index a5242e0..94b5ffb 100644 --- a/crates/core/src/bc_protocol/pirstate.rs +++ b/crates/core/src/bc_protocol/pirstate.rs @@ -39,10 +39,10 @@ impl BcCamera { reties += 1; continue; } else { - return Err(Error::CameraServiceUnavaliable(msg.meta.response_code)); + return Err(Error::CameraServiceUnavailable(msg.meta.response_code)); } } else if msg.meta.response_code != 200 { - return Err(Error::CameraServiceUnavaliable(msg.meta.response_code)); + return Err(Error::CameraServiceUnavailable(msg.meta.response_code)); } else { // Valid message with response_code == 200 if let BcBody::ModernMsg(ModernMsg { @@ -101,7 +101,7 @@ impl BcCamera { { let msg = reply?; if msg.meta.response_code != 200 { - return Err(Error::CameraServiceUnavaliable(msg.meta.response_code)); + return Err(Error::CameraServiceUnavailable(msg.meta.response_code)); } if let BcMeta { diff --git a/crates/core/src/bc_protocol/ptz.rs b/crates/core/src/bc_protocol/ptz.rs index 985df32..d5e979e 100644 --- a/crates/core/src/bc_protocol/ptz.rs +++ b/crates/core/src/bc_protocol/ptz.rs @@ -325,7 +325,7 @@ impl BcCamera { sub_get.send(get).await?; let msg = sub_get.recv().await?; if msg.meta.response_code != 200 { - return Err(Error::CameraServiceUnavaliable(msg.meta.response_code)); + return Err(Error::CameraServiceUnavailable(msg.meta.response_code)); } if let BcBody::ModernMsg(ModernMsg { diff --git a/crates/core/src/bc_protocol/pushinfo.rs b/crates/core/src/bc_protocol/pushinfo.rs index 9da38b3..9b9d46e 100644 --- a/crates/core/src/bc_protocol/pushinfo.rs +++ b/crates/core/src/bc_protocol/pushinfo.rs @@ -64,7 +64,7 @@ impl BcCamera { sub.send(msg).await?; let msg = sub.recv().await?; if msg.meta.response_code != 200 { - return Err(Error::CameraServiceUnavaliable(msg.meta.response_code)); + return Err(Error::CameraServiceUnavailable(msg.meta.response_code)); } Ok(()) diff --git a/crates/core/src/bc_protocol/siren.rs b/crates/core/src/bc_protocol/siren.rs index 5e664a4..06c0fa3 100644 --- a/crates/core/src/bc_protocol/siren.rs +++ b/crates/core/src/bc_protocol/siren.rs @@ -39,7 +39,7 @@ impl BcCamera { sub_get.send(get).await?; let msg = sub_get.recv().await?; if msg.meta.response_code != 200 { - return Err(Error::CameraServiceUnavaliable(msg.meta.response_code)); + return Err(Error::CameraServiceUnavailable(msg.meta.response_code)); } Ok(()) diff --git a/crates/core/src/bc_protocol/snap.rs b/crates/core/src/bc_protocol/snap.rs index e199d8c..958f142 100644 --- a/crates/core/src/bc_protocol/snap.rs +++ b/crates/core/src/bc_protocol/snap.rs @@ -41,7 +41,7 @@ impl BcCamera { sub_get.send(get).await?; let msg = sub_get.recv().await?; if msg.meta.response_code != 200 { - return Err(Error::CameraServiceUnavaliable(msg.meta.response_code)); + return Err(Error::CameraServiceUnavailable(msg.meta.response_code)); } if let BcBody::ModernMsg(ModernMsg { @@ -132,7 +132,7 @@ impl BcCamera { } } else { // anything else is an error - return Err(Error::CameraServiceUnavaliable(msg.meta.response_code)); + return Err(Error::CameraServiceUnavailable(msg.meta.response_code)); } // let binary_stream = sub_get.payload_stream(); diff --git a/crates/core/src/bc_protocol/stream.rs b/crates/core/src/bc_protocol/stream.rs index 60bbfd7..9572434 100644 --- a/crates/core/src/bc_protocol/stream.rs +++ b/crates/core/src/bc_protocol/stream.rs @@ -17,7 +17,7 @@ pub enum StreamKind { Sub, /// This stream represents a balance between SD and HD /// - /// It is only avaliable on some camera. If the camera dosen't + /// It is only available on some camera. If the camera doesn't /// support it the stream will be the same as the SD stream Extern, } @@ -155,7 +155,7 @@ impl BcCamera { StreamKind::Extern => 0, }; - // Theses are the numbers used with the offical client + // Theses are the numbers used with the official client // On an E1 and swann cameras: // - mainStream always has a value of 0 // - subStream always has a value of 1 @@ -271,7 +271,7 @@ impl BcCamera { msg_id: MSG_ID_VIDEO_STOP, .. } = msg.meta { - return Err(Error::CameraServiceUnavaliable(msg.meta.response_code)); + return Err(Error::CameraServiceUnavailable(msg.meta.response_code)); } } } => v, @@ -313,7 +313,7 @@ impl BcCamera { StreamKind::Extern => 0, }; - // Theses are the numbers used with the offical client + // Theses are the numbers used with the official client // On an E1 and swann cameras: // - mainStream always has a value of 0 // - subStream always has a value of 1 @@ -352,7 +352,7 @@ impl BcCamera { let reply = sub_video.recv().await?; if reply.meta.response_code != 200 { - return Err(Error::CameraServiceUnavaliable(reply.meta.response_code)); + return Err(Error::CameraServiceUnavailable(reply.meta.response_code)); } Ok(()) diff --git a/crates/core/src/bc_protocol/stream_info.rs b/crates/core/src/bc_protocol/stream_info.rs index af34614..0abc60d 100644 --- a/crates/core/src/bc_protocol/stream_info.rs +++ b/crates/core/src/bc_protocol/stream_info.rs @@ -27,7 +27,7 @@ impl BcCamera { sub_get.send(get).await?; let msg = sub_get.recv().await?; if msg.meta.response_code != 200 { - return Err(Error::CameraServiceUnavaliable(msg.meta.response_code)); + return Err(Error::CameraServiceUnavailable(msg.meta.response_code)); } if let BcBody::ModernMsg(ModernMsg { diff --git a/crates/core/src/bc_protocol/support.rs b/crates/core/src/bc_protocol/support.rs index 20df452..5adf6cf 100644 --- a/crates/core/src/bc_protocol/support.rs +++ b/crates/core/src/bc_protocol/support.rs @@ -26,7 +26,7 @@ impl BcCamera { sub_get.send(get).await?; let msg = sub_get.recv().await?; if msg.meta.response_code != 200 { - return Err(Error::CameraServiceUnavaliable(msg.meta.response_code)); + return Err(Error::CameraServiceUnavailable(msg.meta.response_code)); } if let BcBody::ModernMsg(ModernMsg { diff --git a/crates/core/src/bc_protocol/time.rs b/crates/core/src/bc_protocol/time.rs index fd28306..ae64db7 100644 --- a/crates/core/src/bc_protocol/time.rs +++ b/crates/core/src/bc_protocol/time.rs @@ -33,7 +33,7 @@ impl BcCamera { sub_get_general.send(get).await?; let msg = sub_get_general.recv().await?; if msg.meta.response_code != 200 { - return Err(Error::CameraServiceUnavaliable(msg.meta.response_code)); + return Err(Error::CameraServiceUnavailable(msg.meta.response_code)); } if let BcBody::ModernMsg(ModernMsg { diff --git a/crates/core/src/bc_protocol/uid.rs b/crates/core/src/bc_protocol/uid.rs index 553172a..252047d 100644 --- a/crates/core/src/bc_protocol/uid.rs +++ b/crates/core/src/bc_protocol/uid.rs @@ -25,7 +25,7 @@ impl BcCamera { sub_get.send(get).await?; let msg = sub_get.recv().await?; if msg.meta.response_code != 200 { - return Err(Error::CameraServiceUnavaliable(msg.meta.response_code)); + return Err(Error::CameraServiceUnavailable(msg.meta.response_code)); } if let BcBody::ModernMsg(ModernMsg { diff --git a/crates/core/src/bc_protocol/version.rs b/crates/core/src/bc_protocol/version.rs index ef73345..5e33670 100644 --- a/crates/core/src/bc_protocol/version.rs +++ b/crates/core/src/bc_protocol/version.rs @@ -27,7 +27,7 @@ impl BcCamera { let modern_reply = sub_version.recv().await?; if modern_reply.meta.response_code != 200 { - return Err(Error::CameraServiceUnavaliable( + return Err(Error::CameraServiceUnavailable( modern_reply.meta.response_code, )); } diff --git a/crates/core/src/bcmedia/codex.rs b/crates/core/src/bcmedia/codex.rs index f0fe817..0d8b760 100644 --- a/crates/core/src/bcmedia/codex.rs +++ b/crates/core/src/bcmedia/codex.rs @@ -39,7 +39,7 @@ impl Decoder for BcMediaCodex { type Item = BcMedia; type Error = Error; - /// Since frames can cross EOF boundaries we overload this so it dosen't error if + /// Since frames can cross EOF boundaries we overload this so it doesn't error if /// there are bytes left on the stream fn decode_eof(&mut self, buf: &mut BytesMut) -> Result> { match self.decode(buf)? { diff --git a/crates/core/src/bcudp/codex.rs b/crates/core/src/bcudp/codex.rs index 5c82fef..30d1b48 100644 --- a/crates/core/src/bcudp/codex.rs +++ b/crates/core/src/bcudp/codex.rs @@ -34,7 +34,7 @@ impl Decoder for BcUdpCodex { type Item = BcUdp; type Error = Error; - /// Since frames can cross EOF boundaries we overload this so it dosen't error if + /// Since frames can cross EOF boundaries we overload this so it doesn't error if /// there are bytes left on the stream // fn decode_eof(&mut self, buf: &mut BytesMut) -> Result> { // match self.decode(buf)? { diff --git a/sample_config.toml b/sample_config.toml index 89ef291..85a7ea8 100644 --- a/sample_config.toml +++ b/sample_config.toml @@ -98,6 +98,6 @@ address = "192.168.1.245:9000" # camera to connect to with by setting the `channel_id` # # By default channel_id = 0. Eg the first connected camera on the device -# **Note**: that unlike in the offical client the numbering starts from 0 not 1. +# **Note**: that unlike in the official client the numbering starts from 0 not 1. # An 8 channel NVR would have channels 0 through 7 # channel_id = 0 diff --git a/src/common/instance.rs b/src/common/instance.rs index 9339403..ffcfae6 100644 --- a/src/common/instance.rs +++ b/src/common/instance.rs @@ -125,7 +125,7 @@ impl NeoInstance { if let Err(e) = &r { log::debug!("- Task Result: {e:?}"); } - if let Err(Some(neolink_core::Error::CameraServiceUnavaliable(400))) = r.as_ref().map_err(|e| e.downcast_ref::()) { + if let Err(Some(neolink_core::Error::CameraServiceUnavailable(400))) = r.as_ref().map_err(|e| e.downcast_ref::()) { // Retryable without a reconnect // Usually occurs when camera is starting up // or the connection is initialising diff --git a/src/mqtt/mod.rs b/src/mqtt/mod.rs index 94d2e61..4ac6070 100644 --- a/src/mqtt/mod.rs +++ b/src/mqtt/mod.rs @@ -467,7 +467,7 @@ async fn listen_on_camera(camera: NeoInstance, mqtt_instance: MqttInstance) -> R }).await; let image = match image { Err(e) => match e.downcast::() { - Ok(neolink_core::Error::CameraServiceUnavaliable(_)) => { + Ok(neolink_core::Error::CameraServiceUnavailable(_)) => { log::debug!("Image not supported"); futures::future::pending().await }, @@ -512,7 +512,7 @@ async fn listen_on_camera(camera: NeoInstance, mqtt_instance: MqttInstance) -> R }).await; let xml = match xml { Err(e) => match e.downcast::() { - Ok(neolink_core::Error::CameraServiceUnavaliable(_)) => { + Ok(neolink_core::Error::CameraServiceUnavailable(_)) => { log::debug!("Battery not supported"); futures::future::pending().await }, diff --git a/src/rtsp/stream.rs b/src/rtsp/stream.rs index 95f36a4..27e58c3 100644 --- a/src/rtsp/stream.rs +++ b/src/rtsp/stream.rs @@ -323,7 +323,7 @@ async fn stream_run( log::debug!("Path: {}", path); mounts.add_factory(path, factory.clone()); } - log::info!("{}: Avaliable at {}", name, paths.join(", ")); + log::info!("{}: Available at {}", name, paths.join(", ")); let stream_cancel = CancellationToken::new(); let drop_guard = stream_cancel.clone().drop_guard();