I have a Strato4 as a GPS Tracker and I want to connect it to an ESP32 using the UART-Interface with which both devices are equipt. However the Strato4 does not seem to send any information towards the ESP.
#include <HardwareSerial.h>
HardwareSerial mySerial(1); // Use UART 1
const int RXD2 = 16; // Example GPIO pin for RX
const int TXD2 = 17; // Example GPIO pin for TX
void setup() {
// Initialize the default serial (UART0) with a baud rate
Serial.begin(9600); // Use a baud rate like 9600
Serial.println("New Run");
// Initialize UART1 on the specified RX and TX pins
mySerial.begin(9600, SERIAL_8N1, RXD2, TXD2);
}
void loop() {
if (mySerial.available()) {
String data = mySerial.readString(); // Read incoming data
Serial.println("Received data: " + data); // Print data to the console
} else {
Serial.println("No data available");
}
}
I tried running this code on the ESP, but mySerial does not seem to be availible, as I get "No data available" as my output.