delay messages to reduce mqtt issues (sender to fast) improve mqtt debugging

This commit is contained in:
2024-03-02 14:43:52 +01:00
parent e070c802d5
commit 869a581242
2 changed files with 35 additions and 24 deletions

View File

@@ -723,11 +723,14 @@ impl PlantCtrlBoardInteraction for PlantCtrlBoard<'_> {
true,
message,
);
Delay::new(10).delay_ms(10);
match publish {
OkStd(_) => return Ok(()),
OkStd(message_id) => {
println!("Published mqtt topic {} with message {:#?} msgid is {:?}",full_topic, String::from_utf8_lossy(message), message_id);
return Ok(())
},
Err(err) => {
println!("Error during mqtt send on topic {} with message {:#?} error is {:?}",full_topic, message, err);
println!("Error during mqtt send on topic {} with message {:#?} error is {:?}",full_topic, String::from_utf8_lossy(message), err);
return Err(err)?
},
}