diff --git a/Cargo.toml b/Cargo.toml index 6053b9a..69e7408 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,10 +5,10 @@ edition = "2021" [dependencies] anyhow = "1.0" -tokio = { version = "1.36", features = ["full"] } -tracing = "0.1" -tracing-subscriber = "0.3" -rppal = "0.22" -serde = { version = "1.0", features = ["derive"] } -tracing-appender = "0.2" -serenity = { version = "0.12", features = ["standard_framework"] } +tokio = { version = "1.45.1", features = ["full"] } +tracing = "0.1.41" +tracing-subscriber = "0.3.19" +rppal = "0.22.1" +serde = { version = "1.0.219", features = ["derive"] } +tracing-appender = "0.2.3" +serenity = { version = "0.12.4", features = ["standard_framework"] } diff --git a/deploy.sh b/deploy.sh index 4379b54..af340b5 100755 --- a/deploy.sh +++ b/deploy.sh @@ -38,13 +38,17 @@ WantedBy=multi-user.target EOL echo "Copying to Raspberry Pi..." -# Copy files - scp target/aarch64-unknown-linux-gnu/release/noisebell noisebridge@noisebell.local:~/ -scp noisebell.service noisebridge@noisebell.local:~/ +# Debug remote directory status +ssh noisebridge@noisebell.local "pwd && ls -la ~/ && echo 'Directory permissions:' && stat -c '%A %a %n' ~/" +# Remove existing files +ssh noisebridge@noisebell.local "rm -f /home/noisebridge/noisebell /home/noisebridge/noisebell.service" +# Copy files with absolute paths +scp -v target/aarch64-unknown-linux-gnu/release/noisebell noisebridge@noisebell.local:/home/noisebridge/noisebell +scp -v noisebell.service noisebridge@noisebell.local:/home/noisebridge/noisebell.service echo "Setting up service..." # Deploy service -ssh noisebridge@noisebell.local "sudo cp ~/noisebell.service /etc/systemd/system/ && \ +ssh noisebridge@noisebell.local "sudo cp /home/noisebridge/noisebell.service /etc/systemd/system/ && \ sudo systemctl daemon-reload && \ sudo systemctl enable noisebell && \ sudo systemctl restart noisebell" diff --git a/logs/noisebell.2025-06-11.log b/logs/noisebell.2025-06-11.log new file mode 100644 index 0000000..e69de29 diff --git a/src/main.rs b/src/main.rs index 70a0bcf..aef20f9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -27,11 +27,14 @@ async fn main() -> Result<()> { Duration::from_secs(DEFAULT_DEBOUNCE_DELAY_SECS) )?; + // Get a handle to the current runtime + let runtime = tokio::runtime::Handle::current(); + // Set up the callback for state changes let callback = move |event: gpio::CircuitEvent| { info!("Circuit state changed to: {:?}", event); let discord_client = discord_client.clone(); - tokio::spawn(async move { + runtime.spawn(async move { let space_event = match event { gpio::CircuitEvent::Open => discord::SpaceEvent::Open, gpio::CircuitEvent::Closed => discord::SpaceEvent::Closed,