How to disable wifi on ESP32

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
User avatar
mogplus8
Posts: 10
Joined: Tue Aug 07, 2018 4:12 am

How to disable wifi on ESP32

Post by mogplus8 » Mon Aug 17, 2020 6:53 am

Hi All,
I want to use ten adc inputs on an ESP32, but there are only eight on ADC1. ADC2 has another ten, but they cannot be used while wifi is active. I am not using wifi for this project so I would like to disable it and use two ADC2 channels. How do I do that?
Thanks,

User avatar
rcolistete
Posts: 352
Joined: Thu Dec 31, 2015 3:12 pm
Location: Brazil
Contact:

Re: How to disable wifi on ESP32

Post by rcolistete » Mon Aug 17, 2020 6:07 pm

It is not currently possible using MicroPython mainline/official, see this GitHub issue #6219 "[ESP32] Read from ADC2 Pins".

But the MicroPython ESP32 Lobo firmware supports ADC2 .
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).

User avatar
mogplus8
Posts: 10
Joined: Tue Aug 07, 2018 4:12 am

Re: How to disable wifi on ESP32

Post by mogplus8 » Tue Aug 18, 2020 3:22 am

Thanks @rcolistete,
I installed the Lobo version of Micropython, and found it has lots of good features as well as supporting ADC2. However it seems my board, a Heltec WiFi Kit 32, does not. When I enter the command

Code: Select all

adc = ADC(Pin(25),unit=2
in the REPL to define 25 as an ADC pin I get these errors

Code: Select all

E (413001) RTC_MODULE: /home/ian/MicroPython_ESP32_psRAM_LoBo/Tools/esp-idf/components/driver/rtc_module.c:1167 (adc_gpio_init):ADC unit error, only support ADC1 for now
E (413006) RTC_MODULE: /home/ian/MicroPython_ESP32_psRAM_LoBo/Tools/esp-idf/components/driver/rtc_module.c:1197 (adc_set_data_width):ADC unit error, only support ADC1 for now
So it would seem I'm stuck. The board just doesn't support it.

Thanks again for your help, much appreciated.

User avatar
mogplus8
Posts: 10
Joined: Tue Aug 07, 2018 4:12 am

Re: How to disable wifi on ESP32

Post by mogplus8 » Tue Aug 18, 2020 2:20 pm

@rcolistete one more question if I may.
I have found with the Lobo version of Micropython I can no longer use the RMT peripheral. In the documentation it states that the RMT module is used to implement Neopixel, DHT and 1-wire, so it's there. But how to use it? I tried importing it from machine, but it says RMT does not exist. in the REPL help(machine) does not list it. Has this module been disabled in this build?

Thanks,

User avatar
rcolistete
Posts: 352
Joined: Thu Dec 31, 2015 3:12 pm
Location: Brazil
Contact:

Re: How to disable wifi on ESP32

Post by rcolistete » Tue Aug 18, 2020 3:02 pm

About ADC2, try other pins after reading your board pinout, in some boards some ADC2 pins are used.

I don't have experience with RMT.
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).

User avatar
mogplus8
Posts: 10
Joined: Tue Aug 07, 2018 4:12 am

Re: How to disable wifi on ESP32

Post by mogplus8 » Thu Aug 20, 2020 1:02 pm

Thanks @rcolistete I'll try the others.
RMT (remote control) peripheral was originally to use with IR controllers, but is has found a few other uses as well. It seems everything is 2.4GHz these days anyway, I don't know if IR is used much any more.
;-)

Post Reply