MQTT API Reference¶
The RTK Base uses MQTT for real-time communication, configuration, and data streaming.
Connection Details¶
- Broker:
mqtt.yamabikorobots.net(production) - Port:
8883(MQTT over TLS) - Client ID:
<serial_number> - Authentication: TLS client certificates
Topic Structure¶
All topics use the format: base/<SN>/<action>
Where <SN> is the RTK Base serial number (e.g., BRRB000021)
DRTK Publication¶
base/{SN}/drtk¶
Type: Publish
Raw RTCM data stream. Published as soon as RTCM data is available from the ZED module.
Behavior:
- Payload is raw bytes (binary RTCM data)
- Published continuously when operational
- If
transfer/mqtt/rtcm/optimizationis enabled, requires keep-alive messages
Keep-Alive Mechanism:
When optimization is enabled, robots must publish to base/keepAlive/<NAME>/<SN> periodically to maintain the RTCM stream.
REST-like API over MQTT¶
The RTK Base emulates its REST API over MQTT for environments where HTTP is not available.
Info Request¶
Request:
- Topic: base/{SN}/info/get
- Payload: unused (empty)
Response:
- Topic:
base/{SN}/info - Payload: JSON info object (same as HTTP
/get-info)
Change Configuration¶
Request:
- Topic: base/{SN}/change/post
- Payload: JSON configuration object
Response:
- Topic:
base/{SN}/change/resp - Payload: Response JSON with result and leftover fields
See REST API for available configuration fields.
System Commands¶
Request:
- Topic: base/{SN}/system/post
- Payload: Parameter string (the part after ? in HTTP URI)
Response:
- Topic:
base/{SN}/notice - Payload: Text output from command
Generic Command¶
Request:
- Topic: base/{SN}/cmd
- Payload: JSON or system command string
See command formats below.
Debug Logs¶
Log Retrieval¶
Request:
- Topic: debug/log/get
- Payload: unused
Response:
- Topic:
debug/log/lines/{IDX} - Payload: One log line per message
- QoS: 1 (at least once delivery)
- Index:
{IDX}is the line index
Value Storage (NVS)¶
Get Value¶
Request:
- Topic: base/{SN}/val/get
- Payload: ID (value identifier)
Response:
- Topic:
base/{SN}/val - Payload:
ID HEXVALUE
Set Value¶
Request:
- Topic:
base/{SN}/val/set - Payload:
ID HEXVALUE
Response:
- Topic:
base/{SN}/val/ack - Payload: Acknowledgment
Delete Value¶
Request:
- Topic:
base/{SN}/val/del - Payload:
ID
Response:
- Topic:
base/{SN}/val/ack - Payload: Acknowledgment
UBX Protocol¶
UBX Forwarding¶
Request:
- Topic: base/{SN}/ubx/post
- Payload: Binary UBX packet or hex string
Behavior: - Upon receiving this command, the RTK Base forwards all UBX packets to MQTT for 30 seconds - Forwarding format follows the format of the last received packet (binary or hex)
Response:
- Topic:
base/{SN}/ubx - Payload: UBX packets
Spectrum Analyzer¶
Get Spectrum Data¶
Request:
- Topic: base/{SN}/span/get
- Payload: unused
Response:
- Topic:
base/{SN}/span - Payload: JSON spectrum data
Example Response:
{
"bands": [
{
"center": 1583461250,
"span": 128000000,
"res": 500000,
"pga": 57,
"buck": [67, 68, 67, 66, ...]
},
{
"center": 1224006250,
"span": 128000000,
"res": 500000,
"pga": 57,
"buck": [67, 69, 69, 70, ...]
}
]
}
Satellite Information¶
Get Satellite Data¶
Request:
- Topic: base/{SN}/sat/get
- Payload: unused
Response:
- Topic: base/{SN}/sat
- Payload: JSON array of satellite objects
Example Response:
[
{
"gnss": "gps",
"svid": 5,
"pr": 2,
"q": 7,
"cno": 43,
"elev": 48,
"azim": 212,
"flags": ["used", "healthy", "diffcorr"],
"orbit": "ano",
"corr": ["sbas", "pr", "doppler"]
},
{
"gnss": "gal",
"svid": 24,
"pr": 3,
"q": 7,
"cno": 38,
"elev": 27,
"azim": 46,
"flags": ["used", "healthy"],
"orbit": "ano",
"corr": []
}
]
Fields:
gnss: GNSS system (gps, glonass, gal, bds, sbas, navic)svid: Space Vehicle IDpr: Pseudorangeq: Quality indicatorcno: Carrier-to-Noise ratio (dB-Hz)elev: Elevation angle (degrees)azim: Azimuth angle (degrees)flags: Status flags (used, healthy, diffcorr)orbit: Orbit source (ano, eph, alm)corr: Applied corrections
Fast SVIN Query¶
Request RTCM Source¶
See Fast SVIN technical documentation.
Query:
- Topic:
base/{SN}/query/rtcm/req - Payload:
lat=LAT,lon=LON
Response:
- Topic:
base/{SN}/query/rtcm/resp - Payload:
topic=RTCM_TOPIC,keepalive=KA_TOPIC,dist=DISTANCE,prio=PRIO
Production Mode¶
Note: These interfaces are only available when the RTK Base is in production test mode.
UI Display¶
Topics:
production/base/{SN}/UI/USER-TITLE: Display title (string)production/base/{SN}/UI/USER-TEXT: Display text (string)production/base/{SN}/UI/INTERACT: Interaction command
Interaction Types:
- Button:
OK,CANCEL,PASS - Text Input:
TEXT;name(name = default text) - List:
LIST;a;b;c;d;e
Test Report¶
Topic: production/base/{SN}/UI/test-report
Payload: JSON test results
UI Interaction Response¶
Topic: production/base/{SN}/UI/INTERACT/resp
Payload: User response (button name, list item, or text input)
Device Command¶
Topic: production/base/{HW_ID}/cmd
Commands:
whereAreYou: Start 10-second Christmas blinking animation (for locating device)- Any other payload: Treated as standard command
Device Ready¶
Topic: production/base/{SN}/ready
Payload: 1 (published when base is ready for production test)
Who Is Alive¶
Topic: production/whoIsAlive
Response: production/base/{SN}/ready with payload 1
Keep-Alive¶
base/keepAlive/{NAME}/{SN}¶
Type: Subscribe (base listens)
Used to trigger RTCM publication when optimization is enabled.
Parameters:
{NAME}: Identifier of the robot or entity requesting data{SN}: RTK Base serial number
Behavior:
- Robots must publish periodically to this topic
- RTCM stream stops if no keep-alive received for 5 minutes
- Prevents unnecessary bandwidth usage
JSON Command Format¶
Firmware Update¶
{
"cmd_type": "updateBase",
"cmd_param": {
"url": "http://myStaticFileServer.com/RTK_BASE_4.0.2.bin"
}
}
ZED Configuration Update¶
{
"cmd_type": "updateZedConfig",
"cmd_param": {
"url": "http://myStaticFileServer.com/Zed_Config_file_1.3.txt"
}
}
QoS Levels¶
| Topic Pattern | QoS | Description |
|---|---|---|
base/{SN}/drtk |
0 | RTCM data (best effort) |
base/{SN}/info |
1 | Info responses |
debug/log/lines/{IDX} |
1 | Log lines |
production/base/{SN}/ready |
1 | Production status |
Security¶
- All production MQTT traffic uses TLS encryption
- Client certificates are used for authentication
- Certificate lifecycle managed automatically
- Production test mode uses separate topic namespace