Compare commits

..

15 Commits

Author SHA1 Message Date
e57e87af3f fix backplane usb placement, use uncritial pins for high during flash/boot 2025-06-23 23:19:36 +02:00
450197c7cd merge stuff 2025-06-23 22:21:03 +02:00
736925f7de Merge pull request 'Housekeeping' (#18) from housekeeping into develop
Reviewed-on: #18
2025-06-23 22:15:50 +02:00
1fb9d2ab1b Merge pull request 'reduced sizes so all executable code stays below 8mb' (#19) from feature/partition_table_stuff into develop
Reviewed-on: #19
2025-06-23 22:15:34 +02:00
ea60d804b3 reduced sizes so all executable code stays below 8mb 2025-06-22 17:36:59 +02:00
d059b7b1db Merge branch 'develop' into housekeeping and clippy and spellcheck 2025-06-20 23:59:14 +02:00
e7b6bda747 Merge branch 'develop' into housekeeping 2025-06-20 23:40:32 +02:00
04849162cd added solar ina handling, adjusted website 2025-06-20 23:37:59 +02:00
5621f17e61
fix all warnings 2025-06-20 21:31:12 +02:00
d0e5627815
keep node artifacts in webpack directory
add commands to build.rs to move assets to required location within src
2025-06-20 20:53:32 +02:00
7115809f2b
fix all compiler warnings 2025-06-20 20:53:29 +02:00
c1d0ce542c
fix confusing lifetime warning 2025-06-20 20:53:28 +02:00
b7b08d8747
fix unused variable warnings 2025-06-20 20:53:26 +02:00
8d68f0ef14
remove embassy references in Cargo.toml
in newer esp-rust toolchains having these dependencies defiened leeds to
compile errors.
2025-06-20 20:53:23 +02:00
34b20b1f8f Merge pull request 'Refactor Battery State for more robustness against missing BatteryMonitor' (#17) from fix/deep-sleep-timeout-robustness into develop
Reviewed-on: #17
2025-06-20 20:52:48 +02:00
35 changed files with 7238 additions and 6058 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"board": {
"active_layer": 0,
"active_layer": 2,
"active_layer_preset": "All Layers",
"auto_track_width": false,
"hidden_netclasses": [],

View File

@ -1102,6 +1102,15 @@
(hide yes)
)
)
(property "Sim.Pins" "1=K 2=A"
(at 0 0 0)
(effects
(font
(size 1.27 1.27)
)
(hide yes)
)
)
(property "ki_keywords" "LED diode"
(at 0 0 0)
(effects
@ -4742,6 +4751,26 @@
)
(uuid f1cb09e6-74b4-43c4-8247-c9f441069dc5)
)
(text "free"
(exclude_from_sim no)
(at 180.848 72.39 0)
(effects
(font
(size 1.27 1.27)
)
)
(uuid "1556efd1-3aac-45ee-8113-03336077a83d")
)
(text "GPIO21 pulses high during flashing!\nGPIO19 is used for communication during flashing"
(exclude_from_sim no)
(at 202.692 102.362 0)
(effects
(font
(size 1.27 1.27)
)
)
(uuid "2195adc7-ab0b-4ee3-aa2e-b2786571de43")
)
(text "To Allow Wakeup via interrupt"
(exclude_from_sim no)
(at 157.734 70.104 0)
@ -5021,6 +5050,10 @@
(at 31.75 200.66)
(uuid "133b7027-41a1-4e09-a1e6-24d8bb033b2a")
)
(no_connect
(at 184.15 72.39)
(uuid "5a1ba32e-b2ae-4014-aefc-1b75b4dc3c15")
)
(no_connect
(at 184.15 67.31)
(uuid "6d645bf1-339f-4b38-a26a-bdd168ca591e")
@ -6151,7 +6184,7 @@
)
(global_label "WORKING"
(shape input)
(at 224.79 72.39 0)
(at 224.79 87.63 0)
(fields_autoplaced yes)
(effects
(font
@ -6161,7 +6194,7 @@
)
(uuid "0af53f6a-ea11-4d73-a8d1-f63ebcdc2e54")
(property "Intersheetrefs" "${INTERSHEET_REFS}"
(at 235.6482 72.39 0)
(at 235.6482 87.63 0)
(effects
(font
(size 1.27 1.27)
@ -6435,28 +6468,6 @@
)
)
)
(global_label "PUMP_ENABLE"
(shape input)
(at 184.15 72.39 180)
(fields_autoplaced yes)
(effects
(font
(size 1.27 1.27)
)
(justify right)
)
(uuid "2e795b18-a106-4105-bbb4-8c45273e4987")
(property "Intersheetrefs" "${INTERSHEET_REFS}"
(at 168.5143 72.39 0)
(effects
(font
(size 1.27 1.27)
)
(justify right)
(hide yes)
)
)
)
(global_label "SDA"
(shape input)
(at 224.79 85.09 0)
@ -6701,44 +6712,22 @@
)
(global_label "EXTRA_1"
(shape input)
(at 224.79 92.71 0)
(at 184.15 82.55 180)
(fields_autoplaced yes)
(effects
(font
(size 1.27 1.27)
)
(justify left)
(justify right)
)
(uuid "4635eda0-e395-42c7-9764-c7b7fc3019ec")
(property "Intersheetrefs" "${INTERSHEET_REFS}"
(at 234.9828 92.71 0)
(at 173.9572 82.55 0)
(effects
(font
(size 1.27 1.27)
)
(justify left)
(hide yes)
)
)
)
(global_label "GND"
(shape input)
(at 59.69 135.89 0)
(fields_autoplaced yes)
(effects
(font
(size 1.27 1.27)
)
(justify left)
)
(uuid "472614c1-a2b1-4366-9d8e-904ae5de7b8a")
(property "Intersheetrefs" "${INTERSHEET_REFS}"
(at 65.8915 135.89 0)
(effects
(font
(size 1.27 1.27)
)
(justify left)
(justify right)
(hide yes)
)
)
@ -7075,22 +7064,22 @@
)
(global_label "WARN_LED"
(shape input)
(at 184.15 82.55 180)
(at 224.79 92.71 0)
(fields_autoplaced yes)
(effects
(font
(size 1.27 1.27)
)
(justify right)
(justify left)
)
(uuid "63850aa5-2eca-4827-9a2f-c5aed597072f")
(property "Intersheetrefs" "${INTERSHEET_REFS}"
(at 172.2638 82.55 0)
(at 236.6762 92.71 0)
(effects
(font
(size 1.27 1.27)
)
(justify right)
(justify left)
(hide yes)
)
)
@ -7339,7 +7328,7 @@
)
(global_label "EXTRA_2"
(shape input)
(at 224.79 87.63 0)
(at 224.79 72.39 0)
(fields_autoplaced yes)
(effects
(font
@ -7349,7 +7338,7 @@
)
(uuid "79c7218b-c7f0-4a6c-8b1d-8ae92200b937")
(property "Intersheetrefs" "${INTERSHEET_REFS}"
(at 234.9828 87.63 0)
(at 234.9828 72.39 0)
(effects
(font
(size 1.27 1.27)
@ -12076,7 +12065,7 @@
(hide yes)
)
)
(property "Description" ""
(property "Description" "Light emitting diode"
(at 142.24 115.57 0)
(effects
(font
@ -12110,7 +12099,7 @@
)
)
)
(property "Sim.Pins" ""
(property "Sim.Pins" "1=K 2=A"
(at 142.24 115.57 0)
(effects
(font
@ -12298,7 +12287,7 @@
(hide yes)
)
)
(property "Description" ""
(property "Description" "Light emitting diode"
(at 74.93 337.82 0)
(effects
(font
@ -12332,7 +12321,7 @@
)
)
)
(property "Sim.Pins" ""
(property "Sim.Pins" "1=K 2=A"
(at 74.93 337.82 0)
(effects
(font
@ -13631,7 +13620,7 @@
(hide yes)
)
)
(property "Description" ""
(property "Description" "Light emitting diode"
(at 113.03 107.95 0)
(effects
(font
@ -13665,7 +13654,7 @@
)
)
)
(property "Sim.Pins" ""
(property "Sim.Pins" "1=K 2=A"
(at 113.03 107.95 0)
(effects
(font
@ -14388,7 +14377,7 @@
(hide yes)
)
)
(property "Description" ""
(property "Description" "Light emitting diode"
(at 35.56 337.82 0)
(effects
(font
@ -14422,7 +14411,7 @@
)
)
)
(property "Sim.Pins" ""
(property "Sim.Pins" "1=K 2=A"
(at 35.56 337.82 0)
(effects
(font
@ -14939,7 +14928,7 @@
(hide yes)
)
)
(property "Description" ""
(property "Description" "Light emitting diode"
(at 281.94 101.6 0)
(effects
(font
@ -14973,7 +14962,7 @@
)
)
)
(property "Sim.Pins" ""
(property "Sim.Pins" "1=K 2=A"
(at 281.94 101.6 0)
(effects
(font

View File

@ -166,40 +166,40 @@
)
(pad "7" thru_hole rect
(at -0.5 -12)
(size 0.85 0.85)
(drill 0.5)
(size 1.7 1.7)
(drill 1)
(layers "*.Cu" "*.Mask")
(remove_unused_layers no)
(uuid "536f0038-06c5-45e5-b1c8-898a364f6ec4")
)
(pad "8" thru_hole rect
(at 39.5 -16)
(size 0.85 0.85)
(drill 0.5)
(size 1.7 1.7)
(drill 1)
(layers "*.Cu" "*.Mask")
(remove_unused_layers no)
(uuid "3e0cdbaa-8219-48c4-bb0a-fd4f0e78a390")
)
(pad "9" thru_hole rect
(at 39.5 22.5)
(size 0.85 0.85)
(drill 0.5)
(size 1.7 1.7)
(drill 1)
(layers "*.Cu" "*.Mask")
(remove_unused_layers no)
(uuid "f01565c2-eadd-4451-9dea-2ebe28d872f0")
)
(pad "10" thru_hole rect
(at -0.5 15)
(size 0.85 0.85)
(drill 0.5)
(size 1.7 1.7)
(drill 1)
(layers "*.Cu" "*.Mask")
(remove_unused_layers no)
(uuid "56ec7c50-069f-4f46-9b83-ac18e4928930")
)
(pad "11" thru_hole rect
(at -43 22.5)
(size 0.85 0.85)
(drill 0.5)
(size 1.7 1.7)
(drill 1)
(layers "*.Cu" "*.Mask")
(remove_unused_layers no)
(uuid "f423be21-13b8-46de-8e19-e48325411a29")

View File

@ -738,7 +738,7 @@
(type default)
)
(layer "F.SilkS")
(uuid "87f61a83-c9a2-45b6-a235-fe6e83f3dbe3")
(uuid "23d58535-2840-4798-8fe6-a41e5dd82cfc")
)
(fp_line
(start -45 24)
@ -748,7 +748,7 @@
(type default)
)
(layer "F.SilkS")
(uuid "f24175c8-21e2-4899-af70-89e48457e9ba")
(uuid "ed3c0755-343c-4d19-9481-c2c33348ef82")
)
(fp_line
(start -44 24)
@ -758,7 +758,7 @@
(type default)
)
(layer "F.SilkS")
(uuid "a884c661-0353-48a0-9bc6-995e02652e36")
(uuid "cd2e639b-4e20-40a4-8976-6223f2753aeb")
)
(fp_line
(start 41 -18)
@ -768,7 +768,7 @@
(type default)
)
(layer "F.SilkS")
(uuid "675d135e-52c1-4dd1-b434-983f40a2b544")
(uuid "f34b006e-828a-45d3-b0f5-daad16782ed8")
)
(fp_line
(start 41 24)
@ -778,7 +778,7 @@
(type default)
)
(layer "F.SilkS")
(uuid "fbfb2621-73ae-4c15-8403-abdec5cc45cd")
(uuid "03fcb85f-a42f-4eab-bf16-6ff7087e0441")
)
(fp_text user "${REFERENCE}"
(at 0 2.5 0)
@ -860,8 +860,8 @@
)
(pad "7" thru_hole rect
(at -0.5 -12)
(size 0.85 0.85)
(drill 0.5)
(size 1.7 1.7)
(drill 1)
(layers "*.Cu" "*.Mask")
(remove_unused_layers no)
(net 1 "GND")
@ -871,8 +871,8 @@
)
(pad "8" thru_hole rect
(at 39.5 -16)
(size 0.85 0.85)
(drill 0.5)
(size 1.7 1.7)
(drill 1)
(layers "*.Cu" "*.Mask")
(remove_unused_layers no)
(net 1 "GND")
@ -882,8 +882,8 @@
)
(pad "9" thru_hole rect
(at 39.5 22.5)
(size 0.85 0.85)
(drill 0.5)
(size 1.7 1.7)
(drill 1)
(layers "*.Cu" "*.Mask")
(remove_unused_layers no)
(net 1 "GND")
@ -893,8 +893,8 @@
)
(pad "10" thru_hole rect
(at -0.5 15)
(size 0.85 0.85)
(drill 0.5)
(size 1.7 1.7)
(drill 1)
(layers "*.Cu" "*.Mask")
(remove_unused_layers no)
(net 1 "GND")
@ -904,8 +904,8 @@
)
(pad "11" thru_hole rect
(at -43 22.5)
(size 0.85 0.85)
(drill 0.5)
(size 1.7 1.7)
(drill 1)
(layers "*.Cu" "*.Mask")
(remove_unused_layers no)
(net 1 "GND")

Binary file not shown.

View File

@ -7,54 +7,123 @@ P arrayDim N
317VBAT VIA MD0157PA00X+043130Y-035039X0315Y0000R000S3
317GND VIA MD1181PA00X+077500Y-007000X1575Y0000R000S3
317GND VIA MD0157PA00X+062402Y-010433X0315Y0000R000S3
317GND VIA MD0157PA00X+054134Y-011614X0315Y0000R000S3
317GND VIA MD0157PA00X+062205Y-012303X0315Y0000R000S3
317GND VIA MD0157PA00X+058169Y-012303X0315Y0000R000S3
317GND VIA MD0157PA00X+051772Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+054449Y-012323X0315Y0000R000S3
317GND VIA MD0157PA00X+044606Y-010551X0315Y0000R000S3
317GND VIA MD0157PA00X+054921Y-011417X0315Y0000R000S3
317GND VIA MD0157PA00X+050787Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+042126Y-008976X0315Y0000R000S3
317GND VIA MD0157PA00X+062205Y-012323X0315Y0000R000S3
317GND VIA MD0157PA00X+059291Y-012323X0315Y0000R000S3
317GND VIA MD0157PA00X+058150Y-012323X0315Y0000R000S3
317GND VIA MD0157PA00X+054843Y-012323X0315Y0000R000S3
317GND VIA MD0157PA00X+043228Y-012480X0315Y0000R000S3
317GND VIA MD0157PA00X+047244Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+060374Y-011594X0315Y0000R000S3
317GND VIA MD1181PA00X+041500Y-042900X1575Y0000R000S3
317GND VIA MD0157PA00X+059685Y-012402X0315Y0000R000S3
317GND VIA MD0157PA00X+054429Y-011909X0315Y0000R000S3
317GND VIA MD0157PA00X+053346Y-010925X0315Y0000R000S3
317GND VIA MD0157PA00X+047165Y-011260X0315Y0000R000S3
317GND VIA MD0157PA00X+042717Y-013031X0315Y0000R000S3
317GND VIA MD0157PA00X+057008Y-012323X0315Y0000R000S3
317GND VIA MD0157PA00X+062205Y-011614X0315Y0000R000S3
317GND VIA MD0157PA00X+058917Y-012323X0315Y0000R000S3
317GND VIA MD0157PA00X+040945Y-035630X0315Y0000R000S3
317GND VIA MD0157PA00X+059606Y-011575X0315Y0000R000S3
317GND VIA MD1181PA00X+077500Y-042900X1575Y0000R000S3
317GND VIA MD0157PA00X+059055Y-012402X0315Y0000R000S3
317GND VIA MD0157PA00X+056594Y-012303X0315Y0000R000S3
317GND VIA MD0157PA00X+046890Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+054016Y-010591X0315Y0000R000S3
317GND VIA MD0157PA00X+046457Y-011260X0315Y0000R000S3
317GND VIA MD0157PA00X+045039Y-011260X0315Y0000R000S3
317GND VIA MD0157PA00X+045748Y-011260X0315Y0000R000S3
317GND VIA MD0157PA00X+051850Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+051260Y-011260X0315Y0000R000S3
317GND VIA MD0157PA00X+054646Y-011142X0315Y0000R000S3
317GND VIA MD0157PA00X+043819Y-011929X0315Y0000R000S3
317GND VIA MD0157PA00X+046102Y-011260X0315Y0000R000S3
317GND VIA MD0157PA00X+059646Y-012323X0315Y0000R000S3
317GND VIA MD0157PA00X+050079Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+056594Y-012323X0315Y0000R000S3
317GND VIA MD0157PA00X+045118Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+061122Y-011614X0315Y0000R000S3
317GND VIA MD0157PA00X+054626Y-010827X0315Y0000R000S3
317GND VIA MD0157PA00X+043346Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+056693Y-011614X0315Y0000R000S3
317GND VIA MD0157PA00X+044055Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+052559Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+050197Y-011260X0315Y0000R000S3
317GND VIA MD0157PA00X+048228Y-011260X0315Y0000R000S3
317GND VIA MD0157PA00X+045669Y-007087X0315Y0000R000S3
317GND VIA MD0157PA00X+054724Y-012205X0315Y0000R000S3
317GND VIA MD0157PA00X+063386Y-011220X0315Y0000R000S3
317GND VIA MD0157PA00X+059685Y-011614X0315Y0000R000S3
317GND VIA MD0157PA00X+060472Y-012323X0315Y0000R000S3
317GND VIA MD0157PA00X+045699Y-017156X0315Y0000R000S3
317GND VIA MD0157PA00X+048661Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+049724Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+048091Y-016535X0315Y0000R000S3
317GND VIA MD0157PA00X+053740Y-011220X0315Y0000R000S3
317GND VIA MD0157PA00X+048917Y-031102X0315Y0000R000S3
317GND VIA MD0157PA00X+056299Y-005591X0315Y0000R000S3
317GND VIA MD0157PA00X+053858Y-011693X0315Y0000R000S3
317GND VIA MD0157PA00X+049843Y-011260X0315Y0000R000S3
317GND VIA MD0157PA00X+059232Y-011575X0315Y0000R000S3
317GND VIA MD0157PA00X+055709Y-011220X0315Y0000R000S3
317GND VIA MD0157PA00X+058169Y-011614X0315Y0000R000S3
317GND VIA MD0157PA00X+044094Y-011654X0315Y0000R000S3
317GND VIA MD0157PA00X+061654Y-008071X0315Y0000R000S3
317GND VIA MD0157PA00X+054035Y-010138X0315Y0000R000S3
317GND VIA MD0157PA00X+054331Y-010531X0315Y0000R000S3
317GND VIA MD0157PA00X+055217Y-012303X0315Y0000R000S3
317GND VIA MD0157PA00X+056102Y-012303X0315Y0000R000S3
317GND VIA MD0157PA00X+055315Y-011516X0315Y0000R000S3
317GND VIA MD0157PA00X+055709Y-012303X0315Y0000R000S3
317GND VIA MD0157PA00X+054921Y-011220X0315Y0000R000S3
317GND VIA MD0157PA00X+050551Y-011260X0315Y0000R000S3
317GND VIA MD0157PA00X+049370Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+042402Y-009213X0315Y0000R000S3
317GND VIA MD0157PA00X+059980Y-011594X0315Y0000R000S3
317GND VIA MD0157PA00X+056181Y-011614X0315Y0000R000S3
317GND VIA MD0157PA00X+044409Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+055276Y-012323X0315Y0000R000S3
317GND VIA MD0157PA00X+056181Y-012323X0315Y0000R000S3
317GND VIA MD0157PA00X+045394Y-011260X0315Y0000R000S3
317GND VIA MD0157PA00X+060748Y-011614X0315Y0000R000S3
317GND VIA MD0157PA00X+044685Y-011260X0315Y0000R000S3
317GND VIA MD0157PA00X+055276Y-011614X0315Y0000R000S3
317GND VIA MD0157PA00X+051142Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+055748Y-012323X0315Y0000R000S3
317GND VIA MD0157PA00X+045827Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+052835Y-011260X0315Y0000R000S3
317GND VIA MD0157PA00X+053189Y-011260X0315Y0000R000S3
317GND VIA MD0157PA00X+047953Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+052205Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+053780Y-010315X0315Y0000R000S3
317GND VIA MD0157PA00X+046181Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+047283Y-023622X0315Y0000R000S3
317GND VIA MD0157PA00X+051496Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+059843Y-005591X0315Y0000R000S3
317GND VIA MD0157PA00X+050787Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+053583Y-011378X0315Y0000R000S3
317GND VIA MD0157PA00X+049016Y-034154X0315Y0000R000S3
317GND VIA MD0157PA00X+051772Y-008858X0315Y0000R000S3
317GND VIA MD0157PA00X+045472Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+058543Y-012323X0315Y0000R000S3
317GND VIA MD0157PA00X+054331Y-010866X0315Y0000R000S3
317GND VIA MD0157PA00X+046811Y-011260X0315Y0000R000S3
317GND VIA MD0157PA00X+046555Y-030512X0315Y0000R000S3
317GND VIA MD0157PA00X+061122Y-012303X0315Y0000R000S3
317GND VIA MD0157PA00X+052913Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+043701Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+048307Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+061181Y-012323X0315Y0000R000S3
317GND VIA MD0157PA00X+049488Y-011260X0315Y0000R000S3
317GND VIA MD0157PA00X+047520Y-011260X0315Y0000R000S3
317GND VIA MD0157PA00X+060059Y-012323X0315Y0000R000S3
317GND VIA MD0157PA00X+042283Y-013386X0315Y0000R000S3
317GND VIA MD0157PA00X+044764Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+047205Y-025709X0315Y0000R000S3
317GND VIA MD0157PA00X+055709Y-011614X0315Y0000R000S3
317GND VIA MD0157PA00X+059055Y-011614X0315Y0000R000S3
317GND VIA MD0157PA00X+060827Y-012323X0315Y0000R000S3
317GND VIA MD0157PA00X+054134Y-011969X0315Y0000R000S3
317GND VIA MD0157PA00X+046535Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+043504Y-012205X0315Y0000R000S3
317GND VIA MD1181PA00X+041575Y-007087X1575Y0000R000S3
317GND VIA MD0157PA00X+050906Y-011260X0315Y0000R000S3
317GND VIA MD0157PA00X+042992Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+040945Y-034646X0315Y0000R000S3
317GND VIA MD0157PA00X+063386Y-012598X0315Y0000R000S3
317GND VIA MD0157PA00X+047598Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+047874Y-011260X0315Y0000R000S3
317GND VIA MD0157PA00X+042756Y-009291X0315Y0000R000S3
317GND VIA MD0157PA00X+050433Y-009646X0315Y0000R000S3
317GND VIA MD0157PA00X+048583Y-011260X0315Y0000R000S3
317GND VIA MD0157PA00X+048031Y-014567X0315Y0000R000S3
317GND VIA MD0157PA00X+057185Y-011516X0315Y0000R000S3
317GND VIA MD0157PA00X+057185Y-011614X0315Y0000R000S3
317GND VIA MD0157PA00X+042953Y-012756X0315Y0000R000S3
3173_3V VIA MD0157PA00X+064646Y-014567X0315Y0000R000S3
3173_3V VIA MD0157PA00X+075906Y-014331X0315Y0000R000S3
3173_3V VIA MD0157PA00X+074094Y-014331X0315Y0000R000S3
@ -76,79 +145,19 @@ P arrayDim N
317ISDAY VIA MD0157PA00X+066929Y-011024X0315Y0000R000S3
317LED_ENABLE VIA MD0157PA00X+064764Y-010728X0315Y0000R000S3
317WORKING VIA MD0157PA00X+058661Y-011417X0315Y0000R000S3
317WORKING VIA MD0157PA00X+071949Y-008169X0315Y0000R000S3
317WORKING VIA MD0157PA00X+069843Y-008858X0315Y0000R000S3
317ENABLE_TANK VIA MD0157PA00X+062894Y-011516X0315Y0000R000S3
317ENABLE_TANK VIA MD0157PA00X+050525Y-015584X0315Y0000R000S3
317USB_D- VIA MD0157PA00X+045276Y-010305X0315Y0000R000S3
317USB_D- VIA MD0157PA00X+063377Y-011752X0315Y0000R000S3
317USB_D- VIA MD0157PA00X+052902Y-009500X0315Y0000R000S3
317FLOW VIA MD0157PA00X+048543Y-023228X0315Y0000R000S3
317FLOW VIA MD0157PA00X+063484Y-007382X0315Y0000R000S3
317USB_D+ VIA MD0157PA00X+045276Y-010719X0315Y0000R000S3
317USB_D+ VIA MD0157PA00X+063377Y-012165X0315Y0000R000S3
317USB_D+ VIA MD0157PA00X+052610Y-009792X0315Y0000R000S3
317BOOT_SEL VIA MD0157PA00X+064764Y-009744X0315Y0000R000S3
317BOOT_SEL VIA MD0157PA00X+070374Y-012205X0315Y0000R000S3
317WARN_LED VIA MD0157PA00X+069803Y-008465X0315Y0000R000S3
317WARN_LED VIA MD0157PA00X+044390Y-005807X0315Y0000R000S3
317WARN_LED VIA MD0157PA00X+063386Y-008268X0315Y0000R000S3
327GND U2 -1 A01X+064094Y-005709X0591Y0354R000S2
3273_3V U2 -2 A01X+064094Y-006209X0591Y0354R000S2
327EN U2 -3 A01X+064094Y-006709X0591Y0354R000S2
327FLOW U2 -4 A01X+064094Y-007209X0591Y0354R000S2
327TANK_SENSOR U2 -5 A01X+064094Y-007709X0591Y0354R000S2
327WARN_LED U2 -6 A01X+064094Y-008209X0591Y0354R000S2
327ISDAY U2 -7 A01X+064094Y-008709X0591Y0354R000S2
327-(U2-IO0-PAD8) U2 -8 A01X+064094Y-009209X0591Y0354R000S2
327BOOT_SEL U2 -9 A01X+064094Y-009709X0591Y0354R000S2
327(U2-IO8-PAD10) U2 -10 A01X+064094Y-010209X0591Y0354R000S2
327LED_ENABLE U2 -11 A01X+064094Y-010709X0591Y0354R000S2
327ENABLE_TANK U2 -12 A01X+064094Y-011209X0591Y0354R000S2
327USB_D- U2 -13 A01X+064094Y-011709X0591Y0354R000S2
327USB_D+ U2 -14 A01X+064094Y-012209X0591Y0354R000S2
327BOOT_SEL U2 -15 A01X+070984Y-012209X0591Y0354R000S2
327TEMP U2 -16 A01X+070984Y-011709X0591Y0354R000S2
327SCL U2 -17 A01X+070984Y-011209X0591Y0354R000S2
327SDA U2 -18 A01X+070984Y-010709X0591Y0354R000S2
327EXTRA_2 U2 -19 A01X+070984Y-010209X0591Y0354R000S2
327CD_PROBE U2 -20 A01X+070984Y-009709X0591Y0354R000S2
327EXTRA_1 U2 -21 A01X+070984Y-009209X0591Y0354R000S2
327-(U2-NC-PAD22) U2 -22 A01X+070984Y-008709X0591Y0354R000S2
327WORKING U2 -23 A01X+070984Y-008209X0591Y0354R000S2
327ESP_RX U2 -24 A01X+070984Y-007709X0591Y0354R000S2
327ESP_TX U2 -25 A01X+070984Y-007209X0591Y0354R000S2
327CHARGE U2 -26 A01X+070984Y-006709X0591Y0354R000S2
327PUMP_ENABLE U2 -27 A01X+070984Y-006209X0591Y0354R000S2
327GND U2 -28 A01X+070984Y-005709X0591Y0354R000S2
327GND U2 -29_5 A01X+066947Y-007961X0315Y0315R000S2
327GND U2 -29_1 A01X+066455Y-007469X0315Y0315R000S2
327GND U2 -29_2 A01X+066947Y-007469X0315Y0315R000S2
327GND U2 -29_3 A01X+067439Y-007469X0315Y0315R000S2
327GND U2 -29_4 A01X+066455Y-007961X0315Y0315R000S2
327GND U2 -29_6 A01X+067439Y-007961X0315Y0315R000S2
327GND U2 -29_7 A01X+066455Y-008453X0315Y0315R000S2
327GND U2 -29_8 A01X+066947Y-008453X0315Y0315R000S2
327GND U2 -29_9 A01X+067439Y-008453X0315Y0315R000S2
317GND U2 -30_1 D0098PA00X+066701Y-007469X0138Y0000R000S3
317GND U2 -30_2 D0098PA00X+067193Y-007469X0138Y0000R000S3
317GND U2 -30_3 D0098PA00X+066455Y-007715X0138Y0000R000S3
317GND U2 -30_4 D0098PA00X+066947Y-007715X0138Y0000R000S3
317GND U2 -30_5 D0098PA00X+067439Y-007715X0138Y0000R000S3
317GND U2 -30_6 D0098PA00X+066701Y-007961X0138Y0000R000S3
317GND U2 -30_7 D0098PA00X+067193Y-007961X0138Y0000R000S3
317GND U2 -30_8 D0098PA00X+066455Y-008207X0138Y0000R000S3
317GND U2 -30_9 D0098PA00X+066947Y-008207X0138Y0000R000S3
317GND U2 -30_1 D0098PA00X+067439Y-008207X0138Y0000R000S3
317GND U2 -30_1 D0098PA00X+066701Y-008453X0138Y0000R000S3
317GND U2 -30_1 D0098PA00X+067193Y-008453X0138Y0000R000S3
3173_3V U5 -1 D0394PA00X+046339Y-019764X0669Y0669R000S0
317(U5-VBAT-PAD2) U5 -2 D0394PA00X+046339Y-020764X0669Y0000R000S0
317SDA U5 -3 D0394PA00X+046339Y-021764X0669Y0000R000S0
317SCL U5 -4 D0394PA00X+046339Y-022764X0669Y0000R000S0
317CD_PROBE U5 -5 D0394PA00X+046339Y-023764X0669Y0000R000S0
317GND U5 -6 D0394PA00X+046339Y-024764X0669Y0000R000S0
317GND U5 -7 D0197PA00X+062835Y-021063X0335Y0335R000S0
317GND U5 -8 D0197PA00X+078583Y-019488X0335Y0335R000S0
317GND U5 -9 D0197PA00X+078583Y-034646X0335Y0335R000S0
317GND U5 -10 D0197PA00X+062835Y-031693X0335Y0335R000S0
317GND U5 -11 D0197PA00X+046102Y-034646X0335Y0335R000S0
327GND D11 -1 A01X+046506Y-030000X0581Y0236R180S2
327VBAT D11 -2 A01X+046506Y-029252X0581Y0236R180S2
327NET-(D10-K) D11 -3 A01X+045768Y-029626X0581Y0236R180S2
@ -197,9 +206,9 @@ P arrayDim N
327GND R16 -2 A01X+048091Y-016043X0315Y0374R180S2
327NET-(Q2-G) R22 -1 A01X+047805Y-034843X0315Y0374R000S2
327GND R22 -2 A01X+048455Y-034843X0315Y0374R000S2
327FLOW D5 -3 A01X+047288Y-023228X0581Y0236R180S2
3273_3V D5 -2 A01X+048027Y-022854X0581Y0236R180S2
327GND D5 -1 A01X+048027Y-023602X0581Y0236R180S2
3273_3V D5 -2 A01X+048027Y-022854X0581Y0236R180S2
327FLOW D5 -3 A01X+047288Y-023228X0581Y0236R180S2
327NET-(D2-K) D2 -1 A01X+043701Y-006570X0384Y0551R270S2
327WARN_LED D2 -2 A01X+043701Y-005832X0384Y0551R270S2
327GND D6 -1 A01X+046043Y-016811X0581Y0236R180S2
@ -207,25 +216,25 @@ P arrayDim N
327TANK_SENSOR D6 -3 A01X+045305Y-016437X0581Y0236R180S2
327NET-(CD1-A) R9 -1 A01X+058661Y-010305X0315Y0374R090S2
327WORKING R9 -2 A01X+058661Y-010955X0315Y0374R090S2
317GND J6 -1 D0394PA00X+041319Y-014661X0669Y0669R180S0
3173_3V J6 -2 D0394PA00X+041319Y-013661X0669Y0000R180S0
317SDA J6 -3 D0394PA00X+041319Y-012661X0669Y0000R180S0
317SCL J6 -4 D0394PA00X+041319Y-011661X0669Y0000R180S0
317SQW J6 -5 D0394PA00X+041319Y-010661X0669Y0000R180S0
31732K J6 -6 D0394PA00X+041319Y-009661X0669Y0000R180S0
317GND J6 -1 D0394PA00X+051921Y-008228X0669Y0669R090S0
3173_3V J6 -2 D0394PA00X+050921Y-008228X0669Y0000R090S0
317SDA J6 -3 D0394PA00X+049921Y-008228X0669Y0000R090S0
317SCL J6 -4 D0394PA00X+048921Y-008228X0669Y0000R090S0
317SQW J6 -5 D0394PA00X+047921Y-008228X0669Y0000R090S0
31732K J6 -6 D0394PA00X+046921Y-008228X0669Y0000R090S0
327NET-(D8-K) D8 -1 A01X+040945Y-033243X0384Y0551R270S2
327NET-(D8-A) D8 -2 A01X+040945Y-032505X0384Y0551R270S2
327NET-(J2-PIN_2) R2 -1 A01X+046457Y-005581X0315Y0374R090S2
327GND R2 -2 A01X+046457Y-006230X0315Y0374R090S2
327USB_D+ U1 -1 A01X+050251Y-009286X0522Y0236R180S2
327GND U1 -2 A01X+050251Y-008912X0522Y0236R180S2
327USB_D- U1 -3 A01X+050251Y-008538X0522Y0236R180S2
327SLASH}O2-PAD4) U1 -4 A01X+049355Y-008538X0522Y0236R180S2
327USB_BUS U1 -5 A01X+049355Y-008912X0522Y0236R180S2
327SLASH}O1-PAD6) U1 -6 A01X+049355Y-009286X0522Y0236R180S2
327TEMP D7 -3 A01X+047288Y-025295X0581Y0236R180S2
3273_3V D7 -2 A01X+048027Y-024921X0581Y0236R180S2
327NET-(J2-PIN_2) R2 -1 A01X+042943Y-014764X0315Y0374R000S2
327GND R2 -2 A01X+043593Y-014764X0315Y0374R000S2
327USB_D+ U1 -1 A01X+044124Y-010945X0522Y0236R180S2
327GND U1 -2 A01X+044124Y-010571X0522Y0236R180S2
327USB_D- U1 -3 A01X+044124Y-010197X0522Y0236R180S2
327SLASH}O2-PAD4) U1 -4 A01X+043228Y-010197X0522Y0236R180S2
327USB_BUS U1 -5 A01X+043228Y-010571X0522Y0236R180S2
327SLASH}O1-PAD6) U1 -6 A01X+043228Y-010945X0522Y0236R180S2
327GND D7 -1 A01X+048027Y-025669X0581Y0236R180S2
3273_3V D7 -2 A01X+048027Y-024921X0581Y0236R180S2
327TEMP D7 -3 A01X+047288Y-025295X0581Y0236R180S2
327VBAT C8 -1 A01X+042534Y-036024X0463Y0571R180S2
327GND C8 -2 A01X+041718Y-036024X0463Y0571R180S2
327NET-(R3-PAD1) R3 -1 A01X+057677Y-012933X0315Y0374R090S2
@ -261,10 +270,59 @@ P arrayDim N
327BOOT_SEL C5 -2 A01X+062992Y-009700X0423Y0374R270S2
327TANK_SENSOR R12 -1 A01X+047215Y-016831X0404Y0551R270S2
3273_3V R12 -2 A01X+047215Y-016112X0404Y0551R270S2
327NET-(D2-K) R1 -1 A01X+045935Y-007874X0315Y0374R000S2
327GND R1 -2 A01X+046585Y-007874X0315Y0374R000S2
327NET-(D2-K) R1 -1 A01X+044488Y-008317X0315Y0374R270S2
327GND R1 -2 A01X+044488Y-007667X0315Y0374R270S2
327EXTRA_1 R20 -1 A01X+048455Y-031890X0315Y0374R180S2
327NET-(Q3-G) R20 -2 A01X+047805Y-031890X0315Y0374R180S2
327GND U2 -1 A01X+064094Y-005709X0591Y0354R000S2
3273_3V U2 -2 A01X+064094Y-006209X0591Y0354R000S2
327EN U2 -3 A01X+064094Y-006709X0591Y0354R000S2
327FLOW U2 -4 A01X+064094Y-007209X0591Y0354R000S2
327TANK_SENSOR U2 -5 A01X+064094Y-007709X0591Y0354R000S2
327EXTRA_1 U2 -6 A01X+064094Y-008209X0591Y0354R000S2
327ISDAY U2 -7 A01X+064094Y-008709X0591Y0354R000S2
327-(U2-IO0-PAD8) U2 -8 A01X+064094Y-009209X0591Y0354R000S2
327BOOT_SEL U2 -9 A01X+064094Y-009709X0591Y0354R000S2
327(U2-IO8-PAD10) U2 -10 A01X+064094Y-010209X0591Y0354R000S2
327LED_ENABLE U2 -11 A01X+064094Y-010709X0591Y0354R000S2
327ENABLE_TANK U2 -12 A01X+064094Y-011209X0591Y0354R000S2
327USB_D- U2 -13 A01X+064094Y-011709X0591Y0354R000S2
327USB_D+ U2 -14 A01X+064094Y-012209X0591Y0354R000S2
327BOOT_SEL U2 -15 A01X+070984Y-012209X0591Y0354R000S2
327TEMP U2 -16 A01X+070984Y-011709X0591Y0354R000S2
327SCL U2 -17 A01X+070984Y-011209X0591Y0354R000S2
327SDA U2 -18 A01X+070984Y-010709X0591Y0354R000S2
327WORKING U2 -19 A01X+070984Y-010209X0591Y0354R000S2
327CD_PROBE U2 -20 A01X+070984Y-009709X0591Y0354R000S2
327WARN_LED U2 -21 A01X+070984Y-009209X0591Y0354R000S2
327-(U2-NC-PAD22) U2 -22 A01X+070984Y-008709X0591Y0354R000S2
327EXTRA_2 U2 -23 A01X+070984Y-008209X0591Y0354R000S2
327ESP_RX U2 -24 A01X+070984Y-007709X0591Y0354R000S2
327ESP_TX U2 -25 A01X+070984Y-007209X0591Y0354R000S2
327CHARGE U2 -26 A01X+070984Y-006709X0591Y0354R000S2
327PUMP_ENABLE U2 -27 A01X+070984Y-006209X0591Y0354R000S2
327GND U2 -28 A01X+070984Y-005709X0591Y0354R000S2
327GND U2 -29_1 A01X+066455Y-007469X0315Y0315R000S2
327GND U2 -29_2 A01X+066947Y-007469X0315Y0315R000S2
327GND U2 -29_3 A01X+067439Y-007469X0315Y0315R000S2
327GND U2 -29_4 A01X+066455Y-007961X0315Y0315R000S2
327GND U2 -29_5 A01X+066947Y-007961X0315Y0315R000S2
327GND U2 -29_6 A01X+067439Y-007961X0315Y0315R000S2
327GND U2 -29_7 A01X+066455Y-008453X0315Y0315R000S2
327GND U2 -29_8 A01X+066947Y-008453X0315Y0315R000S2
327GND U2 -29_9 A01X+067439Y-008453X0315Y0315R000S2
317GND U2 -30_1 D0098PA00X+066701Y-007469X0138Y0000R000S3
317GND U2 -30_2 D0098PA00X+067193Y-007469X0138Y0000R000S3
317GND U2 -30_3 D0098PA00X+066455Y-007715X0138Y0000R000S3
317GND U2 -30_4 D0098PA00X+066947Y-007715X0138Y0000R000S3
317GND U2 -30_5 D0098PA00X+067439Y-007715X0138Y0000R000S3
317GND U2 -30_6 D0098PA00X+066701Y-007961X0138Y0000R000S3
317GND U2 -30_7 D0098PA00X+067193Y-007961X0138Y0000R000S3
317GND U2 -30_8 D0098PA00X+066455Y-008207X0138Y0000R000S3
317GND U2 -30_9 D0098PA00X+066947Y-008207X0138Y0000R000S3
317GND U2 -30_1 D0098PA00X+067439Y-008207X0138Y0000R000S3
317GND U2 -30_1 D0098PA00X+066701Y-008453X0138Y0000R000S3
317GND U2 -30_1 D0098PA00X+067193Y-008453X0138Y0000R000S3
317NET-(D10-K) Extra_-1 D0394PA00X+042283Y-029616X0669Y0787R270S0
317VBAT Extra_-2 D0394PA00X+042283Y-028632X0669Y0787R270S0
327GND D1 -1 A01X+047441Y-014469X0581Y0236R180S2
@ -276,8 +334,19 @@ P arrayDim N
327NET-(Q2-G) R23 -2 A01X+047805Y-035728X0315Y0374R180S2
327VBAT R18 -1 A01X+046033Y-028445X0315Y0374R000S2
327NET-(D10-A) R18 -2 A01X+046683Y-028445X0315Y0374R000S2
327NET-(J2-PIN_5) R4 -1 A01X+053150Y-005581X0315Y0374R090S2
327GND R4 -2 A01X+053150Y-006230X0315Y0374R090S2
3173_3V U5 -1 D0394PA00X+046339Y-019764X0669Y0669R000S0
317(U5-VBAT-PAD2) U5 -2 D0394PA00X+046339Y-020764X0669Y0000R000S0
317SDA U5 -3 D0394PA00X+046339Y-021764X0669Y0000R000S0
317SCL U5 -4 D0394PA00X+046339Y-022764X0669Y0000R000S0
317CD_PROBE U5 -5 D0394PA00X+046339Y-023764X0669Y0000R000S0
317GND U5 -6 D0394PA00X+046339Y-024764X0669Y0000R000S0
317GND U5 -7 D0394PA00X+062835Y-021063X0669Y0669R000S0
317GND U5 -8 D0394PA00X+078583Y-019488X0669Y0669R000S0
317GND U5 -9 D0394PA00X+078583Y-034646X0669Y0669R000S0
317GND U5 -10 D0394PA00X+062835Y-031693X0669Y0669R000S0
317GND U5 -11 D0394PA00X+046102Y-034646X0669Y0669R000S0
327NET-(J2-PIN_3) R4 -1 A01X+042943Y-014134X0315Y0374R000S2
327GND R4 -2 A01X+043593Y-014134X0315Y0374R000S2
327NET-(D10-K) D10 -1 A01X+040945Y-029542X0384Y0551R270S2
327NET-(D10-A) D10 -2 A01X+040945Y-028804X0384Y0551R270S2
317NET-(J4-PIN_1) J4 -1 D0295PA00X+042323Y-017638X0472Y0689R270S0
@ -297,12 +366,12 @@ P arrayDim N
327NET-(CD1-A) CD1 -2 A01X+045177Y-005832X0384Y0551R270S2
327GND C4 -1 A01X+060630Y-011166X0423Y0374R270S2
327NET-(C4-PAD2) C4 -2 A01X+060630Y-010487X0423Y0374R270S2
317USB_BUS J2 -1 D0295PA00X+047835Y-006142X0472Y0689R000S0
317NET-(J2-PIN_2) J2 -2 D0295PA00X+048622Y-006142X0472Y0689R000S0
317USB_D+ J2 -3 D0295PA00X+049409Y-006142X0472Y0689R000S0
317USB_D- J2 -4 D0295PA00X+050197Y-006142X0472Y0689R000S0
317NET-(J2-PIN_5) J2 -5 D0295PA00X+050984Y-006142X0472Y0689R000S0
317GND J2 -6 D0295PA00X+051772Y-006142X0472Y0689R000S0
317USB_BUS J2 -1 D0295PA00X+041260Y-009803X0472Y0689R090S0
317NET-(J2-PIN_2) J2 -2 D0295PA00X+041260Y-010591X0472Y0689R090S0
317NET-(J2-PIN_3) J2 -3 D0295PA00X+041260Y-011378X0472Y0689R090S0
317USB_D- J2 -4 D0295PA00X+041260Y-012165X0472Y0689R090S0
317USB_D+ J2 -5 D0295PA00X+041260Y-012953X0472Y0689R090S0
317GND J2 -6 D0295PA00X+041260Y-013740X0472Y0689R090S0
3273_3V R15 -1 A01X+049680Y-023228X0315Y0374R180S2
327FLOW R15 -2 A01X+049031Y-023228X0315Y0374R180S2
327NET-(Q1-G) Q1 -1 A01X+048770Y-016831X0354Y0315R090S2
@ -313,9 +382,9 @@ P arrayDim N
327NET-(Q2-G) Q2 -1 A01X+047776Y-034142X0354Y0315R270S2
327GND Q2 -2 A01X+048524Y-034142X0354Y0315R270S2
327NET-(D8-K) Q2 -3 A01X+048150Y-033354X0354Y0315R270S2
317VBAT U7 -1 D0433PA00X+042795Y-040315X0750Y0787R180S0
317GND U7 -2 D0433PA00X+041795Y-040315X0750Y0787R180S0
3173_3V U7 -3 D0433PA00X+040795Y-040315X0750Y0787R180S0
317VBAT U7 -1 D0433PA00X+042795Y-037835X0750Y0787R180S0
317GND U7 -2 D0433PA00X+041795Y-037835X0750Y0787R180S0
3173_3V U7 -3 D0433PA00X+040795Y-037835X0750Y0787R180S0
317GND J1 -1 D0394PA00X+044882Y-012047X0669Y0669R000S0
317SCL J1 -2 D0394PA00X+044882Y-013047X0669Y0000R000S0
317SDA J1 -3 D0394PA00X+044882Y-014047X0669Y0000R000S0

View File

@ -5,8 +5,8 @@ target = "riscv32imac-esp-espidf"
[target.riscv32imac-esp-espidf]
linker = "ldproxy"
#runner = "espflash flash --monitor --baud 921600 --partition-table partitions.csv -b no-reset" # Select this runner in case of usb ttl
runner = "espflash flash --monitor --baud 921600 --flash-size 16mb --partition-table partitions.csv"
#runner = "cargo runner"
#runner = "espflash flash --monitor"
runner = "cargo runner"
#runner = "espflash flash --monitor --partition-table partitions.csv -b no-reset" # create upgrade image file for webupload

View File

@ -1,7 +1,14 @@
<component name="ProjectDictionaryState">
<dictionary name="project">
<words>
<w>buildtime</w>
<w>deepsleep</w>
<w>githash</w>
<w>lightstate</w>
<w>mppt</w>
<w>plantstate</w>
<w>sntp</w>
<w>vergen</w>
</words>
</dictionary>
</component>

View File

@ -38,13 +38,13 @@ command = [
partition_table = "partitions.csv"
[features]
default = ["std", "embassy", "esp-idf-svc/native"]
default = ["std", "esp-idf-svc/native"]
pio = ["esp-idf-svc/pio"]
std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"]
alloc = ["esp-idf-svc/alloc"]
nightly = ["esp-idf-svc/nightly"]
experimental = ["esp-idf-svc/experimental"]
embassy = ["esp-idf-svc/embassy-sync", "esp-idf-svc/critical-section", "esp-idf-svc/embassy-time-driver"]
#embassy = ["esp-idf-svc/embassy-sync", "esp-idf-svc/critical-section", "esp-idf-svc/embassy-time-driver"]
[dependencies]
#ESP stuff

View File

@ -22,6 +22,22 @@ fn main() {
println!("stdout: {}", String::from_utf8_lossy(&output.stdout));
println!("stderr: {}", String::from_utf8_lossy(&output.stderr));
assert!(output.status.success());
// move webpack results to rust webserver src
let _ = Command::new("cmd")
.arg("/K")
.arg("move")
.arg("./src_webpack/bundle.js")
.arg("./src/webserver")
.output()
.unwrap();
let _ = Command::new("cmd")
.arg("/K")
.arg("move")
.arg("./src_webpack/index.html")
.arg("./src/webserver")
.output()
.unwrap();
}
Err(_) => {
println!("Assuming build on linux");
@ -34,6 +50,18 @@ fn main() {
println!("stdout: {}", String::from_utf8_lossy(&output.stdout));
println!("stderr: {}", String::from_utf8_lossy(&output.stderr));
assert!(output.status.success());
// move webpack results to rust webserver src
let _ = Command::new("mv")
.arg("./src_webpack/bundle.js")
.arg("./src/webserver")
.output()
.unwrap();
let _ = Command::new("mv")
.arg("./src_webpack/index.html")
.arg("./src/webserver")
.output()
.unwrap();
}
}

6
rust/espflash.toml Normal file
View File

@ -0,0 +1,6 @@
partition_table="partitions.csv"
[connection]
serial = "/dev/ttyACM0"
baudrate = 921600
[flash]
size = "16MB"

View File

@ -1,6 +1,6 @@
nvs, data, nvs, , 16k,
otadata, data, ota, , 8k,
phy_init, data, phy, , 4k,
ota_0, app, ota_0, , 5632k,
ota_1, app, ota_1, , 5632k,
storage, data, spiffs, , 5000k,
ota_0, app, ota_0, , 3968k,
ota_1, app, ota_0, , 3968k,
storage, data, spiffs, , 8M,

1 nvs data nvs 16k
2 otadata data ota 8k
3 phy_init data phy 4k
4 ota_0 app ota_0 5632k 3968k
5 ota_1 app ota_1 ota_0 5632k 3968k
6 storage data spiffs 5000k 8M

View File

@ -1,4 +1,3 @@
use crate::to_string;
use anyhow::anyhow;
use bq34z100::{Bq34Z100Error, Bq34z100g1, Bq34z100g1Driver};
use embedded_hal_bus::i2c::MutexDevice;
@ -98,6 +97,7 @@ impl BatteryInteraction for NoBatteryMonitor {
}
//TODO implement this battery monitor kind once controller is complete
#[allow(dead_code)]
pub struct WchI2cSlave {}
pub struct BQ34Z100G1<'a> {

View File

@ -63,14 +63,14 @@ pub struct MqttClient<'a> {
mqtt_client: EspMqttClient<'a>,
base_topic: heapless::String<64>,
}
pub struct ESP<'a> {
pub struct Esp<'a> {
pub(crate) mqtt_client: Option<MqttClient<'a>>,
pub(crate) wifi_driver: EspWifi<'a>,
pub(crate) boot_button: PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, esp_idf_hal::gpio::Input>,
pub(crate) delay: Delay,
}
impl ESP<'_> {
impl Esp<'_> {
const SPIFFS_PARTITION_NAME: &'static str = "storage";
const CONFIG_FILE: &'static str = "/spiffs/config.cfg";
const BASE_PATH: &'static str = "/spiffs";
@ -310,7 +310,7 @@ impl ESP<'_> {
filename: file.file_name().into_string().unwrap(),
size: file
.metadata()
.and_then(|it| Ok(it.len()))
.map(|it| it.len())
.unwrap_or_default()
as usize,
};

View File

@ -1,16 +1,19 @@
use crate::config::{BoardHardware, PlantControllerConfig};
use crate::hal::battery::{BatteryInteraction, NoBatteryMonitor};
use crate::hal::esp::ESP;
use crate::hal::esp::Esp;
use crate::hal::{deep_sleep, BackupHeader, BoardInteraction, FreePeripherals, Sensor};
use crate::{
config::PlantControllerConfig,
hal::battery::{BatteryInteraction, NoBatteryMonitor},
};
use anyhow::{bail, Result};
use chrono::{DateTime, Utc};
use embedded_hal::digital::OutputPin;
use esp_idf_hal::gpio::{IOPin, Pull};
use esp_idf_hal::gpio::{InputOutput, PinDriver};
use measurements::{Current, Voltage};
pub struct Initial<'a> {
pub(crate) general_fault: PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, InputOutput>,
pub(crate) esp: ESP<'a>,
pub(crate) esp: Esp<'a>,
pub(crate) config: PlantControllerConfig,
pub(crate) battery: Box<dyn BatteryInteraction + Send>,
}
@ -19,7 +22,7 @@ pub(crate) fn create_initial_board(
free_pins: FreePeripherals,
fs_mount_error: bool,
config: PlantControllerConfig,
esp: ESP<'static>,
esp: Esp<'static>,
) -> Result<Box<dyn BoardInteraction<'static> + Send>> {
let mut general_fault = PinDriver::input_output(free_pins.gpio6.downgrade())?;
general_fault.set_pull(Pull::Floating)?;
@ -38,7 +41,7 @@ pub(crate) fn create_initial_board(
}
impl<'a> BoardInteraction<'a> for Initial<'a> {
fn get_esp(&mut self) -> &mut ESP<'a> {
fn get_esp(&mut self) -> &mut Esp<'a> {
&mut self.esp
}
@ -50,7 +53,7 @@ impl<'a> BoardInteraction<'a> for Initial<'a> {
&mut self.battery
}
fn set_charge_indicator(&mut self, charging: bool) -> Result<()> {
fn set_charge_indicator(&mut self, _charging: bool) -> Result<()> {
bail!("Please configure board revision")
}
@ -66,7 +69,7 @@ impl<'a> BoardInteraction<'a> for Initial<'a> {
bail!("Please configure board revision")
}
fn backup_config(&mut self, bytes: &[u8]) -> Result<()> {
fn backup_config(&mut self, _bytes: &[u8]) -> Result<()> {
bail!("Please configure board revision")
}
@ -81,17 +84,17 @@ impl<'a> BoardInteraction<'a> for Initial<'a> {
fn tank_sensor_voltage(&mut self) -> Result<f32> {
bail!("Please configure board revision")
}
fn light(&mut self, enable: bool) -> Result<()> {
fn light(&mut self, _enable: bool) -> Result<()> {
bail!("Please configure board revision")
}
fn pump(&mut self, plant: usize, enable: bool) -> Result<()> {
fn pump(&mut self, _plant: usize, _enable: bool) -> Result<()> {
bail!("Please configure board revision")
}
fn fault(&mut self, plant: usize, _enable: bool) -> Result<()> {
fn fault(&mut self, _plant: usize, _enable: bool) -> Result<()> {
bail!("Please configure board revision")
}
fn measure_moisture_hz(&mut self, plant: usize, sensor: Sensor) -> Result<f32> {
fn measure_moisture_hz(&mut self, _plant: usize, _sensor: Sensor) -> Result<f32> {
bail!("Please configure board revision")
}
@ -107,10 +110,10 @@ impl<'a> BoardInteraction<'a> for Initial<'a> {
bail!("Please configure board revision")
}
fn set_rtc_time(&mut self, time: &DateTime<Utc>) -> Result<()> {
fn set_rtc_time(&mut self, _time: &DateTime<Utc>) -> Result<()> {
bail!("Please configure board revision")
}
fn test_pump(&mut self, plant: usize) -> Result<()> {
fn test_pump(&mut self, _plant: usize) -> Result<()> {
bail!("Please configure board revision")
}
@ -123,4 +126,12 @@ impl<'a> BoardInteraction<'a> for Initial<'a> {
self.esp.save_config(&self.config)?;
anyhow::Ok(())
}
fn get_mptt_voltage(&mut self) -> Result<Voltage> {
bail!("Please configure board revision")
}
fn get_mptt_current(&mut self) -> Result<Current> {
bail!("Please configure board revision")
}
}

View File

@ -4,54 +4,46 @@ mod initial_hal;
mod v3_hal;
mod v4_hal;
use crate::{
config::{BatteryBoardVersion, BoardVersion, PlantControllerConfig},
hal::{
battery::{print_battery_bq34z100, BatteryInteraction, NoBatteryMonitor},
esp::Esp,
},
log::{log, LogMessage},
};
use anyhow::{Ok, Result};
use battery::BQ34Z100G1;
use bq34z100::Bq34z100g1Driver;
use crate::log::LogMessage;
use ds323x::DateTimeAccess;
use esp_ota::mark_app_valid;
use eeprom24x::Eeprom24xTrait;
use chrono::{DateTime, Utc};
use embedded_hal_bus::i2c::MutexDevice;
use esp_idf_hal::adc::ADC1;
use esp_idf_hal::i2c::{APBTickType, I2cConfig, I2cDriver};
use esp_idf_hal::units::FromValueType;
use esp_idf_svc::eventloop::EspSystemEventLoop;
use esp_idf_svc::nvs::EspDefaultNvsPartition;
use esp_idf_svc::wifi::EspWifi;
use esp_idf_sys::esp_restart;
use esp_idf_hal::{
adc::ADC1,
delay::Delay,
gpio::{
Gpio0, Gpio1, Gpio10, Gpio11, Gpio12, Gpio13, Gpio14, Gpio15, Gpio16, Gpio17, Gpio18,
Gpio2, Gpio21, Gpio22, Gpio23, Gpio24, Gpio25, Gpio26, Gpio27, Gpio28, Gpio29, Gpio3,
Gpio30, Gpio4, Gpio5, Gpio6, Gpio7, Gpio8, IOPin, PinDriver, Pull,
},
i2c::{APBTickType, I2cConfig, I2cDriver},
pcnt::PCNT0,
prelude::Peripherals,
reset::ResetReason,
units::FromValueType,
};
use esp_idf_svc::{eventloop::EspSystemEventLoop, nvs::EspDefaultNvsPartition, wifi::EspWifi};
use esp_idf_sys::{
esp_deep_sleep, esp_sleep_enable_ext1_wakeup,
esp_deep_sleep, esp_restart, esp_sleep_enable_ext1_wakeup,
esp_sleep_ext1_wakeup_mode_t_ESP_EXT1_WAKEUP_ANY_LOW,
};
use esp_ota::mark_app_valid;
use measurements::{Current, Voltage};
use once_cell::sync::Lazy;
use anyhow::{Ok, Result};
use serde::{Deserialize, Serialize};
use chrono::{DateTime, Utc};
use std::result::Result::Ok as OkStd;
use std::sync::Mutex;
use std::time::Duration;
use crate::config::{BatteryBoardVersion, BoardVersion, PlantControllerConfig};
use crate::hal::battery::{print_battery_bq34z100, BatteryInteraction, NoBatteryMonitor};
use crate::hal::esp::ESP;
use crate::hal::initial_hal::Initial;
use crate::log::log;
use embedded_hal::digital::OutputPin;
use esp_idf_hal::delay::Delay;
use esp_idf_hal::gpio::{
Gpio0, Gpio1, Gpio10, Gpio11, Gpio12, Gpio13, Gpio14, Gpio15, Gpio16, Gpio17, Gpio18, Gpio2,
Gpio21, Gpio22, Gpio23, Gpio24, Gpio25, Gpio26, Gpio27, Gpio28, Gpio29, Gpio3, Gpio30, Gpio4,
Gpio5, Gpio6, Gpio7, Gpio8, IOPin, PinDriver, Pull,
};
use esp_idf_hal::pcnt::PCNT0;
use esp_idf_hal::prelude::Peripherals;
use esp_idf_hal::reset::ResetReason;
use pca9535::StandardExpanderInterface;
//Only support for 8 right now!
pub const PLANT_COUNT: usize = 8;
const REPEAT_MOIST_MEASURE: usize = 1;
@ -60,11 +52,6 @@ const TANK_MULTI_SAMPLE: usize = 11;
pub static I2C_DRIVER: Lazy<Mutex<I2cDriver<'static>>> = Lazy::new(PlantHal::create_i2c);
#[non_exhaustive]
struct V3Constants;
impl V3Constants {}
const X25: crc::Crc<u16> = crc::Crc::<u16>::new(&crc::CRC_16_IBM_SDLC);
fn deep_sleep(duration_in_ms: u64) -> ! {
@ -97,25 +84,15 @@ pub struct HAL<'a> {
pub board_hal: Box<dyn BoardInteraction<'a> + Send>,
}
#[derive(Serialize, Deserialize, PartialEq, Debug)]
#[derive(Serialize, Deserialize, PartialEq, Debug, Default)]
pub struct BackupHeader {
pub timestamp: i64,
crc16: u16,
pub size: usize,
}
impl Default for BackupHeader {
fn default() -> Self {
Self {
timestamp: Default::default(),
crc16: Default::default(),
size: Default::default(),
}
}
}
pub trait BoardInteraction<'a> {
fn get_esp(&mut self) -> &mut ESP<'a>;
fn get_esp(&mut self) -> &mut Esp<'a>;
fn get_config(&mut self) -> &PlantControllerConfig;
fn get_battery_monitor(&mut self) -> &mut Box<dyn BatteryInteraction + Send>;
fn set_charge_indicator(&mut self, charging: bool) -> Result<()>;
@ -139,8 +116,11 @@ pub trait BoardInteraction<'a> {
fn test_pump(&mut self, plant: usize) -> Result<()>;
fn test(&mut self) -> Result<()>;
fn set_config(&mut self, config: PlantControllerConfig) -> Result<()>;
fn get_mptt_voltage(&mut self) -> anyhow::Result<Voltage>;
fn get_mptt_current(&mut self) -> anyhow::Result<Current>;
}
#[allow(dead_code)]
pub struct FreePeripherals {
pub gpio0: Gpio0,
pub gpio1: Gpio1,
@ -235,7 +215,7 @@ impl PlantHal {
gpio30: peripherals.pins.gpio30,
};
let mut esp = ESP {
let mut esp = Esp {
mqtt_client: None,
wifi_driver,
boot_button,

View File

@ -1,11 +1,12 @@
use crate::config::PlantControllerConfig;
use crate::hal::battery::BatteryInteraction;
use crate::hal::esp::ESP;
use crate::hal::{
deep_sleep, BackupHeader, BoardInteraction, FreePeripherals, Sensor, V3Constants, I2C_DRIVER,
PLANT_COUNT, REPEAT_MOIST_MEASURE, TANK_MULTI_SAMPLE, X25,
deep_sleep, BackupHeader, BoardInteraction, FreePeripherals, Sensor, I2C_DRIVER, PLANT_COUNT,
REPEAT_MOIST_MEASURE, TANK_MULTI_SAMPLE, X25,
};
use crate::log::{log, LogMessage};
use crate::{
config::PlantControllerConfig,
hal::{battery::BatteryInteraction, esp::Esp},
};
use anyhow::{anyhow, bail, Ok, Result};
use chrono::{DateTime, Utc};
use ds18b20::Ds18b20;
@ -13,20 +14,22 @@ use ds323x::{DateTimeAccess, Ds323x};
use eeprom24x::{Eeprom24x, Eeprom24xTrait, SlaveAddr};
use embedded_hal::digital::OutputPin;
use embedded_hal_bus::i2c::MutexDevice;
use esp_idf_hal::adc::oneshot::config::AdcChannelConfig;
use esp_idf_hal::adc::oneshot::{AdcChannelDriver, AdcDriver};
use esp_idf_hal::adc::{attenuation, Resolution};
use esp_idf_hal::delay::Delay;
use esp_idf_hal::gpio::{AnyInputPin, Gpio5, IOPin, InputOutput, PinDriver, Pull};
use esp_idf_hal::i2c::I2cDriver;
use esp_idf_hal::pcnt::{
PcntChannel, PcntChannelConfig, PcntControlMode, PcntCountMode, PcntDriver, PinIndex,
use esp_idf_hal::{
adc::{
attenuation,
oneshot::{config::AdcChannelConfig, AdcChannelDriver, AdcDriver},
Resolution,
},
delay::Delay,
gpio::{AnyInputPin, Gpio5, IOPin, InputOutput, PinDriver, Pull},
i2c::I2cDriver,
pcnt::{PcntChannel, PcntChannelConfig, PcntControlMode, PcntCountMode, PcntDriver, PinIndex},
};
use esp_idf_sys::{gpio_hold_dis, gpio_hold_en, vTaskDelay, EspError};
use measurements::{Current, Voltage};
use one_wire_bus::OneWire;
use plant_ctrl2::sipo::ShiftRegister40;
use std::result::Result::Ok as OkStd;
use std::sync::Arc;
const PUMP8_BIT: usize = 0;
const PUMP1_BIT: usize = 1;
@ -76,13 +79,13 @@ const FAULT_2: usize = 23;
pub struct V3<'a> {
config: PlantControllerConfig,
battery_monitor: Box<dyn BatteryInteraction + Send>,
esp: ESP<'a>,
esp: Esp<'a>,
shift_register: ShiftRegister40<
PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, InputOutput>,
PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, InputOutput>,
PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, InputOutput>,
>,
shift_register_enable_invert:
_shift_register_enable_invert:
PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, esp_idf_hal::gpio::Output>,
tank_channel: AdcChannelDriver<'a, Gpio5, AdcDriver<'a, esp_idf_hal::adc::ADC1>>,
solar_is_day: PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, esp_idf_hal::gpio::Input>,
@ -104,10 +107,10 @@ pub struct V3<'a> {
pub(crate) fn create_v3(
peripherals: FreePeripherals,
esp: ESP<'static>,
esp: Esp<'static>,
config: PlantControllerConfig,
battery_monitor: Box<dyn BatteryInteraction + Send>,
) -> Result<Box<dyn BoardInteraction + Send + '_>> {
) -> Result<Box<dyn BoardInteraction<'static> + Send>> {
let mut clock = PinDriver::input_output(peripherals.gpio15.downgrade())?;
clock.set_pull(Pull::Floating)?;
let mut latch = PinDriver::input_output(peripherals.gpio3.downgrade())?;
@ -232,7 +235,7 @@ pub(crate) fn create_v3(
battery_monitor,
esp,
shift_register,
shift_register_enable_invert,
_shift_register_enable_invert: shift_register_enable_invert,
tank_channel,
solar_is_day,
light,
@ -247,7 +250,27 @@ pub(crate) fn create_v3(
}
impl<'a> BoardInteraction<'a> for V3<'a> {
fn get_esp(&mut self) -> &mut ESP<'a> {
fn set_charge_indicator(&mut self, charging: bool) -> Result<()> {
Ok(self.shift_register.decompose()[CHARGING].set_state(charging.into())?)
}
fn is_day(&self) -> bool {
self.solar_is_day.get_level().into()
}
fn get_mptt_voltage(&mut self) -> Result<Voltage> {
//if working this is the hardware set mppt voltage
if self.is_day() {
Ok(Voltage::from_volts(15_f64))
} else {
Ok(Voltage::from_volts(0_f64))
}
}
fn get_mptt_current(&mut self) -> Result<Current> {
bail!("Board does not have current sensor")
}
fn get_esp(&mut self) -> &mut Esp<'a> {
&mut self.esp
}
@ -259,10 +282,6 @@ impl<'a> BoardInteraction<'a> for V3<'a> {
&mut self.battery_monitor
}
fn set_charge_indicator(&mut self, charging: bool) -> Result<()> {
Ok(self.shift_register.decompose()[CHARGING].set_state(charging.into())?)
}
fn deep_sleep(&mut self, duration_in_ms: u64) -> ! {
let _ = self.shift_register.decompose()[AWAKE].set_low();
deep_sleep(duration_in_ms)
@ -364,10 +383,6 @@ impl<'a> BoardInteraction<'a> for V3<'a> {
Ok(())
}
fn is_day(&self) -> bool {
self.solar_is_day.get_level().into()
}
fn water_temperature_c(&mut self) -> Result<f32> {
self.one_wire_bus
.reset(&mut self.esp.delay)

View File

@ -1,6 +1,6 @@
use crate::config::PlantControllerConfig;
use crate::hal::battery::BatteryInteraction;
use crate::hal::esp::ESP;
use crate::hal::esp::Esp;
use crate::hal::{
deep_sleep, BackupHeader, BoardInteraction, FreePeripherals, Sensor, I2C_DRIVER, PLANT_COUNT,
REPEAT_MOIST_MEASURE, TANK_MULTI_SAMPLE, X25,
@ -22,10 +22,12 @@ use esp_idf_hal::i2c::I2cDriver;
use esp_idf_hal::pcnt::{
PcntChannel, PcntChannelConfig, PcntControlMode, PcntCountMode, PcntDriver, PinIndex,
};
use esp_idf_sys::{gpio_hold_dis, gpio_hold_en, vTaskDelay, EspError};
use ina219::address::Address;
use ina219::calibration::{Calibration, UnCalibrated};
use esp_idf_sys::{gpio_hold_dis, gpio_hold_en, EspError};
use ina219::address::{Address, Pin};
use ina219::calibration::UnCalibrated;
use ina219::configuration::{Configuration, OperatingMode};
use ina219::SyncIna219;
use measurements::{Current, Resistance, Voltage};
use one_wire_bus::OneWire;
use pca9535::{GPIOBank, Pca9535Immediate, StandardExpanderInterface};
use std::result::Result::Ok as OkStd;
@ -37,15 +39,82 @@ const MS3: u8 = 4_u8;
const MS4: u8 = 2_u8;
const SENSOR_ON: u8 = 5_u8;
pub struct V4<'a> {
pub enum Charger<'a> {
SolarMpptV1 {
mppt_ina: SyncIna219<MutexDevice<'a, I2cDriver<'a>>, UnCalibrated>,
esp: ESP<'a>,
solar_is_day: PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, esp_idf_hal::gpio::Input>,
charge_indicator: PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, InputOutput>,
},
}
impl Charger<'_> {
pub(crate) fn power_save(&mut self) {
match self {
Charger::SolarMpptV1 { mppt_ina, .. } => {
let _ = mppt_ina
.set_configuration(Configuration {
reset: Default::default(),
bus_voltage_range: Default::default(),
shunt_voltage_range: Default::default(),
bus_resolution: Default::default(),
shunt_resolution: Default::default(),
operating_mode: OperatingMode::PowerDown,
})
.map_err(|e| {
println!(
"Error setting ina mppt configuration during deep sleep preparation{:?}",
e
);
});
}
}
}
fn set_charge_indicator(&mut self, charging: bool) -> anyhow::Result<()> {
match self {
Self::SolarMpptV1 {
charge_indicator, ..
} => {
charge_indicator.set_state(charging.into())?;
}
}
Ok(())
}
fn is_day(&self) -> bool {
match self {
Charger::SolarMpptV1 { solar_is_day, .. } => solar_is_day.get_level().into(),
}
}
fn get_mptt_voltage(&mut self) -> anyhow::Result<Voltage> {
let voltage = match self {
Charger::SolarMpptV1 { mppt_ina, .. } => mppt_ina
.bus_voltage()
.map(|v| Voltage::from_millivolts(v.voltage_mv() as f64))?,
};
Ok(voltage)
}
fn get_mptt_current(&mut self) -> anyhow::Result<Current> {
let current = match self {
Charger::SolarMpptV1 { mppt_ina, .. } => mppt_ina.shunt_voltage().map(|v| {
let shunt_voltage = Voltage::from_microvolts(v.shunt_voltage_uv().abs() as f64);
let shut_value = Resistance::from_ohms(0.05_f64);
let current = shunt_voltage.as_volts() / shut_value.as_ohms();
Current::from_amperes(current)
})?,
};
Ok(current)
}
}
pub struct V4<'a> {
esp: Esp<'a>,
charger: Charger<'a>,
battery_monitor: Box<dyn BatteryInteraction + Send>,
config: PlantControllerConfig,
tank_channel: AdcChannelDriver<'a, Gpio5, AdcDriver<'a, esp_idf_hal::adc::ADC1>>,
solar_is_day: PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, esp_idf_hal::gpio::Input>,
signal_counter: PcntDriver<'a>,
charge_indicator: PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, InputOutput>,
awake: PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, Output>,
light: PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, InputOutput>,
tank_power: PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, InputOutput>,
@ -65,14 +134,14 @@ pub struct V4<'a> {
pub(crate) fn create_v4(
peripherals: FreePeripherals,
esp: ESP<'static>,
esp: Esp<'static>,
config: PlantControllerConfig,
battery_monitor: Box<dyn BatteryInteraction + Send>,
) -> anyhow::Result<Box<dyn BoardInteraction + Send + '_>> {
let mut awake = PinDriver::output(peripherals.gpio15.downgrade())?;
) -> anyhow::Result<Box<dyn BoardInteraction<'static> + Send + 'static>> {
let mut awake = PinDriver::output(peripherals.gpio21.downgrade())?;
awake.set_high()?;
let mut general_fault = PinDriver::input_output(peripherals.gpio6.downgrade())?;
let mut general_fault = PinDriver::input_output(peripherals.gpio23.downgrade())?;
general_fault.set_pull(Pull::Floating)?;
general_fault.set_low()?;
@ -87,6 +156,12 @@ pub(crate) fn create_v4(
)
};
let mut extra1 = PinDriver::output(peripherals.gpio6.downgrade())?;
extra1.set_high()?;
let mut extra2 = PinDriver::output(peripherals.gpio15.downgrade())?;
extra1.set_high()?;
let mut one_wire_pin = PinDriver::input_output_od(peripherals.gpio18.downgrade())?;
one_wire_pin.set_pull(Pull::Floating)?;
@ -173,7 +248,21 @@ pub(crate) fn create_v4(
let _ = sensor_expander.pin_set_low(GPIOBank::Bank1, pin);
}
let mut mppt_ina = SyncIna219::new(MutexDevice::new(&I2C_DRIVER), Address::from_byte(68)?)?;
//TODO error handling is not done nicely here, should not break if ina is not responsive
let mut mppt_ina = SyncIna219::new(
MutexDevice::new(&I2C_DRIVER),
Address::from_pins(Pin::Vcc, Pin::Gnd),
)?;
mppt_ina.set_configuration(Configuration {
reset: Default::default(),
bus_voltage_range: Default::default(),
shunt_voltage_range: Default::default(),
bus_resolution: Default::default(),
shunt_resolution: ina219::configuration::Resolution::Avg128,
operating_mode: Default::default(),
})?;
//TODO this is probably already done until we are ready first time?, maybe add startup time comparison on access?
esp.delay.delay_ms(
mppt_ina
.configuration()?
@ -181,18 +270,17 @@ pub(crate) fn create_v4(
.unwrap()
.as_millis() as u32,
);
println!("Bus Voltage: {}", mppt_ina.bus_voltage()?);
println!("Shunt Voltage: {}", mppt_ina.shunt_voltage()?);
let volt = (mppt_ina.shunt_voltage()?.shunt_voltage_mv()) as f32 / 1000_f32;
let current = volt / 0.05;
println!("Shunt Current: {}", current);
let charger = Charger::SolarMpptV1 {
mppt_ina,
solar_is_day,
charge_indicator,
};
let v = V4 {
mppt_ina,
esp,
awake,
tank_channel,
solar_is_day,
signal_counter,
light,
tank_power,
@ -202,15 +290,15 @@ pub(crate) fn create_v4(
general_fault,
pump_expander,
sensor_expander,
charge_indicator,
config,
battery_monitor,
charger,
};
Ok(Box::new(v))
}
impl<'a> BoardInteraction<'a> for V4<'a> {
fn get_esp(&mut self) -> &mut ESP<'a> {
fn get_esp(&mut self) -> &mut Esp<'a> {
&mut self.esp
}
@ -223,14 +311,12 @@ impl<'a> BoardInteraction<'a> for V4<'a> {
}
fn set_charge_indicator(&mut self, charging: bool) -> anyhow::Result<()> {
self.charge_indicator
.set_state(charging.into())
.expect("cannot fail");
Ok(())
self.charger.set_charge_indicator(charging)
}
fn deep_sleep(&mut self, duration_in_ms: u64) -> ! {
self.awake.set_low().unwrap();
self.charger.power_save();
deep_sleep(duration_in_ms);
}
@ -331,7 +417,7 @@ impl<'a> BoardInteraction<'a> for V4<'a> {
}
fn is_day(&self) -> bool {
self.solar_is_day.get_level().into()
self.charger.is_day()
}
fn water_temperature_c(&mut self) -> anyhow::Result<f32> {
@ -568,4 +654,12 @@ impl<'a> BoardInteraction<'a> for V4<'a> {
self.esp.save_config(&self.config)?;
anyhow::Ok(())
}
fn get_mptt_voltage(&mut self) -> anyhow::Result<Voltage> {
self.charger.get_mptt_voltage()
}
fn get_mptt_current(&mut self) -> anyhow::Result<Current> {
self.charger.get_mptt_current()
}
}

View File

@ -65,7 +65,7 @@ pub fn get_log() -> Vec<LogEntry> {
read_copy.push(copy);
}
drop(buffer);
return read_copy;
read_copy
}
pub fn log(message_key: LogMessage, number_a: u32, number_b: u32, txt_short: &str, txt_long: &str) {

View File

@ -1,43 +1,39 @@
use crate::webserver::webserver::httpd;
use crate::{
config::BoardVersion::INITIAL,
hal::{PlantHal, HAL, PLANT_COUNT},
webserver::httpd,
};
use anyhow::bail;
use chrono::{DateTime, Datelike, Timelike, Utc};
use chrono_tz::Tz;
use chrono_tz::Tz::UTC;
use chrono_tz::Tz::{self, UTC};
use esp_idf_hal::delay::Delay;
use esp_idf_sys::{
esp_ota_get_app_partition_count, esp_ota_get_running_partition, esp_ota_get_state_partition,
esp_ota_img_states_t, esp_ota_img_states_t_ESP_OTA_IMG_ABORTED,
esp_ota_img_states_t_ESP_OTA_IMG_INVALID, esp_ota_img_states_t_ESP_OTA_IMG_NEW,
esp_ota_img_states_t_ESP_OTA_IMG_PENDING_VERIFY, esp_ota_img_states_t_ESP_OTA_IMG_UNDEFINED,
esp_ota_img_states_t_ESP_OTA_IMG_VALID, vTaskDelay,
esp_ota_img_states_t_ESP_OTA_IMG_VALID,
};
use esp_ota::{mark_app_valid, rollback_and_reboot};
use hal::battery::BatteryState;
use log::{log, LogMessage};
use once_cell::sync::Lazy;
use plant_state::PlantState;
use serde::{Deserialize, Serialize};
use std::sync::MutexGuard;
use std::{
fmt::Display,
sync::{atomic::AtomicBool, Arc, Mutex},
};
use std::sync::{atomic::AtomicBool, Arc, Mutex, MutexGuard};
use tank::*;
mod config;
mod hal;
mod log;
mod plant_state;
mod tank;
mod webserver;
use crate::config::BoardVersion::INITIAL;
use crate::hal::battery::BatteryInteraction;
use crate::hal::{BoardInteraction, PlantHal, HAL, PLANT_COUNT};
use plant_state::PlantState;
use tank::*;
pub static BOARD_ACCESS: Lazy<Mutex<HAL>> = Lazy::new(|| PlantHal::create().unwrap());
pub static STAY_ALIVE: Lazy<AtomicBool> = Lazy::new(|| AtomicBool::new(false));
mod webserver {
pub mod webserver;
}
#[derive(Serialize, Deserialize, Debug, PartialEq)]
enum WaitType {
@ -72,7 +68,7 @@ struct LightState {
}
#[derive(Serialize, Deserialize, Debug, PartialEq, Default)]
///mqtt stuct to track pump activities
///mqtt struct to track pump activities
struct PumpInfo {
enabled: bool,
pump_ineffective: bool,
@ -178,16 +174,7 @@ fn safe_main() -> anyhow::Result<()> {
}
println!("cur is {}", cur);
match board
.board_hal
.get_battery_monitor()
.average_current_milli_ampere()
{
Ok(charging) => {
let _ = board.board_hal.set_charge_indicator(charging > 20);
}
Err(_) => {}
}
update_charge_indicator(&mut board);
if board.board_hal.get_esp().get_restart_to_conf() {
log(LogMessage::ConfigModeSoftwareOverride, 0, 0, "", "");
@ -268,7 +255,7 @@ fn safe_main() -> anyhow::Result<()> {
address,
ota_state_string,
&mut board,
&ip_address,
ip_address,
timezone_time,
);
publish_battery_state(&mut board);
@ -424,12 +411,12 @@ fn safe_main() -> anyhow::Result<()> {
.state_charge_percent()
.unwrap_or(0.);
/// try to load full battery state if failed the battery state is unknown
// try to load full battery state if failed the battery state is unknown
let battery_state = board
.board_hal
.get_battery_monitor()
.get_battery_state()
.unwrap_or(hal::battery::BatteryState::Unknown);
.unwrap_or(BatteryState::Unknown);
let mut light_state = LightState {
enabled: board.board_hal.get_config().night_lamp.enabled,
@ -559,6 +546,26 @@ fn safe_main() -> anyhow::Result<()> {
.deep_sleep(1000 * 1000 * 60 * deep_sleep_duration_minutes as u64);
}
fn update_charge_indicator(board: &mut MutexGuard<HAL>) {
//we have mppt controller, ask it for charging current
if let Ok(current) = board.board_hal.get_mptt_current() {
let _ = board
.board_hal
.set_charge_indicator(current.as_milliamperes() > 20_f64);
}
//fallback to battery controller and ask it instead
else if let Ok(charging) = board
.board_hal
.get_battery_monitor()
.average_current_milli_ampere()
{
let _ = board.board_hal.set_charge_indicator(charging > 20);
} else {
//who knows
let _ = board.board_hal.set_charge_indicator(false);
}
}
fn obtain_tank_temperature(board: &mut MutexGuard<HAL>) -> anyhow::Result<f32> {
//multisample should be moved to water_temperature_c
let mut attempt = 1;
@ -611,7 +618,7 @@ fn publish_plant_states(
.zip(&board.board_hal.get_config().plants.clone())
.enumerate()
{
match serde_json::to_string(&plant_state.to_mqtt_info(plant_conf, &timezone_time)) {
match serde_json::to_string(&plant_state.to_mqtt_info(plant_conf, timezone_time)) {
Ok(state) => {
let plant_topic = format!("/plant{}", plant_id + 1);
let _ = board
@ -682,7 +689,7 @@ fn try_connect_wifi_sntp_mqtt(board: &mut MutexGuard<HAL>) -> NetworkMode {
SntpMode::OFFLINE
}
};
let mqtt_connected = if let Some(_) = board.board_hal.get_config().network.mqtt_url {
let mqtt_connected = if board.board_hal.get_config().network.mqtt_url.is_some() {
let nw_config = &board.board_hal.get_config().network.clone();
match board.board_hal.get_esp().mqtt(nw_config) {
Ok(_) => {
@ -739,7 +746,8 @@ fn pump_info(
fn publish_battery_state(board: &mut MutexGuard<'_, HAL<'_>>) {
let state = board.board_hal.get_battery_monitor().get_battery_state();
if let Ok(serialized_battery_state_bytes) = serde_json::to_string(&state).map(|s| s.into_bytes())
if let Ok(serialized_battery_state_bytes) =
serde_json::to_string(&state).map(|s| s.into_bytes())
{
let _ = board
.board_hal
@ -752,17 +760,11 @@ fn wait_infinity(wait_type: WaitType, reboot_now: Arc<AtomicBool>) -> ! {
let delay = wait_type.blink_pattern();
let mut led_count = 8;
let mut pattern_step = 0;
let delay_handle = Delay::new_default();
loop {
unsafe {
let mut board = BOARD_ACCESS.lock().unwrap();
if let Ok(charging) = board
.board_hal
.get_battery_monitor()
.average_current_milli_ampere()
{
let _ = board.board_hal.set_charge_indicator(charging > 20);
}
update_charge_indicator(&mut board);
match wait_type {
WaitType::MissingConfig => {
// Keep existing behavior: circular filling pattern
@ -790,7 +792,8 @@ fn wait_infinity(wait_type: WaitType, reboot_now: Arc<AtomicBool>) -> ! {
board.board_hal.general_fault(true);
drop(board);
vTaskDelay(delay);
//cannot use shared delay as that is inside the mutex here
delay_handle.delay_ms(delay);
let mut board = BOARD_ACCESS.lock().unwrap();
board.board_hal.general_fault(false);
@ -799,7 +802,7 @@ fn wait_infinity(wait_type: WaitType, reboot_now: Arc<AtomicBool>) -> ! {
let _ = board.board_hal.fault(i, false);
}
drop(board);
vTaskDelay(delay);
delay_handle.delay_ms(delay);
if wait_type == WaitType::MqttConfig
&& !STAY_ALIVE.load(std::sync::atomic::Ordering::Relaxed)
@ -813,12 +816,11 @@ fn wait_infinity(wait_type: WaitType, reboot_now: Arc<AtomicBool>) -> ! {
}
}
}
}
fn main() {
let result = safe_main();
match result {
// this should not get triggered, safe_main should not return but go into deep sleep with sensbile
// this should not get triggered, safe_main should not return but go into deep sleep with sensible
// timeout, this is just a fallback
Ok(_) => {
println!("Main app finished, restarting");
@ -839,23 +841,14 @@ fn main() {
}
}
fn to_string<T: Display>(value: anyhow::Result<T>) -> String {
match value {
Ok(v) => v.to_string(),
Err(err) => {
format!("{:?}", err)
}
}
}
pub fn in_time_range(cur: &DateTime<Tz>, start: u8, end: u8) -> bool {
let curhour = cur.hour() as u8;
let current_hour = cur.hour() as u8;
//eg 10-14
if start < end {
curhour > start && curhour < end
current_hour > start && current_hour < end
} else {
//eg 20-05
curhour > start || curhour < end
current_hour > start || current_hour < end
}
}

View File

@ -1,10 +1,12 @@
use crate::{
config::PlantConfig,
hal::{Sensor, HAL},
in_time_range,
};
use chrono::{DateTime, TimeDelta, Utc};
use chrono_tz::Tz;
use serde::{Deserialize, Serialize};
use crate::hal::{BoardInteraction, Sensor, HAL};
use crate::{config::PlantConfig, in_time_range};
const MOIST_SENSOR_MAX_FREQUENCY: f32 = 7500.; // 60kHz (500Hz margin)
const MOIST_SENSOR_MIN_FREQUENCY: f32 = 150.; // this is really, really dry, think like cactus levels
@ -237,7 +239,11 @@ impl PlantState {
}
}
pub fn to_mqtt_info(&self, plant_conf: &PlantConfig, current_time: &DateTime<Tz>) -> PlantInfo {
pub fn to_mqtt_info(
&self,
plant_conf: &PlantConfig,
current_time: &DateTime<Tz>,
) -> PlantInfo<'_> {
PlantInfo {
sensor_a: &self.sensor_a,
sensor_b: &self.sensor_b,

View File

@ -100,7 +100,7 @@ macro_rules! ShiftRegisterBuilder {
}
/// Get embedded-hal output pins to control the shift register outputs
pub fn decompose(&self) -> [ShiftRegisterPin; $size] {
pub fn decompose(&self) -> [ShiftRegisterPin<'_>; $size] {
// Create an uninitialized array of `MaybeUninit`. The `assume_init` is
// safe because the type we are claiming to have initialized here is a
// bunch of `MaybeUninit`s, which do not require initialization.

View File

@ -1,8 +1,6 @@
use crate::{config::TankConfig, hal::HAL};
use serde::Serialize;
use crate::config::TankConfig;
use crate::hal::{BoardInteraction, HAL};
const OPEN_TANK_VOLTAGE: f32 = 3.0;
pub const WATER_FROZEN_THRESH: f32 = 4.0;

View File

@ -1,8 +1,12 @@
//offer ota and config mode
use crate::hal::battery::BatteryInteraction;
use crate::{
determine_tank_state, get_version, log::LogMessage, plant_state::PlantState, BOARD_ACCESS,
config::PlantControllerConfig,
determine_tank_state, get_version,
hal::PLANT_COUNT,
log::LogMessage,
plant_state::{MoistureSensorState, PlantState},
BOARD_ACCESS,
};
use anyhow::bail;
use chrono::DateTime;
@ -19,10 +23,6 @@ use std::{
};
use url::Url;
use crate::config::PlantControllerConfig;
use crate::hal::{BoardInteraction, PLANT_COUNT};
use crate::plant_state::MoistureSensorState;
#[derive(Serialize, Debug)]
struct SSIDList<'a> {
ssids: Vec<&'a String<32>>,
@ -40,6 +40,13 @@ struct Moistures {
moisture_b: Vec<std::string::String>,
}
#[derive(Serialize, Debug)]
struct SolarState {
mppt_voltage: f32,
mppt_current: f32,
is_day: bool,
}
#[derive(Deserialize, Debug)]
struct SetTime<'a> {
time: &'a str,
@ -214,10 +221,22 @@ fn set_config(
let config: PlantControllerConfig = serde_json::from_slice(&all)?;
let mut board = BOARD_ACCESS.lock().expect("board access");
board.board_hal.set_config(config);
board.board_hal.set_config(config)?;
anyhow::Ok(Some("saved".to_owned()))
}
fn get_solar_state(
_request: &mut Request<&mut EspHttpConnection>,
) -> Result<Option<std::string::String>, anyhow::Error> {
let mut board = BOARD_ACCESS.lock().expect("board access");
let state = SolarState {
mppt_voltage: board.board_hal.get_mptt_voltage()?.as_volts() as f32,
mppt_current: board.board_hal.get_mptt_current()?.as_amperes() as f32,
is_day: board.board_hal.is_day(),
};
anyhow::Ok(Some(serde_json::to_string(&state)?))
}
fn get_battery_state(
_request: &mut Request<&mut EspHttpConnection>,
) -> Result<Option<std::string::String>, anyhow::Error> {
@ -322,6 +341,7 @@ fn ota(
let iter = (total_read / 1024) % 8;
if iter != lastiter {
board.board_hal.general_fault(iter%5==0);
for i in 0..PLANT_COUNT {
let _ = board.board_hal.fault(i, iter == i);
}
@ -383,6 +403,11 @@ pub fn httpd(reboot_now: Arc<AtomicBool>) -> Box<EspHttpServer<'static>> {
handle_error_to500(request, get_battery_state)
})
.unwrap();
server
.fn_handler("/solar", Method::Get, |request| {
handle_error_to500(request, get_solar_state)
})
.unwrap();
server
.fn_handler("/time", Method::Get, |request| {
handle_error_to500(request, get_time)

View File

@ -38,6 +38,12 @@ export interface FileList {
iter_error: string,
}
export interface SolarState{
mppt_voltage: number,
mppt_current: number,
is_day: boolean
}
export interface FileInfo{
filename: string,
size: number,

View File

@ -13,7 +13,7 @@
<select class="boardvalue" id="hardware_board_value">
</select>
</div>
<div class="flexcontainer" style="text-decoration-line: line-through;">
<div class="flexcontainer">
<div class="boardkey">BatteryMonitor</div>
<select class="boardvalue" id="hardware_battery_value">
</select>

View File

@ -149,6 +149,8 @@
</div>
<div id="batteryview" class="subcontainer">
</div>
<div id="solarview" class="subcontainer">
</div>
</div>
<div class="flexcontainer">

View File

@ -28,8 +28,9 @@ import {
SetTime, SSIDList, TankInfo,
TestPump,
VersionInfo,
FileList
FileList, SolarState
} from "./api";
import {SolarView} from "./solarview";
export class Controller {
loadTankInfo() : Promise<void> {
@ -160,7 +161,7 @@ export class Controller {
console.log(error);
});
}
updateBatteryData(): Promise<void> {
updateBatteryData() {
return fetch(PUBLIC_URL + "/battery")
.then(response => response.json())
.then(json => json as BatteryState)
@ -172,6 +173,18 @@ export class Controller {
console.log(error);
})
}
updateSolarData() {
return fetch(PUBLIC_URL + "/solar")
.then(response => response.json())
.then(json => json as SolarState)
.then(solar => {
controller.solarView.update(solar)
})
.catch(error => {
controller.solarView.update(null)
console.log(error);
})
}
uploadNewFirmware(file: File) {
var current = 0;
var max = 100;
@ -244,6 +257,7 @@ export class Controller {
//load from remote to be clean
controller.downloadConfig()
}
backupConfig(json: string, statusCallback: (status: string) => void) {
controller.progressview.addIndeterminate("backup_config", "Backingup Config")
fetch(PUBLIC_URL + "/backup_config", {
@ -465,6 +479,7 @@ export class Controller {
readonly firmWareView: OTAView;
readonly progressview: ProgressView;
readonly batteryView: BatteryView;
readonly solarView: SolarView;
readonly fileview: FileView;
readonly logView: LogView
constructor() {
@ -473,6 +488,7 @@ export class Controller {
this.networkView = new NetworkConfigView(this, PUBLIC_URL)
this.tankView = new TankConfigView(this)
this.batteryView = new BatteryView(this)
this.solarView = new SolarView(this)
this.nightLampView = new NightLampView(this)
this.submitView = new SubmitView(this)
this.firmWareView = new OTAView(this)
@ -489,21 +505,16 @@ export class Controller {
controller.exit();
}
}
selftest() {
}
}
const controller = new Controller();
controller.progressview.removeProgress("rebooting");
const tasks = [
{ task: controller.populateTimezones, displayString: "Populating Timezones" },
{ task: controller.updateRTCData, displayString: "Updating RTC Data" },
{ task: controller.updateBatteryData, displayString: "Updating Battery Data" },
{ task: controller.updateSolarData, displayString: "Updating Solar Data" },
{ task: controller.downloadConfig, displayString: "Downloading Configuration" },
{ task: controller.version, displayString: "Fetching Version Information" },
{ task: controller.updateFileList, displayString: "Updating File List" },

View File

@ -20,7 +20,7 @@
<div class="lightkey">Test Nightlight</div>
<input class="lightcheckbox" type="checkbox" id="night_lamp_test">
</div>
<div class="flexcontainer" style="text-decoration-line: line-through;">
<div class="flexcontainer">
<div class="lightkey">Enable Nightlight</div>
<input class="lightcheckbox" type="checkbox" id="night_lamp_enabled">
</div>

View File

@ -29,7 +29,7 @@ export class OTAView {
};
test.onclick = () => {
controller.selftest();
controller.selfTest();
}
}

View File

@ -0,0 +1,29 @@
<style>
.solarflexkey {
min-width: 150px;
}
.solarflexvalue {
text-wrap: nowrap;
flex-grow: 1;
}
</style>
<div class="flexcontainer">
<div class="subtitle">
Mppt:
</div>
<input id="solar_auto_refresh" type="checkbox">
</div>
<div class="flexcontainer">
<span class="solarflexkey">Mppt mV:</span>
<span class="solarflexvalue" id="solar_voltage_milli_volt"></span>
</div>
<div class="flexcontainer">
<span class="solarflexkey">Mppt mA:</span>
<span class="solarflexvalue" id="solar_current_milli_ampere" ></span>
</div>
<div class="flexcontainer">
<span class="solarflexkey">is Day:</span>
<span class="solarflexvalue" id="solar_is_day" ></span>
</div>

View File

@ -0,0 +1,49 @@
import { Controller } from "./main";
import {BatteryState, SolarState} from "./api";
export class SolarView{
solar_voltage_milli_volt: HTMLSpanElement;
solar_current_milli_ampere: HTMLSpanElement;
solar_is_day: HTMLSpanElement;
solar_auto_refresh: HTMLInputElement;
timer: NodeJS.Timeout | undefined;
controller: Controller;
constructor (controller:Controller) {
(document.getElementById("solarview") as HTMLElement).innerHTML = require("./solarview.html")
this.solar_voltage_milli_volt = document.getElementById("solar_voltage_milli_volt") as HTMLSpanElement;
this.solar_current_milli_ampere = document.getElementById("solar_current_milli_ampere") as HTMLSpanElement;
this.solar_is_day = document.getElementById("solar_is_day") as HTMLSpanElement;
this.solar_auto_refresh = document.getElementById("solar_auto_refresh") as HTMLInputElement;
this.controller = controller
this.solar_auto_refresh.onchange = () => {
if(this.timer){
clearTimeout(this.timer)
}
if(this.solar_auto_refresh.checked){
controller.updateSolarData()
}
}
}
update(solarState: SolarState|null){
if (solarState == null) {
this.solar_voltage_milli_volt.innerText = "N/A"
this.solar_current_milli_ampere.innerText = "N/A"
this.solar_is_day.innerText = "N/A"
} else {
this.solar_voltage_milli_volt.innerText = solarState.mppt_voltage.toFixed(2)
this.solar_current_milli_ampere.innerText = String(+solarState.mppt_current)
this.solar_is_day.innerText = solarState.is_day?"🌞":"🌙"
}
if(this.solar_auto_refresh.checked){
this.timer = setTimeout(this.controller.updateSolarData, 1000);
} else {
if(this.timer){
clearTimeout(this.timer)
}
}
}
}

View File

@ -7,14 +7,31 @@
word-wrap: break-word;
overflow: scroll;
}
.submitbutton{
padding: 1em 1em;
background: #667eea;
color: white;
border: none;
border-radius: 8px;
font-size: 1.1em;
font-weight: bold;
cursor: pointer;
transition: all 0.3s ease;
letter-spacing: 1px;
margin: 1em 0;
}
.submitbutton:hover {
background: #1c4e63;
}
</style>
<button class="submitbutton" id="submit">Submit</button>
<br>
<button id="showJson">Show Json</button>
<div id="rawdata" class="flexcontainer" style="display: none;">
<div class="submitarea" id="json" contenteditable="true"></div>
<div class="submitarea" id="backupjson">backup will be here</div>
</div>
<button id="submit">Submit</button>
<div>BackupStatus:</div>
<div id="backuptimestamp"></div>
<div id="backupsize"></div>

View File

@ -9,7 +9,7 @@ console.log("Dev server is " + isDevServer);
var host;
if (isDevServer){
//ensure no trailing /
host = 'http://192.168.71.1';
host = 'http://10.23.44.186';
} else {
host = '';
}
@ -49,7 +49,7 @@ module.exports = {
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, '../src/webserver'),
path: path.resolve(__dirname, '.'),
},
devServer: {
}