diff --git a/src/main.rs b/src/main.rs index 852f52e..6a38527 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,7 @@ #![feature(trait_alias)] #![feature(generic_arg_infer)] extern crate alloc; -use core::mem::{MaybeUninit}; +use core::mem::MaybeUninit; use alloc::borrow::Cow; use alloc::boxed::Box; @@ -25,9 +25,7 @@ use esp_alloc::EspHeap; use esp_backtrace as _; use esp_hal::adc::{AdcPin, Attenuation, ADC}; use esp_hal::clock::CpuClock; -use esp_hal::gpio::{ - Analog, AnyPin, GpioPin, Output, PushPull, -}; +use esp_hal::gpio::{Analog, AnyPin, GpioPin, Output, PushPull}; use esp_hal::peripherals::{Peripherals, ADC1}; use esp_hal::systimer::SystemTimer; use esp_hal::{adc::AdcConfig, clock::ClockControl}; @@ -192,7 +190,7 @@ async fn battery_monitor( .await .insert(Cow::from("vbat"), v_bat.to_string()); } - Timer::after(Duration::from_secs(1)).await; + Timer::after(Duration::from_secs(30)).await; } } static EXECUTOR: StaticCell = StaticCell::new(); diff --git a/src/mqtt.rs b/src/mqtt.rs index 23c31e5..3df090b 100644 --- a/src/mqtt.rs +++ b/src/mqtt.rs @@ -107,7 +107,7 @@ pub async fn send_message( // establish TCP connection socket.connect(socket_addr).await?; let after_tcp = Instant::now(); - info!("connected to {socket_addr:?}"); + debug!("connected to {socket_addr:?}"); // seed mqtt rng from rng let mut mqtt_config = ClientConfig::<5, _>::new( @@ -153,7 +153,7 @@ pub async fn send_message( let mut mqtt_backend = socket; let after_tls = Instant::now(); #[cfg(feature = "tls")] - info!( + debug!( "tls handshake succeeded: +{}ms", (after_tls - after_tcp).as_millis() ); @@ -174,7 +174,7 @@ pub async fn send_message( ); mqtt_client.connect_to_broker().await?; let after_mqtt = Instant::now(); - info!("connected to broker"); + debug!("connected to broker"); for (topic, message) in messages { mqtt_client .send_message(