obd-poller over the K-line via the Bluetooth ELM327; gnss publisher; elm_connected
Rust (L4T) / Clippy, test, build, glibc (push) Failing after 1s
/ crosscheck (push) Successful in 1s

obd-poller drops its CAN socket: the Z27AG answers OBD-II only on ISO 9141-2.
It holds a raw RFCOMM link to the ELM (no pairing, no root), fixes the protocol
(ATSP3) so nothing probes CAN, publishes the obd_* signals, and releases the
adapter after a minute of ECU silence so it can sleep.
gnss: gpsd's fix as yukart/gnss/<signal>. orin-status: elm_connected from BlueZ.
One native deploy script (deploy-native.sh BIN) behind the per-service ones;
/etc/default/yukart-elm holds the adapter's address.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DDwfd6Ki8UfG4hK6W5YpJz
This commit is contained in:
2026-10-13 22:57:30 +09:00
parent 54171aaf27
commit cce9711119
19 changed files with 809 additions and 405 deletions
+4 -40
View File
@@ -1,42 +1,6 @@
#!/usr/bin/env bash
# Build the decoder natively on the development Orin, check it against the car's
# glibc, and install it on the car Orin as the yukart-decoder service.
# Build decoder natively on the development Orin and install it on the car Orin as
# yukart-decoder: scripts/deploy-native.sh does the work.
#
# usage: scripts/deploy-decoder.sh [host] (default: mikkeli-orin-nano)
# env: BUILD_HOST (default: mikkeli-orin-nano-2)
#
# Builds what is pushed, not the working tree: the build host pulls master of
# svc-core and contracts under ~/dev/yukart/; the signal layouts are compiled in
# from contracts' signals.json, so a registry change needs a redeploy. Native like
# orin-status, on the preferred build host (check-glibc.sh gates it either way).
set -euo pipefail
HOST="${1:-mikkeli-orin-nano}"
BUILD_HOST="${BUILD_HOST:-mikkeli-orin-nano-2}"
cd "$(dirname "$0")/.."
BIN="$(mktemp -d)/decoder"
ssh "$BUILD_HOST" 'set -e
mkdir -p ~/dev/yukart && cd ~/dev/yukart
for r in svc-core contracts; do
[ -d $r ] || git clone -q http://192.168.2.199:3005/yukart/$r.git
git -C $r pull -q --ff-only
done
cd svc-core && ~/.cargo/bin/cargo build --release --bin decoder 2>&1 | tail -1
git log --oneline -1'
scp -q "$BUILD_HOST:dev/yukart/svc-core/target/release/decoder" "$BIN"
scripts/check-glibc.sh "$BIN"
# Binary lives under ~/infra per the host repo's guidelines; /usr/local/bin gets a symlink.
ssh "$HOST" 'mkdir -p ~/infra/svc-core'
scp -q "$BIN" "$HOST:infra/svc-core/decoder.new"
scp -q deploy/yukart-decoder.service "$HOST:infra/svc-core/yukart-decoder.service"
ssh "$HOST" 'set -e
mv ~/infra/svc-core/decoder.new ~/infra/svc-core/decoder
sudo ln -sfn "$HOME/infra/svc-core/decoder" /usr/local/bin/yukart-decoder
sudo install -m 0644 ~/infra/svc-core/yukart-decoder.service /etc/systemd/system/yukart-decoder.service
sudo systemctl daemon-reload
sudo systemctl enable yukart-decoder.service >/dev/null
sudo systemctl restart yukart-decoder.service
sleep 1
systemctl --no-pager --lines=5 status yukart-decoder.service'
# usage: scripts/deploy-decoder.sh [host] (default: mikkeli-orin-nano)
exec "$(dirname "$0")/deploy-native.sh" decoder "$@"
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
# Build gnss natively on the development Orin and install it on the car Orin as
# yukart-gnss: scripts/deploy-native.sh does the work.
#
# usage: scripts/deploy-gnss.sh [host] (default: mikkeli-orin-nano)
exec "$(dirname "$0")/deploy-native.sh" gnss "$@"
+55
View File
@@ -0,0 +1,55 @@
#!/usr/bin/env bash
# Build one svc-core binary natively on the development Orin, check it against the
# car's glibc, and install it on the car Orin as the yukart-<bin> service.
#
# usage: scripts/deploy-native.sh BIN [host] (host default: mikkeli-orin-nano)
# env: BUILD_HOST (default: mikkeli-orin-nano-2)
#
# Builds what is pushed, not the working tree: the build host pulls master of
# svc-core and contracts under ~/dev/yukart/. Signal names, units and layouts are
# compiled in from contracts' signals.json, so a registry change needs a redeploy.
# Native because std::process::Command cross-compiled against the workstation's
# newer glibc links GLIBC_2.39 symbols the car cannot load (check-glibc.sh gates it).
#
# A service that reads /etc/default/yukart-elm (the ELM327's address) gets the
# repo's copy installed when the host has none; an existing one is left alone.
set -euo pipefail
BIN="${1:?usage: scripts/deploy-native.sh BIN [host]}"
HOST="${2:-mikkeli-orin-nano}"
BUILD_HOST="${BUILD_HOST:-mikkeli-orin-nano-2}"
cd "$(dirname "$0")/.."
UNIT="deploy/yukart-$BIN.service"
[ -f "$UNIT" ] || { echo "no $UNIT" >&2; exit 2; }
OUT="$(mktemp -d)/$BIN"
ssh "$BUILD_HOST" "set -e
mkdir -p ~/dev/yukart && cd ~/dev/yukart
for r in svc-core contracts; do
[ -d \$r ] || git clone -q http://192.168.2.199:3005/yukart/\$r.git
git -C \$r pull -q --ff-only
done
cd svc-core && ~/.cargo/bin/cargo build --release --bin $BIN 2>&1 | tail -1
git log --oneline -1"
scp -q "$BUILD_HOST:dev/yukart/svc-core/target/release/$BIN" "$OUT"
scripts/check-glibc.sh "$OUT"
# Binary lives under ~/infra per the host repo's guidelines; /usr/local/bin gets a symlink.
ssh "$HOST" 'mkdir -p ~/infra/svc-core'
scp -q "$OUT" "$HOST:infra/svc-core/$BIN.new"
scp -q "$UNIT" "$HOST:infra/svc-core/yukart-$BIN.service"
if grep -q /etc/default/yukart-elm "$UNIT"; then
scp -q deploy/yukart-elm.default "$HOST:infra/svc-core/yukart-elm.default"
fi
ssh "$HOST" "set -e
mv ~/infra/svc-core/$BIN.new ~/infra/svc-core/$BIN
sudo ln -sfn \"\$HOME/infra/svc-core/$BIN\" /usr/local/bin/yukart-$BIN
sudo install -m 0644 ~/infra/svc-core/yukart-$BIN.service /etc/systemd/system/yukart-$BIN.service
if [ -f ~/infra/svc-core/yukart-elm.default ] && [ ! -f /etc/default/yukart-elm ]; then
sudo install -m 0644 ~/infra/svc-core/yukart-elm.default /etc/default/yukart-elm
fi
sudo systemctl daemon-reload
sudo systemctl enable yukart-$BIN.service >/dev/null
sudo systemctl restart yukart-$BIN.service
sleep 1
systemctl --no-pager --lines=5 status yukart-$BIN.service"
+4 -29
View File
@@ -1,31 +1,6 @@
#!/usr/bin/env bash
# Build the obd-poller for aarch64, check it against the car's glibc, and install it
# on an Orin as the yukart-obd-poller service.
# Build obd-poller natively on the development Orin and install it on the car Orin as
# yukart-obd-poller: scripts/deploy-native.sh does the work.
#
# usage: scripts/deploy-obd-poller.sh [host] (default: mikkeli-orin-nano)
#
# Cross-compiles from the workstation (the documented fallback): the development
# Orin is the preferred native build host. Either way check-glibc.sh gates it.
set -euo pipefail
HOST="${1:-mikkeli-orin-nano}"
cd "$(dirname "$0")/.."
TARGET=aarch64-unknown-linux-gnu
BIN="target/$TARGET/release/obd-poller"
cargo build --release --target "$TARGET" --bin obd-poller
scripts/check-glibc.sh "$BIN"
# Binary lives under ~/infra per the host repo's guidelines; /usr/local/bin gets a symlink.
ssh "$HOST" 'mkdir -p ~/infra/svc-core'
scp -q "$BIN" "$HOST:infra/svc-core/obd-poller.new"
scp -q deploy/yukart-obd-poller.service "$HOST:infra/svc-core/yukart-obd-poller.service"
ssh "$HOST" 'set -e
mv ~/infra/svc-core/obd-poller.new ~/infra/svc-core/obd-poller
sudo ln -sfn "$HOME/infra/svc-core/obd-poller" /usr/local/bin/yukart-obd-poller
sudo install -m 0644 ~/infra/svc-core/yukart-obd-poller.service /etc/systemd/system/yukart-obd-poller.service
sudo systemctl daemon-reload
sudo systemctl enable yukart-obd-poller.service >/dev/null
sudo systemctl restart yukart-obd-poller.service
sleep 1
systemctl --no-pager --lines=5 status yukart-obd-poller.service'
# usage: scripts/deploy-obd-poller.sh [host] (default: mikkeli-orin-nano)
exec "$(dirname "$0")/deploy-native.sh" obd-poller "$@"
+4 -40
View File
@@ -1,42 +1,6 @@
#!/usr/bin/env bash
# Build orin-status natively on the development Orin, check it against the car's
# glibc, and install it on the car Orin as the yukart-orin-status service.
# Build orin-status natively on the development Orin and install it on the car Orin as
# yukart-orin-status: scripts/deploy-native.sh does the work.
#
# usage: scripts/deploy-orin-status.sh [host] (default: mikkeli-orin-nano)
# env: BUILD_HOST (default: mikkeli-orin-nano-2)
#
# Builds what is pushed, not the working tree: the build host pulls master of
# svc-core and contracts under ~/dev/yukart/. Native on purpose: orin-status runs
# mmcli, and std::process::Command cross-compiled against the workstation's newer
# glibc links GLIBC_2.39 symbols the car cannot load.
set -euo pipefail
HOST="${1:-mikkeli-orin-nano}"
BUILD_HOST="${BUILD_HOST:-mikkeli-orin-nano-2}"
cd "$(dirname "$0")/.."
BIN="$(mktemp -d)/orin-status"
ssh "$BUILD_HOST" 'set -e
mkdir -p ~/dev/yukart && cd ~/dev/yukart
for r in svc-core contracts; do
[ -d $r ] || git clone -q http://192.168.2.199:3005/yukart/$r.git
git -C $r pull -q --ff-only
done
cd svc-core && ~/.cargo/bin/cargo build --release --bin orin-status 2>&1 | tail -1
git log --oneline -1'
scp -q "$BUILD_HOST:dev/yukart/svc-core/target/release/orin-status" "$BIN"
scripts/check-glibc.sh "$BIN"
# Binary lives under ~/infra per the host repo's guidelines; /usr/local/bin gets a symlink.
ssh "$HOST" 'mkdir -p ~/infra/svc-core'
scp -q "$BIN" "$HOST:infra/svc-core/orin-status.new"
scp -q deploy/yukart-orin-status.service "$HOST:infra/svc-core/yukart-orin-status.service"
ssh "$HOST" 'set -e
mv ~/infra/svc-core/orin-status.new ~/infra/svc-core/orin-status
sudo ln -sfn "$HOME/infra/svc-core/orin-status" /usr/local/bin/yukart-orin-status
sudo install -m 0644 ~/infra/svc-core/yukart-orin-status.service /etc/systemd/system/yukart-orin-status.service
sudo systemctl daemon-reload
sudo systemctl enable yukart-orin-status.service >/dev/null
sudo systemctl restart yukart-orin-status.service
sleep 1
systemctl --no-pager --lines=5 status yukart-orin-status.service'
# usage: scripts/deploy-orin-status.sh [host] (default: mikkeli-orin-nano)
exec "$(dirname "$0")/deploy-native.sh" orin-status "$@"