← index #4425PR #2579
Off-topic · high · value 3.012
QUERY · ISSUE

esp8266 recvfrom() gives ap address instead of source

openby pmp-popened 2019-01-24updated 2019-05-13
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

closedby dmansoopened 2016-10-30updated 2016-10-31

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.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied