[SOLVED]Receiving no data from Serial2
Posted: Thu Oct 24, 2019 2:20 pm
Board: ESP32-EVB
I am trying to read data from a Radar's RS232 Serial Interface through the UEXT connector on the ESP.
As per the schematics, I am using GPIO 36 as the rxPin and GPIO 4 as the txPin.
I have also tried replacing Serial2 with USE_SERIAL1 and defined it like this : HardwareSerial USE_SERIAL1(1); but to no avail.
The radar is set up to send data on 9600.
I'm receiving no data. Not even Serial.println("Serial2 is available.");.
Any thoughts ?
I am trying to read data from a Radar's RS232 Serial Interface through the UEXT connector on the ESP.
As per the schematics, I am using GPIO 36 as the rxPin and GPIO 4 as the txPin.
Code: Select all
#define RXD2 36
#define TXD2 4
void setup() {
delay(100);
Serial.begin(115200);
delay(1000);
Serial2.begin(9600, SERIAL_8N1, RXD2, TXD2);
}
void loop() {
if(Serial2.available() >0) {
Serial.println("Serial2 is available.");
while (Serial2.available()) {
char c = char(Serial2.read());
Radar_String += c;
Serial.print(char(Serial2.read()));
}
Serial.println("Radar_String = " + Radar_String);
}
The radar is set up to send data on 9600.
I'm receiving no data. Not even Serial.println("Serial2 is available.");.
Any thoughts ?