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 · PULL REQUEST
esp8266/modnetwork.c: fix wifi set mac address
Changing MAC address of STA or AP wifi interfaces always raise a ValueError: invalid buffer length
>>> network.WLAN(network.AP_IF).config(mac=b'\0bbbbb')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: invalid buffer length
This is because code try to use the key 'mac' as the address instead of the value.
Also a flag (set_config) is used not to set wifi config in case only MAC address is changed to avoid a "can't set STA/AP config" error.