A
Dear all
I found the core of the problem and solution.
The problem cames from the fact that I was broadcasting the frames from the wipys to the PC. I did it, since I also can have 2 PCs, one as a logger, and the other as a controller which takes the measurements from the wipy, and both PCs must be different due to the project requirements.
Broadcasting to the 255.255.255.255 address works DIRECTLY on legacy 1.20.0r13, BUT not on pybytes 1.20.2.r4
I remove broadcasting, giving as socket_adress just the logger PC and port
socket_addr = (PC_IP_Address, Socket_port)
This way, on both firmware versions, the transmission works correctly!!!
I look for more information on Broadcasting problems with UDP sockets and micropython.
Initially it seems that for python:
socketUDP.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
should enable broadcast if it was disabled. However, this option is NOT implemented for micropython. I found this post:
https://forum.micropython.org/viewtopic.php?t=8342
where they talked about this problem, and they said that adding
socketUDP.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
solves the problem for broadcasting... and IT WORKS
I also tried this:
socketUDP.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 0)
which must means that "don't resuse" the address, and I thought was the default if not settled, and it also works, even better...
CONCLUSION: For broadcating with UDP sockets, implicit declaration of socket option SO_REUSEADDR is required.
My working socket set-up is:
# Set-up UDP socket
socketUDP = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
socketUDP.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 0)
socketUDP.setblocking(False) # Non-blocking socket
socketUDP.settimeout(1.0) # timeout every 1 second
t0 = chrono.read()
I post this as solution, since maybe someone else might have the same problem as I had.
Thanks to all who replied to me and tried to help!