proceed with bq34z100 extraction
This commit is contained in:
parent
541f7e4471
commit
060a1cc32d
@ -11113,7 +11113,7 @@
|
||||
(property "ki_keywords" "HCMOS SR 3State")
|
||||
(path "/66a7ed92-e7d3-43dc-9320-c0d3557a8e25")
|
||||
(attr smd)
|
||||
(fp_text reference "U1" (at 0 5.9 90) (layer "B.SilkS")
|
||||
(fp_text reference "U1" (at 0 5.9 90) (layer "B.SilkS") hide
|
||||
(effects (font (size 1 1) (thickness 0.15)) (justify mirror))
|
||||
(tstamp aaafd671-664e-452e-9cb5-f767f0c5e818)
|
||||
)
|
||||
@ -14421,8 +14421,8 @@
|
||||
(property "ki_keywords" "R res resistor")
|
||||
(path "/00000000-0000-0000-0000-000060bfab84")
|
||||
(attr smd)
|
||||
(fp_text reference "R15" (at 0 -1.5) (layer "B.SilkS")
|
||||
(effects (font (size 1 1) (thickness 0.15)) (justify mirror))
|
||||
(fp_text reference "R15" (at -0.9 -1.2) (layer "B.SilkS")
|
||||
(effects (font (size 1 0.7) (thickness 0.125)) (justify mirror))
|
||||
(tstamp b8dca75e-7694-4664-a68f-a25b99c6e816)
|
||||
)
|
||||
(fp_text value "1k" (at 0 -1.43) (layer "B.Fab")
|
||||
@ -14821,6 +14821,61 @@
|
||||
)
|
||||
)
|
||||
|
||||
(footprint "Resistor_SMD:R_0603_1608Metric" (layer "B.Cu")
|
||||
(tstamp 47d606a6-b542-4eed-9691-d24fe13156a4)
|
||||
(at 175.48 81.095 90)
|
||||
(descr "Resistor SMD 0603 (1608 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: IPC-SM-782 page 72, https://www.pcb-3d.com/wordpress/wp-content/uploads/ipc-sm-782a_amendment_1_and_2.pdf), generated with kicad-footprint-generator")
|
||||
(tags "resistor")
|
||||
(property "LCSC_PART_NUMBER" "C212284")
|
||||
(property "Sheetfile" "PlantCtrlESP32.kicad_sch")
|
||||
(property "Sheetname" "")
|
||||
(property "ki_description" "Resistor")
|
||||
(property "ki_keywords" "R res resistor")
|
||||
(path "/b4ff286f-51e3-425f-8430-14c7e2113349")
|
||||
(attr smd)
|
||||
(fp_text reference "R46" (at 0 1.43 90) (layer "B.SilkS")
|
||||
(effects (font (size 1 1) (thickness 0.15)) (justify mirror))
|
||||
(tstamp 8940bf89-2e2e-4b1c-9b36-6e3e9e66912c)
|
||||
)
|
||||
(fp_text value "10k" (at 0 -1.43 90) (layer "B.Fab")
|
||||
(effects (font (size 1 1) (thickness 0.15)) (justify mirror))
|
||||
(tstamp ffcdfcc9-1614-40b8-b345-4feaa8f0d896)
|
||||
)
|
||||
(fp_text user "${REFERENCE}" (at 0 0 90) (layer "B.Fab")
|
||||
(effects (font (size 0.4 0.4) (thickness 0.06)) (justify mirror))
|
||||
(tstamp 630a0503-d861-48d9-8d6e-ae2cd61d9218)
|
||||
)
|
||||
(fp_line (start -0.237258 -0.5225) (end 0.237258 -0.5225)
|
||||
(stroke (width 0.12) (type solid)) (layer "B.SilkS") (tstamp f5b433c5-1c83-46d4-9424-a1e255a4eeb1))
|
||||
(fp_line (start -0.237258 0.5225) (end 0.237258 0.5225)
|
||||
(stroke (width 0.12) (type solid)) (layer "B.SilkS") (tstamp 202cf467-adf0-4dc7-8ed8-e4e83a204fc1))
|
||||
(fp_line (start -1.48 -0.73) (end -1.48 0.73)
|
||||
(stroke (width 0.05) (type solid)) (layer "B.CrtYd") (tstamp e325c82f-6158-42d3-b128-7b2b010dfa55))
|
||||
(fp_line (start -1.48 0.73) (end 1.48 0.73)
|
||||
(stroke (width 0.05) (type solid)) (layer "B.CrtYd") (tstamp cc07117c-e071-4ab4-a68d-497020924749))
|
||||
(fp_line (start 1.48 -0.73) (end -1.48 -0.73)
|
||||
(stroke (width 0.05) (type solid)) (layer "B.CrtYd") (tstamp 72b9a2cc-bab1-4aa2-bc65-f9b3a39810f5))
|
||||
(fp_line (start 1.48 0.73) (end 1.48 -0.73)
|
||||
(stroke (width 0.05) (type solid)) (layer "B.CrtYd") (tstamp 797d2bb1-8ee8-4f2c-88f8-5b0d2547f4c5))
|
||||
(fp_line (start -0.8 -0.4125) (end -0.8 0.4125)
|
||||
(stroke (width 0.1) (type solid)) (layer "B.Fab") (tstamp 601f924a-b1be-4291-94f6-d87569520e35))
|
||||
(fp_line (start -0.8 0.4125) (end 0.8 0.4125)
|
||||
(stroke (width 0.1) (type solid)) (layer "B.Fab") (tstamp 8a14dea6-3e84-4b2e-9e60-2ec889f353e8))
|
||||
(fp_line (start 0.8 -0.4125) (end -0.8 -0.4125)
|
||||
(stroke (width 0.1) (type solid)) (layer "B.Fab") (tstamp 50b07823-5420-4299-af85-b352a84e244b))
|
||||
(fp_line (start 0.8 0.4125) (end 0.8 -0.4125)
|
||||
(stroke (width 0.1) (type solid)) (layer "B.Fab") (tstamp 7f8d523d-763b-4fff-b4de-3acdfd47f9a7))
|
||||
(pad "1" smd roundrect (at -0.825 0 90) (size 0.8 0.95) (layers "B.Cu" "B.Paste" "B.Mask") (roundrect_rratio 0.25)
|
||||
(net 4 "GND") (pintype "passive") (tstamp f40837e4-35aa-4f5d-a250-5ddb00c287db))
|
||||
(pad "2" smd roundrect (at 0.825 0 90) (size 0.8 0.95) (layers "B.Cu" "B.Paste" "B.Mask") (roundrect_rratio 0.25)
|
||||
(net 82 "SerialIn") (pintype "passive") (tstamp b28e3237-9e25-4e58-8a12-9d59ecfad216))
|
||||
(model "${KICAD6_3DMODEL_DIR}/Resistor_SMD.3dshapes/R_0603_1608Metric.wrl"
|
||||
(offset (xyz 0 0 0))
|
||||
(scale (xyz 1 1 1))
|
||||
(rotate (xyz 0 0 0))
|
||||
)
|
||||
)
|
||||
|
||||
(footprint "Package_TO_SOT_SMD:SOT-23" (layer "B.Cu")
|
||||
(tstamp 481bba05-fb9d-4de3-aa52-66cb9c8f522d)
|
||||
(at 242.33 129.9825 -90)
|
||||
@ -22552,6 +22607,61 @@
|
||||
)
|
||||
)
|
||||
|
||||
(footprint "Resistor_SMD:R_0603_1608Metric" (layer "B.Cu")
|
||||
(tstamp ae19be9b-13ee-4672-9eb6-fbb7cd3787ba)
|
||||
(at 177.68 78.27)
|
||||
(descr "Resistor SMD 0603 (1608 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: IPC-SM-782 page 72, https://www.pcb-3d.com/wordpress/wp-content/uploads/ipc-sm-782a_amendment_1_and_2.pdf), generated with kicad-footprint-generator")
|
||||
(tags "resistor")
|
||||
(property "LCSC_PART_NUMBER" "C212284")
|
||||
(property "Sheetfile" "PlantCtrlESP32.kicad_sch")
|
||||
(property "Sheetname" "")
|
||||
(property "ki_description" "Resistor")
|
||||
(property "ki_keywords" "R res resistor")
|
||||
(path "/ee167434-7247-432a-8a61-3f2f465cfc2a")
|
||||
(attr smd)
|
||||
(fp_text reference "R48" (at -2.4 0.8 180) (layer "B.SilkS")
|
||||
(effects (font (size 1 0.7) (thickness 0.15)) (justify mirror))
|
||||
(tstamp 882a78fb-26f3-4c90-84d1-fde95b459b77)
|
||||
)
|
||||
(fp_text value "10k" (at 0 -1.43) (layer "B.Fab")
|
||||
(effects (font (size 1 1) (thickness 0.15)) (justify mirror))
|
||||
(tstamp 8b65b92d-4e0e-4246-8a01-c731512f8a26)
|
||||
)
|
||||
(fp_text user "${REFERENCE}" (at 0 0) (layer "B.Fab")
|
||||
(effects (font (size 0.4 0.4) (thickness 0.06)) (justify mirror))
|
||||
(tstamp 4d5539a5-1f58-4302-b78a-9b7b0e7596f4)
|
||||
)
|
||||
(fp_line (start -0.237258 -0.5225) (end 0.237258 -0.5225)
|
||||
(stroke (width 0.12) (type solid)) (layer "B.SilkS") (tstamp ea5d2922-2df8-45eb-a143-cccc4250fbda))
|
||||
(fp_line (start -0.237258 0.5225) (end 0.237258 0.5225)
|
||||
(stroke (width 0.12) (type solid)) (layer "B.SilkS") (tstamp 5f75bf84-fa2c-43ad-bbde-e6e4dafcddeb))
|
||||
(fp_line (start -1.48 -0.73) (end -1.48 0.73)
|
||||
(stroke (width 0.05) (type solid)) (layer "B.CrtYd") (tstamp 3d77616e-6deb-4999-9c1c-1ab64562db7e))
|
||||
(fp_line (start -1.48 0.73) (end 1.48 0.73)
|
||||
(stroke (width 0.05) (type solid)) (layer "B.CrtYd") (tstamp 90448eea-5b46-445a-a01e-1c6c70b5ccbe))
|
||||
(fp_line (start 1.48 -0.73) (end -1.48 -0.73)
|
||||
(stroke (width 0.05) (type solid)) (layer "B.CrtYd") (tstamp f2ebd7fe-d528-4cb4-bc65-d6bfd8941531))
|
||||
(fp_line (start 1.48 0.73) (end 1.48 -0.73)
|
||||
(stroke (width 0.05) (type solid)) (layer "B.CrtYd") (tstamp e89a0182-9707-4234-90b9-3b22aa2c8051))
|
||||
(fp_line (start -0.8 -0.4125) (end -0.8 0.4125)
|
||||
(stroke (width 0.1) (type solid)) (layer "B.Fab") (tstamp 9c7e54e4-3203-4afd-af41-ae6c51469d16))
|
||||
(fp_line (start -0.8 0.4125) (end 0.8 0.4125)
|
||||
(stroke (width 0.1) (type solid)) (layer "B.Fab") (tstamp 2d0eb338-7c07-46b0-9441-5227c5b60f76))
|
||||
(fp_line (start 0.8 -0.4125) (end -0.8 -0.4125)
|
||||
(stroke (width 0.1) (type solid)) (layer "B.Fab") (tstamp 49378f51-9db8-4146-bc6f-e6aa6181ee13))
|
||||
(fp_line (start 0.8 0.4125) (end 0.8 -0.4125)
|
||||
(stroke (width 0.1) (type solid)) (layer "B.Fab") (tstamp 4f543b8d-6ea2-419c-9b28-04b68a213f18))
|
||||
(pad "1" smd roundrect (at -0.825 0) (size 0.8 0.95) (layers "B.Cu" "B.Paste" "B.Mask") (roundrect_rratio 0.25)
|
||||
(net 4 "GND") (pintype "passive") (tstamp f44c437f-c486-414e-8121-8a2da34766a0))
|
||||
(pad "2" smd roundrect (at 0.825 0) (size 0.8 0.95) (layers "B.Cu" "B.Paste" "B.Mask") (roundrect_rratio 0.25)
|
||||
(net 28 "Latch") (pintype "passive") (tstamp d3b70f4f-26d1-4a8f-9bb3-2c2b35b67cad))
|
||||
(model "${KICAD6_3DMODEL_DIR}/Resistor_SMD.3dshapes/R_0603_1608Metric.wrl"
|
||||
(offset (xyz 0 0 0))
|
||||
(scale (xyz 1 1 1))
|
||||
(rotate (xyz 0 0 0))
|
||||
)
|
||||
)
|
||||
|
||||
(footprint "Package_TO_SOT_SMD:SOT-23" (layer "B.Cu")
|
||||
(tstamp ae66a751-eade-4a70-9441-f0672cba6e29)
|
||||
(at 221.58 95.17 -90)
|
||||
@ -23461,6 +23571,61 @@
|
||||
)
|
||||
)
|
||||
|
||||
(footprint "Resistor_SMD:R_0603_1608Metric" (layer "B.Cu")
|
||||
(tstamp b8f3f81e-a9af-47b3-b04f-39c6fa40c26f)
|
||||
(at 177.68 76.47)
|
||||
(descr "Resistor SMD 0603 (1608 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: IPC-SM-782 page 72, https://www.pcb-3d.com/wordpress/wp-content/uploads/ipc-sm-782a_amendment_1_and_2.pdf), generated with kicad-footprint-generator")
|
||||
(tags "resistor")
|
||||
(property "LCSC_PART_NUMBER" "C212284")
|
||||
(property "Sheetfile" "PlantCtrlESP32.kicad_sch")
|
||||
(property "Sheetname" "")
|
||||
(property "ki_description" "Resistor")
|
||||
(property "ki_keywords" "R res resistor")
|
||||
(path "/bb4afad3-b745-45d5-a7ce-b8763b1bdea0")
|
||||
(attr smd)
|
||||
(fp_text reference "R51" (at -1.1 -1.1) (layer "B.SilkS")
|
||||
(effects (font (size 1 1) (thickness 0.15)) (justify mirror))
|
||||
(tstamp 13332d5e-c617-4483-b4f0-c7e15f20aaa1)
|
||||
)
|
||||
(fp_text value "10k" (at 0 -1.43) (layer "B.Fab")
|
||||
(effects (font (size 1 1) (thickness 0.15)) (justify mirror))
|
||||
(tstamp b10fc1bd-be29-4b67-abc3-0f0d64d65a9a)
|
||||
)
|
||||
(fp_text user "${REFERENCE}" (at 0 0) (layer "B.Fab")
|
||||
(effects (font (size 0.4 0.4) (thickness 0.06)) (justify mirror))
|
||||
(tstamp 2d6f580f-76d6-481c-a8fc-0175a6b54367)
|
||||
)
|
||||
(fp_line (start -0.237258 -0.5225) (end 0.237258 -0.5225)
|
||||
(stroke (width 0.12) (type solid)) (layer "B.SilkS") (tstamp 4e5e566b-8ad5-4ec3-b975-f6b1f1888def))
|
||||
(fp_line (start -0.237258 0.5225) (end 0.237258 0.5225)
|
||||
(stroke (width 0.12) (type solid)) (layer "B.SilkS") (tstamp 657859c1-24e3-48af-8067-8906faa44c92))
|
||||
(fp_line (start -1.48 -0.73) (end -1.48 0.73)
|
||||
(stroke (width 0.05) (type solid)) (layer "B.CrtYd") (tstamp c817aaee-9e1c-4a3b-a82d-c4394309dbeb))
|
||||
(fp_line (start -1.48 0.73) (end 1.48 0.73)
|
||||
(stroke (width 0.05) (type solid)) (layer "B.CrtYd") (tstamp 5a896cec-48ab-441f-b619-170df73e1564))
|
||||
(fp_line (start 1.48 -0.73) (end -1.48 -0.73)
|
||||
(stroke (width 0.05) (type solid)) (layer "B.CrtYd") (tstamp 859402eb-e79e-41f7-b981-1b90ce949075))
|
||||
(fp_line (start 1.48 0.73) (end 1.48 -0.73)
|
||||
(stroke (width 0.05) (type solid)) (layer "B.CrtYd") (tstamp bce1041d-6388-41f5-82f2-0741acfe61d6))
|
||||
(fp_line (start -0.8 -0.4125) (end -0.8 0.4125)
|
||||
(stroke (width 0.1) (type solid)) (layer "B.Fab") (tstamp 1d49510e-55c1-4f67-9f79-25e5eece35ce))
|
||||
(fp_line (start -0.8 0.4125) (end 0.8 0.4125)
|
||||
(stroke (width 0.1) (type solid)) (layer "B.Fab") (tstamp 2d1b3292-c856-4f5c-84c0-9a3137f5d329))
|
||||
(fp_line (start 0.8 -0.4125) (end -0.8 -0.4125)
|
||||
(stroke (width 0.1) (type solid)) (layer "B.Fab") (tstamp c7d50401-c5ba-4169-b83b-0108ad23776a))
|
||||
(fp_line (start 0.8 0.4125) (end 0.8 -0.4125)
|
||||
(stroke (width 0.1) (type solid)) (layer "B.Fab") (tstamp bad48cbf-bf89-4b11-a7c0-37481914c36b))
|
||||
(pad "1" smd roundrect (at -0.825 0) (size 0.8 0.95) (layers "B.Cu" "B.Paste" "B.Mask") (roundrect_rratio 0.25)
|
||||
(net 4 "GND") (pintype "passive") (tstamp 2f25ffaf-400e-4221-a2fd-8a63e67d02cb))
|
||||
(pad "2" smd roundrect (at 0.825 0) (size 0.8 0.95) (layers "B.Cu" "B.Paste" "B.Mask") (roundrect_rratio 0.25)
|
||||
(net 27 "Clock") (pintype "passive") (tstamp 12adee31-ed2b-4b77-a099-e5899bb37440))
|
||||
(model "${KICAD6_3DMODEL_DIR}/Resistor_SMD.3dshapes/R_0603_1608Metric.wrl"
|
||||
(offset (xyz 0 0 0))
|
||||
(scale (xyz 1 1 1))
|
||||
(rotate (xyz 0 0 0))
|
||||
)
|
||||
)
|
||||
|
||||
(footprint "Resistor_SMD:R_0603_1608Metric" (layer "B.Cu")
|
||||
(tstamp ba4e6fc4-2749-4e12-b7ee-316c44ae524f)
|
||||
(at 242.33 119.17 180)
|
||||
@ -28898,6 +29063,7 @@
|
||||
(segment (start 210.83 115.2325) (end 211.8675 114.195) (width 0.2) (layer "B.Cu") (net 4) (tstamp 0da79d79-ff4f-4f81-bdc1-2474b5add81f))
|
||||
(segment (start 249.43 101.745) (end 248.985 101.745) (width 0.2) (layer "B.Cu") (net 4) (tstamp 0db36108-d612-4e21-a43d-a04d23fe312b))
|
||||
(segment (start 248.98 57.045) (end 247.73 57.045) (width 0.2) (layer "B.Cu") (net 4) (tstamp 0dcd1a2a-fe93-4af2-96f2-8f21f738ef6a))
|
||||
(segment (start 176.705 76.47) (end 173.605 73.37) (width 0.2) (layer "B.Cu") (net 4) (tstamp 0e4da3df-21c8-4428-b0e0-974f861cdc31))
|
||||
(segment (start 175.6425 100.62) (end 180.2425 100.62) (width 0.2) (layer "B.Cu") (net 4) (tstamp 0ee97dd0-b02b-46d5-9fed-de183d8add14))
|
||||
(segment (start 245.855 94.17) (end 246.58 93.445) (width 0.2) (layer "B.Cu") (net 4) (tstamp 0efc0c65-3dbe-4fae-94d6-bba0626b5dd4))
|
||||
(segment (start 248.735 122.745) (end 249.6795 121.8005) (width 0.2) (layer "B.Cu") (net 4) (tstamp 0f28bde6-faad-4175-a9c3-fc2f2e843ad9))
|
||||
@ -29452,6 +29618,7 @@
|
||||
(segment (start 243.83 80.892792) (end 243.83 65.645) (width 1) (layer "B.Cu") (net 4) (tstamp db6ed76a-3b45-4186-9c2d-6d9271a84a4c))
|
||||
(segment (start 231.655 113.995) (end 230.63 112.97) (width 0.2) (layer "B.Cu") (net 4) (tstamp db993f52-365f-4798-9eba-5c3009a77f81))
|
||||
(segment (start 251.8675 103.745) (end 255.155 103.745) (width 0.2) (layer "B.Cu") (net 4) (tstamp dc1ab6ee-acce-4fe4-ba99-5977483f0dc3))
|
||||
(segment (start 176.855 76.47) (end 176.855 78.27) (width 0.2) (layer "B.Cu") (net 4) (tstamp dc3cac55-c959-47b9-9ae3-7fab21b6b2d7))
|
||||
(segment (start 223.005 103.62) (end 221.73 103.62) (width 0.2) (layer "B.Cu") (net 4) (tstamp dc92f7e1-ac86-49ea-9123-a9178abdf35a))
|
||||
(segment (start 189.275 74.92) (end 191.775 72.42) (width 0.2) (layer "B.Cu") (net 4) (tstamp dcaf377a-4b07-4f38-b805-c095469376ba))
|
||||
(segment (start 261.455 119.87) (end 262.08 119.87) (width 0.5) (layer "B.Cu") (net 4) (tstamp dd03f112-5e18-4199-8111-85e2ac73cadd))
|
||||
@ -29530,6 +29697,7 @@
|
||||
(segment (start 231.985 79.92) (end 231.985 81.575) (width 0.2) (layer "B.Cu") (net 4) (tstamp fc0aa60a-1c83-44ff-9e30-ec236347dc46))
|
||||
(segment (start 245.13 51.22) (end 247.28 49.07) (width 0.2) (layer "B.Cu") (net 4) (tstamp fc79b0dd-b7aa-409c-9d7e-3ac9a9bac1ea))
|
||||
(segment (start 239.93 99.2825) (end 239.93 94.32) (width 0.2) (layer "B.Cu") (net 4) (tstamp fca5a196-7fae-47b3-a589-fbd4afd8d18f))
|
||||
(segment (start 176.855 76.47) (end 176.705 76.47) (width 0.2) (layer "B.Cu") (net 4) (tstamp fd157e30-0682-416c-a47f-c7bfcc509dce))
|
||||
(segment (start 220.255 114.92) (end 220.63 115.295) (width 0.2) (layer "B.Cu") (net 4) (tstamp fd6f6c67-a3af-40eb-b436-5ea1d2457efc))
|
||||
(segment (start 179.48 106.145) (end 180.63 104.995) (width 0.2) (layer "B.Cu") (net 4) (tstamp fd70e3ba-b9ba-4ff2-9481-ac05227e27cc))
|
||||
(segment (start 180.63 94.295) (end 180.38 94.545) (width 0.2) (layer "B.Cu") (net 4) (tstamp fd8b6866-f37d-4849-9569-c6b5e31a6057))
|
||||
@ -29742,7 +29910,6 @@
|
||||
(segment (start 180.805 42.845) (end 181.38 42.27) (width 0.2) (layer "B.Cu") (net 10) (tstamp 0162aa97-9415-4324-888b-5a40e22218ad))
|
||||
(segment (start 175.6425 98.72) (end 175.6425 96.9825) (width 0.2) (layer "B.Cu") (net 10) (tstamp 01a0dcdf-8683-486b-8d5c-c1412da6c5f1))
|
||||
(segment (start 257.58 45.47) (end 258.98 44.07) (width 0.2) (layer "B.Cu") (net 10) (tstamp 0315daee-ad93-471d-adcb-5a6912728148))
|
||||
(segment (start 177.055 73.87) (end 177.055 78.645) (width 0.2) (layer "B.Cu") (net 10) (tstamp 03f36878-df6e-4f8f-800a-30da66b5b845))
|
||||
(segment (start 205.58 55.295) (end 202.58 55.295) (width 0.2) (layer "B.Cu") (net 10) (tstamp 0429863c-dfd0-484e-b0a0-552a30382d62))
|
||||
(segment (start 220.58 119.356396) (end 220.58 117.37) (width 0.2) (layer "B.Cu") (net 10) (tstamp 06fef1e9-43af-4ea0-8b8d-904abbe17624))
|
||||
(segment (start 171.68 120.77) (end 171.58 120.67) (width 0.2) (layer "B.Cu") (net 10) (tstamp 07323ed0-7f67-4dc0-9869-f13335da8bcb))
|
||||
@ -29788,6 +29955,7 @@
|
||||
(segment (start 212.355 120.27) (end 212.78 120.695) (width 0.2) (layer "B.Cu") (net 10) (tstamp 3b0c11eb-00c6-4e50-9a17-b7b5718f8d80))
|
||||
(segment (start 250.78 98.07) (end 250.78 96.07) (width 0.2) (layer "B.Cu") (net 10) (tstamp 3c2c1322-73e7-469c-a552-b992f340bfec))
|
||||
(segment (start 260.3175 128.0825) (end 260.3175 126.6075) (width 0.5) (layer "B.Cu") (net 10) (tstamp 3c3eed0c-b782-46b5-a200-d2462e9a318c))
|
||||
(segment (start 177.055 73.87) (end 177.055 75.245) (width 0.2) (layer "B.Cu") (net 10) (tstamp 3cde8e6c-084f-4274-91d2-a573efd997d3))
|
||||
(segment (start 202.58 115.17) (end 202.33 115.42) (width 0.2) (layer "B.Cu") (net 10) (tstamp 3d5777e3-eff0-4d53-9193-5cb3db2d1d75))
|
||||
(segment (start 242.58 94.17) (end 242.58 100.0325) (width 0.2) (layer "B.Cu") (net 10) (tstamp 3daed90a-e2f0-4c10-9ff0-74b77c8818ce))
|
||||
(segment (start 231.33 119.92) (end 230.33 118.92) (width 0.2) (layer "B.Cu") (net 10) (tstamp 3f4903ff-bb38-4b85-93a7-d7b26a974610))
|
||||
@ -29818,6 +29986,7 @@
|
||||
(segment (start 232.53 100.17) (end 230.58 98.22) (width 0.2) (layer "B.Cu") (net 10) (tstamp 579d666c-16df-4ee8-8094-33c77621d47b))
|
||||
(segment (start 230.33 118.92) (end 230.33 117.42) (width 0.2) (layer "B.Cu") (net 10) (tstamp 57d33c77-aaf5-4764-827c-b166fe7b8882))
|
||||
(segment (start 221.118604 119.895) (end 220.58 119.356396) (width 0.2) (layer "B.Cu") (net 10) (tstamp 585f5d35-1af0-4462-8f78-189a98e33382))
|
||||
(segment (start 177.68 79.27) (end 180.33 81.92) (width 0.2) (layer "B.Cu") (net 10) (tstamp 5b8f0869-9b61-4292-8f41-5b52e01a79e2))
|
||||
(segment (start 251.305 109.395) (end 250.83 108.92) (width 0.2) (layer "B.Cu") (net 10) (tstamp 5cdf11c1-6877-4303-8938-53abe63cd641))
|
||||
(segment (start 265.58 117.25) (end 262.175 117.25) (width 0.5) (layer "B.Cu") (net 10) (tstamp 5e2d2eff-44d4-4884-80d0-e73e364780d3))
|
||||
(segment (start 232.53 115.2325) (end 232.53 121.12) (width 0.2) (layer "B.Cu") (net 10) (tstamp 5e884bb1-cb2d-4912-abdb-714ae01ba223))
|
||||
@ -29853,6 +30022,7 @@
|
||||
(segment (start 225.005001 82.07) (end 228.33 82.07) (width 0.2) (layer "B.Cu") (net 10) (tstamp 79a94bde-9daa-4fc3-9482-9375ac9f1a9c))
|
||||
(segment (start 222.214369 118.999235) (end 222.214369 120.535631) (width 0.2) (layer "B.Cu") (net 10) (tstamp 7bd1f3b3-d98e-4975-90ac-a00561c7c5e8))
|
||||
(segment (start 182.38 100.0825) (end 182.38 94.445) (width 0.2) (layer "B.Cu") (net 10) (tstamp 7c5db391-6bcb-4769-a943-6b39bc21e7d7))
|
||||
(segment (start 177.055 75.245) (end 177.68 75.87) (width 0.2) (layer "B.Cu") (net 10) (tstamp 83c17464-32d0-4b15-927b-3ce71baeebce))
|
||||
(segment (start 192.255 99.17) (end 191.143604 99.17) (width 0.2) (layer "B.Cu") (net 10) (tstamp 843913e5-d744-497e-80fd-e6358f1f37ab))
|
||||
(segment (start 240.58 98.17) (end 240.58 96.17) (width 0.2) (layer "B.Cu") (net 10) (tstamp 85b8b77f-9373-4a78-9202-ba464a70e5f8))
|
||||
(segment (start 195.9675 62.62) (end 195.9675 61.07) (width 1) (layer "B.Cu") (net 10) (tstamp 8617004e-79c3-4c93-a319-5d101d1cc659))
|
||||
@ -29896,6 +30066,7 @@
|
||||
(segment (start 181.105 109.495) (end 180.1805 108.5705) (width 0.2) (layer "B.Cu") (net 10) (tstamp b3348cb6-b34f-47a6-bf89-77eb969b9730))
|
||||
(segment (start 211.499239 98.92) (end 211.393604 98.92) (width 0.2) (layer "B.Cu") (net 10) (tstamp b4f6e4e0-6739-4002-be0e-e462f76dab40))
|
||||
(segment (start 180.33 81.92) (end 180.385 81.365) (width 0.2) (layer "B.Cu") (net 10) (tstamp b6394c72-ab63-451b-a6d8-311d9fa9b6d6))
|
||||
(segment (start 177.68 75.87) (end 177.68 79.27) (width 0.2) (layer "B.Cu") (net 10) (tstamp b69555f7-c5b2-4f39-8b73-88200c0069d6))
|
||||
(segment (start 222.53 110.42) (end 221.53 109.42) (width 0.2) (layer "B.Cu") (net 10) (tstamp b6d00cf6-09ed-494c-bd78-f22c7e366bb4))
|
||||
(segment (start 212.73 115.2325) (end 212.505 115.4575) (width 0.2) (layer "B.Cu") (net 10) (tstamp b8694d50-5139-4ab7-839d-df7b54b5fac3))
|
||||
(segment (start 255.925001 45.07) (end 257.18 45.07) (width 0.2) (layer "B.Cu") (net 10) (tstamp b9ea2691-7b23-442c-b7bf-21c8f2bd073b))
|
||||
@ -29935,7 +30106,6 @@
|
||||
(segment (start 212.505 120.895) (end 212.78 121.17) (width 0.2) (layer "B.Cu") (net 10) (tstamp e9bbbaee-cf1b-46b9-9429-d3d4659f7c71))
|
||||
(segment (start 260.3175 120.5825) (end 260.3175 119.1075) (width 0.5) (layer "B.Cu") (net 10) (tstamp ea3902ff-af19-44b9-bca9-6efea460f77e))
|
||||
(segment (start 257.58 46.5) (end 257.88 46.5) (width 0.2) (layer "B.Cu") (net 10) (tstamp ea515d4d-91cb-4ca2-b1e0-0645e56f563b))
|
||||
(segment (start 177.055 78.645) (end 180.33 81.92) (width 0.2) (layer "B.Cu") (net 10) (tstamp eb038917-0c65-41d4-a036-3738023fe791))
|
||||
(segment (start 221.08 109.42) (end 220.58 108.92) (width 0.2) (layer "B.Cu") (net 10) (tstamp eb2a7ac5-f9b6-4773-a4b0-aae4ebf6bbf7))
|
||||
(segment (start 221.53 109.42) (end 221.08 109.42) (width 0.2) (layer "B.Cu") (net 10) (tstamp eb54f7c2-7d09-4201-859c-da3c86a66a19))
|
||||
(segment (start 257.23 46.5) (end 257.58 46.5) (width 0.2) (layer "B.Cu") (net 10) (tstamp ebb1e33b-7e1a-45e9-81d4-fc83ff770bdd))
|
||||
@ -30243,6 +30413,7 @@
|
||||
(segment (start 258.210025 109.300025) (end 258.13 109.38005) (width 0.2) (layer "In2.Cu") (net 27) (tstamp c3caffaa-ef78-4415-844b-c7128b6cb371))
|
||||
(segment (start 258.13 109.22) (end 258.210025 109.300025) (width 0.2) (layer "In2.Cu") (net 27) (tstamp da598899-bb2b-4be8-b0ec-b41887aa9891))
|
||||
(segment (start 258.13 109.38005) (end 258.13 117.42) (width 0.2) (layer "In2.Cu") (net 27) (tstamp e7224add-e40e-4efc-964c-2ceb71874244))
|
||||
(segment (start 181.38 77.67) (end 180.18 76.47) (width 0.2) (layer "B.Cu") (net 27) (tstamp 066c33bb-afee-4264-a44e-9fe193004e92))
|
||||
(segment (start 222.585 79.553604) (end 221.251396 78.22) (width 0.2) (layer "B.Cu") (net 27) (tstamp 0f3c47c4-1c93-49fa-bc1f-d8d7b11b4f2d))
|
||||
(segment (start 186.735 78.025) (end 186.38 77.67) (width 0.2) (layer "B.Cu") (net 27) (tstamp 10ca370c-e6cc-4a76-bc39-1e962cdedf21))
|
||||
(segment (start 178.115 67.575) (end 178.115 66.205) (width 0.2) (layer "B.Cu") (net 27) (tstamp 11fb2acf-15c5-45ce-ac9d-c38cd3ed093d))
|
||||
@ -30264,6 +30435,7 @@
|
||||
(segment (start 198.605 79.553604) (end 197.271396 78.22) (width 0.2) (layer "B.Cu") (net 27) (tstamp e4b4348a-5296-4722-a0cc-ad7fadf7f9cc))
|
||||
(segment (start 209.141396 78.22) (end 199.53 78.22) (width 0.2) (layer "B.Cu") (net 27) (tstamp e66c26cc-3833-4da4-8792-a55fb15a9136))
|
||||
(segment (start 265.58 124.87) (end 264.03 126.42) (width 0.2) (layer "B.Cu") (net 27) (tstamp e71c9b50-c9ee-4d76-878c-f8ac19b1f7fa))
|
||||
(segment (start 180.18 76.47) (end 178.505 76.47) (width 0.2) (layer "B.Cu") (net 27) (tstamp f99d7cdb-73b1-4199-8486-e76d2f57a30d))
|
||||
(segment (start 174.28 68.97) (end 180.38 75.07) (width 0.2) (layer "F.Cu") (net 28) (tstamp 51803ded-0bb0-4499-a89f-ca01ca859a29))
|
||||
(segment (start 174.28 66.27) (end 174.28 68.97) (width 0.2) (layer "F.Cu") (net 28) (tstamp b6d026fe-466c-4db1-a022-f449f677b658))
|
||||
(segment (start 180.38 75.07) (end 180.38 77.67) (width 0.2) (layer "F.Cu") (net 28) (tstamp fe3593c4-7a9d-4742-85fe-9a5c03546a15))
|
||||
@ -30292,6 +30464,7 @@
|
||||
(segment (start 185.465 79.92) (end 185.465 78.555) (width 0.2) (layer "B.Cu") (net 28) (tstamp 3e9db227-fd2e-4ab9-b578-3ccef9ae3204))
|
||||
(segment (start 174.305 66.295) (end 174.28 66.27) (width 0.2) (layer "B.Cu") (net 28) (tstamp 403adb90-4a4f-4108-9466-bb1250d51b19))
|
||||
(segment (start 233.255 81.48495) (end 232.11995 82.62) (width 0.2) (layer "B.Cu") (net 28) (tstamp 454352b9-3bf5-4f48-8a85-e7006645fd83))
|
||||
(segment (start 179.78 78.27) (end 178.505 78.27) (width 0.2) (layer "B.Cu") (net 28) (tstamp 49b8290f-73aa-4719-9635-9b91dbb16bea))
|
||||
(segment (start 196.36995 82.12) (end 197.335 81.15495) (width 0.2) (layer "B.Cu") (net 28) (tstamp 4e908e86-7f27-4d94-a80c-e4b3c1859dd7))
|
||||
(segment (start 201.360761 81.17) (end 200.060761 82.47) (width 0.2) (layer "B.Cu") (net 28) (tstamp 54aaa6cf-28b3-4d33-b5c8-ad421ad33d25))
|
||||
(segment (start 232.11995 82.62) (end 231.33 82.62) (width 0.2) (layer "B.Cu") (net 28) (tstamp 55441ca0-e77e-4488-ac92-207c8e1f3958))
|
||||
@ -30305,6 +30478,7 @@
|
||||
(segment (start 263.33 129.66) (end 263.33 130.17) (width 0.2) (layer "B.Cu") (net 28) (tstamp 8e22ff07-8e90-4109-a250-e20c78bcb1ea))
|
||||
(segment (start 174.305 67.575) (end 174.305 66.295) (width 0.2) (layer "B.Cu") (net 28) (tstamp 8f3f9d7f-34ce-4148-b85f-6e1fa6922d45))
|
||||
(segment (start 226.58 83.02) (end 230.38 83.02) (width 0.2) (layer "B.Cu") (net 28) (tstamp 9506178d-aa10-46fa-a1b8-c721385f847d))
|
||||
(segment (start 180.38 77.67) (end 179.78 78.27) (width 0.2) (layer "B.Cu") (net 28) (tstamp 98aac04d-b728-4c58-8e05-9d31ea9c9a3d))
|
||||
(segment (start 220.58 83.47) (end 219.18 83.47) (width 0.2) (layer "B.Cu") (net 28) (tstamp 9efaa25b-cccd-4963-9ac2-784ab74528b6))
|
||||
(segment (start 226.18 82.62) (end 226.58 83.02) (width 0.2) (layer "B.Cu") (net 28) (tstamp 9fe8ebd7-b3bd-480a-8b25-cc1a4243b82e))
|
||||
(segment (start 233.255 79.92) (end 233.255 81.48495) (width 0.2) (layer "B.Cu") (net 28) (tstamp a7611a1c-f96b-4979-b5fd-f9c6b69e1825))
|
||||
@ -30728,11 +30902,11 @@
|
||||
(segment (start 254.362122 85.300378) (end 254.13 85.5325) (width 0.2) (layer "B.Cu") (net 81) (tstamp 37a47831-68a8-43d3-b142-1b196353ea40))
|
||||
(segment (start 241.58 85.5325) (end 245.38 85.5325) (width 0.2) (layer "B.Cu") (net 81) (tstamp 3b7b8e73-1054-4aba-88d1-737ea500cb6c))
|
||||
(segment (start 205.33 85.4825) (end 211.58 85.4825) (width 0.2) (layer "B.Cu") (net 81) (tstamp 3db0f412-c89b-4541-a08e-8fd922a4eeb2))
|
||||
(segment (start 181.33 85.545) (end 175.38 79.595) (width 0.2) (layer "B.Cu") (net 81) (tstamp 4d90bba8-8ae6-451b-8c21-920240905003))
|
||||
(segment (start 178.88 81.17) (end 178.88 83.095) (width 0.2) (layer "B.Cu") (net 81) (tstamp 4f9f947e-241f-42ba-949f-79f16c420cb1))
|
||||
(segment (start 250.33 85.5325) (end 254.13 85.5325) (width 0.2) (layer "B.Cu") (net 81) (tstamp 51dcda47-ac8a-4978-9723-887fde653b2f))
|
||||
(segment (start 175.38 78.47) (end 176.18 79.27) (width 0.2) (layer "B.Cu") (net 81) (tstamp 54400117-5966-4a4f-a1a8-aeb9a85adc24))
|
||||
(segment (start 181.925 67.575) (end 181.925 66.225) (width 0.2) (layer "B.Cu") (net 81) (tstamp 564772a8-522b-46e7-84b1-f1e834869824))
|
||||
(segment (start 231.58 89.7325) (end 231.58 85.47) (width 0.2) (layer "B.Cu") (net 81) (tstamp 5a5a2224-07e6-450a-a608-e83bd0dcc297))
|
||||
(segment (start 175.38 79.595) (end 175.38 76.47) (width 0.2) (layer "B.Cu") (net 81) (tstamp 65e7c203-df7f-4f7f-937d-f889e4aba362))
|
||||
(segment (start 221.58 85.4825) (end 221.58 89.7325) (width 0.2) (layer "B.Cu") (net 81) (tstamp 73fda6b0-1cb6-4217-8981-72ab07a08344))
|
||||
(segment (start 191.58 85.4825) (end 195.33 85.4825) (width 0.2) (layer "B.Cu") (net 81) (tstamp 7bcb0394-246b-41f5-b1dc-0b3ddc13f8bd))
|
||||
(segment (start 195.33 85.4825) (end 195.8175 85.97) (width 0.2) (layer "B.Cu") (net 81) (tstamp 8d2d6d82-c526-4abe-a4f7-c6b1edb00ec3))
|
||||
@ -30747,20 +30921,29 @@
|
||||
(segment (start 181.33 89.6075) (end 181.33 85.545) (width 0.2) (layer "B.Cu") (net 81) (tstamp c2449367-f26e-4b00-a028-3929b0ee1ac7))
|
||||
(segment (start 235.33 85.47) (end 241.5175 85.47) (width 0.2) (layer "B.Cu") (net 81) (tstamp c7fe3dd5-0195-45f8-84ef-30d510fa32f3))
|
||||
(segment (start 200.08 86.07) (end 199.98 85.97) (width 0.2) (layer "B.Cu") (net 81) (tstamp c99f1c9c-9525-4711-8908-42e6975c7275))
|
||||
(segment (start 176.98 79.27) (end 178.88 81.17) (width 0.2) (layer "B.Cu") (net 81) (tstamp ce40f7f3-a64b-406b-b89c-8e5867392bb0))
|
||||
(segment (start 199.98 85.97) (end 201.0925 85.97) (width 0.2) (layer "B.Cu") (net 81) (tstamp d434102b-025c-48e5-aa3c-0c81e47ed824))
|
||||
(segment (start 245.38 85.5325) (end 250.33 85.5325) (width 0.2) (layer "B.Cu") (net 81) (tstamp ea756cc5-2100-4192-85e4-22aab9e58802))
|
||||
(segment (start 211.58 89.7325) (end 211.58 85.4825) (width 0.2) (layer "B.Cu") (net 81) (tstamp ee4243f2-9128-41f2-b5f9-e7e9ffaa8a07))
|
||||
(segment (start 178.88 83.095) (end 181.33 85.545) (width 0.2) (layer "B.Cu") (net 81) (tstamp ef806edf-a568-4c38-bfd0-a67e82d5e3bc))
|
||||
(segment (start 175.38 76.47) (end 175.38 78.47) (width 0.2) (layer "B.Cu") (net 81) (tstamp f2675980-f062-4a65-bbb2-fa68a230ca8c))
|
||||
(segment (start 176.18 79.27) (end 176.98 79.27) (width 0.2) (layer "B.Cu") (net 81) (tstamp f9de0ca0-f9a7-40d0-9bf9-d3b9d65a0a2d))
|
||||
(segment (start 200.08 88.2325) (end 200.08 86.07) (width 0.2) (layer "B.Cu") (net 81) (tstamp fb3e93ba-a66b-4f48-95c2-6879c62b1800))
|
||||
(segment (start 231.58 85.47) (end 235.33 85.47) (width 0.2) (layer "B.Cu") (net 81) (tstamp fe0cbe1c-a2f4-4515-86c1-9c2bc11f9568))
|
||||
(segment (start 183.08 81.67) (end 183.035025 81.625025) (width 0.2) (layer "F.Cu") (net 82) (tstamp 296d1bb1-3842-434b-a0d7-51395d2ecea3))
|
||||
(segment (start 180.68 66.17) (end 180.68 73.25995) (width 0.2) (layer "F.Cu") (net 82) (tstamp 575340bd-cc4f-4940-bcee-88e8aba5ed2c))
|
||||
(segment (start 183.035025 81.625025) (end 183.035025 75.614975) (width 0.2) (layer "F.Cu") (net 82) (tstamp 6137de4a-d76a-46f8-ab61-6fbf5d461ed5))
|
||||
(segment (start 180.68 73.25995) (end 183.035025 75.614975) (width 0.2) (layer "F.Cu") (net 82) (tstamp 6f86c6f2-e6c9-49cd-9662-7e713f1934c9))
|
||||
(via (at 176.58 80.17) (size 0.8) (drill 0.4) (layers "F.Cu" "B.Cu") (net 82) (tstamp 54cc5474-820b-469b-8e61-299a64d26409))
|
||||
(via (at 183.08 81.67) (size 0.8) (drill 0.4) (layers "F.Cu" "B.Cu") (net 82) (tstamp 6f660475-62b3-4ad2-badd-5f7c2ab85393))
|
||||
(via (at 180.68 66.17) (size 0.8) (drill 0.4) (layers "F.Cu" "B.Cu") (net 82) (tstamp d269c222-ae01-478b-b9f4-1da215028865))
|
||||
(segment (start 181.58 80.17) (end 176.58 80.17) (width 0.2) (layer "In2.Cu") (net 82) (tstamp bc709376-91ea-4524-83c4-012e36a5d27b))
|
||||
(segment (start 183.08 81.67) (end 181.58 80.17) (width 0.2) (layer "In2.Cu") (net 82) (tstamp bfe21857-1363-414e-8011-8556ce7683b7))
|
||||
(segment (start 180.655 67.575) (end 180.655 66.195) (width 0.2) (layer "B.Cu") (net 82) (tstamp 0029788b-0478-4045-a30b-5164ccc31e42))
|
||||
(segment (start 182.925 81.515) (end 183.08 81.67) (width 0.2) (layer "B.Cu") (net 82) (tstamp 02e87b5e-83e2-4ef5-a375-ff1fbfaa0d1a))
|
||||
(segment (start 176.58 80.17) (end 175.58 80.17) (width 0.2) (layer "B.Cu") (net 82) (tstamp 3a530405-f71c-4205-9933-ed0995a336d2))
|
||||
(segment (start 180.655 66.195) (end 180.68 66.17) (width 0.2) (layer "B.Cu") (net 82) (tstamp 7a898056-471a-432d-a742-4405e25cc29e))
|
||||
(segment (start 175.58 80.17) (end 175.48 80.27) (width 0.2) (layer "B.Cu") (net 82) (tstamp 98b2f137-2d86-4347-8128-09d7caeb5f07))
|
||||
(segment (start 182.925 79.92) (end 182.925 81.515) (width 0.2) (layer "B.Cu") (net 82) (tstamp b8925caa-7726-4143-8810-22c025d4969f))
|
||||
(segment (start 218.83 89.095) (end 218.005 89.095) (width 0.2) (layer "F.Cu") (net 84) (tstamp 3326281f-f5dd-4a33-ba36-bc322548e694))
|
||||
(segment (start 218.005 89.095) (end 217.58 88.67) (width 0.2) (layer "F.Cu") (net 84) (tstamp b3cae221-0c4c-4c3c-824b-6718c6928560))
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"board": {
|
||||
"active_layer": 0,
|
||||
"active_layer": 31,
|
||||
"active_layer_preset": "",
|
||||
"auto_track_width": false,
|
||||
"hidden_netclasses": [],
|
||||
|
@ -2679,6 +2679,9 @@
|
||||
(junction (at 360.172 380.746) (diameter 0) (color 0 0 0 0)
|
||||
(uuid 2125b107-250d-44b9-ae2a-63555b15b96b)
|
||||
)
|
||||
(junction (at 212.09 331.978) (diameter 0) (color 0 0 0 0)
|
||||
(uuid 21c9489c-b7e7-411e-8242-06cb982ccdfb)
|
||||
)
|
||||
(junction (at 505.206 51.054) (diameter 0) (color 0 0 0 0)
|
||||
(uuid 2229d344-cb60-4539-b02a-c72401d1ef40)
|
||||
)
|
||||
@ -2814,6 +2817,9 @@
|
||||
(junction (at 360.172 409.448) (diameter 0) (color 0 0 0 0)
|
||||
(uuid 547e0024-8ca5-4fd9-9ed0-6e6fa4efe2d1)
|
||||
)
|
||||
(junction (at 217.678 314.198) (diameter 0) (color 0 0 0 0)
|
||||
(uuid 54c228c6-a419-4461-b51c-f4689ab11c16)
|
||||
)
|
||||
(junction (at 437.388 182.118) (diameter 0) (color 0 0 0 0)
|
||||
(uuid 54e7dc2f-bc56-4792-9ac4-117d8dbca40c)
|
||||
)
|
||||
@ -3348,6 +3354,9 @@
|
||||
(junction (at 220.98 410.21) (diameter 0) (color 0 0 0 0)
|
||||
(uuid ea81a12e-80a8-4055-a8fc-17c9562b0042)
|
||||
)
|
||||
(junction (at 219.71 327.914) (diameter 0) (color 0 0 0 0)
|
||||
(uuid eb134ef6-0e32-46e8-9263-d8797dfe432d)
|
||||
)
|
||||
(junction (at 592.074 296.291) (diameter 0) (color 0 0 0 0)
|
||||
(uuid ebf87918-a615-4d30-a04f-fc903a46a5a2)
|
||||
)
|
||||
@ -3902,6 +3911,10 @@
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 1ac57f67-5331-4ab5-8e31-a0bea0b41fcb)
|
||||
)
|
||||
(wire (pts (xy 215.9 314.198) (xy 217.678 314.198))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 1af34761-dc49-4d18-bbf4-1492f4cc1d8d)
|
||||
)
|
||||
(wire (pts (xy 58.166 74.295) (xy 58.293 74.295))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 1afcf8f1-7ff8-4810-8e5d-9e8796e6dfba)
|
||||
@ -4042,6 +4055,10 @@
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 23de727b-6639-4447-893f-880e5b289536)
|
||||
)
|
||||
(wire (pts (xy 212.09 331.978) (xy 212.09 332.994))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 23e8c9c3-93be-44ca-8fad-c83dd18ac0c8)
|
||||
)
|
||||
(wire (pts (xy 544.576 63.754) (xy 544.576 77.724))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 23f0aa50-d487-4575-a843-de67ca60c727)
|
||||
@ -4474,7 +4491,7 @@
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 3ac512fc-03e0-45ef-bcfc-91cd31a5d08a)
|
||||
)
|
||||
(wire (pts (xy 212.598 327.914) (xy 230.378 327.914))
|
||||
(wire (pts (xy 212.598 327.914) (xy 219.71 327.914))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 3b182ec3-13b7-44b7-bac1-25041955a3fa)
|
||||
)
|
||||
@ -5334,6 +5351,10 @@
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 73a51a53-a55b-473b-ad2a-375e6364ea43)
|
||||
)
|
||||
(wire (pts (xy 222.758 332.994) (xy 222.758 325.374))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 73aa0f01-ebf0-43dc-996d-3ff58256e648)
|
||||
)
|
||||
(wire (pts (xy 345.948 165.608) (xy 345.948 171.958))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 73c811c0-180d-4343-833c-a4531fc8ea4b)
|
||||
@ -5390,6 +5411,10 @@
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 7787bad0-9d3f-4609-aabe-4e315b1f104a)
|
||||
)
|
||||
(wire (pts (xy 219.71 332.994) (xy 222.758 332.994))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 779102a9-05bb-4278-bb3e-42b19f67fb92)
|
||||
)
|
||||
(wire (pts (xy 728.218 169.418) (xy 728.218 183.388))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 77a545d4-c2cc-4b63-bbb8-e17a2fec39e3)
|
||||
@ -5690,6 +5715,10 @@
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 8de7403f-6049-43f8-95bf-e7674bbb8126)
|
||||
)
|
||||
(wire (pts (xy 217.678 314.198) (xy 217.678 314.706))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 8e3947c4-be9e-457a-bc90-0a239e779748)
|
||||
)
|
||||
(wire (pts (xy 218.948 164.338) (xy 218.948 169.418))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 8e556e8d-3ee1-4358-b136-37db57b41c2d)
|
||||
@ -5778,6 +5807,10 @@
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 934f0394-ae0e-47f4-91b3-2ec651bd0e40)
|
||||
)
|
||||
(wire (pts (xy 207.518 314.198) (xy 208.28 314.198))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 93527407-e64a-464a-a822-23f894dba242)
|
||||
)
|
||||
(wire (pts (xy 382.778 313.944) (xy 382.778 327.914))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 93562069-8e07-48ad-b56e-a5f0da6e07c4)
|
||||
@ -5798,6 +5831,10 @@
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 943d1afc-7f5d-4875-8168-a29bc8d11059)
|
||||
)
|
||||
(wire (pts (xy 217.678 313.944) (xy 217.678 314.198))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 953a7cd9-fffb-4ca4-93ce-542d5be8c086)
|
||||
)
|
||||
(wire (pts (xy 727.456 63.754) (xy 727.456 77.724))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 957af009-c4d1-4703-a2b0-2895638aac41)
|
||||
@ -6050,6 +6087,10 @@
|
||||
(stroke (width 0) (type default))
|
||||
(uuid a3e55282-f56d-4ba7-a844-9b0da0a714e4)
|
||||
)
|
||||
(wire (pts (xy 212.09 330.454) (xy 212.09 331.978))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid a3f9aa8c-6e37-42a4-a5ea-bdb5c1293da3)
|
||||
)
|
||||
(wire (pts (xy 738.378 210.058) (xy 738.378 211.328))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid a4d6f58e-d74f-4990-8ab2-709c04b5738d)
|
||||
@ -6302,6 +6343,10 @@
|
||||
(stroke (width 0) (type default))
|
||||
(uuid b51314ec-4cdc-48a3-a408-417d07cad7c9)
|
||||
)
|
||||
(wire (pts (xy 211.074 331.978) (xy 212.09 331.978))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid b556332f-cf07-4913-afad-9a147244daf9)
|
||||
)
|
||||
(wire (pts (xy 161.925 598.805) (xy 161.925 602.615))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid b56b2139-5a37-484a-90d8-a5f9ef1e143a)
|
||||
@ -6718,10 +6763,18 @@
|
||||
(stroke (width 0) (type default))
|
||||
(uuid ceb39d43-c3f5-4ba0-8409-156fc44404bd)
|
||||
)
|
||||
(wire (pts (xy 219.71 327.914) (xy 230.378 327.914))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid cef05c58-cf41-42bf-ac69-07a5193ba078)
|
||||
)
|
||||
(wire (pts (xy 152.146 92.202) (xy 107.696 92.202))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid cf535f02-1104-433d-b44e-1468f9b7d04c)
|
||||
)
|
||||
(wire (pts (xy 219.71 327.914) (xy 219.71 330.454))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid cf5ad6aa-78f5-40ce-8d6b-96f71942f001)
|
||||
)
|
||||
(wire (pts (xy 445.262 419.608) (xy 445.262 422.148))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid cfd7eed5-0d5e-4137-a194-4dc8b31a899b)
|
||||
@ -7541,6 +7594,10 @@
|
||||
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||
(uuid 7d8bf144-571c-4332-bd3c-87c0906480f4)
|
||||
)
|
||||
(text "Very bright\n" (at 651.51 280.67 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||
(uuid 832b3340-c75e-433e-b9da-dd5c76103ba0)
|
||||
)
|
||||
(text "Input only" (at 108.966 131.572 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||
(uuid 89047526-255e-471a-8d38-0782d129a865)
|
||||
@ -9266,6 +9323,13 @@
|
||||
(effects (font (size 1.27 1.27)) (justify left) hide)
|
||||
)
|
||||
)
|
||||
(global_label "GND" (shape input) (at 211.074 331.978 180) (fields_autoplaced)
|
||||
(effects (font (size 1.27 1.27)) (justify right))
|
||||
(uuid 78288350-16cd-4d62-a692-e0cb8d89fb85)
|
||||
(property "Intersheetrefs" "${INTERSHEET_REFS}" (at 204.8725 331.978 0)
|
||||
(effects (font (size 1.27 1.27)) (justify right) hide)
|
||||
)
|
||||
)
|
||||
(global_label "1K_GND" (shape input) (at 236.728 210.058 0) (fields_autoplaced)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
(uuid 78a43fe2-1a2b-4ecb-b5a3-8196eada2a7b)
|
||||
@ -10127,6 +10191,13 @@
|
||||
(effects (font (size 1.27 1.27)) (justify right) hide)
|
||||
)
|
||||
)
|
||||
(global_label "GND" (shape input) (at 207.518 314.198 180) (fields_autoplaced)
|
||||
(effects (font (size 1.27 1.27)) (justify right))
|
||||
(uuid b53f4dbf-44b8-4097-b5a3-e8b67f5ca368)
|
||||
(property "Intersheetrefs" "${INTERSHEET_REFS}" (at 201.3165 314.198 0)
|
||||
(effects (font (size 1.27 1.27)) (justify right) hide)
|
||||
)
|
||||
)
|
||||
(global_label "SENSOR3_PUMP_END" (shape input) (at 507.746 105.664 270) (fields_autoplaced)
|
||||
(effects (font (size 1.27 1.27)) (justify right))
|
||||
(uuid b5896234-9844-4a7c-b385-3ed74755ab79)
|
||||
@ -10666,10 +10737,10 @@
|
||||
(effects (font (size 1.27 1.27)) (justify left) hide)
|
||||
)
|
||||
)
|
||||
(global_label "SerialIn" (shape input) (at 217.678 313.944 270) (fields_autoplaced)
|
||||
(global_label "SerialIn" (shape input) (at 217.678 314.706 270) (fields_autoplaced)
|
||||
(effects (font (size 1.27 1.27)) (justify right))
|
||||
(uuid dca7b472-c7e0-4e05-b5ef-1499c1695b27)
|
||||
(property "Intersheetrefs" "${INTERSHEET_REFS}" (at 217.678 324.1069 90)
|
||||
(property "Intersheetrefs" "${INTERSHEET_REFS}" (at 217.678 324.8689 90)
|
||||
(effects (font (size 1.27 1.27)) (justify right) hide)
|
||||
)
|
||||
)
|
||||
@ -20561,6 +20632,35 @@
|
||||
)
|
||||
)
|
||||
|
||||
(symbol (lib_id "Device:R") (at 212.09 314.198 90) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no)
|
||||
(uuid b4ff286f-51e3-425f-8430-14c7e2113349)
|
||||
(property "Reference" "R46" (at 210.9216 312.42 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
)
|
||||
(property "Value" "10k" (at 213.233 312.42 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
)
|
||||
(property "Footprint" "Resistor_SMD:R_0603_1608Metric" (at 212.09 315.976 90)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Datasheet" "~" (at 212.09 314.198 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "LCSC_PART_NUMBER" "C212284" (at 212.09 314.198 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(pin "1" (uuid 4f49bea2-8256-45de-9483-b0b617806a07))
|
||||
(pin "2" (uuid cacf7d54-0201-4e58-91b5-78b976778c6d))
|
||||
(instances
|
||||
(project "PlantCtrlESP32"
|
||||
(path "/c26e8d55-0b6e-4c4e-b7c8-b1fed973201c"
|
||||
(reference "R46") (unit 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(symbol (lib_id "Device:C") (at 110.49 734.06 0) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
|
||||
(uuid b51bde50-3d7a-4a3c-9970-527322e8f4a4)
|
||||
@ -20783,6 +20883,35 @@
|
||||
)
|
||||
)
|
||||
|
||||
(symbol (lib_id "Device:R") (at 215.9 332.994 90) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no)
|
||||
(uuid bb4afad3-b745-45d5-a7ce-b8763b1bdea0)
|
||||
(property "Reference" "R51" (at 214.7316 331.216 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
)
|
||||
(property "Value" "10k" (at 217.043 331.216 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
)
|
||||
(property "Footprint" "Resistor_SMD:R_0603_1608Metric" (at 215.9 334.772 90)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Datasheet" "~" (at 215.9 332.994 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "LCSC_PART_NUMBER" "C212284" (at 215.9 332.994 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(pin "1" (uuid 5b451fb6-7b85-4d13-aaad-da9a7f63856b))
|
||||
(pin "2" (uuid ac816894-a69a-4fbf-9fbe-e1301d8a6d94))
|
||||
(instances
|
||||
(project "PlantCtrlESP32"
|
||||
(path "/c26e8d55-0b6e-4c4e-b7c8-b1fed973201c"
|
||||
(reference "R51") (unit 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(symbol (lib_id "Device:LED") (at 263.652 405.638 90) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
|
||||
(uuid bb8dd331-89fa-4efd-b804-823bb21d1395)
|
||||
@ -23618,6 +23747,35 @@
|
||||
)
|
||||
)
|
||||
|
||||
(symbol (lib_id "Device:R") (at 215.9 330.454 90) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no)
|
||||
(uuid ee167434-7247-432a-8a61-3f2f465cfc2a)
|
||||
(property "Reference" "R48" (at 214.7316 328.676 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
)
|
||||
(property "Value" "10k" (at 217.043 328.676 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
)
|
||||
(property "Footprint" "Resistor_SMD:R_0603_1608Metric" (at 215.9 332.232 90)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Datasheet" "~" (at 215.9 330.454 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "LCSC_PART_NUMBER" "C212284" (at 215.9 330.454 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(pin "1" (uuid a8ce9c84-3042-4d2e-aefc-0a6dcd754e22))
|
||||
(pin "2" (uuid ec839d03-e002-45c2-8b4f-8962d298176c))
|
||||
(instances
|
||||
(project "PlantCtrlESP32"
|
||||
(path "/c26e8d55-0b6e-4c4e-b7c8-b1fed973201c"
|
||||
(reference "R48") (unit 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(symbol (lib_id "Device:C") (at 226.314 383.032 90) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
|
||||
(uuid ee6c797b-3de3-4642-9429-536ccc47bb9f)
|
||||
|
@ -3,6 +3,7 @@ target = "xtensa-esp32-espidf"
|
||||
|
||||
[target.xtensa-esp32-espidf]
|
||||
linker = "ldproxy"
|
||||
#runner = "espflash flash --monitor --partition-table partitions.csv" # Select this runner for espflash v2.x.x
|
||||
runner = "espflash flash --monitor --baud 921600 --partition-table partitions.csv" # Select this runner for espflash v2.x.x
|
||||
#runner = "cargo runner"
|
||||
rustflags = [ "--cfg", "espidf_time64"] # Extending time_t for ESP IDF 5: https://github.com/esp-rs/rust/issues/110
|
||||
|
@ -78,6 +78,8 @@ serde_json = "1.0.108"
|
||||
strum = { version = "0.25.0", features = ["derive"] }
|
||||
once_cell = "1.19.0"
|
||||
measurements = "0.11.0"
|
||||
medians = "3.0.6"
|
||||
median-accumulator = "0.2.0"
|
||||
#?bq34z100 required
|
||||
|
||||
[build-dependencies]
|
||||
|
1835
rust/src/bq34z100.rs
1835
rust/src/bq34z100.rs
File diff suppressed because it is too large
Load Diff
@ -14,8 +14,8 @@ pub struct Config {
|
||||
pub tank_sensor_enabled: bool,
|
||||
pub tank_useable_ml: u32,
|
||||
pub tank_warn_percent: u8,
|
||||
pub tank_empty_mv: u16,
|
||||
pub tank_full_mv: u16,
|
||||
pub tank_empty_percent: u16,
|
||||
pub tank_full_percent: u16,
|
||||
|
||||
pub night_lamp_hour_start: u8,
|
||||
pub night_lamp_hour_end: u8,
|
||||
@ -38,8 +38,8 @@ impl Default for Config {
|
||||
plants: [Plant::default(); PLANT_COUNT],
|
||||
max_consecutive_pump_count: 15,
|
||||
tank_useable_ml: 5000,
|
||||
tank_empty_mv: 0100_u16,
|
||||
tank_full_mv: 3300_u16,
|
||||
tank_empty_percent: 0_u16,
|
||||
tank_full_percent: 100_u16,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
283
rust/src/main.rs
283
rust/src/main.rs
@ -3,11 +3,13 @@ use std::{
|
||||
sync::{atomic::AtomicBool, Arc, Mutex},
|
||||
};
|
||||
|
||||
use anyhow::{Result, bail};
|
||||
use chrono::{Datelike, Duration, NaiveDateTime, Timelike, DateTime};
|
||||
use anyhow::{bail, Result};
|
||||
use chrono::{DateTime, Datelike, Duration, NaiveDateTime, Timelike};
|
||||
use chrono_tz::{Europe::Berlin, Tz};
|
||||
use esp_idf_hal::delay::Delay;
|
||||
use esp_idf_sys::{esp_restart, vTaskDelay, CONFIG_FREERTOS_HZ, esp_deep_sleep};
|
||||
use esp_idf_sys::{
|
||||
esp_deep_sleep, esp_restart, gpio_deep_sleep_hold_dis, gpio_deep_sleep_hold_en, vTaskDelay, CONFIG_FREERTOS_HZ
|
||||
};
|
||||
use esp_ota::rollback_and_reboot;
|
||||
use log::error;
|
||||
use once_cell::sync::Lazy;
|
||||
@ -51,11 +53,11 @@ enum WaitType {
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Copy, Clone, Debug, PartialEq, Default)]
|
||||
struct LightState{
|
||||
struct LightState {
|
||||
active: bool,
|
||||
out_of_work_hour: bool,
|
||||
battery_low: bool,
|
||||
is_day: bool
|
||||
is_day: bool,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Copy, Clone, Debug, PartialEq, Default)]
|
||||
@ -75,7 +77,7 @@ struct PlantState {
|
||||
sensor_error_a: bool,
|
||||
sensor_error_b: bool,
|
||||
sensor_error_p: bool,
|
||||
out_of_work_hour: bool
|
||||
out_of_work_hour: bool,
|
||||
}
|
||||
|
||||
fn wait_infinity(wait_type: WaitType, reboot_now: Arc<AtomicBool>) -> ! {
|
||||
@ -122,10 +124,18 @@ pub static STAY_ALIVE: Lazy<AtomicBool> = Lazy::new(|| AtomicBool::new(false));
|
||||
|
||||
fn map_range(from_range: (f32, f32), s: f32) -> Result<f32> {
|
||||
if s < from_range.0 {
|
||||
bail!("Value out of range, min {} but current is {}", from_range.0, s);
|
||||
bail!(
|
||||
"Value out of range, min {} but current is {}",
|
||||
from_range.0,
|
||||
s
|
||||
);
|
||||
}
|
||||
if s > from_range.1 {
|
||||
bail!("Value out of range, max {} but current is {}", from_range.1, s);
|
||||
bail!(
|
||||
"Value out of range, max {} but current is {}",
|
||||
from_range.1,
|
||||
s
|
||||
);
|
||||
}
|
||||
return Ok(TO.0 + (s - from_range.0) * (TO.1 - TO.0) / (from_range.1 - from_range.0));
|
||||
}
|
||||
@ -141,7 +151,7 @@ fn map_range_moisture(s: f32) -> Result<u8> {
|
||||
return Ok(tmp as u8);
|
||||
}
|
||||
|
||||
fn in_time_range(cur: DateTime<Tz>, start:u8, end:u8) -> bool{
|
||||
fn in_time_range(cur: DateTime<Tz>, start: u8, end: u8) -> bool {
|
||||
let curhour = cur.hour() as u8;
|
||||
//eg 10-14
|
||||
if start < end {
|
||||
@ -152,40 +162,60 @@ fn in_time_range(cur: DateTime<Tz>, start:u8, end:u8) -> bool{
|
||||
}
|
||||
}
|
||||
|
||||
fn determine_next_plant(plantstate: &mut [PlantState;PLANT_COUNT],cur: DateTime<Tz>, enough_water: bool, water_frozen: bool, tank_sensor_error: bool, config: &Config, board: &mut std::sync::MutexGuard<'_, PlantCtrlBoard<'_>>) -> Option<usize> {
|
||||
fn determine_next_plant(
|
||||
plantstate: &mut [PlantState; PLANT_COUNT],
|
||||
cur: DateTime<Tz>,
|
||||
enough_water: bool,
|
||||
water_frozen: bool,
|
||||
tank_sensor_error: bool,
|
||||
config: &Config,
|
||||
board: &mut std::sync::MutexGuard<'_, PlantCtrlBoard<'_>>,
|
||||
) -> Option<usize> {
|
||||
for plant in 0..PLANT_COUNT {
|
||||
let state = &mut plantstate[plant];
|
||||
let plant_config = config.plants[plant];
|
||||
match plant_config.mode {
|
||||
config::Mode::OFF => {
|
||||
|
||||
},
|
||||
config::Mode::OFF => {}
|
||||
config::Mode::TargetMoisture => {
|
||||
match board.measure_moisture_hz(plant, plant_hal::Sensor::A).and_then (|moist| map_range_moisture(moist as f32)) {
|
||||
match board
|
||||
.measure_moisture_hz(plant, plant_hal::Sensor::A)
|
||||
.and_then(|moist| map_range_moisture(moist as f32))
|
||||
{
|
||||
Ok(a) => state.a = Some(a),
|
||||
Err(err) => {
|
||||
board.fault(plant, true);
|
||||
println!("Could not determine Moisture A for plant {} due to {}", plant, err);
|
||||
state.a = None;
|
||||
println!(
|
||||
"Could not determine Moisture A for plant {} due to {}",
|
||||
plant, err
|
||||
);
|
||||
state.a = None;
|
||||
state.sensor_error_a = true;
|
||||
}
|
||||
}
|
||||
match board.measure_moisture_hz(plant, plant_hal::Sensor::B).and_then (|moist| map_range_moisture(moist as f32)) {
|
||||
match board
|
||||
.measure_moisture_hz(plant, plant_hal::Sensor::B)
|
||||
.and_then(|moist| map_range_moisture(moist as f32))
|
||||
{
|
||||
Ok(b) => state.b = Some(b),
|
||||
Err(err) => {
|
||||
board.fault(plant, true);
|
||||
println!("Could not determine Moisture B for plant {} due to {}", plant, err);
|
||||
state.b = None;
|
||||
println!(
|
||||
"Could not determine Moisture B for plant {} due to {}",
|
||||
plant, err
|
||||
);
|
||||
state.b = None;
|
||||
state.sensor_error_b = true;
|
||||
}
|
||||
}
|
||||
//FIXME how to average analyze whatever?
|
||||
//FIXME how to average analyze whatever?
|
||||
let a_low = state.a.is_some() && state.a.unwrap() < plant_config.target_moisture;
|
||||
let b_low = state.b.is_some() && state.b.unwrap() < plant_config.target_moisture;
|
||||
|
||||
|
||||
if a_low || b_low {
|
||||
state.dry = true;
|
||||
if tank_sensor_error && !config.tank_allow_pumping_if_sensor_error || !enough_water {
|
||||
if tank_sensor_error && !config.tank_allow_pumping_if_sensor_error
|
||||
|| !enough_water
|
||||
{
|
||||
state.no_water = true;
|
||||
}
|
||||
}
|
||||
@ -194,20 +224,24 @@ fn determine_next_plant(plantstate: &mut [PlantState;PLANT_COUNT],cur: DateTime<
|
||||
if next_pump > cur {
|
||||
state.cooldown = true;
|
||||
}
|
||||
if !in_time_range(cur, plant_config.pump_hour_start, plant_config.pump_hour_end) {
|
||||
if !in_time_range(
|
||||
cur,
|
||||
plant_config.pump_hour_start,
|
||||
plant_config.pump_hour_end,
|
||||
) {
|
||||
state.out_of_work_hour = true;
|
||||
}
|
||||
if water_frozen {
|
||||
state.frozen = true;
|
||||
}
|
||||
if state.dry && !state.no_water && !state.cooldown && !state.out_of_work_hour{
|
||||
if state.dry && !state.no_water && !state.cooldown && !state.out_of_work_hour {
|
||||
if water_frozen {
|
||||
state.frozen = true;
|
||||
} else {
|
||||
state.do_water = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
config::Mode::TimerOnly => {
|
||||
let duration = Duration::minutes((60 * plant_config.pump_cooldown_min).into());
|
||||
let next_pump = board.last_pump_time(plant) + duration;
|
||||
@ -220,14 +254,18 @@ fn determine_next_plant(plantstate: &mut [PlantState;PLANT_COUNT],cur: DateTime<
|
||||
state.do_water = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
config::Mode::TimerAndDeadzone => {
|
||||
let duration = Duration::minutes((60 * plant_config.pump_cooldown_min).into());
|
||||
let next_pump = board.last_pump_time(plant) + duration;
|
||||
if next_pump > cur {
|
||||
state.cooldown = true;
|
||||
}
|
||||
if !in_time_range(cur, plant_config.pump_hour_start, plant_config.pump_hour_end) {
|
||||
}
|
||||
if !in_time_range(
|
||||
cur,
|
||||
plant_config.pump_hour_start,
|
||||
plant_config.pump_hour_end,
|
||||
) {
|
||||
state.out_of_work_hour = true;
|
||||
}
|
||||
if !state.cooldown && !state.out_of_work_hour {
|
||||
@ -237,10 +275,10 @@ fn determine_next_plant(plantstate: &mut [PlantState;PLANT_COUNT],cur: DateTime<
|
||||
state.do_water = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
//FIXME publish state here!
|
||||
if state.do_water{
|
||||
if state.do_water {
|
||||
if board.consecutive_pump_count(plant) > config.max_consecutive_pump_count.into() {
|
||||
state.not_effective = true;
|
||||
board.fault(plant, true);
|
||||
@ -252,13 +290,16 @@ fn determine_next_plant(plantstate: &mut [PlantState;PLANT_COUNT],cur: DateTime<
|
||||
}
|
||||
for plant in 0..PLANT_COUNT {
|
||||
let state = &plantstate[plant];
|
||||
println!("Checking for water plant {} with state {}", plant, state.do_water);
|
||||
println!(
|
||||
"Checking for water plant {} with state {}",
|
||||
plant, state.do_water
|
||||
);
|
||||
if state.do_water {
|
||||
return Some(plant);
|
||||
}
|
||||
}
|
||||
println!("No plant needs water");
|
||||
return None
|
||||
return None;
|
||||
}
|
||||
|
||||
fn safe_main() -> Result<()> {
|
||||
@ -284,23 +325,23 @@ fn safe_main() -> Result<()> {
|
||||
|
||||
let partition_state: embedded_svc::ota::SlotState = embedded_svc::ota::SlotState::Unknown;
|
||||
match esp_idf_svc::ota::EspOta::new() {
|
||||
Ok(ota) => {
|
||||
//match ota.get_running_slot(){
|
||||
// Ok(slot) => {
|
||||
// partition_state = slot.state;
|
||||
// println!(
|
||||
// "Booting from {} with state {:?}",
|
||||
// slot.label, partition_state
|
||||
// );
|
||||
//},
|
||||
// Err(err) => {
|
||||
// println!("Error getting running slot {}", err);
|
||||
// },
|
||||
//}
|
||||
},
|
||||
Err(err) => {
|
||||
println!("Error obtaining ota info {}", err);
|
||||
},
|
||||
Ok(ota) => {
|
||||
//match ota.get_running_slot(){
|
||||
// Ok(slot) => {
|
||||
// partition_state = slot.state;
|
||||
// println!(
|
||||
// "Booting from {} with state {:?}",
|
||||
// slot.label, partition_state
|
||||
// );
|
||||
//},
|
||||
// Err(err) => {
|
||||
// println!("Error getting running slot {}", err);
|
||||
// },
|
||||
//}
|
||||
}
|
||||
Err(err) => {
|
||||
println!("Error obtaining ota info {}", err);
|
||||
}
|
||||
}
|
||||
|
||||
println!("Board hal init");
|
||||
@ -402,7 +443,7 @@ fn safe_main() -> Result<()> {
|
||||
}
|
||||
|
||||
if online_mode == OnlineMode::Wifi {
|
||||
match board.sntp(1000 * 120) {
|
||||
match board.sntp(1000 * 5) {
|
||||
Ok(new_time) => {
|
||||
cur = new_time;
|
||||
online_mode = OnlineMode::SnTp;
|
||||
@ -458,37 +499,43 @@ fn safe_main() -> Result<()> {
|
||||
if config.tank_sensor_enabled {
|
||||
let mut tank_value_r = 0;
|
||||
|
||||
let success = board.tank_sensor_mv().and_then(|raw| {
|
||||
tank_value_r = raw;
|
||||
return map_range(
|
||||
(config.tank_empty_mv as f32, config.tank_full_mv as f32),
|
||||
raw as f32,
|
||||
);
|
||||
}).and_then(|percent| {
|
||||
let left_ml = ((percent / 100_f32) * config.tank_useable_ml as f32) as u32;
|
||||
println!(
|
||||
"Tank sensor returned mv {} as {}% leaving {} ml useable",
|
||||
tank_value_r, percent as u8, left_ml
|
||||
);
|
||||
if config.tank_warn_percent > percent as u8 {
|
||||
board.general_fault(true);
|
||||
println!(
|
||||
"Low water, current percent is {}, minimum warn level is {}",
|
||||
percent as u8, config.tank_warn_percent
|
||||
let success = board
|
||||
.tank_sensor_percent()
|
||||
.and_then(|raw| {
|
||||
tank_value_r = raw;
|
||||
return map_range(
|
||||
(
|
||||
config.tank_empty_percent as f32,
|
||||
config.tank_full_percent as f32,
|
||||
),
|
||||
raw as f32,
|
||||
);
|
||||
}
|
||||
if config.tank_warn_percent <= 0 {
|
||||
enough_water = false;
|
||||
}
|
||||
return Ok(());
|
||||
});
|
||||
})
|
||||
.and_then(|percent| {
|
||||
let left_ml = (percent * config.tank_useable_ml as f32) as u32;
|
||||
println!(
|
||||
"Tank sensor returned mv {} as {}% leaving {} ml useable",
|
||||
tank_value_r, percent as u8, left_ml
|
||||
);
|
||||
if config.tank_warn_percent > percent as u8 {
|
||||
board.general_fault(true);
|
||||
println!(
|
||||
"Low water, current percent is {}, minimum warn level is {}",
|
||||
percent as u8, config.tank_warn_percent
|
||||
);
|
||||
}
|
||||
if config.tank_warn_percent <= 0 {
|
||||
enough_water = false;
|
||||
}
|
||||
return Ok(());
|
||||
});
|
||||
match success {
|
||||
Err(err) => {
|
||||
println!("Could not determine tank value due to {}", err);
|
||||
board.general_fault(true);
|
||||
tank_sensor_error = true;
|
||||
}
|
||||
Ok(_) => {},
|
||||
Ok(_) => {}
|
||||
}
|
||||
}
|
||||
|
||||
@ -503,17 +550,25 @@ fn safe_main() -> Result<()> {
|
||||
water_frozen = true;
|
||||
}
|
||||
break;
|
||||
},
|
||||
}
|
||||
Err(err) => {
|
||||
println!("Could not get water temp {}", err)
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let mut plantstate = [PlantState {
|
||||
..Default::default()
|
||||
}; PLANT_COUNT];
|
||||
let plant_to_pump = determine_next_plant(&mut plantstate, europe_time, enough_water, water_frozen, tank_sensor_error, &config, &mut board);
|
||||
let plant_to_pump = determine_next_plant(
|
||||
&mut plantstate,
|
||||
europe_time,
|
||||
enough_water,
|
||||
water_frozen,
|
||||
tank_sensor_error,
|
||||
&config,
|
||||
&mut board,
|
||||
);
|
||||
|
||||
if STAY_ALIVE.load(std::sync::atomic::Ordering::Relaxed) {
|
||||
drop(board);
|
||||
@ -521,72 +576,94 @@ fn safe_main() -> Result<()> {
|
||||
let _webserver = httpd(reboot_now.clone());
|
||||
wait_infinity(WaitType::StayAlive, reboot_now.clone());
|
||||
}
|
||||
|
||||
|
||||
match plant_to_pump {
|
||||
Some(plant) => {
|
||||
let mut state = plantstate[plant];
|
||||
let consecutive_pump_count = board.consecutive_pump_count(plant) + 1;
|
||||
board.store_consecutive_pump_count(plant, consecutive_pump_count);
|
||||
let plant_config = config.plants[plant];
|
||||
println!("Trying to pump for {}s with pump {} now", plant_config.pump_time_s,plant);
|
||||
|
||||
println!(
|
||||
"Trying to pump for {}s with pump {} now",
|
||||
plant_config.pump_time_s, plant
|
||||
);
|
||||
|
||||
board.any_pump(true)?;
|
||||
board.store_last_pump_time(plant, cur);
|
||||
board.pump(plant, true)?;
|
||||
board.last_pump_time(plant);
|
||||
state.active = true;
|
||||
//FIXME do periodic pump test here and state update
|
||||
unsafe { vTaskDelay(plant_config.pump_time_s as u32*CONFIG_FREERTOS_HZ) };
|
||||
match map_range_moisture(board.measure_moisture_hz(plant, plant_hal::Sensor::PUMP)? as f32) {
|
||||
unsafe { vTaskDelay(plant_config.pump_time_s as u32 * CONFIG_FREERTOS_HZ) };
|
||||
board.pump(plant, false)?;
|
||||
match map_range_moisture(
|
||||
board.measure_moisture_hz(plant, plant_hal::Sensor::PUMP)? as f32
|
||||
) {
|
||||
Ok(p) => state.after_p = Some(p),
|
||||
Err(err) => {
|
||||
board.fault(plant, true);
|
||||
println!("Could not determine Moisture P after for plant {} due to {}", plant, err);
|
||||
state.after_p = None;
|
||||
println!(
|
||||
"Could not determine Moisture P after for plant {} due to {}",
|
||||
plant, err
|
||||
);
|
||||
state.after_p = None;
|
||||
state.sensor_error_p = true;
|
||||
}
|
||||
}
|
||||
if state.after_p.is_none() || state.p.is_none() || state.after_p.unwrap() < state.p.unwrap() + 5 {
|
||||
if state.after_p.is_none()
|
||||
|| state.p.is_none()
|
||||
|| state.after_p.unwrap() < state.p.unwrap() + 5
|
||||
{
|
||||
state.pump_error = true;
|
||||
board.fault(plant, true);
|
||||
}
|
||||
},
|
||||
}
|
||||
None => {
|
||||
println!("Nothing to do");
|
||||
}
|
||||
,
|
||||
}
|
||||
|
||||
let mut light_state = LightState{ ..Default::default() };
|
||||
let mut light_state = LightState {
|
||||
..Default::default()
|
||||
};
|
||||
light_state.is_day = board.is_day();
|
||||
light_state.out_of_work_hour = !in_time_range(europe_time, config.night_lamp_hour_start, config.night_lamp_hour_end);
|
||||
light_state.out_of_work_hour = !in_time_range(
|
||||
europe_time,
|
||||
config.night_lamp_hour_start,
|
||||
config.night_lamp_hour_end,
|
||||
);
|
||||
if !light_state.out_of_work_hour {
|
||||
if config.night_lamp_only_when_dark {
|
||||
if !light_state.is_day {
|
||||
light_state.active = true;
|
||||
board.light(true).unwrap();
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
light_state.active = true;
|
||||
board.light(true).unwrap();
|
||||
}
|
||||
} else {
|
||||
light_state.active = false;
|
||||
board.light(false).unwrap();
|
||||
}
|
||||
println!("Lightstate is {:?}", light_state);
|
||||
|
||||
//check if during light time
|
||||
//lightstate += out of worktime
|
||||
//check battery level
|
||||
//lightstate += battery empty
|
||||
//check solar level if config requires
|
||||
//lightstate += stillday
|
||||
//if no preventing lightstate, enable light
|
||||
//lightstate = active
|
||||
|
||||
//deepsleep here?
|
||||
unsafe { esp_deep_sleep(1000*1000*10) };
|
||||
//check if during light time
|
||||
//lightstate += out of worktime
|
||||
//check battery level
|
||||
//lightstate += battery empty
|
||||
//check solar level if config requires
|
||||
//lightstate += stillday
|
||||
//if no preventing lightstate, enable light
|
||||
//lightstate = active
|
||||
|
||||
//relatch
|
||||
unsafe{gpio_deep_sleep_hold_dis()};
|
||||
unsafe { gpio_deep_sleep_hold_en() };
|
||||
unsafe { esp_deep_sleep(1000 * 1000 * 20) };
|
||||
}
|
||||
|
||||
fn main(){
|
||||
fn main() {
|
||||
let result = safe_main();
|
||||
result.unwrap();
|
||||
}
|
||||
|
@ -1,12 +1,9 @@
|
||||
//mod config;
|
||||
|
||||
use bit_field::BitField;
|
||||
use embedded_hal::blocking::i2c::Operation;
|
||||
use embedded_svc::wifi::{
|
||||
AccessPointConfiguration, AccessPointInfo, AuthMethod, ClientConfiguration, Configuration,
|
||||
};
|
||||
|
||||
use esp_idf_hal::i2c::{I2cConfig, I2cDriver, APBTickType};
|
||||
use esp_idf_hal::i2c::{I2cConfig, I2cDriver, I2cError};
|
||||
use esp_idf_hal::units::FromValueType;
|
||||
use esp_idf_svc::eventloop::EspSystemEventLoop;
|
||||
use esp_idf_svc::mqtt::client::QoS::ExactlyOnce;
|
||||
@ -14,7 +11,7 @@ use esp_idf_svc::mqtt::client::{EspMqttClient, MqttClientConfiguration};
|
||||
use esp_idf_svc::nvs::EspDefaultNvsPartition;
|
||||
use esp_idf_svc::wifi::config::{ScanConfig, ScanType};
|
||||
use esp_idf_svc::wifi::EspWifi;
|
||||
use measurements::{Measurement, Temperature};
|
||||
use measurements::Temperature;
|
||||
use plant_ctrl2::sipo::ShiftRegister40;
|
||||
|
||||
use anyhow::anyhow;
|
||||
@ -34,7 +31,7 @@ use ds18b20::Ds18b20;
|
||||
use embedded_hal::digital::v2::OutputPin;
|
||||
use esp_idf_hal::adc::{attenuation, AdcChannelDriver, AdcDriver};
|
||||
use esp_idf_hal::delay::Delay;
|
||||
use esp_idf_hal::gpio::{AnyInputPin, Gpio39, Gpio4, Level, PinDriver, Pull, InputOutput};
|
||||
use esp_idf_hal::gpio::{AnyInputPin, Gpio39, Gpio4, InputOutput, Level, PinDriver, Pull};
|
||||
use esp_idf_hal::pcnt::{
|
||||
PcntChannel, PcntChannelConfig, PcntControlMode, PcntCountMode, PcntDriver, PinIndex,
|
||||
};
|
||||
@ -42,12 +39,12 @@ use esp_idf_hal::prelude::Peripherals;
|
||||
use esp_idf_hal::reset::ResetReason;
|
||||
use esp_idf_svc::sntp::{self, SyncStatus};
|
||||
use esp_idf_svc::systime::EspSystemTime;
|
||||
use esp_idf_sys::{vTaskDelay, EspError, esp};
|
||||
use esp_idf_sys::{gpio_hold_dis, gpio_hold_en, vTaskDelay, EspError};
|
||||
use one_wire_bus::OneWire;
|
||||
|
||||
use crate::bq34z100::{Bq34Z100Error, Bq34z100g1, Bq34z100g1Driver};
|
||||
use crate::config::{self, Config, WifiConfig};
|
||||
use crate::STAY_ALIVE;
|
||||
use crate::bq34z100::{Bq34z100g1Driver, Bq34z100g1};
|
||||
|
||||
pub const PLANT_COUNT: usize = 8;
|
||||
const PINS_PER_PLANT: usize = 5;
|
||||
@ -61,6 +58,8 @@ const SPIFFS_PARTITION_NAME: &str = "storage";
|
||||
const WIFI_CONFIG_FILE: &str = "/spiffs/wifi.cfg";
|
||||
const CONFIG_FILE: &str = "/spiffs/config.cfg";
|
||||
|
||||
const TANK_MULTI_SAMPLE: usize = 11;
|
||||
|
||||
#[link_section = ".rtc.data"]
|
||||
static mut LAST_WATERING_TIMESTAMP: [i64; PLANT_COUNT] = [0; PLANT_COUNT];
|
||||
#[link_section = ".rtc.data"]
|
||||
@ -137,7 +136,7 @@ pub trait PlantCtrlBoardInteraction {
|
||||
|
||||
fn is_day(&self) -> bool;
|
||||
fn water_temperature_c(&mut self) -> Result<f32>;
|
||||
fn tank_sensor_mv(&mut self) -> Result<u16>;
|
||||
fn tank_sensor_percent(&mut self) -> Result<u16>;
|
||||
|
||||
fn set_low_voltage_in_cycle(&mut self);
|
||||
fn clear_low_voltage_in_cycle(&mut self);
|
||||
@ -202,7 +201,11 @@ pub struct PlantCtrlBoard<'a> {
|
||||
|
||||
impl PlantCtrlBoardInteraction for PlantCtrlBoard<'_> {
|
||||
fn battery_state(&mut self) -> Result<BatteryState> {
|
||||
Ok(BatteryState::default())
|
||||
let state = BatteryState {
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
Ok(state)
|
||||
}
|
||||
|
||||
fn is_day(&self) -> bool {
|
||||
@ -236,17 +239,45 @@ impl PlantCtrlBoardInteraction for PlantCtrlBoard<'_> {
|
||||
if sensor_data.temperature == 85_f32 {
|
||||
bail!("Ds18b20 dummy temperature returned");
|
||||
}
|
||||
Ok(sensor_data.temperature/10_f32)
|
||||
Ok(sensor_data.temperature / 10_f32)
|
||||
}
|
||||
|
||||
fn tank_sensor_mv(&mut self) -> Result<u16> {
|
||||
fn tank_sensor_percent(&mut self) -> Result<u16> {
|
||||
let delay = Delay::new_default();
|
||||
self.tank_power.set_high()?;
|
||||
//let stabilize
|
||||
delay.delay_ms(100);
|
||||
let value = self.tank_driver.read(&mut self.tank_channel)?;
|
||||
self.tank_power.set_low()?;
|
||||
Ok(value)
|
||||
unsafe {
|
||||
vTaskDelay(100);
|
||||
}
|
||||
|
||||
let mut store = [0_u16; TANK_MULTI_SAMPLE];
|
||||
for multisample in 0..TANK_MULTI_SAMPLE {
|
||||
let value = self.tank_driver.read(&mut self.tank_channel)?;
|
||||
store[multisample] = value;
|
||||
}
|
||||
store.sort();
|
||||
let median = store[6] as f32 / 1000_f32;
|
||||
let config_open_voltage_mv = 3.0;
|
||||
if config_open_voltage_mv < median {
|
||||
self.tank_power.set_low()?;
|
||||
bail!(
|
||||
"Tank sensor missing, open loop voltage {} on tank sensor input {}",
|
||||
config_open_voltage_mv,
|
||||
median
|
||||
);
|
||||
}
|
||||
|
||||
let r2 = median * 50.0 / (3.3 - median);
|
||||
let mut percent = r2 / 190_f32 * 100_f32;
|
||||
percent = percent.clamp(0.0, 100.0);
|
||||
|
||||
let quantizised = quantize_to_next_5_percent(percent as f64) as u16;
|
||||
println!(
|
||||
"Tank sensor raw {} percent {} quantized {}",
|
||||
median, percent, quantizised
|
||||
);
|
||||
return Ok(quantizised);
|
||||
}
|
||||
|
||||
fn set_low_voltage_in_cycle(&mut self) {
|
||||
@ -258,7 +289,9 @@ impl PlantCtrlBoardInteraction for PlantCtrlBoard<'_> {
|
||||
}
|
||||
|
||||
fn light(&mut self, enable: bool) -> Result<()> {
|
||||
unsafe { gpio_hold_dis(self.light.pin()) };
|
||||
self.light.set_state(enable.into())?;
|
||||
unsafe { gpio_hold_en(self.light.pin()) };
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@ -667,40 +700,69 @@ impl PlantCtrlBoardInteraction for PlantCtrlBoard<'_> {
|
||||
}
|
||||
}
|
||||
|
||||
fn print_battery(
|
||||
battery_driver: &mut Bq34z100g1Driver<I2cDriver, Delay>,
|
||||
) -> Result<(), Bq34Z100Error<I2cError>> {
|
||||
let fwversion = battery_driver.fw_version()?;
|
||||
println!("fw version is {}", fwversion);
|
||||
|
||||
let design_capacity = battery_driver.design_capacity()?;
|
||||
println!("Design Capacity {}", design_capacity);
|
||||
if design_capacity == 1000 {
|
||||
println!("Still stock configuring battery, readouts are likely to be wrong!");
|
||||
}
|
||||
|
||||
let flags = battery_driver.get_flags_decoded()?;
|
||||
println!("Flags {:?}", flags);
|
||||
|
||||
let chem_id = battery_driver.chem_id()?;
|
||||
let bat_temp = battery_driver.internal_temperature()?;
|
||||
let temp_c = Temperature::from_kelvin(bat_temp as f64 / 10_f64).as_celsius();
|
||||
let voltage = battery_driver.voltage()?;
|
||||
let current = battery_driver.current()?;
|
||||
let state = battery_driver.state_of_charge()?;
|
||||
let charge_voltage = battery_driver.charge_voltage()?;
|
||||
let charge_current = battery_driver.charge_current()?;
|
||||
println!("ChemId: {} Current voltage {} and current {} with charge {}% and temp {} CVolt: {} CCur {}", chem_id, voltage, current, state, temp_c, charge_voltage, charge_current);
|
||||
return Result::Ok(());
|
||||
}
|
||||
|
||||
impl CreatePlantHal<'_> for PlantHal {
|
||||
fn create() -> Result<Mutex<PlantCtrlBoard<'static>>> {
|
||||
let peripherals = Peripherals::take()?;
|
||||
|
||||
|
||||
let i2c = peripherals.i2c1;
|
||||
let config = I2cConfig::new()
|
||||
.scl_enable_pullup(false)
|
||||
.sda_enable_pullup(false)
|
||||
.baudrate(10_u32.kHz().into());
|
||||
.scl_enable_pullup(false)
|
||||
.sda_enable_pullup(false)
|
||||
.baudrate(10_u32.kHz().into());
|
||||
let scl = peripherals.pins.gpio16;
|
||||
let sda = peripherals.pins.gpio17;
|
||||
|
||||
|
||||
let driver = I2cDriver::new(i2c, sda, scl, &config).unwrap();
|
||||
let i2c_port = driver.port();
|
||||
let mut battery_driver :Bq34z100g1Driver<I2cDriver, Delay> = Bq34z100g1Driver{
|
||||
i2c :driver,
|
||||
|
||||
//let i2c_port = driver.port();
|
||||
//esp!(unsafe { esp_idf_sys::i2c_set_timeout(i2c_port, 1048000) }).unwrap();
|
||||
|
||||
let mut battery_driver: Bq34z100g1Driver<I2cDriver, Delay> = Bq34z100g1Driver {
|
||||
i2c: driver,
|
||||
delay: Delay::new_default(),
|
||||
flash_block_data : [0;32],
|
||||
};
|
||||
flash_block_data: [0; 32],
|
||||
};
|
||||
|
||||
let mut clock = PinDriver::input_output(peripherals.pins.gpio21)?;
|
||||
clock.set_pull(Pull::Floating);
|
||||
clock.set_pull(Pull::Floating).unwrap();
|
||||
let mut latch = PinDriver::input_output(peripherals.pins.gpio22)?;
|
||||
latch.set_pull(Pull::Floating);
|
||||
latch.set_pull(Pull::Floating).unwrap();
|
||||
let mut data = PinDriver::input_output(peripherals.pins.gpio19)?;
|
||||
data.set_pull(Pull::Floating);
|
||||
data.set_pull(Pull::Floating).unwrap();
|
||||
let shift_register = ShiftRegister40::new(clock.into(), latch.into(), data.into());
|
||||
for mut pin in shift_register.decompose() {
|
||||
pin.set_low().unwrap();
|
||||
}
|
||||
|
||||
let mut one_wire_pin = PinDriver::input_output_od(peripherals.pins.gpio4)?;
|
||||
one_wire_pin.set_pull(Pull::Floating);
|
||||
one_wire_pin.set_pull(Pull::Floating).unwrap();
|
||||
//TODO make to none if not possible to init
|
||||
|
||||
//init,reset rtc memory depending on cause
|
||||
@ -765,12 +827,15 @@ impl CreatePlantHal<'_> for PlantHal {
|
||||
let nvs = EspDefaultNvsPartition::take()?;
|
||||
let wifi_driver = EspWifi::new(peripherals.modem, sys_loop, Some(nvs))?;
|
||||
|
||||
|
||||
let last_watering_timestamp = Mutex::new(unsafe { LAST_WATERING_TIMESTAMP });
|
||||
let consecutive_watering_plant = Mutex::new(unsafe { CONSECUTIVE_WATERING_PLANT });
|
||||
let low_voltage_detected = Mutex::new(unsafe { LOW_VOLTAGE_DETECTED });
|
||||
let tank_driver =
|
||||
AdcDriver::new(peripherals.adc1, &esp_idf_hal::adc::config::Config::new())?;
|
||||
|
||||
let adc_config = esp_idf_hal::adc::config::Config {
|
||||
resolution: esp_idf_hal::adc::config::Resolution::Resolution12Bit,
|
||||
calibration: true,
|
||||
};
|
||||
let tank_driver = AdcDriver::new(peripherals.adc1, &adc_config)?;
|
||||
let tank_channel: AdcChannelDriver<'_, { attenuation::DB_11 }, Gpio39> =
|
||||
AdcChannelDriver::new(peripherals.pins.gpio39)?;
|
||||
|
||||
@ -779,8 +844,10 @@ impl CreatePlantHal<'_> for PlantHal {
|
||||
|
||||
let mut boot_button = PinDriver::input(peripherals.pins.gpio0)?;
|
||||
boot_button.set_pull(Pull::Floating)?;
|
||||
|
||||
let mut light = PinDriver::input_output(peripherals.pins.gpio26)?;
|
||||
light.set_pull(Pull::Floating)?;
|
||||
light.set_pull(Pull::Floating).unwrap();
|
||||
|
||||
let mut main_pump = PinDriver::input_output(peripherals.pins.gpio23)?;
|
||||
main_pump.set_pull(Pull::Floating)?;
|
||||
main_pump.set_low()?;
|
||||
@ -794,143 +861,10 @@ impl CreatePlantHal<'_> for PlantHal {
|
||||
|
||||
println!("After stuff");
|
||||
|
||||
esp!(unsafe { esp_idf_sys::i2c_set_timeout(i2c_port, 1048000) }).unwrap();
|
||||
|
||||
let fwversion = battery_driver.fw_version();
|
||||
println!("fw version is {}", fwversion);
|
||||
|
||||
let design_capacity = battery_driver.design_capacity();
|
||||
println!("Design Capacity {}", design_capacity);
|
||||
if(design_capacity == 1000){
|
||||
println!("Still stock configuring battery");
|
||||
let status = print_battery(&mut battery_driver);
|
||||
if status.is_err() {
|
||||
println!("Error communicating with battery!! {:?}", status.err());
|
||||
}
|
||||
|
||||
//battery_driver.update_design_capacity(5999);
|
||||
|
||||
|
||||
//let mut success = battery_driver.update_design_capacity(6000);
|
||||
//if (!success){
|
||||
// bail!("Error updating capacity");
|
||||
//}
|
||||
|
||||
//success = battery_driver.update_q_max(6000);
|
||||
//if (!success){
|
||||
// bail!("Error updating max q");
|
||||
//}
|
||||
|
||||
//let energy = 25600;
|
||||
//success = battery_driver.update_design_energy(energy, 3);
|
||||
//if (!success){
|
||||
// bail!("Error updating design energy");
|
||||
//}
|
||||
|
||||
//success = battery_driver.update_cell_charge_voltage_range(3650,3650,3650);
|
||||
//if (!success){
|
||||
// bail!("Error updating cell charge voltage");
|
||||
//}
|
||||
|
||||
//success = battery_driver.update_number_of_series_cells(4);
|
||||
//if (!success){
|
||||
// bail!("Error updating number of series");
|
||||
//}
|
||||
|
||||
//charge termination here
|
||||
|
||||
|
||||
|
||||
// //RESCAP CAL_EN SCALED RSVD VOLTSEL IWAKE RSNS1 RSNS0
|
||||
// //RFACTSTEP SLEEP RMFCC NiDT NiDV QPCCLEAR GNDSEL TEMPS
|
||||
// let mut conf: u16 = 0;
|
||||
// //RESCAP
|
||||
// conf.set_bit(15, true);
|
||||
// //CAL_EN
|
||||
// conf.set_bit(14, true);
|
||||
// //SCALED
|
||||
// conf.set_bit(13, false);
|
||||
// //RSVD
|
||||
// conf.set_bit(12, false);
|
||||
// //VOLTSEL
|
||||
// conf.set_bit(11, true);
|
||||
// //IWAKE
|
||||
// conf.set_bit(10, false);
|
||||
// //RSNS1
|
||||
// conf.set_bit(9, false);
|
||||
// //RSNS0
|
||||
// conf.set_bit(8, true);
|
||||
|
||||
// //RFACTSTEP
|
||||
// conf.set_bit(7, true);
|
||||
// //SLEEP
|
||||
// conf.set_bit(6, true);
|
||||
// //RMFCC
|
||||
// conf.set_bit(5, true);
|
||||
// //NiDT
|
||||
// conf.set_bit(4, false);
|
||||
// //NiDV
|
||||
// conf.set_bit(3, false);
|
||||
// //QPCCLEAR
|
||||
// conf.set_bit(2, false);
|
||||
// //GNDSEL
|
||||
// conf.set_bit(1, true);
|
||||
// //TEMPS
|
||||
// conf.set_bit(0, false);
|
||||
|
||||
|
||||
|
||||
// let mut success = battery_driver.update_pack_configuration(conf);
|
||||
// if (!success){
|
||||
// bail!("Error updating pack config");
|
||||
// }
|
||||
|
||||
// let mut success = battery_driver.update_charge_termination_parameters(100, 25, 100, 40, 99, 95, 100, 96);
|
||||
// if (!success){
|
||||
// bail!("Error updating pack config");
|
||||
// }
|
||||
|
||||
//calibration here
|
||||
|
||||
//println!("Cc offset");
|
||||
//battery_driver.calibrate_cc_offset();
|
||||
//println!("board offset");
|
||||
//battery_driver.calibrate_board_offset();
|
||||
//println!("voltage divider");
|
||||
//battery_driver.calibrate_voltage_divider(15000.0, 4);
|
||||
|
||||
//battery_driver.calibrate_sense_resistor(1530);
|
||||
//let mut data = 0_u8;
|
||||
//data.set_bit(0, true); //led mode
|
||||
//data.set_bit(1, false); // led mode
|
||||
//data.set_bit(2, false); //led mode
|
||||
|
||||
//data.set_bit(3, true); //led always on
|
||||
|
||||
|
||||
//battery_driver.set_led_mode(data);
|
||||
//battery_driver.unsealed();
|
||||
battery_driver.it_enable();
|
||||
|
||||
loop {
|
||||
|
||||
let flags = battery_driver.get_flags_decoded();
|
||||
println!("Flags {:?}", flags);
|
||||
|
||||
let chem_id = battery_driver.chem_id();
|
||||
let bat_temp = battery_driver.internal_temperature();
|
||||
let temp_c = Temperature::from_kelvin(bat_temp as f64/10_f64).as_celsius();
|
||||
let voltage = battery_driver.voltage();
|
||||
let current = battery_driver.current();
|
||||
let state = battery_driver.state_of_charge();
|
||||
let charge_voltage = battery_driver.charge_voltage();
|
||||
let charge_current = battery_driver.charge_current();
|
||||
println!("ChemId: {} Current voltage {} and current {} with charge {}% and temp {} CVolt: {} CCur {}", chem_id, voltage, current, state, temp_c, charge_voltage, charge_current);
|
||||
|
||||
unsafe{
|
||||
vTaskDelay(1000);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
let rv = Mutex::new(PlantCtrlBoard {
|
||||
shift_register,
|
||||
last_watering_timestamp,
|
||||
@ -952,3 +886,21 @@ impl CreatePlantHal<'_> for PlantHal {
|
||||
Ok(rv)
|
||||
}
|
||||
}
|
||||
|
||||
fn quantize_to_next_5_percent(value: f64) -> i32 {
|
||||
// Multiply by 100 to work with integer values
|
||||
let multiplied_value = (value * 100.0).round() as i32;
|
||||
|
||||
// Calculate the remainder when divided by 5
|
||||
let remainder = multiplied_value % 5;
|
||||
|
||||
// If the remainder is greater than or equal to half of 5, round up to the next 5%
|
||||
let rounded_value = if remainder >= 2 {
|
||||
multiplied_value + (5 - remainder)
|
||||
} else {
|
||||
multiplied_value - remainder
|
||||
};
|
||||
|
||||
// Divide by 100 to get back to a float
|
||||
rounded_value / 100
|
||||
}
|
||||
|
@ -43,12 +43,12 @@
|
||||
Tank Warn below mL
|
||||
</div>
|
||||
<div>
|
||||
<input type="number" min="1" max="500000" id="tank_empty_mv">
|
||||
Tank Empty Voltage (mv)
|
||||
<input type="number" min="0" max="100" id="tank_empty_percent">
|
||||
Tank Empty Percent (% max move)
|
||||
</div>
|
||||
<div>
|
||||
<input type="number" min="1" max="500000" id="tank_full_mv">
|
||||
Tank Full Voltage (mv)
|
||||
<input type="number" min="0" max="100" id="tank_full_percent">
|
||||
Tank Full Percent (% max move)
|
||||
</div>
|
||||
|
||||
<h3>Light:</h3>
|
||||
|
@ -5,8 +5,8 @@ interface PlantConfig {
|
||||
tank_allow_pumping_if_sensor_error: boolean,
|
||||
tank_useable_ml: number,
|
||||
tank_warn_percent: number,
|
||||
tank_empty_mv: number,
|
||||
tank_full_mv: number,
|
||||
tank_empty_percent: number,
|
||||
tank_full_percent: number,
|
||||
night_lamp_hour_start: number,
|
||||
night_lamp_hour_end: number,
|
||||
night_lamp_only_when_dark: boolean,
|
||||
@ -46,10 +46,10 @@ let fromWrapper = (() => {
|
||||
|
||||
let tank_useable_ml = document.getElementById("tank_useable_ml") as HTMLInputElement;
|
||||
tank_useable_ml.onchange = updateJson
|
||||
let tank_empty_mv = document.getElementById("tank_empty_mv") as HTMLInputElement;
|
||||
tank_empty_mv.onchange = updateJson
|
||||
let tank_full_mv = document.getElementById("tank_full_mv") as HTMLInputElement;
|
||||
tank_full_mv.onchange = updateJson
|
||||
let tank_empty_percent = document.getElementById("tank_empty_percent") as HTMLInputElement;
|
||||
tank_empty_percent.onchange = updateJson
|
||||
let tank_full_percent = document.getElementById("tank_full_percent") as HTMLInputElement;
|
||||
tank_full_percent.onchange = updateJson
|
||||
let tank_warn_percent = document.getElementById("tank_warn_percent") as HTMLInputElement;
|
||||
tank_warn_percent.onchange = updateJson
|
||||
let tank_sensor_enabled = document.getElementById("tank_sensor_enabled") as HTMLInputElement;
|
||||
@ -189,8 +189,8 @@ let fromWrapper = (() => {
|
||||
tank_allow_pumping_if_sensor_error.checked = current.tank_allow_pumping_if_sensor_error;
|
||||
tank_useable_ml.value = current.tank_useable_ml.toString();
|
||||
tank_warn_percent.value = current.tank_warn_percent.toString();
|
||||
tank_empty_mv.value = current.tank_empty_mv.toString();
|
||||
tank_full_mv.value = current.tank_full_mv.toString();
|
||||
tank_empty_percent.value = current.tank_empty_percent.toString();
|
||||
tank_full_percent.value = current.tank_full_percent.toString();
|
||||
|
||||
night_lamp_time_start.value = current.night_lamp_hour_start.toString();
|
||||
night_lamp_time_end.value = current.night_lamp_hour_end.toString();
|
||||
@ -220,8 +220,8 @@ let fromWrapper = (() => {
|
||||
tank_sensor_enabled: tank_sensor_enabled.checked,
|
||||
tank_useable_ml: +tank_useable_ml.value,
|
||||
tank_warn_percent: +tank_warn_percent.value,
|
||||
tank_empty_mv: +tank_empty_mv.value,
|
||||
tank_full_mv: +tank_full_mv.value,
|
||||
tank_empty_percent: +tank_empty_percent.value,
|
||||
tank_full_percent: +tank_full_percent.value,
|
||||
night_lamp_hour_start: +night_lamp_time_start.value,
|
||||
night_lamp_hour_end: +night_lamp_time_end.value,
|
||||
night_lamp_only_when_dark: night_lamp_only_when_dark.checked,
|
||||
|
Loading…
Reference in New Issue
Block a user