Created
June 9, 2023 15:00
-
-
Save matteobertozzi/c22de3c792af3a046bb86c161c041c82 to your computer and use it in GitHub Desktop.
Read U-blox M9N GNSS from /dev/ttyS3
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 # (ubuntu python3-serial package) - https://pyserial.readthedocs.io/en/latest/ | |
def gps_read(): | |
# nROK 1031 Built-in U-blox M9N GNSS is on /dev/ttyS3 (Ubuntu 22.04 LTS) | |
with serial.Serial('/dev/ttyS3', baudrate=38400) as sd: | |
sd.flushInput() | |
sd.flushOutput() | |
while True: | |
yield sd.readline() | |
for nmea_sentence in gps_read(): | |
print(nmea_sentence) # b'$GNRMC,.... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment