9600 baud gps in datalogger

Inquiry and support for Freematics products
Post Reply
ramsaymike
Posts: 8
Joined: Sun Aug 19, 2018 8:43 pm

9600 baud gps in datalogger

Post by ramsaymike »

I am unable to get an older 9600 baud gps module to work in Datalogger (V5). It works fine in the simple gps program example. Does anyone know what changes other than the obvious config.h that have to be made? Thanks.
stanley
Site Admin
Posts: 1018
Joined: Sat Mar 01, 2014 3:15 am

Re: 9600 baud gps in datalogger

Post by stanley »

Default baudrate is defined in FreematicsPlus.h of the library. It is also possible to specify GPS baudrate by passing it as first argument of gpsInit().
ramsaymike
Posts: 8
Joined: Sun Aug 19, 2018 8:43 pm

Re: 9600 baud gps in datalogger

Post by ramsaymike »

I was able to fine it and can confirm that it works just fine. Thanks for the reply
ramsaymike
Posts: 8
Joined: Sun Aug 19, 2018 8:43 pm

Re: 9600 baud gps in datalogger

Post by ramsaymike »

So it appears that I don't have this figured out! After much frustration I found that the baud rate was hard coded and once changed worked fine! No idea was is going on of course...


bool FreematicsESP32::gpsBegin(unsigned long baudrate, bool buffered, bool softserial)
{
pinMode(PIN_GPS_POWER, OUTPUT);
// turn on GPS power
Serial.println(baudrate);
digitalWrite(PIN_GPS_POWER, HIGH);

if (buffered && !nmeaBuffer) nmeaBuffer = new char[NMEA_BUF_SIZE];
nmeaBytes = 0;

if (!gpsData) gpsData = new GPS_DATA;
memset(gpsData, 0, sizeof(GPS_DATA));

if (taskGPS.running()) {
taskGPS.resume();
} else if (!softserial) {
uart_config_t uart_config = {
.baud_rate = 9600, <<<<<<<<<<<<<<<<<<<<<<< changed here from 115000 <<<<<<<<<<<<<<<<<<<<<<
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 122,
};
Post Reply