Is there a way to modify the script to stop clearing the screen and show result lets say after a 5 seconds just once? i am using this code as a part of bigger script which pulls also other devices and clearing the screen is not good for me.
ok i can share my modified version of script.
You can view simple table or full raw XML. just use "python name_of_the_script.py" to get table view or "name_of_the_script.py raw" to get full jsons.
probably you need to install prettytable package
import xml.etree.ElementTree as ET
from...
Thank you its working but there is one problem with the outputed xml. The messages in output are not complete - if there is a second message coming it can stop from showing the first one. Look at my example:
Received message from ('10.30.1.230', 37020):
<?xml version="1.0" encoding="UTF-8" ?>...
you are more than helpful thank you :) for now i will leave my script version you can double check in a free time
import socket
# Configuration
UDP_IP = "239.255.255.250" # Broadcast IP address
UDP_PORT = 202 # I need to remember which port it was, you can check what sadp is using
# Create...
The same problem, i googled it also and maybe there is a problem with the destination IP is in different subnet than the local machine? Foud some similar issue when the first ip is not matching the sock.bind
ok i reverted the changes and still get
Sent UDP broadcast packet.
Traceback (most recent call last):
File "/home/pi/hikvision.py", line 17, in <module>
sock.bind(("0.0.0.0", UDP_PORT))
OSError: [Errno 22] Invalid argument
Thank you in my case:
broadcast UDP_IP = "10.30.1.255"
but sock.bind is failing on address 0.0.0.0 i put there also the ip of the machine running the script - the same
Sent UDP broadcast packet.
Traceback (most recent call last):
File "/home/pi/hikvision.py", line 17, in <module>...
Hi, i often need to find hikvision devices via linux command line. What type of discovery service is sdap tool using to find it? no luck with nmap or avahi-browse. i dont need to use full sdap functions, i want only find ip address of hikvision devices in the network.
is there any port of this...