diff --git a/crates/muninn-daemon/src/main.rs b/crates/muninn-daemon/src/main.rs index 972e08a..68eda4b 100644 --- a/crates/muninn-daemon/src/main.rs +++ b/crates/muninn-daemon/src/main.rs @@ -704,6 +704,7 @@ fn build_move_controller_state_record( buttons: move_button_names(report), battery01: move_battery01(report.get(12).copied().unwrap_or_default()), observed_at, + source_path: source.hidraw_path.clone(), } } @@ -732,6 +733,7 @@ fn build_move_controller_state_record_from_joystick( buttons: joystick_button_names(buttons), battery01: f32::NAN, observed_at, + source_path: source.hidraw_path.clone(), } } @@ -1216,12 +1218,17 @@ fn verify_move_sources_fresh( for source in &options.move_state_sources { let latest = states .iter() - .filter(|state| state.host_id == options.host_id && state.move_id == source.move_id) + .filter(|state| { + state.host_id == options.host_id + && state.move_id == source.move_id + && state.source_path == source.hidraw_path + }) .max_by_key(|state| unix_timestamp_sort_key(&state.observed_at)) .ok_or_else(|| { anyhow!( - "Muninn Move source {} has no controller-state records", - source.move_id + "Muninn Move source {} at {} has no controller-state records", + source.move_id, + source.hidraw_path ) })?; let observed_seconds = parse_unix_timestamp(&latest.observed_at).with_context(|| { @@ -1318,10 +1325,11 @@ fn move_state_status(options: Options) -> Result<()> { } for state in states { println!( - "{} seq={} move={} buttons=[{}] trigger={:.3} accel={:?} gyro={:?} battery={:.3} observed={}", + "{} seq={} move={} source={} buttons=[{}] trigger={:.3} accel={:?} gyro={:?} battery={:.3} observed={}", state.stream_id, state.sequence, state.move_id, + state.source_path, state.buttons.join(","), state.trigger_value, state.accelerometer_xyz, diff --git a/scripts/health-nightwing-muninn.ps1 b/scripts/health-nightwing-muninn.ps1 index d1fc0d7..08f3be9 100644 --- a/scripts/health-nightwing-muninn.ps1 +++ b/scripts/health-nightwing-muninn.ps1 @@ -3,7 +3,7 @@ param( [string] $MuninnExe = "/home/metacrat/.local/bin/muninn", [string] $StorePath = "/home/metacrat/.local/state/gamecult/muninn/muninn.telemetry.cc", [string] $PidPath = "/home/metacrat/.local/state/gamecult/muninn/muninn.pid", - [string] $MoveState = "move-usb=/dev/input/by-id/usb-Sony_Computer_Entertainment_Motion_Controller-joystick", + [string] $MoveState = "move-usb=/dev/hidraw1", [int] $IntervalSeconds = 15 ) diff --git a/scripts/restart-nightwing-muninn.ps1 b/scripts/restart-nightwing-muninn.ps1 index 03a09d6..ac7ec64 100644 --- a/scripts/restart-nightwing-muninn.ps1 +++ b/scripts/restart-nightwing-muninn.ps1 @@ -3,7 +3,7 @@ param( [string] $MuninnExe = "/home/metacrat/.local/bin/muninn", [string] $StorePath = "/home/metacrat/.local/state/gamecult/muninn/muninn.telemetry.cc", [string] $LogRoot = "/home/metacrat/.local/state/gamecult/muninn", - [string] $MoveState = "move-usb=/dev/input/by-id/usb-Sony_Computer_Entertainment_Motion_Controller-joystick", + [string] $MoveState = "move-usb=/dev/hidraw1", [string] $MoveEvidenceStream = "muninn:nightwing:move-evidence", [int] $IntervalSeconds = 15 )