I'm trying to send out ArtNet Data with on a Raspberry Pi Pico with an W5500 Ethernet shield. The Ethernet connection is tested and working good.
The problem is, that the socket.sendto() command takes about half a second to execute on the PI, which is way to slow for me. (i need about 30fps)
When I run the code on my PC, socket.sendto() is not taking long, its working nearly instant.
Below is the code i used:
import time
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
time.sleep(0.5)
data = bytearray()
data.append(0)
start_time = time.time()
s.sendto(data, ('192.168.2.240', 6454))
stop_time = time.time()
print("time to send: " + str(stop_time - start_time))
Raspberry Pi Pico 2020 with W5500 Ethernet shield takes about 512ms. Windows PC nearly instant.