Comments on: ESP32 UART Communication (Serial): Set Pins, Interfaces, Send and Receive Data (Arduino IDE) https://randomnerdtutorials.com/esp32-uart-communication-serial-arduino/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Mon, 24 Mar 2025 11:45:53 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Dr Quark https://randomnerdtutorials.com/esp32-uart-communication-serial-arduino/#comment-1016826 Sat, 15 Mar 2025 17:06:23 +0000 https://randomnerdtutorials.com/?p=162999#comment-1016826 It turns out that the TFT_eSPI.h library (or something linked in that library) prevents the UART (or maybe just IO16) from functioning on receive (Rx). Transmit (Tx) works fine. You can check the CYD hardware by removing the tri-color LED and the port3 connections to the CH340 and connecting IO16 and IO17 directly to port3. Then just do a loop-back test by connecting IO16 to IO17.

]]>
By: Dr Quark https://randomnerdtutorials.com/esp32-uart-communication-serial-arduino/#comment-1016490 Fri, 14 Mar 2025 20:05:52 +0000 https://randomnerdtutorials.com/?p=162999#comment-1016490 I know IO4, IO16, and IO17 work because they are connected to the LED in the unmodified CYD. I can see in the o’scope the proper 0.2v-3.3v serial data stream on IO16. I setup and started UART(2) using:

HardwareSerial SerialPort(2) ;
setup() {
Serial.begin(9600) ;
SerialPort.begin(9600, SERIAL_8N1, 16, 17);

When I reset the CYD, I occasionally get one SerialPort.available(), then nothing further.

]]>
By: Dr Quark https://randomnerdtutorials.com/esp32-uart-communication-serial-arduino/#comment-1016487 Fri, 14 Mar 2025 19:53:38 +0000 https://randomnerdtutorials.com/?p=162999#comment-1016487 In reply to Dr Quark.

I know IO4, IO16, and IO17 work because they are connected to the LED in the unmodified CYD. I can see the proper 0.2v-3.3v serial data stream on IO16. I setup and started UART(2) using:

HardwareSerial SerialPort(2) ;
setup() {
Serial.begin(9600) ;
SerialPort.begin(9600, SERIAL_8N1, 16, 17);

When I reset the CYD, I occasionally get one SerialPort.available(), then nothing further.

]]>
By: Dr Quark https://randomnerdtutorials.com/esp32-uart-communication-serial-arduino/#comment-1013333 Tue, 04 Mar 2025 18:59:34 +0000 https://randomnerdtutorials.com/?p=162999#comment-1013333 I’m trying to get two CYDs talking on UART(2). I’ve removed the tri-color led and connected the P3 port directly to pins 16 and 17, with no pullup resistors. I’ve cross-connected pins 16/17 and I see good serial output from pin 17, but pin 16 never gives me a Serial2.available(). I’ve used both units on the Tx side and the Rx side, just to make sure they both work when sending and to see if maybe one of the Rx sides of the UART is bad. Nope, Tx works on both, but Rx doesn’t work either way.

Is there something odd about UART(2) on the CYD?

]]>
By: syed furqaan https://randomnerdtutorials.com/esp32-uart-communication-serial-arduino/#comment-999773 Tue, 14 Jan 2025 12:40:36 +0000 https://randomnerdtutorials.com/?p=162999#comment-999773 I cant use gpio 01 and 03 on esp 32 for the following via usb to tll wotking if i use io 16 and 17

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-uart-communication-serial-arduino/#comment-993791 Mon, 23 Dec 2024 11:00:10 +0000 https://randomnerdtutorials.com/?p=162999#comment-993791 In reply to steven.

Hi.
Yes, you can set other pins.
See the section”ESP32 Setting Custom UART Pins
Regards,
Sara

]]>
By: steven https://randomnerdtutorials.com/esp32-uart-communication-serial-arduino/#comment-993730 Mon, 23 Dec 2024 04:50:46 +0000 https://randomnerdtutorials.com/?p=162999#comment-993730 i want to make a uart communication for my esp32 and gps but my esp32 module doesn’t have the 16 and 17 pin. can i use the other pin for example using pin 22 as a tx and pin 33 as an rx?

]]>
By: Bryant https://randomnerdtutorials.com/esp32-uart-communication-serial-arduino/#comment-986645 Tue, 26 Nov 2024 09:26:24 +0000 https://randomnerdtutorials.com/?p=162999#comment-986645 can I use esp1 to read the sensor and then the data is sent to esp2, because I have tried in arduino mega to esp32 that when reading the sensor it does not want to send, but when the sensor is not connected it wants to send data again….

]]>
By: Turbo_Nasty https://randomnerdtutorials.com/esp32-uart-communication-serial-arduino/#comment-983496 Fri, 15 Nov 2024 17:35:14 +0000 https://randomnerdtutorials.com/?p=162999#comment-983496 I am having issues using the data received to do something. If the counter reaches ten for example I would like to serial.printing (“we reached ten”); I have tried a few different approaches using if(message == “10”) {} I have been unsuccessful so far. My goal is to send a color as a string “blue” and receive it as a string the perform a function to change LEDs. I am assuming the counter is sending the numbers as strings.

]]>
By: Talih5n@gmail.com https://randomnerdtutorials.com/esp32-uart-communication-serial-arduino/#comment-976220 Sat, 26 Oct 2024 16:53:22 +0000 https://randomnerdtutorials.com/?p=162999#comment-976220 Merci tout est claire

]]>