Telemetry Pi
On this page
What runs on the car's Raspberry Pi, how to set it up, how to start and stop a run, and how to get the logs.
A Raspberry Pi on the car reads both CAN buses and the BMS. Four services run on it:
| Service | What it does |
|---|---|
telem | Records all CAN and BMS data to the SD card at /mnt/logs, and sends the radio selection over the XBee. |
bms-telemetry | Reads the BMS (an Allion AL1220-BT) over Bluetooth and passes its values to the other services. |
mur-cellular | Sends the live selection over cellular to the backend, which serves it to mur-voir. |
mur-mf4-uploader | Uploads each finished MF4 file to the backend, which archives it in Azure. |
The services run separately. If the cellular link or the backend goes down, telem keeps recording.
The car has two CAN buses:
| Bus | Pi interface | Bitrate |
|---|---|---|
| Control (tractive) | can1 | 500 kbit/s |
| Telemetry | can0 | 1 Mbit/s |
Run day
Section titled “Run day”Check that everything is running:
systemctl status telem bms-telemetry mur-cellular mur-mf4-uploaderWatch the logger and the BMS as the car runs:
journalctl -u telem -u bms-telemetry -ftelem prints a status line every 10 seconds. received should climb, log_dropped and invalid_bms should stay at 0, and log_queue should stay small.
Each time telem starts, it begins a new run. To end a run and start the next one:
sudo systemctl stop telem # finishes writing the last filesudo systemctl start telem # starts a new runTo stop sending data over cellular without stopping the recording, stop the two network services. Restart them to resume:
sudo systemctl stop mur-cellular mur-mf4-uploadersudo systemctl restart mur-cellular mur-mf4-uploaderA power cut loses at most the file being written, which is the last minute of data. The finished files are safe.
To join a new Wi-Fi network or a phone hotspot at the track, run the Wi-Fi tool from the checkout. It scans for networks and connects:
cd ~/Wireless-telemsudo python3 scripts/add_wifi.pyGet the logs
Section titled “Get the logs”Each run gets its own folder in /mnt/logs, holding:
part0001.mf4,part0002.mf4and so on, one per 60 seconds of running.- A copy of every DBC file used, named
bus<id>_<file>.dbc. - The configuration the run used.
manifest.json, with the run’s details, whether it finished, and how many samples were received and dropped.
Check that a run finished cleanly. status should be complete, and received should equal logged:
R=/mnt/logs/$(ls -t /mnt/logs | head -1) # the latest runjq '{status, counters}' "$R/manifest.json"If the power was cut, the manifest still says recording. You can delete any leftover tmp* and *.partial.mf4 files.
The Pi also uploads each finished file to the team’s Azure archive. It keeps its own copy either way. Copy runs off the SD card to work on them, then open them in mur-voir.
Two scripts in Wireless-telem help with a run folder. Run them on a laptop, not the car.
# CAN message rates, intervals and gaps for each busuv run python scripts/can_rates.py logs/RUN/
# Merge the one-minute files into 15-minute files in logs/RUN/merged/uv run python scripts/merge_parts.py logs/RUN/ --parts-per-file 15The MF4 files hold raw CAN frames. To decode them in Python, pass every bus<id>_*.dbc file from the run folder to asammdf’s extract_bus_logging, one (file, bus id) entry each.
Set up a new Pi
Section titled “Set up a new Pi”You need:
- Raspberry Pi OS, with a user called
mur, the CAN controllers set up ascan0andcan1, Bluetooth working, and the log SD card mounted at/mnt/logs. - A fine-grained GitHub token with read-only Contents access to
Wireless-telem,mur-msgsandbms_telemetry. Make it in GitHub under Settings → Developer settings → Fine-grained tokens, with Melbourne-University-Motorsports as the owner and an expiry date. An org admin has to approve it. - The serial path of the car’s XBee radio and the 16-digit address of the base station’s radio. See Radio link.
The Pi bring-up checklist has the same steps with a check after each one.
-
Clone the repo and install it. Paste the token when git asks for a password. The credential store keeps it, so later
git pullanduv syncruns work too.Terminal window git config --global credential.helper storegit clone --recurse-submodules https://github.com/Melbourne-University-Motorsports/Wireless-telemcd Wireless-telemuv python install 3.12 3.13uv syncuv venv --python 3.13 .venv-bmsuv pip install --python .venv-bms/bin/python -r services/bms/bms_telemetry/requirements.txt -
Bring the CAN buses up at the right bitrates on every boot:
Terminal window sudo tee /etc/systemd/network/80-can0.network >/dev/null <<'EOF'[Match]Name=can0[CAN]BitRate=1MEOFsudo tee /etc/systemd/network/80-can1.network >/dev/null <<'EOF'[Match]Name=can1[CAN]BitRate=500KEOFsudo systemctl enable --now systemd-networkd -
Let
murwrite logs and use the radio:Terminal window findmnt /mnt/logs # check the SD card is mountedsudo chown mur:mur /mnt/logssudo usermod -aG dialout mur -
Install the services and fill in the radio settings:
Terminal window sudo install -m 644 deploy/telem.service deploy/bms-telemetry.service /etc/systemd/system/sudo install -m 600 deploy/telem.env.example /etc/telem.envsudoedit /etc/telem.envSet
XBEE_PORTto the car radio’s path, whichls /dev/serial/by-id/lists. SetXBEE_DESTINATIONto the base station radio’s address, not the car’s own. -
Check the clock is synchronised, because the logs use absolute timestamps.
timedatectlshould saySystem clock synchronized: yes. -
Start both services, BMS first, and have them start on boot:
Terminal window sudo systemctl daemon-reloadsudo systemctl enable bms-telemetry telemsudo systemctl start bms-telemetrysudo systemctl start telem
Cellular services
Section titled “Cellular services”mur-cellular and mur-mf4-uploader install separately from the logger, as versioned releases under ~/.local/share/mur-cellular/. The Pi also has to be on the MUR tailnet, and needs the backend’s upload token. A maintainer sets this up by following the deployment section of the Pi-to-dashboard runbook.
Updating the cellular services never touches the logger’s checkout. To roll back, stop the two services, point ~/.local/share/mur-cellular/current at the previous release, and start them again.
Change what’s sent live
Section titled “Change what’s sent live”Everything is always recorded at full rate. The live selection only decides what goes over the radio and cellular links.
Both links take their selection from the [[live]] entries in config/telem.toml. Each entry names a bus, a CAN ID and a rate:
[[live]] # 0x0A5 INV_MotorPosition: motor rpmbus = 0id = 165hz = 3.0The cellular service also sends every message that carries a state signal or fault bits, at 1 Hz. Cellular rates have to be above 0 and at most 10 Hz. Each cellular release carries its own copy of the configuration, so a change needs a new release. For the radio limits, see Radio link.
Signal definitions come from mur-msgs, pinned to one commit in services/telem/pyproject.toml. When you move the pin, update the lockfile and the copy of the API in vendor/mur-msgs at the same time. Then run uv sync on both the Pi and the base station.
Troubleshooting
Section titled “Troubleshooting”| Problem | Likely cause | Check |
|---|---|---|
git clone or uv sync keeps asking for a password, or can’t find mur-msgs | The token is missing a repo or isn’t approved | The token needs all three repos and an org admin’s approval. |
telem exits straight away | A bad /etc/telem.env, or /mnt/logs isn’t mounted | systemctl status telem, findmnt /mnt/logs |
No Radio connected line | The wrong port, or mur isn’t in dialout | ls /dev/serial/by-id/ and id mur. Log out and back in after usermod. |
received doesn’t climb | A bus is down or at the wrong bitrate | ip -details -statistics link show can0, then can1 |
| The inverter or SBG signals don’t decode | An old checkout, or uv sync wasn’t run after a pull | git pull && uv sync |
invalid_bms climbs, or no BMS values | The BMS isn’t connected | journalctl -u bms-telemetry, and check AL1220BT shows in bluetoothctl scan on |
| mur-voir says No car data | The cellular services are down, or the Pi has no connection | systemctl status mur-cellular, journalctl -u mur-cellular -f |
Known gaps:
- A BMS error other than a bad value ends the whole run, CAN logging included. systemd restarts it as a new run.
- CAN ID
0x170on the Telemetry bus isn’t in any DBC, so it’s recorded but never decoded.
More detail
Section titled “More detail”- Wireless-telem README: configuration, running on a laptop, logs and tests.
- Pi bring-up checklist: setup with checks, including the radio’s counters.
- Pi-to-dashboard runbook: the cellular publisher, the backend, the MF4 uploader and their tests.