-
Notifications
You must be signed in to change notification settings - Fork 6
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
Cant find IP address when running in docker #3
Comments
Hello, Same error
I even ran Docker running on a Debian 12 vm. Any idea what the problem is? |
I have been debugging (more like learning) the code on what its trying to do on an Ubuntu machine I setup just for all this to run natively as node from source. I think its saying IP not found in this instance on the vlan mac because it cant connect to the camera. If you try and follow the connect to docker instance and try and run the node I am looking at the source code and that method does
My camera is not onvif.. so I am confused why its trying to connec to to an onvif endpoint. Trying to query that via postman has no results.. |
So the problem with IP Address not found is something to do with Node not returning the VLAN
While debugging code It does not seem like the VLAN state is UP so its not coming back. |
OK ! We forgot to run the critical command
Now it is showing in the get interfaces :D But I only get IPv6 address no IPv4 |
Hello P10tyr ! Have you configured your dhcp server to give an IP to this Mac address ? |
In your Unifi Network, Settings, Network, your network, DHCP mode is DHCP Server ? If yes : Clients Devices, in top right icon to add a client, and there you can add a lease for a Mac address. |
Same problem now.... |
I removed and added it back to Unify the way you said. But it is not showing up any where in the list now. I cant see the MAC. When I try to add it.. it says the MAC already exists... |
Client devices, Offline : here you can normally see the leases. |
In the docker host or machine where is set the macvlan : dhclient onvif-proxy-1 I'm stuck there. |
The default config file as high and low quality feeds |
Thats the settings i have i think the snap shot one needs to have ISAPI in it.. but this server does not support it yet anyway |
dhclient is used to retrieve the ip address from the dhcp server |
You're luckier than me ! |
Yea there is something not quite correct in docker. Maybe you need to create virtual interfaces using docker networks instead? And I understand now. Each feed is like a separate camera. ill just make 1 feed |
Okay. On the docker host : 10.0.0.0/24 is my physical network, ens18 is the name of the interface in the docker host Then : a2:a2:a2:a2:a2:42 is the mac address for this camera in my config.yaml and 10.0.0.77 is the IP address of the onvif stream that Unifi Protect will see. To check the correct assignment of the IP to the container you can do : Now it works and I was able to adopt a third-party camera that did not provide an onvif stream, only rtsp/H264. Nothing serious but just a little oddity : apparently the name provided in the config.yaml is not taken into account. Unifi Protect sees a "Cardinal" camera. Thank you Daniela for your work ! |
Ahh thats great news and it maybe a bit simpler doing it the docker network way rather than the linux commands. In Edge the live stream is a bit choppy but in the Protect app its smooth. Also the recording works fine and scrubbing is good! I am going to try and create a PR with some improvements around the errors and descriptions of what's going on around the networking stuff. I will also see if there is a way to rename the "Cardinal" on a PR |
As I fix an ip to the container, my workaround will only work with one stream per docker. This is not really a solution in my opinion. |
You can connect multiple networks to docker 😄 |
You may have been correct with this comment! I ran into limitations with assigning multiple MAC addresses to each node. I did spend some time since yesterday doing a whole bunch of fixes.. which I have now made in my own forked repo. I have also merged the fixes to camera name and some better debug outputs. Generally I am going to be focusing on making it work with docker compose there. It works nicely without any extra commands and if you want multiple streams.. yes multiple nodes .. for now! Will work to maybe remove the MAC address stuff completely. |
I solved the problem in Docker and it now auto registers MAC and IPv4 based on config entries. It is also more performant network driver. |
Firstly, I wanted to say thank you for creating this! Means I can carry on using some of my older, perfectly working cameras in Unify Protect now!
The docker instructions says
All you need to do is to mount your config.yaml to /onvif.yaml inside the container.
Which I have done. The mac address I used is the camera mac.. but i also tried a random one got the same response.
I am running Docker in Windows as test for now. But do i need to setup virtual networks too? I am not quite sure what is going on here.
The text was updated successfully, but these errors were encountered: