j0h

discover_opto22s

j0h
Mar 11th, 2026
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. How to discover Opto22 Groov Epic / Rios on a network. Its easy!
  2. you send this payload = b"\x00\x00\x04\x50\x00\x00\xff\xff\xf0\x30\x00\x20\x01\x30\x00\x00"
  3. to ports 2001, and or 2002, to the subnet's broadcast address. Now your opto22 devices will respond to pings.
  4.  
  5. # Here I made this function
  6. def discover_targets(ip):
  7. # pass Broadcast addresses.
  8. DISCOVERY_PORTS = (2002, 2001)
  9. payload = b"\x00\x00\x04\x50\x00\x00\xff\xff\xf0\x30\x00\x20\x01\x30\x00\x00"
  10. s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  11. s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
  12. for port in DISCOVERY_PORTS:
  13. s.sendto(payload, (ip, port))
  14. s.close()
  15.  
Advertisement
Add Comment
Please, Sign In to add comment