← index #3813PR #2579
Related · high · value 1.606
QUERY · ISSUE

ESP8285 can't use ap_if.config "can't set AP config"

openby mindforgeropened 2018-05-23updated 2022-03-05
port-esp8266

i did the following

import network
ap_if = network.WLAN(network.AP_IF)
ap_if.active(False)
ap_if.config(essid="someID", password="somePassword")

but i always get "can't set AP config", no matter what parameter i try to use

MicroPython v1.9.4-8-ga9a3caad0 on 2018-05-11; ESP module with ESP8266

flashed on an plain ES8285 Module

listdir is also doing funky stuff on this module, getting a crap ton of " '\x00\x00\x00\x00\x00\x00\x00\x00.\x00\x00\x00'," as answer + the folders and file that icreated for a test

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