Same request as in https://forum.micropython.org/viewtopic.php?f=16&t=12065
Also see https://www.bakke.online/index.php/2017/06/24/esp8266-wifi-power-reduction-avoiding-network-scan/
I'd also like to do this for power saving on a battery powered device.
I believe micropython isn't able to do this yet, because it's missing from connect:
(call does not allow channel as kwarg)
|
STATIC mp_obj_t esp_connect(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { |
|
enum { ARG_ssid, ARG_key, ARG_bssid }; |
|
static const mp_arg_t allowed_args[] = { |
|
{ MP_QSTR_, MP_ARG_OBJ, {.u_obj = mp_const_none} }, |
|
{ MP_QSTR_, MP_ARG_OBJ, {.u_obj = mp_const_none} }, |
|
{ MP_QSTR_bssid, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, |
|
}; |
Additionally, it's also not possible to set this from esp_config:
(setter only for AP, not STA):
|
case MP_QSTR_channel: { |
|
req_if = SOFTAP_IF; |
|
cfg.ap.channel = mp_obj_get_int(kwargs->table[i].value); |
|
break; |
|
} |
(getter only for AP, not STA):
|
case MP_QSTR_channel: |
|
req_if = SOFTAP_IF; |
|
val = MP_OBJ_NEW_SMALL_INT(cfg.ap.channel); |
|
break; |
Same request as in https://forum.micropython.org/viewtopic.php?f=16&t=12065
Also see https://www.bakke.online/index.php/2017/06/24/esp8266-wifi-power-reduction-avoiding-network-scan/
I'd also like to do this for power saving on a battery powered device.
I believe micropython isn't able to do this yet, because it's missing from
connect:(call does not allow
channelas kwarg)micropython/ports/esp8266/modnetwork.c
Lines 111 to 117 in 89b3207
Additionally, it's also not possible to set this from
esp_config:(setter only for AP, not STA):
micropython/ports/esp8266/modnetwork.c
Lines 395 to 399 in 89b3207
(getter only for AP, not STA):
micropython/ports/esp8266/modnetwork.c
Lines 465 to 468 in 89b3207