Changing baud rate of a gps receiver

Hi all, I have a Beitian BD 280 ZR GPS receiver. The following code is used to display its data:

#include <SoftwareSerial.h>

#define PIN_RXD 3
#define PIN_TXD 4

#define GPS_BAUD 9600

// serial connection to the GPS device
SoftwareSerial gpsSerial(PIN_RXD, PIN_TXD);

void setup()
{
    Serial.begin(9600);
    gpsSerial.begin(GPS_BAUD);
}

void loop()
{
    // Output raw GPS data to the serial monitor
    while (gpsSerial.available() > 0) {
        Serial.write(gpsSerial.read());
    }
}

How can I change its baud rate to 4800?
My first thought was to change the argument of gpsSerial.begin from 9600 to 4800 did not help.
The datasheet doesn't say anything, and on the Amazon Q&A page I could only read someones answer: " sending a HEX array to the module to change the update rate and baud rate. I posted an image for the HEX array that works for me." But this image is nowhere to find.
So, if someone knows how to change the baudrate by sending a command or similar to the module, please let me know.

Thanks,

-richard

I don't know that module, but why would you want to go slower?

Please post a link to the Amazon page

Because my commercial Second display for GPS works with NMEA0183 standard of 4800 baud.

@UKHeliBob: Amazon.com

The board appears to have a NEO-6M GPS module

Have you using u-center ?

so they show some commands to set at 115200 bauds.
You need the same for 4800 bauds

115200 is 0x 0001C200

which you can find in the binary code

I would try with 0x000012C0 which is 4800 so maybe sending C0 12 00 00

I would not issue the save command so that a reset would go back to normal operations.


As @UKHeliBob said, seems you could also do that directly from u-center which could be easier

No. u-center is, as far as I know, a Windows application, and I have no machine with Windows running, only Linux.

did you try something like this

I think I copied correctly the binary from the amazon image and I just changed what appears to be the 115200 value into 4800

I HAVE NO IDEA WHAT IT EXACTLY DOES, IF THIS WORKS OR NOT OR IF THAT CAN FREEZE YOUR MODULE FOREVER.... USE AT YOUR OWN RISK

const byte baudRateCmd[] = {
  0xB5, 0x62, 0x06, 0x00, 0x01, 0x00, 0x01, 0x08,
  0x22, 0xB5, 0x62, 0x06, 0x00, 0x14, 0x00, 0x01, 
  0x00, 0x00, 0x00, 0xD0, 0x08, 0x00, 0x00, 
  0xC0, 0x12, 0x00, 0x00,                             // 0x000012C0 in little endian = 4800
  0x07, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
  0xC0, 0x7E, 0xB5, 0x62, 0x06, 0x00, 0x01, 0x00,
  0x01, 0x08, 0x22
};

#include <SoftwareSerial.h>

#define PIN_RXD 3
#define PIN_TXD 4

// serial connection to the GPS device
SoftwareSerial gpsSerial(PIN_RXD, PIN_TXD);

void setup()
{
  Serial.begin(115200);  // open the Serial Monitor at 115200 bauds to see the communication flow

  Serial.println("Opening GPS connexion at 9600 bauds");
  gpsSerial.begin(9600);

  Serial.println("Sending command to move to 4800 bauds");
  gpsSerial.write(baudRateCmd, sizeof baudRateCmd);
  delay(100);

  Serial.println("Terminating communication at 9600 bauds");
  gpsSerial.end();
  delay(10);

  Serial.println("Opening GPS connexion at 4800 bauds");
  gpsSerial.begin(4800);

  Serial.println("Now listening to GPS communication");
}

void loop() {
  if (gpsSerial.available()) Serial.write(gpsSerial.read());
}

and I don't know if a baud change is effective immediately, so may be it won't work

open your serial monitor at 115200 bauds to see if that works

Sorry, doesn't work. The serial monitor shows a line with characters appearing, not readable, no CR/LF. The module doesn't get stuck, that's the positive message :slight_smile:

Did you find an appropriate image on Amazon? I'm sorry, I didn't ...

The image was posted in post 7 ➜ You have all the hex codes to send

Did you switch the serial monitor to 115200?

yes

Ok… so worth finding the address of the manufacturer and ask the question or find a PC and see what command gets sent

Can you show a screen shot of that? Did the messages in post #9 get printed?

This appears to be at least close to the command set for the device.

From what I can it expects a CFG-PRT (0x06 0x00) command to set the baud rate.

See page 123-124 in the manual above.

4 bytes header & command (0xB5 0x62 0x06 0x00)
2 byte payload length
20 bytes payload (portID, res0, txReady, mode, baudRate, inProtoMask, outProtoMask, flags, res3)
2 bytes check sum (described on page 79)

Not trivial, but not impossible.

Interesting- that’s a bit I did not modify when updating the payload. Worth calculating the new check sum and injecting it in the payload

concerning post #9:
Since the picture you copied the code from also shows code for changing the update to 10 Hz and to save the changes, I also added these lines:

  0xB5, 0x62, 0x06, 0x00, 0x01, 0x00, 0x01, 0x08,
  0x22, 0xB5, 0x62, 0x06, 0x00, 0x14, 0x00, 0x01, 
  0x00, 0x00, 0x00, 0xD0, 0x08, 0x00, 0x00, 
  0xC0, 0x12, 0x00, 0x00,                             // 0x000012C0 in little endian = 4800
  0x07, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
  0xC0, 0x7E, 0xB5, 0x62, 0x06, 0x00, 0x01, 0x00,
  0x01, 0x08, 0x22
};

const byte baudRate2Cmd[] = {0xB5, 0x62, 0x06, 0x08, 0x00, 0x00, 0x0E, 0x30, 
0xB5, 0x62, 0x06, 0x08, 0x06, 0x00, 0x64, 0x00, //GPS update 10 Hz
0x01, 0x00, 0x01, 0x00, 0x7A, 0x12, 0xB5, 0x62, 
0x06, 0x08, 0x00, 0x00, 0x0E, 0x30};

const byte baudRate3Cmd[] = {0xB5, 0x62, 0x06, 0x13, 0x00, 0x00, 0x19, 0x51,
0xB5, 0x62, 0x06, 0x09, 0x0D, 0x00, 0x00, 0x00, //Save permanently
0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x17, 0x31, 0xBF};
#include <SoftwareSerial.h>

#define PIN_RXD 3
#define PIN_TXD 4

// serial connection to the GPS device
SoftwareSerial gpsSerial(PIN_RXD, PIN_TXD);

void setup()
{
  Serial.begin(115200);  // open the Serial Monitor at 115200 bauds to see the communication flow

  Serial.println("Opening GPS connexion at 9600 bauds");
  gpsSerial.begin(9600);

  Serial.println("Sending command to move to 4800 bauds");
  gpsSerial.write(baudRate1Cmd, sizeof baudRate1Cmd);
  delay(100);
  gpsSerial.write(baudRate2Cmd, sizeof baudRate2Cmd);
  delay(100);
  gpsSerial.write(baudRate3Cmd, sizeof baudRate3Cmd);
  delay(100);

  Serial.println("Terminating communication at 9600 bauds");
  gpsSerial.end();
  delay(10);

  Serial.println("Opening GPS connexion at 4800 bauds");
  gpsSerial.begin(4800);

  Serial.println("Now listening to GPS communication at 4800");
}

void loop() {
  if (gpsSerial.available()) Serial.write(gpsSerial.read());
}

but no effect. It continues to send at 4800.
I borrowed a laptop with Win11 and installed ublox center, but also with this software I got no change in the behaviour of the module. Finally I wrote to the manufacturer.

Did you update the CRC in the codes?

No. I'm aware that CRC is a kind of checksum, but I don't know how to calculate and how to update it.