This commit is contained in:
legop3
2026-11-16 23:22:43 -05:00
parent 9626389dbe
commit 2d9b6e4a36
16 changed files with 67 additions and 36 deletions
+4 -2
View File
@@ -8,7 +8,7 @@ https://rover.otter.land
## This guide is a work in progress, it will cover: ## This guide is a work in progress, it will cover:
- Building rovers - Building rovers
- Installing roverd on a rover's raspberry pi - Installing roverd on a Debian-based rover computer
- Setting up the server - Setting up the server
- Configuration - Configuration
@@ -17,6 +17,8 @@ You WILL need some common hobby electronics knowledge to build one of these, I w
### Parts per rover ### Parts per rover
This parts list describes my Pi/AIY build. Roverd also supports other Linux hosts and configurable camera/audio devices.
| Part | Notes | | Part | Notes |
| --- | --- | | --- | --- |
| Create 2 compatible Roomba with the mini DIN port | Tested only with 600 series Roombas, your mileage may vary with newer models | | Create 2 compatible Roomba with the mini DIN port | Tested only with 600 series Roombas, your mileage may vary with newer models |
@@ -28,7 +30,7 @@ You WILL need some common hobby electronics knowledge to build one of these, I w
| A good wifi adapter | Has to work with Linux 6.12 (I use ones with the MT7921AU chipset and they work great), ideally wifi 6 with MU-MIMO if you are running multiple rovers on one AP. The built in wifi on the pi zero 2 W is NOT good enough for this. | | A good wifi adapter | Has to work with Linux 6.12 (I use ones with the MT7921AU chipset and they work great), ideally wifi 6 with MU-MIMO if you are running multiple rovers on one AP. The built in wifi on the pi zero 2 W is NOT good enough for this. |
| A USB hub hat (if using a pi zero) | If you are using a raspberry pi zero, you will want a USB hub hat for your wifi adapter, I would not recommend using an OTG adapter as it may not provide enough power. | | A USB hub hat (if using a pi zero) | If you are using a raspberry pi zero, you will want a USB hub hat for your wifi adapter, I would not recommend using an OTG adapter as it may not provide enough power. |
| ----CAMERA STUFF---- | ----Below here is all camera related things that youll need---- | | ----CAMERA STUFF---- | ----Below here is all camera related things that youll need---- |
| A pi camera v2 (ov5647) | The video publisher in this project is only designed for the ov5647, though it would be totally possible to make your own publisher for other sensors. | | A compatible camera | Select the rpicam profile for a Raspberry Pi CSI camera or V4L2 for a USB camera. Custom profiles can use other capture/encoder commands. |
| Cheap 5v servo | Unless you have a VERY wide camera lens, you will want to have a servo plugged into the pi to be able to tilt the camera up and down. | | Cheap 5v servo | Unless you have a VERY wide camera lens, you will want to have a servo plugged into the pi to be able to tilt the camera up and down. |
| LED for toggling the headlight | I use white LEDs attached to one of the "driver" pins on the AIY hat to trick one of those generic pi camera LED floodlights into turning on / off on demand.| | LED for toggling the headlight | I use white LEDs attached to one of the "driver" pins on the AIY hat to trick one of those generic pi camera LED floodlights into turning on / off on demand.|
| Optional laser pointer | A laser pointer can be wired to another high-current-capable GPIO driver, with GPIO 27 used by default in the rover config. | | Optional laser pointer | A laser pointer can be wired to another high-current-capable GPIO driver, with GPIO 27 used by default in the rover config. |
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+14 -1
View File
@@ -45,7 +45,7 @@ The parent switch now defaults to disabled. Saved child settings do not enable G
- [x] Add AIY capture/playback profiles alongside generic selectable ALSA device profiles. - [x] Add AIY capture/playback profiles alongside generic selectable ALSA device profiles.
- [x] Make TTS, horn, forwarded audio, and mixer routing use configured devices consistently. - [x] Make TTS, horn, forwarded audio, and mixer routing use configured devices consistently.
- [x] Generate ALSA routing from the shared input/output configuration, including distinct input/output cards, logical profile devices, format conversion, and independent playback volume controls. - [x] Generate ALSA routing from the shared input/output configuration, including distinct input/output cards, logical profile devices, format conversion, and independent playback volume controls.
- [ ] Audit fixed card numbers, named PCM assumptions, capture formats, camera orientation/sensor defaults, serial device defaults, and architecture-specific TTS assets. - [x] Audit fixed card numbers, named PCM assumptions, capture formats, camera orientation/sensor defaults, serial device defaults, and architecture-specific TTS assets. Findings and deployment checks are below.
- [x] Keep required one-time host boot changes visible; distinguish a hardware-overlay reboot from ordinary roverd update/restart behavior. - [x] Keep required one-time host boot changes visible; distinguish a hardware-overlay reboot from ordinary roverd update/restart behavior.
- [x] Add exact final profile selections and JSON settings for the existing AIY rover. - [x] Add exact final profile selections and JSON settings for the existing AIY rover.
- [ ] Verify on the actual HAT and at least one non-HAT audio device; record results rather than assuming compatibility. - [ ] Verify on the actual HAT and at least one non-HAT audio device; record results rather than assuming compatibility.
@@ -65,3 +65,16 @@ For the existing AIY v1 setup, start with these fields in a complete current con
- Enable the parent `piGpio.enabled` and the desired child roles as described above. The old automatic PWM-overlay installer is gone; the GPIO12/13 PWM overlay remains a documented host wiring requirement, not an audio-profile side effect. - Enable the parent `piGpio.enabled` and the desired child roles as described above. The old automatic PWM-overlay installer is gone; the GPIO12/13 PWM overlay remains a documented host wiring requirement, not an audio-profile side effect.
The HAT setup does not disable unrelated onboard audio or force a card index. Use the configured stable device/card names. Existing installed media systemd units must be removed/disabled before running the new supervisor. Remove any old roverd-specific host ALSA configuration before deployment: the generated config includes the system ALSA definitions, whose hooks can still load host configuration. The old media launchers are no longer used. The HAT setup does not disable unrelated onboard audio or force a card index. Use the configured stable device/card names. Existing installed media systemd units must be removed/disabled before running the new supervisor. Remove any old roverd-specific host ALSA configuration before deployment: the generated config includes the system ALSA definitions, whose hooks can still load host configuration. The old media launchers are no longer used.
## Hardware assumption audit (2026-11-16)
- New configs use a non-inverted camera and automatic CSI sensor mode (empty `media.video.sensorMode`). The AIY/CSI sample and checked-in rover config retain the existing inverted mount and `1296:972` selection. For your existing rover set `media.video.inverted` to true and retain that sensor mode only if supported by the connected camera. V4L2 uses `media.video.device` and `inputFormat`; its profile ignores the CSI mode.
- `serial.device` defaults to `/dev/ttyUSB0`, but accepts a stable `/dev/serial/by-id/...` path. Select the Roomba adapter explicitly to avoid depending on USB enumeration. Peripheral discovery excludes that device.
- Audio card zero and 48 kHz stereo are editable defaults, not mandatory hardware. Set the physical input/output separately and use the HAT's 16 kHz mono output values above. Logical plug devices perform format conversion; the physical output still needs to support the chosen dmix format. Verify microphone channels/rate against actual hardware.
- Chrome TTS assets are chosen by installed OS architecture; ARMv6 has no bundled Chrome library and should use `audio.defaultEngine: "flite"` or `"espeak"`. Chrome libraries/voices still require on-device verification. TTS, horn, and forwarded audio use the generated routing; verify independent gains after each logical PCM has opened, when ALSA creates its soft-volume control.
- Pi firmware voltage/throttle probes run only when `vcgencmd` is installed. Native GPIO access remains controlled by `piGpio.enabled`, independently of host-health telemetry.
- AIY profile setup adds new boot settings under `[all]`. If existing matching settings are inside a model-specific section, ensure that section applies to your Pi. The profile does not rewrite existing host sections.
- Keep `dtoverlay=pwm-2chan,pin=12,func=4,pin2=13,func2=4` in an applicable boot-config section for the existing GPIO12 servo wiring. Keep GPIO18/19 free for the HAT's I2S. Reboot after overlay changes.
No camera, ALSA device, firmware command, or GPIO operation was exercised during this source audit. Host installation, browser flows, and physical hardware verification remain required.
+2 -2
View File
@@ -52,6 +52,6 @@ These commands do not install packages, open devices, or start streams. Configur
## Deployment checks still required ## Deployment checks still required
Before deploying over an old installation, explicitly disable/remove its old media units so they cannot compete for devices or publish duplicate streams. This rework does not migrate an installed host. The checkout installer now installs only the roverd service and runtime dependencies; standalone bootstrap/update redesign remains a later stage. Before deploying over an old installation, explicitly disable/remove its old media units so they cannot compete for devices or publish duplicate streams. This rework does not migrate an installed host. The checkout installer now installs only the roverd service and runtime dependencies; the standalone bootstrap and shared updater use that installer. See [installation and updates](roverd-installation.md).
On the actual rover, confirm all selected profiles complete setup, observe output/status in fleet management, and verify video, microphone, forwarded audio, TTS, horn, simultaneous playback, and each gain control. Restart the server or interrupt Wi-Fi: media commands should retry without restarting roverd. Save configuration and verify no media child processes remain from the previous daemon. Capture journal output and observed results. AIY overlay changes require a one-time host reboot; ordinary configuration saves only restart roverd. On the actual rover, confirm all selected profiles complete setup, observe output/status in fleet management, and verify video, microphone, forwarded audio, TTS, horn, simultaneous playback, and each gain control. Restart the server or interrupt Wi-Fi: media commands should retry without restarting roverd. The existing control-disconnection watchdog separately seeks the dock after one minute and reboots the host after six minutes; use a shorter interruption to isolate streamer retries. Save configuration and verify no media child processes remain from the previous daemon. Capture journal output and observed results. AIY overlay changes require a one-time host reboot; ordinary configuration saves only restart roverd.
+19 -6
View File
@@ -1,6 +1,6 @@
# Roverd rework plan and implementation tracker # Roverd rework plan and implementation tracker
Status: implementation authorized on 2026-11-16; repository/build, internal GPIO, JSON/management, Fleet UI, rover state, media profiles/supervision, and shared audio routing implemented; standalone bootstrap and shared self-update are also implemented; final cleanup/hardware audit and deployment verification remain pending. Status: implementation authorized on 2026-11-16; repository/build, internal GPIO, JSON/management, Fleet UI, rover state, media profiles/supervision, and shared audio routing implemented; standalone bootstrap and shared self-update are also implemented; source cleanup/hardware audit is complete; deployment and hardware verification remain pending.
This is the persistent plan and progress record for the roverd rework. Update it as implementation proceeds, recording completed work, decisions, verification evidence, and remaining work. Keep unfinished work unchecked; distinguish implemented behavior from runtime-verified behavior. This is the persistent plan and progress record for the roverd rework. Update it as implementation proceeds, recording completed work, decisions, verification evidence, and remaining work. Keep unfinished work unchecked; distinguish implemented behavior from runtime-verified behavior.
@@ -171,7 +171,7 @@ The order below is a working sequence, not a requirement to leave incompatible i
- [x] Add bundled YAML catalogs and one custom YAML profile per media category. (Live verification pending.) - [x] Add bundled YAML catalogs and one custom YAML profile per media category. (Live verification pending.)
- [x] Preserve AIY HAT as an explicit profile and expose ordinary audio-device selection on every architecture, including TTS/horn/mixer paths. (Live verification pending.) - [x] Preserve AIY HAT as an explicit profile and expose ordinary audio-device selection on every architecture, including TTS/horn/mixer paths. (Live verification pending.)
- [x] Generate ALSA routing from shared input/output selections; connect microphone, TTS, horn, forwarded audio, and independent volume controls to the resulting logical devices. (Live verification pending.) - [x] Generate ALSA routing from shared input/output selections; connect microphone, TTS, horn, forwarded audio, and independent volume controls to the resulting logical devices. (Live verification pending.)
- [ ] Document exact configuration for the existing AIY rover and audit other machine-specific assumptions. - [x] Document exact configuration for the existing AIY rover and audit other machine-specific assumptions.
- [x] Implement command environments, persistent working directories, and setup on each daemon startup. (Live verification pending.) - [x] Implement command environments, persistent working directories, and setup on each daemon startup. (Live verification pending.)
- [x] Replace media systemd management with child-process supervision and continuous bounded output forwarding. (Live verification pending.) - [x] Replace media systemd management with child-process supervision and continuous bounded output forwarding. (Live verification pending.)
- [x] Implement per-rover schema editor and complete-object saves (browser/live verification pending). - [x] Implement per-rover schema editor and complete-object saves (browser/live verification pending).
@@ -179,10 +179,12 @@ The order below is a working sequence, not a requirement to leave incompatible i
- [x] Add profile editing/selection, media output/status, reboot, and update UI. (Live verification pending.) - [x] Add profile editing/selection, media output/status, reboot, and update UI. (Live verification pending.)
- [x] Implement standalone bootstrap with only name/address input and automatic OS architecture selection. (Host verification pending.) - [x] Implement standalone bootstrap with only name/address input and automatic OS architecture selection. (Host verification pending.)
- [x] Implement shared checkout installation and self-update with reconnect-visible results. (Host verification pending.) - [x] Implement shared checkout installation and self-update with reconnect-visible results. (Host verification pending.)
- [ ] Remove obsolete services, configuration files, scripts, build distinctions, and documentation. - [x] Remove obsolete services, configuration files, scripts, build distinctions, and documentation.
- [ ] Update user/contributor documentation, including profile variables, setup expectations, building, installation, and updates. - [x] Update user/contributor documentation, including profile variables, setup expectations, building, installation, and updates.
- [ ] Perform focused available verification and record results below. - [x] Perform focused available verification and record results below.
- [ ] Record deployment/hardware checks still required; do not claim those verified locally. - [x] Record deployment/hardware checks still required; do not claim those verified locally.
- [ ] Complete live rover/server/browser and hardware verification recorded below.
## Verification record ## Verification record
@@ -296,3 +298,14 @@ Verification for this stage:
- Added `docs/roverd-installation.md` and updated README instructions. - Added `docs/roverd-installation.md` and updated README instructions.
- Verification: all four committed architecture binaries rebuilt successfully; shell syntax, server syntax, focused UI lint, and diff whitespace checks passed. No installation, apt operation, host reboot/restart, or live server/browser was run on the development machine. - Verification: all four committed architecture binaries rebuilt successfully; shell syntax, server syntax, focused UI lint, and diff whitespace checks passed. No installation, apt operation, host reboot/restart, or live server/browser was run on the development machine.
- Required rover checks: fresh bootstrap identity/connectivity; successful update and reconnect-visible status; failure reporting and retry; preservation of settings/custom profiles/data. Hardware/audio checks and final universal-hardware audit remain open. - Required rover checks: fresh bootstrap identity/connectivity; successful update and reconnect-visible status; failure reporting and retry; preservation of settings/custom profiles/data. Hardware/audio checks and final universal-hardware audit remain open.
### Final source cleanup and hardware audit (2026-11-16)
- Audited device paths, ALSA routing and gains, camera defaults, serial discovery, architecture-specific TTS installation, GPIO ownership, host telemetry, installer/build references, and current setup documentation.
- Removed the inverted camera/fixed CSI mode from new defaults and cleared the CSI mode in the V4L2 sample. Preserved the existing AIY/CSI sample and checked-in rover configuration. Physical audio/serial device identifiers remain editable defaults; no automatic hardware guessing was added.
- Pi firmware voltage/throttle probes are optional when `vcgencmd` is absent. Native GPIO remains behind its explicit peripheral switch.
- Inline AIY setup now adds missing settings under `[all]` instead of inheriting the last boot-config section. Existing conditional host settings are documented rather than rewritten.
- Removed obsolete publisher/env-file wording and stale bootstrap status; updated hardware notes with exact existing camera, AIY, PWM, stable serial path, and TTS constraints. Historical stage notes above remain a record of their stage, not current pending work.
- Verification: all four committed architecture binaries rebuilt; actual daemon loaded six profiles and all inline commands passed Bash syntax checks; V4L2 sample validation passed; actual default export confirmed non-inverted video and empty sensor mode; diff whitespace check passed.
- Live installation/update, browser/server saves and permissions, GPIO/serial, camera/audio, independent volume controls, and failure/reconnect behavior remain unverified. Use the deployment checks in the management, installation, media, and hardware documents. No hardware services or background processes were started here.
+3 -1
View File
@@ -21,7 +21,9 @@
changed=0 changed=0
for setting in dtparam=i2s=on dtoverlay=googlevoicehat-soundcard; do for setting in dtparam=i2s=on dtoverlay=googlevoicehat-soundcard; do
if ! grep -Fxq "$setting" "$boot"; then if ! grep -Fxq "$setting" "$boot"; then
printf '\n%s\n' "$setting" >> "$boot" # Leave any model-specific section before adding shared HAT settings.
if [[ "$changed" == 0 ]]; then printf '\n[all]\n' >> "$boot"; fi
printf '%s\n' "$setting" >> "$boot"
changed=1 changed=1
fi fi
done done
+3 -1
View File
@@ -23,7 +23,9 @@
changed=0 changed=0
for setting in dtparam=i2s=on dtoverlay=googlevoicehat-soundcard; do for setting in dtparam=i2s=on dtoverlay=googlevoicehat-soundcard; do
if ! grep -Fxq "$setting" "$boot"; then if ! grep -Fxq "$setting" "$boot"; then
printf '\n%s\n' "$setting" >> "$boot" # Leave any model-specific section before adding shared HAT settings.
if [[ "$changed" == 0 ]]; then printf '\n[all]\n' >> "$boot"; fi
printf '%s\n' "$setting" >> "$boot"
changed=1 changed=1
fi fi
done done
+1 -1
View File
@@ -76,7 +76,7 @@ func (c *WSClient) applyMixerGain(control string, gain float64) {
return return
} }
// Convert linear gain to dB, matching softvol max_dB=12.0 in /etc/asound.conf. // Convert linear gain to dB, matching softvol max_dB=12.0 in the generated ALSA routing.
db := 20.0 * math.Log10(normalized) db := 20.0 * math.Log10(normalized)
if db > 12.0 { if db > 12.0 {
db = 12.0 db = 12.0
+3 -8
View File
@@ -272,8 +272,8 @@ func DefaultConfig() Config {
Height: 480, Height: 480,
FPS: 30, FPS: 30,
Bitrate: 2000000, Bitrate: 2000000,
Inverted: true, Inverted: false,
SensorMode: "1296:972", SensorMode: "",
}, },
AudioCapture: AudioCaptureConfig{ AudioCapture: AudioCaptureConfig{
Profile: "alsa", Profile: "alsa",
@@ -471,12 +471,7 @@ func validateAudioConfig(cfg *AudioConfig) {
} }
func validateMediaConfig(cfg *MediaConfig, serverURL string, roverName string) error { func validateMediaConfig(cfg *MediaConfig, serverURL string, roverName string) error {
/* // Normalize shared settings before they become profile command variables.
The nested media config is the source of truth for the publisher scripts,
so defaults that used to live in shell are normalized here before any env
file is written. This keeps the Pi behavior stable while making laptop
and future publisher variants explicit configuration choices.
*/
if cfg.RTSPPort <= 0 { if cfg.RTSPPort <= 0 {
cfg.RTSPPort = 8554 cfg.RTSPPort = 8554
} }
+15 -11
View File
@@ -20,7 +20,7 @@ const (
) )
// HostStats is the wire format sent from roverd to the server. It avoids // HostStats is the wire format sent from roverd to the server. It avoids
// Roomba-specific sensor naming so the browser can treat these values as Pi // Roomba-specific sensor naming so the browser can treat these values as Linux
// host health, not robot telemetry. // host health, not robot telemetry.
type HostStats struct { type HostStats struct {
UptimeSec *float64 `json:"uptimeSec,omitempty"` UptimeSec *float64 `json:"uptimeSec,omitempty"`
@@ -136,17 +136,21 @@ func CollectHostStats(ctx context.Context) HostStats {
} }
} }
if coreV, err := readCoreVoltage(ctx); err != nil { // Firmware voltage/throttle telemetry is optional on non-Pi hosts.
stats.addError("coreVoltage", err) if _, err := exec.LookPath("vcgencmd"); err == nil {
} else { if coreV, err := readCoreVoltage(ctx); err != nil {
stats.CoreVoltageV = &coreV stats.addError("coreVoltage", err)
} } else {
stats.CoreVoltageV = &coreV
}
if raw, flags, err := readThrottleFlags(ctx); err != nil {
stats.addError("throttled", err)
} else {
stats.ThrottledRaw = raw
stats.applyThrottleFlags(flags)
}
if raw, flags, err := readThrottleFlags(ctx); err != nil {
stats.addError("throttled", err)
} else {
stats.ThrottledRaw = raw
stats.applyThrottleFlags(flags)
} }
if wifi, err := collectWiFiStats(ctx); err != nil { if wifi, err := collectWiFiStats(ctx); err != nil {
+1 -1
View File
@@ -239,7 +239,7 @@ func (c *ManagementClient) forwardHostStats(ctx context.Context, conn *websocket
send := func() bool { send := func() bool {
// Host stats are collected on demand so each outbound message describes // Host stats are collected on demand so each outbound message describes
// the current Pi state. Collection failures are encoded into the stats // the current host state. Collection failures are encoded into the stats
// payload, which keeps this telemetry path from closing the rover socket. // payload, which keeps this telemetry path from closing the rover socket.
stats := CollectHostStats(ctx) stats := CollectHostStats(ctx)
// Throughput is derived here because this loop owns the ordered, periodic // Throughput is derived here because this loop owns the ordered, periodic
+1 -1
View File
@@ -63,7 +63,7 @@
"fps": 30, "fps": 30,
"bitrate": 2000000, "bitrate": 2000000,
"inverted": false, "inverted": false,
"sensorMode": "1296:972" "sensorMode": ""
}, },
"audioCapture": { "audioCapture": {
"profile": "alsa", "profile": "alsa",
+1 -1
View File
@@ -671,7 +671,7 @@ func (c *WSClient) handleRebootTimeout() {
c.connMu.Unlock() c.connMu.Unlock()
c.console.Notify("Control server has been disconnected for 6 minutes. Rebooting the rover now.") c.console.Notify("Control server has been disconnected for 6 minutes. Rebooting the rover now.")
c.log.Printf("rebooting pi after prolonged websocket disconnect") c.log.Printf("rebooting rover after prolonged websocket disconnect")
cmd := exec.Command("systemctl", "reboot") cmd := exec.Command("systemctl", "reboot")
if err := cmd.Start(); err != nil { if err := cmd.Start(); err != nil {
c.log.Printf("reboot command failed: %v", err) c.log.Printf("reboot command failed: %v", err)