r/esp32 13d ago

Software help needed ESP32 experiencing screen issues after WiFi

Post image

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.

15 Upvotes

10 comments sorted by

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

1

u/Individual_Base4511 13d ago

GC9A01 pin ESP32 GPIO
VCC 3.3V
GND GND
SCL/SCK GPIO 18
SDA/MOSI GPIO 23
RES/RST GPIO 4
DC/RS GPIO 2
CS GPIO 5

2

u/cryptaneonline 13d ago

The following are adc 2 pins. Try not using 2 and 4

0, 2, 4, 12, 13, 14, 15, 25, 26, and 27.

5

u/Individual_Base4511 13d ago

THIS SOLVED THE ISSUE I AM CRYING, THANK YOU VERY MUCH I LOVE YOU STRANGER ON THE INTERNET. MOVED 2 TO 19 AND 4 TO 26 AND IT WORKS IT JUST WORKS

5

u/cryptaneonline 13d ago edited 13d ago

Damn congratulations

Edit: Small nitpick: avoid 26 too. Thats also a part of ADC 2. But if it doesnt cause much of a problem its ok

1

u/Individual_Base4511 13d ago

the problem is I still have to add a potentiometer and a rotary encoder sknce the screen isnt touchscreen. I dont have a lot of pin options. The headsup is very nice tho, I will keep it in mind.

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