QUERY · ISSUE
esp8266 recvfrom() gives ap address instead of source
port-esp8266
on esp8266 with master :
STA 192.168.4.2 send packet to AP with sendto( data, ('192.168.4.1',port) )
on ap data, adrr = recvfrom() gives addr[0] == '192.168.4.1' source address instead of '192.168.4.2'
CANDIDATE · ISSUE
ESP8266 v1.18 Unreliable UDP Receiving From Broadcast Address (ex 192.168.1.255)
bugneeds-info
Anyone else having issues receiving UDP packets? I can send 10-20 packets and only receive one packet. I send them with another esp or with my computer and can see the packets in Wireshark but hardly any are received with the 8266. It seems to be substantially worse when I send to the broadcast (ex 192.168.1.255) vs directly to the esp IP address. Should I be using a multicast address instead? Not sure what the differences are.
socket = socket(AF_INET, SOCK_DGRAM)
socket.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
socket.bind(('', 1011))
socket.setblocking(False)
while True:
try:
data, addr = self.socket.recvfrom(1024)
print('Recv Data From %s' % str(addr))
except OSError as err:
if err.args[0] != 11:
print(err)