reduce logging

This commit is contained in:
shimun 2024-05-10 11:43:04 +02:00
parent 3428419c51
commit fec9d8b00a
Signed by: shimun
GPG Key ID: E0420647856EA39E
2 changed files with 6 additions and 8 deletions

View File

@ -9,7 +9,7 @@
#![feature(trait_alias)] #![feature(trait_alias)]
#![feature(generic_arg_infer)] #![feature(generic_arg_infer)]
extern crate alloc; extern crate alloc;
use core::mem::{MaybeUninit}; use core::mem::MaybeUninit;
use alloc::borrow::Cow; use alloc::borrow::Cow;
use alloc::boxed::Box; use alloc::boxed::Box;
@ -25,9 +25,7 @@ use esp_alloc::EspHeap;
use esp_backtrace as _; use esp_backtrace as _;
use esp_hal::adc::{AdcPin, Attenuation, ADC}; use esp_hal::adc::{AdcPin, Attenuation, ADC};
use esp_hal::clock::CpuClock; use esp_hal::clock::CpuClock;
use esp_hal::gpio::{ use esp_hal::gpio::{Analog, AnyPin, GpioPin, Output, PushPull};
Analog, AnyPin, GpioPin, Output, PushPull,
};
use esp_hal::peripherals::{Peripherals, ADC1}; use esp_hal::peripherals::{Peripherals, ADC1};
use esp_hal::systimer::SystemTimer; use esp_hal::systimer::SystemTimer;
use esp_hal::{adc::AdcConfig, clock::ClockControl}; use esp_hal::{adc::AdcConfig, clock::ClockControl};
@ -192,7 +190,7 @@ async fn battery_monitor(
.await .await
.insert(Cow::from("vbat"), v_bat.to_string()); .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<Executor> = StaticCell::new(); static EXECUTOR: StaticCell<Executor> = StaticCell::new();

View File

@ -107,7 +107,7 @@ pub async fn send_message(
// establish TCP connection // establish TCP connection
socket.connect(socket_addr).await?; socket.connect(socket_addr).await?;
let after_tcp = Instant::now(); let after_tcp = Instant::now();
info!("connected to {socket_addr:?}"); debug!("connected to {socket_addr:?}");
// seed mqtt rng from rng // seed mqtt rng from rng
let mut mqtt_config = ClientConfig::<5, _>::new( let mut mqtt_config = ClientConfig::<5, _>::new(
@ -153,7 +153,7 @@ pub async fn send_message(
let mut mqtt_backend = socket; let mut mqtt_backend = socket;
let after_tls = Instant::now(); let after_tls = Instant::now();
#[cfg(feature = "tls")] #[cfg(feature = "tls")]
info!( debug!(
"tls handshake succeeded: +{}ms", "tls handshake succeeded: +{}ms",
(after_tls - after_tcp).as_millis() (after_tls - after_tcp).as_millis()
); );
@ -174,7 +174,7 @@ pub async fn send_message(
); );
mqtt_client.connect_to_broker().await?; mqtt_client.connect_to_broker().await?;
let after_mqtt = Instant::now(); let after_mqtt = Instant::now();
info!("connected to broker"); debug!("connected to broker");
for (topic, message) in messages { for (topic, message) in messages {
mqtt_client mqtt_client
.send_message( .send_message(