Experiencing conflicts between touch and Wifi on ESP32 #2631
|
I am experiencing something that looks like a conflict between the touch interface and the wifi library. I am using a Lolin32 ESP32 board and a 2.4 TFT SPI 240 x 320 screen with touch. (Red board - bought on Ali Express). My signals are connected as follows: Display ESP32 GPIO Display and touch work perfectly, but as soon as I turn on Wifi, the touch interface stops working. WiFi.mode(WIFI_STA); When not working, the touch interface always returns the same values: x: 8191 y: 8191 z: 0 |
Replies: 3 comments
|
Answered my own question: The problem was the use of GPIO2 for T_DO and MISO. It seems to be used when the Wifi Interface is turned on for some reason. Since the Display is not really using MISO, it was still working. However, since the touch interface uses the T_DO signal, it was malfunctioning. Connecting to another GPIO (GPIO23 in this case) solved the problem. |
|
Me ha funcionado |
|
I experienced a very similar issue with my ESP32 + ILI9488 + WiFi. The display worked perfectly without WiFi, but turned completely blank as soon as I connected to a network. After hours of debugging, I found that the problem was caused by using GPIO2 for TFT_DC. When I moved the TFT_DC pin from GPIO2 to GPIO14 (and kept CS on GPIO5, RST on GPIO4, SPI pins 18,19,23), the display started working normally even with WiFi active. No other changes were needed – the same code, same library, just a different pin for DC. It seems GPIO2 has an internal conflict with the WiFi radio on the ESP32, making it unsuitable for controlling the display's DC line. I also reduced SPI frequency to 20 MHz for extra stability, but the pin change was the real fix. Thank you to everyone in this discussion for pointing out the GPIO2 issue – it saved me. I hope this helps others facing the same problem. |
Answered my own question: The problem was the use of GPIO2 for T_DO and MISO. It seems to be used when the Wifi Interface is turned on for some reason. Since the Display is not really using MISO, it was still working. However, since the touch interface uses the T_DO signal, it was malfunctioning. Connecting to another GPIO (GPIO23 in this case) solved the problem.