Created
May 29, 2025 17:34
-
-
Save polprog/bcfdad14420ef335a9933af720913fd6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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