Theoretically I have a Wemos_d1_mini32 board. And I want to use the following adc pins: adc2_7 and adc2_2 according with the following scheme that I find in internet:
According wiht the image there are 16 adc pins available for this board…
But is impossible to select in ESPhome. Without errors I only can select the following adc pins: A0, A3, A4, A5, A6, A7 with the following code:
If I try to use this sentence, ESPHOME shows an error, pin with the syntax GPIO don’t work, only with pin: A0 (A before the number the adc platform in this board seems to work, but only with the pins above
If I validate the code with you suggestion:
INFO Reading configuration /config/esphome/toldo.yaml...
Failed config
sensor.adc: [source /config/esphome/toldo.yaml:59]
platform: adc
ESP32 doesn't support ADC on this pin.
pin: GPIO17
This 16 adc pins are theoretical on the other hand because all adc_2 channels are not usable when wifi is active
Since the ADC2 module is also used by the Wi-Fi, only one of them could get the preemption when using together, which means the adc2_get_raw() may get blocked until Wi-Fi stops, and vice versa.
In the end what’s left are the 8 channels with adc_1. For esphome you have to define the gpio pins which are written in the pin out you posted (including errors).
In case this post magically disappears you can always find it again in the waybackmachine
That is a good point @minnie (and is also mentioned in the random nerds page I pointed to). However I didn’t click to this issue in the thread. Thanks for pointing it out.
INFO Reading configuration /config/esphome/toldo.yaml...
Failed config
sensor.adc: [source /config/esphome/toldo.yaml:59]
platform: adc
ESP32 doesn't support ADC on this pin.
pin: 27
With your help my understand is that I only we can use the adc in channel 1 (because channel 2 is not working when WIFI is active), then, there are 6 adc pins, and these adc pins are the A0, A3, A4, A5, A6 and A7 and the code with ESPHOME is “pin: A0” directly, it’s the only code thhats works, code with “pin: GPIO36” or “pin: 36” dont’ works, only with the A before the pin number.
ESPHome always uses the chip-internal GPIO numbers. These internal numbers are always integers like 16 and can be prefixed by GPIO. For example to use the pin with the internal GPIO number 16, you could type GPIO16 or just 16.
Most boards however have aliases for certain pins. For example the NodeMCU ESP8266 uses pin names D0 through D8 as aliases for the internal GPIO pin numbers. Each board (defined in ESPHome section) has their own aliases and so not all of them are supported yet. For example, for the D0 (as printed on the PCB silkscreen) pin on the NodeMCU ESP8266 has the internal GPIO name GPIO16, but also has an alias D0. So using either one of these names in your configuration will lead to the same result.
Originally, the code don’t have this section, and the LED is always ON with the log with:
[18:42:11][C][status_led:019]: Status LED:
[18:42:11][C][status_led:020]: Pin: GPIO22
If the log says GPIO22 I understand thay is this pin that control the LED, then, I put the codes with 3 variations in order to try if I can put the LED OFF, but nothing of the tree variations works.