fix tank calculation, update bq34 driver
This commit is contained in:
@@ -7,6 +7,7 @@ use embedded_svc::wifi::{
|
||||
use esp_idf_hal::i2c::{I2cConfig, I2cDriver, I2cError};
|
||||
use esp_idf_hal::units::FromValueType;
|
||||
use esp_idf_svc::eventloop::EspSystemEventLoop;
|
||||
use esp_idf_svc::ipv4::IpInfo;
|
||||
use esp_idf_svc::mqtt::client::QoS::AtLeastOnce;
|
||||
use esp_idf_svc::mqtt::client::QoS::ExactlyOnce;
|
||||
use esp_idf_svc::mqtt::client::{EspMqttClient, LwtConfiguration, MqttClientConfiguration};
|
||||
@@ -94,7 +95,7 @@ pub trait PlantCtrlBoardInteraction {
|
||||
ssid: heapless::String<32>,
|
||||
password: Option<heapless::String<64>>,
|
||||
max_wait: u32,
|
||||
) -> Result<()>;
|
||||
) -> Result<IpInfo>;
|
||||
fn sntp(&mut self, max_wait: u32) -> Result<chrono::DateTime<Utc>>;
|
||||
fn mount_file_system(&mut self) -> Result<()>;
|
||||
fn file_system_size(&mut self) -> Result<FileSystemSizeInfo>;
|
||||
@@ -393,7 +394,7 @@ impl PlantCtrlBoardInteraction for PlantCtrlBoard<'_> {
|
||||
ssid: heapless::String<32>,
|
||||
password: Option<heapless::String<64>>,
|
||||
max_wait: u32,
|
||||
) -> Result<()> {
|
||||
) -> Result<IpInfo> {
|
||||
match password {
|
||||
Some(pw) => {
|
||||
//TODO expect error due to invalid pw or similar! //call this during configuration and check if works, revert to config mode if not
|
||||
@@ -448,7 +449,7 @@ impl PlantCtrlBoardInteraction for PlantCtrlBoard<'_> {
|
||||
//update freertos registers ;)
|
||||
let address = self.wifi_driver.sta_netif().get_ip_info().unwrap();
|
||||
println!("IP info: {:?}", address);
|
||||
Ok(())
|
||||
Ok(address)
|
||||
}
|
||||
|
||||
fn mount_file_system(&mut self) -> Result<()> {
|
||||
@@ -620,6 +621,7 @@ impl PlantCtrlBoardInteraction for PlantCtrlBoard<'_> {
|
||||
qos: AtLeastOnce,
|
||||
retain: true,
|
||||
}),
|
||||
keep_alive_interval : Some(Duration::from_secs(60*60*2)),
|
||||
//room for improvement
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user