Cita:
Originalmente publicado por Tanausu
Le voy a dar una vuelta al wifi Gateway a ver si lo consigo.
|
Añades
// Serial port 2 config (GPIO 16)
const int baudrate = 38400;
const int rs_config = SERIAL_8N1;
// Serial port 1 config (GPIO 12)
const int baudrate1= 4800;
const int rs_config1= SERIAL_8N1;
// NMEA message for AIS receiving and multiplexing
tNMEA0183Msg NMEA0183Msg;
tNMEA0183 NMEA0183;
// NMEA message for gps receiving and multiplexing
tNMEA0183Msg NMEA0183Msg1;
tNMEA0183 NMEA0183_1;
// Init AIS serial port 2
Serial2.begin(baudrate, rs_config);
NMEA0183.Begin(&Serial2, 3, baudrate);
// Init GPS serial port 1
Serial1.begin(baudrate1, rs_config1);
NMEA0183_1.Begin(&Serial1, 3, baudrate1);
if (NMEA0183.GetMessage(NMEA0183Msg)) { // Get AIS NMEA sentences from serial2
SendNMEA0183Message(NMEA0183Msg); // Send to TCP clients
NMEA0183Msg.GetMessage(buff, MAX_NMEA0183_MESSAGE_SIZE); // send to buffer
#if ENABLE_DEBUG_LOG == 1
Serial.println(buff);
#endif
#if UDP_Forwarding == 1
size = strlen(buff);
udp.beginPacket(udpAddress, udpPort); // Send to UDP
udp.write((byte*)buff, size);
udp.endPacket();
#endif
}
if (NMEA01831.GetMessage(NMEA0183Msg1)) { // Get GPS NMEA sentences from serial1
SendNMEA0183Message(NMEA0183Msg1); // Send to TCP clients
NMEA0183Msg1.GetMessage(buff, MAX_NMEA0183_MESSAGE_SIZE); // send to buffer
#if ENABLE_DEBUG_LOG == 1
Serial.println(buff);
#endif
#if UDP_Forwarding == 1
size = strlen(buff);
udp.beginPacket(udpAddress, udpPort); // Send to UDP
udp.write((byte*)buff, size);
udp.endPacket();
#endif
}
DUPLICAS el esquema del transistor de ka entrada AUS, PERO CONECTADO al gpio12
Conectas la salida del GPS tanto al 6500 como al ESP32 y debería funcionar