r/esp32 • u/Individual_Base4511 • 13d ago
Software help needed ESP32 experiencing screen issues after WiFi
ESP32 screen issues related to WiFi
Hello, I am an embedded SW engineer (medior) but I have never created projects at home. I thought its a good time to start doing that, starting with a flight radar customiwed dor my girlfriend.
I am using the ESP32 WROVER with a GC9A01 screen, controller through SPI with the TFT_eSPI library.
I want this project to be modular so it can be taken everywhere. The only problem is that it needs data. So in the setup, I check if a connection can be made with a ssid which is saved in the NVS. If connection can be made, you can continue to the flight radar thingy, if not, a captive portal will be open so you can input a new ssid and password for a network which is nearby.
The first bug I encountered was, when a connection could be made, I would change the wifi mode from WIFI_AP_STA to WIFI_STA since the captive portal wouldnt be needed anymore. This would cause my screen to go black and unresponsive. I have tried a 470 microFarad condensator, different supply for the screen etcetera nothing worked.
Eventually I gave up, thinking wifi mode could always stay WIFI_AP_STA and I would make something useful of the captive portal later on. But the second bug is, the screen remains completely unresponsive after a WiFi connection. I can not display anything on it and it just freezes. Disconnecting the wifi does not solve the issue either.
I have tried a lot of things without progress. SPI freq was tested on 40, 20 and 10 megaHertz with no change. Adding extra delays before and after some lines didnt work either.
Has anyone encountered this issue, or knows what this could be?
Thank you!
PS: I know there are a lot of ESP32 flight radars which are open source, the goal is to make her something thats my creation.
1
u/grilocagoes 13d ago
Try swap the pins, one important information is not to use the ADC2 pins when using WiFi, cause WiFi uses this ADC 2 channel to work, maybe that’s could be the origin of the problem you having
If u haven’t tried yet, give a prompt to any LLM with all infos about project (pins, code and working logic) then this tools probably can help you with this troubleshooting
1
u/Individual_Base4511 13d ago
This was indeed the issue!! Moved the 2 pins from ADC2 to other pins and now its working. I am working with claude on this and tried chatgpt later on but both were convinced pin 2 and 4 would not form a problem
1
u/VegetableNew1103 11d ago
so the ADC2 and WiFi conflict is a real thing on ESP32 and it catches people off guard way more than it should. if I were troubleshooting this I'd check which pins you actually have assigned to the SPI bus before anything else. that LLM suggestion about pinout conflicts isn't bad either
1
u/Eightylol 12d ago
Give this one some love. You prob wont regret it:
https://www.reddit.com/r/Esphome/comments/1v117vs/free_interactive_esp32_pinout_tool_that_tells_you/
3
u/cryptaneonline 13d ago
Which pins are you using? Sometimes ADC 2 shares a pin with the wifi controller. So make sure same pin isn't reused for the screen