Issue running in two different tasks Wifi and I2C device
Posted: Wed Jun 16, 2021 10:12 pm
Hi,
I don't know if it is a bug, however I have this situation on ESP32-WROOM-32D.
In the setup function I start 2 separated tasks. One task manages the connection to WiFi network with the "Wifi.h" library, after the Wifi connection completed the task stay IDLE with a infinite loop of delays.
The other task manages the I2C sensor DHT22; it essentially init the sensor and query it in a infinite loop and print the temperatures in the Serial terminal. The libraries used are "#Adafruit_Sensor.h, DHT.h, DHT_U.h".
The problem in this configuration is I get a sensor reading failure after some random number of successful readings (meanly 8-10).
This problem doesn't occur if I perform the same Wifi connection and sensor reading in the same task. I also tried to bind the two tasks on different cores, but I have the same problem.
Anyone may help me to figure out what can be wrong?
Regards
I don't know if it is a bug, however I have this situation on ESP32-WROOM-32D.
In the setup function I start 2 separated tasks. One task manages the connection to WiFi network with the "Wifi.h" library, after the Wifi connection completed the task stay IDLE with a infinite loop of delays.
The other task manages the I2C sensor DHT22; it essentially init the sensor and query it in a infinite loop and print the temperatures in the Serial terminal. The libraries used are "#Adafruit_Sensor.h, DHT.h, DHT_U.h".
The problem in this configuration is I get a sensor reading failure after some random number of successful readings (meanly 8-10).
This problem doesn't occur if I perform the same Wifi connection and sensor reading in the same task. I also tried to bind the two tasks on different cores, but I have the same problem.
Anyone may help me to figure out what can be wrong?
Regards