Skip to content

[FEATURE] Add the ability to select network interface used for ONVIF discovery through the CLI #29

Description

@NoNameWouldSuffice

Is your feature request related to a problem? Please describe.
On a machine with multiple connected network interfaces (e.g. multiple ethernet connections, connected to WiFi and Ethernet at the same time, etc), using the discovery feature of the CLI automatically selects an interface and does not detect cameras connected to another network interface / outside of the subnet of the selected network interface.

A workaround is to disconnect all network interfaces except the one that is connected to the cameras to discover.

Describe the solution you'd like
Some CLI-level argument, like --interface is added so users can manually select what network interface they want to use for interactive ONVIF discovery.

Describe alternatives you've considered:
CLI discovery probes all interfaces connected to the machine for cameras.

Additional context

  • Installed operating system is Kubuntu 26.04
  • Output of the problem happening:
(onvif-python) user@laptop:~$ onvif --discover -i

Discovering ONVIF devices on network...
Network interface: 192.168.100.45
Timeout: 4s

No ONVIF devices discovered. Exiting.
(onvif-python) user@laptop:~$ ping 10.72.84.221
PING 10.72.84.221 (10.72.84.221) 56(84) bytes of data.
64 bytes from 10.72.84.221: icmp_seq=1 ttl=64 time=0.208 ms
64 bytes from 10.72.84.221: icmp_seq=2 ttl=64 time=0.228 ms
64 bytes from 10.72.84.221: icmp_seq=3 ttl=64 time=0.291 ms
^C
--- 10.72.84.221 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2033ms
rtt min/avg/max/mdev = 0.208/0.242/0.291/0.035 ms
(onvif-python) user@laptop:~$ echo "After the other network interfaces are disconnected: "
After the other network interfaces are disconnected: 
(onvif-python) user@laptop:~$ onvif --discover -i

Discovering ONVIF devices on network...
Network interface: 10.72.84.217
Timeout: 4s

Found 3 ONVIF device(s):

[1] 10.72.84.100:80 (HTTP)
    [id] cc930000-8eb4-11b5-8461-80beafc461e7
    [xaddrs] [http://10.72.84.100/onvif/device_service] [http://[fe80::82be:afff:fec4:61e7]/onvif/device_service]
    [types] [dn:NetworkVideoTransmitter] [tds:Device]
    [scopes] [type/video_encoder] [Profile/Streaming] [Profile/G] [Profile/T] [type/audio_encoder] [MAC/80:be:af:xx:xx:xx] [hardware/IPC-T269H-MU/SL] [name/HIKVISION%20IPC-T269H-MU/SL] [location/city/hangzhou]

[2] 10.72.84.221:80 (HTTP)
    [id] 5a534a56-3656-3458-3430-303030504600
    [xaddrs] [http://10.72.84.221/onvif/device_service]
    [types] [dn:NetworkVideoTransmitter] [tds:Device]
    [scopes] [manufacturer/Hanwha%20Vision] [type/video_encoder] [type/Network_Video_Transmitter] [hardware/QNE-C9013RL] [Profile/Streaming] [Profile/G] [Profile/T] [Profile/M] [location/country/korea] [location/city/seoul] [name/QNE-C9013RL]
[3] 10.72.84.221:80 (HTTP)
    [id] 5a534a56-3656-3458-3430-303030504600
    [xaddrs] [http://10.72.84.221/onvif/device_service]
    [types] [dn:NetworkVideoTransmitter] [tds:Device]
    [scopes] [manufacturer/Hanwha%20Vision] [type/video_encoder] [type/Network_Video_Transmitter] [hardware/QNE-C9013RL] [Profile/Streaming] [Profile/G] [Profile/T] [Profile/M] [location/country/korea] [location/city/seoul] [name/QNE-C9013RL]

Select device number 1-3 or q to quit: q
Device selection cancelled.
(onvif-python) user@laptop:~$ 

Happy to provide more context if desired

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions