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

[ipcamera] ONVIF discovery uses only the first listed network interface #9023

Closed
puzzle-star opened this issue Nov 14, 2020 · 3 comments · Fixed by #9199
Closed

[ipcamera] ONVIF discovery uses only the first listed network interface #9023

puzzle-star opened this issue Nov 14, 2020 · 3 comments · Fixed by #9199
Labels
enhancement An enhancement or new feature for an existing add-on

Comments

@puzzle-star
Copy link

Using 2.5.10.

I have several network interfaces on my system, and the camera happens not to be on the first one, so I can only use discovery by disabling other interfaces. I might also end up having cameras on different interfaces (wired and Wifi).

Looking into the binding code, I seem to understand the discovery only uses the first available IP interface.

Would it be possible to use the primary interface defined in Openhab configuration if defined, instead of the first listed one?

At a second stage, would it be possible to launch discovery on all available interfaces?

I would be happy to help with code, but I do not have a develpment set-up so not easy for me to compile / test / commit binding code

@puzzle-star puzzle-star added the enhancement An enhancement or new feature for an existing add-on label Nov 14, 2020
@wborn wborn changed the title [IPCamera] ONVID discovery uses only the first listed network interface [ipcamera] ONVID discovery uses only the first listed network interface Nov 22, 2020
@Skinah
Copy link
Contributor

Skinah commented Nov 26, 2020

Yes the binding uses the selected interface in other areas of the binding so it can be done easily, see the class IpCameraHandlerFactory and how it uses NetworkAddressService. Your correct the discovery does not use this method, although I like the idea of sending it to all interfaces as the code already listens for replies back on all interfaces. I have been wondering why some people have mentioned discovery does not work for them, and this is probably the reason why so thanks for raising this.

Actually it really does not matter much as the only thing that gets discovered is the IP and onvif port of the camera, if you manually add the camera with the UI and give these then you wont miss out on anything as the rest of the discovery is done when the camera actually connects after the thing is already created.

@Skinah Skinah changed the title [ipcamera] ONVID discovery uses only the first listed network interface [ipcamera] ONVIF discovery uses only the first listed network interface Nov 26, 2020
@Skinah
Copy link
Contributor

Skinah commented Nov 29, 2020

I made some changes, but I can not test them as none of my devices have multiple networks. Can you test please?
Precompiled jar can be downloaded here.
http://www.pcmus.com/openhab/IpCameraBinding/ipcamera-3.0.0-2020-11-29.zip

Changes made can be seen here.
main...Skinah:ipcamera

It will scan on all NICs and also use the discovery packet change you suggested which finds all my cameras here.

@puzzle-star
Copy link
Author

Thanks, I cannot test right now as all my cameras are "in production", but I ordered I new one and will test when it arrives.

Anyway, the issue is closed, so I think it will work ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants