Seems like you changed horses midstream!
There is a BIG difference between an UNO and the ESP32
From the very beginning you said you were using an ESP32.
So exactly what tests were made with an Uno and which with an ESP32?
All of my suggestions assumed you were using an ESP32 and will NOT work on an UNO
Which board do you actually plan to use?