← index #16179PR #8992
Likely Duplicate · medium · value 2.082
QUERY · ISSUE

wifi long range mode (MODE_LR) is not working

openby stanelieopened 2024-11-07updated 2026-03-24
bugport-esp32

Port, board and/or hardware

Waveshare ESP32-S3-ZERO

MicroPython version

MicroPython v1.24.0 on 2024-10-25; Generic ESP32S3 module with ESP32S3

Reproduction

I have been unable to set the long range mode of wifi using micropython.
Either I can't read, or the documentation is lacking, or the feature does not work. Here is the code I tried :

import network

sta = network.WLAN(network.STA_IF)
sta.active(True)
sta.config(protocol=network.MODE_LR)

Expected behaviour

I expect this to set the LR mode that is available on Espressif devices.

Observed behaviour

Nothing changes, the mode is not set.
print(sta.config("protocol")) reports 8 or 1 when I use MODE_LR or MODE_11B respectively, but anything else throws a 'module' object has no attribute 'MODE_11G', for example. And the link quality does not change

Additional Information

No response

Code of Conduct

Yes, I agree

CANDIDATE · PULL REQUEST

ports/esp32: Support setting the wifi protocol mode.

closedby glenn20opened 2022-07-31updated 2022-09-04
port-esp32

This PR provides support for setting/getting the wifi protocol mode (11B|11G|11N).

Provides: Adds the protocol option to WLAN.config() to support setting/getting the wifi protocol modem, eg:

import network
ap = network.WLAN(1); ap.active(True)
ap.config(protocol=network.MODE_11N)
ap.config(protocol=network.MODE_11B|network.MODE_11G)

Curiously, the constants for these modes were already present in modnetwork.c, but previously no method for using them.

Also adds network.MODE_LR which enables Espressif's long-range mode for communication between ESP devices.

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