agrobot_base/Python/ip_bridge/udp/base_sender.py

14 lines
237 B
Python

# base_tx.py
import socket, time
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
ROBO_IP = "192.168.99.108"
i = 0
while True:
msg = f"PING {i}".encode()
sock.sendto(msg, (ROBO_IP, 5000))
i += 1
time.sleep(0.2)