Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reolink argus 3 ultra stays awake #300

Open
apocaliss92 opened this issue Sep 24, 2024 · 8 comments
Open

Reolink argus 3 ultra stays awake #300

apocaliss92 opened this issue Sep 24, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@apocaliss92
Copy link

Describe the bug
The connection with a reolink 3 ultra does not go in idle, it keeps the camera awake even though no rtsp interaction is happening
In the log I can see a regular spamming of these messages

[2024-09-24T15:20:54Z DEBUG neolink::common::neocam] baby_monitor: InUse
[2024-09-24T15:20:55Z DEBUG neolink_core::bc_protocol::connection::bcconn] Ignoring uninteresting message id 252 (number: 0)
[2024-09-24T15:20:55Z DEBUG neolink::common::neocam] baby_monitor: Idle

To Reproduce
Configuration used

bind = "0.0.0.0"

[[cameras]]
name = "camera"
username = "xxxxx"
password = "xxxxxx"
uid = "xxxxxx"
address = "xxxxxx"
idle_disconnect = true

[cameras.pause]
on_client = true # Should pause when no rtsp client
timeout = 2.1 # How long to wait after motion stops before pausing

Expected behavior
A clear and concise description of what you expected to happen.

Versions
Neolink software: 0.6.2
Reolink camera model and firmware: Reolink argus 3 ultra Hardware BIPC_560MIX16M35C10G8MP Firmware v3.0.0.3492_24052209

@apocaliss92 apocaliss92 added the bug Something isn't working label Sep 24, 2024
@apocaliss92
Copy link
Author

I also tried out the rc2, no more spamming of messages but rtsp seems not working, I'm getting this log on a consumer (Scrypted)

[WebRTC Plugin]: signalingState have-remote-offer
[WebRTC Plugin]: signalingState stable
[WebRTC Plugin]: iceGatheringState gathering
[WebRTC Plugin]: waiting ice connected
[WebRTC Plugin]: iceConnectionState completed
[WebRTC Plugin]: iceGatheringState complete
[WebRTC Plugin]: connectionState connecting
[WebRTC Plugin]: iceConnectionState checking
[WebRTC Plugin]: iceConnectionState connected
[WebRTC Plugin]: connectionState connected
[WebRTC Plugin]: Connection is local network: true 192.168.1.122 {
[WebRTC Plugin]: ipv4: true,
[WebRTC Plugin]: type: 'prflx',
[WebRTC Plugin]: isLocalNetwork: true,
[WebRTC Plugin]: destinationId: '192.168.1.122'
[WebRTC Plugin]: }
[WebRTC Plugin]: done waiting ice connected
[WebRTC Plugin]: Connection is local network: true 192.168.1.122 {
[WebRTC Plugin]: ipv4: true,
[WebRTC Plugin]: type: 'prflx',
[WebRTC Plugin]: isLocalNetwork: true,
[WebRTC Plugin]: destinationId: '192.168.1.122'
[WebRTC Plugin]: }
[Rebroadcast Plugin]: Stream 1 prebuffer session started
stream url rtsp://192.168.20.10:8554/baby_monitor/main
[Rebroadcast Plugin]: rtsp outgoing message
[Rebroadcast Plugin]: OPTIONS rtsp://192.168.20.10:8554/baby_monitor/main RTSP/1.0
[Rebroadcast Plugin]: CSeq: 0
[Rebroadcast Plugin]: User-Agent: Scrypted
[Rebroadcast Plugin]:
[Rebroadcast Plugin]: rtsp incoming message
[Rebroadcast Plugin]: RTSP/1.0 200 OK
[Rebroadcast Plugin]: CSeq: 0
[Rebroadcast Plugin]: Public: OPTIONS, DESCRIBE, ANNOUNCE, GET_PARAMETER, PAUSE, PLAY, RECORD, SETUP, SET_PARAMETER, TEARDOWN
[Rebroadcast Plugin]: Server: GStreamer RTSP server
[Rebroadcast Plugin]: Date: Tue, 24 Sep 2024 18:00:21 GMT
[Rebroadcast Plugin]:
[Rebroadcast Plugin]: rtsp outgoing message
[Rebroadcast Plugin]: DESCRIBE rtsp://192.168.20.10:8554/baby_monitor/main RTSP/1.0
[Rebroadcast Plugin]: Accept: application/sdp
[Rebroadcast Plugin]: CSeq: 1
[Rebroadcast Plugin]: User-Agent: Scrypted
[Rebroadcast Plugin]:
[Rebroadcast Plugin]: rtsp outgoing message
[Rebroadcast Plugin]: TEARDOWN rtsp://192.168.20.10:8554/baby_monitor/main RTSP/1.0
[Rebroadcast Plugin]: CSeq: 2
[Rebroadcast Plugin]: User-Agent: Scrypted
[Rebroadcast Plugin]:
[Rebroadcast Plugin]: Stream 1 prebuffer session ended with error r [Error]: Operation Timed Out
[Rebroadcast Plugin]: at Timeout.eval [as _onTimeout] (/@scrypted/prebuffer-mixin/main.nodejs.js:1:40558)
[Rebroadcast Plugin]: at listOnTimeout (node:internal/timers:581:17)
[Rebroadcast Plugin]: at process.processTimers (node:internal/timers:519:7) {
[Rebroadcast Plugin]: promise: Promise { }
[Rebroadcast Plugin]: }
[WebRTC Plugin]: Error starting playback for WebRTC track. RPCResultError: Operation Timed Out
[WebRTC Plugin]: at Timeout.eval [as _onTimeout] (/@scrypted/prebuffer-mixin/main.nodejs.js:1:40558)
[WebRTC Plugin]: at listOnTimeout (node:internal/timers:581:17)
[WebRTC Plugin]: at process.processTimers (node:internal/timers:519:7)
[WebRTC Plugin]: thread:main
[WebRTC Plugin]: @scrypted/prebuffer-mixin:host
[WebRTC Plugin]: host:@scrypted/nvr
[WebRTC Plugin]: @scrypted/nvr:host
[WebRTC Plugin]: host:@scrypted/nvr
[WebRTC Plugin]: @scrypted/nvr:host
[WebRTC Plugin]: host:@scrypted/webrtc {
[WebRTC Plugin]: cause: undefined
[WebRTC Plugin]: }
[WebRTC Plugin]: signalingState closed
[WebRTC Plugin]: connectionState closed
[WebRTC Plugin]: iceConnectionState closed

What could be the reason of not going through? Seems ending in timeout, same happens on vlc

@QuantumEntangledAndy
Copy link
Owner

QuantumEntangledAndy commented Sep 25, 2024

You have the client scrypted connected all the time right?

What usually happens is something like this,

  • connect to neolink
  • neolink wakes up camera
  • neolink feeds frames until motion stop
  • neolink stops on motion, no longer sending frames
  • client (vlc, scypted, frigate, ha, etc) sees not frames attempts a reconnect
  • reconnect is treated like a new connection attempt and neolink wakes the camera
  • this makes the battery drain

I've only found ffmpeg to work properly with the pause as it will wait indefinitely for the frames to resume without killing it

Some clients particular vlc are demanding too with strict timeout after the initial describe request, which can be troublesome as it can take over a minute to wake a camera and get sufficient frames

There's no easy solution for these with compromising being taken. Currently neolink takes the path of least resources to help it run on low end machines where we just stop sending frames. However there are other avenues of explored such as sending dummy frames etc but this often makes the clients like vlc complain a lot and still disconnect once it realises the frames are empty. Perhaps the most robust solution would be a full decode and re-encode while using gstreamers still frame plugin to add a hold frame but this will be a lot of resources particularly for full 4k vid with multiple cameras.

@apocaliss92
Copy link
Author

Thank you for the detailed response! With the latest release it actually works quiet well, besides battery drain that can be tackeld just stopping the server when there are no listeners anymore, which I could make it work somehow
But why would't it connect at all with the rc2? New rtsp libraries? Because actually it works beautifully with scrypted with the previous version

Besides this, if I was a bit experienced with video protocols, I would try to make a scrypted plugin out of this repo, this would work very well with the tools scrypted provides, rebroadcast etc..., it would fit nicely!

@QuantumEntangledAndy
Copy link
Owner

Really am not sure, it seems whenever I fix it for one client another one stops working, you can try this build is you want it tries to do things differently to address lag issues

@apocaliss92
Copy link
Author

if it's the latest, tried it already, anyways thanks a lot for the quick and exhaustive response, I will just stick with the latest stable one and work on the disconnections by myself

@QuantumEntangledAndy
Copy link
Owner

QuantumEntangledAndy commented Sep 25, 2024

It's the tip of master not the latest release from the side bar it should report a version of 0.6.3-rc.3

@apocaliss92
Copy link
Author

Got it, so the docker image would be quantumentangledandy/neolink:v0.6.3.rc.3 right? I will try it right away

@QuantumEntangledAndy
Copy link
Owner

Version tags are only made when there is a release, it will be named after it's branch quantumentangledandy/neolink:master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants