7.6 KiB
7.6 KiB
Script Summary
This repo is centered on GNSS/RTK work: BLE communication with an H11-style receiver, NTRIP caster testing, RTCM stream capture/parsing, and a Point One GraphQL console.
Setup
Install the Python dependencies used by the FastAPI/BLE tools:
pip install -r requirements.txt
Some scripts also need optional packages that are not listed in requirements.txt:
pip install pyserial bleak
Root Python Scripts
| Script | What it does | Syntax |
|---|---|---|
app.py |
FastAPI web app for BLE scan/connect/send, AT command UI, NMEA parsing, measurement logging, NTRIP correction streaming, and log/weather review. Serves static/index.html and static/app.js. |
python app.py then open http://127.0.0.1:8100 |
tcp_listener.py |
Simple raw TCP server that prints incoming data from any client. | python tcp_listener.py --host 0.0.0.0 --port 12000 |
capture_raw_ntrip.py |
Connects to the hardcoded NTRIP caster, sends periodic GGA, captures 60 seconds of raw stream bytes to ntrip_raw_<timestamp>.bin, and writes a text log. |
python capture_raw_ntrip.py |
ntrip_test.py |
Connects to the hardcoded NTRIP caster and prints parsed RTCM messages, base station position messages, baseline distance, and running stats. | python ntrip_test.py |
ntrip_message_survey.py |
Surveys the hardcoded caster for 60 seconds and counts RTCM message types, with special attention to 1005/1006 base position messages. | python ntrip_message_survey.py |
rtcm_to_csv.py |
Captures RTCM from the hardcoded caster for a configurable duration, parses selected message types with RTCMDetailedParser, and exports CSV. |
python rtcm_to_csv.py --duration 60 --output rtcm_messages.csv --types 1005,1006,1008 --verbose |
parse_rtcm_messages.py |
Offline RTCM v3 frame scanner. Reads a binary file or stdin, verifies CRC-24Q, auto/raw/chunked decodes, prints messages, and can export frames/CSV/JSONL. | python parse_rtcm_messages.py ntrip_raw_20260605_120848.bin --mode auto --hex --csv messages.csv --jsonl messages.jsonl --out-dir frames --write-stream clean.bin |
parse_chunked_rtcm.py |
Offline analyzer for HTTP chunked NTRIP captures. Dechunks the input, optionally saves clean RTCM bytes, and summarizes RTCM messages. | python parse_chunked_rtcm.py ntrip_raw_20260605_120848.bin --save-clean --max-messages 100 |
analyze_rtcm_binary.py |
Offline binary/ASCII scanner for RTCM-like frames. Shows ASCII blocks, message type counts, and optional payload hex. Does not verify CRC. | python analyze_rtcm_binary.py ntrip_raw_20260605_120848.bin --hex --type 208 --max-messages 10 |
analyze_rtcm_correct.py |
Offline stream analyzer with bit-level RTCM type/station parsing plus ASCII block detection. | python analyze_rtcm_correct.py ntrip_raw_20260605_120848.bin --hex --type 1005 --max-items 100 --no-ascii |
debug_1005.py |
Live debug tool for hardcoded caster. Captures RTCM 1005/1006 messages and prints detailed bit fields, ECEF, WGS84 position, and rover baseline distance. | python debug_1005.py |
rtcm_208_capture.py |
Live capture tool for proprietary RTCM type 208. Writes payloads to rtcm_208_raw_<timestamp>.bin and an index file. |
python rtcm_208_capture.py |
rtcm_208_decoder.py |
Live type-208 decoder. Captures type 208, tries ASCII/UTF-8/CSV interpretation, and writes rtcm_208_messages.csv plus parsed fields if present. |
python rtcm_208_decoder.py |
rtcm_208_analyzer.py |
Live type-208 analyzer against the POLARIS_LOCAL mountpoint. Hex-dumps samples and compares static/dynamic bytes. |
python rtcm_208_analyzer.py |
test_ecef_convert.py |
Standalone sanity test for converting hardcoded ECEF coordinates to latitude/longitude/altitude and comparing to a rover position. | python test_ecef_convert.py |
Root Python Modules
These are primarily imported by other scripts, but they can also be used from a Python shell or another script.
| Module | What it does | Usage syntax |
|---|---|---|
rtcm_parser.py |
Streaming RTCM parser with HTTP chunked decoding, message stats, 1005/1006 base station position parsing, 1033 descriptor handling, and ECEF-to-LLA conversion. Used by app.py and ntrip_test.py. |
from rtcm_parser import RTCMParser |
rtcm_detailed_parser.py |
More detailed RTCM parser with CSV export. Handles 1005, 1006, 1007, 1008, 1033, MSM4/MSM7 summaries, 1019, and 1020. Used by rtcm_to_csv.py. |
from rtcm_detailed_parser import RTCMDetailedParser |
Example module use:
from rtcm_detailed_parser import RTCMDetailedParser
parser = RTCMDetailedParser()
messages = parser.parse_messages(data, timestamp="2026-06-22T12:00:00Z")
parser.export_to_csv("rtcm_messages.csv", message_types=[1005, 1006])
ntrip/ Python Scripts
| Script | What it does | Syntax |
|---|---|---|
ntrip/client.py |
Configurable NTRIP forwarder. Pulls RTCM from a hardcoded caster, optionally forwards to serial or TCP, sends periodic GGA, can parse NMEA from serial, and prints RTCM/debug stats. Edit settings at the top of the file before use. | python ntrip\client.py |
ntrip/ble_client.py |
BLE scanner/client using bleak. Finds the configured BLE receiver, subscribes to a NMEA notify characteristic, and prints raw/NMEA data. Edit BLE UUID/name constants if needed. |
python ntrip\ble_client.py |
ntrip/bluetooth_nmea_parser.py |
Bluetooth serial NMEA parser using pyserial. Reads GGA/GSA sentences from the configured serial port and prints fix quality, DOP, estimated accuracy, and position. |
python ntrip\bluetooth_nmea_parser.py |
Web and Browser JavaScript
| File | What it does | Syntax |
|---|---|---|
static/app.js |
Browser-side client for app.py. Handles BLE scan/connect, characteristic selection, command building/sending, WebSocket events, measurement logging, log viewing, plots, and dashboard metrics. |
Served by python app.py; open http://127.0.0.1:8100 |
pointone/server/index.js |
Local Node web server for the Point One GraphQL console. Serves static UI files and proxies /api/graphql requests with a configured bearer token. |
cd pointone; npm start or node server/index.js |
pointone/server/pointone-config.js |
Default Node console config: port, GraphQL URL, token from env, headers, timeout, plus optional local override. | Set env vars, then cd pointone; npm start |
pointone/server/pointone-config.local.js |
Local override for Point One GraphQL config. Contains local access tokens and should be treated as private machine-specific config. | Loaded automatically by pointone/server/index.js |
pointone/public/app.js |
Browser-side Point One GraphQL console. Loads config, offers example queries, sends GraphQL requests to /api/graphql, formats variables, and copies cURL. |
Served by cd pointone; npm start; open http://localhost:5177 |
Postman Assets
| File | What it does | Syntax |
|---|---|---|
postman/Soracom_API.postman_collection.json |
Postman collection for Soracom API requests. | Import into Postman |
postman/Soracom_API.postman_environment.json |
Postman environment values for the Soracom collection. | Import into Postman |
postman/soracom-api.en.yaml |
Soracom OpenAPI spec. | Import into Postman or another OpenAPI tool |
Notes
- Several live NTRIP scripts have caster credentials, mountpoints, and rover coordinates hardcoded near the top of the file.
pointone/server/pointone-config.local.jscontains local access tokens. Keep it private and avoid committing/sharing it.- The most robust offline parser is
parse_rtcm_messages.pybecause it validates RTCM CRC-24Q and supports raw/chunked input.