Skip to content
Melbourne University RacingMelbourne University RacingMUR Autonomous WikiAutonomous Wiki

Radio link

On this page

Receive live data from the car over the XBee radios, and view it in mur-voir or Marple.

The car can also send live data over a pair of Digi XBee XR 900 radios, one on the car and one plugged into a laptop at the track. The laptop runs the base station, which decodes the data and saves it. This link doesn’t need internet access or the tailnet.

The radio link is slow, at 9600 baud with a budget of about 500 bytes per second. The default selection is the shakedown set:

DataRate
Motor rpm, front wheel speed3 Hz
Pedal status2 Hz
Inverter state and faults, ECU and TTCS status, node heartbeats, rear GPS position and velocity1 Hz
Selected BMS values0.5 Hz

When the link can’t keep up, the car sends the latest values less often instead of queueing old ones. None of this affects what the Pi records.

Set up both radios in Digi’s XCTU:

  1. Give both radios the same RF and network settings.
  2. Set API mode, AP=1 or AP=2.
  3. Set the baud rate to match baud under [radio] in config/telem.toml, which is 9600 by default.
  4. Save the settings and close XCTU’s serial consoles, so the port is free.
  5. Write down each radio’s 16-digit address, which is its SH and SL values together.

On the car, XBEE_DESTINATION in /etc/telem.env is the base station radio’s address. See Telemetry Pi.

To send more data, raise the baud rate in both XCTU and config/telem.toml before you add messages or raise rates. Keep max_payload within the radio’s NP limit.

You need uv and access to Wireless-telem.

Terminal window
git clone --recurse-submodules https://github.com/Melbourne-University-Motorsports/Wireless-telem
cd Wireless-telem
uv sync

Plug in the base station radio and find its port. On a Mac it’s /dev/cu.usbserial-..., on Linux /dev/serial/by-id/..., and on Windows COM....

Terminal window
ls /dev/cu.usbserial-*
uv run base-station --port /dev/cu.usbserial-XXXX --source CAR_RADIO_ADDRESS

--source is the car radio’s address. The base station prints nothing while it runs. It writes every sample to logs/live.jsonl and an MF4 to logs/live_run_<time>_<run id>.mf4.

To check packets are arriving with no gaps, run this in a second terminal. It prints a dot per packet and a GAP line when packets go missing.

Terminal window
tail -n 0 -f logs/live.jsonl | jq --unbuffered -r .sequence | awk '{ if (NR>1 && $1!=p+1) print "\nGAP", p, "->", $1, "missing", $1-p-1; else printf "."; fflush(); p=$1 }'

Press Ctrl-C to stop the base station. It prints its counters:

CounterMeaning
foreign_radioPackets from another radio. --source is wrong.
invalid_packetsThe car and base station run different versions. Update both.
decode_errorsA CAN frame doesn’t match its DBC.
No countersNo radio traffic arrived at all.

mur-voir can follow the base station’s logs/live.jsonl through a small bridge. From a mur-voir checkout, run:

Terminal window
npm run radio-bridge -- --input /absolute/path/to/Wireless-telem/logs/live.jsonl --port 1885

Then open File → Connect in mur-voir and enter:

SettingValue
SourceMQTT direct (debug)
Addressws://127.0.0.1:1885
Topic filtermur/signal/#
MappingJSON per signal
Username and passwordEmpty
CAN timestampUnchecked

The bridge only sends new packets, so connect before the car starts sending. It has no history. To share it with other laptops on the pit network, add --host 0.0.0.0 and connect them to ws://<base station IP>:1885. The bridge has no password or encryption, so only do this on a network you trust.

The base station can also upload live data to Marple.

  1. Create a realtime stream in Marple. Set its name as stream under [marple] in config/telem.toml. The default is vehicle-live.

  2. Install the Marple extra with uv sync --all-packages --all-extras.

  3. Start the base station with your Marple token and --marple:

    Terminal window
    export MARPLE_API_TOKEN='your-token'
    uv run base-station --port /dev/cu.usbserial-XXXX --source CAR_RADIO_ADDRESS --marple

The base station makes a Marple dataset for each run on the car. If Marple fails, reception carries on and logs/live.jsonl keeps the data, but nothing uploads it later.

You can run the whole radio path on one laptop, with simulated CAN traffic and no radios. Run each command in its own terminal, starting with the base station:

Terminal window
# Terminal 1: receive the simulated radio traffic
uv run base-station --udp-port 15001 --output logs/live.jsonl
# Terminal 2: record simulated CAN and send the live selection
uv run telem --simulate-port 15000 --radio-udp 15001 --no-bms
# Terminal 3: make traffic for both CAN buses
uv run can-simulator --udp-port 15000

To test the real radios with simulated CAN, plug both into the laptop:

Terminal window
# Terminal 1: --source is the car radio's address
uv run base-station --port /dev/cu.usbserial-BASE --source CAR_RADIO_ADDRESS
# Terminal 2: --destination is the base station radio's address
uv run telem --simulate-port 15000 --port /dev/cu.usbserial-CAR --destination BASE_RADIO_ADDRESS --no-bms
# Terminal 3
uv run can-simulator

Stop telem with Ctrl-C so it finishes its log. Add --duration 30 to end a test after 30 seconds.