Merge branch 'master' of github.com:0110/PlantCtrl

This commit is contained in:
Ollo 2021-10-01 21:40:41 +02:00
commit e913ff462e
48 changed files with 126205 additions and 6141 deletions

11
board/PlantCtrlESP32.erc Normal file
View File

@ -0,0 +1,11 @@
ERC report (Thu 10 Jun 2021 11:02:23 PM CEST, Encoding UTF8 )
***** Sheet /
ErrType(3): Pin connected to other pins, but not driven by any pin
@(476.25 mm, 236.22 mm): Pin 3 (Power input) of component U6 is not driven (Net 13).
ErrType(3): Pin connected to other pins, but not driven by any pin
@(71.12 mm, 154.94 mm): Pin 4 (Power input) of component U3 is not driven (Net 25).
ErrType(3): Pin connected to other pins, but not driven by any pin
@(558.80 mm, 274.32 mm): Pin 5 (Power input) of component U2 is not driven (Net 28).
** ERC messages: 3 Errors 0 Warnings 3

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
update=Fri 27 Nov 2020 08:17:47 PM CET
update=Thu 10 Jun 2021 10:17:33 PM CEST
version=1
last_client=kicad
[general]
@ -44,8 +44,10 @@ TrackWidth3=0.5
TrackWidth4=1
ViaDiameter1=0.8
ViaDrill1=0.4
ViaDiameter2=4
ViaDrill2=3
ViaDiameter2=1.2
ViaDrill2=0.8
ViaDiameter3=4
ViaDrill3=3
dPairWidth1=0.2
dPairGap1=0.25
dPairViaGap1=0.25

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,15 @@
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.10*
G04 #@! TF.CreationDate,2021-06-10T23:09:58+02:00*
G04 #@! TF.ProjectId,PlantCtrlESP32,506c616e-7443-4747-926c-45535033322e,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Glue,Bot*
G04 #@! TF.FilePolarity,Positive*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 5.1.10) date 2021-06-10 23:09:58*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 APERTURE END LIST*
M02*

View File

@ -0,0 +1,32 @@
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.10*
G04 #@! TF.CreationDate,2021-06-10T23:09:58+02:00*
G04 #@! TF.ProjectId,PlantCtrlESP32,506c616e-7443-4747-926c-45535033322e,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Other,User*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 5.1.10) date 2021-06-10 23:09:58*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
%ADD10C,0.050000*%
G04 APERTURE END LIST*
D10*
X237729200Y-51267800D02*
X237729200Y-60847800D01*
X237729200Y-51267800D02*
X242229200Y-51267800D01*
X242229200Y-60847800D02*
X237729200Y-60847800D01*
X242229200Y-60847800D02*
X242229200Y-51267800D01*
X231560800Y-64114800D02*
X223160800Y-64114800D01*
X231560800Y-57364800D02*
X231560800Y-64114800D01*
X223160800Y-57364800D02*
X231560800Y-57364800D01*
X223160800Y-64114800D02*
X223160800Y-57364800D01*
M02*

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,425 @@
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.10*
G04 #@! TF.CreationDate,2021-06-10T23:09:58+02:00*
G04 #@! TF.ProjectId,PlantCtrlESP32,506c616e-7443-4747-926c-45535033322e,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Other,Fab,Bot*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 5.1.10) date 2021-06-10 23:09:58*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
%ADD10C,0.100000*%
%ADD11C,0.150000*%
G04 APERTURE END LIST*
D10*
X226110800Y-62614800D02*
X226735800Y-63614800D01*
X225485800Y-63614800D02*
X226110800Y-62614800D01*
X231060800Y-63614800D02*
X223660800Y-63614800D01*
X231060800Y-57864800D02*
X231060800Y-63614800D01*
X223660800Y-57864800D02*
X231060800Y-57864800D01*
X223660800Y-63614800D02*
X223660800Y-57864800D01*
D11*
X235812057Y-62843514D02*
X235764438Y-62891133D01*
X235716819Y-63033990D01*
X235716819Y-63129228D01*
X235764438Y-63272085D01*
X235859676Y-63367323D01*
X235954914Y-63414942D01*
X236145390Y-63462561D01*
X236288247Y-63462561D01*
X236478723Y-63414942D01*
X236573961Y-63367323D01*
X236669200Y-63272085D01*
X236716819Y-63129228D01*
X236716819Y-63033990D01*
X236669200Y-62891133D01*
X236621580Y-62843514D01*
X235716819Y-62272085D02*
X235764438Y-62367323D01*
X235812057Y-62414942D01*
X235907295Y-62462561D01*
X236193009Y-62462561D01*
X236288247Y-62414942D01*
X236335866Y-62367323D01*
X236383485Y-62272085D01*
X236383485Y-62129228D01*
X236335866Y-62033990D01*
X236288247Y-61986371D01*
X236193009Y-61938752D01*
X235907295Y-61938752D01*
X235812057Y-61986371D01*
X235764438Y-62033990D01*
X235716819Y-62129228D01*
X235716819Y-62272085D01*
X236383485Y-61510180D02*
X235716819Y-61510180D01*
X236288247Y-61510180D02*
X236335866Y-61462561D01*
X236383485Y-61367323D01*
X236383485Y-61224466D01*
X236335866Y-61129228D01*
X236240628Y-61081609D01*
X235716819Y-61081609D01*
X236383485Y-60605419D02*
X235716819Y-60605419D01*
X236288247Y-60605419D02*
X236335866Y-60557800D01*
X236383485Y-60462561D01*
X236383485Y-60319704D01*
X236335866Y-60224466D01*
X236240628Y-60176847D01*
X235716819Y-60176847D01*
X235621580Y-59938752D02*
X235621580Y-59176847D01*
X236716819Y-58748276D02*
X236716819Y-58653038D01*
X236669200Y-58557800D01*
X236621580Y-58510180D01*
X236526342Y-58462561D01*
X236335866Y-58414942D01*
X236097771Y-58414942D01*
X235907295Y-58462561D01*
X235812057Y-58510180D01*
X235764438Y-58557800D01*
X235716819Y-58653038D01*
X235716819Y-58748276D01*
X235764438Y-58843514D01*
X235812057Y-58891133D01*
X235907295Y-58938752D01*
X236097771Y-58986371D01*
X236335866Y-58986371D01*
X236526342Y-58938752D01*
X236621580Y-58891133D01*
X236669200Y-58843514D01*
X236716819Y-58748276D01*
X235716819Y-57462561D02*
X235716819Y-58033990D01*
X235716819Y-57748276D02*
X236716819Y-57748276D01*
X236573961Y-57843514D01*
X236478723Y-57938752D01*
X236431104Y-58033990D01*
X235716819Y-57129228D02*
X236383485Y-56605419D01*
X236383485Y-57129228D02*
X235716819Y-56605419D01*
X236716819Y-56033990D02*
X236716819Y-55938752D01*
X236669200Y-55843514D01*
X236621580Y-55795895D01*
X236526342Y-55748276D01*
X236335866Y-55700657D01*
X236097771Y-55700657D01*
X235907295Y-55748276D01*
X235812057Y-55795895D01*
X235764438Y-55843514D01*
X235716819Y-55938752D01*
X235716819Y-56033990D01*
X235764438Y-56129228D01*
X235812057Y-56176847D01*
X235907295Y-56224466D01*
X236097771Y-56272085D01*
X236335866Y-56272085D01*
X236526342Y-56224466D01*
X236621580Y-56176847D01*
X236669200Y-56129228D01*
X236716819Y-56033990D01*
X236621580Y-55319704D02*
X236669200Y-55272085D01*
X236716819Y-55176847D01*
X236716819Y-54938752D01*
X236669200Y-54843514D01*
X236621580Y-54795895D01*
X236526342Y-54748276D01*
X236431104Y-54748276D01*
X236288247Y-54795895D01*
X235716819Y-55367323D01*
X235716819Y-54748276D01*
X235621580Y-54557800D02*
X235621580Y-53795895D01*
X236240628Y-53224466D02*
X236240628Y-53557800D01*
X235716819Y-53557800D02*
X236716819Y-53557800D01*
X236716819Y-53081609D01*
X235764438Y-52319704D02*
X235716819Y-52414942D01*
X235716819Y-52605419D01*
X235764438Y-52700657D01*
X235859676Y-52748276D01*
X236240628Y-52748276D01*
X236335866Y-52700657D01*
X236383485Y-52605419D01*
X236383485Y-52414942D01*
X236335866Y-52319704D01*
X236240628Y-52272085D01*
X236145390Y-52272085D01*
X236050152Y-52748276D01*
X235716819Y-51843514D02*
X236383485Y-51843514D01*
X236288247Y-51843514D02*
X236335866Y-51795895D01*
X236383485Y-51700657D01*
X236383485Y-51557800D01*
X236335866Y-51462561D01*
X236240628Y-51414942D01*
X235716819Y-51414942D01*
X236240628Y-51414942D02*
X236335866Y-51367323D01*
X236383485Y-51272085D01*
X236383485Y-51129228D01*
X236335866Y-51033990D01*
X236240628Y-50986371D01*
X235716819Y-50986371D01*
X235716819Y-50081609D02*
X236240628Y-50081609D01*
X236335866Y-50129228D01*
X236383485Y-50224466D01*
X236383485Y-50414942D01*
X236335866Y-50510180D01*
X235764438Y-50081609D02*
X235716819Y-50176847D01*
X235716819Y-50414942D01*
X235764438Y-50510180D01*
X235859676Y-50557800D01*
X235954914Y-50557800D01*
X236050152Y-50510180D01*
X236097771Y-50414942D01*
X236097771Y-50176847D01*
X236145390Y-50081609D01*
X235716819Y-49462561D02*
X235764438Y-49557800D01*
X235859676Y-49605419D01*
X236716819Y-49605419D01*
X235764438Y-48700657D02*
X235716819Y-48795895D01*
X235716819Y-48986371D01*
X235764438Y-49081609D01*
X235859676Y-49129228D01*
X236240628Y-49129228D01*
X236335866Y-49081609D01*
X236383485Y-48986371D01*
X236383485Y-48795895D01*
X236335866Y-48700657D01*
X236240628Y-48653038D01*
X236145390Y-48653038D01*
X236050152Y-49129228D01*
X239526819Y-57486371D02*
X239526819Y-57962561D01*
X240526819Y-57962561D01*
X239526819Y-57153038D02*
X240526819Y-57153038D01*
X239526819Y-56676847D02*
X240526819Y-56676847D01*
X240526819Y-56295895D01*
X240479200Y-56200657D01*
X240431580Y-56153038D01*
X240336342Y-56105419D01*
X240193485Y-56105419D01*
X240098247Y-56153038D01*
X240050628Y-56200657D01*
X240003009Y-56295895D01*
X240003009Y-56676847D01*
X240526819Y-55486371D02*
X240526819Y-55295895D01*
X240479200Y-55200657D01*
X240383961Y-55105419D01*
X240193485Y-55057800D01*
X239860152Y-55057800D01*
X239669676Y-55105419D01*
X239574438Y-55200657D01*
X239526819Y-55295895D01*
X239526819Y-55486371D01*
X239574438Y-55581609D01*
X239669676Y-55676847D01*
X239860152Y-55724466D01*
X240193485Y-55724466D01*
X240383961Y-55676847D01*
X240479200Y-55581609D01*
X240526819Y-55486371D01*
X239526819Y-54105419D02*
X239526819Y-54676847D01*
X239526819Y-54391133D02*
X240526819Y-54391133D01*
X240383961Y-54486371D01*
X240288723Y-54581609D01*
X240241104Y-54676847D01*
X231098895Y-57021942D02*
X231146514Y-57069561D01*
X231289371Y-57117180D01*
X231384609Y-57117180D01*
X231527466Y-57069561D01*
X231622704Y-56974323D01*
X231670323Y-56879085D01*
X231717942Y-56688609D01*
X231717942Y-56545752D01*
X231670323Y-56355276D01*
X231622704Y-56260038D01*
X231527466Y-56164800D01*
X231384609Y-56117180D01*
X231289371Y-56117180D01*
X231146514Y-56164800D01*
X231098895Y-56212419D01*
X230527466Y-57117180D02*
X230622704Y-57069561D01*
X230670323Y-57021942D01*
X230717942Y-56926704D01*
X230717942Y-56640990D01*
X230670323Y-56545752D01*
X230622704Y-56498133D01*
X230527466Y-56450514D01*
X230384609Y-56450514D01*
X230289371Y-56498133D01*
X230241752Y-56545752D01*
X230194133Y-56640990D01*
X230194133Y-56926704D01*
X230241752Y-57021942D01*
X230289371Y-57069561D01*
X230384609Y-57117180D01*
X230527466Y-57117180D01*
X229765561Y-56450514D02*
X229765561Y-57117180D01*
X229765561Y-56545752D02*
X229717942Y-56498133D01*
X229622704Y-56450514D01*
X229479847Y-56450514D01*
X229384609Y-56498133D01*
X229336990Y-56593371D01*
X229336990Y-57117180D01*
X228860800Y-56450514D02*
X228860800Y-57117180D01*
X228860800Y-56545752D02*
X228813180Y-56498133D01*
X228717942Y-56450514D01*
X228575085Y-56450514D01*
X228479847Y-56498133D01*
X228432228Y-56593371D01*
X228432228Y-57117180D01*
X228194133Y-57212419D02*
X227432228Y-57212419D01*
X227003657Y-56117180D02*
X226908419Y-56117180D01*
X226813180Y-56164800D01*
X226765561Y-56212419D01*
X226717942Y-56307657D01*
X226670323Y-56498133D01*
X226670323Y-56736228D01*
X226717942Y-56926704D01*
X226765561Y-57021942D01*
X226813180Y-57069561D01*
X226908419Y-57117180D01*
X227003657Y-57117180D01*
X227098895Y-57069561D01*
X227146514Y-57021942D01*
X227194133Y-56926704D01*
X227241752Y-56736228D01*
X227241752Y-56498133D01*
X227194133Y-56307657D01*
X227146514Y-56212419D01*
X227098895Y-56164800D01*
X227003657Y-56117180D01*
X225717942Y-57117180D02*
X226289371Y-57117180D01*
X226003657Y-57117180D02*
X226003657Y-56117180D01*
X226098895Y-56260038D01*
X226194133Y-56355276D01*
X226289371Y-56402895D01*
X225384609Y-57117180D02*
X224860800Y-56450514D01*
X225384609Y-56450514D02*
X224860800Y-57117180D01*
X224289371Y-56117180D02*
X224194133Y-56117180D01*
X224098895Y-56164800D01*
X224051276Y-56212419D01*
X224003657Y-56307657D01*
X223956038Y-56498133D01*
X223956038Y-56736228D01*
X224003657Y-56926704D01*
X224051276Y-57021942D01*
X224098895Y-57069561D01*
X224194133Y-57117180D01*
X224289371Y-57117180D01*
X224384609Y-57069561D01*
X224432228Y-57021942D01*
X224479847Y-56926704D01*
X224527466Y-56736228D01*
X224527466Y-56498133D01*
X224479847Y-56307657D01*
X224432228Y-56212419D01*
X224384609Y-56164800D01*
X224289371Y-56117180D01*
X223575085Y-56212419D02*
X223527466Y-56164800D01*
X223432228Y-56117180D01*
X223194133Y-56117180D01*
X223098895Y-56164800D01*
X223051276Y-56212419D01*
X223003657Y-56307657D01*
X223003657Y-56402895D01*
X223051276Y-56545752D01*
X223622704Y-57117180D01*
X223003657Y-57117180D01*
X230860800Y-58493371D02*
X230527466Y-58493371D01*
X230384609Y-59017180D02*
X230860800Y-59017180D01*
X230860800Y-58017180D01*
X230384609Y-58017180D01*
X230051276Y-58017180D02*
X229384609Y-59017180D01*
X229384609Y-58017180D02*
X230051276Y-59017180D01*
X229146514Y-58017180D02*
X228575085Y-58017180D01*
X228860800Y-59017180D02*
X228860800Y-58017180D01*
X228479847Y-59112419D02*
X227717942Y-59112419D01*
X227479847Y-59017180D02*
X227479847Y-58017180D01*
X227098895Y-58017180D01*
X227003657Y-58064800D01*
X226956038Y-58112419D01*
X226908419Y-58207657D01*
X226908419Y-58350514D01*
X226956038Y-58445752D01*
X227003657Y-58493371D01*
X227098895Y-58540990D01*
X227479847Y-58540990D01*
X226575085Y-58017180D02*
X226336990Y-59017180D01*
X226146514Y-58302895D01*
X225956038Y-59017180D01*
X225717942Y-58017180D01*
X224765561Y-59017180D02*
X225098895Y-58540990D01*
X225336990Y-59017180D02*
X225336990Y-58017180D01*
X224956038Y-58017180D01*
X224860800Y-58064800D01*
X224813180Y-58112419D01*
X224765561Y-58207657D01*
X224765561Y-58350514D01*
X224813180Y-58445752D01*
X224860800Y-58493371D01*
X224956038Y-58540990D01*
X225336990Y-58540990D01*
X223813180Y-59017180D02*
X224384609Y-59017180D01*
X224098895Y-59017180D02*
X224098895Y-58017180D01*
X224194133Y-58160038D01*
X224289371Y-58255276D01*
X224384609Y-58302895D01*
M02*

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,15 @@
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.10*
G04 #@! TF.CreationDate,2021-06-10T23:09:58+02:00*
G04 #@! TF.ProjectId,PlantCtrlESP32,506c616e-7443-4747-926c-45535033322e,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Paste,Bot*
G04 #@! TF.FilePolarity,Positive*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 5.1.10) date 2021-06-10 23:09:58*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 APERTURE END LIST*
M02*

View File

@ -0,0 +1,436 @@
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.10*
G04 #@! TF.CreationDate,2021-06-10T23:09:58+02:00*
G04 #@! TF.ProjectId,PlantCtrlESP32,506c616e-7443-4747-926c-45535033322e,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Legend,Bot*
G04 #@! TF.FilePolarity,Positive*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 5.1.10) date 2021-06-10 23:09:58*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
%ADD10C,0.500000*%
%ADD11C,0.120000*%
%ADD12C,0.150000*%
G04 APERTURE END LIST*
D10*
X237963476Y-80549523D02*
X237963476Y-76549523D01*
X236439666Y-76549523D01*
X236058714Y-76740000D01*
X235868238Y-76930476D01*
X235677761Y-77311428D01*
X235677761Y-77882857D01*
X235868238Y-78263809D01*
X236058714Y-78454285D01*
X236439666Y-78644761D01*
X237963476Y-78644761D01*
X233392047Y-80549523D02*
X233773000Y-80359047D01*
X233963476Y-79978095D01*
X233963476Y-76549523D01*
X230153952Y-80549523D02*
X230153952Y-78454285D01*
X230344428Y-78073333D01*
X230725380Y-77882857D01*
X231487285Y-77882857D01*
X231868238Y-78073333D01*
X230153952Y-80359047D02*
X230534904Y-80549523D01*
X231487285Y-80549523D01*
X231868238Y-80359047D01*
X232058714Y-79978095D01*
X232058714Y-79597142D01*
X231868238Y-79216190D01*
X231487285Y-79025714D01*
X230534904Y-79025714D01*
X230153952Y-78835238D01*
X228249190Y-77882857D02*
X228249190Y-80549523D01*
X228249190Y-78263809D02*
X228058714Y-78073333D01*
X227677761Y-77882857D01*
X227106333Y-77882857D01*
X226725380Y-78073333D01*
X226534904Y-78454285D01*
X226534904Y-80549523D01*
X225201571Y-77882857D02*
X223677761Y-77882857D01*
X224630142Y-76549523D02*
X224630142Y-79978095D01*
X224439666Y-80359047D01*
X224058714Y-80549523D01*
X223677761Y-80549523D01*
X220058714Y-80168571D02*
X220249190Y-80359047D01*
X220820619Y-80549523D01*
X221201571Y-80549523D01*
X221773000Y-80359047D01*
X222153952Y-79978095D01*
X222344428Y-79597142D01*
X222534904Y-78835238D01*
X222534904Y-78263809D01*
X222344428Y-77501904D01*
X222153952Y-77120952D01*
X221773000Y-76740000D01*
X221201571Y-76549523D01*
X220820619Y-76549523D01*
X220249190Y-76740000D01*
X220058714Y-76930476D01*
X218915857Y-77882857D02*
X217392047Y-77882857D01*
X218344428Y-76549523D02*
X218344428Y-79978095D01*
X218153952Y-80359047D01*
X217773000Y-80549523D01*
X217392047Y-80549523D01*
X216058714Y-80549523D02*
X216058714Y-77882857D01*
X216058714Y-78644761D02*
X215868238Y-78263809D01*
X215677761Y-78073333D01*
X215296809Y-77882857D01*
X214915857Y-77882857D01*
X213011095Y-80549523D02*
X213392047Y-80359047D01*
X213582523Y-79978095D01*
X213582523Y-76549523D01*
X209011095Y-76549523D02*
X207677761Y-80549523D01*
X206344428Y-76549523D01*
X204249190Y-76549523D02*
X203868238Y-76549523D01*
X203487285Y-76740000D01*
X203296809Y-76930476D01*
X203106333Y-77311428D01*
X202915857Y-78073333D01*
X202915857Y-79025714D01*
X203106333Y-79787619D01*
X203296809Y-80168571D01*
X203487285Y-80359047D01*
X203868238Y-80549523D01*
X204249190Y-80549523D01*
X204630142Y-80359047D01*
X204820619Y-80168571D01*
X205011095Y-79787619D01*
X205201571Y-79025714D01*
X205201571Y-78073333D01*
X205011095Y-77311428D01*
X204820619Y-76930476D01*
X204630142Y-76740000D01*
X204249190Y-76549523D01*
X201201571Y-80168571D02*
X201011095Y-80359047D01*
X201201571Y-80549523D01*
X201392047Y-80359047D01*
X201201571Y-80168571D01*
X201201571Y-80549523D01*
X197201571Y-80549523D02*
X199487285Y-80549523D01*
X198344428Y-80549523D02*
X198344428Y-76549523D01*
X198725380Y-77120952D01*
X199106333Y-77501904D01*
X199487285Y-77692380D01*
X194725380Y-76549523D02*
X194344428Y-76549523D01*
X193963476Y-76740000D01*
X193773000Y-76930476D01*
X193582523Y-77311428D01*
X193392047Y-78073333D01*
X193392047Y-79025714D01*
X193582523Y-79787619D01*
X193773000Y-80168571D01*
X193963476Y-80359047D01*
X194344428Y-80549523D01*
X194725380Y-80549523D01*
X195106333Y-80359047D01*
X195296809Y-80168571D01*
X195487285Y-79787619D01*
X195677761Y-79025714D01*
X195677761Y-78073333D01*
X195487285Y-77311428D01*
X195296809Y-76930476D01*
X195106333Y-76740000D01*
X194725380Y-76549523D01*
D11*
X223260800Y-64014800D02*
X223260800Y-62764800D01*
X224510800Y-64014800D02*
X223260800Y-64014800D01*
X230410800Y-58514800D02*
X227360800Y-58514800D01*
X230410800Y-61464800D02*
X230410800Y-58514800D01*
X231160800Y-61464800D02*
X230410800Y-61464800D01*
X224310800Y-58514800D02*
X227360800Y-58514800D01*
X224310800Y-61464800D02*
X224310800Y-58514800D01*
X223560800Y-61464800D02*
X224310800Y-61464800D01*
X231160800Y-63714800D02*
X229360800Y-63714800D01*
X231160800Y-62964800D02*
X231160800Y-63714800D01*
X229360800Y-62964800D02*
X231160800Y-62964800D01*
X229360800Y-63714800D02*
X229360800Y-62964800D01*
X225360800Y-63714800D02*
X223560800Y-63714800D01*
X225360800Y-62964800D02*
X225360800Y-63714800D01*
X223560800Y-62964800D02*
X225360800Y-62964800D01*
X223560800Y-63714800D02*
X223560800Y-62964800D01*
X227860800Y-63714800D02*
X226860800Y-63714800D01*
X227860800Y-62964800D02*
X227860800Y-63714800D01*
X226860800Y-62964800D02*
X227860800Y-62964800D01*
X226860800Y-63714800D02*
X226860800Y-62964800D01*
X231170800Y-63724800D02*
X223550800Y-63724800D01*
X231170800Y-57754800D02*
X231170800Y-63724800D01*
X223550800Y-57754800D02*
X231170800Y-57754800D01*
X223550800Y-63724800D02*
X223550800Y-57754800D01*
D12*
X185356285Y-137866380D02*
X185689619Y-137390190D01*
X185927714Y-137866380D02*
X185927714Y-136866380D01*
X185546761Y-136866380D01*
X185451523Y-136914000D01*
X185403904Y-136961619D01*
X185356285Y-137056857D01*
X185356285Y-137199714D01*
X185403904Y-137294952D01*
X185451523Y-137342571D01*
X185546761Y-137390190D01*
X185927714Y-137390190D01*
X184546761Y-137818761D02*
X184642000Y-137866380D01*
X184832476Y-137866380D01*
X184927714Y-137818761D01*
X184975333Y-137723523D01*
X184975333Y-137342571D01*
X184927714Y-137247333D01*
X184832476Y-137199714D01*
X184642000Y-137199714D01*
X184546761Y-137247333D01*
X184499142Y-137342571D01*
X184499142Y-137437809D01*
X184975333Y-137533047D01*
X184118190Y-137818761D02*
X184022952Y-137866380D01*
X183832476Y-137866380D01*
X183737238Y-137818761D01*
X183689619Y-137723523D01*
X183689619Y-137675904D01*
X183737238Y-137580666D01*
X183832476Y-137533047D01*
X183975333Y-137533047D01*
X184070571Y-137485428D01*
X184118190Y-137390190D01*
X184118190Y-137342571D01*
X184070571Y-137247333D01*
X183975333Y-137199714D01*
X183832476Y-137199714D01*
X183737238Y-137247333D01*
X182880095Y-137818761D02*
X182975333Y-137866380D01*
X183165809Y-137866380D01*
X183261047Y-137818761D01*
X183308666Y-137723523D01*
X183308666Y-137342571D01*
X183261047Y-137247333D01*
X183165809Y-137199714D01*
X182975333Y-137199714D01*
X182880095Y-137247333D01*
X182832476Y-137342571D01*
X182832476Y-137437809D01*
X183308666Y-137533047D01*
X182546761Y-137199714D02*
X182165809Y-137199714D01*
X182403904Y-136866380D02*
X182403904Y-137723523D01*
X182356285Y-137818761D01*
X182261047Y-137866380D01*
X182165809Y-137866380D01*
X181308666Y-137866380D02*
X181880095Y-137866380D01*
X181594380Y-137866380D02*
X181594380Y-136866380D01*
X181689619Y-137009238D01*
X181784857Y-137104476D01*
X181880095Y-137152095D01*
X197683238Y-137596571D02*
X197540380Y-137644190D01*
X197492761Y-137691809D01*
X197445142Y-137787047D01*
X197445142Y-137929904D01*
X197492761Y-138025142D01*
X197540380Y-138072761D01*
X197635619Y-138120380D01*
X198016571Y-138120380D01*
X198016571Y-137120380D01*
X197683238Y-137120380D01*
X197588000Y-137168000D01*
X197540380Y-137215619D01*
X197492761Y-137310857D01*
X197492761Y-137406095D01*
X197540380Y-137501333D01*
X197588000Y-137548952D01*
X197683238Y-137596571D01*
X198016571Y-137596571D01*
X196873714Y-138120380D02*
X196968952Y-138072761D01*
X197016571Y-138025142D01*
X197064190Y-137929904D01*
X197064190Y-137644190D01*
X197016571Y-137548952D01*
X196968952Y-137501333D01*
X196873714Y-137453714D01*
X196730857Y-137453714D01*
X196635619Y-137501333D01*
X196588000Y-137548952D01*
X196540380Y-137644190D01*
X196540380Y-137929904D01*
X196588000Y-138025142D01*
X196635619Y-138072761D01*
X196730857Y-138120380D01*
X196873714Y-138120380D01*
X195968952Y-138120380D02*
X196064190Y-138072761D01*
X196111809Y-138025142D01*
X196159428Y-137929904D01*
X196159428Y-137644190D01*
X196111809Y-137548952D01*
X196064190Y-137501333D01*
X195968952Y-137453714D01*
X195826095Y-137453714D01*
X195730857Y-137501333D01*
X195683238Y-137548952D01*
X195635619Y-137644190D01*
X195635619Y-137929904D01*
X195683238Y-138025142D01*
X195730857Y-138072761D01*
X195826095Y-138120380D01*
X195968952Y-138120380D01*
X195349904Y-137453714D02*
X194968952Y-137453714D01*
X195207047Y-137120380D02*
X195207047Y-137977523D01*
X195159428Y-138072761D01*
X195064190Y-138120380D01*
X194968952Y-138120380D01*
X194111809Y-138120380D02*
X194683238Y-138120380D01*
X194397523Y-138120380D02*
X194397523Y-137120380D01*
X194492761Y-137263238D01*
X194588000Y-137358476D01*
X194683238Y-137406095D01*
X243336819Y-57486371D02*
X243336819Y-57962561D01*
X244336819Y-57962561D01*
X243336819Y-57153038D02*
X244336819Y-57153038D01*
X243336819Y-56676847D02*
X244336819Y-56676847D01*
X244336819Y-56295895D01*
X244289200Y-56200657D01*
X244241580Y-56153038D01*
X244146342Y-56105419D01*
X244003485Y-56105419D01*
X243908247Y-56153038D01*
X243860628Y-56200657D01*
X243813009Y-56295895D01*
X243813009Y-56676847D01*
X244336819Y-55486371D02*
X244336819Y-55295895D01*
X244289200Y-55200657D01*
X244193961Y-55105419D01*
X244003485Y-55057800D01*
X243670152Y-55057800D01*
X243479676Y-55105419D01*
X243384438Y-55200657D01*
X243336819Y-55295895D01*
X243336819Y-55486371D01*
X243384438Y-55581609D01*
X243479676Y-55676847D01*
X243670152Y-55724466D01*
X244003485Y-55724466D01*
X244193961Y-55676847D01*
X244289200Y-55581609D01*
X244336819Y-55486371D01*
X243336819Y-54105419D02*
X243336819Y-54676847D01*
X243336819Y-54391133D02*
X244336819Y-54391133D01*
X244193961Y-54486371D01*
X244098723Y-54581609D01*
X244051104Y-54676847D01*
X230860800Y-64743371D02*
X230527466Y-64743371D01*
X230384609Y-65267180D02*
X230860800Y-65267180D01*
X230860800Y-64267180D01*
X230384609Y-64267180D01*
X230051276Y-64267180D02*
X229384609Y-65267180D01*
X229384609Y-64267180D02*
X230051276Y-65267180D01*
X229146514Y-64267180D02*
X228575085Y-64267180D01*
X228860800Y-65267180D02*
X228860800Y-64267180D01*
X228479847Y-65362419D02*
X227717942Y-65362419D01*
X227479847Y-65267180D02*
X227479847Y-64267180D01*
X227098895Y-64267180D01*
X227003657Y-64314800D01*
X226956038Y-64362419D01*
X226908419Y-64457657D01*
X226908419Y-64600514D01*
X226956038Y-64695752D01*
X227003657Y-64743371D01*
X227098895Y-64790990D01*
X227479847Y-64790990D01*
X226575085Y-64267180D02*
X226336990Y-65267180D01*
X226146514Y-64552895D01*
X225956038Y-65267180D01*
X225717942Y-64267180D01*
X224765561Y-65267180D02*
X225098895Y-64790990D01*
X225336990Y-65267180D02*
X225336990Y-64267180D01*
X224956038Y-64267180D01*
X224860800Y-64314800D01*
X224813180Y-64362419D01*
X224765561Y-64457657D01*
X224765561Y-64600514D01*
X224813180Y-64695752D01*
X224860800Y-64743371D01*
X224956038Y-64790990D01*
X225336990Y-64790990D01*
X223813180Y-65267180D02*
X224384609Y-65267180D01*
X224098895Y-65267180D02*
X224098895Y-64267180D01*
X224194133Y-64410038D01*
X224289371Y-64505276D01*
X224384609Y-64552895D01*
M02*

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,748 @@
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.10*
G04 #@! TF.CreationDate,2021-06-10T23:09:58+02:00*
G04 #@! TF.ProjectId,PlantCtrlESP32,506c616e-7443-4747-926c-45535033322e,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,OtherDrawing,Comment*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 5.1.10) date 2021-06-10 23:09:58*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
%ADD10C,0.100000*%
%ADD11C,0.150000*%
G04 APERTURE END LIST*
D10*
X169862000Y-119918000D02*
X159082000Y-119918000D01*
X169862000Y-91918000D02*
X169862000Y-119918000D01*
X169862000Y-91918000D02*
X159082000Y-91918000D01*
X159082000Y-91918000D02*
X159082000Y-119918000D01*
X159082000Y-118443000D02*
X160172000Y-119918000D01*
X159082000Y-116443000D02*
X161787000Y-119918000D01*
X159082000Y-114443000D02*
X163402000Y-119918000D01*
X159082000Y-112443000D02*
X165017000Y-119918000D01*
X159082000Y-110443000D02*
X166632000Y-119918000D01*
X159082000Y-108443000D02*
X168247000Y-119918000D01*
X159082000Y-106443000D02*
X169862000Y-119918000D01*
X159082000Y-104443000D02*
X169862000Y-117918000D01*
X159082000Y-102443000D02*
X169862000Y-115918000D01*
X169862000Y-113918000D02*
X159082000Y-100443000D01*
X159082000Y-98443000D02*
X169862000Y-111918000D01*
X159082000Y-96443000D02*
X169862000Y-109918000D01*
X159082000Y-94443000D02*
X169862000Y-107918000D01*
X159082000Y-92443000D02*
X169862000Y-105918000D01*
X160172000Y-91918000D02*
X169862000Y-103918000D01*
X161787000Y-91918000D02*
X169862000Y-101918000D01*
X163402000Y-91918000D02*
X169862000Y-99918000D01*
X165017000Y-91918000D02*
X169862000Y-97918000D01*
X166632000Y-91918000D02*
X169862000Y-95918000D01*
X168247000Y-91918000D02*
X169862000Y-93918000D01*
D11*
X260475480Y-68863421D02*
X260475480Y-68768183D01*
X260523100Y-68672945D01*
X260570719Y-68625326D01*
X260665957Y-68577707D01*
X260856433Y-68530088D01*
X261094528Y-68530088D01*
X261285004Y-68577707D01*
X261380242Y-68625326D01*
X261427861Y-68672945D01*
X261475480Y-68768183D01*
X261475480Y-68863421D01*
X261427861Y-68958659D01*
X261380242Y-69006278D01*
X261285004Y-69053897D01*
X261094528Y-69101516D01*
X260856433Y-69101516D01*
X260665957Y-69053897D01*
X260570719Y-69006278D01*
X260523100Y-68958659D01*
X260475480Y-68863421D01*
X261380242Y-68101516D02*
X261427861Y-68053897D01*
X261475480Y-68101516D01*
X261427861Y-68149135D01*
X261380242Y-68101516D01*
X261475480Y-68101516D01*
X260475480Y-67434850D02*
X260475480Y-67339611D01*
X260523100Y-67244373D01*
X260570719Y-67196754D01*
X260665957Y-67149135D01*
X260856433Y-67101516D01*
X261094528Y-67101516D01*
X261285004Y-67149135D01*
X261380242Y-67196754D01*
X261427861Y-67244373D01*
X261475480Y-67339611D01*
X261475480Y-67434850D01*
X261427861Y-67530088D01*
X261380242Y-67577707D01*
X261285004Y-67625326D01*
X261094528Y-67672945D01*
X260856433Y-67672945D01*
X260665957Y-67625326D01*
X260570719Y-67577707D01*
X260523100Y-67530088D01*
X260475480Y-67434850D01*
X260475480Y-66196754D02*
X260475480Y-66672945D01*
X260951671Y-66720564D01*
X260904052Y-66672945D01*
X260856433Y-66577707D01*
X260856433Y-66339611D01*
X260904052Y-66244373D01*
X260951671Y-66196754D01*
X261046909Y-66149135D01*
X261285004Y-66149135D01*
X261380242Y-66196754D01*
X261427861Y-66244373D01*
X261475480Y-66339611D01*
X261475480Y-66577707D01*
X261427861Y-66672945D01*
X261380242Y-66720564D01*
X260904052Y-65577707D02*
X260856433Y-65672945D01*
X260808814Y-65720564D01*
X260713576Y-65768183D01*
X260665957Y-65768183D01*
X260570719Y-65720564D01*
X260523100Y-65672945D01*
X260475480Y-65577707D01*
X260475480Y-65387230D01*
X260523100Y-65291992D01*
X260570719Y-65244373D01*
X260665957Y-65196754D01*
X260713576Y-65196754D01*
X260808814Y-65244373D01*
X260856433Y-65291992D01*
X260904052Y-65387230D01*
X260904052Y-65577707D01*
X260951671Y-65672945D01*
X260999290Y-65720564D01*
X261094528Y-65768183D01*
X261285004Y-65768183D01*
X261380242Y-65720564D01*
X261427861Y-65672945D01*
X261475480Y-65577707D01*
X261475480Y-65387230D01*
X261427861Y-65291992D01*
X261380242Y-65244373D01*
X261285004Y-65196754D01*
X261094528Y-65196754D01*
X260999290Y-65244373D01*
X260951671Y-65291992D01*
X260904052Y-65387230D01*
X261475480Y-64768183D02*
X260808814Y-64768183D01*
X260475480Y-64768183D02*
X260523100Y-64815802D01*
X260570719Y-64768183D01*
X260523100Y-64720564D01*
X260475480Y-64768183D01*
X260570719Y-64768183D01*
X260808814Y-64291992D02*
X261475480Y-64291992D01*
X260904052Y-64291992D02*
X260856433Y-64244373D01*
X260808814Y-64149135D01*
X260808814Y-64006278D01*
X260856433Y-63911040D01*
X260951671Y-63863421D01*
X261475480Y-63863421D01*
X260427861Y-62672945D02*
X261713576Y-63530088D01*
X261475480Y-61815802D02*
X261475480Y-62387230D01*
X261475480Y-62101516D02*
X260475480Y-62101516D01*
X260618338Y-62196754D01*
X260713576Y-62291992D01*
X260761195Y-62387230D01*
X261380242Y-61387230D02*
X261427861Y-61339611D01*
X261475480Y-61387230D01*
X261427861Y-61434850D01*
X261380242Y-61387230D01*
X261475480Y-61387230D01*
X260808814Y-60482469D02*
X261475480Y-60482469D01*
X260427861Y-60720564D02*
X261142147Y-60958659D01*
X261142147Y-60339611D01*
X260475480Y-59530088D02*
X260475480Y-59720564D01*
X260523100Y-59815802D01*
X260570719Y-59863421D01*
X260713576Y-59958659D01*
X260904052Y-60006278D01*
X261285004Y-60006278D01*
X261380242Y-59958659D01*
X261427861Y-59911040D01*
X261475480Y-59815802D01*
X261475480Y-59625326D01*
X261427861Y-59530088D01*
X261380242Y-59482469D01*
X261285004Y-59434850D01*
X261046909Y-59434850D01*
X260951671Y-59482469D01*
X260904052Y-59530088D01*
X260856433Y-59625326D01*
X260856433Y-59815802D01*
X260904052Y-59911040D01*
X260951671Y-59958659D01*
X261046909Y-60006278D01*
X261475480Y-59006278D02*
X260808814Y-59006278D01*
X260904052Y-59006278D02*
X260856433Y-58958659D01*
X260808814Y-58863421D01*
X260808814Y-58720564D01*
X260856433Y-58625326D01*
X260951671Y-58577707D01*
X261475480Y-58577707D01*
X260951671Y-58577707D02*
X260856433Y-58530088D01*
X260808814Y-58434850D01*
X260808814Y-58291992D01*
X260856433Y-58196754D01*
X260951671Y-58149135D01*
X261475480Y-58149135D01*
X261475480Y-57672945D02*
X260808814Y-57672945D01*
X260904052Y-57672945D02*
X260856433Y-57625326D01*
X260808814Y-57530088D01*
X260808814Y-57387230D01*
X260856433Y-57291992D01*
X260951671Y-57244373D01*
X261475480Y-57244373D01*
X260951671Y-57244373D02*
X260856433Y-57196754D01*
X260808814Y-57101516D01*
X260808814Y-56958659D01*
X260856433Y-56863421D01*
X260951671Y-56815802D01*
X261475480Y-56815802D01*
X270305280Y-72063761D02*
X270305280Y-71968523D01*
X270352900Y-71873285D01*
X270400519Y-71825666D01*
X270495757Y-71778047D01*
X270686233Y-71730428D01*
X270924328Y-71730428D01*
X271114804Y-71778047D01*
X271210042Y-71825666D01*
X271257661Y-71873285D01*
X271305280Y-71968523D01*
X271305280Y-72063761D01*
X271257661Y-72159000D01*
X271210042Y-72206619D01*
X271114804Y-72254238D01*
X270924328Y-72301857D01*
X270686233Y-72301857D01*
X270495757Y-72254238D01*
X270400519Y-72206619D01*
X270352900Y-72159000D01*
X270305280Y-72063761D01*
X271210042Y-71301857D02*
X271257661Y-71254238D01*
X271305280Y-71301857D01*
X271257661Y-71349476D01*
X271210042Y-71301857D01*
X271305280Y-71301857D01*
X270400519Y-70873285D02*
X270352900Y-70825666D01*
X270305280Y-70730428D01*
X270305280Y-70492333D01*
X270352900Y-70397095D01*
X270400519Y-70349476D01*
X270495757Y-70301857D01*
X270590995Y-70301857D01*
X270733852Y-70349476D01*
X271305280Y-70920904D01*
X271305280Y-70301857D01*
X271305280Y-69349476D02*
X271305280Y-69920904D01*
X271305280Y-69635190D02*
X270305280Y-69635190D01*
X270448138Y-69730428D01*
X270543376Y-69825666D01*
X270590995Y-69920904D01*
X270638614Y-68492333D02*
X271305280Y-68492333D01*
X270257661Y-68730428D02*
X270971947Y-68968523D01*
X270971947Y-68349476D01*
X271305280Y-67968523D02*
X270638614Y-67968523D01*
X270305280Y-67968523D02*
X270352900Y-68016142D01*
X270400519Y-67968523D01*
X270352900Y-67920904D01*
X270305280Y-67968523D01*
X270400519Y-67968523D01*
X270638614Y-67492333D02*
X271305280Y-67492333D01*
X270733852Y-67492333D02*
X270686233Y-67444714D01*
X270638614Y-67349476D01*
X270638614Y-67206619D01*
X270686233Y-67111380D01*
X270781471Y-67063761D01*
X271305280Y-67063761D01*
X270257661Y-65873285D02*
X271543376Y-66730428D01*
X270305280Y-65063761D02*
X270305280Y-65539952D01*
X270781471Y-65587571D01*
X270733852Y-65539952D01*
X270686233Y-65444714D01*
X270686233Y-65206619D01*
X270733852Y-65111380D01*
X270781471Y-65063761D01*
X270876709Y-65016142D01*
X271114804Y-65016142D01*
X271210042Y-65063761D01*
X271257661Y-65111380D01*
X271305280Y-65206619D01*
X271305280Y-65444714D01*
X271257661Y-65539952D01*
X271210042Y-65587571D01*
X271210042Y-64587571D02*
X271257661Y-64539952D01*
X271305280Y-64587571D01*
X271257661Y-64635190D01*
X271210042Y-64587571D01*
X271305280Y-64587571D01*
X270638614Y-63682809D02*
X271305280Y-63682809D01*
X270257661Y-63920904D02*
X270971947Y-64159000D01*
X270971947Y-63539952D01*
X270638614Y-62730428D02*
X271305280Y-62730428D01*
X270257661Y-62968523D02*
X270971947Y-63206619D01*
X270971947Y-62587571D01*
X270733852Y-62063761D02*
X270686233Y-62159000D01*
X270638614Y-62206619D01*
X270543376Y-62254238D01*
X270495757Y-62254238D01*
X270400519Y-62206619D01*
X270352900Y-62159000D01*
X270305280Y-62063761D01*
X270305280Y-61873285D01*
X270352900Y-61778047D01*
X270400519Y-61730428D01*
X270495757Y-61682809D01*
X270543376Y-61682809D01*
X270638614Y-61730428D01*
X270686233Y-61778047D01*
X270733852Y-61873285D01*
X270733852Y-62063761D01*
X270781471Y-62159000D01*
X270829090Y-62206619D01*
X270924328Y-62254238D01*
X271114804Y-62254238D01*
X271210042Y-62206619D01*
X271257661Y-62159000D01*
X271305280Y-62063761D01*
X271305280Y-61873285D01*
X271257661Y-61778047D01*
X271210042Y-61730428D01*
X271114804Y-61682809D01*
X270924328Y-61682809D01*
X270829090Y-61730428D01*
X270781471Y-61778047D01*
X270733852Y-61873285D01*
X271305280Y-61254238D02*
X270638614Y-61254238D01*
X270733852Y-61254238D02*
X270686233Y-61206619D01*
X270638614Y-61111380D01*
X270638614Y-60968523D01*
X270686233Y-60873285D01*
X270781471Y-60825666D01*
X271305280Y-60825666D01*
X270781471Y-60825666D02*
X270686233Y-60778047D01*
X270638614Y-60682809D01*
X270638614Y-60539952D01*
X270686233Y-60444714D01*
X270781471Y-60397095D01*
X271305280Y-60397095D01*
X271305280Y-59920904D02*
X270638614Y-59920904D01*
X270733852Y-59920904D02*
X270686233Y-59873285D01*
X270638614Y-59778047D01*
X270638614Y-59635190D01*
X270686233Y-59539952D01*
X270781471Y-59492333D01*
X271305280Y-59492333D01*
X270781471Y-59492333D02*
X270686233Y-59444714D01*
X270638614Y-59349476D01*
X270638614Y-59206619D01*
X270686233Y-59111380D01*
X270781471Y-59063761D01*
X271305280Y-59063761D01*
X267295380Y-77835911D02*
X267295380Y-77740673D01*
X267343000Y-77645435D01*
X267390619Y-77597816D01*
X267485857Y-77550197D01*
X267676333Y-77502578D01*
X267914428Y-77502578D01*
X268104904Y-77550197D01*
X268200142Y-77597816D01*
X268247761Y-77645435D01*
X268295380Y-77740673D01*
X268295380Y-77835911D01*
X268247761Y-77931150D01*
X268200142Y-77978769D01*
X268104904Y-78026388D01*
X267914428Y-78074007D01*
X267676333Y-78074007D01*
X267485857Y-78026388D01*
X267390619Y-77978769D01*
X267343000Y-77931150D01*
X267295380Y-77835911D01*
X268200142Y-77074007D02*
X268247761Y-77026388D01*
X268295380Y-77074007D01*
X268247761Y-77121626D01*
X268200142Y-77074007D01*
X268295380Y-77074007D01*
X267295380Y-76407340D02*
X267295380Y-76312102D01*
X267343000Y-76216864D01*
X267390619Y-76169245D01*
X267485857Y-76121626D01*
X267676333Y-76074007D01*
X267914428Y-76074007D01*
X268104904Y-76121626D01*
X268200142Y-76169245D01*
X268247761Y-76216864D01*
X268295380Y-76312102D01*
X268295380Y-76407340D01*
X268247761Y-76502578D01*
X268200142Y-76550197D01*
X268104904Y-76597816D01*
X267914428Y-76645435D01*
X267676333Y-76645435D01*
X267485857Y-76597816D01*
X267390619Y-76550197D01*
X267343000Y-76502578D01*
X267295380Y-76407340D01*
X267390619Y-75693054D02*
X267343000Y-75645435D01*
X267295380Y-75550197D01*
X267295380Y-75312102D01*
X267343000Y-75216864D01*
X267390619Y-75169245D01*
X267485857Y-75121626D01*
X267581095Y-75121626D01*
X267723952Y-75169245D01*
X268295380Y-75740673D01*
X268295380Y-75121626D01*
X268295380Y-74169245D02*
X268295380Y-74740673D01*
X268295380Y-74454959D02*
X267295380Y-74454959D01*
X267438238Y-74550197D01*
X267533476Y-74645435D01*
X267581095Y-74740673D01*
X268295380Y-73740673D02*
X267628714Y-73740673D01*
X267295380Y-73740673D02*
X267343000Y-73788292D01*
X267390619Y-73740673D01*
X267343000Y-73693054D01*
X267295380Y-73740673D01*
X267390619Y-73740673D01*
X267628714Y-73264483D02*
X268295380Y-73264483D01*
X267723952Y-73264483D02*
X267676333Y-73216864D01*
X267628714Y-73121626D01*
X267628714Y-72978769D01*
X267676333Y-72883530D01*
X267771571Y-72835911D01*
X268295380Y-72835911D01*
X267247761Y-71645435D02*
X268533476Y-72502578D01*
X267295380Y-71121626D02*
X267295380Y-71026388D01*
X267343000Y-70931150D01*
X267390619Y-70883530D01*
X267485857Y-70835911D01*
X267676333Y-70788292D01*
X267914428Y-70788292D01*
X268104904Y-70835911D01*
X268200142Y-70883530D01*
X268247761Y-70931150D01*
X268295380Y-71026388D01*
X268295380Y-71121626D01*
X268247761Y-71216864D01*
X268200142Y-71264483D01*
X268104904Y-71312102D01*
X267914428Y-71359721D01*
X267676333Y-71359721D01*
X267485857Y-71312102D01*
X267390619Y-71264483D01*
X267343000Y-71216864D01*
X267295380Y-71121626D01*
X268200142Y-70359721D02*
X268247761Y-70312102D01*
X268295380Y-70359721D01*
X268247761Y-70407340D01*
X268200142Y-70359721D01*
X268295380Y-70359721D01*
X267295380Y-69407340D02*
X267295380Y-69883530D01*
X267771571Y-69931150D01*
X267723952Y-69883530D01*
X267676333Y-69788292D01*
X267676333Y-69550197D01*
X267723952Y-69454959D01*
X267771571Y-69407340D01*
X267866809Y-69359721D01*
X268104904Y-69359721D01*
X268200142Y-69407340D01*
X268247761Y-69454959D01*
X268295380Y-69550197D01*
X268295380Y-69788292D01*
X268247761Y-69883530D01*
X268200142Y-69931150D01*
X267295380Y-69026388D02*
X267295380Y-68407340D01*
X267676333Y-68740673D01*
X267676333Y-68597816D01*
X267723952Y-68502578D01*
X267771571Y-68454959D01*
X267866809Y-68407340D01*
X268104904Y-68407340D01*
X268200142Y-68454959D01*
X268247761Y-68502578D01*
X268295380Y-68597816D01*
X268295380Y-68883530D01*
X268247761Y-68978769D01*
X268200142Y-69026388D01*
X267295380Y-68074007D02*
X267295380Y-67454959D01*
X267676333Y-67788292D01*
X267676333Y-67645435D01*
X267723952Y-67550197D01*
X267771571Y-67502578D01*
X267866809Y-67454959D01*
X268104904Y-67454959D01*
X268200142Y-67502578D01*
X268247761Y-67550197D01*
X268295380Y-67645435D01*
X268295380Y-67931150D01*
X268247761Y-68026388D01*
X268200142Y-68074007D01*
X268295380Y-67026388D02*
X267628714Y-67026388D01*
X267723952Y-67026388D02*
X267676333Y-66978769D01*
X267628714Y-66883530D01*
X267628714Y-66740673D01*
X267676333Y-66645435D01*
X267771571Y-66597816D01*
X268295380Y-66597816D01*
X267771571Y-66597816D02*
X267676333Y-66550197D01*
X267628714Y-66454959D01*
X267628714Y-66312102D01*
X267676333Y-66216864D01*
X267771571Y-66169245D01*
X268295380Y-66169245D01*
X268295380Y-65693054D02*
X267628714Y-65693054D01*
X267723952Y-65693054D02*
X267676333Y-65645435D01*
X267628714Y-65550197D01*
X267628714Y-65407340D01*
X267676333Y-65312102D01*
X267771571Y-65264483D01*
X268295380Y-65264483D01*
X267771571Y-65264483D02*
X267676333Y-65216864D01*
X267628714Y-65121626D01*
X267628714Y-64978769D01*
X267676333Y-64883530D01*
X267771571Y-64835911D01*
X268295380Y-64835911D01*
X266660380Y-65339230D02*
X266660380Y-65243992D01*
X266708000Y-65148754D01*
X266755619Y-65101135D01*
X266850857Y-65053516D01*
X267041333Y-65005897D01*
X267279428Y-65005897D01*
X267469904Y-65053516D01*
X267565142Y-65101135D01*
X267612761Y-65148754D01*
X267660380Y-65243992D01*
X267660380Y-65339230D01*
X267612761Y-65434469D01*
X267565142Y-65482088D01*
X267469904Y-65529707D01*
X267279428Y-65577326D01*
X267041333Y-65577326D01*
X266850857Y-65529707D01*
X266755619Y-65482088D01*
X266708000Y-65434469D01*
X266660380Y-65339230D01*
X267565142Y-64577326D02*
X267612761Y-64529707D01*
X267660380Y-64577326D01*
X267612761Y-64624945D01*
X267565142Y-64577326D01*
X267660380Y-64577326D01*
X266660380Y-63910659D02*
X266660380Y-63815421D01*
X266708000Y-63720183D01*
X266755619Y-63672564D01*
X266850857Y-63624945D01*
X267041333Y-63577326D01*
X267279428Y-63577326D01*
X267469904Y-63624945D01*
X267565142Y-63672564D01*
X267612761Y-63720183D01*
X267660380Y-63815421D01*
X267660380Y-63910659D01*
X267612761Y-64005897D01*
X267565142Y-64053516D01*
X267469904Y-64101135D01*
X267279428Y-64148754D01*
X267041333Y-64148754D01*
X266850857Y-64101135D01*
X266755619Y-64053516D01*
X266708000Y-64005897D01*
X266660380Y-63910659D01*
X266660380Y-62672564D02*
X266660380Y-63148754D01*
X267136571Y-63196373D01*
X267088952Y-63148754D01*
X267041333Y-63053516D01*
X267041333Y-62815421D01*
X267088952Y-62720183D01*
X267136571Y-62672564D01*
X267231809Y-62624945D01*
X267469904Y-62624945D01*
X267565142Y-62672564D01*
X267612761Y-62720183D01*
X267660380Y-62815421D01*
X267660380Y-63053516D01*
X267612761Y-63148754D01*
X267565142Y-63196373D01*
X267660380Y-62196373D02*
X266993714Y-62196373D01*
X266660380Y-62196373D02*
X266708000Y-62243992D01*
X266755619Y-62196373D01*
X266708000Y-62148754D01*
X266660380Y-62196373D01*
X266755619Y-62196373D01*
X266993714Y-61720183D02*
X267660380Y-61720183D01*
X267088952Y-61720183D02*
X267041333Y-61672564D01*
X266993714Y-61577326D01*
X266993714Y-61434469D01*
X267041333Y-61339230D01*
X267136571Y-61291611D01*
X267660380Y-61291611D01*
X266612761Y-60101135D02*
X267898476Y-60958278D01*
X267660380Y-59243992D02*
X267660380Y-59815421D01*
X267660380Y-59529707D02*
X266660380Y-59529707D01*
X266803238Y-59624945D01*
X266898476Y-59720183D01*
X266946095Y-59815421D01*
X267565142Y-58815421D02*
X267612761Y-58767802D01*
X267660380Y-58815421D01*
X267612761Y-58863040D01*
X267565142Y-58815421D01*
X267660380Y-58815421D01*
X266755619Y-58386850D02*
X266708000Y-58339230D01*
X266660380Y-58243992D01*
X266660380Y-58005897D01*
X266708000Y-57910659D01*
X266755619Y-57863040D01*
X266850857Y-57815421D01*
X266946095Y-57815421D01*
X267088952Y-57863040D01*
X267660380Y-58434469D01*
X267660380Y-57815421D01*
X266660380Y-57482088D02*
X266660380Y-56815421D01*
X267660380Y-57243992D01*
X267660380Y-56434469D02*
X266993714Y-56434469D01*
X267088952Y-56434469D02*
X267041333Y-56386850D01*
X266993714Y-56291611D01*
X266993714Y-56148754D01*
X267041333Y-56053516D01*
X267136571Y-56005897D01*
X267660380Y-56005897D01*
X267136571Y-56005897D02*
X267041333Y-55958278D01*
X266993714Y-55863040D01*
X266993714Y-55720183D01*
X267041333Y-55624945D01*
X267136571Y-55577326D01*
X267660380Y-55577326D01*
X267660380Y-55101135D02*
X266993714Y-55101135D01*
X267088952Y-55101135D02*
X267041333Y-55053516D01*
X266993714Y-54958278D01*
X266993714Y-54815421D01*
X267041333Y-54720183D01*
X267136571Y-54672564D01*
X267660380Y-54672564D01*
X267136571Y-54672564D02*
X267041333Y-54624945D01*
X266993714Y-54529707D01*
X266993714Y-54386850D01*
X267041333Y-54291611D01*
X267136571Y-54243992D01*
X267660380Y-54243992D01*
M02*

View File

@ -0,0 +1,14 @@
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.10*
G04 #@! TF.CreationDate,2021-06-10T23:09:58+02:00*
G04 #@! TF.ProjectId,PlantCtrlESP32,506c616e-7443-4747-926c-45535033322e,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Other,ECO1*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 5.1.10) date 2021-06-10 23:09:58*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 APERTURE END LIST*
M02*

View File

@ -0,0 +1,14 @@
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.10*
G04 #@! TF.CreationDate,2021-06-10T23:09:58+02:00*
G04 #@! TF.ProjectId,PlantCtrlESP32,506c616e-7443-4747-926c-45535033322e,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Other,ECO2*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 5.1.10) date 2021-06-10 23:09:58*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 APERTURE END LIST*
M02*

View File

@ -0,0 +1,28 @@
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.10*
G04 #@! TF.CreationDate,2021-06-10T23:09:58+02:00*
G04 #@! TF.ProjectId,PlantCtrlESP32,506c616e-7443-4747-926c-45535033322e,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Profile,NP*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 5.1.10) date 2021-06-10 23:09:58*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 #@! TA.AperFunction,Profile*
%ADD10C,0.050000*%
G04 #@! TD*
G04 APERTURE END LIST*
D10*
X170180000Y-40640000D02*
X269240000Y-40640000D01*
X170180000Y-43180000D02*
X170180000Y-40640000D01*
X170180000Y-139700000D02*
X170180000Y-43180000D01*
X269240000Y-139700000D02*
X269240000Y-40640000D01*
X170180000Y-139700000D02*
X269240000Y-139700000D01*
M02*

View File

@ -0,0 +1,32 @@
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.10*
G04 #@! TF.CreationDate,2021-06-10T23:09:58+02:00*
G04 #@! TF.ProjectId,PlantCtrlESP32,506c616e-7443-4747-926c-45535033322e,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Glue,Top*
G04 #@! TF.FilePolarity,Positive*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 5.1.10) date 2021-06-10 23:09:58*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
%ADD10C,0.380000*%
G04 APERTURE END LIST*
D10*
X211413132Y-73660000D02*
G75*
G03*
X211413132Y-73660000I-212132J0D01*
G01*
X211751000Y-73660000D02*
G75*
G03*
X211751000Y-73660000I-550000J0D01*
G01*
X212101000Y-73660000D02*
G75*
G03*
X212101000Y-73660000I-900000J0D01*
G01*
M02*

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,14 @@
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.1.10*
G04 #@! TF.CreationDate,2021-06-10T23:09:58+02:00*
G04 #@! TF.ProjectId,PlantCtrlESP32,506c616e-7443-4747-926c-45535033322e,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Other,User*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 5.1.10) date 2021-06-10 23:09:58*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 APERTURE END LIST*
M02*

View File

@ -0,0 +1,20 @@
M48
; DRILL file {KiCad 5.1.10} date Thu Jun 10 23:11:37 2021
; FORMAT={-:-/ absolute / inch / decimal}
; #@! TF.CreationDate,2021-06-10T23:11:37+02:00
; #@! TF.GenerationSoftware,Kicad,Pcbnew,5.1.10
; #@! TF.FileFunction,NonPlated,1,2,NPTH
FMAT,2
INCH
T1C0.0941
T2C0.1358
%
G90
G05
T1
X9.8951Y-2.461
T2
X7.394Y-2.461
X9.5672Y-1.831
T0
M30

View File

@ -0,0 +1,304 @@
M48
; DRILL file {KiCad 5.1.10} date Thu Jun 10 23:11:37 2021
; FORMAT={-:-/ absolute / inch / decimal}
; #@! TF.CreationDate,2021-06-10T23:11:37+02:00
; #@! TF.GenerationSoftware,Kicad,Pcbnew,5.1.10
; #@! TF.FileFunction,Plated,1,2,PTH
FMAT,2
INCH
T1C0.0157
T2C0.0295
T3C0.0315
T4C0.0374
T5C0.0394
T6C0.0591
T7C0.0591
T8C0.0787
T9C0.1181
%
G90
G05
T1
X6.7418Y-4.8632
X6.755Y-4.285
X6.8055Y-4.415
X6.825Y-3.525
X6.845Y-3.93
X6.8754Y-4.7304
X6.8757Y-4.3343
X6.905Y-4.58
X6.96Y-4.585
X6.98Y-3.19
X6.985Y-3.91
X7.005Y-4.37
X7.025Y-2.385
X7.025Y-4.75
X7.04Y-4.6
X7.045Y-5.035
X7.05Y-3.48
X7.055Y-4.38
X7.055Y-4.89
X7.08Y-2.99
X7.11Y-5.025
X7.13Y-2.45
X7.13Y-4.96
X7.14Y-4.77
X7.15Y-2.92
X7.1528Y-5.1602
X7.17Y-5.43
X7.21Y-4.3
X7.22Y-4.77
X7.225Y-4.35
X7.225Y-4.35
X7.2274Y-4.2647
X7.23Y-3.06
X7.25Y-5.16
X7.255Y-4.41
X7.2866Y-5.2154
X7.29Y-3.41
X7.3Y-4.41
X7.315Y-2.385
X7.32Y-4.77
X7.3282Y-3.95
X7.34Y-4.075
X7.35Y-3.73
X7.3621Y-4.3489
X7.37Y-3.67
X7.37Y-4.12
X7.42Y-4.77
X7.4275Y-5.0525
X7.43Y-4.92
X7.43Y-4.96
X7.45Y-3.15
X7.5Y-3.78
X7.52Y-4.77
X7.5434Y-4.5416
X7.55Y-4.35
X7.58Y-4.58
X7.59Y-4.15
X7.59Y-5.29
X7.5965Y-4.9528
X7.62Y-4.77
X7.64Y-4.18
X7.66Y-2.095
X7.665Y-1.99
X7.69Y-5.41
X7.7Y-2.36
X7.72Y-4.77
X7.78Y-2.525
X7.78Y-5.37
X7.825Y-3.25
X7.875Y-3.45
X7.975Y-3.45
X7.975Y-4.45
X8.025Y-1.97
X8.0625Y-2.8075
X8.07Y-2.09
X8.072Y-4.652
X8.09Y-5.2
X8.125Y-3.4
X8.145Y-2.32
X8.15Y-5.09
X8.18Y-4.44
X8.22Y-3.92
X8.24Y-4.72
X8.2779Y-3.7421
X8.2779Y-3.9179
X8.2779Y-4.1879
X8.29Y-5.44
X8.3Y-5.26
X8.31Y-3.275
X8.31Y-3.645
X8.3299Y-3.8453
X8.33Y-4.58
X8.35Y-4.645
X8.375Y-3.66
X8.38Y-5.37
X8.4Y-1.72
X8.43Y-4.7
X8.48Y-4.595
X8.49Y-1.815
X8.54Y-3.85
X8.57Y-1.78
X8.615Y-4.375
X8.637Y-4.8689
X8.6726Y-3.6326
X8.695Y-4.59
X8.695Y-4.7
X8.8Y-3.15
X8.83Y-3.85
X8.841Y-1.761
X8.847Y-1.646
X8.915Y-4.38
X8.9526Y-3.6326
X8.955Y-4.705
X8.9559Y-4.861
X8.96Y-4.58
X9.06Y-2.97
X9.11Y-2.1
X9.11Y-2.34
X9.13Y-3.85
X9.2Y-3.34
X9.22Y-4.37
X9.2526Y-3.6326
X9.2551Y-4.8335
X9.27Y-4.585
X9.27Y-4.705
X9.28Y-3.21
X9.319Y-1.656
X9.32Y-3.46
X9.325Y-1.764
X9.35Y-2.48
X9.44Y-3.85
X9.45Y-3.21
X9.47Y-2.59
X9.515Y-3.375
X9.52Y-4.38
X9.525Y-3.46
X9.525Y-4.585
X9.53Y-4.7
X9.5374Y-3.6326
X9.5588Y-3.2462
X9.58Y-4.85
X9.59Y-4.955
X9.715Y-2.025
X9.74Y-3.85
X9.75Y-4.7
X9.79Y-3.465
X9.84Y-4.385
X9.84Y-4.85
X9.845Y-1.835
X9.851Y-1.657
X9.854Y-1.744
X9.8774Y-3.6326
X9.885Y-4.955
X9.925Y-4.58
X10.03Y-3.27
X10.03Y-3.41
X10.05Y-3.85
X10.12Y-4.375
X10.125Y-4.22
X10.14Y-4.01
X10.17Y-4.85
X10.185Y-4.525
X10.185Y-4.955
X10.21Y-3.265
X10.315Y-4.715
X10.328Y-2.639
X10.3328Y-2.1392
X10.3378Y-3.8453
X10.34Y-3.41
X10.345Y-4.275
X10.355Y-3.585
X10.36Y-4.485
X10.365Y-2.6
X10.375Y-3.29
X10.4Y-3.945
X10.4028Y-3.85
X10.42Y-3.405
X10.475Y-3.63
X10.48Y-3.015
X10.505Y-4.41
X10.5051Y-3.5849
X10.51Y-3.195
X10.57Y-3.559
X10.572Y-2.412
T2
X8.47Y-1.645
X8.52Y-1.645
X8.57Y-1.645
T3
X8.655Y-3.03
X10.145Y-3.47
X10.1474Y-3.6326
T4
X6.861Y-2.737
X6.861Y-2.8354
X6.861Y-2.9339
X7.5247Y-5.07
X7.6231Y-5.07
X7.7216Y-5.07
X7.82Y-5.07
X8.45Y-4.9031
X8.45Y-5.0016
X8.45Y-5.1
X8.75Y-4.9031
X8.75Y-5.0016
X8.75Y-5.1
X9.05Y-4.9031
X9.05Y-5.0016
X9.05Y-5.1
X9.35Y-4.9031
X9.35Y-5.0016
X9.35Y-5.1
X9.65Y-4.9031
X9.65Y-5.0016
X9.65Y-5.1
X9.95Y-4.9031
X9.95Y-5.0016
X9.95Y-5.1
X10.25Y-4.9031
X10.25Y-5.0016
X10.25Y-5.1
T5
X6.95Y-3.4
X7.1381Y-2.805
X7.1469Y-3.4
X7.335Y-2.805
X7.5781Y-2.795
X7.775Y-2.795
X7.825Y-3.775
X7.825Y-3.875
X7.9Y-4.55
X7.925Y-3.775
X7.925Y-3.875
X8.0Y-4.55
X8.025Y-3.775
X8.025Y-3.875
X8.1Y-4.55
X8.125Y-3.775
X8.125Y-3.875
X8.39Y-3.4
X8.45Y-4.3516
X8.45Y-4.45
X8.5869Y-3.4
X8.707Y-2.665
X8.75Y-4.3516
X8.75Y-4.45
X8.807Y-2.665
X8.85Y-3.4
X8.902Y-2.412
X8.907Y-2.665
X9.0004Y-2.412
X9.007Y-2.665
X9.0469Y-3.4
X9.05Y-4.3516
X9.05Y-4.45
X9.35Y-4.3516
X9.35Y-4.45
X9.65Y-4.3516
X9.65Y-4.45
X9.95Y-4.3516
X9.95Y-4.45
X10.225Y-2.815
X10.225Y-2.915
X10.225Y-3.015
X10.225Y-3.115
X10.25Y-4.3516
X10.25Y-4.45
T6
X9.1502Y-2.8
X10.04Y-2.8
T7
X9.448Y-2.107
X9.448Y-2.307
T8
X6.9321Y-2.146
X10.029Y-2.146
T9
X6.85Y-1.75
X6.85Y-5.34
X10.45Y-1.75
X10.45Y-5.34
T0
M30

BIN
board/gerber/gerber.zip Normal file

Binary file not shown.

1
esp32/.gitignore vendored
View File

@ -7,3 +7,4 @@
doc/
custom_platformio.ini
cppcheck-build-dir
host/settings.json

View File

@ -21,7 +21,8 @@
"iterator": "cpp",
"array": "cpp",
"tuple": "cpp",
"utility": "cpp"
"utility": "cpp",
"fstream": "cpp"
}
}
}

View File

@ -0,0 +1,49 @@
{
"settings": {
"sleep":600,
"nightsleep": 1200,
"pumpsleep": 5,
"tankmax": 1000,
"tankmin": 100,
"tankwarn": 200,
"tankVolume": 100,
"lipoDSAddr": "abcdefghijklmnop",
"tankDSAddr": "abcdefghijklmnop",
"ntpServer":"pool.ntp.org",
"dry0":50,
"hourstart0":6,
"hourend0":20,
"lowLight0": false,
"delay0": 10,
"dry1":-1,
"hourstart1":6,
"hourend1":20,
"lowLight1": false,
"delay1": 10,
"dry2":-1,
"hourstart2":6,
"hourend2":20,
"lowLight2": false,
"delay2": 10,
"dry3":-1,
"hourstart3":6,
"hourend3":20,
"lowLight3": false,
"delay3": 10,
"dry4":-1,
"hourstart4":6,
"hourend4":20,
"lowLight4": false,
"delay4": 10,
"dry5":-1,
"hourstart5":6,
"hourend5":20,
"lowLight5": false,
"delay5": 10,
"dry6":-1,
"hourstart6":6,
"hourend6":20,
"lowLight6": false,
"delay6": 10
}
}

39
esp32/host/upload-settings.sh Executable file
View File

@ -0,0 +1,39 @@
#!//bin/bash
if [ $# -ne 3 ]; then
echo "Homie prefex and device index must be specified:"
echo "$0 <mqtt host> <prefix> <device index>"
echo "e.g."
echo "$0 192.168.0.2 test/ MyDeviceId"
exit 1
fi
mqttHost=$1
mqttPrefix=$2
homieId=$3
settingsFile=settings.json
if [ ! -f $settingsFile ]; then
echo "$settingsFile missing"
echo "check $settingsFile.example"
exit 1
fi
mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/stay/alive/set" -m "1" -r
echo "Waiting ..."
mosquitto_sub -h $mqttHost -t "${mqttPrefix}${homieId}/#" -R -C 1
set -e
echo "Waiting 30 seconds ..."
sleep 30
mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/\$implementation/config/set" -f $settingsFile
echo "Waiting for reboot ..."
sleep 1
mosquitto_sub -h $mqttHost -t "${mqttPrefix}${homieId}/#" -R -C 1
echo "Alive"
sleep 20
echo "Create Backup ..."
mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/config/backup/set" -m "true" -r
sleep 5
echo "Shutdown ..."
mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/stay/alive/set" -m "0" -r
exit 0

View File

@ -21,6 +21,7 @@ fi
mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/stay/alive/set" -m "1" -r
echo "Waiting ..."
mosquitto_sub -h $mqttHost -t "${mqttPrefix}${homieId}/#" -R -C 1
set -e
python ota_updater.py -l $mqttHost -t "$mqttPrefix" -i "$homieId" $firmwareFile
mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/stay/alive/set" -m "0" -r

View File

@ -69,8 +69,12 @@
#define SENSOR_TANK_ECHO GPIO_NUM_16 /**< GPIO 16 - echo feedback of water sensor */
#define SENSOR_TANK_TRG GPIO_NUM_17 /**< GPIO 17 - trigger for water sensor */
#define BUTTON GPIO_NUM_0 /**< GPIO 0 - Fix button of NodeMCU */
#define CUSTOM1_PIN3 GPIO_NUM_2 /**< GPIO 2 - Custom GPIO controlling a MOSFET, connected to GND */
#define CUSTOM1_PIN2 GPIO_NUM_12 /**< GPIO 4 - custom GPIO directly connected to GPIO header */
#define CUSTOM1_PIN1 GPIO_NUM_34 /** direct gpio */
#define CUSTOM1_PIN3 GPIO_NUM_35 /** direct gpio */
#define CUSTOM1_PIN5 GPIO_NUM_2 /** mosfet controlled */
#define CUSTOM1_PIN7 GPIO_NUM_12 /** mosfet controlled */
#define I2C1_SDA GPIO_NUM_34 /**< GPIO 34 - I2C */
#define I2C1_SCL GPIO_NUM_35 /**< GPIO 35 - I2C */
/* @} */
@ -78,23 +82,27 @@
/** \addtogroup Configuration
* @{
*/
#define FIRMWARE_VERSION "sw 1.2 hw 0.9"
#define FIRMWARE_VERSION "sw 1.3 hw 0.10"
#define MOIST_SENSOR_MAX_ADC (85 * 4095 / 100)
#define MOIST_SENSOR_MIN_ADC (25 * 4095 / 100)
#define TIMED_LIGHT_PIN CUSTOM1_PIN5
#define SOLAR_VOLT_FACTOR 2
#define MOIST_SENSOR_MAX_FRQ 60000 // 60kHz (500Hz margin)
#define MOIST_SENSOR_MIN_FRQ 1000 // 1kHz (500Hz margin)
#define SOLAR_VOLT_FACTOR 11
#define BATTSENSOR_INDEX_SOLAR 0
#define BATTSENSOR_INDEX_BATTERY 1
#define MQTT_TIMEOUT (1000 * 10) /**< After 10 seconds, MQTT is expected to be connected */
#define MQTT_TIMEOUT (1000 * 60) /**< After 10 seconds, MQTT is expected to be connected */
#define ESP_STALE_TIMEOUT (MQTT_TIMEOUT+(30*1000))
#define MAX_PLANTS 7
#define SOLAR_CHARGE_MIN_VOLTAGE 7 /**< Sun is rising (morning detected) */
#define SOLAR_CHARGE_MAX_VOLTAGE 9 /**< Sun is shining (noon) */
#define VOLT_MAX_BATT 4.2f
#define MAX_CONFIG_SETTING_ITEMS 50 /**< Parameter, that can be configured in Homie */
#define MAX_CONFIG_SETTING_ITEMS 100 /**< Parameter, that can be configured in Homie */
#define MAX_JSON_CONFIG_FILE_SIZE_CUSTOM 2500
#define TEMPERATUR_TIMEOUT 3000 /**< 3 Seconds timeout for the temperatur sensors */
#define DS18B20_RESOLUTION 9 /**< 9bit temperature resolution -> 0.5°C steps */

View File

@ -38,7 +38,7 @@
0, /* Voltage */ \
0, /* Current */ \
0, /* Current */ \
0 /* Threashold */ \
0b10000000 /* Threshold to 4LSB */ \
}
typedef struct PageOne {

View File

@ -0,0 +1,9 @@
#ifndef FILEUTILS_H
#define FILEUTILS_H
bool doesFileExist(const char *source);
bool copyFile(const char *source, const char *target);
bool deleteFile(const char *source);
void printFile(const char *source);
#endif

View File

@ -18,13 +18,14 @@
#define MAX_PLANTS 7
/**
* @name Homie Attributes
* generated Information
* @{
**/
#define NUMBER_TYPE "number" /**< numberic information, published or read in Homie */
#define NUMBER_TYPE "Number" /**< numberic information, published or read in Homie */
/**
* @name Temperatur Node
@ -50,6 +51,11 @@ HomieNode plant4("plant4", "Plant 4", "Plant"); /**< dynamic Homie information f
HomieNode plant5("plant5", "Plant 5", "Plant"); /**< dynamic Homie information for sixth plant */
HomieNode plant6("plant6", "Plant 6", "Plant"); /**< dynamic Homie information for seventh plant */
#if defined(TIMED_LIGHT_PIN)
HomieNode timedLightNode("timedLight", "TimedLight", "Status");
#endif // TIMED_LIGHT_PIN
HomieNode sensorLipo("lipo", "Battery Status", "Lipo");
HomieNode sensorSolar("solar", "Solar Status", "Solarpanel");
HomieNode sensorWater("water", "WaterSensor", "Water");
@ -65,18 +71,26 @@ HomieNode stayAlive("stay", "alive", "alive"); /**< Necessary for Mqtt Active C
* General settings for the controller
* @{
*/
HomieSetting<long> deepSleepTime("deepsleep", "time in seconds to sleep");
HomieSetting<long> deepSleepTime("sleep", "time in seconds to sleep");
HomieSetting<long> deepSleepNightTime("nightsleep", "time in seconds to sleep (0 uses same setting: deepsleep at night, too)");
HomieSetting<long> wateringDeepSleep("pumpdeepsleep", "time seconds to sleep, while a pump is running");
HomieSetting<long> waterLevelMax("watermaxlevel", "distance (mm) at maximum water level");
HomieSetting<long> waterLevelMin("waterminlevel", "distance (mm) at minimum water level (pumps still covered)");
HomieSetting<long> waterLevelWarn("waterlevelwarn", "warn (mm) if below this water level %");
HomieSetting<long> waterLevelVol("waterVolume", "(ml) between minimum and maximum");
HomieSetting<const char *> lipoSensorAddr("lipoTempAddr", "1wire address for lipo temperature sensor");
HomieSetting<const char *> waterSensorAddr("waterTempIndex", "1wire address for water temperature sensor");
HomieSetting<long> wateringDeepSleep("pumpsleep", "time seconds to sleep, while a pump is running");
HomieSetting<long> pumpIneffectiveWarning("pumpConsecutiveWarn", "if the pump was triggered this amount directly after each cooldown, without resolving dryness, warn");
HomieSetting<long> waterLevelMax("tankmax", "distance (mm) at maximum water level");
HomieSetting<long> waterLevelMin("tankmin", "distance (mm) at minimum water level (pumps still covered)");
HomieSetting<long> waterLevelWarn("tankwarn", "warn (mm) if below this water level %");
HomieSetting<long> waterLevelVol("tankVolume", "(ml) between minimum and maximum");
HomieSetting<const char *> lipoSensorAddr("lipoDSAddr", "1wire address for lipo temperature sensor");
HomieSetting<const char *> waterSensorAddr("tankDSAddr", "1wire address for water temperature sensor");
HomieSetting<const char *> ntpServer("ntpServer", "NTP server (pool.ntp.org as default)");
#if defined(TIMED_LIGHT_PIN)
HomieSetting<double> timedLightVoltageCutoff("LightVoltageCutoff", "voltage at wich to disable light");
HomieSetting<long> timedLightStart("LightStart", "hour to start light");
HomieSetting<long> timedLightEnd("LightEnd", "hour to end light");
HomieSetting<bool> timedLightOnlyWhenDark("LightOnlyDark", "only enable light, if solar is low");
#endif // TIMED_LIGHT_PIN
/**
* @}
*/
@ -88,11 +102,11 @@ HomieSetting<const char *> ntpServer("ntpServer", "NTP server (pool.ntp.org as d
**/
#define GENERATE_PLANT(plant, strplant) \
HomieSetting<long> mSensorDry##plant = HomieSetting<long>("moistdry" strplant, "Plant " strplant "- Moist sensor dry threshold"); \
HomieSetting<long> mPumpAllowedHourRangeStart##plant = HomieSetting<long>("rangehourstart" strplant, "Plant" strplant " - Range pump allowed hour start (0-23)"); \
HomieSetting<long> mPumpAllowedHourRangeEnd##plant = HomieSetting<long>("rangehourend" strplant, "Plant" strplant " - Range pump allowed hour end (0-23)"); \
HomieSetting<bool> mPumpOnlyWhenLowLight##plant = HomieSetting<bool>("onlyWhenLowLightZ" strplant, "Plant" strplant " - Enable the Pump only, when there is no sunlight"); \
HomieSetting<long> mPumpCooldownInHours##plant = HomieSetting<long>("cooldownpump" strplant, "Plant" strplant " - How long to wait until the pump is activated again (minutes)"); \
HomieSetting<double> mSensorDry##plant = HomieSetting<double>("dry" strplant, "Plant " strplant "- Moist sensor dry %"); \
HomieSetting<long> mPumpAllowedHourRangeStart##plant = HomieSetting<long>("hourstart" strplant, "Plant" strplant " - Range pump allowed hour start (0-23)"); \
HomieSetting<long> mPumpAllowedHourRangeEnd##plant = HomieSetting<long>("hourend" strplant, "Plant" strplant " - Range pump allowed hour end (0-23)"); \
HomieSetting<bool> mPumpOnlyWhenLowLight##plant = HomieSetting<bool>("lowLight" strplant, "Plant" strplant " - Enable the Pump only, when there is no sunlight"); \
HomieSetting<long> mPumpCooldownInHours##plant = HomieSetting<long>("delay" strplant, "Plant" strplant " - How long to wait until the pump is activated again (minutes)"); \
PlantSettings_t mSetting##plant = {&mSensorDry##plant, &mPumpAllowedHourRangeStart##plant, &mPumpAllowedHourRangeEnd##plant, &mPumpOnlyWhenLowLight##plant, &mPumpCooldownInHours##plant}; \
/**< Generate all settings for one plant \
* \

View File

@ -13,12 +13,12 @@
#include <Homie.h>
#define DEACTIVATED_PLANT 5000
#define MISSING_SENSOR 5001
#define DEACTIVATED_PLANT -1
#define MISSING_SENSOR -2
typedef struct PlantSettings_t
{
HomieSetting<long> *pSensorDry;
HomieSetting<double> *pSensorDry;
HomieSetting<long> *pPumpAllowedHourRangeStart;
HomieSetting<long> *pPumpAllowedHourRangeEnd;
HomieSetting<bool> *pPumpOnlyWhenLowLight;

View File

@ -0,0 +1,29 @@
#pragma once
#define LOG_LEVEL_ERROR 0
#define LOG_LEVEL_WARN 1
#define LOG_LEVEL_INFO 2
#define LOG_LEVEL_DEBUG 3
#define LOG_TANKSENSOR_FAIL_DETECT "Failed to detect and initialize distance sensor!"
#define LOG_TANKSENSOR_FAIL_DETECT_CODE -1
#define LOG_BACKUP_SUCCESSFUL "Backup sucessful"
#define LOG_BACKUP_SUCCESSFUL_CODE 1
#define LOG_BACKUP_FAILED "Backup error"
#define LOG_BACKUP_FAILED_CODE -2
#define LOG_PUMP_BUTNOTANK_MESSAGE "Want to pump but no water"
#define LOG_PUMP_BUTNOTANK_CODE -3
#define LOG_PUMP_AND_DOWNLOADMODE "Download mode, ignoring pump request"
#define LOG_PUMP_AND_DOWNLOADMODE_CODE 2
//msg is dynamic defined
#define LOG_PUMP_INEFFECTIVE -4
#define LOG_DEBUG_CODE 1001
#define LOG_NOPUMP_LOWLIGHT 100
#define LOG_NOPUMPS 101
#define LOG_MISSING_PUMP -4

View File

@ -0,0 +1,7 @@
#ifndef MATHUTILS_H
#define MATHUTILS_H
bool equalish(double x, double y);
#endif

View File

@ -13,14 +13,21 @@
#define PLANT_CTRL_H
#include "HomieTypes.h"
#include <HomieNode.hpp>
#include "ControllerConfiguration.h"
#include "RunningMedian.h"
#include "MathUtils.h"
#define MOISTURE_MEASUREMENT_DURATION 400 /** ms */
class Plant
{
private:
RunningMedian moistureRaw = RunningMedian(5);
HomieNode *mPlant = NULL;
HomieInternals::PropertyInterface mPump;
int32_t mMoisture_freq = 0;
int mPinSensor = 0; /**< Pin of the moist sensor */
int mPinPump = 0; /**< Pin of the pump */
bool mConnected = false;
@ -47,7 +54,8 @@ public:
* @brief Measure a new analog moister value
*
*/
void addSenseValue(void);
void startMoistureMeasurement(void);
void stopMoistureMeasurement(void);
void deactivatePump(void);
@ -61,28 +69,32 @@ public:
*/
bool isPumpRequired()
{
bool isDry = getCurrentMoisture() > getSettingsMoisture();
bool isDry = getCurrentMoisture() > getSetting2Moisture();
bool isActive = isPumpTriggerActive();
return isDry && isActive;
}
bool isPumpTriggerActive()
{
return this->mSetting->pSensorDry->get() != DEACTIVATED_PLANT;
long current = this->mSetting->pSensorDry->get();
return !equalish(current,DEACTIVATED_PLANT);
}
float getCurrentMoisture()
{
if(moistureRaw.getCount()==0){
if(mMoisture_freq < MOIST_SENSOR_MIN_FRQ){
return MISSING_SENSOR;
}
return this->moistureRaw.getMedian();
return mMoisture_freq;
}
long getSettingsMoisture()
long getSetting2Moisture()
{
if (this->mSetting->pSensorDry != NULL)
{
return this->mSetting->pSensorDry->get();
//1 is totally wet, 0 is try, 0 is MOIST_SENSOR_MAX_FRQ, 1 is MOIST_SENSOR_MIN_FRQ
float factor = (this->mSetting->pSensorDry->get());
return map(factor,0,100,MOIST_SENSOR_MAX_FRQ,MOIST_SENSOR_MIN_FRQ);
}
else
{
@ -94,7 +106,6 @@ public:
{
return mPlant->setProperty(property);
}
bool switchHandler(const HomieRange &range, const String &value);
void init(void);
@ -124,6 +135,12 @@ public:
{
return this->mSetting->pPumpOnlyWhenLowLight->get();
}
void publishState(String state);
bool switchHandler(const HomieRange& range, const String& value);
void setSwitchHandler(HomieInternals::PropertyInputHandler f);
};
#endif

View File

@ -0,0 +1,4 @@
#pragma once
long getCurrentTime(void);
int getCurrentHour(void);

81
esp32/src/FileUtils.cpp Normal file
View File

@ -0,0 +1,81 @@
#include <Homie.h>
#include "FileUtils.h"
bool deleteFile(const char *source)
{
Serial << "deleting file " << source << endl;
if (!SPIFFS.begin())
{
return false;
}
bool deleted = SPIFFS.remove(source);
if (deleted)
{
Serial << "Deleted " << source << endl;
}
else
{
Serial << "Could not delete " << source << endl;
}
return deleted;
}
void printFile(const char *source)
{
Serial << "printing file " << source << endl;
if (!SPIFFS.begin())
{
Serial << "could not start spiffs " << source << endl;
return;
}
File file = SPIFFS.open(source, FILE_READ);
if (!file)
{
Serial << "could not start open " << source << endl;
return;
}
Serial << file.readString() << endl;
Serial << "Finished printing file " << source << endl;
file.close();
}
bool doesFileExist(const char *source)
{
Serial << "checking if file exist " << source << endl;
if (!SPIFFS.begin())
{
return false;
}
bool exists = SPIFFS.exists(source);
Serial << "File " << source << (exists ? "" : " not") << " found " << endl;
return exists;
}
bool copyFile(const char *source, const char *target)
{
Serial << "copy started " << source << " -> " << target << endl;
if (!SPIFFS.begin())
{
return false;
}
File file = SPIFFS.open(source, FILE_READ);
File file2 = SPIFFS.open(target, FILE_WRITE);
Serial.flush();
if (!file)
{
Serial << "There was an error opening " << source << " for reading" << endl;
return false;
}
if (!file2)
{
Serial << "There was an error opening " << target << " for reading" << endl;
file.close();
return false;
}
file2.println(file.readString());
Serial << "copy finished " << source << " -> " << target << endl;
file.close();
file2.close();
return true;
}

7
esp32/src/MathUtil.cpp Normal file
View File

@ -0,0 +1,7 @@
#include "MathUtils.h"
#include <Arduino.h>
bool equalish(double x, double y)
{
return (abs(x - y) < 0.5);
}

View File

@ -12,6 +12,14 @@
#include "PlantCtrl.h"
#include "ControllerConfiguration.h"
#include "TimeUtils.h"
#include "MathUtils.h"
#include "driver/pcnt.h"
double mapf(double x, double in_min, double in_max, double out_min, double out_max)
{
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
Plant::Plant(int pinSensor, int pinPump, int plantId, HomieNode *plant, PlantSettings_t *setting)
{
@ -26,8 +34,8 @@ void Plant::init(void)
{
/* Initialize Home Settings validator */
this->mSetting->pSensorDry->setDefaultValue(DEACTIVATED_PLANT);
this->mSetting->pSensorDry->setValidator([](long candidate) {
return (((candidate >= 0) && (candidate <= 4095)) || candidate == DEACTIVATED_PLANT);
this->mSetting->pSensorDry->setValidator([](double candidate) {
return (((candidate >= 0.0) && (candidate <= 100.0)) || equalish(candidate,DEACTIVATED_PLANT));
});
this->mSetting->pPumpAllowedHourRangeStart->setDefaultValue(8); // start at 8:00
this->mSetting->pPumpAllowedHourRangeStart->setValidator([](long candidate) {
@ -49,21 +57,44 @@ void Plant::init(void)
pinMode(this->mPinPump, OUTPUT);
Serial.println("Set GPIO mode " + String(mPinSensor) + "=" + String(ANALOG));
Serial.flush();
pinMode(this->mPinSensor, ANALOG);
pinMode(this->mPinSensor, INPUT);
Serial.println("Set GPIO " + String(mPinPump) + "=" + String(LOW));
Serial.flush();
digitalWrite(this->mPinPump, LOW);
pcnt_unit_t unit = (pcnt_unit_t) (PCNT_UNIT_0 + this->mPlantId);
pcnt_config_t pcnt_config = { }; // Instancia PCNT config
pcnt_config.pulse_gpio_num = this->mPinSensor; // Configura GPIO para entrada dos pulsos
pcnt_config.ctrl_gpio_num = PCNT_PIN_NOT_USED; // Configura GPIO para controle da contagem
pcnt_config.unit = unit; // Unidade de contagem PCNT - 0
pcnt_config.channel = PCNT_CHANNEL_0; // Canal de contagem PCNT - 0
pcnt_config.counter_h_lim = INT16_MAX; // Limite maximo de contagem - 20000
pcnt_config.pos_mode = PCNT_COUNT_INC; // Incrementa contagem na subida do pulso
pcnt_config.neg_mode = PCNT_COUNT_DIS; // Incrementa contagem na descida do pulso
pcnt_config.lctrl_mode = PCNT_MODE_KEEP; // PCNT - modo lctrl desabilitado
pcnt_config.hctrl_mode = PCNT_MODE_KEEP; // PCNT - modo hctrl - se HIGH conta incrementando
pcnt_unit_config(&pcnt_config); // Configura o contador PCNT
pcnt_counter_pause(unit); // Pausa o contador PCNT
pcnt_counter_clear(unit); // Zera o contador PCNT
Serial.println("Setup Counter " + String(mPinPump) + "=" + String(LOW));
}
void Plant::addSenseValue(void)
{
int raw = analogRead(this->mPinSensor);
if(raw < MOIST_SENSOR_MAX_ADC && raw > MOIST_SENSOR_MIN_ADC){
this->moistureRaw.add(raw);
} else {
int plantId = this->mPlantId;
Serial << "ignoring sensor " << plantId << " value due to being strange " << raw << endl;
}
void Plant::startMoistureMeasurement(void) {
pcnt_unit_t unit = (pcnt_unit_t) (PCNT_UNIT_0 + this->mPlantId);
pcnt_counter_resume(unit);
}
void Plant::stopMoistureMeasurement(void) {
int16_t pulses;
pcnt_unit_t unit = (pcnt_unit_t) (PCNT_UNIT_0 + this->mPlantId);
pcnt_counter_pause(unit);
pcnt_get_counter_value(unit, &pulses);
pcnt_counter_clear(unit);
this->mMoisture_freq = pulses * (1000 / MOISTURE_MEASUREMENT_DURATION);
}
void Plant::postMQTTconnection(void)
@ -71,6 +102,25 @@ void Plant::postMQTTconnection(void)
const String OFF = String("OFF");
this->mConnected = true;
this->mPlant->setProperty("switch").send(OFF);
long raw = getCurrentMoisture();
double pct = mapf(raw, MOIST_SENSOR_MIN_FRQ, MOIST_SENSOR_MAX_FRQ, 100, 0);
if (equalish(raw, MISSING_SENSOR))
{
pct = 0;
}
if (pct < 0)
{
pct = 0;
}
if (pct > 100)
{
pct = 100;
}
this->mPlant->setProperty("moist").send(String(round(pct*10)/10));
this->mPlant->setProperty("moistraw").send(String(raw));
this->mPlant->setProperty("moisttrigger").send(String(getSetting2Moisture()));
}
void Plant::deactivatePump(void)
@ -85,6 +135,13 @@ void Plant::deactivatePump(void)
}
}
void Plant::publishState(String state) {
if (this->mConnected)
{
this->mPlant->setProperty("state").send(state);
}
}
void Plant::activatePump(void)
{
int plantId = this->mPlantId;
@ -94,32 +151,36 @@ void Plant::activatePump(void)
{
const String OFF = String("ON");
this->mPlant->setProperty("switch").send(OFF);
this->mPlant->setProperty("lastPump").send(String(getCurrentTime()));
}
}
bool Plant::switchHandler(const HomieRange& range, const String& value) {
if (range.isRange) {
return false; // only one switch is present
}
if ((value.equals("ON")) || (value.equals("On")) || (value.equals("on")) || (value.equals("true"))) {
this->activatePump();
return true;
} else if ((value.equals("OFF")) || (value.equals("Off")) || (value.equals("off")) || (value.equals("false")) ) {
this->deactivatePump();
return true;
} else {
return false;
}
}
void Plant::setSwitchHandler(HomieInternals::PropertyInputHandler f) {
this->mPump.settable(f);
}
void Plant::advertise(void)
{
// Advertise topics
this->mPlant->advertise("switch").setName("Pump 1").setDatatype("boolean");
//FIXME add .settable(this->switchHandler)
this->mPlant->advertise("moist").setName("Percent").setDatatype("number").setUnit("%");
this->mPlant->advertise("moistraw").setName("adc").setDatatype("number").setUnit("3.3/4096V");
mPump = this->mPlant->advertise("switch").setName("Pump").setDatatype("boolean");
this->mPlant->advertise("lastPump").setName("lastPump").setDatatype("Number").setUnit("unixtime");
this->mPlant->advertise("moist").setName("Percent").setDatatype("Number").setUnit("%");
this->mPlant->advertise("moistraw").setName("adc").setDatatype("Number").setUnit("3.3/4096V");
this->mPlant->advertise("state").setName("state").setDatatype("string");
}
/* FIXME
bool Plant::switchHandler(const HomieRange& range, const String& value) {
if (range.isRange) return false; // only one switch is present
if ((value.equals("ON")) || (value.equals("On")) || (value.equals("on")) || (value.equals("true"))) {
this->activatePump();
return true;
} else if ((value.equals("OFF")) || (value.equals("Off")) || (value.equals("off")) || (value.equals("false")) ) {
this->deactivatePump();
return true;
} else {
return false;
}
}
}
*/

18
esp32/src/TimeUtils.cpp Normal file
View File

@ -0,0 +1,18 @@
#include "TimeUtils.h"
#include <Homie.h>
long getCurrentTime()
{
struct timeval tv_now;
gettimeofday(&tv_now, NULL);
return tv_now.tv_sec;
}
int getCurrentHour()
{
struct tm info;
time_t now;
time(&now);
localtime_r(&now, &info);
return info.tm_hour;
}

View File

@ -13,6 +13,9 @@
/******************************************************************************
* INCLUDES
******************************************************************************/
#include "LogDefines.h"
#include "FileUtils.h"
#include "TimeUtils.h"
#include "PlantCtrl.h"
#include "ControllerConfiguration.h"
#include "HomieConfiguration.h"
@ -35,10 +38,12 @@
* DEFINES
******************************************************************************/
#define AMOUNT_SENOR_QUERYS 8
#define MAX_TANK_DEPTH 1000
#define MAX_TANK_DEPTH 2000
#define TEST_TOPIC "roundtrip\0"
#define LOG_TOPIC "log\0"
#define BACKUP_TOPIC "$implementation/config/backup/set\0"
#define BACKUP_STATUS_TOPIC "$implementation/config/backup\0"
#define CONFIG_FILE "/homie/config.json"
#define CONFIG_FILE_BACKUP "/homie/config.json.bak"
#define getTopic(test, topic) \
char *topic = new char[strlen(Homie.getConfiguration().mqtt.baseTopic) + strlen(Homie.getConfiguration().deviceId) + 1 + strlen(test) + 1]; \
@ -51,18 +56,25 @@
* FUNCTION PROTOTYPES
******************************************************************************/
int determineNextPump();
void plantcontrol(boolean withHomie);
void log(int level, String message, int code);
int determineNextPump(bool lowLight);
void plantcontrol();
void readPowerSwitchedSensors();
bool determineTimedLightState(bool lowLight);
/******************************************************************************
* NON VOLATILE VARIABLES in DEEP SLEEP
******************************************************************************/
RTC_SLOW_ATTR int lastPumpRunning = -1; /**< store last successfully waterd plant */
RTC_SLOW_ATTR long lastWaterValue = 0; /**< to calculate the used water per plant */
RTC_DATA_ATTR int lastPumpRunning = -1; /**< store last successfully waterd plant */
RTC_DATA_ATTR long lastWaterValue = 0; /**< to calculate the used water per plant */
#if defined(TIMED_LIGHT_PIN)
RTC_DATA_ATTR bool timedLightOn = false; /**< allow fast recovery after poweron */
#endif // TIMED_LIGHT_PIN
RTC_SLOW_ATTR long rtcLastWateringPlant[MAX_PLANTS] = {0};
RTC_DATA_ATTR long rtcLastWateringPlant[MAX_PLANTS] = {0};
RTC_DATA_ATTR long consecutiveWateringPlant[MAX_PLANTS] = {0};
/******************************************************************************
* LOCAL VARIABLES
@ -98,37 +110,21 @@ Plant mPlants[MAX_PLANTS] = {
/******************************************************************************
* LOCAL FUNCTIONS
******************************************************************************/
long getCurrentTime()
{
struct timeval tv_now;
gettimeofday(&tv_now, NULL);
return tv_now.tv_sec;
}
int getCurrentHour()
{
struct tm info;
time_t now;
time(&now);
localtime_r(&now, &info);
return info.tm_hour;
}
void espDeepSleepFor(long seconds, bool activatePump, bool withHomieShutdown)
void espDeepSleepFor(long seconds, bool activatePump)
{
if (mDownloadMode)
{
Serial << "abort deepsleep, DownloadMode active" << endl;
log(LOG_LEVEL_DEBUG, "abort deepsleep, DownloadMode active", LOG_DEBUG_CODE);
return;
}
if (withHomieShutdown)
if (mAliveWasRead)
{
for (int i = 0; i < 10; i++)
{
long cTime = getCurrentTime();
if (cTime < 100000)
{
Serial << "Wait for ntp" << endl;
delay(100);
}
else
@ -136,21 +132,27 @@ void espDeepSleepFor(long seconds, bool activatePump, bool withHomieShutdown)
break;
}
}
if (getCurrentTime() < 100000)
{
log(LOG_LEVEL_DEBUG, "NTP timeout before deepsleep", LOG_DEBUG_CODE);
}
}
//allo hold for all digital pins
gpio_deep_sleep_hold_en();
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_OFF);
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_SLOW_MEM, ESP_PD_OPTION_ON);
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_FAST_MEM, ESP_PD_OPTION_OFF);
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_FAST_MEM, ESP_PD_OPTION_ON);
if (activatePump)
{
esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_ON);
gpio_deep_sleep_hold_en();
gpio_hold_en(OUTPUT_ENABLE_PUMP); //pump pwr
}
else
{
gpio_hold_dis(OUTPUT_ENABLE_PUMP); //pump pwr
gpio_deep_sleep_hold_dis();
digitalWrite(OUTPUT_ENABLE_PUMP, LOW);
digitalWrite(OUTPUT_ENABLE_SENSOR, LOW);
for (int i = 0; i < MAX_PLANTS; i++)
@ -165,32 +167,26 @@ void espDeepSleepFor(long seconds, bool activatePump, bool withHomieShutdown)
gpio_hold_en(OUTPUT_PUMP4);
gpio_hold_en(OUTPUT_PUMP5);
gpio_hold_en(OUTPUT_PUMP6);
//FIXME fix for outher outputs
#if defined(TIMED_LIGHT_PIN)
gpio_hold_en(TIMED_LIGHT_PIN);
#endif // TIMED_LIGHT_PIN
Serial.print("Trying to sleep for ");
Serial.print(seconds);
Serial.println(" seconds");
esp_sleep_enable_timer_wakeup((seconds * 1000U * 1000U));
Serial.flush();
if (withHomieShutdown)
if (mAliveWasRead)
{
delay(1000);
Homie.prepareToSleep();
}
else
{
Serial << "Bye offline mode" << endl;
Serial.flush();
esp_deep_sleep_start();
}
}
//requires homie being started
void readOneWireSensors(bool withMQTT)
void readOneWireSensors()
{
Serial << "Read OneWire" << endl;
Serial.flush();
for (uint8_t i = 0; i < sensors.getDeviceCount(); i++)
{
uint8_t ds18b20Address[8];
@ -236,7 +232,7 @@ void readOneWireSensors(bool withMQTT)
Serial << "DS18S20 Temperatur " << String(buf) << " : " << temp << " °C " << endl;
if (strcmp(lipoSensorAddr.get(), buf) == 0)
{
if (withMQTT)
if (mAliveWasRead)
{
sensorTemp.setProperty(TEMPERATUR_SENSOR_LIPO).send(String(temp));
}
@ -244,14 +240,14 @@ void readOneWireSensors(bool withMQTT)
}
if (strcmp(waterSensorAddr.get(), buf) == 0)
{
if (withMQTT)
if (mAliveWasRead)
{
sensorTemp.setProperty(TEMPERATUR_SENSOR_WATER).send(String(temp));
}
Serial << "Water Temperatur " << temp << " °C " << endl;
}
/* Always send the sensor address with the temperatur value */
if (withMQTT)
if (mAliveWasRead)
{
sensorTemp.setProperty(String(buf)).send(String(temp));
}
@ -275,16 +271,24 @@ void readOneWireSensors(bool withMQTT)
void readPowerSwitchedSensors()
{
digitalWrite(OUTPUT_ENABLE_SENSOR, HIGH);
delay(10);
for (int readCnt = 0; readCnt < AMOUNT_SENOR_QUERYS; readCnt++)
delay(50);
for (int i = 0; i < MAX_PLANTS; i++)
{
for (int i = 0; i < MAX_PLANTS; i++)
{
mPlants[i].addSenseValue();
}
delay(2);
mPlants[i].startMoistureMeasurement();
}
delay(MOISTURE_MEASUREMENT_DURATION);
for (int i = 0; i < MAX_PLANTS; i++)
{
mPlants[i].stopMoistureMeasurement();
}
for (int i = 0; i < MAX_PLANTS; i++)
{
Serial << "Plant " << i << " measurement: " << mPlants[i].getCurrentMoisture() << " hz" << endl;
}
waterRawSensor.clear();
Wire.setPins(SENSOR_TANK_TRG, SENSOR_TANK_ECHO);
Wire.begin();
tankSensor.setTimeout(500);
@ -312,8 +316,13 @@ void readPowerSwitchedSensors()
for (int readCnt = 0; readCnt < 5; readCnt++)
{
if(!tankSensor.timeoutOccurred()){
waterRawSensor.add(tankSensor.readRangeSingleMillimeters());
if (!tankSensor.timeoutOccurred())
{
uint16_t distance = tankSensor.readRangeSingleMillimeters();
if (distance < MAX_TANK_DEPTH)
{
waterRawSensor.add(distance);
}
}
delay(10);
}
@ -321,62 +330,13 @@ void readPowerSwitchedSensors()
}
else
{
Serial.println("Failed to detect and initialize distance sensor!");
log(LOG_LEVEL_WARN, LOG_TANKSENSOR_FAIL_DETECT, LOG_TANKSENSOR_FAIL_DETECT_CODE);
}
/* deactivate the sensors */
digitalWrite(OUTPUT_ENABLE_SENSOR, LOW);
}
bool copyFile(const char *source, const char *target)
{
Serial << "copy started " << source << " -> " << target << endl;
byte buffer[512];
if (!SPIFFS.begin())
{
return false;
}
File file = SPIFFS.open(source, FILE_READ);
File file2 = SPIFFS.open(target, FILE_WRITE);
Serial.flush();
if (!file)
{
Serial << "There was an error opening " << source << " for reading" << endl;
SPIFFS.end();
return false;
}
if (!file2)
{
Serial << "There was an error opening " << target << " for reading" << endl;
file.close();
SPIFFS.end();
return false;
}
while (file.available())
{
int read = file.read(buffer, 512);
if (read < 0)
{
Serial << "copy file is fucked" << endl;
file.close();
file2.close();
SPIFFS.end();
return false;
}
else
{
file.write(buffer, read);
}
}
file2.flush();
Serial << "copy finished " << source << " -> " << target << endl;
file.close();
file2.close();
SPIFFS.end();
return true;
}
void onMessage(char *incoming, char *payload, AsyncMqttClientMessageProperties properties, size_t len, size_t index, size_t total)
{
getTopic(TEST_TOPIC, testTopic);
@ -388,10 +348,20 @@ void onMessage(char *incoming, char *payload, AsyncMqttClientMessageProperties p
getTopic(BACKUP_TOPIC, backupTopic);
if (strcmp(incoming, backupTopic) == 0)
{
bool backupSucessful = copyFile("/homie/config.json", "/homie/config.old");
getTopic(BACKUP_STATUS_TOPIC, backupStatusTopic);
Homie.getMqttClient().publish(backupStatusTopic, 2, true, backupSucessful ? "true" : "false");
delete backupStatusTopic;
if (strcmp(payload, "true") == 0)
{
bool backupSucessful = copyFile(CONFIG_FILE, CONFIG_FILE_BACKUP);
printFile(CONFIG_FILE_BACKUP);
if (backupSucessful)
{
log(LOG_LEVEL_INFO, LOG_BACKUP_SUCCESSFUL, LOG_BACKUP_SUCCESSFUL_CODE);
}
else
{
log(LOG_LEVEL_INFO, LOG_BACKUP_FAILED, LOG_BACKUP_FAILED_CODE);
}
Homie.getMqttClient().publish(backupTopic, 2, true, "false");
}
}
delete backupTopic;
}
@ -401,8 +371,6 @@ void onHomieEvent(const HomieEvent &event)
switch (event.type)
{
case HomieEventType::READY_TO_SLEEP:
Serial << "Bye homie mode" << endl;
Serial.flush();
esp_deep_sleep_start();
break;
case HomieEventType::SENDING_STATISTICS:
@ -415,14 +383,8 @@ void onHomieEvent(const HomieEvent &event)
}
mSensorsRead = true; // MQTT is working, deactivate timeout logic
Serial.printf("NTP Setup with server %s\r\n", ntpServer.get());
configTime(0, 0, ntpServer.get());
Serial << "publish plants mqtt" << endl;
for (int i = 0; i < MAX_PLANTS; i++)
{
mPlants[i].postMQTTconnection();
}
{
getTopic(TEST_TOPIC, testopic)
Homie.getMqttClient()
@ -438,7 +400,6 @@ void onHomieEvent(const HomieEvent &event)
break;
case HomieEventType::OTA_STARTED:
Homie.getLogger() << "OTA started" << endl;
for (int i = 0; i < MAX_PLANTS; i++)
{
mPlants[i].deactivatePump();
@ -450,7 +411,6 @@ void onHomieEvent(const HomieEvent &event)
mDownloadMode = true;
break;
case HomieEventType::OTA_SUCCESSFUL:
Homie.getLogger() << "OTA successful" << endl;
digitalWrite(OUTPUT_ENABLE_SENSOR, LOW);
digitalWrite(OUTPUT_ENABLE_PUMP, LOW);
ESP.restart();
@ -460,31 +420,54 @@ void onHomieEvent(const HomieEvent &event)
}
}
int determineNextPump()
int determineNextPump(bool isLowLight)
{
bool isLowLight = (mSolarVoltage < SOLAR_CHARGE_MIN_VOLTAGE);
int pumpToUse = -1;
for (int i = 0; i < MAX_PLANTS; i++)
{
bool wateralarm = consecutiveWateringPlant[i] >= pumpIneffectiveWarning.get();
if (wateralarm)
{
log(LOG_LEVEL_ERROR, String(String(i) + " Plant still dry after " + String(consecutiveWateringPlant[i]) + " watering attempts"), LOG_PUMP_INEFFECTIVE);
}
Plant plant = mPlants[i];
if (!plant.isPumpTriggerActive())
{
Serial.printf("%d Skip deactivated pump\r\n", i);
plant.publishState("deactivated");
log(LOG_LEVEL_DEBUG, String(String(i) + " Skip deactivated pump"), LOG_DEBUG_CODE);
continue;
}
if ((rtcLastWateringPlant[i] > 0) && ((rtcLastWateringPlant[i] + plant.getCooldownInSeconds()) < getCurrentTime()))
if ((rtcLastWateringPlant[i] + plant.getCooldownInSeconds()) > getCurrentTime())
{
Serial.printf("%d Skipping due to cooldown %ld / %ld \r\n", i, rtcLastWateringPlant[i], plant.getCooldownInSeconds());
if (wateralarm)
{
plant.publishState("cooldown+alarm");
}
else
{
plant.publishState("cooldown");
}
log(LOG_LEVEL_DEBUG, String(String(i) + " Skipping due to cooldown " + String(rtcLastWateringPlant[i] + plant.getCooldownInSeconds())), LOG_DEBUG_CODE);
continue;
}
if (!isLowLight && plant.isAllowedOnlyAtLowLight())
{
Serial.printf("%d No pump required: due to light\r\n", i);
if (wateralarm)
{
plant.publishState("sunny+alarm");
}
else
{
plant.publishState("sunny");
}
log(LOG_LEVEL_DEBUG, String(String(i) + " No pump required: due to light"), LOG_DEBUG_CODE);
continue;
}
if (plant.getCurrentMoisture() == MISSING_SENSOR)
if (equalish(plant.getCurrentMoisture(), MISSING_SENSOR))
{
Serial.printf("%d No pump possible: missing sensor \r\n", i);
plant.publishState("nosensor");
log(LOG_LEVEL_ERROR, String(String(i) + " No pump possible: missing sensor"), LOG_MISSING_PUMP);
continue;
}
if (plant.isPumpRequired())
@ -498,18 +481,38 @@ int determineNextPump()
/* no time from NTP received */
(getCurrentTime() < 10000))
{
Serial.printf("%d Requested pumping\r\n", i);
if (wateralarm)
{
plant.publishState("active+alarm");
}
else
{
plant.publishState("active");
}
consecutiveWateringPlant[i]++;
log(LOG_LEVEL_DEBUG, String(String(i) + " Requested pumping"), LOG_DEBUG_CODE);
pumpToUse = i;
}
else
{
Serial.printf("%d ignored due to time boundary: %d to %d (current %d)\r\n", i, plant.getHoursStart(), plant.getHoursEnd(), getCurrentHour());
if (wateralarm)
{
plant.publishState("after-work+alarm");
}
else
{
plant.publishState("after-work");
}
log(LOG_LEVEL_DEBUG, String(String(i) + " ignored due to time boundary: " + String(plant.getHoursStart()) + " to " + String(plant.getHoursEnd()) + " ( current " + String(getCurrentHour()) + " )"), LOG_DEBUG_CODE);
}
continue;
}
else
{
Serial.printf("%d No pump required: moisture acceptable %f / %ld\r\n", i, plant.getCurrentMoisture(), plant.getSettingsMoisture());
plant.publishState("wet");
//plant was detected as wet, remove consecutive count
consecutiveWateringPlant[i] = 0;
}
}
return pumpToUse;
@ -526,9 +529,10 @@ int determineNextPump()
bool aliveHandler(const HomieRange &range, const String &value)
{
if (range.isRange)
{
return false; // only one controller is present
Serial.println("aliuve handler");
Serial.flush();
}
if (value.equals("ON") || value.equals("On") || value.equals("1"))
{
mDownloadMode = true;
@ -552,10 +556,45 @@ void homieLoop()
{
Serial.println("received alive & mqtt is ready");
notStarted = false;
plantcontrol(true);
plantcontrol();
}
}
bool switch1(const HomieRange &range, const String &value)
{
return mPlants[0].switchHandler(range, value);
}
bool switch2(const HomieRange &range, const String &value)
{
return mPlants[1].switchHandler(range, value);
}
bool switch3(const HomieRange &range, const String &value)
{
return mPlants[2].switchHandler(range, value);
}
bool switch4(const HomieRange &range, const String &value)
{
return mPlants[3].switchHandler(range, value);
}
bool switch5(const HomieRange &range, const String &value)
{
return mPlants[4].switchHandler(range, value);
}
bool switch6(const HomieRange &range, const String &value)
{
return mPlants[5].switchHandler(range, value);
}
bool switch7(const HomieRange &range, const String &value)
{
return mPlants[6].switchHandler(range, value);
}
/**
* @brief Startup function
* Is called once, the controller is started
@ -571,13 +610,27 @@ void setup()
WiFi.mode(WIFI_OFF);
Serial.flush();
//restore state before releasing pin, to prevent flickering
#if defined(TIMED_LIGHT_PIN)
pinMode(TIMED_LIGHT_PIN, OUTPUT);
digitalWrite(TIMED_LIGHT_PIN, timedLightOn);
gpio_hold_dis(TIMED_LIGHT_PIN);
#endif // TIMED_LIGHT_PIN
gpio_hold_dis(OUTPUT_PUMP0);
gpio_hold_dis(OUTPUT_PUMP1);
gpio_hold_dis(OUTPUT_PUMP2);
gpio_hold_dis(OUTPUT_PUMP3);
gpio_hold_dis(OUTPUT_PUMP4);
gpio_hold_dis(OUTPUT_PUMP5);
gpio_hold_dis(OUTPUT_PUMP6);
gpio_hold_dis(OUTPUT_ENABLE_PUMP);
/* Intialize Plant */
for (int i = 0; i < MAX_PLANTS; i++)
{
mPlants[i].init();
}
Serial.println("plants init");
Serial.flush();
// read button
pinMode(BUTTON, INPUT);
@ -590,7 +643,13 @@ void setup()
if (HomieInternals::MAX_CONFIG_SETTING_SIZE < MAX_CONFIG_SETTING_ITEMS)
{
//increase the config settings to 50 and the json to 3000
//increase the config settings
Serial << "Limits.hpp is not adjusted, please search for this string and increase" << endl;
return;
}
if (HomieInternals::MAX_JSON_CONFIG_FILE_SIZE < MAX_JSON_CONFIG_FILE_SIZE_CUSTOM)
{
//increase the config settings
Serial << "Limits.hpp is not adjusted, please search for this string and increase" << endl;
return;
}
@ -623,11 +682,13 @@ void setup()
Serial.flush();
/************************* Start Homie Framework ***************/
Homie_setFirmware("PlantControl", FIRMWARE_VERSION);
Homie.disableLedFeedback();
Homie_setBrand("PlantControl");
// Set default values
//in seconds
deepSleepTime.setDefaultValue(600).setValidator([](long candidate) { return (candidate > 0) && (candidate < (60 * 60 * 2) /** 2h max sleep */); });
deepSleepTime.setDefaultValue(600).setValidator([](long candidate)
{ return (candidate > 0) && (candidate < (60 * 60 * 2) /** 2h max sleep */); });
deepSleepNightTime.setDefaultValue(600);
wateringDeepSleep.setDefaultValue(5);
ntpServer.setDefaultValue("pool.ntp.org");
@ -638,20 +699,40 @@ void setup()
waterLevelVol.setDefaultValue(5000); /* 5l in ml */
lipoSensorAddr.setDefaultValue("");
waterSensorAddr.setDefaultValue("");
pumpIneffectiveWarning.setDefaultValue(5).setValidator([](long candidate)
{ return (candidate > 0) && (candidate < (20)); });
#if defined(TIMED_LIGHT_PIN)
timedLightStart.setDefaultValue(18).setValidator([](long candidate)
{ return (candidate > 0) && (candidate < (25)); });
timedLightEnd.setDefaultValue(23).setValidator([](long candidate)
{ return (candidate > 0) && (candidate < (24)); });
timedLightOnlyWhenDark.setDefaultValue(true);
timedLightVoltageCutoff.setDefaultValue(3.8).setValidator([](double candidate)
{ return (candidate > 3.3) && (candidate < (4.2)); });
#endif // TIMED_LIGHT_PIN
Homie.setLoopFunction(homieLoop);
Homie.onEvent(onHomieEvent);
//Homie.disableLogging();
Homie.setup();
mConfigured = Homie.isConfigured();
if (mConfigured)
{
for (int i = 0; i < MAX_PLANTS; i++)
{
mPlants[i].advertise();
}
mPlants[0].setSwitchHandler(switch1);
mPlants[1].setSwitchHandler(switch2);
mPlants[2].setSwitchHandler(switch3);
mPlants[3].setSwitchHandler(switch4);
mPlants[4].setSwitchHandler(switch5);
mPlants[5].setSwitchHandler(switch6);
mPlants[6].setSwitchHandler(switch7);
sensorTemp.advertise(TEMPERATUR_SENSOR_LIPO)
.setName(TEMPERATURE_NAME)
.setDatatype(NUMBER_TYPE)
@ -686,7 +767,23 @@ void setup()
}
else
{
readOneWireSensors(false);
if (doesFileExist(CONFIG_FILE))
{
printFile(CONFIG_FILE);
}
if (doesFileExist(CONFIG_FILE_BACKUP))
{
printFile(CONFIG_FILE_BACKUP);
bool restoredConfig = copyFile(CONFIG_FILE_BACKUP, CONFIG_FILE);
if (restoredConfig)
{
deleteFile(CONFIG_FILE_BACKUP);
espDeepSleepFor(1, false);
return;
}
}
readOneWireSensors();
//prevent BOD to be paranoid
WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0);
digitalWrite(OUTPUT_ENABLE_PUMP, HIGH);
@ -749,12 +846,12 @@ void loop()
WiFi.mode(WIFI_OFF);
Serial << "Wifi mode set to " << WIFI_OFF << " mqqt was no reached within " << timeSinceSetup << "ms , fallback to offline mode " << endl;
Serial.flush();
plantcontrol(false);
plantcontrol();
}
}
/** Timeout always stopping the ESP -> no endless power consumption */
if (millis() > 60000 && !mDownloadMode)
if (millis() > ESP_STALE_TIMEOUT && !mDownloadMode)
{
Serial << (millis() / 1000) << "not terminated watchdog reset" << endl;
Serial.flush();
@ -766,7 +863,7 @@ void loop()
* @fn plantcontrol
* Main function, doing the logic
*/
void plantcontrol(bool withHomie)
void plantcontrol()
{
if (lastPumpRunning != -1)
{
@ -776,29 +873,17 @@ void plantcontrol(bool withHomie)
Serial << "Plant" << lastPumpRunning << ": Water diff " << waterDiff << " mm" << endl;
}
readOneWireSensors(true);
for (int i = 0; i < MAX_PLANTS; i++)
if (mAliveWasRead)
{
long raw = mPlants[i].getCurrentMoisture();
long pct = 100 - map(raw, MOIST_SENSOR_MIN_ADC, MOIST_SENSOR_MAX_ADC, 0, 100);
if (raw == MISSING_SENSOR)
for (int i = 0; i < MAX_PLANTS; i++)
{
pct = 0;
mPlants[i].postMQTTconnection();
mPlants[i].setProperty("consecutivePumps").send(String(consecutiveWateringPlant[i]));
}
if (pct < 0)
{
pct = 0;
}
if (pct > 100)
{
pct = 100;
}
mPlants[i].setProperty("moist").send(String(pct));
mPlants[i].setProperty("moistraw").send(String(raw));
}
readOneWireSensors();
Serial << "W : " << waterRawSensor.getAverage() << " cm (" << String(waterLevelMax.get() - waterRawSensor.getAverage()) << "%)" << endl;
lastWaterValue = waterRawSensor.getAverage();
@ -806,10 +891,17 @@ void plantcontrol(bool withHomie)
float chipTemp = battery.getTemperature();
Serial << "Chip Temperatur " << chipTemp << " °C " << endl;
if (withHomie)
if (mAliveWasRead)
{
sensorWater.setProperty("remaining").send(String(waterLevelMax.get() - waterRawSensor.getAverage()));
sensorWater.setProperty("distance").send(String(waterRawSensor.getAverage()));
float remaining = waterLevelMax.get() - waterRawSensor.getAverage();
if (!isnan(remaining))
{
sensorWater.setProperty("remaining").send(String(remaining));
}
if (!isnan(waterRawSensor.getAverage()))
{
sensorWater.setProperty("distance").send(String(waterRawSensor.getAverage()));
}
sensorLipo.setProperty("percent").send(String(100 * batteryVoltage / VOLT_MAX_BATT));
sensorLipo.setProperty("volt").send(String(batteryVoltage));
sensorLipo.setProperty("current").send(String(battery.getCurrent()));
@ -826,18 +918,19 @@ void plantcontrol(bool withHomie)
Serial.flush();
}
bool isLowLight = (mSolarVoltage < SOLAR_CHARGE_MIN_VOLTAGE);
bool hasWater = true; //FIXMEmWaterGone > waterLevelMin.get();
//FIXME no water warning message
lastPumpRunning = determineNextPump();
lastPumpRunning = determineNextPump(isLowLight);
if (lastPumpRunning != -1 && !hasWater)
{
Serial.println("Want to pump but no water");
log(LOG_LEVEL_ERROR, LOG_PUMP_BUTNOTANK_MESSAGE, LOG_PUMP_BUTNOTANK_CODE);
}
else if (lastPumpRunning != -1 && hasWater)
{
if (mDownloadMode)
{
Serial.println("Mode 3 active, ignoring pump request");
log(LOG_LEVEL_INFO, LOG_PUMP_AND_DOWNLOADMODE, LOG_PUMP_AND_DOWNLOADMODE_CODE);
}
else
{
@ -852,26 +945,87 @@ void plantcontrol(bool withHomie)
}
}
#if defined(TIMED_LIGHT_PIN)
bool shouldLight = determineTimedLightState(isLowLight);
timedLightOn = shouldLight;
digitalWrite(TIMED_LIGHT_PIN, shouldLight);
#endif // TIMED_LIGHT_PIN
/* Always handle one of the deep sleep duration */
if (lastPumpRunning == -1 || !hasWater)
{
if (mSolarVoltage < SOLAR_CHARGE_MIN_VOLTAGE)
{
Serial.print(mSolarVoltage);
Serial.println("V! No pumps to activate and low light, deepSleepNight");
espDeepSleepFor(deepSleepNightTime.get(), false, withHomie);
log(LOG_LEVEL_INFO, String(String(mSolarVoltage) + "V! No pumps to activate and low light, deepSleepNight"), LOG_NOPUMP_LOWLIGHT);
espDeepSleepFor(deepSleepNightTime.get(), false);
}
else
{
Serial.println("No pumps to activate, deepSleep");
espDeepSleepFor(deepSleepTime.get(), false, withHomie);
log(LOG_LEVEL_INFO, "No pumps to activate, deepSleep", LOG_NOPUMPS);
espDeepSleepFor(deepSleepTime.get(), false);
}
}
else
{
Serial.println("Running pump, watering deepsleep");
espDeepSleepFor(wateringDeepSleep.get(), true, withHomie);
espDeepSleepFor(wateringDeepSleep.get(), true);
}
}
/** @}*/
bool determineTimedLightState(bool lowLight){
bool onlyAllowedWhenDark = timedLightOnlyWhenDark.get();
long hoursStart = timedLightStart.get();
long hoursEnd = timedLightEnd.get();
//ntp missing
if(getCurrentTime() < 10000){
timedLightNode.setProperty("state").send(String("Off, missing ntp"));
return false;
}
if(onlyAllowedWhenDark && !lowLight){
timedLightNode.setProperty("state").send(String("Off, not dark"));
return false;
}
if (((hoursStart > hoursEnd) &&
(getCurrentHour() >= hoursStart || getCurrentHour() <= hoursEnd)) ||
/* Handle e.g. start = 8, end = 21 */
((hoursStart < hoursEnd) &&
(getCurrentHour() >= hoursStart && getCurrentHour() <= hoursEnd)))
{
if(battery.getVoltage(BATTSENSOR_INDEX_BATTERY) >= timedLightVoltageCutoff.get() ){
timedLightNode.setProperty("state").send(String("On"));
return true;
}else {
timedLightNode.setProperty("state").send(String("Off, due to missing voltage"));
return false;
}
} else {
timedLightNode.setProperty("state").send(String("Off, outside worktime"));
return false;
}
}
void log(int level, String message, int statusCode)
{
String buffer;
StaticJsonDocument<200> doc;
doc["level"] = level;
doc["message"] = message;
doc["statusCode"] = statusCode;
serializeJson(doc, buffer);
if (mAliveWasRead)
{
getTopic(LOG_TOPIC, logTopic)
Homie.getMqttClient()
.subscribe(logTopic, 2);
Homie.getMqttClient().publish(logTopic, 2, false, buffer.c_str());
delete logTopic;
}
Serial << statusCode << "@" << level << " : " << message << endl;
}

View File

@ -1,174 +1,52 @@
#include <Arduino.h>
#include "esp_sleep.h"
#include "DallasTemperature.h"
#include "DS2438.h"
#include "driver/pcnt.h"
#define uS_TO_S_FACTOR 1000000 /* Conversion factor for micro seconds to seconds */
#define TIME_TO_SLEEP 5 /* Time ESP32 will go to sleep (in seconds) */
#define OUTPUT_SENSOR 14 /**< GPIO 16 - Enable Sensors */
#define SENSOR_PLANT5 39 /**< SENSOR vn */
#define SENSOR_PLANT6 36 /**< SENSOR VP */
#define SENSOR_DS18B20 2 /**< GPIO 2 */
#define OUTPUT_PUMP0 17 /**< GPIO 23 */
#define OUTPUT_PUMP1 05 /**< GPIO 22 */
#define OUTPUT_PUMP2 18 /**< GPIO 21 */
#define OUTPUT_PUMP3 19 /**< GPIO 19 */
#define OUTPUT_PUMP4 21 /**< GPIO 18 */
#define OUTPUT_PUMP5 15 /**< GPIO 5 */
#define OUTPUT_PUMP6 23 /**< GPIO 15 */
#define OUTPUT_SENSOR 16 /**< GPIO 16 - Enable Sensors */
#define OUTPUT_PUMP 13 /**< GPIO 13 - Enable Pumps */
#define SENSOR_PLANT0 32 /**< GPIO 32 (ADC1) */
#define ADC_TO_VOLT(adc) ((adc) * 3.3 ) / 4095)
#define ADC_TO_VOLT_WITH_MULTI(adc, multi) (((adc) * 3.3 * (multi)) / 4095)
#define SOLAR_VOLT(adc) ADC_TO_VOLT_WITH_MULTI(adc, 4.0306) /**< 100k and 33k voltage dividor */
#define ADC_5V_TO_3V3(adc) ADC_TO_VOLT_WITH_MULTI(adc, 1.7) /**< 33k and 47k8 voltage dividor */
RTC_DATA_ATTR int bootCount = 0;
RTC_DATA_ATTR int pumpActive = 0;
int secondBootCount = 0;
OneWire oneWire(SENSOR_DS18B20);
DallasTemperature temp(&oneWire);
DS2438 battery(&oneWire,0.1f);
void print_wakeup_reason(){
esp_sleep_wakeup_cause_t wakeup_reason;
wakeup_reason = esp_sleep_get_wakeup_cause();
switch(wakeup_reason){
case ESP_SLEEP_WAKEUP_EXT0 : Serial.println("Wakeup caused by external signal using RTC_IO"); break;
case ESP_SLEEP_WAKEUP_EXT1 : Serial.println("Wakeup caused by external signal using RTC_CNTL"); break;
case ESP_SLEEP_WAKEUP_TIMER : Serial.println("Wakeup caused by timer"); break;
case ESP_SLEEP_WAKEUP_TOUCHPAD : Serial.println("Wakeup caused by touchpad"); break;
case ESP_SLEEP_WAKEUP_ULP : Serial.println("Wakeup caused by ULP program"); break;
default : Serial.printf("Wakeup was not caused by deep sleep: %d\r\n",wakeup_reason); break;
}
}
bool whatever = true;
void setAll2to(int state) {
Serial.println("Set GPIO" + String(OUTPUT_PUMP0) + "=" + String(state));
digitalWrite(OUTPUT_PUMP0, state);
Serial.println("Set GPIO" + String(OUTPUT_PUMP1) + "=" + String(state));
digitalWrite(OUTPUT_PUMP1, state);
Serial.println("Set GPIO" + String(OUTPUT_PUMP2) + "=" + String(state));
digitalWrite(OUTPUT_PUMP2, state);
Serial.println("Set GPIO" + String(OUTPUT_PUMP3) + "=" + String(state));
digitalWrite(OUTPUT_PUMP3, state);
Serial.println("Set GPIO" + String(OUTPUT_PUMP4) + "=" + String(state));
digitalWrite(OUTPUT_PUMP4, state);
Serial.println("Set GPIO" + String(OUTPUT_PUMP5) + "=" + String(state));
digitalWrite(OUTPUT_PUMP5, state);
Serial.println("Set GPIO" + String(OUTPUT_PUMP6) + "=" + String(state));
digitalWrite(OUTPUT_PUMP6, state);
Serial.println("Set GPIO" + String(OUTPUT_SENSOR) + "=" + String(state));
digitalWrite(OUTPUT_SENSOR, state);
}
int16_t pulses = 0;
int16_t pulses2 = 0;
void setup() {
Serial.begin(115200);
pinMode(OUTPUT_PUMP0, OUTPUT);
pinMode(OUTPUT_PUMP1, OUTPUT);
pinMode(OUTPUT_PUMP2, OUTPUT);
pinMode(OUTPUT_PUMP3, OUTPUT);
pinMode(OUTPUT_PUMP4, OUTPUT);
pinMode(OUTPUT_PUMP5, OUTPUT);
pinMode(OUTPUT_PUMP6, OUTPUT);
pinMode(OUTPUT_SENSOR, OUTPUT);
pinMode(OUTPUT_PUMP, OUTPUT);
pinMode(SENSOR_PLANT0, ANALOG);
pinMode(SENSOR_PLANT5, INPUT);
//Increment boot number and print it every reboot
++bootCount;
++secondBootCount;
Serial.println("Boot number: " + String(bootCount) + " " + String(secondBootCount));
pcnt_config_t pcnt_config = { }; // Instancia PCNT config
//Print the wakeup reason for ESP32
print_wakeup_reason();
Serial.println("------- build from " + String(__DATE__) + "=" + String(__TIME__) + " @ " + String(millis()) + "ms");
Serial.println("Set GPIO" + String(OUTPUT_PUMP) + "=" + String(LOW));
digitalWrite(OUTPUT_PUMP, LOW);
pcnt_config.pulse_gpio_num = SENSOR_PLANT5; // Configura GPIO para entrada dos pulsos
pcnt_config.ctrl_gpio_num = PCNT_PIN_NOT_USED; // Configura GPIO para controle da contagem
pcnt_config.unit = PCNT_UNIT_0; // Unidade de contagem PCNT - 0
pcnt_config.channel = PCNT_CHANNEL_0; // Canal de contagem PCNT - 0
pcnt_config.counter_h_lim = INT16_MAX; // Limite maximo de contagem - 20000
pcnt_config.pos_mode = PCNT_COUNT_INC; // Incrementa contagem na subida do pulso
pcnt_config.neg_mode = PCNT_COUNT_DIS; // Incrementa contagem na descida do pulso
pcnt_config.lctrl_mode = PCNT_MODE_KEEP; // PCNT - modo lctrl desabilitado
pcnt_config.hctrl_mode = PCNT_MODE_KEEP; // PCNT - modo hctrl - se HIGH conta incrementando
pcnt_unit_config(&pcnt_config); // Configura o contador PCNT
setAll2to(HIGH);
delay(1000);
Serial.println("--------------------------" + String(" @ ") + String(millis()) + "ms");
setAll2to(LOW);
delay(1000);
Serial.println("--------------------------" + String(" @ ") + String(millis()) + "ms");
/* activate power pump and pump 0 */
pcnt_counter_pause(PCNT_UNIT_0); // Pausa o contador PCNT
pcnt_counter_clear(PCNT_UNIT_0); // Zera o contador PCNT
digitalWrite(OUTPUT_SENSOR, HIGH);
delay(1);
temp.begin();
battery.begin();
Serial.print("Battery");
Serial.print("\t");
Serial.print("Solar");
Serial.print("\t");
Serial.print("Bat I");
Serial.print("\t");
Serial.println("Temp/10");
Serial.println("Start done");
}
void loop() {
static int loop=1;
DeviceAddress t;
for(int i=0; i < sizeof(t); i++) {
t[i] = loop + i*2;
}
char buf[sizeof(DeviceAddress)*2];
snprintf(buf, sizeof(buf), "%.2X%.2X%.2X%.2X%.2X%.2X%.2X%.2X", t[0], t[1], t[2], t[3], t[4], t[5], t[6], t[7]);
/*
%X -> linksbündige hexzahl
%2X -> 2Stellige hexzahl ... dynamisch erweitert
%0.2X -> 2stellige hexzahl mit führerder "0"
*/
printf("Print: %s\n", buf);
loop++;
delay(500);
return;
whatever = !whatever;
digitalWrite(OUTPUT_PUMP, HIGH);
delay(500);
digitalWrite(OUTPUT_PUMP6, HIGH);
for(int j=0; j < 5 && temp.getDeviceCount() == 0; j++) {
delay(10);
// Serial.println("Reset 1wire temp");
temp.begin();
}
for(int j=0; j < 5 && (0 == battery.isFound()); j++) {
delay(10);
Serial.println("Reset 1wire bat");
battery.begin();
battery.update();
}
battery.update();
Serial.print(battery.getVoltage(0)); //use define here, solar
Serial.print("\t");
Serial.print(battery.getVoltage(1)); //use define here, battery
Serial.print("\t");
Serial.print(battery.getCurrent());
Serial.print("\t");
Serial.println(battery.getTemperature()/10);
pulses2 = pulseIn(SENSOR_PLANT5,HIGH);
pcnt_counter_resume(PCNT_UNIT_0);
delay(500);
pcnt_counter_pause(PCNT_UNIT_0);
pcnt_get_counter_value(PCNT_UNIT_0, &pulses);
pcnt_counter_clear(PCNT_UNIT_0);
Serial.println(pulses2*2);
Serial.println(pulses*2);
}