QuantumEntangledAndy / neolink

An RTSP bridge to Reolink IP cameras
GNU Affero General Public License v3.0
250 stars 41 forks source link

Failed to setup RTSP session with version 0.6x (Users aren't created) #154

Closed JC38 closed 9 months ago

JC38 commented 9 months ago

Describe the bug I was looking at the [[mqtt]] bug so I didn't see that my go2rtc client was failing to connect. This problem appeared with version 0.60

To Reproduce Steps to reproduce the behavior.

  1. Get a working toml file with version < 0.60. Passwords are set for users to connect to neolink and for neolink to connect to cameras.
  2. Upgrade to 0.60
  3. Got black screen with go2rtc
  4. Testing the connection with VLC gives this Votre média d'entrée ne peut être ouvert: VLC ne peut pas ouvrir « rtsp://MyUser:MyPassword@192.168.0.48:8554/E1-Abri ». Vérifier les messages du journal pour plus de détails. And if you ask VLC to display the messages live555 error: Failed to connect with rtsp://192.168.0.48:8554/E1-Abri satip error: Failed to setup RTSP session

Putting back the files from version 0.5.18 and testing the same url with VLC gives the video and sound as expected

QuantumEntangledAndy commented 9 months ago

Do you have a log? Do you get the "Available at" message?

JC38 commented 9 months ago

Here are some details (from the console). Is there any log elsewhere ? Below, the 2 outputs I got (0.6.00 and 0.6.10) `Version 0.6.00


root@Debian12:/home/jc/neolink# ./neolink rtsp --config=neolink.toml [2023-09-24T18:18:18Z INFO neolink] Neolink e5008abe5611f9f28475f904ea79f01b22f15d26 release [2023-09-24T18:18:18Z WARN neolink::rtsp] Without a server certificate, usernames and passwords will be exchanged in plaintext! [2023-09-24T18:18:18Z INFO neolink::rtsp] E1-Bureau: Rtsp Staring [2023-09-24T18:18:18Z INFO neolink::rtsp] Starting RTSP Server at 0.0.0.0:8554 [2023-09-24T18:18:18Z INFO neolink::rtsp] E1-Abri: Rtsp Staring [2023-09-24T18:18:18Z INFO neolink::utils] E1-Abri: Connecting to camera at Address: 192.168.0.6:9000 [2023-09-24T18:18:18Z INFO neolink::utils] E1-Bureau: Connecting to camera at Address: 192.168.0.11:9000 [2023-09-24T18:18:18Z INFO neolink_core::bc_protocol] E1-Bureau: Trying TCP discovery [2023-09-24T18:18:18Z INFO neolink_core::bc_protocol] E1-Abri: Trying TCP discovery [2023-09-24T18:18:18Z INFO neolink_core::bc_protocol] E1-Bureau: TCP Discovery success at 192.168.0.11:9000 [2023-09-24T18:18:18Z INFO neolink_core::bc_protocol] E1-Abri: TCP Discovery success at 192.168.0.6:9000 [2023-09-24T18:18:18Z INFO neolink::utils] E1-Bureau: Logging in [2023-09-24T18:18:18Z INFO neolink::utils] E1-Abri: Logging in [2023-09-24T18:18:18Z INFO neolink::utils] E1-Abri: Connected and logged in [2023-09-24T18:18:18Z INFO neolink::utils] E1-Bureau: Connected and logged in [2023-09-24T18:18:18Z INFO neolink::common::camthread] E1-Abri: Camera time is already set: 2023-09-24 20:18:17.0 -01:00:00 [2023-09-24T18:18:18Z INFO neolink::common::camthread] E1-Bureau: Camera time is already set: 2023-09-24 20:18:18.0 -01:00:00 [2023-09-24T18:18:18Z INFO neolink::common::neocam] E1-Bureau: Model E1 Pro [2023-09-24T18:18:18Z INFO neolink::common::neocam] E1-Bureau: Firmware Version v3.0.0.716_21112404 [2023-09-24T18:18:18Z INFO neolink::common::neocam] E1-Abri: Model E1 Pro [2023-09-24T18:18:18Z INFO neolink::common::neocam] E1-Abri: Firmware Version v3.0.0.716_21112404 [2023-09-24T18:18:18Z INFO neolink::rtsp] E1-Bureau: Avaliable at ["/E1-Bureau/main", "/E1-Bureau/Main", "/E1-Bureau/mainStream", "/E1-Bureau/MainStream", "/E1-Bureau/Mainstream", "/E1-Bureau/mainstream", "/E1-Bureau"]

Version 0.6.10


root@Debian12:/home/jc/neolink# ./neolink rtsp --config=neolink.toml [2023-09-24T18:21:13Z INFO neolink] Neolink 0f91c06d0bc914c3c9cbc9a52078746810d2307b release [2023-09-24T18:21:13Z INFO neolink::rtsp] E1-Bureau: Rtsp Staring [2023-09-24T18:21:13Z INFO neolink::rtsp] E1-Abri: Rtsp Staring [2023-09-24T18:21:13Z WARN neolink::rtsp] Without a server certificate, usernames and passwords will be exchanged in plaintext! [2023-09-24T18:21:13Z INFO neolink::rtsp] Starting RTSP Server at 0.0.0.0:8554 [2023-09-24T18:21:13Z INFO neolink::utils] E1-Abri: Connecting to camera at Address: 192.168.0.6:9000 [2023-09-24T18:21:13Z INFO neolink_core::bc_protocol] E1-Abri: Trying TCP discovery [2023-09-24T18:21:13Z INFO neolink::utils] E1-Bureau: Connecting to camera at Address: 192.168.0.11:9000 [2023-09-24T18:21:13Z INFO neolink_core::bc_protocol] E1-Bureau: Trying TCP discovery [2023-09-24T18:21:13Z INFO neolink_core::bc_protocol] E1-Abri: TCP Discovery success at 192.168.0.6:9000 [2023-09-24T18:21:13Z INFO neolink_core::bc_protocol] E1-Bureau: TCP Discovery success at 192.168.0.11:9000 [2023-09-24T18:21:13Z INFO neolink::utils] E1-Abri: Logging in [2023-09-24T18:21:13Z INFO neolink::utils] E1-Bureau: Logging in [2023-09-24T18:21:13Z INFO neolink::utils] E1-Abri: Connected and logged in [2023-09-24T18:21:13Z INFO neolink::common::camthread] E1-Abri: Camera time is already set: 2023-09-24 20:21:13.0 -01:00:00 [2023-09-24T18:21:13Z INFO neolink::utils] E1-Bureau: Connected and logged in [2023-09-24T18:21:13Z INFO neolink::common::camthread] E1-Bureau: Camera time is already set: 2023-09-24 20:21:14.0 -01:00:00 [2023-09-24T18:21:13Z INFO neolink::common::neocam] E1-Bureau: Model E1 Pro [2023-09-24T18:21:13Z INFO neolink::common::neocam] E1-Bureau: Firmware Version v3.0.0.716_21112404 [2023-09-24T18:21:13Z INFO neolink::common::neocam] E1-Abri: Model E1 Pro [2023-09-24T18:21:13Z INFO neolink::common::neocam] E1-Abri: Firmware Version v3.0.0.716_21112404 [2023-09-24T18:21:13Z INFO neolink::rtsp] E1-Bureau: Avaliable at /E1-Bureau/main, /E1-Bureau/Main, /E1-Bureau/mainStream, /E1-Bureau/MainStream, /E1-Bureau/Mainstream, /E1-Bureau/mainstream, /E1-Bureau [2023-09-24T18:21:13Z INFO neolink::rtsp] E1-Abri: Avaliable at /E1-Abri/main, /E1-Abri/Main, /E1-Abri/mainStream, /E1-Abri/MainStream, /E1-Abri/Mainstream, /E1-Abri/mainstream, /E1-Abri

`

QuantumEntangledAndy commented 9 months ago

Are you trying to open the stream before the "Available at" message?

JC38 commented 9 months ago

Go2rtc is always running, so maybe it tries to connect. But this is not something new, it worked like this since I am using Neolink. Anyway, it doesn't matter when using version < 0.6x

QuantumEntangledAndy commented 9 months ago

Right but what I want to know, is does it eventually connect fine after the available message?

JC38 commented 9 months ago

I tried again but stopping go2trc before starting neolink. I don't think it changed anything. However, using the same rtsp url from vlc prompt for a password with 0.6x version and not from the previous. So, I am thinking about an authentication problem btw the client and Neolink into your code for version 0.6x (did you change some rules into the toml for the [[users]] section (as you did for mqtt from [[mqtt]] to [mqtt])

QuantumEntangledAndy commented 9 months ago

Didn't change anything in the toml for that but I did change the way users are loaded since I made it possible to adjust the users mid stream from mqtt.

Does it work ok without setting users?

QuantumEntangledAndy commented 9 months ago

Ah found a bug in the user creation fix is in this build

JC38 commented 9 months ago

Ok, I made useless test as you found a bug before I saw your previous post. Even if [[users]] section is removed, VLC is requesting a user/pwd :-( (all versions) I am waiting the x86_64 build. Is it available? And when I look to this build file sizes, they are huge., is it normal ?

QuantumEntangledAndy commented 9 months ago

It looks like the builds are there when I try

Also I switched the allocator to jemalloc (to help trace memory leak) perhaps bundling the jemalloc library into it is causing the file size to bump up

QuantumEntangledAndy commented 9 months ago

The difference is 26.3 MB to 34.1 MB so I think thats about right for bundling the allocator. Before it used the system allocator so it didn't need to bundle it

JC38 commented 9 months ago

This is ok with the build named release-amd64-bullseye.

QuantumEntangledAndy commented 9 months ago

Ok I am releasing under 0.6.2 then and closing this. Let me know if you get anything else wrong