Last active
February 28, 2025 15:25
-
-
Save jj1bdx/03780b1cef9e8c45469447d4b2f5a9f7 to your computer and use it in GitHub Desktop.
Get QZSS status from u-blox MAX-M10s via UBX protocol using pyubx2
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
#!/usr/bin/env python3 | |
import signal | |
import socket | |
import sys | |
from pyubx2 import UBXReader, UBX_PROTOCOL | |
def signal_handler(signal, frame): | |
print('Terminated by CTRL/C') | |
sys.exit(0) | |
signal.signal(signal.SIGINT, signal_handler) | |
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as stream: | |
stream.connect(("HOSTNAME", "PORT-NUMBER")) | |
ubr = UBXReader(stream, protfilter=UBX_PROTOCOL) | |
for raw, msg in ubr: | |
if msg.identity == 'RXM-SFRBX': | |
if msg.gnssId == 5: | |
sys.stdout.buffer.write(raw) | |
sys.stdout.flush() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment