Skip to content

Instantly share code, notes, and snippets.

@polprog
Created May 29, 2025 17:34
Show Gist options
  • Select an option

  • Save polprog/bcfdad14420ef335a9933af720913fd6 to your computer and use it in GitHub Desktop.

Select an option

Save polprog/bcfdad14420ef335a9933af720913fd6 to your computer and use it in GitHub Desktop.
import serial
ser = serial.Serial(
port='/dev/ttyACM0', # adjust to your setup
baudrate=230400, # old baudrate
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS
)
if not ser.isOpen():
print("Failed to open serial port")
# https://content.u-blox.com/sites/default/files/products/documents/u-blox8-M8_ReceiverDescrProtSpec_UBX-13003221.pdf?utm_content=UBX-13003221
# 31.3.1.1 Set protocols and baud rate Page 178
# NMEA checksum calculator: https://www.meme.au/nmea-checksum.html
ser.write(b"$PUBX,41,1,0007,0003,9600,0*10\r\n")
ser.close()
print("ok.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment