thirtythreeforty / neolink

An RTSP bridge to Reolink IP cameras
https://www.thirtythreeforty.net/posts/2020/05/hacking-reolink-cameras-for-fun-and-profit/
GNU Affero General Public License v3.0
886 stars 146 forks source link

Trying to connect the Neolink RTSP stream with Home Assistant Frigate (running on VM) #265

Open Yashaa02 opened 2 years ago

Yashaa02 commented 2 years ago

Describe the bug Currently running the neolink setup on my local pc via windows using gstreamer (used the instructions provided). Was able to get a RTSP stream playing on VLC from the Reolink Argus 3 Pro battery powered cameras via these links [rtsp://127.0.0.1:8554/Camera/subStream] [rtsp://192.168.56.1:8554/Camera/subStream]

I'm trying to connect this RTSP link to Home Assistant I'm running on a Oracle Virtual Box (haos_ova-7.4.vdi) on my pc (same one running Neolink). However, I'm getting an error where Home Assistant - Frigate Addon is not able to read the RTSP stream.

Thank you in advance for your help!
` Versions NVR software: Frigate NVR through Home Assistant

Neolink software: Neolink 23a4790b8dfb54c33234ccc31344de32234c9432 release neolink 0.4.0

Reolink camera model and firmware: Reolink Argus 3 Pro v3.0.0.307_21051100

QuantumEntangledAndy commented 2 years ago

Not much to go on with that info. What configuration did you use for HA to connect to the neolink? The generic camera? The ffmpeg one? On more in depth logs from HA? Really this seems like something you should ask in the HA forums

Yashaa02 commented 2 years ago

I'm a little new to this type of setup. Slowly learning about home automation and security.

The configuration to neolink from the camera was: config.toml < bind = "0.0.0.0"

[[cameras]] name = "Camera" username = "admin" password = "PW" uid = "UID" stream = "both"

We tried using both link streams generated by neolink within frigate.
[rtsp://127.0.0.1:8554/Camera/subStream] (local ip address provided by neolink) [rtsp://192.168.56.1:8554/Camera/subStream] (ip address from the VirtualBox Host-only Network)

Both links worked when we tested it on VLC on the same pc.

Frigate code (frigate.yml) in HA <mqtt: host: 192.168.1.117 port: 1883 user: mqtt-user password: PW cameras: OfficeCamera: ffmpeg: inputs:

I have been reaching out in the HA forums and in Frigate forums as well. Just wanted to make sure I was setting up neolink correctly.

I was trying to figure out how I can pass the RTSP stream from my local PC through the firewall to the VM to Home Assistant (in the neolink page, there was some mention about opening firewall ports if neolink is setup on a different server/pc).

Any help would be appreciated!

QuantumEntangledAndy commented 2 years ago

Perhaps you can help me understand the topology of the network:

Windows: host Virtual machine (on host): neolink Virtual machine (on host, host only network): HA and frigate

Is that right?

P.s. Why use HA and frigate on a virtualbox rather than docker?

Yashaa02 commented 2 years ago

Yes of course, the current layout of the setup is:

PC running windows - has neolink installed connected to the Reolink Argus 3 pro Camera to generate an RTSP stream

PC running Oracle VirtualBox to run Home Assistant (using Hass Addon vdi) (Bridged Adapter network setting). Frigate is installed as an addon within Home Assitant.

Current Network Map

Hopefully this makes sense!

QuantumEntangledAndy commented 2 years ago

Yes I think I get the topology. The best place to look for answers would the the frigate logs to see what it says if coming from the ffmpeg command.

We should also do some manual tests. Open a terminal in the frigate vm (not the host) and run something like this:

ffprobe rtsp://192.168.56.1:8554

It should report the video and audio format (h264/5 and pcm). If not check that the virtual machine is on the right subnet (run ip addr on the vm and confirm that there is a 192.168.56.x address listed other than 56.1). If there is nothing wrong here check your windows firewall and ensure that port 8554 is open.

Yashaa02 commented 2 years ago

How would I be able to do manual tests like opening a terminal when I'm running VM on hassio interface? I wasn't able to open a terminal in the Frigate VM to run "ffprobe"

I was able to get the network info to see if the network is on the same network: image

This the local network info from the PC: image

Thank you again for all the help!

QuantumEntangledAndy commented 2 years ago

Running a terminal in the virtual machine all depends on what the guest OS is.

I noticed that your vm has an interface and a docker.

Is your setup

Win Host->VM Linux->Docker HA

If so I am thinking that perhaps the VM Linux has a connection to the host but not the internal docker.

Might I ask if you followed some sort of tutorial on getting your HA up and running? If I can see it then it might explain a few things to me.

QuantumEntangledAndy commented 2 years ago

Perhaps on the HA you can look into getting the web terminal plugin installed and you can debug on that

https://community.home-assistant.io/t/home-assistant-community-add-on-ssh-web-terminal/33820

Yashaa02 commented 2 years ago

https://www.youtube.com/watch?v=sVqyDtEjudk

This is the link I used for the installation of Home Assistant on the Virtual Machine.

I was able to get the sub stream loaded on to Home Assistant on MotionEye, and Frigate, but there is a huge lag in the stream itself.