Giter Site home page Giter Site logo

quantumentangledandy / neolink Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thirtythreeforty/neolink

243.0 243.0 39.0 3.47 MB

An RTSP bridge to Reolink IP cameras

License: GNU Affero General Public License v3.0

Lua 3.35% Rust 96.32% Dockerfile 0.30% Shell 0.02%

neolink's People

Contributors

cian911 avatar cincodenada avatar danielkaiser avatar developersteve avatar dgriswo avatar frans-willem avatar hh1209 avatar jbremond avatar kevans91 avatar kevin-david avatar kickbits avatar m1k1o avatar morphy99 avatar mpfl avatar prplhaz4 avatar quantumentangledandy avatar rexxars avatar schredder avatar sebix avatar si458 avatar thirtythreeforty avatar twistedddx avatar vfdev-5 avatar zhulik 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

neolink's Issues

neolink image dont work in docker container

Describe the bug
When I run neolink image --config=/etc/neolink.toml --file-path=snap cam05 in the neolink container I have this error msg:

bash-5.1# neolink image --config=/etc/neolink.toml --file-path=snap cam05
[2023-06-03T09:28:32Z INFO  neolink] Neolink 384a0271bdbcf3227d4160859c052e8c1cb9d1f8 release
[2023-06-03T09:28:32Z INFO  neolink::utils] cam05: Connecting to camera at UID: XXXXXXXXXXXXNKV
[2023-06-03T09:28:32Z INFO  neolink_core::bc_protocol] cam05: Trying local discovery
[2023-06-03T09:28:33Z INFO  neolink_core::bc_protocol] cam05: Local discovery success XXXXXXXXXXXXNKV at 192.168.X.XX:42054
[2023-06-03T09:28:33Z INFO  neolink::utils] cam05: Logging in
[2023-06-03T09:28:33Z INFO  neolink::utils] cam05: Connected and logged in
[2023-06-03T09:28:36Z INFO  neolink::image::gst] appsrc name=thesource ! h264parse ! decodebin ! jpegenc snapshot=TRUE
                    ! filesink location=snap.jpeg
[2023-06-03T09:28:41Z WARN  neolink::image::gst] Error from gstreamer when setting the play state Error(Message { ptr: 0x7efda4001a00, type: "error", seqnum: 77, src: Some("decodebin0"), structure: Some(GstMessageError { gerror: (GError) ((GError*) 0x7efda402f850), debug: (gchararray) "../gst/playback/gstdecodebin2.c(4719): gst_decode_bin_expose (): /GstPipeline:pipeline0/GstDecodeBin:decodebin0:\nno suitable plugins found:\nMissing decoder: H.264 (High Profile) (video/x-h264, width=(int)1920, height=(int)1072, framerate=(fraction)0/1, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true, stream-format=(string)avc, alignment=(string)au, profile=(string)high, level=(string)4, codec_data=(buffer)01640028ffe1000a67640028ace8078021e401000468ee3cb0)\n" }) }) setting to Null instead
thread 'tokio-runtime-worker' panicked at 'A Tokio 1.x context was found, but it is being shutdown.', /github/home/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.27.0/src/runtime/time/entry.rs:553:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

To Reproduce
Docker-compose:

services:
  neolink:
    image: quantumentangledandy/neolink:v0.5.12
    container_name: neolink
    ports:
      - 9002:8554
    volumes:
      - /home/test/mnt:/etc/
    restart: unless-stopped
    network_mode: host

config.toml

bind = "0.0.0.0"
[[users]]
name = "admin"
pass = "XXXXXXXXXXX"

[[cameras]]
name = "cam05"
username = "admin"
password = "XXXXXXXXXX"
uid = "XXXXXXXXXXXXXXXXXXX"
mqtt.broker_addr = "192.168.X.XX"
mqtt.port = 1883
mqtt.credentials = ["admin", "XXXXXXXX"]
stream = "subStream"
  [cameras.pause]
  on_motion = true # Should pause when no motion
  on_client = true # Should pause when no rtsp client
  timeout = 2.1 # How long to wait after motion stops before pausing

Expected behavior
Get a snapshot from the cam.

Versions
Neolink software: 0.5.12
Reolink camera model and firmware: Argus Eco

Do not start 0.0.5

Neolink does not start anymore.

I did not modify anything, I made the update 0.0.5

error : /entrypoint.sh: 9: /entrypoint.sh: /run.sh: not found

And when I restart Reolink:

[2023-04-16T13:10:42Z INFO neolink] Neolink 1ea8f18 release
[2023-04-16T13:10:42Z WARN neolink::rtsp::gst::factory] Constructing Factor Impl
[2023-04-16T13:10:42Z INFO neolink::rtsp] Starting RTSP Server at 0.0.0.0:8554
[2023-04-16T13:10:45Z INFO neolink_core::bc_protocol] cam: Remote discovery success 952700046Q0FTLCI at 192.168.1.46:26065
[2023-04-16T13:10:45Z INFO neolink_core::bc_protocol] cam: Relay success 952700046Q0FTLCI at 15.188.144.151:51674
[2023-04-16T13:10:48Z ERROR neolink::rtsp] cam: Fatal error: cam: Could not login to camera

Caused by:
Communication error
Error: cam: Could not login to camera
Caused by:
Communication error

Versions
HA Core : 2023.4.4
HA supervisor : 2023.04.0
HassOS: 9.5
Neolink software: 0.0.5
Reolink camera model and firmware: Argus Pro 3 v3.0.0.973_22051000

Enable local discovery across subnets when IP address known.

Local discovery for cameras addressed by UID works by broadcasting to all networks that the neolink server device has direct connection to. I have isolated my cameras onto a separate VLAN / subnet, so when I run neolink from a server that is not connected to that VLAN then the camera must be discovered using remote Reolink servers... because broadcasts are not forwarded between subnets/VLANs by switch/router/bridges.

This can be optimized if the IP address of the camera is known. So, if the config file lists both a UID and a IP address then instead of broadcasting to all clients on the local network, just "broadcast" to the one known IP address (at the 2015/2018 ports if no port provided in the config file). This will forward through routers/bridges.

I tested this with a hardcoded hack in discovery.rs...

    let mut direct: Vec<(Ipv4Addr, u16)> = vec![(Ipv4Addr::new(192, 168, 21, 38), 2015), (Ipv4Addr::new(192, 168, 21, 38), 2018)];
    info!("Broadcasting to: {:?}", direct);
    Ok(direct
        .drain(..)
        .map(|(addr, port)| SocketAddr::new(addr.into(), port))
        .collect())

And ran it from a server that is NOT connected to 192.168.21.xx/24...

root@utils:/# ip -4 addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
28: eth0@if29: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link-netnsid 0
    inet 192.168.17.176/24 metric 100 brd 192.168.17.255 scope global dynamic eth0
       valid_lft 83474sec preferred_lft 83474sec
root@utils:/# ~/neolink2 image --config=/root/neolink2.toml --file-path=/mnt/tmp/cameras/temp6_hd.jpeg driveway
[2023-03-01T15:58:22Z INFO  neolink] Neolink 0.5.4 (unknown commit) debug
[2023-03-01T15:58:22Z INFO  neolink::utils] driveway: Connecting to camera at UID: <redacted>
[2023-03-01T15:58:22Z INFO  neolink_core::bc_protocol::connection::discovery] Broadcasting to: [(192.168.21.38, 2015), (192.168.21.38, 2018)]
[2023-03-01T15:58:22Z INFO  neolink_core::bc_protocol] Local discovery success <redacted> at 192.168.21.38:38438
[2023-03-01T15:58:22Z INFO  neolink::utils] driveway: Logging in
[2023-03-01T15:58:23Z INFO  neolink::utils] driveway: Connected and logged in

This is far more efficient than reaching out to a remote Reolink server, which is what is required when camera is not on the same subnet as the server..

Thanks
David

Stream Fails to Play on VLC (Argus 3)

Describe the bug
Seems that the latest build isn't working properly with my Argus 3. VLC attempts to connect to the RTSP stream and fails after a while which results in plenty of warnings and errors in the neolink/gstreamer logs.

To Reproduce

  1. Configuration file:
name = "frontdoor"
username = "admin"
password = "..."
uid = "..."
    [cameras.pause]
    on_motion = true
    on_client = true
    mode = "still"
    timeout = 4.0
  1. Launch Neolink:

$ GST_DEBUG=3 neolink rtsp --config=config_lsd.toml

  1. Try to play the rtsp stream in vlc using the url:

rtsp://<neolink url>:8554/frontdoor

  1. Observe that VLC tries to buffer for ~15 seconds, fails to play the stream, and the following logs are seen:
[2023-04-08T15:26:35Z INFO  neolink] Neolink 5734321633774a7a2e21dac510d95233a93be8c7 release
[2023-04-08T15:26:35Z INFO  neolink::rtsp] Starting RTSP Server at 0.0.0.0:8554
[2023-04-08T15:26:35Z INFO  neolink::rtsp::states] frontdoor: Connecting to camera at UID: 95270003UR3L14GD
[2023-04-08T15:26:35Z INFO  neolink_core::bc_protocol] Local discovery success 95270003UR3L14GD at 192.168.70.11:24541
[2023-04-08T15:26:35Z INFO  neolink::rtsp::states] frontdoor: Logging in
[2023-04-08T15:26:36Z INFO  neolink::rtsp::states] frontdoor: Successfully logged in
[2023-04-08T15:26:36Z INFO  neolink::rtsp::states] frontdoor: Camera time is already set: 2023-04-08 10:26:35 -6
[2023-04-08T15:26:36Z INFO  neolink::rtsp::states] frontdoor: Camera reports firmware version v3.0.0.819_22012700
[2023-04-08T15:26:36Z INFO  neolink::rtsp::states] frontdoor: Starting stream
[2023-04-08T15:26:36Z INFO  neolink::rtsp::states::streaming] frontdoor: Starting video stream Sub Stream (Fluent)
[2023-04-08T15:26:36Z INFO  neolink::rtsp::states::streaming] frontdoor: Starting video stream Main Stream (Clear)
[2023-04-08T15:26:36Z INFO  neolink::rtsp::states] frontdoor: Successfully started streaming
[2023-04-08T15:26:37Z WARN  neolink::rtsp] Not ready to pause
[2023-04-08T15:26:42Z INFO  neolink::rtsp] Pause on motion
[2023-04-08T15:26:42Z INFO  neolink::rtsp::states] frontdoor: Pausing stream
[2023-04-08T15:26:42Z INFO  neolink::rtsp::states::streaming] Streaming take_outputs
[2023-04-08T15:26:42Z INFO  neolink::rtsp::states::paused] frontdoor: Starting paused stream Sub Stream (Fluent)
[2023-04-08T15:26:42Z INFO  neolink::rtsp::states::paused] frontdoor: Starting paused stream Main Stream (Clear)
[2023-04-08T15:26:42Z INFO  neolink::rtsp::states] frontdoor: Successfully paused streaming
0:00:09.644118810  7558 0x7f9a8802d400 FIXME                default gstutils.c:4025:gst_pad_create_stream_id_internal:<audiotestsrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:09.643000942  7558 0x7f9a8800e180 FIXME                default gstutils.c:4025:gst_pad_create_stream_id_internal:<audsrc:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:09.645598552  7558 0x7f9a8802d860 FIXME                default gstutils.c:4025:gst_pad_create_stream_id_internal:<vidsrc:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:29.638715447  7558 0x7f9aa0005ea0 WARN               rtspmedia rtsp-media.c:3576:wait_preroll: failed to preroll pipeline
0:00:29.638835186  7558 0x7f9aa0005ea0 WARN               rtspmedia rtsp-media.c:3946:gst_rtsp_media_prepare: failed to preroll pipeline
0:00:29.643276018  7558 0x7f9aa0005ea0 ERROR             rtspclient rtsp-client.c:1087:find_media: client 0x7f9aa000b160: can't prepare media
0:00:29.644080126  7558 0x7f9aa0005ea0 ERROR             rtspclient rtsp-client.c:3346:handle_describe_request: client 0x7f9aa000b160: no media
0:00:29.648450189  7558 0x7f9a8800e180 FIXME                default gstutils.c:4025:gst_pad_create_stream_id_internal:<audsrc:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:29.648552843  7558 0x7f9a8802d400 FIXME                default gstutils.c:4025:gst_pad_create_stream_id_internal:<audiotestsrc1:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:29.650900139  7558 0x7f9a8802d520 FIXME                default gstutils.c:4025:gst_pad_create_stream_id_internal:<vidsrc:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:49.647200889  7558 0x7f9aa0005ea0 WARN               rtspmedia rtsp-media.c:3576:wait_preroll: failed to preroll pipeline
0:00:49.647349849  7558 0x7f9aa0005ea0 WARN               rtspmedia rtsp-media.c:3946:gst_rtsp_media_prepare: failed to preroll pipeline
0:00:49.654982495  7558 0x7f9aa0005ea0 ERROR             rtspclient rtsp-client.c:1087:find_media: client 0x7f9aa000b2a0: can't prepare media
0:00:49.655728980  7558 0x7f9aa0005ea0 ERROR             rtspclient rtsp-client.c:3064:handle_setup_request: client 0x7f9aa000b2a0: media '/frontdoor' not found

Expected behavior

VLC should be able to play the stream properly

Versions
Neolink software: 5734321
Reolink camera model and firmware: Reolink Argus 3, FW v3.0.0.819_22012700

"WARN neolink::rtsp] camera_name: Retryable error: Motion detection unexpectedly stopped"

Hello! I've been seeing the amazing work that you continue putting into neolink :) A big thank you!!

I wanted to test the latest version (0.5.5) to see if the CPU consumption issue was fixed or improved. But after a while of the stream pause there's a WARN message and the connection restarts.

Docker install using tag:latest and network mode
Neolink 4fcaf4d release
Camera Argus 2E

Thanks!

[2023-03-05T16:27:32Z INFO  neolink::rtsp::states] tapas_balcony: Successfully paused streaming
[2023-03-05T16:28:32Z WARN  neolink::rtsp] tapas_balcony: Retryable error: Motion detection unexpectedly stopped

    Caused by:
        0: Dropped connection
        1: receiving on a closed channel
[2023-03-05T16:28:32Z INFO  neolink::rtsp::states] tapas_balcony: Connecting to camera at UID: 1111111111111111111111
[2023-03-05T16:28:37Z INFO  neolink_core::bc_protocol] Local discovery success 1111111111111111111111 at 192.168.1.106:26774
[2023-03-05T16:28:37Z INFO  neolink::rtsp::states] tapas_balcony: Logging in
[2023-03-05T16:28:37Z INFO  neolink::rtsp::states] tapas_balcony: Successfully logged in
[2023-03-05T16:28:37Z INFO  neolink::rtsp::states] tapas_balcony: Camera time is already set: 2023-03-05 17:28:40 +1
[2023-03-05T16:28:38Z INFO  neolink::rtsp::states] tapas_balcony: Camera reports firmware version 0323_712_572_477
[2023-03-05T16:28:38Z INFO  neolink::rtsp::states] tapas_balcony: Starting stream
[2023-03-05T16:28:38Z INFO  neolink::rtsp::states::streaming] tapas_balcony: Starting video stream Sub Stream (Fluent)
[2023-03-05T16:28:38Z INFO  neolink::rtsp::states] tapas_balcony: Successfully started streaming
[2023-03-05T16:28:38Z WARN  neolink::rtsp] Not ready to pause
[2023-03-05T16:28:38Z INFO  neolink::rtsp] Pause on motion (start)
[2023-03-05T16:28:38Z INFO  neolink::rtsp::states] tapas_balcony: Pausing stream
[2023-03-05T16:28:38Z INFO  neolink::rtsp::states::streaming] Streaming take_outputs
[2023-03-05T16:28:38Z INFO  neolink::rtsp::states::paused] tapas_balcony: Starting paused stream Sub Stream (Fluent)
[2023-03-05T16:28:38Z INFO  neolink::rtsp::states] tapas_balcony: Successfully paused streaming

PIR motion settings not working with Argus Eco

Hey @QuantumEntangledAndy

Thanks for your work on attempting to get the PIR motion working and integrated with neolink.

However I'm having some trouble using the artifacts from the build here: https://github.com/QuantumEntangledAndy/neolink/actions/runs/3564809691

It stops the stream (twice) as soon as starting, and doesn't start up again when there's any motion.

Some info on my setup and devices here:
thirtythreeforty#325

Full log file is attached.

run.log

Let me know if theres any more info you need.

Request still JPEG image

I would like to be able to capture a still JPEG image from Reolink battery cameras (specifically Argus 3 Pro).

With wired Reolink cameras I can connect to the IP address and capture an image. For example...

curl -s -m 15 http://192.168.1.111/cgi-bin/api.cgi\?cmd=Snap\&channel=0\&rs=randomstr\&user=admin\&password=password -o image.jpeg

I would like to be able to do the same with the Argus 3 Pro... without keeping the camera on-and-live-streaming all the time (to minimize battery drain).

Is this possible?

GStreamer plugin missing

Docker, main version.

Not sure if expected or not.

[2023-01-08T18:11:00Z WARN neolink::rtsp::gst] Missing the gstreamer plugin x264 (gst-plugins-ugly) for x264enc element. Required to paused certain cameras
[2023-01-08T18:11:00Z WARN neolink::rtsp::gst] Missing the gstreamer plugin libav (gst-libav) for avdec_h264 element. Required to paused certain cameras
[2023-01-08T18:11:00Z WARN neolink::rtsp::gst] Missing the gstreamer plugin libav (gst-libav) for avdec_h265 element. Required to paused certain cameras

Install on Windows 11

When I try to start neolink on Windows 11 I get these errors

dll error

In the gstreamer folder these dlls are actually not there.
I tried to install both MSVC 64-bit version and MinGW 64-bit version, the result I get is the same.
I tried with gstreamer 1.20.5 with gstreamer 1.20.6, 1.22.1 and many others
Where am I wrong?

Illegal instruction when running on Raspberry Pi Model B Rev 2

Describe the bug

pi@raspberrypi:~/neolink_linux_armhf$ ./neolink help
Illegal instruction
pi@raspberrypi:~/neolink_linux_armhf$ ./neolink --help
Illegal instruction
pi@raspberrypi:~/neolink_linux_armhf$ uname -a
Linux raspberrypi 4.19.65+ #1252 Fri Aug 9 18:00:11 BST 2019 armv6l GNU/Linux
pi@raspberrypi:~$ cat /proc/cpuinfo
processor       : 0
model name      : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 697.95
Features        : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : BCM2835
Revision        : 000f
Serial          : 00000000913da422

To Reproduce
Steps to reproduce the behavior. Example:

  1. Download and open latest version of NeoLink
  2. Launch Neolink

Expected behavior
The help is displayed

Versions

Set PIR fails with `Service Unavailable` for Argus Eco

My camera is an Argus Eco. I am trying to switch OFF the PIR:

./neolink pir --config=neolink_config.toml giardino off
[2023-03-31T07:56:20Z INFO  neolink] Neolink 4fcaf4d538dc6e05434690bdf7f3a3bc22b077e3 release
[2023-03-31T07:56:20Z INFO  neolink::utils] giardino: Connecting to camera at UID: 95270004YFGE16SE
[2023-03-31T07:56:22Z INFO  neolink_core::bc_protocol] Relay success 95270004YFGE16SE at 35.180.129.86:51736
[2023-03-31T07:56:22Z INFO  neolink::utils] giardino: Logging in
[2023-03-31T07:56:24Z INFO  neolink::utils] giardino: Connected and logged in
Error: Unable to set camera PIR state

Caused by:
    Camera responded with Service Unavaliable

Mqtt battery draining

Describe the bug
MQTT keeps the cameras active and drains the battery

To Reproduce
Steps to reproduce the behavior. Example:

  1. Run MQTT
  2. Cameras will never be disconnected and battery drainage will happen

Expected behavior
MQTT server should keep running, but cameras should be disconnected when we are not using them. Reconnection could be done when we need to execute a command in any of them.

Versions
NVR software: -
Neolink software: Last version
Reolink camera model and firmware: Argus 3 pro

neolink + powered camera - high CPU usage after some hours

Setup

  • Docker container
  • neolink version 0.5.7
  • Powered camera Reolink E1 Pro
  • Frigate 0.12.0 connected to neolink stream via 192.168.1.10:8889

neolink docker logs:

(...)
[2023-04-15T11:11:54Z INFO  neolink::rtsp] Join Pause
[2023-04-15T11:12:04Z WARN  neolink::rtsp] tapas_hall: Retryable error: tapas_hall: Error while streaming
    Caused by:
        deadline has elapsed
[2023-04-15T11:13:00Z WARN  neolink::rtsp] tapas_hall: Retryable error: tapas_hall: Could not connect to camera
    Caused by:
        0: Failed to connect to camera tapas_hall at Address: 192.168.1.216:9000 on channel 0
        1: Cannot contact camera at given address
[2023-04-15T11:13:00Z INFO  neolink_core::bc_protocol] tapas_hall: TCP Discovery success at 192.168.1.216:9000
(...)

Frigate docker logs

2023-04-16 07:58:47.635806588  07:58:47.635 WRN [rtsp] error="source 0 error: dial tcp 192.168.1.10:8889: connect: connection refused" stream=tapas_balcony
2023-04-16 07:58:47.639060992  [2023-04-16 07:58:47] frigate.video                  ERROR   : tapas_balcony: Unable to read frames from ffmpeg process.
2023-04-16 07:58:47.639628721  [2023-04-16 07:58:47] frigate.video                  ERROR   : tapas_balcony: ffmpeg process is not running. exiting capture thread...
2023-04-16 07:58:50.071712983  192.168.25.9 - - [16/Apr/2023:07:58:50 +0000] "GET /api/stats HTTP/1.1" 200 2289 "-" "HomeAssistant/2023.4.4 aiohttp/3.8.4 Python/3.10" "-"
2023-04-16 07:58:57.636225154  [2023-04-16 07:58:57] watchdog.tapas_balcony         ERROR   : Ffmpeg process crashed unexpectedly for tapas_balcony.
2023-04-16 07:58:57.637464564  [2023-04-16 07:58:57] watchdog.tapas_balcony         ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-04-16 07:58:57.637481849  [2023-04-16 07:58:57] ffmpeg.tapas_balcony.detect    ERROR   : [rtsp @ 0x55ceb1a54100] method DESCRIBE failed: 404 Not Found
2023-04-16 07:58:57.637484388  [2023-04-16 07:58:57] ffmpeg.tapas_balcony.detect    ERROR   : rtsp://127.0.0.1:8554/tapas_balcony: Server returned 404 Not Found
2023-04-16 07:58:57.674282953  07:58:57.673 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="dial tcp 192.168.1.10:8889: connect: connection refused" url=rtsp://192.168.1.10:8889/tapas_balcony
2023-04-16 07:58:57.675132153  07:58:57.674 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="dial tcp 192.168.1.10:8889: connect: connection refused" url=rtsp://192.168.1.10:8889/tapas_balcony
2023-04-16 07:58:57.675483306  07:58:57.675 WRN [rtsp] error="source 0 error: dial tcp 192.168.1.10:8889: connect: connection refused" stream=tapas_balcony
2023-04-16 07:58:57.682663332  [2023-04-16 07:58:57] frigate.video                  ERROR   : tapas_balcony: Unable to read frames from ffmpeg process.
2023-04-16 07:58:57.683063682  [2023-04-16 07:58:57] frigate.video                  ERROR   : tapas_balcony: ffmpeg process is not running. exiting capture thread...
2023-04-16 07:58:59.116699935  192.168.25.9 - - [16/Apr/2023:07:58:59 +0000] "GET /api/stats HTTP/1.1" 200 2288 "-" "HomeAssistant/2023.4.4 aiohttp/3.8.4 Python/3.10" "-"
2023-04-16 07:59:07.653010078  [2023-04-16 07:59:07] watchdog.tapas_balcony         ERROR   : Ffmpeg process crashed unexpectedly for tapas_balcony.
2023-04-16 07:59:07.656549542  [2023-04-16 07:59:07] watchdog.tapas_balcony         ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-04-16 07:59:07.656556231  [2023-04-16 07:59:07] ffmpeg.tapas_balcony.detect    ERROR   : [rtsp @ 0x55c87c6d6100] method DESCRIBE failed: 404 Not Found
2023-04-16 07:59:07.656558614  [2023-04-16 07:59:07] ffmpeg.tapas_balcony.detect    ERROR   : rtsp://127.0.0.1:8554/tapas_balcony: Server returned 404 Not Found
2023-04-16 07:59:07.689685112  07:59:07.689 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="dial tcp 192.168.1.10:8889: connect: connection refused" url=rtsp://192.168.1.10:8889/tapas_balcony
2023-04-16 07:59:07.690266545  07:59:07.690 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="dial tcp 192.168.1.10:8889: connect: connection refused" url=rtsp://192.168.1.10:8889/tapas_balcony
2023-04-16 07:59:07.690402924  07:59:07.690 WRN [rtsp] error="source 0 error: dial tcp 192.168.1.10:8889: connect: connection refused" stream=tapas_balcony
2023-04-16 07:59:07.695709549  [2023-04-16 07:59:07] frigate.video                  ERROR   : tapas_balcony: Unable to read frames from ffmpeg process.
2023-04-16 07:59:07.696222426  [2023-04-16 07:59:07] frigate.video                  ERROR   : tapas_balcony: ffmpeg process is not running. exiting capture thread...

image

I've enabled RUST_LOG = debug and am awaiting to see if it reproduces.

Stream not ready - Reolink Lumus

Describe the bug
Load stream into VLC and I get static and error message "Stream not Ready"

To Reproduce
Steps to reproduce the behavior. Example:

  1. Create this configuration file:
    Docker Compose:

version: "3.4"
services:
neolink:
image: quantumentangledandy/neolink:latest
container_name: neolink
environment:
- PUID=1000
- PGID=100
- TZ=TZ=Australia/Perth
volumes:
- /srv/dev-disk-by-uuid-4a3f08d5-22b1-41f3-81da-f78d77b40830/config/neolink/neolink.toml:/etc/neolink.toml
ports:
- 8554:8554
restart: unless-stopped

neolink.toml:

bind = "0.0.0.0"

[[cameras]]
name = "patio"
username = ""
password = "
"
address = "192.168.1.35:9000"
stream = "both"

  1. Launch Neolink:

Docker log:

[2023-05-21T09:18:18Z INFO neolink] Neolink 384a027 release
[2023-05-21T09:18:18Z INFO neolink::rtsp] Starting RTSP Server at 0.0.0.0:8554
[2023-05-21T09:18:18Z INFO neolink_core::bc_protocol] patio: Trying TCP discovery
[2023-05-21T09:18:18Z INFO neolink_core::bc_protocol] patio: TCP Discovery success at 192.168.1.35:9000

  1. open network stream in VLC - "rtsp://192.168.1.4:8554/patio"

Expected behavior
A view of the camera stream

Versions
NVR software: Blue Iris 5.7.6.8 x64, VLC 3.0.18
Neolink software: quantumentangledandy/neolink:latest
Reolink camera model and firmware: Reolink Lumus running v2.0.0.687_20102800

Other:

It works when running 3340's docker image but my log is full of Deserialization errors

edit: code tag drama

Frigate - Streaming with audio stops

Today I managed to configure Frigate with the audio stream.
Unfortunately I notice that when the audio "skips", the stream stops.
I attach the log.
log2.txt
The cameras Reolink Argus 3 PRO are at 1536kbps
What are all those "Pausing" that I see in the log?
Here is my Frigate configuration:

mqtt:
  enabled: False  

ffmpeg:
  hwaccel_args: preset-vaapi
  output_args:
    record: preset-record-generic-audio-copy

cameras:
  c5:
    ffmpeg:
      inputs:
        - path: rtsp://192.168.3.170:8554/c5 # 
          input_args: preset-rtsp-restream
          roles:
            - detect
    detect:
      enabled: False 
      width: 2560
      height: 1440

go2rtc:
  streams:
    c5:
      - "ffmpeg:rtsp://192.168.0.150:8554/c5#audio=aac"
      - rtsp://192.168.0.150:8554/c5

Stream controllable from external

Is your feature request related to a problem? Please describe.
Since the automatic pause function does not always work ... is there a possiblility to start and stop the stream by an external function call?

Describe the solution you'd like
Background of the request is, that I would like to access an RSTP stream from my home automation system. And this system knows when somebody wants to watch the video, so it could just start and stop it on demand which would save more battery on camery side. Thanks for your good work by the way!

Pir status

Is it possible to query the PIR status?

Expected Delay/Lag in video

Hello!
First of all let me say that this project is pure genius!!
I've been looking for a way to get rid of the Reolink App for months AND also for a way to incorporate my Reolink battery cameras to Home Assistant, and this project really looks like it could make it happen!

Therefore I'm experimenting with neolink, but I noticed there is a huge delay between the video stream and the "real time" actions (for example, if I walk in front of a camera this will be shown many seconds later, up to a minute in my tries).

Since I've tried installing neolink on an OrangePi PC that I have running at home, is this delay due to the low processing power of the board I'm running neolink on or is this expected behavior even if using a more powerful device?

Thanks a lot.

Error streaming from Argus 3 Pro

Getting this recoverable error.

david@neolink:~/github/neolink$ ~/github/neolink/target/debug/neolink rtsp --config=/home/david/neolink.toml
[2023-02-26T02:51:19Z INFO  neolink] Neolink 0.5.2 (unknown commit) debug
[2023-02-26T02:51:19Z WARN  neolink::rtsp::gst] Missing the gstreamer plugin `x264 (gst-plugins-ugly)` for `x264enc` element. Required to paused certain cameras
[2023-02-26T02:51:19Z WARN  neolink::rtsp::gst] Missing the gstreamer plugin `libav (gst-libav)` for `avdec_h264` element. Required to paused certain cameras
[2023-02-26T02:51:19Z WARN  neolink::rtsp::gst] Missing the gstreamer plugin `libav (gst-libav)` for `avdec_h265` element. Required to paused certain cameras
[2023-02-26T02:51:19Z INFO  neolink::rtsp] Starting RTSP Server at 0.0.0.0:8554
[2023-02-26T02:51:19Z INFO  neolink::rtsp::states] driveway: Connecting to camera at UID: <redacted>
[2023-02-26T02:51:22Z INFO  neolink_core::bc_protocol] Local discovery success <redacted> at 192.168.21.38:34892
[2023-02-26T02:51:22Z INFO  neolink::rtsp::states] driveway: Logging in
[2023-02-26T02:51:22Z INFO  neolink::rtsp::states] driveway: Successfully logged in
[2023-02-26T02:51:23Z INFO  neolink::rtsp::states] driveway: Camera time is already set: 2023-02-25 21:51:30 -5
[2023-02-26T02:51:23Z INFO  neolink::rtsp::states] driveway: Camera reports firmware version v3.0.0.973_22051000
[2023-02-26T02:51:23Z INFO  neolink::rtsp::states] driveway: Starting stream
[2023-02-26T02:51:23Z INFO  neolink::rtsp::states::streaming] driveway: Starting video stream Main Stream (Clear)
[2023-02-26T02:51:23Z INFO  neolink::rtsp::states] driveway: Successfully started streaming
[2023-02-26T02:52:28Z WARN  neolink::rtsp] driveway: Retryable error: Camera has unexpectanely stopped the streaming state: On stream: Main

    Caused by:
        Nom Parsing error: Nom Error: VerboseError { errors: [([8C, 32, 37, 7A, A1, 36, 24, D0, 86, 13, 4D, B7, A3, E6, 5B, 52, EF, EC, 33, 88, FB, B2, 3C, A, 41, B0, 70, 4C, 64, 53, C5, 11, 5C, AC, F9, 2A, 82, 93, 9D, F2, 4, 62, 73, 2, 51, F4, 9F, E0, A7, 10, 53, 93, A2, EA, AD, 2A, F5, D7, C6, 11, CF, B4, 64, B4, BA, B, 4, C1, 2F, 6F, F4, C, B2, D4, C, FB, B4, B8, 29, EE, F5, 89, F4, F5, 37, 68, BD, A0, C4, 15, 1C, 3, 39, 95, 5F, 4C, 19, A4, 9F, B5, E3, C6, A6, C9, 74, 1, C1, C1, DD, C8, DE, F, 24, 43, E8, F5, CA, 81, 61, 19, FF, 84, 1B, C4, 82, A0, 83, 46, 3D, 96, 6D, 84, 66, C, A5, E, 68, 8C, 1D, D0, D8, 7F, 7A, F4, F4, 5D, 64, DE, 80, D9, 77, 44, 73, EE, 53, A1, B9, 3A, 9F, 7E, F, C6, 4A, AB, 71, BB, 69, B7, FF, 7D, BF, DF, 47, A4, 45, 51, 6, F6, FD, 4B, DA, 9, E0, 31, 15, D2, 88, 98, 77, AD, CC, 80, 9, EC, 1C, C4, B3, 39, 2B, CF, 9D, 23, D, EA, 35, FF, B, 50, 50, 91, 4A, 56, 38, F3, 27, B9, 17, A5, FD, 1F, A4, CE, 2E, FB, CB, 3E, AD, 6D, E0, 58, 18, C3, DB, 45, C1, D3, 80, 50, 4F, D, 41, 8B, 4C, B, 2F, 0, A0, 93, 50, 2D, 78, C4, DD, 26, 51, 5B, 68, ED, 0, 60, BB, F2, A8, 1F, 7F, 4A, BE, B9, 87, 2B, F4, E1, 99, 8, A5, 4, B1, 4E, 1E, 2C, AE, 4C, 62, 66, D7, EA, D6, 22, 35, C2, D6, 1A, C, 81, DF, 34, 3, D1, 8C, 4A, A5, 95, BB, 87, CD, AE, D0, 89, D9, B3, B7, 34, 19, 77, 52, D, 80, F2, E3, 5E, C2, 69, E1, 70, 99, 6E, D9, EE, B5, 74, 4, D4, B3, E, DE, 4D, 4A, BC, 2B, 72, BC, A8, 43, 1D, F, CB, 62, B2, 97, 92, 5A, F7, BC, B4, 7F, 48, 9B, 6C, 89, 1C, 34, 33, AF, AC, 35, 80, 92, 51, 3E, 39, C1, E4, F9, 15, 46, 94, A3, 3F, E0, 7C, F5, 3A, 62, 64, 70, 71, C9, 90, 79, 3D, A6, 1D, FF, 3A, 16, CB, 5A, EE, CC, 36, 8B, E7, A, E4, 5, 43, 93, 91, 42, 4D, 98, 71, A0, 16, 89, 33, D2, 82, EB, E5, 33, 7, 62, DD, AC, 4E, CD, 24, 3F, 92, FB, 34, 45, 2B, EF, 81, 7C, 1B, B1, 76, 11, 5A, 42, 53, C4, BD, 63, FF, E1, 66, E6, 22, 96, 54, 9E, E7, A, C4, 0, 5E, AB, D, 6F, BD, 3C, A2, EF, 86, 86, 57, 48, F9, 3, 8A, F2, 10, 97, 1A, F3, A4, 64, 73, 32, C4, EC, C0, DC, 1D, 38, 94, 9D, A2, 38, D8, 69, 26, A7, 9, 3A, EA, B, 39, 41, 72, 2C, 1D, DB, 2B, 2A, 1E, CE, BF, 7, 9D, CF, 81, A7, B0, 65, D8, 88, 6B, 9C, 4E, 3B, A6, C8, 9B], Nom(Verify)), ([8C, 32, 37, 7A, A1, 36, 24, D0, 86, 13, 4D, B7, A3, E6, 5B, 52, EF, EC, 33, 88, FB, B2, 3C, A, 41, B0, 70, 4C, 64, 53, C5, 11, 5C, AC, F9, 2A, 82, 93, 9D, F2, 4, 62, 73, 2, 51, F4, 9F, E0, A7, 10, 53, 93, A2, EA, AD, 2A, F5, D7, C6, 11, CF, B4, 64, B4, BA, B, 4, C1, 2F, 6F, F4, C, B2, D4, C, FB, B4, B8, 29, EE, F5, 89, F4, F5, 37, 68, BD, A0, C4, 15, 1C, 3, 39, 95, 5F, 4C, 19, A4, 9F, B5, E3, C6, A6, C9, 74, 1, C1, C1, DD, C8, DE, F, 24, 43, E8, F5, CA, 81, 61, 19, FF, 84, 1B, C4, 82, A0, 83, 46, 3D, 96, 6D, 84, 66, C, A5, E, 68, 8C, 1D, D0, D8, 7F, 7A, F4, F4, 5D, 64, DE, 80, D9, 77, 44, 73, EE, 53, A1, B9, 3A, 9F, 7E, F, C6, 4A, AB, 71, BB, 69, B7, FF, 7D, BF, DF, 47, A4, 45, 51, 6, F6, FD, 4B, DA, 9, E0, 31, 15, D2, 88, 98, 77, AD, CC, 80, 9, EC, 1C, C4, B3, 39, 2B, CF, 9D, 23, D, EA, 35, FF, B, 50, 50, 91, 4A, 56, 38, F3, 27, B9, 17, A5, FD, 1F, A4, CE, 2E, FB, CB, 3E, AD, 6D, E0, 58, 18, C3, DB, 45, C1, D3, 80, 50, 4F, D, 41, 8B, 4C, B, 2F, 0, A0, 93, 50, 2D, 78, C4, DD, 26, 51, 5B, 68, ED, 0, 60, BB, F2, A8, 1F, 7F, 4A, BE, B9, 87, 2B, F4, E1, 99, 8, A5, 4, B1, 4E, 1E, 2C, AE, 4C, 62, 66, D7, EA, D6, 22, 35, C2, D6, 1A, C, 81, DF, 34, 3, D1, 8C, 4A, A5, 95, BB, 87, CD, AE, D0, 89, D9, B3, B7, 34, 19, 77, 52, D, 80, F2, E3, 5E, C2, 69, E1, 70, 99, 6E, D9, EE, B5, 74, 4, D4, B3, E, DE, 4D, 4A, BC, 2B, 72, BC, A8, 43, 1D, F, CB, 62, B2, 97, 92, 5A, F7, BC, B4, 7F, 48, 9B, 6C, 89, 1C, 34, 33, AF, AC, 35, 80, 92, 51, 3E, 39, C1, E4, F9, 15, 46, 94, A3, 3F, E0, 7C, F5, 3A, 62, 64, 70, 71, C9, 90, 79, 3D, A6, 1D, FF, 3A, 16, CB, 5A, EE, CC, 36, 8B, E7, A, E4, 5, 43, 93, 91, 42, 4D, 98, 71, A0, 16, 89, 33, D2, 82, EB, E5, 33, 7, 62, DD, AC, 4E, CD, 24, 3F, 92, FB, 34, 45, 2B, EF, 81, 7C, 1B, B1, 76, 11, 5A, 42, 53, C4, BD, 63, FF, E1, 66, E6, 22, 96, 54, 9E, E7, A, C4, 0, 5E, AB, D, 6F, BD, 3C, A2, EF, 86, 86, 57, 48, F9, 3, 8A, F2, 10, 97, 1A, F3, A4, 64, 73, 32, C4, EC, C0, DC, 1D, 38, 94, 9D, A2, 38, D8, 69, 26, A7, 9, 3A, EA, B, 39, 41, 72, 2C, 1D, DB, 2B, 2A, 1E, CE, BF, 7, 9D, CF, 81, A7, B0, 65, D8, 88, 6B, 9C, 4E, 3B, A6, C8, 9B], Context("Failed to match any known bcmedia"))] }
[2023-02-26T02:52:28Z INFO  neolink::rtsp::states] driveway: Connecting to camera at UID: <redacted>
[2023-02-26T02:52:28Z INFO  neolink_core::bc_protocol] Local discovery success <redacted> at 192.168.21.38:34892
[2023-02-26T02:52:28Z INFO  neolink::rtsp::states] driveway: Logging in
[2023-02-26T02:52:29Z INFO  neolink::rtsp::states] driveway: Successfully logged in
[2023-02-26T02:52:29Z INFO  neolink::rtsp::states] driveway: Camera time is already set: 2023-02-25 21:52:37 -5
[2023-02-26T02:52:30Z INFO  neolink::rtsp::states] driveway: Camera reports firmware version v3.0.0.973_22051000
[2023-02-26T02:52:30Z INFO  neolink::rtsp::states] driveway: Starting stream
[2023-02-26T02:52:30Z INFO  neolink::rtsp::states::streaming] driveway: Starting video stream Main Stream (Clear)
[2023-02-26T02:52:30Z INFO  neolink::rtsp::states] driveway: Successfully started streaming
^C

CPU pegged at 100% even when nothing connected to rtsp

Simply running neolink rtsp causes the CPU to peg at 100%, even on my 4-core i7 container. It does this even if nothing is connected to the rtsp port and streaming. I assume this is because some transformation is taking place on every incoming packet from the camera.

This is very inefficient... the transformation should only take place if something is actually connected to the rtsp port. If not just throw away the packets without conversion.

Neolink UDP Argus 3 Login doesn't work

Describe the bug
Login doesn't work.

To Reproduce

[2021-09-11T14:46:15Z INFO  neolink] Neolink cd9fbc4d859ef90317e932f12f6bf7b82aa250a0 release
[2021-09-11T14:46:16Z INFO  neolink::rtsp] storage shed: Connecting to camera at *CAMERA UID*
[2021-09-11T14:46:16Z INFO  neolink::rtsp] storage shed: Connecting to camera at *CAMERA UID*
[2021-09-11T14:46:18Z ERROR neolink::rtsp] Authentication failed to camera storage shed, not retrying
[2021-09-11T14:46:18Z ERROR neolink_core::bc_protocol::connection::udpconn] Udp write poll aborted
[2021-09-11T14:46:18Z ERROR neolink_core::bc_protocol::connection::udpconn] Udp read poll aborted
[2021-09-11T14:46:18Z ERROR neolink::rtsp] Authentication failed to camera storage shed, not retrying
[2021-09-11T14:46:18Z ERROR neolink_core::bc_protocol::connection::udpconn] Udp read poll aborted
[2021-09-11T14:46:18Z ERROR neolink_core::bc_protocol::connection::udpconn] Udp write poll aborted

Expected behavior
Login works.

Versions
Neolink software: cd9fbc4
Reolink camera model and firmware: Argus 3 (0130_705_572_474)

Battery information

The "battery level" feature is very useful, but it introduces a problem. If the battery is enabled and I query the camera status, I have an output like this:

==Battery==
Charge: 100%,
Temperature: 15ยฐC,
LowPower: false,
Adapter: solarPanel,
ChargeStatus: charging,

<?xml version="1.0" encoding="utf-8"?><RfAlarmCfg version="1.1"><rfID>0</rfID><enable>1</enable><sensitivity>0</sensitivity><sensiValue>16</sensiValue><reduceFalseAlarm>0</reduceFalseAlarm><timeBlockList /><alarmHandle /></RfAlarmCfg>

which is tricky to decode as it is mixed text/XML format.

or this:

<?xml version="1.0" encoding="utf-8"?><BatteryInfo><channelId>0</channelId><chargeStatus>charging</chargeStatus><adapterStatus>solarPanel</adapterStatus><voltage>4019</voltage><current>-180</current><temperature>15</temperature><batteryPercent>100</batteryPercent><lowPower>0</lowPower><batteryVersion>2</batteryVersion></BatteryInfo>
<?xml version="1.0" encoding="utf-8"?><RfAlarmCfg version="1.1"><rfID>0</rfID><enable>1</enable><sensitivity>0</sensitivity><sensiValue>16</sensiValue><reduceFalseAlarm>0</reduceFalseAlarm><timeBlockList /><alarmHandle /></RfAlarmCfg>

which are 2 separate XML and introduces more process to decode.

My suggestions are:

  1. add a separate command to query the battery
    or
  2. add the battery information in the same XML (just one XML output)

Reolink Argus PT wont connect

Trying to get the above cams working through neolink
sometimes the connection works but streaming never occurs.
other times the connection fails stating the camera refused connection

gc@scs:~/neolink $ ./neolink rtsp --config=conf.toml
[2023-04-23T11:02:37Z INFO  neolink] Neolink fb4a23a1f641523dd79bd18630fa89b1e0360fbb release
[2023-04-23T11:02:37Z WARN  neolink::rtsp::gst::factory] Constructing Factor Impl
[2023-04-23T11:02:37Z WARN  neolink::rtsp::gst::factory] Constructing Factor Impl
[2023-04-23T11:02:37Z INFO  neolink::rtsp] Starting RTSP Server at 0.0.0.0:8554
[2023-04-23T11:02:40Z INFO  neolink_core::bc_protocol] Rear: Relay success xxxxxxxxxxx at 20.xxx.xxx.191:51378
[2023-04-23T11:02:53Z ERROR neolink::rtsp] Rear: Fatal error: Rear: Could not login to camera
    
    Caused by:
        0: IO Error: Custom { kind: Other, error: CameraTerminate }
        1: Camera terminated the connection
Error: Rear: Could not login to camera

Caused by:
    0: IO Error: Custom { kind: Other, error: CameraTerminate }
    1: Camera terminated the connection

Config:

bind = "0.0.0.0"

[[cameras]]
name = "Rear"
username = "admin"
password = "xxxxxxxxxxxxxxxxxxxxxx"
uid = "xxxxxxxxxxxxxx"
#discovery = "relay"
print_format = "Human"
stream = "both"

rust Debug:

gc@scs:~/neolink $ ./neolink rtsp --config=conf.toml
[2023-04-23T11:02:37Z INFO  neolink] Neolink fb4a23a1f641523dd79bd18630fa89b1e0360fbb release
[2023-04-23T11:02:37Z WARN  neolink::rtsp::gst::factory] Constructing Factor Impl
[2023-04-23T11:02:37Z WARN  neolink::rtsp::gst::factory] Constructing Factor Impl
[2023-04-23T11:02:37Z INFO  neolink::rtsp] Starting RTSP Server at 0.0.0.0:8554
[2023-04-23T11:02:40Z INFO  neolink_core::bc_protocol] Rear: Relay success xxxxxxxxxxx at 20.108.160.191:51378
[2023-04-23T11:02:53Z ERROR neolink::rtsp] Rear: Fatal error: Rear: Could not login to camera
    
    Caused by:
        0: IO Error: Custom { kind: Other, error: CameraTerminate }
        1: Camera terminated the connection
Error: Rear: Could not login to camera

Caused by:
    0: IO Error: Custom { kind: Other, error: CameraTerminate }
    1: Camera terminated the connection

gc@scs:~/neolink $ ./neolink rtsp --config=conf.toml
[2023-04-23T09:30:55Z INFO  neolink] Neolink fb4a23a1f641523dd79bd18630fa89b1e0360fbb release
[2023-04-23T09:30:55Z WARN  neolink::rtsp::gst::factory] Constructing Factor Impl
[2023-04-23T09:30:55Z DEBUG neolink::rtsp::states::shared] Adding path ["/Rear/Main", "/Rear/MainStream", "/Rear/Mainstream", "/rear/Main", "/rear/MainStream", "/rear/Mainstream", "/Rear/main", "/Rear/mainStream", "/Rear/mainstream", "/rear/main", "/rear/mainStream", "/rear/mainstream", "/Rear", "/rear"] for Rear::Main
[2023-04-23T09:30:55Z WARN  neolink::rtsp::gst::factory] Constructing Factor Impl
[2023-04-23T09:30:55Z DEBUG neolink::rtsp::states::shared] Adding path ["/Rear/Sub", "/Rear/SubStream", "/Rear/Substream", "/rear/Sub", "/rear/SubStream", "/rear/Substream", "/Rear/sub", "/Rear/subStream", "/Rear/substream", "/rear/sub", "/rear/subStream", "/rear/substream"] for Rear::Sub
[2023-04-23T09:30:55Z INFO  neolink::rtsp] Starting RTSP Server at 0.0.0.0:8554
[2023-04-23T09:30:55Z TRACE neolink::utils] Camera Info: BcCameraOpt { name: "Rear", channel_id: 0, addrs: [], uid: Some("9xxxxxxxxxxxX"), port: None, protocol: TcpUdp, discovery: Relay, aux_printing: Human, credentials: {"username": "admin", "password": "******"} }
[2023-04-23T09:30:55Z TRACE neolink_core::bc_protocol] Rear: Starting Local discovery
[2023-04-23T09:30:55Z TRACE neolink_core::bc_protocol] Starting Remote discovery
[2023-04-23T09:30:55Z TRACE mio::poll] registering event source with poller: token=Token(1), interests=READABLE | WRITABLE
[2023-04-23T09:30:55Z TRACE mio::poll] registering event source with poller: token=Token(0), interests=READABLE | WRITABLE
[2023-04-23T09:30:55Z TRACE neolink_core::bc_protocol] Starting Map
[2023-04-23T09:30:55Z TRACE neolink_core::bc_protocol] Starting Relay
[2023-04-23T09:30:55Z DEBUG neolink_core::bc_protocol::connection::discovery] Broadcasting to: [(255.255.255.255, 2015), (255.255.255.255, 2018), (192.168.0.255, 2015), (192.168.0.255, 2018), (172.17.255.255, 2015), (172.17.255.255, 2018), (172.26.255.255, 2015), (172.26.255.255, 2018), (169.254.255.255, 2015), (169.254.255.255, 2018)]
[2023-04-23T09:30:55Z TRACE neolink_core::bc_protocol::connection::discovery] Also sending to []
[2023-04-23T09:30:55Z TRACE mio::poll] registering event source with poller: token=Token(2), interests=READABLE | WRITABLE
[2023-04-23T09:30:55Z TRACE mio::poll] registering event source with poller: token=Token(3), interests=READABLE | WRITABLE
[2023-04-23T09:30:55Z TRACE neolink_core::bc_protocol::connection::discovery] client_id: 124363233
[2023-04-23T09:30:55Z TRACE neolink_core::bc_protocol::connection::discovery] client_id: 1764310492
[2023-04-23T09:30:55Z DEBUG neolink_core::bcudp::xml] Struct: start to parse "P2P"
[2023-04-23T09:30:55Z DEBUG yaserde::de] Fetched StartElement(P2P, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-04-23T09:30:55Z DEBUG neolink_core::bcudp::xml] Struct: start to parse "M2C_Q_R"
[2023-04-23T09:30:55Z DEBUG yaserde::de] Fetched StartElement(M2C_Q_R, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-04-23T09:30:55Z DEBUG neolink_core::bcudp::xml] Struct: start to parse "reg"
[2023-04-23T09:30:55Z DEBUG yaserde::de] Fetched StartElement(reg, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-04-23T09:30:55Z DEBUG yaserde::de] Fetched StartElement(ip, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-04-23T09:30:55Z DEBUG yaserde::de] Fetched Characters(20.xxx.xxx.191)
[2023-04-23T09:30:55Z DEBUG yaserde::de] Fetched EndElement(ip)
[2023-04-23T09:30:55Z DEBUG yaserde::de] Fetched StartElement(port, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-04-23T09:30:55Z DEBUG yaserde::de] Fetched Characters(58200)
[2023-04-23T09:30:55Z DEBUG yaserde::de] Fetched EndElement(port)
[2023-04-23T09:30:55Z DEBUG yaserde::de] Fetched EndElement(reg)
[2023-04-23T09:30:55Z DEBUG neolink_core::bcudp::xml] Struct: start to parse "relay"
[2023-04-23T09:30:55Z DEBUG yaserde::de] Fetched StartElement(relay, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-04-23T09:30:55Z DEBUG yaserde::de] Fetched StartElement(ip, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

Versions
NVR software:
Tried on Zoneminder, Shinobi and vlc
Neolink software:
Neolink fb4a23a release
Reolink camera model and firmware:
Reolink Argus PT v3.0.0.715_21112344

Camera work in 0.5.8 (high cpu usage after time). work randomly with v0.5.12 (or lower)

Hello.
I have setup 6 camera B800 (4K, H265 for main) and one RLC (5MP, H.264) with neolink and frigate.

Describe the bug
If i use the 0.5.8 version. All camera work fine on startup. The problem are, the cpu usage increase with the time (100% in 2-3day)

When i update to a more recent update (buffer update), my camera on frigate and VLC work randomly at starting (same iif i wait 10 min after starting neolink).
One time its "cuisine" camera work, when i restart no camera work, restart again, "jardin" camera work, and one time 1000, all camera work and show image in frigate or vlc.

To Reproduce
Steps to reproduce the behavior. Example:

  1. Create this configuration file:
[[cameras]]
name = "Entree"
username = "user"
password = ""
address = "192.168.X"
stream = "both"


[[cameras]]
name = "Salon" 
username = "user"
password = ""
address = "192.168.X
stream = "both"

[[cameras]]
name = "Cuisine" 
username = "user"
password = ""
address = "192.168.X"
stream = "both"

[[cameras]]
name = "Buanderie"
username = "user"
password = ""
address = "192.168.X"
stream = "both"

[[cameras]]
name = "Jardin"
username = "user"
password = ""
address = "192.168.X"
stream = "both"

[[cameras]]
name = "Piscine"
username = "user"
password = ""
address = "192.168.X"
stream = "both"
  1. Launch Neolink: with docker compose
  2. buffer ready:
[2023-05-26T20:25:10Z INFO  neolink::rtsp::states::loggedin] Entree: Camera reports firmware version v3.0.0.183_21012800
[2023-05-26T20:25:10Z INFO  neolink::rtsp::states::streaming] Entree: Starting video stream Main Stream (Clear)
[2023-05-26T20:25:10Z INFO  neolink::rtsp::states::streaming] Entree: Starting video stream Sub Stream (Fluent)
[2023-05-26T20:25:10Z INFO  neolink::rtsp::states::loggedin] Piscine: Camera reports firmware version v3.0.0.183_21012800
[2023-05-26T20:25:10Z INFO  neolink::rtsp::states::streaming] Piscine: Starting video stream Sub Stream (Fluent)
[2023-05-26T20:25:10Z INFO  neolink::rtsp::states::streaming] Piscine: Starting video stream Main Stream (Clear)
[2023-05-26T20:25:10Z INFO  neolink::rtsp::states::loggedin] Cuisine: Camera time is already set: 2023-05-26 22:25:11.0 -01:00:00
[2023-05-26T20:25:10Z INFO  neolink::rtsp::states::loggedin] Cuisine: Camera reports firmware version v3.0.0.183_21012800
[2023-05-26T20:25:10Z INFO  neolink::rtsp::states::streaming] Cuisine: Starting video stream Main Stream (Clear)
[2023-05-26T20:25:10Z INFO  neolink::rtsp::states::streaming] Cuisine: Starting video stream Sub Stream (Fluent)
[2023-05-26T20:25:10Z INFO  neolink::rtsp::states::loggedin] Salon: Camera time is already set: 2023-05-26 22:25:11.0 -01:00:00
[2023-05-26T20:25:10Z INFO  neolink::rtsp::states::loggedin] Buanderie: Camera reports firmware version v3.0.0.183_21012800
[2023-05-26T20:25:10Z INFO  neolink::rtsp::states::streaming] Buanderie: Starting video stream Main Stream (Clear)
[2023-05-26T20:25:10Z INFO  neolink::rtsp::states::streaming] Buanderie: Starting video stream Sub Stream (Fluent)
[2023-05-26T20:25:10Z INFO  neolink::rtsp::states::loggedin] Salon: Camera reports firmware version v3.0.0.183_21012800
[2023-05-26T20:25:10Z INFO  neolink::rtsp::states::streaming] Salon: Starting video stream Sub Stream (Fluent)
[2023-05-26T20:25:10Z INFO  neolink::rtsp::states::streaming] Salon: Starting video stream Main Stream (Clear)
[2023-05-26T20:25:10Z INFO  neolink::rtsp::states::loggedin] Jardin: Camera time is already set: 2023-05-26 22:25:11.0 -01:00:00
[2023-05-26T20:25:10Z INFO  neolink::rtsp::states::loggedin] Jardin: Camera reports firmware version v3.0.0.142_20121803
[2023-05-26T20:25:10Z INFO  neolink::rtsp::states::streaming] Jardin: Starting video stream Main Stream (Clear)
[2023-05-26T20:25:10Z INFO  neolink::rtsp::states::streaming] Jardin: Starting video stream Sub Stream (Fluent)
[2023-05-26T20:25:20Z INFO  neolink::rtsp] Cuisine: Buffers prepared
[2023-05-26T20:25:20Z INFO  neolink::rtsp] Piscine: Buffers prepared
[2023-05-26T20:25:20Z INFO  neolink::rtsp] Buanderie: Buffers prepared
[2023-05-26T20:25:20Z INFO  neolink::rtsp] Salon: Buffers prepared
[2023-05-26T20:25:20Z INFO  neolink::rtsp] Entree: Buffers prepared
[2023-05-26T20:25:20Z INFO  neolink::rtsp] Jardin: Buffers prepared
  1. Launch frigate: with docker compose
  2. no frame received
Capture dโ€™eฬcran 2023-05-26 aฬ€ 22 27 33
  1. logs frigate:
2023-05-26 22:26:23.119704428  [INFO] Starting Frigate...
2023-05-26 22:26:30.413070376  [2023-05-26 22:26:30] frigate.app                    INFO    : Starting Frigate (0.12.0-da3e197)
2023-05-26 22:26:30.491846516  [2023-05-26 22:26:30] peewee_migrate                 INFO    : Starting migrations
2023-05-26 22:26:30.515207452  [2023-05-26 22:26:30] peewee_migrate                 INFO    : There is nothing to migrate
2023-05-26 22:26:30.535435355  [2023-05-26 22:26:30] detector.coral                 INFO    : Starting detection process: 435
2023-05-26 22:26:30.536036075  [2023-05-26 22:26:30] frigate.app                    INFO    : Output process started: 437
2023-05-26 22:26:30.539774426  [2023-05-26 22:26:30] frigate.app                    INFO    : Camera processor started for Entree: 440
2023-05-26 22:26:30.542857234  [2023-05-26 22:26:30] frigate.app                    INFO    : Camera processor started for Salon: 442
2023-05-26 22:26:30.545865444  [2023-05-26 22:26:30] frigate.app                    INFO    : Camera processor started for Cuisine: 443
2023-05-26 22:26:30.549025282  [2023-05-26 22:26:30] frigate.app                    INFO    : Camera processor started for Buanderie: 444
2023-05-26 22:26:30.551962050  [2023-05-26 22:26:30] frigate.app                    INFO    : Camera processor started for Jardin: 445
2023-05-26 22:26:30.555082361  [2023-05-26 22:26:30] frigate.app                    INFO    : Camera processor started for Piscine: 446
2023-05-26 22:26:30.558137732  [2023-05-26 22:26:30] frigate.app                    INFO    : Capture process started for Entree: 447
2023-05-26 22:26:30.558341715  [2023-05-26 22:26:30] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb
2023-05-26 22:26:30.561435765  [2023-05-26 22:26:30] frigate.app                    INFO    : Capture process started for Salon: 453
2023-05-26 22:26:30.564415084  [2023-05-26 22:26:30] frigate.app                    INFO    : Capture process started for Cuisine: 455
2023-05-26 22:26:30.567664458  [2023-05-26 22:26:30] frigate.app                    INFO    : Capture process started for Buanderie: 459
2023-05-26 22:26:30.571083965  [2023-05-26 22:26:30] frigate.app                    INFO    : Capture process started for Jardin: 463
2023-05-26 22:26:30.577745897  [2023-05-26 22:26:30] frigate.app                    INFO    : Capture process started for Piscine: 468
2023-05-26 22:26:33.828220987  [2023-05-26 22:26:33] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found
2023-05-26 22:26:36.595482315  [2023-05-26 22:26:36] frigate.video                  ERROR   : Entree: Unable to read frames from ffmpeg process.
2023-05-26 22:26:36.595660857  [2023-05-26 22:26:36] frigate.video                  ERROR   : Entree: ffmpeg process is not running. exiting capture thread...
2023-05-26 22:26:36.595743148  [2023-05-26 22:26:36] frigate.video                  ERROR   : Cuisine: Unable to read frames from ffmpeg process.
2023-05-26 22:26:36.595817193  [2023-05-26 22:26:36] frigate.video                  ERROR   : Salon: Unable to read frames from ffmpeg process.
2023-05-26 22:26:36.595887479  [2023-05-26 22:26:36] frigate.video                  ERROR   : Cuisine: ffmpeg process is not running. exiting capture thread...
2023-05-26 22:26:36.595955069  [2023-05-26 22:26:36] frigate.video                  ERROR   : Salon: ffmpeg process is not running. exiting capture thread...
2023-05-26 22:26:36.596021256  [2023-05-26 22:26:36] frigate.video                  ERROR   : Piscine: Unable to read frames from ffmpeg process.
2023-05-26 22:26:36.596125500  [2023-05-26 22:26:36] frigate.video                  ERROR   : Piscine: ffmpeg process is not running. exiting capture thread...
2023-05-26 22:26:36.597196682  [2023-05-26 22:26:36] frigate.video                  ERROR   : Buanderie: Unable to read frames from ffmpeg process.
2023-05-26 22:26:36.597295559  [2023-05-26 22:26:36] frigate.video                  ERROR   : Buanderie: ffmpeg process is not running. exiting capture thread...
2023-05-26 22:26:36.597512344  [2023-05-26 22:26:36] frigate.video                  ERROR   : Jardin: Unable to read frames from ffmpeg process.
2023-05-26 22:26:36.597623097  [2023-05-26 22:26:36] frigate.video                  ERROR   : Jardin: ffmpeg process is not running. exiting capture thread...
2023-05-26 22:26:50.635684119  [2023-05-26 22:26:50] watchdog.Salon                 ERROR   : Ffmpeg process crashed unexpectedly for Salon.
2023-05-26 22:26:50.635796105  [2023-05-26 22:26:50] watchdog.Salon                 ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-05-26 22:26:50.635887587  [2023-05-26 22:26:50] ffmpeg.Salon.detect            ERROR   : rtsp://192.168.X/Salon/substream: Invalid data found when processing input
2023-05-26 22:26:50.639875830  [2023-05-26 22:26:50] watchdog.Jardin                ERROR   : Ffmpeg process crashed unexpectedly for Jardin.
2023-05-26 22:26:50.639998437  [2023-05-26 22:26:50] watchdog.Jardin                ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-05-26 22:26:50.640102296  [2023-05-26 22:26:50] ffmpeg.Jardin.detect           ERROR   : rtsp://192.168.X/Jardin/mainstream: Invalid data found when processing input
2023-05-26 22:26:50.641648687  [2023-05-26 22:26:50] watchdog.Cuisine               ERROR   : Ffmpeg process crashed unexpectedly for Cuisine.
2023-05-26 22:26:50.641790818  [2023-05-26 22:26:50] watchdog.Cuisine               ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-05-26 22:26:50.641928290  [2023-05-26 22:26:50] ffmpeg.Cuisine.detect          ERROR   : rtsp://192.168.X/Cuisine/substream: Invalid data found when processing input
2023-05-26 22:26:50.644343800  [2023-05-26 22:26:50] ffmpeg.Salon.record            ERROR   : rtsp://192.168.X/Salon/mainstream: Invalid data found when processing input
2023-05-26 22:26:50.644663288  [2023-05-26 22:26:50] watchdog.Salon                 INFO    : Terminating the existing ffmpeg process...
2023-05-26 22:26:50.644799267  [2023-05-26 22:26:50] watchdog.Salon                 INFO    : Waiting for ffmpeg to exit gracefully...
2023-05-26 22:26:50.646371861  [2023-05-26 22:26:50] watchdog.Entree                ERROR   : Ffmpeg process crashed unexpectedly for Entree.
2023-05-26 22:26:50.649682653  [2023-05-26 22:26:50] watchdog.Piscine               ERROR   : Ffmpeg process crashed unexpectedly for Piscine.
2023-05-26 22:26:50.649694277  [2023-05-26 22:26:50] watchdog.Buanderie             ERROR   : Ffmpeg process crashed unexpectedly for Buanderie.
2023-05-26 22:26:50.649700568  [2023-05-26 22:26:50] watchdog.Buanderie             ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.

The error lines after "TPU found" flood the log after that.

Expected behavior
supposed to show video

Versions
NVR software: i dont pass by the nvr
Neolink software: latest
Reolink camera model and firmware: latest

So i reapeat, when i use the 0.5.8, all work fine, exept the CPU overloading with the time.

Camera connection lost in mqtt command

Describe the bug
When running the mqtt command the first /control commands work just fine. After a few minutes in background additional /control commands either result in "Communication Error" or "Timeout":

Process log with RUST_LOG=DEBUG:

[2023-05-29T07:11:14Z DEBUG rumqttc::state] Pingreq,
                last incoming packet before 4992 millisecs,
                last outgoing request before 4999 millisecs
[2023-05-29T07:11:19Z DEBUG rumqttc::state] Pingreq,
                last incoming packet before 753 millisecs,
                last outgoing request before 5002 millisecs
[2023-05-29T07:11:22Z WARN  neolink::mqtt] Error: Failed to set camera status light on
    
    Caused by:
        0: Failed to recieve reply Timeout
        1: deadline has elapsed. Retrying
[2023-05-29T07:11:22Z INFO  neolink::mqtt::mqttc] Starting MQTT Client for camera
[2023-05-29T07:11:22Z INFO  neolink::mqtt::event_cam] camera: Connecting to camera at Address: <ip>
[2023-05-29T07:11:22Z INFO  neolink_core::bc_protocol] camera: Trying TCP discovery
[2023-05-29T07:11:22Z DEBUG rumqttc::state] Publish. Topic = neolink/camera/status, Pkid = 1, Payload Size = 12
[2023-05-29T07:11:22Z DEBUG rumqttc::state] Subscribe. Topics = [Filter = neolink/camera/#, Qos = AtMostOnce], Pkid = 2
[2023-05-29T07:11:22Z INFO  neolink_core::bc_protocol] camera: TCP Discovery success at <ip>
[2023-05-29T07:11:22Z INFO  neolink::mqtt::event_cam] camera: Logging in

To Reproduce
config file:

bind = "0.0.0.0"

[[cameras]]
name = "camera"
username = "<user>"
password = "<password>"
address = "<ip>:9000"
format = "h264"
  [cameras.mqtt]
  server = "<mqtt ip>"
  port = 1883

Run command

RUST_LOG=DEBUG ./neolink --config ./config.toml mqtt

Publish mqtt packet
neolink/camera/control/led with payload on -> works
neolink/camera/control/led with payload off -> works
Wait some time (most of the time around 1 minute)
neolink/camera/control/led with payload on -> results in error above, republishing the packet after the camera reconnected works again until I wait another minute or so.

It does not matter which command I use (IR LED, PTZ, ...) the behavior is always the same. Some time after connecting/logging in everything works as expected and at some point the connection to the camera seems to be interrupted without any additional information in the log.

Once the communication with the camera is interrupted motion events are also no longer published via mqtt.

Expected behavior
A stable connection to the camera without reconnecting

Versions
Neolink software: latest (master) / v0.5.12
Reolink camera model and firmware: E1 v3.0.0.400_21062500 (latest available firmware)

Add more control to pause feature

I'd suggest two new controls be added to the pause feature.

  1. A timer... so that a paused stream starts automatically again after a specified number of seconds. And then stops based on whatever criteria are set (ie, if no motion then after the timeout).
  2. To immediately stop on an Iframe... unless other activity blocks the stop (e.g. motion, a rtsp client steaming).

These controls would be optionally set in the config file.

With these neolink would be able to e.g. sleep for 10 minutes, start a stream, capture a single Iframe, and then pause until something triggers it again.

Thanks.

Error when streaming from Argus 3 pro [was using UID discovery], Deserialization error

My wired Reolink is working fine (RLC-520). However the Argus 3 Pro is not. I suspect it is to do with UID discovery as that is the only way to connect to this camera.

After streaming starts the debug log shows continuous start to parse "Extension" messages which within 15 seconds ends with an error. Before it errors out I am able to connect to the rstp stream with VLC, but it terminates shortly after the error.

Streaming from the camera seems to stop (tcpdump sees no traffic) but neolink is still doing something as CPU continues to run at 25% (4 core, so 100% on one core/thread?)

Monitoring tcpdump, I notice an incoming packet from 20.231.199.129 which is the relay server returned by Reolink. It appears that neolink is not expecting that because it expects traffic only from the camera's local IP address.

Here is tail end of the log.

[2023-02-24T01:50:39Z DEBUG neolink_core::bc::xml] Struct: start to parse "Extension"
[2023-02-24T01:50:39Z DEBUG yaserde::de] Fetched StartElement(Extension, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"}, [version -> 1.1])
[2023-02-24T01:50:39Z DEBUG yaserde::de] Fetched StartElement(checkPos, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-24T01:50:39Z DEBUG yaserde::de] Fetched Characters(0)
[2023-02-24T01:50:39Z DEBUG yaserde::de] Fetched EndElement(checkPos)
[2023-02-24T01:50:39Z DEBUG yaserde::de] Fetched StartElement(checkValue, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-24T01:50:39Z DEBUG yaserde::de] Fetched Characters(1667510576)
[2023-02-24T01:50:39Z DEBUG yaserde::de] Fetched EndElement(checkValue)
[2023-02-24T01:50:39Z DEBUG neolink_core::bc::xml] Struct: start to parse "Extension"
[2023-02-24T01:50:39Z DEBUG yaserde::de] Fetched StartElement(Extension, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"}, [version -> 1.1])
[2023-02-24T01:50:39Z DEBUG yaserde::de] Fetched StartElement(checkPos, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-24T01:50:39Z DEBUG yaserde::de] Fetched Characters(0)
[2023-02-24T01:50:39Z DEBUG yaserde::de] Fetched EndElement(checkPos)
[2023-02-24T01:50:39Z DEBUG yaserde::de] Fetched StartElement(checkValue, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-24T01:50:39Z DEBUG yaserde::de] Fetched Characters(1667510576)
[2023-02-24T01:50:39Z DEBUG yaserde::de] Fetched EndElement(checkValue)
[2023-02-24T01:50:40Z DEBUG neolink_core::bc::xml] Struct: start to parse "Extension"
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched StartElement(Extension, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"}, [version -> 1.1])
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched StartElement(checkPos, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched Characters(0)
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched EndElement(checkPos)
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched StartElement(checkValue, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched Characters(1667510576)
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched EndElement(checkValue)
[2023-02-24T01:50:40Z DEBUG neolink_core::bc::xml] Struct: start to parse "Extension"
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched StartElement(Extension, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"}, [version -> 1.1])
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched StartElement(checkPos, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched Characters(0)
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched EndElement(checkPos)
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched StartElement(checkValue, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched Characters(1651979568)
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched EndElement(checkValue)
[2023-02-24T01:50:40Z DEBUG neolink_core::bc::xml] Struct: start to parse "Extension"
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched StartElement(Extension, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"}, [version -> 1.1])
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched StartElement(checkPos, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched Characters(0)
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched EndElement(checkPos)
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched StartElement(checkValue, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched Characters(1651979568)
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched EndElement(checkValue)
[2023-02-24T01:50:40Z DEBUG neolink_core::bcudp::xml] Struct: start to parse "P2P"
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched StartElement(P2P, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-24T01:50:40Z DEBUG neolink_core::bcudp::xml] Struct: start to parse "D2C_DISC"
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched StartElement(D2C_DISC, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched StartElement(cid, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched Characters(-221156607)
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched EndElement(cid)
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched StartElement(did, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched Characters(432)
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched EndElement(did)
[2023-02-24T01:50:40Z DEBUG yaserde::de] Fetched EndElement(D2C_DISC)
[2023-02-24T01:50:40Z ERROR neolink_core::bc_protocol::connection::bcconn] Deserialization error: Io(Custom { kind: Other, error: CameraTerminate })
^C

And the tcpdump...

root@neolink:~# tcpdump -n -i eth0 host 192.168.21.38 or host 20.231.199.129
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
20:50:28.442523 IP 192.168.21.171.53961 > 20.231.199.129.58200: UDP, length 297
20:50:28.442523 IP 192.168.21.171.53571 > 20.231.199.129.58200: UDP, length 296
20:50:28.477575 IP 20.231.199.129.58200 > 192.168.21.171.53961: UDP, length 204
20:50:28.477663 IP 20.231.199.129.58200 > 192.168.21.171.53571: UDP, length 203
20:50:28.480283 IP 192.168.21.171.53571 > 192.168.21.38.43563: UDP, length 158
20:50:28.981678 IP 192.168.21.171.53571 > 192.168.21.38.43563: UDP, length 158
20:50:28.986979 IP 20.231.199.129.58200 > 192.168.21.171.53961: UDP, length 204
20:50:28.987302 IP 20.231.199.129.58200 > 192.168.21.171.53571: UDP, length 203
20:50:29.482878 IP 192.168.21.171.53571 > 192.168.21.38.43563: UDP, length 158
20:50:29.494597 IP 20.231.199.129.58200 > 192.168.21.171.53961: UDP, length 204
20:50:29.494787 IP 20.231.199.129.58200 > 192.168.21.171.53571: UDP, length 203
20:50:29.983991 IP 192.168.21.171.53571 > 192.168.21.38.43563: UDP, length 158
20:50:30.485206 IP 192.168.21.171.53571 > 192.168.21.38.43563: UDP, length 158
20:50:30.852897 IP 192.168.21.38.43563 > 192.168.21.171.53961: UDP, length 128
20:50:30.852928 IP 192.168.21.38.43563 > 192.168.21.171.53571: UDP, length 144
20:50:30.854628 IP 192.168.21.171.53961 > 192.168.21.38.43563: UDP, length 173
20:50:30.855857 IP 192.168.21.171.53571 > 20.231.199.129.58200: UDP, length 173
20:50:30.890895 IP 192.168.21.38.43563 > 192.168.21.171.53961: UDP, length 143
20:50:30.892861 IP 192.168.21.171.53961 > 20.231.199.129.58200: UDP, length 174
20:50:30.896164 IP 20.231.199.129.58200 > 192.168.21.171.53961: UDP, length 275
20:50:30.905783 IP 192.168.21.171.53571 > 20.231.199.129.58200: UDP, length 173
20:50:30.942981 IP 192.168.21.171.53961 > 20.231.199.129.58200: UDP, length 174
20:50:30.956164 IP 192.168.21.171.53571 > 20.231.199.129.58200: UDP, length 173
20:50:30.992432 IP 192.168.21.171.53961 > 20.231.199.129.58200: UDP, length 174
20:50:31.005636 IP 192.168.21.171.53571 > 20.231.199.129.58200: UDP, length 173
20:50:31.043028 IP 192.168.21.171.53961 > 20.231.199.129.58200: UDP, length 174
20:50:31.056284 IP 192.168.21.171.53571 > 20.231.199.129.58200: UDP, length 173
20:50:31.057486 IP 192.168.21.171.53571 > 192.168.21.38.43563: UDP, length 156
20:50:31.092786 IP 192.168.21.171.53961 > 20.231.199.129.58200: UDP, length 174
20:50:31.093999 IP 192.168.21.171.53961 > 192.168.21.38.43563: UDP, length 157
20:50:31.107433 IP 192.168.21.171.53571 > 192.168.21.38.43563: UDP, length 156
20:50:31.143701 IP 192.168.21.171.53961 > 192.168.21.38.43563: UDP, length 157
20:50:31.158009 IP 192.168.21.171.53571 > 192.168.21.38.43563: UDP, length 156
20:50:31.193417 IP 192.168.21.171.53961 > 192.168.21.38.43563: UDP, length 157
.
.
[deleted a whole lot of traffic]
.
.
20:50:40.458935 IP 192.168.21.38.43563 > 192.168.21.171.53571: UDP, length 1030
20:50:40.459357 IP 192.168.21.171.53571 > 192.168.21.38.43563: UDP, length 28
20:50:40.460005 IP 192.168.21.38.43563 > 192.168.21.171.53571: UDP, length 1030
20:50:40.460092 IP 192.168.21.38.43563 > 192.168.21.171.53571: UDP, length 1030
20:50:40.460092 IP 192.168.21.38.43563 > 192.168.21.171.53571: UDP, length 1030
20:50:40.461647 IP 192.168.21.38.43563 > 192.168.21.171.53571: UDP, length 616
20:50:40.461740 IP 192.168.21.38.43563 > 192.168.21.171.53571: UDP, length 28
20:50:40.470271 IP 192.168.21.171.53571 > 192.168.21.38.43563: UDP, length 28
20:50:40.476416 IP 192.168.21.38.43563 > 192.168.21.171.53571: UDP, length 28
20:50:40.479463 IP 192.168.21.171.53571 > 192.168.21.38.43563: UDP, length 28
20:50:40.489647 IP 192.168.21.171.53571 > 192.168.21.38.43563: UDP, length 28
20:50:40.499686 IP 192.168.21.171.53571 > 192.168.21.38.43563: UDP, length 28
20:50:40.509836 IP 192.168.21.38.43563 > 192.168.21.171.53571: UDP, length 28
20:50:40.509902 IP 192.168.21.171.53571 > 192.168.21.38.43563: UDP, length 28
20:50:40.513898 IP 192.168.21.38.43563 > 192.168.21.171.53571: UDP, length 93
20:50:40.521009 IP 192.168.21.38.43563 > 192.168.21.171.53571: UDP, length 28
20:50:40.563842 IP 20.231.199.129.58200 > 192.168.21.171.53571: UDP, length 72
20:50:41.023999 IP 20.231.199.129.58200 > 192.168.21.171.53961: UDP, length 72
20:50:41.024024 IP 192.168.21.171 > 20.231.199.129: ICMP 192.168.21.171 udp port 53961 unreachable, length 108
20:50:41.044879 IP 192.168.21.38.43563 > 192.168.21.171.53571: UDP, length 93

Error message in neolink coincides with receipt of the packet from 20.231.199.129

Streaming stops after ~60 seconds.

Installed Neolink into Ubuntu 22.04 and connected to Argus 3 Pro camera. It connects and starts streaming. However after a short period (looks to be consistently ~60 seconds) streaming stops and restarts. If VLC is connected at the time then it stops streaming, closes the connection and does not restart.

Console log...

root@neolink:~/neolink_linux_x86_64_ubuntu# ./neolink rtsp --config=neolink.toml
[2023-01-30T03:24:26Z INFO  neolink] Neolink 44675f25b41ece2acc2fb10f60f7395c59accc34 release
[2023-01-30T03:24:26Z WARN  neolink::rtsp::gst] Missing the gstreamer plugin `x264 (gst-plugins-ugly)` for `x264enc` element. Required to paused certain cameras
[2023-01-30T03:24:26Z WARN  neolink::rtsp::gst] Missing the gstreamer plugin `libav (gst-libav)` for `avdec_h264` element. Required to paused certain cameras
[2023-01-30T03:24:26Z WARN  neolink::rtsp::gst] Missing the gstreamer plugin `libav (gst-libav)` for `avdec_h265` element. Required to paused certain cameras
[2023-01-30T03:24:26Z INFO  neolink::rtsp] Starting RTSP Server at 0.0.0.0:8554
[2023-01-30T03:24:26Z INFO  neolink::rtsp::states] Driveway: Connecting to camera at UID: [redacted]
[2023-01-30T03:24:29Z INFO  neolink::rtsp::states] Driveway: Logging in
[2023-01-30T03:24:29Z INFO  neolink::rtsp::states] Driveway: Successfully logged in
[2023-01-30T03:24:30Z INFO  neolink::rtsp::states] Driveway: Camera time is already set: 2023-01-29 22:24:30 -5
[2023-01-30T03:24:30Z INFO  neolink::rtsp::states] Driveway: Camera reports firmware version v3.0.0.973_22051000
[2023-01-30T03:24:30Z INFO  neolink::rtsp::states] Driveway: Starting stream
[2023-01-30T03:24:30Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Main Stream (Clear)
[2023-01-30T03:24:30Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Extern Stream (Balanced)
[2023-01-30T03:24:30Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Sub Stream (Fluent)
[2023-01-30T03:24:30Z INFO  neolink::rtsp::states] Driveway: Successfully started streaming
[2023-01-30T03:25:30Z ERROR neolink_core::bc_protocol::connection::udpconn] Udp read poll aborted
[2023-01-30T03:25:30Z WARN  neolink::rtsp::states::streaming] During drop: Panicked while streaming
[2023-01-30T03:25:30Z WARN  neolink::rtsp::states::streaming] During drop: Panicked while streaming
[2023-01-30T03:25:30Z WARN  neolink::rtsp::states::streaming] During drop: Main did not stop cleanly: Media Deserialization error

    Caused by:
        Parsing error
[2023-01-30T03:25:30Z WARN  neolink::rtsp] Driveway: Retryable error: Camera has unexpectanely stopped the paused state
[2023-01-30T03:25:30Z INFO  neolink::rtsp::states] Driveway: Connecting to camera at UID: [redacted]
[2023-01-30T03:25:30Z ERROR neolink_core::bc_protocol::connection::udpconn] Udp write poll aborted
[2023-01-30T03:25:30Z INFO  neolink::rtsp::states] Driveway: Logging in
[2023-01-30T03:25:31Z INFO  neolink::rtsp::states] Driveway: Successfully logged in
[2023-01-30T03:25:31Z INFO  neolink::rtsp::states] Driveway: Camera time is already set: 2023-01-29 22:25:32 -5
[2023-01-30T03:25:32Z INFO  neolink::rtsp::states] Driveway: Camera reports firmware version v3.0.0.973_22051000
[2023-01-30T03:25:32Z INFO  neolink::rtsp::states] Driveway: Starting stream
[2023-01-30T03:25:32Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Sub Stream (Fluent)
[2023-01-30T03:25:32Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Main Stream (Clear)
[2023-01-30T03:25:32Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Extern Stream (Balanced)
[2023-01-30T03:25:32Z INFO  neolink::rtsp::states] Driveway: Successfully started streaming
[2023-01-30T03:26:27Z WARN  neolink::rtsp::states::streaming] During drop: Panicked while streaming
[2023-01-30T03:26:27Z WARN  neolink::rtsp::states::streaming] During drop: Panicked while streaming
[2023-01-30T03:26:27Z WARN  neolink::rtsp::states::streaming] During drop: Main did not stop cleanly: Media Deserialization error

    Caused by:
        Parsing error
[2023-01-30T03:26:27Z WARN  neolink::rtsp] Driveway: Retryable error: Camera has unexpectanely stopped the paused state
[2023-01-30T03:26:27Z INFO  neolink::rtsp::states] Driveway: Connecting to camera at UID: [redacted]
[2023-01-30T03:26:27Z ERROR neolink_core::bc_protocol::connection::udpconn] Udp write poll aborted
[2023-01-30T03:26:27Z ERROR neolink_core::bc_protocol::connection::udpconn] Udp read poll aborted
[2023-01-30T03:26:27Z INFO  neolink::rtsp::states] Driveway: Logging in
[2023-01-30T03:26:28Z INFO  neolink::rtsp::states] Driveway: Successfully logged in
[2023-01-30T03:26:28Z INFO  neolink::rtsp::states] Driveway: Camera time is already set: 2023-01-29 22:26:29 -5
[2023-01-30T03:26:29Z INFO  neolink::rtsp::states] Driveway: Camera reports firmware version v3.0.0.973_22051000
[2023-01-30T03:26:29Z INFO  neolink::rtsp::states] Driveway: Starting stream
[2023-01-30T03:26:29Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Extern Stream (Balanced)
[2023-01-30T03:26:29Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Main Stream (Clear)
[2023-01-30T03:26:29Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Sub Stream (Fluent)
[2023-01-30T03:26:29Z INFO  neolink::rtsp::states] Driveway: Successfully started streaming
[2023-01-30T03:27:29Z WARN  neolink::rtsp::states::streaming] During drop: Main did not stop cleanly: Media Deserialization error

    Caused by:
        Parsing error
[2023-01-30T03:27:29Z ERROR neolink_core::bc_protocol::connection::udpconn] Udp read poll aborted
[2023-01-30T03:27:29Z WARN  neolink::rtsp::states::streaming] During drop: Panicked while streaming
[2023-01-30T03:27:29Z WARN  neolink::rtsp::states::streaming] During drop: Panicked while streaming
[2023-01-30T03:27:29Z WARN  neolink::rtsp] Driveway: Retryable error: Camera has unexpectanely stopped the paused state
[2023-01-30T03:27:29Z INFO  neolink::rtsp::states] Driveway: Connecting to camera at UID: [redacted]
[2023-01-30T03:27:29Z ERROR neolink_core::bc_protocol::connection::udpconn] Udp write poll aborted
[2023-01-30T03:27:29Z INFO  neolink::rtsp::states] Driveway: Logging in
[2023-01-30T03:27:30Z INFO  neolink::rtsp::states] Driveway: Successfully logged in
[2023-01-30T03:27:30Z INFO  neolink::rtsp::states] Driveway: Camera time is already set: 2023-01-29 22:27:31 -5
[2023-01-30T03:27:31Z INFO  neolink::rtsp::states] Driveway: Camera reports firmware version v3.0.0.973_22051000
[2023-01-30T03:27:31Z INFO  neolink::rtsp::states] Driveway: Starting stream
[2023-01-30T03:27:31Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Sub Stream (Fluent)
[2023-01-30T03:27:31Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Extern Stream (Balanced)
[2023-01-30T03:27:31Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Main Stream (Clear)
[2023-01-30T03:27:31Z INFO  neolink::rtsp::states] Driveway: Successfully started streaming
[2023-01-30T03:28:32Z WARN  neolink::rtsp::states::streaming] During drop: Main did not stop cleanly: Media Deserialization error

    Caused by:
        Parsing error
[2023-01-30T03:28:32Z WARN  neolink::rtsp::states::streaming] During drop: Panicked while streaming
[2023-01-30T03:28:32Z WARN  neolink::rtsp::states::streaming] During drop: Panicked while streaming
[2023-01-30T03:28:32Z WARN  neolink::rtsp] Driveway: Retryable error: Camera has unexpectanely stopped the paused state
[2023-01-30T03:28:32Z INFO  neolink::rtsp::states] Driveway: Connecting to camera at UID: [redacted]
[2023-01-30T03:28:32Z ERROR neolink_core::bc_protocol::connection::udpconn] Udp read poll aborted
[2023-01-30T03:28:32Z ERROR neolink_core::bc_protocol::connection::udpconn] Udp write poll aborted
[2023-01-30T03:28:32Z INFO  neolink::rtsp::states] Driveway: Logging in
[2023-01-30T03:28:33Z INFO  neolink::rtsp::states] Driveway: Successfully logged in
[2023-01-30T03:28:33Z INFO  neolink::rtsp::states] Driveway: Camera time is already set: 2023-01-29 22:28:34 -5
[2023-01-30T03:28:34Z INFO  neolink::rtsp::states] Driveway: Camera reports firmware version v3.0.0.973_22051000
[2023-01-30T03:28:34Z INFO  neolink::rtsp::states] Driveway: Starting stream
[2023-01-30T03:28:34Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Sub Stream (Fluent)
[2023-01-30T03:28:34Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Extern Stream (Balanced)
[2023-01-30T03:28:34Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Main Stream (Clear)
[2023-01-30T03:28:34Z INFO  neolink::rtsp::states] Driveway: Successfully started streaming
[2023-01-30T03:29:37Z WARN  neolink::rtsp::states::streaming] During drop: Main did not stop cleanly: Media Deserialization error

    Caused by:
        Parsing error
[2023-01-30T03:29:37Z WARN  neolink::rtsp::states::streaming] During drop: Panicked while streaming
[2023-01-30T03:29:37Z WARN  neolink::rtsp::states::streaming] During drop: Panicked while streaming
[2023-01-30T03:29:37Z WARN  neolink::rtsp] Driveway: Retryable error: Camera has unexpectanely stopped the paused state
[2023-01-30T03:29:37Z ERROR neolink_core::bc_protocol::connection::udpconn] Udp read poll aborted
[2023-01-30T03:29:37Z INFO  neolink::rtsp::states] Driveway: Connecting to camera at UID: [redacted]
[2023-01-30T03:29:37Z ERROR neolink_core::bc_protocol::connection::udpconn] Udp write poll aborted
[2023-01-30T03:29:37Z INFO  neolink::rtsp::states] Driveway: Logging in
[2023-01-30T03:29:38Z INFO  neolink::rtsp::states] Driveway: Successfully logged in
[2023-01-30T03:29:38Z INFO  neolink::rtsp::states] Driveway: Camera time is already set: 2023-01-29 22:29:39 -5
[2023-01-30T03:29:39Z INFO  neolink::rtsp::states] Driveway: Camera reports firmware version v3.0.0.973_22051000
[2023-01-30T03:29:39Z INFO  neolink::rtsp::states] Driveway: Starting stream
[2023-01-30T03:29:39Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Sub Stream (Fluent)
[2023-01-30T03:29:39Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Main Stream (Clear)
[2023-01-30T03:29:39Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Extern Stream (Balanced)
[2023-01-30T03:29:39Z INFO  neolink::rtsp::states] Driveway: Successfully started streaming

Missing required gstreamer plugin `Unknown` for `textoverlay` element on Docker

Hi @QuantumEntangledAndy , I try to run the latest docker image by running this command:

docker run \
  -p 8554:8554 \
  --restart=on-failure \
  --volume=$PWD/config.toml:/etc/neolink.toml \
  quantumentangledandy/neolink

But I get the following error:

2023-04-13T14:02:11Z INFO  neolink::rtsp::states::loggedin] reolink_2: Camera reports firmware version v2.0.0.705_21052800
[2023-04-13T14:02:11Z INFO  neolink::rtsp::states::streaming] reolink_2: Starting video stream Main Stream (Clear)
[2023-04-13T14:02:16Z WARN  neolink::rtsp] reolink_1: Retryable error: reolink_1: Could not connect to camera
    
    Caused by:
        0: Failed to connect to camera reolink_1 at UID: 95270004UK0R1BGD on channel 0
        1: Cannot contact camera at given address
thread '<unnamed>' panicked at 'Could not build pipeline: Missing required gstreamer plugin `Unknown` for `textoverlay` element

Caused by:
    Failed to find element factory with name 'textoverlay' for creating element', src/rtsp/gst/factory.rs:157:51
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5
Aborted (core dumped)

Any help would be appreciated, thanks!

Docker | UDP | Argus2 | have tried everything

Tried all different docker versions like udp, udp_docker, udp_proto

docker-compose:
neolink:
container_name: neolink
image: quantumentangledandy/neolink:udp_proto
restart: unless-stopped
environment:
- PUID=${PUID}
- PGID=${PGID}
- TZ=${TZ}
volumes:
- ${USERDIR}/docker/neolink:/etc/
network_mode: host

Simple neolink.toml config:
bind = "0.0.0.0"
[[cameras]]
name = "Office"
username = "xxxx"
password = "xxxx"
uid = "xxxxxx"
channel_id = 0
stream = "both"

Get this error:
[2021-11-28T11:31:48Z ERROR neolink::rtsp] Error streaming from camera Office, will retry in 15s: Failed to connect to camera Office at UID: xxxxxx on channel 0

Caused by:
    0: Connection error
    1: Timeout

Change the port

Error: Failed to parse the "/etc/neolink.toml" config file
Caused by:
TOML parse error at line 2, column 14
|
2 | bind_port = "8551"
| ^^^^^^
invalid type: string "8551", expected u16

Expected to the original docs that the port will be changed

RTSP and MQTT Dual Mode

Is it possible to use the RTSP stream and the MQTT mesages at the same time? I am specifically using the plugin inside Home Assistant. It seems that I can run in RTSP mode and view the streams, or I can run in MQTT mode and view the motion events but not both at the same time.

Am I missing something or is there not a way to do both? I am really just looking to be able to detect Motion from these cameras. I have Neolink running in Home Assistant and I pass these cameras through to Scrypted where they then pass through to HomeKit. The only thing I have missing is the Motion Detection and potentially PTZ (but that isn't supported in HomeKit anyways). Is there a way to detect the motion natively without using MQTT or is there a way to send the MQTT messages AND get the RTSP stream running simultaneously?

Sorry If I am just misunderstanding something. Great work so far on all of this!

"stop" PTZ Command missing

To provide some background to my issue, PTZ control over MQTT was not working for me prior to the recent update to this repo involving updating MQTT to use tokio (I think?). However, after this update PTZ over MQTT seemed to be working somewhat reliably. However the camera seems to endlessly rotate no matter the speed. After some investigation with Wireshark and the Reolink desktop application, it seems that a 'stop' direction is sent when the user stops applying input to the PTZ commands.

To reproduce, I simply send a currently implemented PTZ command with MQTT, and the camera pans the expected way, although entirely to its limit unable to stop at a desired location.

Expected behavior should be that either the camera pans a specified amount before stopping, or a follow-up stop message should be sent by the user to cease the camera's motion.

Forgive me if I have missed something here, or I am using the software incorrectly in some way, as I've only just started to play around with Neolink within the past week or so. I may try and implement this myself over the weekend if no one has the time.

Cameras don't wake up from pause mode

Hi @QuantumEntangledAndy,

I have been experimenting a bit with neolink (0.5.0 / 0.5.1) and I've been successful to setup two cameras and view the stream using vlc.

Unfortunately, when I add the pause feature, the cameras never wake up to stream once neolink is started. It seems they are put into pause mode and never wake up again:

[2023-01-19T18:47:33Z INFO  neolink] Neolink 44675f25b41ece2acc2fb10f60f7395c59accc34 release
[2023-01-19T18:47:34Z WARN  neolink::rtsp::gst] Missing the gstreamer plugin `x264 (gst-plugins-ugly)` for `x264enc` element. Required to paused certain cameras
[2023-01-19T18:47:34Z WARN  neolink::rtsp::gst] Missing the gstreamer plugin `libav (gst-libav)` for `avdec_h264` element. Required to paused certain cameras
[2023-01-19T18:47:34Z WARN  neolink::rtsp::gst] Missing the gstreamer plugin `libav (gst-libav)` for `avdec_h265` element. Required to paused certain cameras
[2023-01-19T18:47:34Z INFO  neolink::rtsp] Starting RTSP Server at 0.0.0.0:8554
[2023-01-19T18:47:34Z INFO  neolink::rtsp::states] Garten: Connecting to camera at UID: 952700023NQHXKZI
[2023-01-19T18:47:34Z INFO  neolink::rtsp::states] Eingang: Connecting to camera at UID: 95270000ARITT6M5
[2023-01-19T18:47:36Z INFO  neolink::rtsp::states] Garten: Logging in
[2023-01-19T18:47:38Z INFO  neolink::rtsp::states] Garten: Successfully logged in
[2023-01-19T18:47:38Z INFO  neolink::rtsp::states] Eingang: Logging in
[2023-01-19T18:47:38Z INFO  neolink::rtsp::states] Garten: Camera time is already set: 2023-01-19 19:47:45 +1
[2023-01-19T18:47:39Z INFO  neolink::rtsp::states] Garten: Camera reports firmware version 1202_491_352_27
[2023-01-19T18:47:39Z INFO  neolink::rtsp::states] Garten: Starting stream
[2023-01-19T18:47:39Z INFO  neolink::rtsp::states::streaming] Garten: Starting video stream Main Stream (Clear)
[2023-01-19T18:47:39Z INFO  neolink::rtsp::states] Garten: Successfully started streaming
[2023-01-19T18:47:39Z WARN  neolink::rtsp] Not ready to pause
[2023-01-19T18:47:39Z INFO  neolink::rtsp::states] Eingang: Successfully logged in
[2023-01-19T18:47:39Z INFO  neolink::rtsp::states] Eingang: Camera time is already set: 2023-01-19 19:47:41 +1
[2023-01-19T18:47:39Z INFO  neolink::rtsp::states] Eingang: Camera reports firmware version 1221_246_237_22
[2023-01-19T18:47:39Z INFO  neolink::rtsp::states] Eingang: Starting stream
[2023-01-19T18:47:39Z INFO  neolink::rtsp::states::streaming] Eingang: Starting video stream Main Stream (Clear)
[2023-01-19T18:47:39Z INFO  neolink::rtsp::states] Eingang: Successfully started streaming
[2023-01-19T18:47:40Z INFO  neolink::rtsp] Pause on motion (start)
[2023-01-19T18:47:40Z INFO  neolink::rtsp::states] Garten: Pausing stream
[2023-01-19T18:47:40Z WARN  neolink::rtsp] Not ready to pause
[2023-01-19T18:47:40Z INFO  neolink::rtsp::states::paused] Garten: Starting paused stream Main Stream (Clear)
[2023-01-19T18:47:40Z INFO  neolink::rtsp::states] Garten: Successfully paused streaming
[2023-01-19T18:47:40Z INFO  neolink::rtsp] Pause on motion (start)
[2023-01-19T18:47:40Z INFO  neolink::rtsp::states] Eingang: Pausing stream
[2023-01-19T18:47:41Z INFO  neolink::rtsp::states::paused] Eingang: Starting paused stream Main Stream (Clear)
[2023-01-19T18:47:41Z INFO  neolink::rtsp::states] Eingang: Successfully paused streaming

As soon as I remove the [cameras.pause] sections in the config file, vlc connects again. Did I miss something?

Best regards,
Jochen

Windows problem? Failed to connect to camera, Timed out while waiting for camera reply

I have Argus 3 Pro.
If I use the Ubuntu package I have no problem while if I use Docker, neolink tries to connect via UDP but times out and does not connect.
I think it's the same problem this user had.

[2021-11-28T20:11:25Z INFO  neolink::rtsp] Office: Connecting to camera at UID: xxx

[2021-11-28T20:11:25Z INFO  neolink::rtsp] Office: Logging in

[2021-11-28T20:11:26Z INFO  neolink::rtsp] Office: Connecting to camera at UID: xxx

[2021-11-28T20:11:26Z INFO  neolink::rtsp] Office: Logging in

[2021-11-28T20:11:26Z INFO  neolink::rtsp] Office: Connected and logged in

[2021-11-28T20:11:26Z INFO  neolink::rtsp] Office: Connected and logged in

[2021-11-28T20:11:26Z INFO  neolink::rtsp] Office: Starting video stream Sub Stream (Fluent)

[2021-11-28T20:11:26Z INFO  neolink::rtsp] Office: Camera time is already set: 2021-11-28 21:11:25 +1

[2021-11-28T20:11:27Z INFO  neolink::rtsp] Office: Camera reports firmware version 1221_246_237_21

Originally posted by @Banditen01 in #11 (comment)

Waiting for Buffers

Describe the bug
Just updated to latest version (0.5.12). Log is now getting flooded with errors.
neolink::rtsp] passageway: Retryable error: passageway: Error while waiting for buffers Caused by: Dropped connection

This is the same across all 5 cameras I have.

To Reproduce
Steps to reproduce the behaviour. Example:

  1. Create this configuration file:
bind = "IP_ADDRESS"
bind_port = 554


[[cameras]]
name = "driveway"
username = "admin"
password = "SECURE_PASSWORD_HERE"
address = "IP_ADDRESS:9000"
channel_id = 0
stream = "mainStream"

[[cameras]]
name = "porch"
username = "admin"
password = "SECURE_PASSWORD_HERE"
address = "IP_ADDRESS:9000"
channel_id = 1
stream = "mainStream"

[[cameras]]
name = "side"
username = "admin"
password = "SECURE_PASSWORD_HERE"
address = "IP_ADDRESS:9000"
channel_id = 2
stream = "mainStream"

[[cameras]]
name = "passageway"
username = "admin"
password = "SECURE_PASSWORD_HERE"
address = "IP_ADDRESS:9000"
channel_id = 4
stream = "mainStream"

[[cameras]]
name = "backgarden"
username = "admin"
password = "SECURE_PASSWORD_HERE"
address = "IP_ADDRESS:9000"
channel_id = 6
stream = "mainStream"
  1. Launch Neolink:

Expected behavior
Cameras work as before, with no issues.

Versions
NVR software: blank
Neolink software: 0.5.12
Reolink camera model and firmware: H2MB14 config version v2.0.0.0

Lots of warnings in VLC client message log

rtsp stream contains lots of missing frames / delayed frames. This may be unavoidable and cause may be upstream (the camera) but wanted to log these in case something can be done in neolink.

The problem occurs on both my wired and wifi/battery cameras so it is not a poor wifi link causing the issue. But it looks to be worse with the wifi/battery one.

This is the VLC client message log (WiFi camera)...

main debug: Buffering 87%
main debug: Buffering 89%
main debug: Buffering 91%
main debug: Buffering 93%
main debug: Buffering 95%
main debug: Buffering 98%
main debug: Stream buffering done (1003 ms in 556 ms)
main debug: Decoder wait done in 0 ms
main warning: buffer too late (-265602 us): dropped
main warning: picture is too late to be displayed (missing 231 ms)
hevc info: Waiting for VPS/SPS/PPS
hevc info: Waiting for VPS/SPS/PPS
hevc info: Waiting for VPS/SPS/PPS
hevc info: Waiting for VPS/SPS/PPS
hevc info: Waiting for VPS/SPS/PPS
hevc info: Waiting for VPS/SPS/PPS
hevc info: Waiting for VPS/SPS/PPS
hevc info: Waiting for VPS/SPS/PPS
hevc info: Waiting for VPS/SPS/PPS
hevc info: Waiting for VPS/SPS/PPS
hevc info: Waiting for VPS/SPS/PPS
hevc info: Waiting for VPS/SPS/PPS
live555 debug: tk->rtpSource->hasBeenSynchronizedUsingRTCP()
main warning: playback way too early (-1292480): playing silence
main debug: inserting 20679 zeroes
main warning: playback too late (106646): up-sampling
main warning: playback way too late (227108): flushing buffers
main debug: picture might be displayed late (missing 5 ms)
main debug: picture might be displayed late (missing 9 ms)
main warning: playback way too early (-967435): playing silence
main debug: inserting 15478 zeroes
main warning: picture is too late to be displayed (missing 123 ms)
main debug: picture might be displayed late (missing 4 ms)
main warning: picture is too late to be displayed (missing 126 ms)
main debug: picture might be displayed late (missing 5 ms)
main debug: picture might be displayed late (missing 8 ms)
main warning: playback too early (-49662): down-sampling
main debug: picture might be displayed late (missing 3 ms)
main debug: picture might be displayed late (missing 3 ms)
main debug: picture might be displayed late (missing 5 ms)
main warning: picture is too late to be displayed (missing 95 ms)
main warning: timing screwed (drift: -114421 us): stopping resampling
main warning: playback too early (-114358): down-sampling
main debug: picture might be displayed late (missing 1 ms)
main debug: picture might be displayed late (missing 2 ms)
main debug: picture might be displayed late (missing 2 ms)
main warning: playback way too early (-798095): playing silence
main debug: inserting 12769 zeroes
main debug: picture might be displayed late (missing 3 ms)
main warning: playback too early (-59052): down-sampling
main debug: picture might be displayed late (missing 3 ms)
main debug: picture might be displayed late (missing 2 ms)
main debug: picture might be displayed late (missing 3 ms)
main warning: picture is too late to be displayed (missing 126 ms)
main debug: picture might be displayed late (missing 15 ms)
main debug: picture might be displayed late (missing 16 ms)
main debug: resampling stopped (drift: -6129 us)
main debug: picture might be displayed late (missing 1 ms)
main warning: playback too late (117605): up-sampling
main warning: playback way too late (204223): flushing buffers
main warning: picture is too late to be displayed (missing 49 ms)
main debug: picture might be displayed late (missing 1 ms)
main debug: picture might be displayed late (missing 3 ms)
main debug: picture might be displayed late (missing 5 ms)
auhal warning: underrun of 1368 bytes
main warning: playback way too early (-1037521): playing silence
main debug: inserting 16600 zeroes
main warning: picture is too late to be displayed (missing 76 ms)
main warning: playback way too early (-180094): playing silence
main debug: inserting 2881 zeroes
main debug: picture might be displayed late (missing 1 ms)
main warning: picture is too late to be displayed (missing 125 ms)
main warning: picture is too late to be displayed (missing 52 ms)
main warning: picture is too late to be displayed (missing 52 ms)
main debug: picture might be displayed late (missing 1 ms)
main warning: picture is too late to be displayed (missing 89 ms)
main warning: picture is too late to be displayed (missing 47 ms)
main warning: playback way too early (-442093): playing silence
main debug: inserting 7073 zeroes
main warning: playback way too late (183092): flushing buffers
main warning: buffer too late (-249193 us): dropped
main warning: buffer too late (-227525 us): dropped
main debug: inserting 16475 zeroes
auhal warning: underrun of 34800 bytes
main debug: picture might be displayed late (missing 1 ms)
main warning: picture is too late to be displayed (missing 1520 ms)
main warning: picture is too late to be displayed (missing 1343 ms)
main warning: picture is too late to be displayed (missing 1343 ms)
main warning: picture is too late to be displayed (missing 1231 ms)
main warning: picture is too late to be displayed (missing 1231 ms)
main warning: picture is too late to be displayed (missing 1231 ms)
main warning: picture is too late to be displayed (missing 1008 ms)
main warning: picture is too late to be displayed (missing 1160 ms)
main warning: picture is too late to be displayed (missing 1072 ms)
main warning: picture is too late to be displayed (missing 1072 ms)
main warning: picture is too late to be displayed (missing 923 ms)
main warning: picture is too late to be displayed (missing 1055 ms)
main warning: picture is too late to be displayed (missing 965 ms)
main warning: picture is too late to be displayed (missing 965 ms)
main warning: picture is too late to be displayed (missing 877 ms)
main warning: picture is too late to be displayed (missing 877 ms)
main warning: picture is too late to be displayed (missing 877 ms)
main warning: playback way too early (-225562): playing silence
main debug: inserting 3608 zeroes
main warning: playback too early (-66758): down-sampling
main debug: picture might be displayed late (missing 3 ms)
main debug: resampling stopped (drift: -8586 us)
main debug: picture might be displayed late (missing 2 ms)
main warning: playback too late (103140): up-sampling
main warning: playback way too late (204102): flushing buffers
main debug: picture might be displayed late (missing 1 ms)
main warning: playback way too early (-1071679): playing silence
main debug: inserting 17146 zeroes
auhal warning: underrun of 60896 bytes
main debug: picture might be displayed late (missing 1 ms)
main warning: picture is too late to be displayed (missing 60 ms)
main debug: picture might be displayed late (missing 1 ms)
main warning: playback way too early (-173749): playing silence
main debug: inserting 2779 zeroes
main warning: picture is too late to be displayed (missing 113 ms)
main warning: picture is too late to be displayed (missing 35 ms)
main warning: picture is too late to be displayed (missing 35 ms)
main debug: picture might be displayed late (missing 1 ms)
main warning: playback too early (-59570): down-sampling
main debug: picture might be displayed late (missing 1 ms)
main debug: picture might be displayed late (missing 3 ms)
main warning: playback way too early (-123937): playing silence
main debug: inserting 1982 zeroes
main warning: playback way too late (272481): flushing buffers
main warning: playback way too early (-686199): playing silence
main debug: inserting 10979 zeroes
auhal warning: underrun of 62912 bytes
main warning: playback way too early (-1505773): playing silence
main debug: inserting 24092 zeroes
main warning: playback way too late (637184): flushing buffers
main debug: picture might be displayed late (missing 1 ms)
main debug: picture might be displayed late (missing 1 ms)
main warning: picture is too late to be displayed (missing 48 ms)
main debug: picture might be displayed late (missing 3 ms)
main debug: picture might be displayed late (missing 1 ms)
main warning: picture is too late to be displayed (missing 227 ms)
main warning: picture is too late to be displayed (missing 128 ms)
main warning: picture is too late to be displayed (missing 127 ms)
main warning: picture is too late to be displayed (missing 24 ms)
main warning: picture is too late to be displayed (missing 151 ms)
main warning: picture is too late to be displayed (missing 22 ms)
main warning: picture is too late to be displayed (missing 22 ms)
main warning: playback too late (143966): up-sampling
main warning: playback way too late (202111): flushing buffers
main debug: picture might be displayed late (missing 1 ms)
main debug: picture might be displayed late (missing 4 ms)

Just a bug applause

Installed original Neolink today.
Everything worked.
Upgraded the camera software.
After that go a g_object_new is_valid property: property 'name' for type 'GstRtpL16Pay' cannot be set twice error
Switched to your fork.

Everything works as a charms. Thanks for maintaining this!

MQTT issues

Describe the bug
I am trying to use neolink with MQTT but I am getting different errors and commands are basically not working.

To Reproduce
This first error is random (it seems to be thread related) ... it happens sometimes when booting the application.
Steps:

  1. Run application with multiple cameras with MQTT enabled - neolink mqtt -c neolink.toml
C:/Users/jlcar/.cargo/bin/cargo.exe run --color=always --package neolink --bin neolink -- mqtt -c neolink.toml
    Finished dev [unoptimized + debuginfo] target(s) in 0.19s
warning: the following packages contain code that will be rejected by a future version of Rust: nom v6.1.2, winapi v0.2.8
note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 297`
     Running `target\debug\neolink.exe mqtt -c neolink.toml`
[2023-04-05T18:18:10Z INFO  neolink] Neolink 0.5.6 debug
[2023-04-05T18:18:10Z INFO  neolink::mqtt] Terraza: Setting up mqtt
[2023-04-05T18:18:10Z INFO  neolink::mqtt] Lavadero: Setting up mqtt
[2023-04-05T18:18:10Z INFO  neolink::mqtt] Piscina: Setting up mqtt
[2023-04-05T18:18:10Z INFO  neolink::mqtt::mqttc] Terraza: Starting listening to mqtt
[2023-04-05T18:18:10Z INFO  neolink::mqtt::mqttc] Piscina: Starting listening to mqtt
[2023-04-05T18:18:10Z INFO  neolink::mqtt::mqttc] Lavadero: Starting listening to mqtt
[2023-04-05T18:18:10Z INFO  neolink::mqtt::mqttc] Starting MQTT Client for Terraza
[2023-04-05T18:18:10Z INFO  neolink::mqtt::mqttc] Starting MQTT Client for Piscina
[2023-04-05T18:18:10Z INFO  neolink::mqtt::event_cam] Piscina: Connecting to camera at UID: XXXXXXXXXXXXXXX
[2023-04-05T18:18:10Z INFO  neolink::mqtt::mqttc] Starting MQTT Client for Lavadero
thread 'tokio-runtime-worker' panicked at 'Cannot start a runtime from within a runtime. This happens because a function (like `block_on`) attempted to block the current thread while the thread is being used to drive asynchronous tasks.', [2023-04-05T18:18:10Z INFO  neolink::mqtt::event_cam] Lavadero: Connecting to camera at UID: XXXXXXXXXXXXXXX
C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\rumqttc-0.8.0\src\client.rs:344[2023-04-05T18:18:10Z INFO  neolink::mqtt::event_cam] Terraza: Connecting to camera at UID: XXXXXXXXXXXXXXX
:28
stack backtrace:
   0: rust_begin_unwind
             at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library\std\src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library\core\src/panicking.rs:64:14
   2: tokio::runtime::context::enter_runtime
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\context.rs:183:9
   3: tokio::runtime::scheduler::current_thread::CurrentThread::block_on
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\scheduler\current_thread.rs:146:25
   4: tokio::runtime::runtime::Runtime::block_on
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\runtime.rs:302:47
   5: <rumqttc::client::Iter as core::iter::traits::iterator::Iterator>::next
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\rumqttc-0.8.0\src\client.rs:344:15
   6: <core::iter::adapters::enumerate::Enumerate<I> as core::iter::traits::iterator::Iterator>::next
             at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0\library\core\src\iter\adapters/enumerate.rs:46:17
   7: neolink::mqtt::mqttc::Mqtt::start
             at .\src\mqtt\mqttc.rs:215:39
   8: neolink::mqtt::listen_on_camera::{{closure}}::{{closure}}
             at .\src\mqtt\mod.rs:131:17
   9: tokio::runtime::task::core::Core<T,S>::poll::{{closure}}
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\core.rs:223:17
  10: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\loom\std\unsafe_cell.rs:14:9
  11: tokio::runtime::task::core::Core<T,S>::poll
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\core.rs:212:13
  12: tokio::runtime::task::harness::poll_future::{{closure}}
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\harness.rs:476:19
  13: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0\library\core\src\panic/unwind_safe.rs:271:9
  14: std::panicking::try::do_call
             at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0\library\std\src/panicking.rs:483:40
  15: __rust_try
  16: std::panicking::try
             at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0\library\std\src/panicking.rs:447:19
  17: std::panic::catch_unwind
             at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0\library\std\src/panic.rs:140:14
  18: tokio::runtime::task::harness::poll_future
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\harness.rs:464:18
  19: tokio::runtime::task::harness::Harness<T,S>::poll_inner
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\harness.rs:198:27
  20: tokio::runtime::task::harness::Harness<T,S>::poll
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\harness.rs:152:15
  21: tokio::runtime::task::raw::poll
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\raw.rs:255:5
  22: tokio::runtime::task::raw::RawTask::poll
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\raw.rs:200:18
  23: tokio::runtime::task::LocalNotified<S>::run
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\mod.rs:394:9
  24: tokio::runtime::scheduler::multi_thread::worker::Context::run_task::{{closure}}
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\scheduler\multi_thread\worker.rs:464:13
  25: tokio::runtime::coop::with_budget
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\coop.rs:107:5
  26: tokio::runtime::coop::budget
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\coop.rs:73:5
  27: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\scheduler\multi_thread\worker.rs:463:9
  28: tokio::runtime::scheduler::multi_thread::worker::Context::run
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\scheduler\multi_thread\worker.rs:433:24
  29: tokio::runtime::scheduler::multi_thread::worker::run::{{closure}}
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\scheduler\multi_thread\worker.rs:406:17
  30: tokio::macros::scoped_tls::ScopedKey<T>::set
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\macros\scoped_tls.rs:61:9
  31: tokio::runtime::scheduler::multi_thread::worker::run
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\scheduler\multi_thread\worker.rs:403:5
  32: tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{{closure}}
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\scheduler\multi_thread\worker.rs:365:45
  33: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\blocking\task.rs:42:21
  34: tokio::runtime::task::core::Core<T,S>::poll::{{closure}}
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\core.rs:223:17
  35: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\loom\std\unsafe_cell.rs:14:9
  36: tokio::runtime::task::core::Core<T,S>::poll
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\core.rs:212:13
  37: tokio::runtime::task::harness::poll_future::{{closure}}
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\harness.rs:476:19
  38: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0\library\core\src\panic/unwind_safe.rs:271:9
  39: std::panicking::try::do_call
             at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0\library\std\src/panicking.rs:483:40
  40: __rust_try
  41: std::panicking::try
             at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0\library\std\src/panicking.rs:447:19
  42: std::panic::catch_unwind
             at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0\library\std\src/panic.rs:140:14
  43: tokio::runtime::task::harness::poll_future
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\harness.rs:464:18
  44: tokio::runtime::task::harness::Harness<T,S>::poll_inner
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\harness.rs:198:27
  45: tokio::runtime::task::harness::Harness<T,S>::poll
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\harness.rs:152:15
  46: tokio::runtime::task::raw::poll
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\raw.rs:255:5
  47: tokio::runtime::task::raw::RawTask::poll
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\raw.rs:200:18
  48: tokio::runtime::task::UnownedTask<S>::run
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\task\mod.rs:431:9
  49: tokio::runtime::blocking::pool::Task::run
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\blocking\pool.rs:159:9
  50: tokio::runtime::blocking::pool::Inner::run
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\blocking\pool.rs:513:17
  51: tokio::runtime::blocking::pool::Spawner::spawn_thread::{{closure}}
             at C:\Users\jlcar\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.27.0\src\runtime\blocking\pool.rs:471:13
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', src\mqtt\mqttc.rs:211:53
stack backtrace:
   0: rust_begin_unwind
             at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library\std\src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library\core\src/panicking.rs:64:14
   2: core::result::unwrap_failed
             at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library\core\src/result.rs:1790:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0\library\core\src/result.rs:1112:23
   4: neolink::mqtt::mqttc::Mqtt::start
             at .\src\mqtt\mqttc.rs:211:30
   5: neolink::mqtt::mqttc::Mqtt::new::{{closure}}
             at .\src\mqtt\mqttc.rs:116:21
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[2023-04-05T18:18:13Z INFO  neolink_core::bc_protocol] Local discovery success XXXXXXXXXXXXXXX at 192.168.2.34:21280
[2023-04-05T18:18:13Z INFO  neolink::mqtt::event_cam] Piscina: Logging in
[2023-04-05T18:18:13Z INFO  neolink_core::bc_protocol] Local discovery success XXXXXXXXXXXXXXX at 192.168.2.31:18069
[2023-04-05T18:18:13Z INFO  neolink::mqtt::event_cam] Lavadero: Logging in
[2023-04-05T18:18:13Z INFO  neolink::mqtt::event_cam] Piscina: Connected and logged in
[2023-04-05T18:18:13Z INFO  neolink::mqtt::event_cam] Piscina: Listening to Camera Motion
[2023-04-05T18:18:13Z INFO  neolink::mqtt::event_cam] Piscina: Setting up camera actions
[2023-04-05T18:18:13Z INFO  neolink::mqtt::event_cam] Lavadero: Connected and logged in
[2023-04-05T18:18:13Z INFO  neolink::mqtt::event_cam] Lavadero: Listening to Camera Motion
[2023-04-05T18:18:13Z INFO  neolink::mqtt::event_cam] Lavadero: Setting up camera actions
[2023-04-05T18:18:14Z INFO  neolink_core::bc_protocol] Local discovery success XXXXXXXXXXXXXXX at 192.168.2.33:18158
[2023-04-05T18:18:14Z INFO  neolink::mqtt::event_cam] Terraza: Logging in
[2023-04-05T18:18:15Z INFO  neolink::mqtt::event_cam] Terraza: Connected and logged in
[2023-04-05T18:18:15Z INFO  neolink::mqtt::event_cam] Terraza: Listening to Camera Motion
[2023-04-05T18:18:15Z INFO  neolink::mqtt::event_cam] Terraza: Setting up camera actions

Also, MQTT commands are not working for me.
If application starts successfully when issuing a command looks like it's failing here:

"Err(anyhow!("Failed to send camera data over crossbeam"))" on function send_message_with_reply

Expected behavior
Application should start consistently and not fail randomly.

Versions
NVR software: None
Neolink software: master branch version
Reolink camera model and firmware: Argus 3 Pro last firmware

neolink 4.0 - Heavy memory leak

Setup: Docker container
Version: thirtythreeforty/neolink:latest@sha256:aa7a19c16b17f6c878e450ce64032422ff35ccb01e12057b332a8957b5b536c8

Camera: Reolink E1 Pro
Firmware version: 3.0.0.716_21112404

Config:

bind = "0.0.0.0"
 
[[cameras]]
name = "tapas_hall"
username = "admin"
password = "PASS"
address = "192.168.1.216:9000"
stream = "both"

Logs:

[2023-04-12T17:40:10Z INFO  neolink::rtsp] tapas_hall: Camera time is already set: 2023-04-12 19:40:11 +1
[2023-04-12T17:40:11Z INFO  neolink::rtsp] tapas_hall: Camera reports firmware version v3.0.0.716_21112404
[2023-04-12T17:40:11Z INFO  neolink::rtsp] tapas_hall: Starting video stream Main Stream (Clear)
(neolink:7): GLib-GObject-CRITICAL **: 17:40:31.615: g_object_new_is_valid_property: property 'name' for type 'GstRtpL16Pay' cannot be set twice
Segmentation fault (core dumped)
[2023-04-12T17:41:51Z INFO  neolink] Neolink 0.4.0 (unknown commit) release
[2023-04-12T17:41:51Z INFO  neolink::rtsp] tapas_hall: Connecting to camera at Address: 192.168.1.216:9000
[2023-04-12T17:41:51Z INFO  neolink::rtsp] tapas_hall: Logging in
[2023-04-12T17:41:51Z INFO  neolink::rtsp] tapas_hall: Connecting to camera at Address: 192.168.1.216:9000
[2023-04-12T17:41:51Z INFO  neolink::rtsp] tapas_hall: Logging in
[2023-04-12T17:41:51Z INFO  neolink::rtsp] tapas_hall: Connected and logged in
[2023-04-12T17:41:51Z INFO  neolink::rtsp] tapas_hall: Connected and logged in
[2023-04-12T17:41:51Z INFO  neolink::rtsp] tapas_hall: Starting video stream Sub Stream (Fluent)
[2023-04-12T17:41:51Z INFO  neolink::rtsp] tapas_hall: Camera time is already set: 2023-04-12 19:41:52 +1
[2023-04-12T17:41:52Z INFO  neolink::rtsp] tapas_hall: Camera reports firmware version v3.0.0.716_21112404
[2023-04-12T17:41:52Z INFO  neolink::rtsp] tapas_hall: Starting video stream Main Stream (Clear)
(neolink:7): GLib-GObject-CRITICAL **: 17:42:11.628: g_object_new_is_valid_property: property 'name' for type 'GstRtpL16Pay' cannot be set twice
(neolink:7): GLib-GObject-CRITICAL **: 19:56:23.796: g_object_new_is_valid_property: property 'name' for type 'GstRtpL16Pay' cannot be set twice
(neolink:7): GLib-GObject-CRITICAL **: 19:57:15.501: g_object_new_is_valid_property: property 'name' for type 'GstRtpL16Pay' cannot be set twice

image

Container reached 1.5GB in more or less 4hours of execution.

I will try with RUST_LOG trace to see if there are interesting logs to be shared.

Thanks,
anthonws.

Are these errors normal in Frigate? And how is camera battery getting depleted?

Are these errors from Frigate expected? I got the idea that you implemented fake frames to be presented by neolink, so that when the camera stream was paused, clients connected to it would not have issues and the stream would show the last captured frame (hopefully I haven't understood it incorrectly).

2023-05-19 21:11:39.909072933  [2023-05-19 21:11:39] watchdog.tapas_balcony         INFO    : No frames received from tapas_balcony in 20 seconds. Exiting ffmpeg...
2023-05-19 21:11:39.909372421  [2023-05-19 21:11:39] watchdog.tapas_balcony         INFO    : Waiting for ffmpeg to exit gracefully...
2023-05-19 21:11:41.032179980  21:11:41.031 WRN github.com/AlexxIT/go2rtc/internal/streams/producer.go:159 > error="read tcp 172.18.0.2:42462->192.168.1.10:8889: i/o timeout" url=rtsp://192.168.1.10:8889/tapas_balcony
2023-05-19 21:11:42.908109026  [2023-05-19 21:11:42] frigate.video                  ERROR   : tapas_balcony: Unable to read frames from ffmpeg process.
2023-05-19 21:11:42.908116357  [2023-05-19 21:11:42] frigate.video                  ERROR   : tapas_balcony: Unable to read frames from ffmpeg process.
2023-05-19 21:11:42.922360692  [2023-05-19 21:11:42] frigate.video                  ERROR   : tapas_balcony: Unable to read frames from ffmpeg process.
2023-05-19 21:11:42.922368023  [2023-05-19 21:11:42] frigate.video                  ERROR   : tapas_balcony: ffmpeg process is not running. exiting capture thread...
2023-05-19 21:11:45.510840994  [2023-05-19 21:11:45] frigate.record                 ERROR   : Error occurred when attempting to maintain recording cache
2023-05-19 21:11:45.511621542  [2023-05-19 21:11:45] frigate.record                 ERROR   : list index out of range
2023-05-19 21:11:50.414896782  [2023-05-19 21:11:50] frigate.record                 ERROR   : Error occurred when attempting to maintain recording cache
2023-05-19 21:11:50.414904211  [2023-05-19 21:11:50] frigate.record                 ERROR   : list index out of range
2023-05-19 21:11:52.918571035  [2023-05-19 21:11:52] watchdog.tapas_balcony         ERROR   : Ffmpeg process crashed unexpectedly for tapas_balcony.
2023-05-19 21:11:52.918578224  [2023-05-19 21:11:52] watchdog.tapas_balcony         ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-05-19 21:11:52.918580537  [2023-05-19 21:11:52] ffmpeg.tapas_balcony.detect    ERROR   : [rtsp @ 0x5636b28ba100] RTP: PT=60: bad cseq 637b expected=336f

Also, given the configuration for my battery camera, if no detection is triggered, the camera stream is paused. But the camera battery gotten to very low values (< 10%).
What should be the optimal configuration for both camera and neolink?

'''
bind = "0.0.0.0"
bind_port = 8889

[[cameras]]
name = "tapas_balcony"
username = "MYUSER"
password = "MYPASS"
uid = "MYUID"
stream = "subStream"
[cameras.pause]
on_motion = true
on_client = true
mode = "none"
timeout = 2.1
'''

For the camera config, I have activated, via the Android app, PIR with low sensitivity.

I have checked push notifications as a debug mechanism to see if the camera would be triggering motion events, but it hasn't, which is why I am finding it odd that the battery depleted almost completely (in a full sunny environment).

Cheers,
anthonws.

EDIT:

FYI, as a test, I've updated Frigate's go2RTC version to 15.0. But nothing changed.

https://github.com/AlexxIT/go2rtc/releases/tag/v1.5.0

Saving a stream from Argus Eco

Hi,

is there a way, when a PIR detection is detected, to get the video file from the internal SD in order to save it outside the camera?

Thanks

Fabio

Errors when streaming from Argus Eco

Describe the bug
Stream works in VLC on another PC on the LAN. However, it will not work with Frigate and also get errors using FFPROBE. FFPROBE confirms GSTREAMER is loading and producing data, but it is not ingesting any video stream it would appear.

To Reproduce
Steps to reproduce the behavior.
CONFIG:
bind = "192.168.27.114"

[[cameras]]
name = "homesite"
username = "admin"
password = "10champs11"
address = "192.168.27.105"
uid = "95270000WZMJ0ZRY"
format = "h264"
[cameras.pause]
on_motion = true # Should pause when no motion
on_client = true # Should pause when no rtsp client
timeout = 2.1 # How long to wait after motion stops before pausing

Expected behavior
Stream should be readable from Frigate and not produce errors from FFPROBE.

Versions
NVR software: Frigate 0.12.0
Neolink software: 0.5.8
Reolink camera model and firmware: Argus Eco 1202_491_352_19

NEOLINK Debug: https://pastebin.com/zy2iSBtC

FFPROBE Output: https://pastebin.com/AzS1pGFC

starting MQTT with docker image

after adjusting some parameters for the docker file to be ok, i searched how to launch MQTT connexion

It looks like MQTT connexion is a specific extra execution of neolink, and that docker image includes a harcoded execution of neolink for RTSP only.

Would it be possible to launch MQTT at the same time than RTSP with docker ? isn't it possible inside the same execution of neolink ?

Failed to connect to the camera [Reolink GO]

Describe the bug
When I try to save an image/turn off the PIR sensor/anything, it will always fail on error Error: Failed to connect to the camera, check credentials and network.

To Reproduce

  1. Configuration file:
bind = "0.0.0.0"

[[cameras]]
name = "driveway"
username = "admin"
password = "my_password"
uid = "my_camera_uid"
discovery = "remote"
  1. Launch Neolink: neolink --config sample_config.toml image --file-path C:\temp driveway
  2. I tried all the discovery options local, remote, map, relay
  3. I tried to turn off the firewall, different ISP provider, no success

Result

[2023-05-03T20:40:56Z INFO  neolink] Neolink 42ff221b0735bf55fbf9ba2508329ef1fdb540e9 release
[2023-05-03T20:40:56Z INFO  neolink::utils] driveway: Connecting to camera at UID: my_camera_uid
Error: Failed to connect to the camera, check credentials and network

Caused by:
    0: Failed to connect to camera driveway at UID: my_camera_uid on channel 0
    1: Cannot contact camera at given address

Expected behavior
It would connect to the camera and take an image/turn off the PIR/any other action.

Versions
NVR software: n/a
Neolink software: Neolink 0.5.8, windows 10
Reolink camera model and firmware: Reolink GO, v1.0.213.00

Remove the .DS_Store file

One of your push's yesterday created a .DS_Store file (generated by apple Mac) which because I also use a Mac is updated by me and so git thinks I have modified a file under version control, so I cannot switch branches without deleting it first. Can you delete them please. You might want to also add these files to your .gitignore_global file to avoid this in future.

Edited to add... or the .gitignore in this repository.
Thanks.

Reoling E1 PRO mqtt/ptz not working

Describe the bug
I used your amazing SW to control my Reolink E1 PRO.
The camera reacts to the first command using MQTT, then stops responding.
Any movement using ptz results in maximum turn, no matter what number I use in the message.
E.g.
mosquitto_pub -h mqttserver -t "neolink/camera1/control/ptz" -m "Right 2"
starts to turn the camera and rotates to max right, then stops.
Further commands (e.g. rotate to left) result in no movement at all. I have to stop the neolink and start it again to again react to command

To Reproduce
Steps to reproduce the behavior. Example:

  1. Create this configuration file: - standard config for E1 PRO and MQTT server
  2. Launch Neolink: ./neolink -c neolink.toml mqtt
  3. send message as in the example above
  4. observe the camera

Expected behavior
The camera will rotate a bit to the right, then stop and listen to next command.

Actual behavior
Camera rotates to max right position and stops listening to MQTT commands.

Versions
NVR software: n/a
Neolink software: 42ff221 release
Reolink camera model and firmware: E1 PRO v3.1.0.1414_22101301

Keep track of camera battery status, log INFO and WARN on low power.

The camera is regularly sending battery status info...

[2023-02-28T03:02:54Z DEBUG neolink_core::bc::xml] Struct: start to parse "body"
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched StartElement(body, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched StartElement(BatteryList, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"}, [version -> 1.1])
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched StartElement(BatteryInfo, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched StartElement(channelId, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched Characters(0)
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched EndElement(channelId)
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched StartElement(chargeStatus, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched Characters(none)
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched EndElement(chargeStatus)
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched StartElement(adapterStatus, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched Characters(adapter)
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched EndElement(adapterStatus)
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched StartElement(voltage, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched Characters(4069)
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched EndElement(voltage)
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched StartElement(current, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched Characters(0)
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched EndElement(current)
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched StartElement(temperature, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched Characters(-3)
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched EndElement(temperature)
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched StartElement(batteryPercent, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched Characters(90)
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched EndElement(batteryPercent)
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched StartElement(lowPower, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched Characters(0)
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched EndElement(lowPower)
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched StartElement(batteryVersion, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched Characters(2)
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched EndElement(batteryVersion)
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched EndElement(BatteryInfo)
[2023-02-28T03:02:54Z DEBUG yaserde::de] Fetched EndElement(BatteryList)
[2023-02-28T03:02:54Z DEBUG neolink_core::bc_protocol::connection::bcconn] Ignoring uninteresting message id 252 (number: 0)

Neolink should catch these and keep track of status. On startup it could print an INFO message. On low battery level can print a WARN message.

I made a start on this and added structs to xml.rs, but stopped work when I realized that I did not know how to catch the '252' messages.
1e7ee1d

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.