Discusión: GPS para red nmea2k
Ver mensaje
  #18  
Antiguo 14-02-2024, 18:38
Avatar de jiauka
jiauka jiauka esta desconectado
Hermano de la costa
 
Registrado: 01-10-2010
Mensajes: 11,548
Agradecimientos que ha otorgado: 3,502
Recibió 6,467 Agradecimientos en 3,556 Mensajes
Sexo:
Predeterminado Re: GPS para red nmea2k

Cita:
Originalmente publicado por Tanausu Ver mensaje
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

Editado por jiauka en 14-02-2024 a las 18:43.
Citar y responder