more stack slightly improved debugging

This commit is contained in:
Empire 2024-03-02 13:21:12 +01:00
parent 27bde9cc87
commit 34066ee463
3 changed files with 11 additions and 5 deletions

View File

@ -1,5 +1,5 @@
# Rust often needs a bit of an extra main task stack size compared to C (the default is 3K) # Rust often needs a bit of an extra main task stack size compared to C (the default is 3K)
CONFIG_ESP_MAIN_TASK_STACK_SIZE=20000 CONFIG_ESP_MAIN_TASK_STACK_SIZE=25000
# Use this to set FreeRTOS kernel tick frequency to 1000 Hz (100 Hz by default). # Use this to set FreeRTOS kernel tick frequency to 1000 Hz (100 Hz by default).
# This allows to use 1 ms granuality for thread sleeps (10 ms by default). # This allows to use 1 ms granuality for thread sleeps (10 ms by default).

View File

@ -105,7 +105,7 @@ fn safe_main() -> anyhow::Result<()> {
// Bind the log crate to the ESP Logging facilities // Bind the log crate to the ESP Logging facilities
esp_idf_svc::log::EspLogger::initialize_default(); esp_idf_svc::log::EspLogger::initialize_default();
if esp_idf_sys::CONFIG_MAIN_TASK_STACK_SIZE < 20000 { if esp_idf_sys::CONFIG_MAIN_TASK_STACK_SIZE < 25000 {
error!( error!(
"stack too small: {} bail!", "stack too small: {} bail!",
esp_idf_sys::CONFIG_MAIN_TASK_STACK_SIZE esp_idf_sys::CONFIG_MAIN_TASK_STACK_SIZE
@ -517,7 +517,7 @@ fn safe_main() -> anyhow::Result<()> {
let _ = board.mqtt_publish( let _ = board.mqtt_publish(
&config, &config,
"/deepsleep", "/deepsleep",
"Entering low voltage long deep sleep".as_bytes(), "low Volt 12h".as_bytes(),
); );
} }
12 * 60 12 * 60
@ -526,7 +526,7 @@ fn safe_main() -> anyhow::Result<()> {
let _ = board.mqtt_publish( let _ = board.mqtt_publish(
&config, &config,
"/deepsleep", "/deepsleep",
"Entering normal mode 20m deep sleep".as_bytes(), "normal 20m".as_bytes(),
); );
} }
20 20
@ -535,11 +535,16 @@ fn safe_main() -> anyhow::Result<()> {
let _ = board.mqtt_publish( let _ = board.mqtt_publish(
&config, &config,
"/deepsleep", "/deepsleep",
"Entering night mode 1h deep sleep".as_bytes(), "night 1h".as_bytes(),
); );
} }
60 60
}; };
if online_mode == OnlineMode::Online {
let _ = board.mqtt_publish(&config, "/state", "sleep".as_bytes());
}
//determine next event //determine next event
//is light out of work trigger soon? //is light out of work trigger soon?
//is battery low ?? //is battery low ??

View File

@ -621,6 +621,7 @@ impl PlantCtrlBoardInteraction for PlantCtrlBoard<'_> {
qos: AtLeastOnce, qos: AtLeastOnce,
retain: true, retain: true,
}), }),
client_id: Some("plantctrl"),
keep_alive_interval : Some(Duration::from_secs(60*60*2)), keep_alive_interval : Some(Duration::from_secs(60*60*2)),
//room for improvement //room for improvement
..Default::default() ..Default::default()