← index #17804PR #7279
Related · medium · value 1.646
QUERY · ISSUE

The WiFi of esp32c3 conflicts with ADCBLOCK2

openby dahanziminopened 2025-08-01updated 2026-03-18
bugport-esp32

Port, board and/or hardware

ESP32C3

MicroPython version

MicroPython v1.25.0 on 2025-04-15; LOLIN_C3_MINI with ESP32-C3FH4

Reproduction

import machine,time

def wlan_connect(ssid='MYSSID', password='MYPASS'):
import network
wlan = network.WLAN(network.WLAN.IF_STA)
if not wlan.active() or not wlan.isconnected():
wlan.active(True)
print('connecting to:', ssid)
wlan.connect(ssid, password)
while not wlan.isconnected():
pass
print('network config:', wlan.ifconfig())

wlan_connect('XXX', '12345678')
adc5 = machine.ADC(machine.Pin(5))
print(adc5.read_u16())

Expected behaviour

MPY: soft reboot
network config: ('192.168.1.64', '255.255.255.0', '192.168.1.1', '192.168.1.1')
65535
MicroPython v1.25.0 on 2025-04-15; LOLIN_C3_MINI with ESP32-C3FH4
Type "help()" for more information.

Observed behaviour

MPY: soft reboot
connecting to: XXX
network config: ('192.168.1.64', '255.255.255.0', '192.168.1.1', '192.168.1.1')
Traceback (most recent call last):
File "main.py", line 18, in <module>
OSError: (-259, 'ESP_ERR_INVALID_STATE')
MicroPython v1.25.0 on 2025-04-15; LOLIN_C3_MINI with ESP32-C3FH4
Type "help()" for more information.

Additional Information

It seems that there is a conflict between the WiFi of esp32c3 and ADCBLOCK2. This error occurs when initializing just after power-on, but it becomes normal after pressing "Ctrl+D". However, it is not completely normal on v1.23.0

Code of Conduct

Yes, I agree

CANDIDATE · PULL REQUEST

ESP32: Added support for using ADC2 Pins

closedby bruno963852opened 2021-05-18updated 2022-01-21
port-esp32

Hello friends, i altered the ADC code for ESP32 for enabling the ADC2 channels.

I made the mistake of branching this change on top of the other PR i made for the nrf port, so i don't know what to do from here, sorry....

I coded so that is transparent for the user wich ADC it's been used, the system selects the correct one based on the pin passed as argument for the ADC object, the user should be aware that the ADC2 conflicts with wi-fi and both should not be used at the same time.

Added the MICROPY_PY_MACHINE_ADC_ENABLE_ADC2 directive for the user to enable or disable this functionality on the mpconfigboard.h

Tested on a TTGO T-Controller board using ESP32-WROVER

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