adjustable voltages for mppt

This commit is contained in:
Empire Phoenix 2025-01-07 01:43:34 +01:00
parent c070e68349
commit d94b5e09d2
5 changed files with 10482 additions and 9161 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"board": { "board": {
"active_layer": 0, "active_layer": 1,
"active_layer_preset": "", "active_layer_preset": "",
"auto_track_width": false, "auto_track_width": false,
"hidden_netclasses": [], "hidden_netclasses": [],
@ -68,7 +68,7 @@
39, 39,
40 40
], ],
"visible_layers": "ffc35ba_ffffffff", "visible_layers": "ffcffff_ffffffff",
"zone_display_mode": 1 "zone_display_mode": 1
}, },
"git": { "git": {

View File

@ -8498,6 +8498,12 @@
(color 0 0 0 0) (color 0 0 0 0)
(uuid "136b5f16-d5fe-4c8a-8508-0e9ad86f8f43") (uuid "136b5f16-d5fe-4c8a-8508-0e9ad86f8f43")
) )
(junction
(at 396.24 537.21)
(diameter 0)
(color 0 0 0 0)
(uuid "14871bbb-dfd8-4195-8c14-9ec80a720539")
)
(junction (junction
(at 447.04 294.64) (at 447.04 294.64)
(diameter 0) (diameter 0)
@ -8858,6 +8864,12 @@
(color 0 0 0 0) (color 0 0 0 0)
(uuid "5aef8b40-8452-4805-a5e4-da8d93469853") (uuid "5aef8b40-8452-4805-a5e4-da8d93469853")
) )
(junction
(at 461.01 532.13)
(diameter 0)
(color 0 0 0 0)
(uuid "5daa4784-f5ea-45b1-b6e6-5ed7605a4fd9")
)
(junction (junction
(at 604.52 85.09) (at 604.52 85.09)
(diameter 0) (diameter 0)
@ -9284,12 +9296,6 @@
(color 0 0 0 0) (color 0 0 0 0)
(uuid "a7ead05e-fd26-4f6a-98b1-c130e29a0605") (uuid "a7ead05e-fd26-4f6a-98b1-c130e29a0605")
) )
(junction
(at 468.63 535.94)
(diameter 0)
(color 0 0 0 0)
(uuid "a8c1d291-f95c-499f-a8f0-8d347b07d19e")
)
(junction (junction
(at 408.94 487.68) (at 408.94 487.68)
(diameter 0) (diameter 0)
@ -9446,12 +9452,6 @@
(color 0 0 0 0) (color 0 0 0 0)
(uuid "cac620f5-0af6-41f8-9844-d9f07ee0c129") (uuid "cac620f5-0af6-41f8-9844-d9f07ee0c129")
) )
(junction
(at 396.24 537.21)
(diameter 0)
(color 0 0 0 0)
(uuid "caf08951-498e-42d7-836c-4ada133aecad")
)
(junction (junction
(at 279.4 373.38) (at 279.4 373.38)
(diameter 0) (diameter 0)
@ -9798,6 +9798,14 @@
(at 38.1 364.49) (at 38.1 364.49)
(uuid "133b7027-41a1-4e09-a1e6-24d8bb033b2a") (uuid "133b7027-41a1-4e09-a1e6-24d8bb033b2a")
) )
(no_connect
(at 396.24 523.24)
(uuid "16bd24e1-85b5-4789-83d0-c7b0f2148660")
)
(no_connect
(at 468.63 535.94)
(uuid "4e457355-1d35-45ea-8f21-39e64314e210")
)
(no_connect (no_connect
(at 184.15 67.31) (at 184.15 67.31)
(uuid "6d645bf1-339f-4b38-a26a-bdd168ca591e") (uuid "6d645bf1-339f-4b38-a26a-bdd168ca591e")
@ -11740,16 +11748,6 @@
) )
(uuid "41b67a6d-7877-4172-9e0c-b79332c344d6") (uuid "41b67a6d-7877-4172-9e0c-b79332c344d6")
) )
(wire
(pts
(xy 396.24 523.24) (xy 396.24 537.21)
)
(stroke
(width 0)
(type default)
)
(uuid "41fdd31f-6d33-496e-aca2-8ea12af4a5e5")
)
(wire (wire
(pts (pts
(xy 537.21 86.36) (xy 537.21 88.9) (xy 537.21 86.36) (xy 537.21 88.9)
@ -12180,6 +12178,16 @@
) )
(uuid "50f6b5b1-5983-4df6-ba22-5686c3cfdbfe") (uuid "50f6b5b1-5983-4df6-ba22-5686c3cfdbfe")
) )
(wire
(pts
(xy 461.01 532.13) (xy 464.82 532.13)
)
(stroke
(width 0)
(type default)
)
(uuid "51a32a10-8287-45f0-bd16-12558c588428")
)
(wire (wire
(pts (pts
(xy 299.72 281.94) (xy 299.72 284.48) (xy 299.72 281.94) (xy 299.72 284.48)
@ -12720,6 +12728,26 @@
) )
(uuid "6b202dc2-b63b-453a-99cf-d34483dfd672") (uuid "6b202dc2-b63b-453a-99cf-d34483dfd672")
) )
(wire
(pts
(xy 400.05 527.05) (xy 396.24 527.05)
)
(stroke
(width 0)
(type default)
)
(uuid "6d716335-4a7d-41d3-9dc9-0ba195c48d5f")
)
(wire
(pts
(xy 396.24 527.05) (xy 396.24 537.21)
)
(stroke
(width 0)
(type default)
)
(uuid "6d76ff3e-5cf8-43c9-abe4-9c585ba56935")
)
(wire (wire
(pts (pts
(xy 311.15 403.86) (xy 311.15 405.13) (xy 311.15 403.86) (xy 311.15 405.13)
@ -13190,6 +13218,16 @@
) )
(uuid "7beda2a7-4c2c-46ec-a0a1-896ed8430c47") (uuid "7beda2a7-4c2c-46ec-a0a1-896ed8430c47")
) )
(wire
(pts
(xy 468.63 537.21) (xy 461.01 537.21)
)
(stroke
(width 0)
(type default)
)
(uuid "7bf3158f-d306-405a-a8c8-9bdf3fc3acf3")
)
(wire (wire
(pts (pts
(xy 530.86 487.68) (xy 533.4 487.68) (xy 530.86 487.68) (xy 533.4 487.68)
@ -13900,16 +13938,6 @@
) )
(uuid "996beda8-547c-4c21-b28c-c603e330bf09") (uuid "996beda8-547c-4c21-b28c-c603e330bf09")
) )
(wire
(pts
(xy 461.01 535.94) (xy 468.63 535.94)
)
(stroke
(width 0)
(type default)
)
(uuid "9990b822-7205-4efa-9f4d-9fe74a085b6e")
)
(wire (wire
(pts (pts
(xy 604.52 85.09) (xy 604.52 88.9) (xy 604.52 85.09) (xy 604.52 88.9)
@ -14022,7 +14050,7 @@
) )
(wire (wire
(pts (pts
(xy 461.01 532.13) (xy 461.01 535.94) (xy 461.01 532.13) (xy 461.01 537.21)
) )
(stroke (stroke
(width 0) (width 0)
@ -14810,16 +14838,6 @@
) )
(uuid "b934306f-22a7-43ef-b4f8-953e0f703194") (uuid "b934306f-22a7-43ef-b4f8-953e0f703194")
) )
(wire
(pts
(xy 468.63 535.94) (xy 468.63 537.21)
)
(stroke
(width 0)
(type default)
)
(uuid "b9869be8-da6e-4abd-9061-453cb262dc7b")
)
(wire (wire
(pts (pts
(xy 664.21 160.02) (xy 671.83 160.02) (xy 664.21 160.02) (xy 671.83 160.02)
@ -16240,6 +16258,16 @@
) )
(uuid "f3c38e30-f3c3-4495-9009-c4501c56511e") (uuid "f3c38e30-f3c3-4495-9009-c4501c56511e")
) )
(wire
(pts
(xy 400.05 519.43) (xy 400.05 527.05)
)
(stroke
(width 0)
(type default)
)
(uuid "f4ba49cb-64ac-4d0d-8f8a-e57afcab26ce")
)
(wire (wire
(pts (pts
(xy 396.24 537.21) (xy 396.24 541.02) (xy 396.24 537.21) (xy 396.24 541.02)
@ -16965,6 +16993,16 @@
) )
(uuid "bce2e59b-26e4-4e64-b782-6f3590928e5c") (uuid "bce2e59b-26e4-4e64-b782-6f3590928e5c")
) )
(text "1V-25V"
(exclude_from_sim no)
(at 384.048 519.684 0)
(effects
(font
(size 1.27 1.27)
)
)
(uuid "d1a16809-9d37-4b74-bc5b-bccc3a29a28b")
)
(text "Ideal Protection Diode" (text "Ideal Protection Diode"
(exclude_from_sim no) (exclude_from_sim no)
(at 499.11 477.52 0) (at 499.11 477.52 0)
@ -16987,16 +17025,6 @@
) )
(uuid "d73aa2a0-6c8a-46d5-b3c9-98204c36143c") (uuid "d73aa2a0-6c8a-46d5-b3c9-98204c36143c")
) )
(text "Check polarity, combine with ms4?\n"
(exclude_from_sim no)
(at 307.34 76.2 0)
(effects
(font
(size 1.27 1.27)
)
)
(uuid "dc811744-0c73-43e0-9d1f-cef99de4fba9")
)
(label "3_3V_cool" (label "3_3V_cool"
(at 158.75 198.12 0) (at 158.75 198.12 0)
(fields_autoplaced yes) (fields_autoplaced yes)
@ -37731,85 +37759,6 @@
) )
) )
) )
(symbol
(lib_id "Device:R")
(at 468.63 532.13 0)
(unit 1)
(exclude_from_sim no)
(in_bom yes)
(on_board yes)
(dnp no)
(fields_autoplaced yes)
(uuid "5282b5c9-6a74-4444-a3d4-c8695dda3e06")
(property "Reference" "R30"
(at 471.17 530.86 0)
(effects
(font
(size 1.27 1.27)
)
(justify left)
)
)
(property "Value" "30k"
(at 471.17 533.4 0)
(effects
(font
(size 1.27 1.27)
)
(justify left)
)
)
(property "Footprint" "Resistor_SMD:R_0603_1608Metric"
(at 466.852 532.13 90)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Datasheet" "~"
(at 468.63 532.13 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Description" ""
(at 468.63 532.13 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "LCSC_PART_NUMBER" "C2907149"
(at 468.63 532.13 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(pin "1"
(uuid "8acd2ca7-db3b-4583-8b6f-0949aefe2def")
)
(pin "2"
(uuid "c2af0d04-a68c-466f-8e6e-8429d1a24318")
)
(instances
(project "PlantCtrlESP32"
(path "/c26e8d55-0b6e-4c4e-b7c8-b1fed973201c"
(reference "R30")
(unit 1)
)
)
)
)
(symbol (symbol
(lib_id "Device:R") (lib_id "Device:R")
(at 499.11 400.05 0) (at 499.11 400.05 0)
@ -43233,6 +43182,87 @@
) )
) )
) )
(symbol
(lib_id "Device:R_Potentiometer")
(at 396.24 519.43 0)
(unit 1)
(exclude_from_sim no)
(in_bom yes)
(on_board yes)
(dnp no)
(uuid "84b2b2be-2dbf-4c20-aa55-1957eb031b82")
(property "Reference" "RV2"
(at 393.7 518.16 0)
(effects
(font
(size 1.27 1.27)
)
(justify right)
)
)
(property "Value" "50k"
(at 393.7 520.7 0)
(effects
(font
(size 1.27 1.27)
)
(justify right)
)
)
(property "Footprint" "Potentiometer_THT:Potentiometer_Bourns_3299W_Vertical"
(at 396.24 519.43 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Datasheet" "~"
(at 396.24 519.43 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Description" ""
(at 396.24 519.43 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "LCSC_PART_NUMBER" "C118911"
(at 396.24 519.43 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(pin "1"
(uuid "eed82135-b2b2-4e54-bd28-10a7e16d3475")
)
(pin "2"
(uuid "9568b812-3f8b-4083-8f2d-597e20f6d7ca")
)
(pin "3"
(uuid "decf576a-9dba-4f35-b79f-af87ec95b2d1")
)
(instances
(project "PlantCtrlESP32"
(path "/c26e8d55-0b6e-4c4e-b7c8-b1fed973201c"
(reference "RV2")
(unit 1)
)
)
)
)
(symbol (symbol
(lib_id "Device:R") (lib_id "Device:R")
(at 455.93 168.91 90) (at 455.93 168.91 90)
@ -45692,7 +45722,7 @@
(hide yes) (hide yes)
) )
) )
(property "Value" "1k" (property "Value" "5k"
(at 293.878 74.93 90) (at 293.878 74.93 90)
(effects (effects
(font (font
@ -48195,6 +48225,88 @@
) )
) )
) )
(symbol
(lib_id "Device:R_Potentiometer")
(at 468.63 532.13 0)
(mirror y)
(unit 1)
(exclude_from_sim no)
(in_bom yes)
(on_board yes)
(dnp no)
(uuid "b332c31b-5371-4806-9189-268fb6732856")
(property "Reference" "RV3"
(at 471.17 530.86 0)
(effects
(font
(size 1.27 1.27)
)
(justify right)
)
)
(property "Value" "50k"
(at 471.17 533.4 0)
(effects
(font
(size 1.27 1.27)
)
(justify right)
)
)
(property "Footprint" "Potentiometer_THT:Potentiometer_Bourns_3299W_Vertical"
(at 468.63 532.13 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Datasheet" "~"
(at 468.63 532.13 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Description" ""
(at 468.63 532.13 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "LCSC_PART_NUMBER" "C118911"
(at 468.63 532.13 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(pin "1"
(uuid "7d4215e3-1540-4495-b06d-f0ce9c684265")
)
(pin "2"
(uuid "ad14874f-5a05-4695-b1a8-1273fccc40e1")
)
(pin "3"
(uuid "3d1aa074-5e83-4f3a-a188-1b671f6f6aaf")
)
(instances
(project "PlantCtrlESP32"
(path "/c26e8d55-0b6e-4c4e-b7c8-b1fed973201c"
(reference "RV3")
(unit 1)
)
)
)
)
(symbol (symbol
(lib_id "Device:R") (lib_id "Device:R")
(at 425.45 97.79 180) (at 425.45 97.79 180)
@ -51184,84 +51296,6 @@
) )
) )
) )
(symbol
(lib_id "Device:R")
(at 396.24 519.43 0)
(unit 1)
(exclude_from_sim no)
(in_bom yes)
(on_board yes)
(dnp no)
(uuid "d1525130-47c2-4ff2-aed6-ce8ea1c915a0")
(property "Reference" "R31"
(at 390.652 518.414 0)
(effects
(font
(size 1.27 1.27)
)
(justify left)
)
)
(property "Value" "34k"
(at 390.525 520.7 0)
(effects
(font
(size 1.27 1.27)
)
(justify left)
)
)
(property "Footprint" "Resistor_SMD:R_0603_1608Metric"
(at 394.462 519.43 90)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Datasheet" "~"
(at 396.24 519.43 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "Description" ""
(at 396.24 519.43 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "LCSC_PART_NUMBER" "C2933202"
(at 396.24 519.43 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(pin "1"
(uuid "b22bc509-5d72-4823-9650-ae3ec9d5f74d")
)
(pin "2"
(uuid "9042682a-77f4-4b63-87e5-4221db8698b2")
)
(instances
(project "PlantCtrlESP32"
(path "/c26e8d55-0b6e-4c4e-b7c8-b1fed973201c"
(reference "R31")
(unit 1)
)
)
)
)
(symbol (symbol
(lib_id "Device:R") (lib_id "Device:R")
(at 659.13 168.91 90) (at 659.13 168.91 90)

View File

@ -566,6 +566,7 @@ fn safe_main() -> anyhow::Result<()> {
let _webserver = httpd(reboot_now.clone()); let _webserver = httpd(reboot_now.clone());
wait_infinity(WaitType::MqttConfig, reboot_now.clone()); wait_infinity(WaitType::MqttConfig, reboot_now.clone());
} }
board.set_restart_to_conf(false);
board.deep_sleep(1000 * 1000 * 60 * deep_sleep_duration_minutes as u64); board.deep_sleep(1000 * 1000 * 60 * deep_sleep_duration_minutes as u64);
} }
@ -966,6 +967,7 @@ fn main() {
match result { match result {
Ok(_) => { Ok(_) => {
println!("Main app finished, restarting"); println!("Main app finished, restarting");
BOARD_ACCESS.lock().unwrap().set_restart_to_conf(false);
BOARD_ACCESS.lock().unwrap().deep_sleep(1); BOARD_ACCESS.lock().unwrap().deep_sleep(1);
} }
Err(err) => { Err(err) => {

View File

@ -24,7 +24,7 @@ use esp_idf_svc::wifi::EspWifi;
use measurements::Temperature; use measurements::Temperature;
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
use plant_ctrl2::sipo::ShiftRegister40; use plant_ctrl2::sipo::ShiftRegister40;
use esp_idf_sys::esp_deep_sleep; use esp_idf_sys::{esp_deep_sleep, esp_sleep_enable_ext1_wakeup, esp_sleep_ext1_wakeup_mode_t_ESP_EXT1_WAKEUP_ANY_LOW};
use esp_idf_sys::esp_restart; use esp_idf_sys::esp_restart;
use anyhow::{anyhow, Context}; use anyhow::{anyhow, Context};
@ -160,7 +160,7 @@ pub struct PlantCtrlBoard<'a> {
main_pump: PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, InputOutput>, main_pump: PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, InputOutput>,
tank_power: PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, InputOutput>, tank_power: PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, InputOutput>,
general_fault: PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, InputOutput>, general_fault: PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, InputOutput>,
pub wifi_driver: EspWifi<'a>, wifi_driver: EspWifi<'a>,
one_wire_bus: OneWire<PinDriver<'a, Gpio18, esp_idf_hal::gpio::InputOutput>>, one_wire_bus: OneWire<PinDriver<'a, Gpio18, esp_idf_hal::gpio::InputOutput>>,
mqtt_client: Option<EspMqttClient<'a>>, mqtt_client: Option<EspMqttClient<'a>>,
battery_driver: Bq34z100g1Driver<MutexDevice<'a, I2cDriver<'a>>, Delay>, battery_driver: Bq34z100g1Driver<MutexDevice<'a, I2cDriver<'a>>, Delay>,
@ -208,7 +208,8 @@ impl PlantCtrlBoard<'_> {
if duration_in_ms == 0 { if duration_in_ms == 0 {
esp_restart(); esp_restart();
} else { } else {
// esp_sleep_enable_ext1_wakeup(0b10u64, esp_sleep_ext1_wakeup_mode_t_ESP_EXT1_WAKEUP_ANY_LOW); //configure gpio 1 to wakeup on low, reused boot button for this
esp_sleep_enable_ext1_wakeup(0b10u64, esp_sleep_ext1_wakeup_mode_t_ESP_EXT1_WAKEUP_ANY_LOW);
esp_deep_sleep(duration_in_ms); esp_deep_sleep(duration_in_ms);
} }
@ -571,9 +572,8 @@ impl PlantCtrlBoard<'_> {
ssid_hidden: false, ssid_hidden: false,
..Default::default() ..Default::default()
}; };
let clientconfig = ClientConfiguration::default();
self.wifi_driver self.wifi_driver
.set_configuration(&Configuration::Mixed(clientconfig, apconfig))?; .set_configuration(&Configuration::AccessPoint(apconfig))?;
self.wifi_driver.start()?; self.wifi_driver.start()?;
Ok(()) Ok(())
} }