Conflict between ADC2 and Wifi
Posted: Fri Oct 12, 2018 11:48 pm
Hi all,
After a few hours of research, I was finally able to isolate my strange problem.
In the code below, if I uncomment the lines concerning wifi, the analog input A10 (GPIO4) always reports 4095.
I finally found here(https://github.com/espressif/arduino-esp32/issues) and here (https://desire.giesecke.tk/index.php/20 ... is-in-use/) that adc2 channel could not be used while wifi was in use. I didn't have the time to check yet but I hope adc1 will work correctly (thanks for your advices on that matter)
That said, I don't really understand 2 points :
And is there a guide somewhere telling precisely which GPIO, ADC ... you can use in which configuration (if possible, I would like to avoid this waste of time in the future) ?
Thanks in advance for all your help and advices.
Antoine
After a few hours of research, I was finally able to isolate my strange problem.
In the code below, if I uncomment the lines concerning wifi, the analog input A10 (GPIO4) always reports 4095.
Code: Select all
#include <Arduino.h>
#include <WiFi.h>
void setup() {
Serial.begin(115200);
pinMode(A10, INPUT_PULLDOWN);
/* Lines to uncomment to create the problem.
WiFi.mode(WIFI_STA);
WiFi.disconnect();*/
}
void loop() {
int analog = analogRead(A10);
Serial.println(analog, DEC);
}
That said, I don't really understand 2 points :
- You will see in my code that I want to disconnect the wifi => Why does the conflict still exist (Note : Actually after that, I want to use esp_now protocol, which may create the conflict anyway, I don't know)
- As the ESP product range has been mainly designed to be used with Wifi, Why Espressif does not communicate more on that issue and/or write it in big somewhere. ?
And is there a guide somewhere telling precisely which GPIO, ADC ... you can use in which configuration (if possible, I would like to avoid this waste of time in the future) ?
Thanks in advance for all your help and advices.
Antoine