Docs - Examples - scan
This example scans a whole nework range (1-254) searching for ATEM switchers:
$ python3 scan.py -h
[Tue Nov 24 22:26:17 2020] PyATEMMax demo script: scan
usage: scan.py [-h] range
positional arguments:
range IP address range (e.g) 192.168.1
optional arguments:
-h, --help show this help message and exit
It tries to connect to all the addresses in the range and reports result.
$ python3 scan.py 192.168.1
[Tue Nov 24 22:27:12 2020] PyATEMMax demo script: scan
[Tue Nov 24 22:27:12 2020] Scanning network range 192.168.1.* for ATEM switchers
[Tue Nov 24 22:27:23 2020] ATEM switcher found at 192.168.1.111
[Tue Nov 24 22:27:38 2020] FINISHED: 1 ATEM switchers found.
Code walkthrough
Start with the usual initial steps (explained in Examples)
Start working with the switcher:
First, the ATEMMax
object is created and the hit count is initialized:
After that, a loop starts for values (1-254):
- The corresponding ip address is built
- The script tries to ping the switcher and shows a message indicating if the connection could be established.