Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to discover Opto22 Groov Epic / Rios on a network. Its easy!
- you send this payload = b"\x00\x00\x04\x50\x00\x00\xff\xff\xf0\x30\x00\x20\x01\x30\x00\x00"
- to ports 2001, and or 2002, to the subnet's broadcast address. Now your opto22 devices will respond to pings.
- # Here I made this function
- def discover_targets(ip):
- # pass Broadcast addresses.
- DISCOVERY_PORTS = (2002, 2001)
- payload = b"\x00\x00\x04\x50\x00\x00\xff\xff\xf0\x30\x00\x20\x01\x30\x00\x00"
- s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
- s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
- for port in DISCOVERY_PORTS:
- s.sendto(payload, (ip, port))
- s.close()
Advertisement
Add Comment
Please, Sign In to add comment