mirror of
https://github.com/anklimov/lighthub
synced 2025-12-06 11:49:51 +03:00
Merge pull request #57 from anklimov/develop
RC Release notes: ===== OTA Universal Modbus (Read only) Syslog fixes MCP23017 driver StatusLED Moved to upstream Ethernet library for WizNet Multiply buttons on single analog input Refactoring LAN StateMachine and many relability improvements
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
-DCONTROLLINO
|
||||
-DCUSTOM_FIRMWARE_MAC=de:ad:be:ef:fe:07
|
||||
-DWiz5100
|
||||
|
||||
7
build-flags/build_flags_due
Normal file
7
build-flags/build_flags_due
Normal file
@@ -0,0 +1,7 @@
|
||||
#-DW5500_CS_PIN=53
|
||||
-DDMX_SMOOTH
|
||||
-DSYSLOG_ENABLE
|
||||
-DMODBUS_DIMMER_PARAM=SERIAL_8E1
|
||||
-DARTNET_ENABLE
|
||||
-DOTA
|
||||
-DSTATUSLED
|
||||
@@ -1 +1,5 @@
|
||||
#NO special flags
|
||||
-DARTNET_ENABLE
|
||||
-DDMX_SMOOTH
|
||||
-DSTATUSLED
|
||||
-DSYSLOG_ENABLE
|
||||
-DWiz5100
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
-DWiz5500
|
||||
-DARTNET_ENABLE
|
||||
-DDMX_SMOOTH
|
||||
-DSTATUSLED
|
||||
-DSYSLOG_ENABLE
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
-DWIFI_ENABLE
|
||||
-DDMX_DISABLE
|
||||
# - exeption in DMX.update/begin
|
||||
#-DSPILED_DISABLE
|
||||
#-DAC_DISABLE
|
||||
-DMODBUS_DISABLE
|
||||
-DOWIRE_DISABLE
|
||||
-DDHT_DISABLE
|
||||
#-DMBUS_DISABLE
|
||||
-DCOUNTER_DISABLE
|
||||
-DSPILED_DISABLE
|
||||
-DAC_DISABLE
|
||||
#-DM5STACK
|
||||
#-DSYSLOG_ENABLE - udp errors
|
||||
-DOTA
|
||||
-DMCP23017
|
||||
-DMODBUS_TX_PIN=13
|
||||
#-DARTNET_ENABLE - udp rx errors ((
|
||||
#-DUSE_1W_PIN=16
|
||||
#-DW5500_CS_PIN=15
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
-DWIFI_ENABLE
|
||||
-DMODBUS_DISABLE
|
||||
#-DCOUNTER_DISABLE
|
||||
-DOTA
|
||||
-std=gnu++11
|
||||
-DSYSLOG_ENABLE
|
||||
-DMCP23017
|
||||
-DARTNET_ENABLE
|
||||
-DUSE_1W_PIN=16
|
||||
-DW5500_CS_PIN=15
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
-DWiz5500
|
||||
-DW5500_CS_PIN=53
|
||||
-DARTNET_ENABLE
|
||||
-DDMX_SMOOTH
|
||||
-DMODBUS_DIMMER_PARAM=SERIAL_8N1
|
||||
-DMODBUS_DIMMER_PARAM=SERIAL_8E1
|
||||
-DMODBUS_SERIAL_BAUD=9600
|
||||
-DOTA
|
||||
-DSYSLOG_ENABLE
|
||||
#-DWiz5500
|
||||
-DSTATUSLED
|
||||
-DMCP23017
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-DWIFI_ENABLE
|
||||
-DDMX_DISABLE
|
||||
-DMODBUS_DISABLE
|
||||
-DOWIRE_DISABLE
|
||||
@@ -6,3 +7,5 @@
|
||||
-DSPILED_DISABLE
|
||||
-DAC_DISABLE
|
||||
-DM5STACK
|
||||
#-DSYSLOG_ENABLE
|
||||
-DUSE_1W_PIN=16
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
-DMODBUS_DIMMER_PARAM=SERIAL_8E1
|
||||
-DAVR_DMXOUT_PIN=18
|
||||
-DSYSLOG_ENABLE
|
||||
-DWiz5100
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-DWiz5500
|
||||
-DMODBUS_DIMMER_PARAM=SERIAL_8E1
|
||||
-DAVR_DMXOUT_PIN=18
|
||||
-DSYSLOG_ENABLE
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
-DMODBUS_DIMMER_PARAM=SERIAL_8E1
|
||||
-DAVR_DMXOUT_PIN=18
|
||||
14
build-flags/build_flags_mega2560slim-5100
Normal file
14
build-flags/build_flags_mega2560slim-5100
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
#-DMODBUS_DIMMER_PARAM=SERIAL_8E1
|
||||
#-DAVR_DMXOUT_PIN=18
|
||||
-DDMX_DISABLE
|
||||
-DMODBUS_DISABLE
|
||||
#-DMBUS_DISABLE
|
||||
#-DOWIRE_DISABLE
|
||||
-DDHT_DISABLE
|
||||
-DCOUNTER_DISABLE
|
||||
-DNO_HOMIE
|
||||
-DCSSHDC_DISABLE
|
||||
-DSPILED_DISABLE
|
||||
-DAC_DISABLE
|
||||
-DSYSLOG_ENABLE
|
||||
@@ -9,3 +9,5 @@
|
||||
-DCSSHDC_DISABLE
|
||||
-DSPILED_DISABLE
|
||||
-DAC_DISABLE
|
||||
-DSYSLOG_ENABLE
|
||||
-DMBUS_DISABLE
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
-DDMX_DISABLE
|
||||
-DMODBUS_DISABLE
|
||||
-DMBUS_DISABLE
|
||||
-DOWIRE_DISABLE
|
||||
-DDHT_DISABLE
|
||||
-DCOUNTER_DISABLE
|
||||
|
||||
137
compiled/DUE_16u2_reflash/16u2-original.hex
Normal file
137
compiled/DUE_16u2_reflash/16u2-original.hex
Normal file
@@ -0,0 +1,137 @@
|
||||
:20000000A7C00000C0C00000BEC00000BCC00000BAC00000B8C00000B6C00000B4C0000023
|
||||
:20002000B2C00000B0C00000AEC00000CBC400008FC40000A8C00000A6C00000A4C000005C
|
||||
:20004000A2C00000A0C000009EC000009CC000009AC0000098C0000096C0000021C100003A
|
||||
:2000600092C0000090C000008EC000008CC000008AC0000088C0000086C0000084C0000028
|
||||
:2000800082C0000080C000007EC000007CC000007AC0000078C000001201100102000008C4
|
||||
:2000A00041233D0001000102DC0109023E00020100C0320904000001020201000524000143
|
||||
:2000C00010042402060524060001070582030800FF09040100020A000000070504024000AC
|
||||
:2000E0000107058302400001040309043203410072006400750069006E006F0020002800CA
|
||||
:200100007700770077002E00610072006400750069006E006F002E0063006300290000003D
|
||||
:200120002E03410072006400750069006E006F0020004400750065002000500072006F002D
|
||||
:2001400067002E00200050006F0072007400000011241FBECFEFD2E0DEBFCDBF11E0A0E029
|
||||
:20016000B1E0E8EEF0E102C005900D92A831B107D9F712E0A8E1B1E001C01D92A833B107E1
|
||||
:20018000E1F722D1AFC73CCF9C01DC01AE57BF4FED91FC91119741911196FC93EE93805872
|
||||
:2001A0009F4FE817F90711F42D933C939FB7F894F901EC57FF4F8081815080839FBF842F6B
|
||||
:2001C0000895882311F03F9A01C03F9847980895882311F046980895469A0895DF92EF9253
|
||||
:2001E000FF920F931F93FC018489813019F0823019F404C010E303C010E001C010E283896E
|
||||
:20020000823009F418608589873031F0883031F0863029F4126003C0146001C016601092A3
|
||||
:20022000C9001092C8001092CA000785F088E188D288202F3F2D4E2D5D2D10921E01203B7C
|
||||
:2002400084E0380780E0480780E0580719F481E080931E01CA01B90122E030E040E050E006
|
||||
:2002600026D720583B47414E5F4FCA01B901202F3F2D4E2D5D2DF9D6215030403093CD00C5
|
||||
:200280002093CC001093CA0082E08093C80088E98093C9001F910F91FF90EF90DF9008957E
|
||||
:2002A0001F920F920FB60F9211242F938F939F93EF93FF939091CE008EB38430F1F4E091ED
|
||||
:2002C000A201F091A3019083E091A201F091A301CF0101969093A3018093A201825A914079
|
||||
:2002E00021F482E291E0928381839FB7F8948091A6018F5F8093A6019FBFFF91EF919F911B
|
||||
:200300008F912F910F900FBE0F901F901895FC0140911A0140931B0180911C0180931D015F
|
||||
:200320008585282F30E02170307020931A01858590E096958795817080931C0180911E013B
|
||||
:20034000882339F08FE590E090931901809318010895442341F4222331F08EE190E09093DB
|
||||
:20036000190180931801089580E091E014C680E091E0C7C51F9384B7877F84BF18E10FB69E
|
||||
:20038000F89410936000109260000FBE80E019DF469A3E9A87E690E09093CD008093CC0043
|
||||
:2003A00086E08093CA001092C8001093C900539A5A9A8AB180638AB98BB180638BB9BDD2F0
|
||||
:2003C00084E085BD1F9108950F931F93CF93DF93D1DF2FB7F89487EA91E09093280280939E
|
||||
:2003E000270290932A02809329022FBF2FB7F89482E291E09093A3018093A2019093A501CC
|
||||
:200400008093A4012FBF7894C7EAD1E003E08FB7F89490912B028FBF903809F180E091E0E4
|
||||
:20042000E6D497FD1CC0E0912702F09128028083E0912702F0912802CF0101969093280251
|
||||
:20044000809327028752924011F4D283C1839FB7F89480912B028F5F80932B029FBF8FB725
|
||||
:20046000F8941091A6018FBFA89903C0113608F469C0A89A8091A601882361F05D9800936C
|
||||
:200480001F0108C082E291E07FDE682F80E091E014D511501123B1F780911F01882351F097
|
||||
:2004A00080911F01815080931F0180911F01882309F45D9A80912001882351F080912001E7
|
||||
:2004C00081508093200180912001882309F45C9A8091180190911901181619067CF58F3560
|
||||
:2004E000910521F481E074DE80E06BDE8091180190911901839721F480E06ADE80E061DE1A
|
||||
:200500008091180190911901499721F480E060DE81E057DE8091180190911901019721F43B
|
||||
:2005200080E056DE80E04DDE80911801909119010197909319018093180104C080E048DEEC
|
||||
:2005400080E03FDE8FB7F89490912B028FBF992369F087EA91E018DE982F8091C80085FF9F
|
||||
:20056000FCCF9093CE005C980093200180E091E095D42AD44CCFDA01923049F0933061F0DA
|
||||
:200580009130F9F4E8E9F0E022E130E01EC0EAEAF0E02EE330E019C0813049F0813018F0DA
|
||||
:2005A000823079F408C0E8EEF0E0849107C0ECEEF0E0849103C0E0E2F1E08491282F30E041
|
||||
:2005C00004C0E0E0F0E020E030E0ED93FC93C901089528E030E040E003C04F5F220F331F15
|
||||
:2005E00028173907D0F3842F8295807F08958093E9008091EB0081608093EB001092ED00ED
|
||||
:200600006093EC004093ED008091EE00881F8827881F08951092F40090E09093E9001092EE
|
||||
:20062000F0001092E8001092ED008091EB008E7F8093EB009F5F953081F70895809130028F
|
||||
:2006400088238CF403C08EB38823B1F08091E80082FFF9CF8091E8008B778093E80008954A
|
||||
:200660008EB3882349F08091E80080FFF9CF8091E8008E778093E800089594E68091EC0008
|
||||
:2006800080FF05C08091E80080FF05C023C08091E80082FD1FC08EB3882311F482E00895AF
|
||||
:2006A0008EB3853011F483E008958091EB0085FF02C081E008958091E10082FFDFCF8091CD
|
||||
:2006C000E1008B7F8093E100992311F484E008959150D4CF80E008959C0140913602509171
|
||||
:2006E00037024617570718F4F90120E038C06115710511F0AB01F8CF8091E8008E77809397
|
||||
:20070000E80040E050E0F0CF8091E80083FF02C081E008958091E80082FD2DC08EB3882356
|
||||
:2007200081F18EB3853079F18091E80080FF17C09091F20006C081918093F1004150504088
|
||||
:200740009F5F4115510511F09830A8F320E0983009F421E08091E8008E778093E800411576
|
||||
:20076000510591F6222381F606C08EB3882349F08EB3853041F08091E80082FFF6CF80E02F
|
||||
:20078000089582E0089583E008959C0140913602509137024617570710F490E03BC061155D
|
||||
:2007A000710511F0AB01F9CF8091E8008E778093E80040E050E0F1CF8091E80083FF02C008
|
||||
:2007C00081E008958091E80082FD30C08EB3882399F18EB3853091F18091E80080FF1AC073
|
||||
:2007E0008091F20009C0F9012F5F3F4FE491E093F100415050408F5F4115510511F08830CA
|
||||
:2008000090F390E0883009F491E08091E8008E778093E8004115510579F6992369F606C0CA
|
||||
:200820008EB3882349F08EB3853041F08091E80082FFF6CF80E0089582E0089583E0089531
|
||||
:200840009C016115710529F48091E8008B778093E800F90120C08091E80083FF02C081E084
|
||||
:2008600008958EB3882339F18EB3853031F18091E80082FFF0CF06C08091F10081936150E7
|
||||
:20088000704021F08091F2008823B1F78091E8008B778093E80061157105E9F606C08EB379
|
||||
:2008A000882349F08EB3853041F08091E80080FFF6CF80E0089582E0089583E0089542D0E2
|
||||
:2008C00044D01EBA10922E0210922D0210922C0284E089BD89B5826089BD09B400FEFDCF22
|
||||
:2008E0008091D800982F9F779093D80080688093D800809163008E7F809363008091D80084
|
||||
:200900008F7D8093D8008091E0008E7F8093E0008091E1008E7F8093E1008091E200816028
|
||||
:200920008093E2008091E100877F8093E1008091E20088608093E2000895C1DF81E0809355
|
||||
:200940002F0208951092E20008951092E10008951F920F920FB60F9211241F932F933F9355
|
||||
:200960004F935F936F937F938F939F93AF93BF93EF93FF93E9EEF0E0108117701082E0EF73
|
||||
:20098000F0E08081877F80837894C3D0F894A9EEB0E01C92E0EFF0E08081886080831C9343
|
||||
:2009A000FF91EF91BF91AF919F918F917F916F915F914F913F912F911F910F900FBE0F901C
|
||||
:2009C0001F9018951F920F920FB60F9211242F933F934F935F936F937F938F939F93AF93BC
|
||||
:2009E000BF93EF93FF938091E10080FF1BC08091E20080FF17C08091E1008E7F8093E10009
|
||||
:200A00008091E2008E7F8093E2008091E20080618093E2008091D80080628093D80019BC8D
|
||||
:200A20001EBAD1D18091E10084FF29C08091E20084FF25C084E089BD89B5826089BD09B4B6
|
||||
:200A400000FEFDCF8091D8008F7D8093D8008091E1008F7E8093E1008091E2008F7E8093E6
|
||||
:200A6000E2008091E20081608093E20080912E02882311F481E001C084E08EBBA4D1809185
|
||||
:200A8000E10083FF27C08091E20083FF23C08091E100877F8093E10082E08EBB10922E024B
|
||||
:200AA0008091E1008E7F8093E1008091E2008E7F8093E2008091E20080618093E200AADDFE
|
||||
:200AC00080E060E042E093DD8091F00088608093F00079D18091E10082FF0AC08091E2007E
|
||||
:200AE00082FF06C08091E1008B7F8093E1006BD1FF91EF91BF91AF919F918F917F916F9183
|
||||
:200B00005F914F913F912F910F900FBE0F901F9018951F93DF93CF93CDB7DEB7AC970FB667
|
||||
:200B2000F894DEBF0FBECDBFE0E3F2E08091F100819322E0E833F207C9F7809130023091AE
|
||||
:200B40003102353009F487C0363040F43130C9F1313070F0333009F01DC133C0383009F4B1
|
||||
:200B6000EFC0393009F4FEC0363009F013C192C0803821F0823809F00DC108C090912C02BC
|
||||
:200B800080912D02882399F0926011C08091340287708093E9008091EB0090E025E0969548
|
||||
:200BA00087952A95E1F7982F91701092E9008091E800877F8093E8009093F1001092F1008E
|
||||
:200BC000CAC0882319F0823009F0E4C090E08F719070009721F0029709F0DDC00CC0809164
|
||||
:200BE0003202813009F0D7C010922D02333069F580932D022AC080913202882331F52091FB
|
||||
:200C00003402277009F4C7C02093E9008091EB0080FFC1C0333021F48091EB00806213C0C2
|
||||
:200C20008091EB0080618093EB0081E090E002C0880F991F2A95E2F78093EA001092EA00D6
|
||||
:200C40008091EB0088608093EB001092E9008091E800877F83C0882309F09CC01091320210
|
||||
:200C60008091E800877F8093E800E8DC04C08EB3882309F490C08091E80080FFF8CF812FCA
|
||||
:200C80008F7711F492E001C093E09EBB80688093E30081C08058823008F07CC08091320228
|
||||
:200CA0009091330223E08C3D920799F55FB7F894DE0115964EE020E030E061E2E42FF0E05B
|
||||
:200CC00060935700849120FF03C082958F704F5F982F9F70892F805D8A3308F0895F8C93E8
|
||||
:200CE00011961C9211972F5F3F4F12962431310529F75FBF8AE28B8383E08C838091E80085
|
||||
:200D0000877F8093E800CE0103966AE270E0E4DC11C060913402AE014F5F5F4F2CDCBC0146
|
||||
:200D20000097C9F18091E800877F8093E80089819A812BDD8091E8008B778093E8002BC05A
|
||||
:200D4000803841F58091E800877F8093E80080912E028093F1008091E8008E778093E8006D
|
||||
:200D60006DDC19C08823B1F490913202923098F48091E800877F8093E80090932E025EDCD7
|
||||
:200D800080912E02882311F483E001C084E08EBBEEDA01C0E9DA8091E80083FF0AC08091EF
|
||||
:200DA000EB0080628093EB008091E800877F8093E800AC960FB6F894DEBF0FBECDBFCF9185
|
||||
:200DC000DF911F91089508951F938EB3882361F01091E9001092E9008091E80083FF01C079
|
||||
:200DE00098DE17701093E9001F9108950895FC018EB3843021F587859089A189B289009757
|
||||
:200E0000A105B105E1F085818093E9008091E80082FF15C08091F200882319F42FEF3FEF4D
|
||||
:200E200004C08091F100282F30E08091F200882341F48091E8008B778093E80002C02FEFCC
|
||||
:200E40003FEFC9010895FC018EB3843011F587859089A189B2890097A105B105D1F08181C5
|
||||
:200E60008093E9008091F2008823A9F09091E8008091E8008E778093E80095FD0CC0FDDBF7
|
||||
:200E8000982F882349F48091E8008E778093E80003C092E001C090E0892F0895FC018EB3B1
|
||||
:200EA000843051F487859089A189B2890097A105B10511F0CF01C7CF08951F93FC01162FC4
|
||||
:200EC0008EB38430D9F487859089A189B2890097A105B10599F081818093E9008091E80053
|
||||
:200EE00085FD08C08091E8008E778093E800C5DB882329F41093F10080E001C082E01F9180
|
||||
:200F000008950F931F93CF93DF93EC010D96FC0189E0DF011D928A95E9F72A813B81098197
|
||||
:200F20008C81882311F410E001C014E0C90151DB182B1260802F61E8412F59DB882329F143
|
||||
:200F40002E813F810D818885882311F410E001C014E0C9013EDB182B1260802F60E8412F33
|
||||
:200F600046DB882391F02A853B8509858C85882311F410E001C014E0C9012BDB182B12603C
|
||||
:200F8000802F61EC412F33DB01C080E0DF91CF911F910F910895CF93DF93EC018091E8003F
|
||||
:200FA00083FF60C0888190E020913402309135022817390709F056C080913102813261F061
|
||||
:200FC000823220F4803209F04DC019C0823269F1833209F047C038C080913002813A09F006
|
||||
:200FE00041C08091E800877F8093E800CE010F9667E070E071DB8091E8008B7713C08091C0
|
||||
:201000003002813279F58091E800877F8093E800CE010F9667E070E013DCCE01DFD88091F2
|
||||
:20102000E8008E778093E8001DC0809130028132C9F48091E800877F8093E80080913202F9
|
||||
:201040008D87CE0164D90DC080913002813251F48091E800877F8093E800CE01609132027A
|
||||
:20106000C5DEECDADF91CF910895A1E21A2EAA1BBB1BFD010DC0AA1FBB1FEE1FFF1FA217E2
|
||||
:20108000B307E407F50720F0A21BB30BE40BF50B661F771F881F991F1A9469F760957095B3
|
||||
:2010A000809590959B01AC01BD01CF01089597FB092E05260ED057FD04D0D7DF0AD0001CDC
|
||||
:2010C00038F450954095309521953F4F4F4F5F4F0895F6F790958095709561957F4F8F4F6A
|
||||
:2010E0009F4F0895F894FFCF00034000000440000002080000000000000000000000140066
|
||||
:00000001FF
|
||||
137
compiled/DUE_16u2_reflash/16u2-out.hex
Normal file
137
compiled/DUE_16u2_reflash/16u2-out.hex
Normal file
@@ -0,0 +1,137 @@
|
||||
:20000000A7C00000C0C00000BEC00000BCC00000BAC00000B8C00000B6C00000B4C0000023
|
||||
:20002000B2C00000B0C00000AEC00000C1C4000085C40000A8C00000A6C00000A4C0000070
|
||||
:20004000A2C00000A0C000009EC000009CC000009AC0000098C0000096C0000021C100003A
|
||||
:2000600092C0000090C000008EC000008CC000008AC0000088C0000086C0000084C0000028
|
||||
:2000800082C0000080C000007EC000007CC000007AC0000078C000001201100102000008C4
|
||||
:2000A00041233D0001000102DC0109023E00020100C0320904000001020201000524000143
|
||||
:2000C00010042402060524060001070582030800FF09040100020A000000070504024000AC
|
||||
:2000E0000107058302400001040309043203410072006400750069006E006F0020002800CA
|
||||
:200100007700770077002E00610072006400750069006E006F002E0063006300290000003D
|
||||
:200120002E03410072006400750069006E006F0020004400750065002000500072006F002D
|
||||
:2001400067002E00200050006F0072007400000011241FBECFEFD2E0DEBFCDBF11E0A0E029
|
||||
:20016000B1E0E4EDF0E102C005900D92A831B107D9F712E0A8E1B1E001C01D92A833B107E6
|
||||
:20018000E1F72BD1A5C73CCF9C01DC01AE57BF4FED91FC91119741911196FC93EE93805873
|
||||
:2001A0009F4FE817F90711F42D933C939FB7F894F901EC57FF4F8081815080839FBF842F6B
|
||||
:2001C0000895882311F03F9A01C03F9847980895882311F046980895469A0895DF92EF9253
|
||||
:2001E000FF920F931F93FC018489813019F0823019F404C010E303C010E001C010E283896E
|
||||
:20020000823009F418608589873031F0883031F0863029F4126003C0146001C016601092A3
|
||||
:20022000C9001092C8001092CA000785F088E188D288202F3F2D4E2D5D2D10921E01203B7C
|
||||
:2002400084E0380780E0480780E0580719F481E080931E01CA01B90122E030E040E050E006
|
||||
:200260001CD720583B47414E5F4FCA01B901202F3F2D4E2D5D2DEFD6215030403093CD00D9
|
||||
:200280002093CC001093CA0082E08093C80088E98093C9001F910F91FF90EF90DF9008957E
|
||||
:2002A0001F920F920FB60F9211242F938F939F93EF93FF939091CE008EB38430F1F4E091ED
|
||||
:2002C000A201F091A3019083E091A201F091A301CF0101969093A3018093A201825A914079
|
||||
:2002E00021F482E291E0928381839FB7F8948091A6018F5F8093A6019FBFFF91EF919F911B
|
||||
:200300008F912F910F900FBE0F901F901895FC0140911A0140931B0180911C0180931D015F
|
||||
:200320008585282F30E02170307020931A01858590E096958795817080931C0180911E013B
|
||||
:20034000882339F088E790E090931901809318010895442341F4222331F082E390E09093EA
|
||||
:20036000190180931801089580E091E00AC680E091E0BDC584B7877F84BF88E10FB6F89468
|
||||
:2003800080936000109260000FBE81E01ADF16BC83E085BD86B58831E8F315BC16BC80E078
|
||||
:2003A00010DF469A3E9A87E690E09093CD008093CC0086E08093CA001092C80088E18093C1
|
||||
:2003C000C900539A5A9A8AB180638AB98BB180638BB9A9D284E085BD08950F931F93CF933B
|
||||
:2003E000DF93C8DF2FB7F89487EA91E0909328028093270290932A02809329022FBF2FB7A6
|
||||
:20040000F89482E291E09093A3018093A2019093A5018093A4012FBF7894C7EAD1E003E03E
|
||||
:200420008FB7F89490912B028FBF903809F180E091E0D3D497FD1CC0E0912702F09128025F
|
||||
:200440008083E0912702F0912802CF01019690932802809327028752924011F4D283C1831B
|
||||
:200460009FB7F89480912B028F5F80932B029FBF8FB7F8941091A6018FBFA89903C011361D
|
||||
:2004800008F456C0A89A8091A601882361F05D9800931F0108C082E291E076DE682F80E0C4
|
||||
:2004A00091E001D511501123B1F780911F01882351F080911F01815080931F0180911F0135
|
||||
:2004C000882309F45D9A80912001882351F08091200181508093200180912001882309F44E
|
||||
:2004E0005C9A809118019091190118161906E4F4CC97CD9710F481E001C080E069DE8091D7
|
||||
:200500001801909119010197C29710F481E001C080E057DE809118019091190101979093BB
|
||||
:2005200019018093180104C080E052DE80E049DE8FB7F89490912B028FBF992369F087EAA6
|
||||
:2005400091E022DE982F8091C80085FFFCCF9093CE005C980093200180E091E095D42AD46A
|
||||
:200560005FCFDA01923049F0933061F09130F9F4E8E9F0E022E130E01EC0EAEAF0E02EE36E
|
||||
:2005800030E019C0813049F0813018F0823079F408C0E8EEF0E0849107C0ECEEF0E08491A7
|
||||
:2005A00003C0E0E2F1E08491282F30E004C0E0E0F0E020E030E0ED93FC93C901089528E087
|
||||
:2005C00030E040E003C04F5F220F331F28173907D0F3842F8295807F08958093E900809142
|
||||
:2005E000EB0081608093EB001092ED006093EC004093ED008091EE00881F8827881F08956A
|
||||
:200600001092F40090E09093E9001092F0001092E8001092ED008091EB008E7F8093EB0016
|
||||
:200620009F5F953081F708958091300288238CF403C08EB38823B1F08091E80082FFF9CFE2
|
||||
:200640008091E8008B778093E80008958EB3882349F08091E80080FFF9CF8091E8008E77A4
|
||||
:200660008093E800089594E68091EC0080FF05C08091E80080FF05C023C08091E80082FD8F
|
||||
:200680001FC08EB3882311F482E008958EB3853011F483E008958091EB0085FF02C081E0ED
|
||||
:2006A00008958091E10082FFDFCF8091E1008B7F8093E100992311F484E008959150D4CF46
|
||||
:2006C00080E008959C0140913602509137024617570718F4F90120E038C06115710511F0B7
|
||||
:2006E000AB01F8CF8091E8008E778093E80040E050E0F0CF8091E80083FF02C081E0089544
|
||||
:200700008091E80082FD2DC08EB3882381F18EB3853079F18091E80080FF17C09091F20054
|
||||
:2007200006C081918093F100415050409F5F4115510511F09830A8F320E0983009F421E0E8
|
||||
:200740008091E8008E778093E8004115510591F6222381F606C08EB3882349F08EB38530D0
|
||||
:2007600041F08091E80082FFF6CF80E0089582E0089583E008959C0140913602509137024D
|
||||
:200780004617570710F490E03BC06115710511F0AB01F9CF8091E8008E778093E80040E0B5
|
||||
:2007A00050E0F1CF8091E80083FF02C081E008958091E80082FD30C08EB3882399F18EB3EF
|
||||
:2007C000853091F18091E80080FF1AC08091F20009C0F9012F5F3F4FE491E093F100415044
|
||||
:2007E00050408F5F4115510511F0883090F390E0883009F491E08091E8008E778093E80004
|
||||
:200800004115510579F6992369F606C08EB3882349F08EB3853041F08091E80082FFF6CF51
|
||||
:2008200080E0089582E0089583E008959C016115710529F48091E8008B778093E800F90126
|
||||
:2008400020C08091E80083FF02C081E008958EB3882339F18EB3853031F18091E80082FFD5
|
||||
:20086000F0CF06C08091F10081936150704021F08091F2008823B1F78091E8008B77809307
|
||||
:20088000E80061157105E9F606C08EB3882349F08EB3853041F08091E80080FFF6CF80E0F6
|
||||
:2008A000089582E0089583E0089542D044D01EBA10922E0210922D0210922C0284E089BD81
|
||||
:2008C00089B5826089BD09B400FEFDCF8091D800982F9F779093D80080688093D800809186
|
||||
:2008E00063008E7F809363008091D8008F7D8093D8008091E0008E7F8093E0008091E1004F
|
||||
:200900008E7F8093E1008091E20081608093E2008091E100877F8093E1008091E200886046
|
||||
:200920008093E2000895C1DF81E080932F0208951092E20008951092E10008951F920F92B0
|
||||
:200940000FB60F9211241F932F933F934F935F936F937F938F939F93AF93BF93EF93FF93D2
|
||||
:20096000E9EEF0E0108117701082E0EFF0E08081877F80837894C3D0F894A9EEB0E01C927D
|
||||
:20098000E0EFF0E08081886080831C93FF91EF91BF91AF919F918F917F916F915F914F914D
|
||||
:2009A0003F912F911F910F900FBE0F901F9018951F920F920FB60F9211242F933F934F932D
|
||||
:2009C0005F936F937F938F939F93AF93BF93EF93FF938091E10080FF1BC08091E20080FF57
|
||||
:2009E00017C08091E1008E7F8093E1008091E2008E7F8093E2008091E20080618093E2006F
|
||||
:200A00008091D80080628093D80019BC1EBAD1D18091E10084FF29C08091E20084FF25C018
|
||||
:200A200084E089BD89B5826089BD09B400FEFDCF8091D8008F7D8093D8008091E1008F7E40
|
||||
:200A40008093E1008091E2008F7E8093E2008091E20081608093E20080912E02882311F4F3
|
||||
:200A600081E001C084E08EBBA4D18091E10083FF27C08091E20083FF23C08091E100877F87
|
||||
:200A80008093E10082E08EBB10922E028091E1008E7F8093E1008091E2008E7F8093E200FD
|
||||
:200AA0008091E20080618093E200AADD80E060E042E093DD8091F00088608093F00079D17E
|
||||
:200AC0008091E10082FF0AC08091E20082FF06C08091E1008B7F8093E1006BD1FF91EF9163
|
||||
:200AE000BF91AF919F918F917F916F915F914F913F912F910F900FBE0F901F9018951F938D
|
||||
:200B0000DF93CF93CDB7DEB7AC970FB6F894DEBF0FBECDBFE0E3F2E08091F100819322E0B1
|
||||
:200B2000E833F207C9F78091300230913102353009F487C0363040F43130C9F1313070F08B
|
||||
:200B4000333009F01DC133C0383009F4EFC0393009F4FEC0363009F013C192C0803821F0E2
|
||||
:200B6000823809F00DC108C090912C0280912D02882399F0926011C0809134028770809355
|
||||
:200B8000E9008091EB0090E025E0969587952A95E1F7982F91701092E9008091E800877FCB
|
||||
:200BA0008093E8009093F1001092F100CAC0882319F0823009F0E4C090E08F7190700097FF
|
||||
:200BC00021F0029709F0DDC00CC080913202813009F0D7C010922D02333069F580932D02AF
|
||||
:200BE0002AC080913202882331F520913402277009F4C7C02093E9008091EB0080FFC1C05B
|
||||
:200C0000333021F48091EB00806213C08091EB0080618093EB0081E090E002C0880F991FEE
|
||||
:200C20002A95E2F78093EA001092EA008091EB0088608093EB001092E9008091E800877F27
|
||||
:200C400083C0882309F09CC0109132028091E800877F8093E800E8DC04C08EB3882309F411
|
||||
:200C600090C08091E80080FFF8CF812F8F7711F492E001C093E09EBB80688093E30081C00C
|
||||
:200C80008058823008F07CC0809132029091330223E08C3D920799F55FB7F894DE011596DC
|
||||
:200CA0004EE020E030E061E2E42FF0E060935700849120FF03C082958F704F5F982F9F70F5
|
||||
:200CC000892F805D8A3308F0895F8C9311961C9211972F5F3F4F12962431310529F75FBF39
|
||||
:200CE0008AE28B8383E08C838091E800877F8093E800CE0103966AE270E0E4DC11C0609188
|
||||
:200D00003402AE014F5F5F4F2CDCBC010097C9F18091E800877F8093E80089819A812BDD55
|
||||
:200D20008091E8008B778093E8002BC0803841F58091E800877F8093E80080912E02809396
|
||||
:200D4000F1008091E8008E778093E8006DDC19C08823B1F490913202923098F48091E8009B
|
||||
:200D6000877F8093E80090932E025EDC80912E02882311F483E001C084E08EBBF8DA01C090
|
||||
:200D8000F3DA8091E80083FF0AC08091EB0080628093EB008091E800877F8093E800AC9629
|
||||
:200DA0000FB6F894DEBF0FBECDBFCF91DF911F91089508951F938EB3882361F01091E900B9
|
||||
:200DC0001092E9008091E80083FF01C098DE17701093E9001F9108950895FC018EB38430E7
|
||||
:200DE00021F587859089A189B2890097A105B105E1F085818093E9008091E80082FF15C03E
|
||||
:200E00008091F200882319F42FEF3FEF04C08091F100282F30E08091F200882341F48091AA
|
||||
:200E2000E8008B778093E80002C02FEF3FEFC9010895FC018EB3843011F587859089A18911
|
||||
:200E4000B2890097A105B105D1F081818093E9008091F2008823A9F09091E8008091E8005C
|
||||
:200E60008E778093E80095FD0CC0FDDB982F882349F48091E8008E778093E80003C092E05F
|
||||
:200E800001C090E0892F0895FC018EB3843051F487859089A189B2890097A105B10511F017
|
||||
:200EA000CF01C7CF08951F93FC01162F8EB38430D9F487859089A189B2890097A105B105FC
|
||||
:200EC00099F081818093E9008091E80085FD08C08091E8008E778093E800C5DB882329F4E7
|
||||
:200EE0001093F10080E001C082E01F9108950F931F93CF93DF93EC010D96FC0189E0DF0190
|
||||
:200F00001D928A95E9F72A813B8109818C81882311F410E001C014E0C90151DB182B126025
|
||||
:200F2000802F61E8412F59DB882329F12E813F810D818885882311F410E001C014E0C90127
|
||||
:200F40003EDB182B1260802F60E8412F46DB882391F02A853B8509858C85882311F410E061
|
||||
:200F600001C014E0C9012BDB182B1260802F61EC412F33DB01C080E0DF91CF911F910F917C
|
||||
:200F80000895CF93DF93EC018091E80083FF60C0888190E020913402309135022817390781
|
||||
:200FA00009F056C080913102813261F0823220F4803209F04DC019C0823269F1833209F0C5
|
||||
:200FC00047C038C080913002813A09F041C08091E800877F8093E800CE010F9667E070E015
|
||||
:200FE00071DB8091E8008B7713C080913002813279F58091E800877F8093E800CE010F9605
|
||||
:2010000067E070E013DCCE01E9D88091E8008E778093E8001DC0809130028132C9F4809120
|
||||
:20102000E800877F8093E800809132028D87CE016ED90DC080913002813251F48091E80057
|
||||
:20104000877F8093E800CE0160913202C5DEECDADF91CF910895A1E21A2EAA1BBB1BFD0161
|
||||
:201060000DC0AA1FBB1FEE1FFF1FA217B307E407F50720F0A21BB30BE40BF50B661F771FE6
|
||||
:20108000881F991F1A9469F760957095809590959B01AC01BD01CF01089597FB092E052647
|
||||
:2010A0000ED057FD04D0D7DF0AD0001C38F450954095309521953F4F4F4F5F4F0895F6F7B9
|
||||
:2010C00090958095709561957F4F8F4F9F4F0895F894FFCF000340000004400000020800B9
|
||||
:0C10E000000000000000000000001400F0
|
||||
:00000001FF
|
||||
137
compiled/DUE_16u2_reflash/16u2-out2.hex
Normal file
137
compiled/DUE_16u2_reflash/16u2-out2.hex
Normal file
@@ -0,0 +1,137 @@
|
||||
:20000000A7C00000C0C00000BEC00000BCC00000BAC00000B8C00000B6C00000B4C0000023
|
||||
:20002000B2C00000B0C00000AEC00000C1C4000085C40000A8C00000A6C00000A4C0000070
|
||||
:20004000A2C00000A0C000009EC000009CC000009AC0000098C0000096C0000021C100003A
|
||||
:2000600092C0000090C000008EC000008CC000008AC0000088C0000086C0000084C0000028
|
||||
:2000800082C0000080C000007EC000007CC000007AC0000078C000001201100102000008C4
|
||||
:2000A00041233D0001000102DC0109023E00020100C0320904000001020201000524000143
|
||||
:2000C00010042402060524060001070582030800FF09040100020A000000070504024000AC
|
||||
:2000E0000107058302400001040309043203410072006400750069006E006F0020002800CA
|
||||
:200100007700770077002E00610072006400750069006E006F002E0063006300290000003D
|
||||
:200120002E03410072006400750069006E006F0020004400750065002000500072006F002D
|
||||
:2001400067002E00200050006F0072007400000011241FBECFEFD2E0DEBFCDBF11E0A0E029
|
||||
:20016000B1E0E4EDF0E102C005900D92A831B107D9F712E0A8E1B1E001C01D92A833B107E6
|
||||
:20018000E1F72BD1A5C73CCF9C01DC01AE57BF4FED91FC91119741911196FC93EE93805873
|
||||
:2001A0009F4FE817F90711F42D933C939FB7F894F901EC57FF4F8081815080839FBF842F6B
|
||||
:2001C0000895882311F03F9A01C03F9847980895882311F046980895469A0895DF92EF9253
|
||||
:2001E000FF920F931F93FC018489813019F0823019F404C010E303C010E001C010E283896E
|
||||
:20020000823009F418608589873031F0883031F0863029F4126003C0146001C016601092A3
|
||||
:20022000C9001092C8001092CA000785F088E188D288202F3F2D4E2D5D2D10921E01203B7C
|
||||
:2002400084E0380780E0480780E0580719F481E080931E01CA01B90122E030E040E050E006
|
||||
:200260001CD720583B47414E5F4FCA01B901202F3F2D4E2D5D2DEFD6215030403093CD00D9
|
||||
:200280002093CC001093CA0082E08093C80088E98093C9001F910F91FF90EF90DF9008957E
|
||||
:2002A0001F920F920FB60F9211242F938F939F93EF93FF939091CE008EB38430F1F4E091ED
|
||||
:2002C000A201F091A3019083E091A201F091A301CF0101969093A3018093A201825A914079
|
||||
:2002E00021F482E291E0928381839FB7F8948091A6018F5F8093A6019FBFFF91EF919F911B
|
||||
:200300008F912F910F900FBE0F901F901895FC0140911A0140931B0180911C0180931D015F
|
||||
:200320008585282F30E02170307020931A01858590E096958795817080931C0180911E013B
|
||||
:20034000882339F088E790E090931901809318010895442341F4222331F082E390E09093EA
|
||||
:20036000190180931801089580E091E00AC680E091E0BDC584B7877F84BF88E10FB6F89468
|
||||
:2003800080936000109260000FBE81E01ADF16BC83E085BD86B58831E8F315BC16BC80E078
|
||||
:2003A00010DF469A3E9A87E690E09093CD008093CC0086E08093CA001092C80088E18093C1
|
||||
:2003C000C900539A5A9A8AB180638AB98BB180638BB9A9D284E085BD08950F931F93CF933B
|
||||
:2003E000DF93C8DF2FB7F89487EA91E0909328028093270290932A02809329022FBF2FB7A6
|
||||
:20040000F89482E291E09093A3018093A2019093A5018093A4012FBF7894C7EAD1E003E03E
|
||||
:200420008FB7F89490912B028FBF903809F180E091E0D3D497FD1CC0E0912702F09128025F
|
||||
:200440008083E0912702F0912802CF01019690932802809327028752924011F4D283C1831B
|
||||
:200460009FB7F89480912B028F5F80932B029FBF8FB7F8941091A6018FBFA89903C011361D
|
||||
:2004800008F456C0A89A8091A601882361F05D9800931F0108C082E291E076DE682F80E0C4
|
||||
:2004A00091E001D511501123B1F780911F01882351F080911F01815080931F0180911F0135
|
||||
:2004C000882309F45D9A80912001882351F08091200181508093200180912001882309F44E
|
||||
:2004E0005C9A809118019091190118161906E4F4CC97CD9710F481E001C080E069DE8091D7
|
||||
:200500001801909119010197C29710F481E001C080E057DE809118019091190101979093BB
|
||||
:2005200019018093180104C080E052DE80E049DE8FB7F89490912B028FBF992369F087EAA6
|
||||
:2005400091E022DE982F8091C80085FFFCCF9093CE005C980093200180E091E095D42AD46A
|
||||
:200560005FCFDA01923049F0933061F09130F9F4E8E9F0E022E130E01EC0EAEAF0E02EE36E
|
||||
:2005800030E019C0813049F0813018F0823079F408C0E8EEF0E0849107C0ECEEF0E08491A7
|
||||
:2005A00003C0E0E2F1E08491282F30E004C0E0E0F0E020E030E0ED93FC93C901089528E087
|
||||
:2005C00030E040E003C04F5F220F331F28173907D0F3842F8295807F08958093E900809142
|
||||
:2005E000EB0081608093EB001092ED006093EC004093ED008091EE00881F8827881F08956A
|
||||
:200600001092F40090E09093E9001092F0001092E8001092ED008091EB008E7F8093EB0016
|
||||
:200620009F5F953081F708958091300288238CF403C08EB38823B1F08091E80082FFF9CFE2
|
||||
:200640008091E8008B778093E80008958EB3882349F08091E80080FFF9CF8091E8008E77A4
|
||||
:200660008093E800089594E68091EC0080FF05C08091E80080FF05C023C08091E80082FD8F
|
||||
:200680001FC08EB3882311F482E008958EB3853011F483E008958091EB0085FF02C081E0ED
|
||||
:2006A00008958091E10082FFDFCF8091E1008B7F8093E100992311F484E008959150D4CF46
|
||||
:2006C00080E008959C0140913602509137024617570718F4F90120E038C06115710511F0B7
|
||||
:2006E000AB01F8CF8091E8008E778093E80040E050E0F0CF8091E80083FF02C081E0089544
|
||||
:200700008091E80082FD2DC08EB3882381F18EB3853079F18091E80080FF17C09091F20054
|
||||
:2007200006C081918093F100415050409F5F4115510511F09830A8F320E0983009F421E0E8
|
||||
:200740008091E8008E778093E8004115510591F6222381F606C08EB3882349F08EB38530D0
|
||||
:2007600041F08091E80082FFF6CF80E0089582E0089583E008959C0140913602509137024D
|
||||
:200780004617570710F490E03BC06115710511F0AB01F9CF8091E8008E778093E80040E0B5
|
||||
:2007A00050E0F1CF8091E80083FF02C081E008958091E80082FD30C08EB3882399F18EB3EF
|
||||
:2007C000853091F18091E80080FF1AC08091F20009C0F9012F5F3F4FE491E093F100415044
|
||||
:2007E00050408F5F4115510511F0883090F390E0883009F491E08091E8008E778093E80004
|
||||
:200800004115510579F6992369F606C08EB3882349F08EB3853041F08091E80082FFF6CF51
|
||||
:2008200080E0089582E0089583E008959C016115710529F48091E8008B778093E800F90126
|
||||
:2008400020C08091E80083FF02C081E008958EB3882339F18EB3853031F18091E80082FFD5
|
||||
:20086000F0CF06C08091F10081936150704021F08091F2008823B1F78091E8008B77809307
|
||||
:20088000E80061157105E9F606C08EB3882349F08EB3853041F08091E80080FFF6CF80E0F6
|
||||
:2008A000089582E0089583E0089542D044D01EBA10922E0210922D0210922C0284E089BD81
|
||||
:2008C00089B5826089BD09B400FEFDCF8091D800982F9F779093D80080688093D800809186
|
||||
:2008E00063008E7F809363008091D8008F7D8093D8008091E0008E7F8093E0008091E1004F
|
||||
:200900008E7F8093E1008091E20081608093E2008091E100877F8093E1008091E200886046
|
||||
:200920008093E2000895C1DF81E080932F0208951092E20008951092E10008951F920F92B0
|
||||
:200940000FB60F9211241F932F933F934F935F936F937F938F939F93AF93BF93EF93FF93D2
|
||||
:20096000E9EEF0E0108117701082E0EFF0E08081877F80837894C3D0F894A9EEB0E01C927D
|
||||
:20098000E0EFF0E08081886080831C93FF91EF91BF91AF919F918F917F916F915F914F914D
|
||||
:2009A0003F912F911F910F900FBE0F901F9018951F920F920FB60F9211242F933F934F932D
|
||||
:2009C0005F936F937F938F939F93AF93BF93EF93FF938091E10080FF1BC08091E20080FF57
|
||||
:2009E00017C08091E1008E7F8093E1008091E2008E7F8093E2008091E20080618093E2006F
|
||||
:200A00008091D80080628093D80019BC1EBAD1D18091E10084FF29C08091E20084FF25C018
|
||||
:200A200084E089BD89B5826089BD09B400FEFDCF8091D8008F7D8093D8008091E1008F7E40
|
||||
:200A40008093E1008091E2008F7E8093E2008091E20081608093E20080912E02882311F4F3
|
||||
:200A600081E001C084E08EBBA4D18091E10083FF27C08091E20083FF23C08091E100877F87
|
||||
:200A80008093E10082E08EBB10922E028091E1008E7F8093E1008091E2008E7F8093E200FD
|
||||
:200AA0008091E20080618093E200AADD80E060E042E093DD8091F00088608093F00079D17E
|
||||
:200AC0008091E10082FF0AC08091E20082FF06C08091E1008B7F8093E1006BD1FF91EF9163
|
||||
:200AE000BF91AF919F918F917F916F915F914F913F912F910F900FBE0F901F9018951F938D
|
||||
:200B0000DF93CF93CDB7DEB7AC970FB6F894DEBF0FBECDBFE0E3F2E08091F100819322E0B1
|
||||
:200B2000E833F207C9F78091300230913102353009F487C0363040F43130C9F1313070F08B
|
||||
:200B4000333009F01DC133C0383009F4EFC0393009F4FEC0363009F013C192C0803821F0E2
|
||||
:200B6000823809F00DC108C090912C0280912D02882399F0926011C0809134028770809355
|
||||
:200B8000E9008091EB0090E025E0969587952A95E1F7982F91701092E9008091E800877FCB
|
||||
:200BA0008093E8009093F1001092F100CAC0882319F0823009F0E4C090E08F7190700097FF
|
||||
:200BC00021F0029709F0DDC00CC080913202813009F0D7C010922D02333069F580932D02AF
|
||||
:200BE0002AC080913202882331F520913402277009F4C7C02093E9008091EB0080FFC1C05B
|
||||
:200C0000333021F48091EB00806213C08091EB0080618093EB0081E090E002C0880F991FEE
|
||||
:200C20002A95E2F78093EA001092EA008091EB0088608093EB001092E9008091E800877F27
|
||||
:200C400083C0882309F09CC0109132028091E800877F8093E800E8DC04C08EB3882309F411
|
||||
:200C600090C08091E80080FFF8CF812F8F7711F492E001C093E09EBB80688093E30081C00C
|
||||
:200C80008058823008F07CC0809132029091330223E08C3D920799F55FB7F894DE011596DC
|
||||
:200CA0004EE020E030E061E2E42FF0E060935700849120FF03C082958F704F5F982F9F70F5
|
||||
:200CC000892F805D8A3308F0895F8C9311961C9211972F5F3F4F12962431310529F75FBF39
|
||||
:200CE0008AE28B8383E08C838091E800877F8093E800CE0103966AE270E0E4DC11C0609188
|
||||
:200D00003402AE014F5F5F4F2CDCBC010097C9F18091E800877F8093E80089819A812BDD55
|
||||
:200D20008091E8008B778093E8002BC0803841F58091E800877F8093E80080912E02809396
|
||||
:200D4000F1008091E8008E778093E8006DDC19C08823B1F490913202923098F48091E8009B
|
||||
:200D6000877F8093E80090932E025EDC80912E02882311F483E001C084E08EBBF8DA01C090
|
||||
:200D8000F3DA8091E80083FF0AC08091EB0080628093EB008091E800877F8093E800AC9629
|
||||
:200DA0000FB6F894DEBF0FBECDBFCF91DF911F91089508951F938EB3882361F01091E900B9
|
||||
:200DC0001092E9008091E80083FF01C098DE17701093E9001F9108950895FC018EB38430E7
|
||||
:200DE00021F587859089A189B2890097A105B105E1F085818093E9008091E80082FF15C03E
|
||||
:200E00008091F200882319F42FEF3FEF04C08091F100282F30E08091F200882341F48091AA
|
||||
:200E2000E8008B778093E80002C02FEF3FEFC9010895FC018EB3843011F587859089A18911
|
||||
:200E4000B2890097A105B105D1F081818093E9008091F2008823A9F09091E8008091E8005C
|
||||
:200E60008E778093E80095FD0CC0FDDB982F882349F48091E8008E778093E80003C092E05F
|
||||
:200E800001C090E0892F0895FC018EB3843051F487859089A189B2890097A105B10511F017
|
||||
:200EA000CF01C7CF08951F93FC01162F8EB38430D9F487859089A189B2890097A105B105FC
|
||||
:200EC00099F081818093E9008091E80085FD08C08091E8008E778093E800C5DB882329F4E7
|
||||
:200EE0001093F10080E001C082E01F9108950F931F93CF93DF93EC010D96FC0189E0DF0190
|
||||
:200F00001D928A95E9F72A813B8109818C81882311F410E001C014E0C90151DB182B126025
|
||||
:200F2000802F61E8412F59DB882329F12E813F810D818885882311F410E001C014E0C90127
|
||||
:200F40003EDB182B1260802F60E8412F46DB882391F02A853B8509858C85882311F410E061
|
||||
:200F600001C014E0C9012BDB182B1260802F61EC412F33DB01C080E0DF91CF911F910F917C
|
||||
:200F80000895CF93DF93EC018091E80083FF60C0888190E020913402309135022817390781
|
||||
:200FA00009F056C080913102813261F0823220F4803209F04DC019C0823269F1833209F0C5
|
||||
:200FC00047C038C080913002813A09F041C08091E800877F8093E800CE010F9667E070E015
|
||||
:200FE00071DB8091E8008B7713C080913002813279F58091E800877F8093E800CE010F9605
|
||||
:2010000067E070E013DCCE01E9D88091E8008E778093E8001DC0809130028132C9F4809120
|
||||
:20102000E800877F8093E800809132028D87CE016ED90DC080913002813251F48091E80057
|
||||
:20104000877F8093E800CE0160913202C5DEECDADF91CF910895A1E21A2EAA1BBB1BFD0161
|
||||
:201060000DC0AA1FBB1FEE1FFF1FA217B307E407F50720F0A21BB30BE40BF50B661F771FE6
|
||||
:20108000881F991F1A9469F760957095809590959B01AC01BD01CF01089597FB092E052647
|
||||
:2010A0000ED057FD04D0D7DF0AD0001C38F450954095309521953F4F4F4F5F4F0895F6F7B9
|
||||
:2010C00090958095709561957F4F8F4F9F4F0895F894FFCF000340000004400000020800B9
|
||||
:0C10E000000000000000000000001400F0
|
||||
:00000001FF
|
||||
137
compiled/DUE_16u2_reflash/16u2-out3.hex
Normal file
137
compiled/DUE_16u2_reflash/16u2-out3.hex
Normal file
@@ -0,0 +1,137 @@
|
||||
:20000000A7C00000C0C00000BEC00000BCC00000BAC00000B8C00000B6C00000B4C0000023
|
||||
:20002000B2C00000B0C00000AEC00000CBC400008FC40000A8C00000A6C00000A4C000005C
|
||||
:20004000A2C00000A0C000009EC000009CC000009AC0000098C0000096C0000021C100003A
|
||||
:2000600092C0000090C000008EC000008CC000008AC0000088C0000086C0000084C0000028
|
||||
:2000800082C0000080C000007EC000007CC000007AC0000078C000001201100102000008C4
|
||||
:2000A00041233D0001000102DC0109023E00020100C0320904000001020201000524000143
|
||||
:2000C00010042402060524060001070582030800FF09040100020A000000070504024000AC
|
||||
:2000E0000107058302400001040309043203410072006400750069006E006F0020002800CA
|
||||
:200100007700770077002E00610072006400750069006E006F002E0063006300290000003D
|
||||
:200120002E03410072006400750069006E006F0020004400750065002000500072006F002D
|
||||
:2001400067002E00200050006F0072007400000011241FBECFEFD2E0DEBFCDBF11E0A0E029
|
||||
:20016000B1E0E8EEF0E102C005900D92A831B107D9F712E0A8E1B1E001C01D92A833B107E1
|
||||
:20018000E1F722D1AFC73CCF9C01DC01AE57BF4FED91FC91119741911196FC93EE93805872
|
||||
:2001A0009F4FE817F90711F42D933C939FB7F894F901EC57FF4F8081815080839FBF842F6B
|
||||
:2001C0000895882311F03F9A01C03F9847980895882311F046980895469A0895DF92EF9253
|
||||
:2001E000FF920F931F93FC018489813019F0823019F404C010E303C010E001C010E283896E
|
||||
:20020000823009F418608589873031F0883031F0863029F4126003C0146001C016601092A3
|
||||
:20022000C9001092C8001092CA000785F088E188D288202F3F2D4E2D5D2D10921E01203B7C
|
||||
:2002400084E0380780E0480780E0580719F481E080931E01CA01B90122E030E040E050E006
|
||||
:2002600026D720583B47414E5F4FCA01B901202F3F2D4E2D5D2DF9D6215030403093CD00C5
|
||||
:200280002093CC001093CA0082E08093C80088E98093C9001F910F91FF90EF90DF9008957E
|
||||
:2002A0001F920F920FB60F9211242F938F939F93EF93FF939091CE008EB38430F1F4E091ED
|
||||
:2002C000A201F091A3019083E091A201F091A301CF0101969093A3018093A201825A914079
|
||||
:2002E00021F482E291E0928381839FB7F8948091A6018F5F8093A6019FBFFF91EF919F911B
|
||||
:200300008F912F910F900FBE0F901F901895FC0140911A0140931B0180911C0180931D015F
|
||||
:200320008585282F30E02170307020931A01858590E096958795817080931C0180911E013B
|
||||
:20034000882339F08FE590E090931901809318010895442341F4222331F08EE190E09093DB
|
||||
:20036000190180931801089580E091E014C680E091E0C7C51F9384B7877F84BF18E10FB69E
|
||||
:20038000F89410936000109260000FBE80E019DF469A3E9A87E690E09093CD008093CC0043
|
||||
:2003A00086E08093CA001092C8001093C900539A5A9A8AB180638AB98BB180638BB9BDD2F0
|
||||
:2003C00084E085BD1F9108950F931F93CF93DF93D1DF2FB7F89487EA91E09093280280939E
|
||||
:2003E000270290932A02809329022FBF2FB7F89482E291E09093A3018093A2019093A501CC
|
||||
:200400008093A4012FBF7894C7EAD1E003E08FB7F89490912B028FBF903809F180E091E0E4
|
||||
:20042000E6D497FD1CC0E0912702F09128028083E0912702F0912802CF0101969093280251
|
||||
:20044000809327028752924011F4D283C1839FB7F89480912B028F5F80932B029FBF8FB725
|
||||
:20046000F8941091A6018FBFA89903C0113608F469C0A89A8091A601882361F05D9800936C
|
||||
:200480001F0108C082E291E07FDE682F80E091E014D511501123B1F780911F01882351F097
|
||||
:2004A00080911F01815080931F0180911F01882309F45D9A80912001882351F080912001E7
|
||||
:2004C00081508093200180912001882309F45C9A8091180190911901181619067CF58F3560
|
||||
:2004E000910521F481E074DE80E06BDE8091180190911901839721F480E06ADE80E061DE1A
|
||||
:200500008091180190911901499721F480E060DE81E057DE8091180190911901019721F43B
|
||||
:2005200080E056DE80E04DDE80911801909119010197909319018093180104C080E048DEEC
|
||||
:2005400080E03FDE8FB7F89490912B028FBF992369F087EA91E018DE982F8091C80085FF9F
|
||||
:20056000FCCF9093CE005C980093200180E091E095D42AD44CCFDA01923049F0933061F0DA
|
||||
:200580009130F9F4E8E9F0E022E130E01EC0EAEAF0E02EE330E019C0813049F0813018F0DA
|
||||
:2005A000823079F408C0E8EEF0E0849107C0ECEEF0E0849103C0E0E2F1E08491282F30E041
|
||||
:2005C00004C0E0E0F0E020E030E0ED93FC93C901089528E030E040E003C04F5F220F331F15
|
||||
:2005E00028173907D0F3842F8295807F08958093E9008091EB0081608093EB001092ED00ED
|
||||
:200600006093EC004093ED008091EE00881F8827881F08951092F40090E09093E9001092EE
|
||||
:20062000F0001092E8001092ED008091EB008E7F8093EB009F5F953081F70895809130028F
|
||||
:2006400088238CF403C08EB38823B1F08091E80082FFF9CF8091E8008B778093E80008954A
|
||||
:200660008EB3882349F08091E80080FFF9CF8091E8008E778093E800089594E68091EC0008
|
||||
:2006800080FF05C08091E80080FF05C023C08091E80082FD1FC08EB3882311F482E00895AF
|
||||
:2006A0008EB3853011F483E008958091EB0085FF02C081E008958091E10082FFDFCF8091CD
|
||||
:2006C000E1008B7F8093E100992311F484E008959150D4CF80E008959C0140913602509171
|
||||
:2006E00037024617570718F4F90120E038C06115710511F0AB01F8CF8091E8008E77809397
|
||||
:20070000E80040E050E0F0CF8091E80083FF02C081E008958091E80082FD2DC08EB3882356
|
||||
:2007200081F18EB3853079F18091E80080FF17C09091F20006C081918093F1004150504088
|
||||
:200740009F5F4115510511F09830A8F320E0983009F421E08091E8008E778093E800411576
|
||||
:20076000510591F6222381F606C08EB3882349F08EB3853041F08091E80082FFF6CF80E02F
|
||||
:20078000089582E0089583E008959C0140913602509137024617570710F490E03BC061155D
|
||||
:2007A000710511F0AB01F9CF8091E8008E778093E80040E050E0F1CF8091E80083FF02C008
|
||||
:2007C00081E008958091E80082FD30C08EB3882399F18EB3853091F18091E80080FF1AC073
|
||||
:2007E0008091F20009C0F9012F5F3F4FE491E093F100415050408F5F4115510511F08830CA
|
||||
:2008000090F390E0883009F491E08091E8008E778093E8004115510579F6992369F606C0CA
|
||||
:200820008EB3882349F08EB3853041F08091E80082FFF6CF80E0089582E0089583E0089531
|
||||
:200840009C016115710529F48091E8008B778093E800F90120C08091E80083FF02C081E084
|
||||
:2008600008958EB3882339F18EB3853031F18091E80082FFF0CF06C08091F10081936150E7
|
||||
:20088000704021F08091F2008823B1F78091E8008B778093E80061157105E9F606C08EB379
|
||||
:2008A000882349F08EB3853041F08091E80080FFF6CF80E0089582E0089583E0089542D0E2
|
||||
:2008C00044D01EBA10922E0210922D0210922C0284E089BD89B5826089BD09B400FEFDCF22
|
||||
:2008E0008091D800982F9F779093D80080688093D800809163008E7F809363008091D80084
|
||||
:200900008F7D8093D8008091E0008E7F8093E0008091E1008E7F8093E1008091E200816028
|
||||
:200920008093E2008091E100877F8093E1008091E20088608093E2000895C1DF81E0809355
|
||||
:200940002F0208951092E20008951092E10008951F920F920FB60F9211241F932F933F9355
|
||||
:200960004F935F936F937F938F939F93AF93BF93EF93FF93E9EEF0E0108117701082E0EF73
|
||||
:20098000F0E08081877F80837894C3D0F894A9EEB0E01C92E0EFF0E08081886080831C9343
|
||||
:2009A000FF91EF91BF91AF919F918F917F916F915F914F913F912F911F910F900FBE0F901C
|
||||
:2009C0001F9018951F920F920FB60F9211242F933F934F935F936F937F938F939F93AF93BC
|
||||
:2009E000BF93EF93FF938091E10080FF1BC08091E20080FF17C08091E1008E7F8093E10009
|
||||
:200A00008091E2008E7F8093E2008091E20080618093E2008091D80080628093D80019BC8D
|
||||
:200A20001EBAD1D18091E10084FF29C08091E20084FF25C084E089BD89B5826089BD09B4B6
|
||||
:200A400000FEFDCF8091D8008F7D8093D8008091E1008F7E8093E1008091E2008F7E8093E6
|
||||
:200A6000E2008091E20081608093E20080912E02882311F481E001C084E08EBBA4D1809185
|
||||
:200A8000E10083FF27C08091E20083FF23C08091E100877F8093E10082E08EBB10922E024B
|
||||
:200AA0008091E1008E7F8093E1008091E2008E7F8093E2008091E20080618093E200AADDFE
|
||||
:200AC00080E060E042E093DD8091F00088608093F00079D18091E10082FF0AC08091E2007E
|
||||
:200AE00082FF06C08091E1008B7F8093E1006BD1FF91EF91BF91AF919F918F917F916F9183
|
||||
:200B00005F914F913F912F910F900FBE0F901F9018951F93DF93CF93CDB7DEB7AC970FB667
|
||||
:200B2000F894DEBF0FBECDBFE0E3F2E08091F100819322E0E833F207C9F7809130023091AE
|
||||
:200B40003102353009F487C0363040F43130C9F1313070F0333009F01DC133C0383009F4B1
|
||||
:200B6000EFC0393009F4FEC0363009F013C192C0803821F0823809F00DC108C090912C02BC
|
||||
:200B800080912D02882399F0926011C08091340287708093E9008091EB0090E025E0969548
|
||||
:200BA00087952A95E1F7982F91701092E9008091E800877F8093E8009093F1001092F1008E
|
||||
:200BC000CAC0882319F0823009F0E4C090E08F719070009721F0029709F0DDC00CC0809164
|
||||
:200BE0003202813009F0D7C010922D02333069F580932D022AC080913202882331F52091FB
|
||||
:200C00003402277009F4C7C02093E9008091EB0080FFC1C0333021F48091EB00806213C0C2
|
||||
:200C20008091EB0080618093EB0081E090E002C0880F991F2A95E2F78093EA001092EA00D6
|
||||
:200C40008091EB0088608093EB001092E9008091E800877F83C0882309F09CC01091320210
|
||||
:200C60008091E800877F8093E800E8DC04C08EB3882309F490C08091E80080FFF8CF812FCA
|
||||
:200C80008F7711F492E001C093E09EBB80688093E30081C08058823008F07CC08091320228
|
||||
:200CA0009091330223E08C3D920799F55FB7F894DE0115964EE020E030E061E2E42FF0E05B
|
||||
:200CC00060935700849120FF03C082958F704F5F982F9F70892F805D8A3308F0895F8C93E8
|
||||
:200CE00011961C9211972F5F3F4F12962431310529F75FBF8AE28B8383E08C838091E80085
|
||||
:200D0000877F8093E800CE0103966AE270E0E4DC11C060913402AE014F5F5F4F2CDCBC0146
|
||||
:200D20000097C9F18091E800877F8093E80089819A812BDD8091E8008B778093E8002BC05A
|
||||
:200D4000803841F58091E800877F8093E80080912E028093F1008091E8008E778093E8006D
|
||||
:200D60006DDC19C08823B1F490913202923098F48091E800877F8093E80090932E025EDCD7
|
||||
:200D800080912E02882311F483E001C084E08EBBEEDA01C0E9DA8091E80083FF0AC08091EF
|
||||
:200DA000EB0080628093EB008091E800877F8093E800AC960FB6F894DEBF0FBECDBFCF9185
|
||||
:200DC000DF911F91089508951F938EB3882361F01091E9001092E9008091E80083FF01C079
|
||||
:200DE00098DE17701093E9001F9108950895FC018EB3843021F587859089A189B289009757
|
||||
:200E0000A105B105E1F085818093E9008091E80082FF15C08091F200882319F42FEF3FEF4D
|
||||
:200E200004C08091F100282F30E08091F200882341F48091E8008B778093E80002C02FEFCC
|
||||
:200E40003FEFC9010895FC018EB3843011F587859089A189B2890097A105B105D1F08181C5
|
||||
:200E60008093E9008091F2008823A9F09091E8008091E8008E778093E80095FD0CC0FDDBF7
|
||||
:200E8000982F882349F48091E8008E778093E80003C092E001C090E0892F0895FC018EB3B1
|
||||
:200EA000843051F487859089A189B2890097A105B10511F0CF01C7CF08951F93FC01162FC4
|
||||
:200EC0008EB38430D9F487859089A189B2890097A105B10599F081818093E9008091E80053
|
||||
:200EE00085FD08C08091E8008E778093E800C5DB882329F41093F10080E001C082E01F9180
|
||||
:200F000008950F931F93CF93DF93EC010D96FC0189E0DF011D928A95E9F72A813B81098197
|
||||
:200F20008C81882311F410E001C014E0C90151DB182B1260802F61E8412F59DB882329F143
|
||||
:200F40002E813F810D818885882311F410E001C014E0C9013EDB182B1260802F60E8412F33
|
||||
:200F600046DB882391F02A853B8509858C85882311F410E001C014E0C9012BDB182B12603C
|
||||
:200F8000802F61EC412F33DB01C080E0DF91CF911F910F910895CF93DF93EC018091E8003F
|
||||
:200FA00083FF60C0888190E020913402309135022817390709F056C080913102813261F061
|
||||
:200FC000823220F4803209F04DC019C0823269F1833209F047C038C080913002813A09F006
|
||||
:200FE00041C08091E800877F8093E800CE010F9667E070E071DB8091E8008B7713C08091C0
|
||||
:201000003002813279F58091E800877F8093E800CE010F9667E070E013DCCE01DFD88091F2
|
||||
:20102000E8008E778093E8001DC0809130028132C9F48091E800877F8093E80080913202F9
|
||||
:201040008D87CE0164D90DC080913002813251F48091E800877F8093E800CE01609132027A
|
||||
:20106000C5DEECDADF91CF910895A1E21A2EAA1BBB1BFD010DC0AA1FBB1FEE1FFF1FA217E2
|
||||
:20108000B307E407F50720F0A21BB30BE40BF50B661F771F881F991F1A9469F760957095B3
|
||||
:2010A000809590959B01AC01BD01CF01089597FB092E05260ED057FD04D0D7DF0AD0001CDC
|
||||
:2010C00038F450954095309521953F4F4F4F5F4F0895F6F790958095709561957F4F8F4F6A
|
||||
:2010E0009F4F0895F894FFCF00034000000440000002080000000000000000000000140066
|
||||
:00000001FF
|
||||
1
compiled/DUE_16u2_reflash/get.sh
Executable file
1
compiled/DUE_16u2_reflash/get.sh
Executable file
@@ -0,0 +1 @@
|
||||
../tools/mac/tool-avrdude/avrdude -C ../tools/mac/tool-avrdude/avrdude.conf -c arduino -P /dev/cu.usbmodem14201 -b 19200 -p m16u2 -vvv -U flash:r:16u2-out3.hex:i
|
||||
@@ -1 +1 @@
|
||||
../tools/mac/tool-avrdude/avrdude -C ../tools/mac/tool-avrdude/avrdude.conf -c arduino -P /dev/cu.usbmodem14101 -b 19200 -p m16u2 -vvv -U flash:w:16u2.hex:i
|
||||
../tools/mac/tool-avrdude/avrdude -C ../tools/mac/tool-avrdude/avrdude.conf -c arduino -P /dev/cu.usbmodem14201 -b 19200 -p m16u2 -vvv -U flash:w:16u2.hex:i
|
||||
|
||||
1
compiled/DUE_16u2_reflash/reflashOriginal.sh
Executable file
1
compiled/DUE_16u2_reflash/reflashOriginal.sh
Executable file
@@ -0,0 +1 @@
|
||||
../tools/mac/tool-avrdude/avrdude -C ../tools/mac/tool-avrdude/avrdude.conf -c arduino -P /dev/cu.usbmodem14201 -b 19200 -p m16u2 -vvv -U flash:w:16u2-original.hex:i
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
1
compiled/due-5500/uploadOTA.sh
Executable file
1
compiled/due-5500/uploadOTA.sh
Executable file
@@ -0,0 +1 @@
|
||||
../tools/mac/arduinoOTA -address 192.168.88.21 -port 65280 -username arduino -password password -sketch firmware.bin -b -upload /sketch
|
||||
BIN
compiled/due/firmware.bin
Executable file
BIN
compiled/due/firmware.bin
Executable file
Binary file not shown.
1
compiled/due/uploadOTA.sh
Executable file
1
compiled/due/uploadOTA.sh
Executable file
@@ -0,0 +1 @@
|
||||
../tools/mac/arduinoOTA -address 192.168.88.21 -port 65280 -username arduino -password password -sketch firmware.bin -b -upload /sketch
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
compiled/lighthub21/hello.bin
Executable file
BIN
compiled/lighthub21/hello.bin
Executable file
Binary file not shown.
1
compiled/lighthub21/update_bin.sh
Executable file
1
compiled/lighthub21/update_bin.sh
Executable file
@@ -0,0 +1 @@
|
||||
cp ../../.pio/build/lighthub21/firmware.bin .
|
||||
1
compiled/lighthub21/uploadHello.sh
Executable file
1
compiled/lighthub21/uploadHello.sh
Executable file
@@ -0,0 +1 @@
|
||||
../tools/mac/arduinoOTA -address 192.168.88.59 -port 65280 -username arduino -password password -sketch hello.bin -b -upload /sketch
|
||||
1
compiled/lighthub21/uploadOTA.sh
Executable file
1
compiled/lighthub21/uploadOTA.sh
Executable file
@@ -0,0 +1 @@
|
||||
../tools/mac/arduinoOTA -address 192.168.11.172 -port 65280 -username arduino -password password -sketch firmware.bin -b -upload /sketch
|
||||
Binary file not shown.
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
BIN
compiled/tools/mac/arduinoOTA
Executable file
BIN
compiled/tools/mac/arduinoOTA
Executable file
Binary file not shown.
@@ -1,3 +1,4 @@
|
||||
cp ../.pio/build/due/firmware.bin due
|
||||
cp ../.pio/build/controllino/firmware.hex controllino
|
||||
cp ../.pio/build/m5stack/firmware.bin m5stack
|
||||
cp ../.pio/build/mega2560slim-5100/firmware.hex mega2560slim-5100
|
||||
|
||||
@@ -26,7 +26,7 @@ int abstractCh::publishTopic(const char* topic, float value, const char* subtopi
|
||||
int abstractCh::publishTopic(const char* topic, const char * value, const char* subtopic)
|
||||
{
|
||||
char addrstr[MQTT_TOPIC_LENGTH];
|
||||
|
||||
if (!isNotRetainingStatus()) return 0;
|
||||
if (topic)
|
||||
{
|
||||
strncpy(addrstr,topic,sizeof(addrstr));
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#define CST_UNKNOWN 0
|
||||
#define CST_INITIALIZED 1
|
||||
#define CST_FAILED 2
|
||||
|
||||
class abstractCh {
|
||||
public:
|
||||
|
||||
@@ -3,10 +3,11 @@
|
||||
#include "abstractch.h"
|
||||
|
||||
class Item;
|
||||
class chPersistent {};
|
||||
class abstractOut : public abstractCh{
|
||||
public:
|
||||
abstractOut(Item * _item):abstractCh(){item=_item;};
|
||||
virtual int Ctrl(short cmd, short n=0, int * Parameters=NULL, boolean send=true, int suffixCode=0, char* subItem=NULL) =0;
|
||||
virtual int Ctrl(short cmd, short n=0, int * Parameters=NULL, int suffixCode=0, char* subItem=NULL) =0;
|
||||
virtual int isActive(){return 0;};
|
||||
virtual int getDefaultOnVal(){return 100;};
|
||||
virtual int getChanType(){return 0;}
|
||||
|
||||
@@ -22,6 +22,7 @@ e-mail anklimov@gmail.com
|
||||
#include "item.h"
|
||||
#include "utils.h"
|
||||
#include <PubSubClient.h>
|
||||
#include "main.h"
|
||||
|
||||
#ifndef DHT_DISABLE
|
||||
#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
|
||||
@@ -31,6 +32,11 @@ e-mail anklimov@gmail.com
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MCP23017
|
||||
#include "Adafruit_MCP23017.h"
|
||||
Adafruit_MCP23017 mcp;
|
||||
#endif
|
||||
|
||||
extern PubSubClient mqttClient;
|
||||
extern aJsonObject *root;
|
||||
extern int8_t ethernetIdleCount;
|
||||
@@ -61,6 +67,7 @@ static short counter_irq_map[54];
|
||||
#endif
|
||||
#endif
|
||||
|
||||
readCache inCache;
|
||||
|
||||
Input::Input(char * name) //Constructor
|
||||
{
|
||||
@@ -72,35 +79,41 @@ Input::Input(char * name) //Constructor
|
||||
}
|
||||
|
||||
|
||||
Input::Input(int pin)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
|
||||
Input::Input(aJsonObject * obj)
|
||||
Input::Input(aJsonObject * obj, aJsonObject * parent)
|
||||
{
|
||||
inputObj= obj;
|
||||
Parse();
|
||||
|
||||
Parse(parent);
|
||||
}
|
||||
|
||||
|
||||
boolean Input::isValid ()
|
||||
{
|
||||
return (pin && store);
|
||||
return (store);
|
||||
}
|
||||
|
||||
void Input::Parse()
|
||||
|
||||
void Input::Parse(aJsonObject * configObj)
|
||||
{
|
||||
aJsonObject *itemBuffer;
|
||||
store = NULL;
|
||||
inType = 0;
|
||||
pin = 0;
|
||||
if (inputObj && (inputObj->type == aJson_Object) && root) {
|
||||
aJsonObject *itemBuffer;
|
||||
itemBuffer = aJson.getObjectItem(inputObj, "T");
|
||||
|
||||
if (!inputObj || !root) return;
|
||||
if (!configObj) configObj = inputObj;
|
||||
|
||||
if (configObj->type == aJson_Object)
|
||||
{
|
||||
// Retreive type and pin#
|
||||
itemBuffer = aJson.getObjectItem(configObj, "T");
|
||||
if (itemBuffer) inType = static_cast<uint8_t>(itemBuffer->valueint);
|
||||
pin = static_cast<uint8_t>(atoi(inputObj->name));
|
||||
|
||||
itemBuffer = aJson.getObjectItem(configObj, "#");
|
||||
if (itemBuffer) pin = static_cast<uint8_t>(itemBuffer->valueint);
|
||||
else pin = static_cast<uint8_t>(atoi(configObj->name));
|
||||
}
|
||||
|
||||
// Persistant storage
|
||||
itemBuffer = aJson.getObjectItem(inputObj, "S");
|
||||
if (!itemBuffer) {
|
||||
debugSerial<<F("In: ")<<pin<<F("/")<<inType<<endl;
|
||||
@@ -108,27 +121,40 @@ void Input::Parse()
|
||||
itemBuffer = aJson.getObjectItem(inputObj, "S");
|
||||
}
|
||||
if (itemBuffer) store = (inStore *) &itemBuffer->valueint;
|
||||
|
||||
}
|
||||
|
||||
void cleanStore(aJsonObject * input)
|
||||
{
|
||||
if (input->type == aJson_Object) {
|
||||
// Check for nested inputs
|
||||
aJsonObject * inputArray = aJson.getObjectItem(input, "act");
|
||||
if (inputArray && (inputArray->type == aJson_Array))
|
||||
{
|
||||
aJsonObject *inputObj = inputArray->child;
|
||||
|
||||
while(inputObj)
|
||||
{
|
||||
Input in(inputObj,input);
|
||||
in.store->aslong = 0;
|
||||
|
||||
yield();
|
||||
inputObj = inputObj->next;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Input in(input);
|
||||
in.Poll(CHECK_INPUT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Input::setup()
|
||||
{
|
||||
if (!isValid() || (!root)) return;
|
||||
/*
|
||||
#ifndef CSSHDC_DISABLE
|
||||
if (inType == IN_CCS811)
|
||||
{
|
||||
in_ccs811 ccs811(this);
|
||||
ccs811.Setup();
|
||||
}
|
||||
else if (inType == IN_HDC1080)
|
||||
{
|
||||
in_hdc1080 hdc1080(this);
|
||||
hdc1080.Setup();
|
||||
}
|
||||
// TODO rest types setup
|
||||
#endif
|
||||
*/
|
||||
cleanStore(inputObj);
|
||||
|
||||
store->aslong=0;
|
||||
uint8_t inputPinMode = INPUT; //if IN_ACTIVE_HIGH
|
||||
switch (inType)
|
||||
@@ -144,6 +170,24 @@ switch (inType)
|
||||
store->state=IS_IDLE;
|
||||
break;
|
||||
|
||||
#ifdef MCP23017
|
||||
|
||||
case IN_I2C | IN_PUSH_ON:
|
||||
case IN_I2C | IN_PUSH_TOGGLE :
|
||||
|
||||
inputPinMode = INPUT_PULLUP;
|
||||
|
||||
case IN_I2C | IN_PUSH_ON | IN_ACTIVE_HIGH:
|
||||
case IN_I2C | IN_PUSH_TOGGLE | IN_ACTIVE_HIGH:
|
||||
|
||||
mcp.begin(); //TBD - multiple chip
|
||||
mcp.pinMode(pin, INPUT);
|
||||
if (inputPinMode == INPUT_PULLUP) mcp.pullUp(0, HIGH); // turn on a 100K pullup internally
|
||||
|
||||
store->state=IS_IDLE;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case IN_ANALOG:
|
||||
inputPinMode = INPUT_PULLUP;
|
||||
|
||||
@@ -193,6 +237,10 @@ switch (cause) {
|
||||
case IN_PUSH_ON | IN_ACTIVE_HIGH:
|
||||
case IN_PUSH_TOGGLE :
|
||||
case IN_PUSH_TOGGLE | IN_ACTIVE_HIGH:
|
||||
case IN_I2C | IN_PUSH_ON:
|
||||
case IN_I2C | IN_PUSH_ON | IN_ACTIVE_HIGH:
|
||||
case IN_I2C | IN_PUSH_TOGGLE :
|
||||
case IN_I2C | IN_PUSH_TOGGLE | IN_ACTIVE_HIGH:
|
||||
contactPoll(cause);
|
||||
break;
|
||||
case IN_ANALOG:
|
||||
@@ -452,7 +500,7 @@ void Input::dht22Poll() {
|
||||
setNextPollTime(millis() + DHT_POLL_DELAY_DEFAULT / 3);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
bool Input::executeCommand(aJsonObject* cmd, int8_t toggle, char* defCmd)
|
||||
{
|
||||
if (!cmd) return false;
|
||||
@@ -500,7 +548,8 @@ if (emit) debugSerial << emit->valuestring<< F(" -> ")<<emitCommand<<endl;
|
||||
|
||||
|
||||
if (emit && emitCommand && emit->type == aJson_String) {
|
||||
/*
|
||||
|
||||
// *
|
||||
TODO implement
|
||||
#ifdef WITH_DOMOTICZ
|
||||
if (getIdxField())
|
||||
@@ -511,7 +560,7 @@ TODO implement
|
||||
getIdxField());
|
||||
} else
|
||||
#endif
|
||||
*/
|
||||
* //
|
||||
|
||||
{
|
||||
char addrstr[MQTT_TOPIC_LENGTH];
|
||||
@@ -535,6 +584,7 @@ return false;
|
||||
} //switch type
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
|
||||
// TODO Polling via timed interrupt with CHECK_INTERRUPT cause
|
||||
bool Input::changeState(uint8_t newState, short cause)
|
||||
@@ -660,12 +710,24 @@ void Input::contactPoll(short cause) {
|
||||
|
||||
|
||||
uint8_t inputOnLevel;
|
||||
aJsonObject * mapObj;
|
||||
if (inType & IN_ACTIVE_HIGH) inputOnLevel = HIGH;
|
||||
else inputOnLevel = LOW;
|
||||
|
||||
|
||||
currentInputState = (digitalRead(pin) == inputOnLevel);
|
||||
|
||||
#ifdef MCP23017
|
||||
if (inType & IN_I2C)
|
||||
currentInputState = (inCache.I2CReadBit(IN_I2C,0,pin) == inputOnLevel);
|
||||
else
|
||||
#endif
|
||||
if (isAnalogPin(pin) && (mapObj=aJson.getObjectItem(inputObj, "map")) && mapObj->type == aJson_Array)
|
||||
{
|
||||
int value = inCache.analogReadCached(pin);
|
||||
if (value >= aJson.getArrayItem(mapObj, 0)->valueint && value <= aJson.getArrayItem(mapObj, 1)->valueint)
|
||||
currentInputState = true;
|
||||
else currentInputState = false;
|
||||
}
|
||||
else currentInputState = (digitalRead(pin) == inputOnLevel);
|
||||
switch (store->state) //Timer based transitions
|
||||
{
|
||||
case IS_PRESSED:
|
||||
@@ -850,7 +912,7 @@ void Input::analogPoll(short cause) {
|
||||
|
||||
pinMode(pin, inputPinMode);
|
||||
*/
|
||||
inputVal = analogRead(pin);
|
||||
inputVal = inCache.analogReadCached(pin);
|
||||
// Mapping
|
||||
if (inputMap && inputMap->type == aJson_Array)
|
||||
{
|
||||
@@ -939,7 +1001,7 @@ if (!strchr(addrstr,'/')) setTopic(addrstr,sizeof(addrstr),T_OUT,emit->valuestri
|
||||
else if (strlen(scmd->valuestring))
|
||||
mqttClient.publish(addrstr, scmd->valuestring, true);
|
||||
} else { //send reset command
|
||||
if (!rcmd || rcmd->type == aJson_String) mqttClient.publish(addrstr, "OFF", true);
|
||||
if (!rcmd || rcmd->type != aJson_String) mqttClient.publish(addrstr, "OFF", true);
|
||||
else if (strlen(rcmd->valuestring))mqttClient.publish(addrstr, rcmd->valuestring, true);
|
||||
}
|
||||
}
|
||||
@@ -950,13 +1012,13 @@ if (!strchr(addrstr,'/')) setTopic(addrstr,sizeof(addrstr),T_OUT,emit->valuestri
|
||||
Item it(item->valuestring);
|
||||
if (it.isValid()) {
|
||||
if (newValue) { //send set command
|
||||
if (!scmd || scmd->type != aJson_String) it.Ctrl(CMD_ON, 0, NULL, true);
|
||||
if (!scmd || scmd->type != aJson_String) it.Ctrl(CMD_ON, 0, NULL);
|
||||
else if (strlen(scmd->valuestring))
|
||||
it.Ctrl(scmd->valuestring, true);
|
||||
it.Ctrl(scmd->valuestring);
|
||||
} else { //send reset command
|
||||
if (!rcmd || rcmd->type != aJson_String) it.Ctrl(CMD_OFF, 0, NULL, true);
|
||||
if (!rcmd || rcmd->type != aJson_String) it.Ctrl(CMD_OFF, 0, NULL);
|
||||
else if (strlen(rcmd->valuestring))
|
||||
it.Ctrl(rcmd->valuestring, true);
|
||||
it.Ctrl(rcmd->valuestring);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1025,3 +1087,44 @@ char* Input::getIdxField() {
|
||||
return idx->valuestring;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
readCache::readCache()
|
||||
{
|
||||
addr=0;
|
||||
type=0;
|
||||
}
|
||||
|
||||
uint16_t readCache::analogReadCached (uint8_t _pin)
|
||||
{
|
||||
if ((_pin==addr) && (IN_ANALOG==type)) return cached_data;
|
||||
addr = _pin;
|
||||
type = IN_ANALOG;
|
||||
cached_data =analogRead(_pin);
|
||||
return cached_data;
|
||||
}
|
||||
|
||||
uint8_t readCache::digitalReadCached(uint8_t _pin)
|
||||
{
|
||||
///TBD
|
||||
}
|
||||
|
||||
#ifdef MCP23017
|
||||
uint8_t readCache::I2CReadBit(uint8_t _type, uint8_t _addr, uint8_t _pin)
|
||||
{
|
||||
if (addr!=_addr || type != _type)
|
||||
{
|
||||
type=_type;
|
||||
addr=_addr;
|
||||
cached_data = mcp.readGPIOAB();
|
||||
}
|
||||
return (cached_data >> _pin ) & 0x1;
|
||||
}
|
||||
#endif
|
||||
|
||||
void readCache::invalidateInputCache()
|
||||
{
|
||||
addr=0;
|
||||
type=0;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ e-mail anklimov@gmail.com
|
||||
#define IN_ACTIVE_HIGH 2 // High level = PUSHED/ CLOSED/ ON othervise :Low Level. Use INPUT mode instead of INPUT_PULLUP for digital pin
|
||||
#define IN_ANALOG 64 // Analog input
|
||||
#define IN_RE 32 // Rotary Encoder (for further use)
|
||||
#define IN_I2C 128 // MCP23017
|
||||
|
||||
#define IN_PUSH_ON 0 // PUSH - ON, Release - OFF (ovverrided by pcmd/rcmd) - DEFAULT
|
||||
#define IN_PUSH_TOGGLE 1 // Used for push buttons. Every physicall push toggle logical switch on/off. Toggle on leading edge
|
||||
@@ -134,10 +135,7 @@ public:
|
||||
uint8_t pin;
|
||||
inStore *store;
|
||||
|
||||
Input(int pin);
|
||||
|
||||
Input(aJsonObject *obj);
|
||||
|
||||
Input(aJsonObject *obj, aJsonObject * configObj = NULL);
|
||||
Input(char *name);
|
||||
|
||||
boolean isValid();
|
||||
@@ -159,7 +157,7 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
void Parse();
|
||||
void Parse(aJsonObject * configObj = NULL);
|
||||
|
||||
void contactPoll(short cause);
|
||||
void analogPoll(short cause);
|
||||
@@ -181,5 +179,24 @@ protected:
|
||||
|
||||
char* getIdxField();
|
||||
bool changeState(uint8_t newState, short cause);
|
||||
bool executeCommand(aJsonObject* cmd, int8_t toggle = -1, char* defCmd = NULL);
|
||||
//bool executeCommand(aJsonObject* cmd, int8_t toggle = -1, char* defCmd = NULL);
|
||||
};
|
||||
|
||||
|
||||
|
||||
class readCache {
|
||||
public:
|
||||
readCache();
|
||||
uint16_t analogReadCached (uint8_t pin);
|
||||
uint8_t digitalReadCached(uint8_t pin);
|
||||
#ifdef MCP23017
|
||||
uint8_t I2CReadBit(uint8_t type, uint8_t addr, uint8_t pin);
|
||||
#endif
|
||||
void invalidateInputCache();
|
||||
protected:
|
||||
uint8_t addr;
|
||||
uint8_t type;
|
||||
uint16_t cached_data;
|
||||
};
|
||||
|
||||
extern readCache inCache;
|
||||
|
||||
@@ -43,6 +43,7 @@ e-mail anklimov@gmail.com
|
||||
#include "modules/out_spiled.h"
|
||||
#include "modules/out_ac.h"
|
||||
#include "modules/out_motor.h"
|
||||
#include "modules/out_modbus.h"
|
||||
|
||||
short modbusBusy = 0;
|
||||
extern aJsonObject *pollingItem;
|
||||
@@ -53,12 +54,91 @@ extern lan_status lanStatus;
|
||||
|
||||
int retrieveCode(char **psubItem);
|
||||
|
||||
|
||||
|
||||
itemCmd itemCmd::Percents(int i)
|
||||
{
|
||||
type=ST_PERCENTS;
|
||||
param.aslong=i;
|
||||
return *this;
|
||||
}
|
||||
|
||||
itemCmd itemCmd::Int(int32_t i)
|
||||
{
|
||||
type=ST_INT32;
|
||||
param.asInt32=i;
|
||||
return *this;
|
||||
}
|
||||
|
||||
itemCmd itemCmd::Int(uint32_t i)
|
||||
{
|
||||
type=ST_UINT32;
|
||||
param.asUint32=i;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
itemCmd itemCmd::Cmd(uint8_t i)
|
||||
{
|
||||
type=ST_COMMAND;
|
||||
param.cmd_code=i;
|
||||
return *this;
|
||||
}
|
||||
|
||||
char * itemCmd::toString(char * Buffer, int bufLen)
|
||||
{
|
||||
if (!Buffer) return NULL;
|
||||
switch (type)
|
||||
{
|
||||
case ST_VOID:
|
||||
return NULL;
|
||||
|
||||
case ST_PERCENTS:
|
||||
case ST_PERCENTS255:
|
||||
case ST_UINT32:
|
||||
snprintf(Buffer, bufLen, "%u", param.asUint32);
|
||||
break;
|
||||
case ST_INT32:
|
||||
snprintf(Buffer, bufLen, "%d", param.asInt32);
|
||||
|
||||
break;
|
||||
case ST_HS:
|
||||
case ST_HSV:
|
||||
case ST_HSV255:
|
||||
snprintf(Buffer, bufLen, "%d,%d,%d", param.h, param.s, param.v);
|
||||
|
||||
break;
|
||||
case ST_FLOAT_CELSIUS:
|
||||
case ST_FLOAT_FARENHEIT:
|
||||
case ST_FLOAT:
|
||||
snprintf(Buffer, bufLen, "%d", param.asfloat);
|
||||
break;
|
||||
case ST_RGB:
|
||||
snprintf(Buffer, bufLen, "%d,%d,%d", param.r, param.g, param.b);
|
||||
break;
|
||||
|
||||
case ST_RGBW:
|
||||
snprintf(Buffer, bufLen, "%d,%d,%d", param.r, param.g, param.b,param.w);
|
||||
break;
|
||||
|
||||
case ST_STRING:
|
||||
strncpy(Buffer, param.asString,bufLen);
|
||||
|
||||
break;
|
||||
case ST_COMMAND:
|
||||
strncpy_P(Buffer, commands_P[param.cmd_code], bufLen);
|
||||
}
|
||||
return Buffer;
|
||||
}
|
||||
|
||||
int txt2cmd(char *payload) {
|
||||
int cmd = CMD_UNKNOWN;
|
||||
if (!payload || !payload[0]) return cmd;
|
||||
|
||||
// Check for command
|
||||
if (*payload == '-' || (*payload >= '0' && *payload <= '9')) cmd = CMD_NUM;
|
||||
else if (*payload == '%') cmd = CMD_UP;
|
||||
/*
|
||||
else if (strcmp_P(payload, ON_P) == 0) cmd = CMD_ON;
|
||||
else if (strcmp_P(payload, OFF_P) == 0) cmd = CMD_OFF;
|
||||
else if (strcmp_P(payload, REST_P) == 0) cmd = CMD_RESTORE;
|
||||
@@ -80,10 +160,26 @@ int txt2cmd(char *payload) {
|
||||
else if (strcmp_P(payload, HIGH_P) == 0) cmd = CMD_HIGH;
|
||||
else if (strcmp_P(payload, MED_P) == 0) cmd = CMD_MED;
|
||||
else if (strcmp_P(payload, LOW_P) == 0) cmd = CMD_LOW;
|
||||
*/
|
||||
else if (*payload == '{') cmd = CMD_JSON;
|
||||
else if (*payload == '#') cmd = CMD_RGB;
|
||||
else
|
||||
{
|
||||
for(uint8_t i=1; i<commandsNum ;i++)
|
||||
if (strcmp_P(payload, commands_P[i]) == 0)
|
||||
{
|
||||
// debugSerial<< i << F(" ") << pgm_read_word_near(&serialModes_P[i].mode)<< endl;
|
||||
return i;
|
||||
}
|
||||
// debugSerial<< F("Default serial mode N81 used");
|
||||
// return static_cast<uint16_t> (SERIAL_8N1);
|
||||
}
|
||||
|
||||
/*
|
||||
else if (strncmp_P(payload, HSV_P, strlen (HSV_P)) == 0) cmd = CMD_HSV;
|
||||
else if (strncmp_P(payload, RGB_P, strlen (RGB_P)) == 0) cmd = CMD_RGB;
|
||||
*/
|
||||
|
||||
return cmd;
|
||||
}
|
||||
|
||||
@@ -174,6 +270,13 @@ void Item::Parse() {
|
||||
// debugSerial<<F("AC driver created")<<endl;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifndef MBUS_DISABLE
|
||||
case CH_MBUS:
|
||||
driver = new out_Modbus (this);
|
||||
// debugSerial<<F("AC driver created")<<endl;
|
||||
break;
|
||||
#endif
|
||||
default: ;
|
||||
}
|
||||
// debugSerial << F(" Item:") << itemArr->name << F(" T:") << itemType << F(" =") << getArg() << endl;
|
||||
@@ -192,6 +295,15 @@ if (driver)
|
||||
else return false;
|
||||
}
|
||||
|
||||
void Item::Stop()
|
||||
{
|
||||
if (driver)
|
||||
{
|
||||
driver->Stop();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Item::~Item()
|
||||
{
|
||||
if (driver)
|
||||
@@ -350,16 +462,40 @@ void Item::setExt(long int par) // Only store if VAL is int (autogenerated or c
|
||||
if (!itemExt)
|
||||
{
|
||||
for (int i = aJson.getArraySize(itemArr); i <= 4; i++)
|
||||
aJson.addItemToArray(itemArr, aJson.createItem(0));
|
||||
itemExt = aJson.getArrayItem(itemArr, I_EXT);
|
||||
aJson.addItemToArray(itemArr, itemExt=aJson.createItem(0));
|
||||
//itemExt = aJson.getArrayItem(itemArr, I_EXT);
|
||||
};
|
||||
|
||||
if(itemExt->type != aJson_Int) return;
|
||||
if(!itemExt || itemExt->type != aJson_Int) return;
|
||||
itemExt->valueint = par;
|
||||
debugSerial<<F("Stored EXT:")<<par<<endl;
|
||||
}
|
||||
|
||||
|
||||
chPersistent * Item::getPersistent()
|
||||
{
|
||||
if (!itemExt) return NULL;
|
||||
if (itemExt->type == aJson_Int) return (chPersistent *) itemExt->child;
|
||||
else return NULL;
|
||||
}
|
||||
|
||||
chPersistent * Item::setPersistent(chPersistent * par)
|
||||
{
|
||||
if (!itemExt)
|
||||
{
|
||||
for (int i = aJson.getArraySize(itemArr); i <= 4; i++)
|
||||
aJson.addItemToArray(itemArr, itemExt = aJson.createItem(0));
|
||||
//itemExt = aJson.getArrayItem(itemArr, I_EXT);
|
||||
};
|
||||
|
||||
if(!itemExt || (itemExt->type != aJson_Int)) return NULL;
|
||||
itemExt->child = (aJsonObject *) par;
|
||||
// debugSerial<<F("Persisted.")<<endl;
|
||||
return par;
|
||||
}
|
||||
|
||||
|
||||
|
||||
boolean Item::isValid() {
|
||||
return (itemArr && (itemArr->type == aJson_Array));
|
||||
}
|
||||
@@ -424,7 +560,7 @@ return suffixCode;
|
||||
#define MAXCTRLPAR 3
|
||||
|
||||
// myhome/dev/item/subItem
|
||||
int Item::Ctrl(char * payload, boolean send, char * subItem){
|
||||
int Item::Ctrl(char * payload, char * subItem){
|
||||
if (!payload) return 0;
|
||||
|
||||
|
||||
@@ -463,7 +599,7 @@ debugSerial<<F("Txt2Cmd:")<<cmd<<endl;
|
||||
while (payload && i < 3)
|
||||
Par[i++] = getInt((char **) &payload);
|
||||
|
||||
return Ctrl(setCommand, i, Par, send, suffixCode, subItem);
|
||||
return Ctrl(setCommand, i, Par, suffixCode, subItem);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -483,14 +619,14 @@ debugSerial<<F("Txt2Cmd:")<<cmd<<endl;
|
||||
Par[0] = map(hsv.h, 0, 255, 0, 365);
|
||||
Par[1] = map(hsv.s, 0, 255, 0, 100);
|
||||
Par[2] = map(hsv.v, 0, 255, 0, 100);
|
||||
return Ctrl(setCommand, 3, Par, send, suffixCode, subItem);
|
||||
return Ctrl(setCommand, 3, Par, suffixCode, subItem);
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
default: //some known command
|
||||
return Ctrl(cmd, 0, NULL, send, suffixCode, subItem);
|
||||
return Ctrl(cmd, 0, NULL, suffixCode, subItem);
|
||||
|
||||
} //ctrl
|
||||
return 0;
|
||||
@@ -507,7 +643,11 @@ short Item::cmd2changeActivity(int lastActivity, short defaultCmd)
|
||||
}
|
||||
*/
|
||||
|
||||
int Item::Ctrl(short cmd, short n, int *Parameters, boolean send, int suffixCode, char *subItem) {
|
||||
int Ctrl(itemCmd cmd, int suffixCode, char* subItem)
|
||||
{
|
||||
/*
|
||||
char stringBuffer[16];
|
||||
bool operation = isNotRetainingStatus() ;
|
||||
|
||||
if ((!subItem || !strlen(subItem)) && strlen(defaultSubItem))
|
||||
subItem = defaultSubItem; /// possible problem here with truncated default
|
||||
@@ -519,6 +659,255 @@ int Item::Ctrl(short cmd, short n, int *Parameters, boolean send, int suffixCode
|
||||
suffixCode = defaultSuffixCode;
|
||||
|
||||
|
||||
debugSerial<<F("RAM=")<<freeRam()<<F(" Item=")<<itemArr->name<<F(" Sub=")<<subItem<<F(" Suff=")<<suffixCode<<F(" Cmd=")<<cmd.toCmd()<<F(" Par=")<<cmd.toString(stringBuffer, sizeof(stringBuffer));
|
||||
if (!itemArr) return -1;
|
||||
|
||||
|
||||
if (itemType != CH_GROUP )
|
||||
{
|
||||
//Check if subitem is some sort of command
|
||||
int subitemCmd = subitem2cmd(subItem);
|
||||
if (subitemCmd && subitemCmd != getCmd())
|
||||
{
|
||||
debugSerial<<F("Ignored, channel cmd=")<<getCmd()<<endl;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
// Group channel
|
||||
if (! operation) return -1;
|
||||
|
||||
|
||||
|
||||
int iaddr = getArg();
|
||||
bool chActive =(isActive()>0);
|
||||
|
||||
switch (cmd.toCmd()) {
|
||||
int t;
|
||||
case CMD_TOGGLE:
|
||||
if (chActive) cmd.Cmd(CMD_OFF);
|
||||
else cmd.Cmd(CMD_ON);
|
||||
break;
|
||||
|
||||
case CMD_RESTORE:
|
||||
if (itemType != CH_GROUP) //individual threating of channels. Ignore restore command for groups
|
||||
switch (t = getCmd()) {
|
||||
case CMD_HALT: //previous command was HALT ?
|
||||
debugSerial << F("Restored from:") << t << endl;
|
||||
if (itemType == CH_THERMO) cmd.Cmd(CMD_AUTO);
|
||||
else cmd.Cmd(CMD_ON); //turning on
|
||||
break;
|
||||
default:
|
||||
return -3;
|
||||
}
|
||||
break;
|
||||
case CMD_XOFF:
|
||||
if (itemType != CH_GROUP) //individual threating of channels. Ignore restore command for groups
|
||||
switch (t = getCmd()) {
|
||||
case CMD_XON: //previous command was CMD_XON ?
|
||||
debugSerial << F("Turned off from:") << t << endl;
|
||||
cmd.Cmd(CMD_OFF); //turning Off
|
||||
break;
|
||||
default:
|
||||
debugSerial<<F("XOFF skipped. Prev cmd:")<<t<<endl;
|
||||
return -3;
|
||||
|
||||
}
|
||||
break;
|
||||
case CMD_DN:
|
||||
case CMD_UP:
|
||||
{
|
||||
if (itemType == CH_GROUP) break; ////bug here
|
||||
if (!n || !Par[0]) Par[0] = DEFAULT_INC_STEP;
|
||||
if (cmd == CMD_DN) Par[0]=-Par[0];
|
||||
st.aslong = getVal();
|
||||
int cType=getChanType();
|
||||
|
||||
debugSerial<<"from: h="<<st.h<<" s="<<st.s <<" v="<<st.v<<endl;
|
||||
switch (suffixCode)
|
||||
{
|
||||
case S_NOTFOUND:
|
||||
case S_SET:
|
||||
Par[0] += st.v;
|
||||
if (Par[0]>100) Par[0]=100;
|
||||
if (Par[0]<0) Par[0]=0;
|
||||
n=1;
|
||||
cmd=CMD_NUM;
|
||||
debugSerial<<" to v="<<Par[0]<<endl;
|
||||
break;
|
||||
case S_HUE:
|
||||
case S_SAT:
|
||||
if ( cType != CH_RGB && cType != CH_RGBW && cType != CH_GROUP) return 0; //HUE and SAT only applicable for RGBx channels
|
||||
}
|
||||
|
||||
if ( cType == CH_RGB || cType == CH_RGBW)
|
||||
{
|
||||
bool modified = false;
|
||||
switch (suffixCode)
|
||||
{
|
||||
case S_HSV:
|
||||
Par[0] += st.h;
|
||||
Par[1] += st.s;
|
||||
Par[2] += st.v;
|
||||
modified = true;
|
||||
break;
|
||||
|
||||
case S_HUE:
|
||||
Par[0] += st.h;
|
||||
Par[1] = st.s;
|
||||
Par[2] = st.v;
|
||||
|
||||
modified = true;
|
||||
break;
|
||||
|
||||
case S_SAT:
|
||||
Par[1] = st.s + Par[0];
|
||||
Par[0] = st.h;
|
||||
Par[2] = st.v;
|
||||
|
||||
modified = true;
|
||||
break;
|
||||
} //switch suffix
|
||||
|
||||
if (modified)
|
||||
{
|
||||
if (Par[0]>365 ) Par[0]=0;
|
||||
if (Par[0]<0) Par[0]=365;
|
||||
if (Par[1]>100) Par[1]=100;
|
||||
if (Par[1]<0) Par[1]=0;
|
||||
if (Par[2]>100) Par[2]=100;
|
||||
if (Par[2]<0) Par[2]=0;
|
||||
|
||||
n=3;
|
||||
cmd=CMD_NUM;
|
||||
suffixCode=S_SET;
|
||||
debugSerial<<"to: h="<<Par[0]<<" s="<<Par[1] <<" v="<<Par[2]<<endl;
|
||||
} // if modified
|
||||
} //RGBx channel
|
||||
}
|
||||
break;
|
||||
case CMD_NUM:
|
||||
//if (itemType == CH_GROUP || n!=1) break;
|
||||
if (n!=1) break;
|
||||
int cType=getChanType();
|
||||
if ( cType == CH_RGB || cType == CH_RGBW || cType == CH_GROUP )
|
||||
{
|
||||
st.aslong = getVal();
|
||||
st.hsv_flag=1;
|
||||
switch (suffixCode)
|
||||
{
|
||||
case S_SAT:
|
||||
st.s = Par[0];
|
||||
|
||||
Par[0] = st.h;
|
||||
Par[1] = st.s;
|
||||
Par[2] = st.v;
|
||||
|
||||
n=3;
|
||||
setVal(st.aslong);
|
||||
break;
|
||||
|
||||
case S_HUE:
|
||||
st.h = Par[0];
|
||||
Par[1] = st.s;
|
||||
Par[2] = st.v;
|
||||
|
||||
n=3;
|
||||
setVal(st.aslong);
|
||||
}
|
||||
//if (itemType == CH_GROUP) break;
|
||||
}
|
||||
else // Non-color channel
|
||||
if (suffixCode == S_SAT || suffixCode == S_HUE) return -3;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
=========
|
||||
int chActive = item->isActive();
|
||||
bool toExecute = (chActive>0);
|
||||
long st;
|
||||
if (cmd>0 && !suffixCode) suffixCode=S_CMD; //if some known command find, but w/o correct suffix - got it
|
||||
|
||||
|
||||
|
||||
switch(suffixCode)
|
||||
{
|
||||
case S_NOTFOUND:
|
||||
// turn on and set
|
||||
toExecute = true;
|
||||
debugSerial<<F("Forced execution");
|
||||
case S_SET:
|
||||
if (!Parameters || n==0) return 0;
|
||||
item->setVal(st=Parameters[0]); //Store
|
||||
if (!suffixCode)
|
||||
{
|
||||
if (chActive>0 && !st) item->setCmd(CMD_OFF);
|
||||
if (chActive==0 && st) item->setCmd(CMD_ON);
|
||||
item->SendStatus(SEND_COMMAND | SEND_PARAMETERS | SEND_DEFFERED);
|
||||
if (item->getExt()) item->setExt(millis()+maxOnTime); //Extend motor time
|
||||
}
|
||||
else item->SendStatus(SEND_PARAMETERS | SEND_DEFFERED);
|
||||
|
||||
return 1;
|
||||
//break;
|
||||
|
||||
case S_CMD:
|
||||
item->setCmd(cmd);
|
||||
switch (cmd)
|
||||
{
|
||||
case CMD_ON:
|
||||
//retrive stored values
|
||||
st = item->getVal();
|
||||
|
||||
|
||||
if (st && (st<MIN_VOLUME) ) st=INIT_VOLUME; // & send
|
||||
item->setVal(st);
|
||||
|
||||
if (st) //Stored smthng
|
||||
{
|
||||
item->SendStatus(SEND_COMMAND | SEND_PARAMETERS);
|
||||
debugSerial<<F("Restored: ")<<st<<endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSerial<<st<<F(": No stored values - default\n");
|
||||
// Store
|
||||
st=100;
|
||||
item->setVal(st);
|
||||
item->SendStatus(SEND_COMMAND | SEND_PARAMETERS );
|
||||
}
|
||||
if (item->getExt()) item->setExt(millis()+maxOnTime); //Extend motor time
|
||||
return 1;
|
||||
|
||||
case CMD_OFF:
|
||||
item->SendStatus(SEND_COMMAND);
|
||||
if (item->getExt()) item->setExt(millis()+maxOnTime); //Extend motor time
|
||||
return 1;
|
||||
|
||||
} //switch cmd
|
||||
|
||||
break;
|
||||
} //switch suffix
|
||||
debugSerial<<F("Unknown cmd")<<endl;
|
||||
return 0;
|
||||
*/
|
||||
}
|
||||
|
||||
int Item::Ctrl(short cmd, short n, int *Parameters, int suffixCode, char *subItem) {
|
||||
bool send = isNotRetainingStatus() ;
|
||||
if ((!subItem || !strlen(subItem)) && strlen(defaultSubItem))
|
||||
subItem = defaultSubItem; /// possible problem here with truncated default
|
||||
|
||||
if (!suffixCode && subItem && strlen(subItem))
|
||||
suffixCode = retrieveCode(&subItem);
|
||||
|
||||
if (!suffixCode && defaultSuffixCode)
|
||||
suffixCode = defaultSuffixCode;
|
||||
|
||||
yield();
|
||||
debugSerial<<F("RAM=")<<freeRam()<<F(" Item=")<<itemArr->name<<F(" Sub=")<<subItem<<F(" Suff=")<<suffixCode<<F(" Cmd=")<<cmd<<F(" Par=(");
|
||||
if (!itemArr) return -1;
|
||||
|
||||
@@ -552,7 +941,7 @@ int Item::Ctrl(short cmd, short n, int *Parameters, boolean send, int suffixCode
|
||||
|
||||
int iaddr = getArg();
|
||||
int chActive =isActive();
|
||||
CHstore st;
|
||||
itemStore st;
|
||||
switch (cmd) {
|
||||
int t;
|
||||
/*
|
||||
@@ -682,12 +1071,13 @@ int Item::Ctrl(short cmd, short n, int *Parameters, boolean send, int suffixCode
|
||||
}
|
||||
break;
|
||||
case CMD_NUM:
|
||||
if (itemType == CH_GROUP || n!=1) break;
|
||||
|
||||
//if (itemType == CH_GROUP || n!=1) break;
|
||||
if (n!=1) break;
|
||||
int cType=getChanType();
|
||||
if ( cType == CH_RGB || cType == CH_RGBW)
|
||||
if ( cType == CH_RGB || cType == CH_RGBW || cType == CH_GROUP )
|
||||
{
|
||||
st.aslong = getVal();
|
||||
st.hsv_flag=1;
|
||||
switch (suffixCode)
|
||||
{
|
||||
case S_SAT:
|
||||
@@ -709,6 +1099,7 @@ int Item::Ctrl(short cmd, short n, int *Parameters, boolean send, int suffixCode
|
||||
n=3;
|
||||
setVal(st.aslong);
|
||||
}
|
||||
//if (itemType == CH_GROUP) break;
|
||||
}
|
||||
else // Non-color channel
|
||||
if (suffixCode == S_SAT || suffixCode == S_HUE) return -3;
|
||||
@@ -724,7 +1115,7 @@ int Item::Ctrl(short cmd, short n, int *Parameters, boolean send, int suffixCode
|
||||
if (!chActive>0) //if channel was'nt active before CMD_XON
|
||||
{
|
||||
debugSerial<<F("Turning XON\n");
|
||||
res = driver->Ctrl(CMD_ON, n, Par, send, suffixCode, subItem);
|
||||
res = driver->Ctrl(CMD_ON, n, Par, suffixCode, subItem);
|
||||
setCmd(CMD_XON);
|
||||
}
|
||||
else
|
||||
@@ -736,7 +1127,7 @@ int Item::Ctrl(short cmd, short n, int *Parameters, boolean send, int suffixCode
|
||||
case CMD_HALT:
|
||||
if (chActive>0) //if channel was active before CMD_HALT
|
||||
{
|
||||
res = driver->Ctrl(CMD_OFF, n, Par, send, suffixCode, subItem);
|
||||
res = driver->Ctrl(CMD_OFF, n, Par, suffixCode, subItem);
|
||||
setCmd(CMD_HALT);
|
||||
return res;
|
||||
}
|
||||
@@ -749,7 +1140,7 @@ int Item::Ctrl(short cmd, short n, int *Parameters, boolean send, int suffixCode
|
||||
case CMD_OFF:
|
||||
if (getCmd() != CMD_HALT) //Halted, ignore OFF
|
||||
{
|
||||
res = driver->Ctrl(cmd, n, Par, send, suffixCode, subItem);
|
||||
res = driver->Ctrl(cmd, n, Par, suffixCode, subItem);
|
||||
setCmd(CMD_OFF);
|
||||
}
|
||||
else
|
||||
@@ -764,7 +1155,7 @@ int Item::Ctrl(short cmd, short n, int *Parameters, boolean send, int suffixCode
|
||||
break;
|
||||
*/
|
||||
default:
|
||||
res = driver->Ctrl(cmd, n, Par, send, suffixCode, subItem);
|
||||
res = driver->Ctrl(cmd, n, Par, suffixCode, subItem);
|
||||
if (cmd) setCmd(cmd);
|
||||
}
|
||||
return res;
|
||||
@@ -1066,7 +1457,7 @@ int Item::Ctrl(short cmd, short n, int *Parameters, boolean send, int suffixCode
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef _modbus
|
||||
#ifndef MODBUS_DISABLE
|
||||
case CH_MODBUS:
|
||||
modbusDimmerSet(Par[0]);
|
||||
break;
|
||||
@@ -1082,7 +1473,7 @@ int Item::Ctrl(short cmd, short n, int *Parameters, boolean send, int suffixCode
|
||||
if (i->type == aJson_String)
|
||||
{
|
||||
Item it(i->valuestring);
|
||||
it.Ctrl(cmd, n, Par, send,suffixCode,subItem); //// was true
|
||||
it.Ctrl(cmd, n, Par, suffixCode,subItem); //// was true
|
||||
}
|
||||
i = i->next;
|
||||
} //while
|
||||
@@ -1149,7 +1540,7 @@ int Item::Ctrl(short cmd, short n, int *Parameters, boolean send, int suffixCode
|
||||
debugSerial<<F("Pin:")<<iaddr<<F("=")<<k<<endl;
|
||||
break;
|
||||
}
|
||||
#ifdef _modbus
|
||||
#ifndef MODBUS_DISABLE
|
||||
case CH_VC:
|
||||
VacomSetFan(Par[0], cmd);
|
||||
break;
|
||||
@@ -1165,7 +1556,7 @@ return 1;
|
||||
}
|
||||
|
||||
int Item::isActive() {
|
||||
CHstore st;
|
||||
itemStore st;
|
||||
int val = 0;
|
||||
|
||||
|
||||
@@ -1312,7 +1703,7 @@ POLL 2101x10
|
||||
[22:27:29] => poll: 0A 03 08 34 00 0A 87 18
|
||||
|
||||
*/
|
||||
#ifdef _modbus
|
||||
#ifndef MODBUS_DISABLE
|
||||
int Item::modbusDimmerSet(uint16_t value)
|
||||
{
|
||||
switch (getCmd())
|
||||
@@ -1772,13 +2163,14 @@ void Item::sendDelayedStatus()
|
||||
|
||||
|
||||
int Item::SendStatus(int sendFlags) {
|
||||
int chancmd=getCmd();
|
||||
if ((sendFlags & SEND_DEFFERED) || (lanStatus==RETAINING_COLLECTING)) {
|
||||
|
||||
if ((sendFlags & SEND_DEFFERED) || (!isNotRetainingStatus() )) {
|
||||
setFlag(sendFlags & (SEND_COMMAND | SEND_PARAMETERS));
|
||||
debugSerial<<F("Status deffered\n");
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
int chancmd=getCmd();
|
||||
sendFlags |= getFlag(SEND_COMMAND | SEND_PARAMETERS); //if some delayed status is pending
|
||||
char addrstr[48];
|
||||
char valstr[16] = "";
|
||||
@@ -1787,7 +2179,7 @@ int Item::SendStatus(int sendFlags) {
|
||||
if (sendFlags & SEND_PARAMETERS)
|
||||
{
|
||||
// Preparing parameters payload //////////
|
||||
CHstore st;
|
||||
itemStore st;
|
||||
int chanType = itemType;
|
||||
if (driver) chanType = driver->getChanType();
|
||||
//retrive stored values
|
||||
|
||||
@@ -50,6 +50,7 @@ e-mail anklimov@gmail.com
|
||||
#define CH_AC 10 //AC Haier
|
||||
#define CH_SPILED 11
|
||||
#define CH_MOTOR 12
|
||||
#define CH_MBUS 14
|
||||
//#define CHANNEL_TYPES 13
|
||||
|
||||
//static uint32_t pollInterval[CHANNEL_TYPES] = {0,0,0,0,MODB};
|
||||
@@ -60,8 +61,18 @@ e-mail anklimov@gmail.com
|
||||
#define CMD_NUM 0
|
||||
#define CMD_UNKNOWN -1
|
||||
#define CMD_JSON -2
|
||||
#define CMD_RGB -3
|
||||
#define CMD_HSV -4
|
||||
//#define CMD_RGB -3
|
||||
//#define CMD_HSV -4
|
||||
|
||||
typedef char cmdstr[9];
|
||||
|
||||
const cmdstr commands_P[] PROGMEM =
|
||||
{
|
||||
"","ON","OFF","REST","TOGGLE","HALT","XON","XOFF","INCREASE","DECREASE",
|
||||
"HEAT","COOL","AUTO","FAN_ONLY","DRY","STOP","HIGH","MEDIUM","LOW",
|
||||
"TRUE","FALSE","ENABLED","DISABLED","RGB","HSV"
|
||||
};
|
||||
#define commandsNum sizeof(commands_P)/sizeof(cmdstr)
|
||||
|
||||
#define CMD_ON 1
|
||||
#define CMD_OFF 2
|
||||
@@ -77,10 +88,16 @@ e-mail anklimov@gmail.com
|
||||
#define CMD_AUTO 0xc
|
||||
#define CMD_FAN 0xd
|
||||
#define CMD_DRY 0xe
|
||||
//#define CMD_SET 0xf
|
||||
#define CMD_STOP 0xf
|
||||
#define CMD_HIGH 0x10 //AC fan leve
|
||||
#define CMD_MED 0x11
|
||||
#define CMD_LOW 0x12
|
||||
#define CMD_ENABLED 0x13
|
||||
#define CMD_DISABLED 0x14
|
||||
#define CMD_TRUE 0x15
|
||||
#define CMD_FALSE 0x16
|
||||
#define CMD_RGB 0x17
|
||||
#define CMD_HSV 0x18
|
||||
//#define CMD_CURTEMP 0xf
|
||||
#define CMD_MASK 0xff
|
||||
#define FLAG_MASK 0xff00
|
||||
@@ -93,6 +110,10 @@ e-mail anklimov@gmail.com
|
||||
#define ACTION_NEEDED 0x1000
|
||||
#define ACTION_IN_PROCESS 0x2000
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//#define CMD_REPORT 32
|
||||
|
||||
#define I_TYPE 0 //Type of item
|
||||
@@ -119,11 +140,40 @@ extern short thermoSetCurTemp(char *name, float t);
|
||||
|
||||
int txt2cmd (char * payload);
|
||||
|
||||
enum itemStoreType {
|
||||
ST_VOID = 0,
|
||||
ST_PERCENTS = 1,
|
||||
ST_HS = 2,
|
||||
ST_HSV = 3,
|
||||
ST_FLOAT_CELSIUS= 4,
|
||||
ST_FLOAT_FARENHEIT= 5,
|
||||
ST_RGB = 6,
|
||||
ST_RGBW = 7,
|
||||
ST_PERCENTS255 = 8,
|
||||
ST_HSV255 = 9,
|
||||
ST_INT32 = 10,
|
||||
ST_UINT32 = 11,
|
||||
ST_STRING = 12,
|
||||
ST_FLOAT = 13,
|
||||
ST_COMMAND = 15
|
||||
|
||||
};
|
||||
|
||||
#pragma pack(push, 1)
|
||||
typedef union
|
||||
{
|
||||
long int aslong;
|
||||
int32_t asInt32;
|
||||
uint32_t asUint32;
|
||||
char* asString;
|
||||
float asfloat;
|
||||
struct
|
||||
{
|
||||
uint8_t cmd_code;
|
||||
uint8_t cmd_flag;
|
||||
uint8_t cmd_effect;
|
||||
uint8_t cmd_effect_param;
|
||||
};
|
||||
struct
|
||||
{ uint8_t v;
|
||||
uint8_t s;
|
||||
@@ -135,19 +185,24 @@ typedef union
|
||||
uint8_t r;
|
||||
uint8_t g;
|
||||
uint8_t b;
|
||||
uint8_t w:7;
|
||||
uint8_t rgb_flag:1;
|
||||
uint8_t w;//:7;
|
||||
// uint8_t rgb_flag:1;
|
||||
};
|
||||
} CHstore;
|
||||
} itemStore;
|
||||
|
||||
/*
|
||||
typedef union
|
||||
class itemCmd
|
||||
{
|
||||
long int aslong;
|
||||
struct
|
||||
public:
|
||||
itemStoreType type;
|
||||
itemStore param;
|
||||
itemCmd Percents(int i);
|
||||
itemCmd Int(int32_t i);
|
||||
itemCmd Int(uint32_t i);
|
||||
itemCmd Cmd(uint8_t i);
|
||||
char * toString(char * Buffer, int bufLen);
|
||||
short toCmd();
|
||||
} ;
|
||||
|
||||
} RGBWstore;
|
||||
*/
|
||||
#pragma pack(pop)
|
||||
|
||||
class Item
|
||||
@@ -163,8 +218,10 @@ class Item
|
||||
|
||||
boolean isValid ();
|
||||
boolean Setup();
|
||||
virtual int Ctrl(short cmd, short n=0, int * Parameters=NULL, boolean send=true, int suffixCode=0, char* subItem=NULL);
|
||||
virtual int Ctrl(char * payload, boolean send=true, char * subItem=NULL);
|
||||
void Stop();
|
||||
int Ctrl(short cmd, short n=0, int * Parameters=NULL, int suffixCode=0, char* subItem=NULL);
|
||||
int Ctrl(itemCmd cmd, int suffixCode=0, char* subItem=NULL);
|
||||
int Ctrl(char * payload, char * subItem=NULL);
|
||||
|
||||
int getArg(short n=0);
|
||||
//int getVal(short n); //From VAL array. Negative if no array
|
||||
@@ -172,6 +229,8 @@ class Item
|
||||
uint8_t getCmd();
|
||||
long int getExt(); //From int val OR array
|
||||
void setExt(long int par);
|
||||
chPersistent * getPersistent();
|
||||
chPersistent * setPersistent(chPersistent * par);
|
||||
void setCmd(uint8_t cmdValue);
|
||||
short getFlag (short flag=FLAG_MASK);
|
||||
void setFlag (short flag);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -23,15 +23,15 @@
|
||||
#include <FS.h> //this needs to be first, or it all crashes and burns...
|
||||
//#include "SPIFFS.h"
|
||||
#include <ESP_EEPROM.h>
|
||||
#include <ESP8266HTTPClient.h>
|
||||
//#include <ESP8266HTTPClient.h>
|
||||
//#include <ArduinoHttpClient.h>
|
||||
//#include "HttpClient.h"
|
||||
#include <WiFiManager.h>
|
||||
#include <DNSServer.h>
|
||||
#include <ESP8266WebServer.h>
|
||||
#include <ESP8266WiFi.h>
|
||||
//#include <WiFiManager.h>
|
||||
//#include <DNSServer.h>
|
||||
//#include <ESP8266WebServer.h>
|
||||
//#include <ESP8266WiFi.h>
|
||||
#include <user_interface.h>
|
||||
#define Ethernet WiFi
|
||||
//#define Ethernet WiFi
|
||||
#endif
|
||||
|
||||
#if defined ARDUINO_ARCH_ESP32
|
||||
@@ -41,15 +41,15 @@
|
||||
#include <NRFFlashStorage.h>
|
||||
//#include "HttpClient.h"
|
||||
//#include <ArduinoHttpClient.h>
|
||||
#include <HTTPClient.h>
|
||||
#include <WiFi.h>
|
||||
#include <WiFiClient.h>
|
||||
#include <WiFiClientSecure.h>
|
||||
#include <WebServer.h>
|
||||
#include <WiFiManager.h>
|
||||
#include <DNSServer.h>
|
||||
//#include <HTTPClient.h>
|
||||
//#include <WiFi.h>
|
||||
//#include <WiFiClient.h>
|
||||
//#include <WiFiClientSecure.h>
|
||||
//#include <WebServer.h>
|
||||
//#include <WiFiManager.h>
|
||||
//include <DNSServer.h>
|
||||
|
||||
#define Ethernet WiFi
|
||||
//#define Ethernet WiFi
|
||||
#endif
|
||||
|
||||
#ifdef NRF5
|
||||
@@ -59,11 +59,16 @@
|
||||
|
||||
#ifdef ARDUINO_ARCH_STM32
|
||||
#include "HttpClient.h"
|
||||
#include "UIPEthernet.h"
|
||||
//#include "UIPEthernet.h"
|
||||
#include <NRFFlashStorage.h>
|
||||
//#include <EEPROM.h>
|
||||
#endif
|
||||
|
||||
#include "streamlog.h"
|
||||
extern Streamlog debugSerial;
|
||||
extern Streamlog infoSerial;
|
||||
extern Streamlog errorSerial;
|
||||
|
||||
#if defined(__SAM3X8E__)
|
||||
#define wdt_res() watchdogReset()
|
||||
#define wdt_en()
|
||||
@@ -119,7 +124,7 @@
|
||||
#include "DallasTemperature.h"
|
||||
#endif
|
||||
|
||||
#ifndef MODBUS_DISABLE
|
||||
#ifdef _modbus
|
||||
#include <ModbusMaster.h>
|
||||
#endif
|
||||
|
||||
@@ -135,13 +140,33 @@
|
||||
#include "dmx.h"
|
||||
#endif
|
||||
|
||||
#ifdef WIFI_ENABLE
|
||||
|
||||
#ifdef Wiz5500
|
||||
#include <Ethernet2.h>
|
||||
#else
|
||||
#if defined(ARDUINO_ARCH_AVR) || defined(__SAM3X8E__) || defined(NRF5)
|
||||
#include <Ethernet.h>
|
||||
#endif
|
||||
#if defined(ARDUINO_ARCH_ESP32)
|
||||
#include <WiFi.h>
|
||||
#include <HTTPClient.h>
|
||||
#include <WiFiClient.h>
|
||||
#include <WiFiClientSecure.h>
|
||||
#include <WiFiManager.h>
|
||||
#include <WebServer.h>
|
||||
#else
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <ESP8266HTTPClient.h>
|
||||
#include <WiFiManager.h>
|
||||
#include <DNSServer.h>
|
||||
#include <ESP8266WebServer.h>
|
||||
#endif
|
||||
#define Ethernet WiFi
|
||||
#else //Wired connection
|
||||
#ifdef Wiz5500
|
||||
#include <Ethernet2.h>
|
||||
#else
|
||||
#ifdef ARDUINO_ARCH_STM32
|
||||
#include "UIPEthernet.h"
|
||||
#else
|
||||
#include <Ethernet.h>
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -171,14 +196,19 @@ extern Artnet *artnet;
|
||||
|
||||
enum lan_status {
|
||||
INITIAL_STATE = 0,
|
||||
HAVE_IP_ADDRESS = 1,
|
||||
IP_READY_CONFIG_LOADED_CONNECTING_TO_BROKER = 2,
|
||||
RETAINING_COLLECTING = 3,
|
||||
OPERATION = 4,
|
||||
AWAITING_ADDRESS = -10,
|
||||
RECONNECT = 12,
|
||||
READ_RE_CONFIG = -11,
|
||||
DO_NOTHING = -14
|
||||
AWAITING_ADDRESS = 1,
|
||||
HAVE_IP_ADDRESS = 2,
|
||||
LIBS_INITIALIZED = 3,
|
||||
IP_READY_CONFIG_LOADED_CONNECTING_TO_BROKER = 4,
|
||||
RETAINING_COLLECTING = 5,
|
||||
OPERATION = 6,
|
||||
|
||||
DO_REINIT = -10,
|
||||
REINIT = - 11,
|
||||
DO_RECONNECT = 12,
|
||||
RECONNECT = 13,
|
||||
READ_RE_CONFIG = 14,
|
||||
DO_NOTHING = -15
|
||||
};
|
||||
|
||||
typedef union {
|
||||
@@ -186,6 +216,7 @@ typedef union {
|
||||
uint8_t UID_Byte[20];
|
||||
} UID;
|
||||
|
||||
bool isNotRetainingStatus();
|
||||
//void watchdogSetup(void);
|
||||
|
||||
void mqttCallback(char *topic, byte *payload, unsigned int length);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "options.h"
|
||||
#include "Streaming.h"
|
||||
#include "item.h"
|
||||
#include "main.h"
|
||||
|
||||
#if defined(M5STACK)
|
||||
#include <M5Stack.h>
|
||||
@@ -30,6 +31,7 @@ int in_ccs811::Setup()
|
||||
Serial.println("CCS811 Init");
|
||||
|
||||
Wire.begin(); //Inialize I2C Harware
|
||||
Wire.setClock(4000);
|
||||
|
||||
//It is recommended to check return status on .begin(), but it is not
|
||||
//required.
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "Streaming.h"
|
||||
#include "item.h"
|
||||
#include "textconst.h"
|
||||
#include "main.h"
|
||||
|
||||
#ifndef AC_Serial
|
||||
#define AC_Serial Serial3
|
||||
@@ -258,7 +259,7 @@ delay(100);
|
||||
return INTERVAL_POLLING;
|
||||
};
|
||||
|
||||
int out_AC::Ctrl(short cmd, short n, int * Parameters, boolean send, int suffixCode, char* subItem)
|
||||
int out_AC::Ctrl(short cmd, short n, int * Parameters, int suffixCode, char* subItem)
|
||||
{char s_mode[10];
|
||||
// Some additional Subitems
|
||||
if (strcmp_P(subItem, LOCK_P) == 0) suffixCode = S_LOCK;
|
||||
@@ -275,7 +276,7 @@ int out_AC::Ctrl(short cmd, short n, int * Parameters, boolean send, int suffixC
|
||||
if (set_tmp >= 10 && set_tmp <= 30)
|
||||
{
|
||||
data[B_SET_TMP] = set_tmp -16;
|
||||
if (send) publishTopic(item->itemArr->name,(long) set_tmp,"/set");
|
||||
publishTopic(item->itemArr->name,(long) set_tmp,"/set");
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -288,7 +289,7 @@ int out_AC::Ctrl(short cmd, short n, int * Parameters, boolean send, int suffixC
|
||||
data[B_POWER] = power;
|
||||
data[B_POWER] |= 1;
|
||||
SendData(on, sizeof(on)/sizeof(byte));
|
||||
if (send) publishTopic(item->itemArr->name,"ON","/cmd");
|
||||
publishTopic(item->itemArr->name,"ON","/cmd");
|
||||
return 1;
|
||||
break;
|
||||
case CMD_OFF:
|
||||
@@ -296,7 +297,7 @@ int out_AC::Ctrl(short cmd, short n, int * Parameters, boolean send, int suffixC
|
||||
data[B_POWER] = power;
|
||||
data[B_POWER] &= ~1;
|
||||
SendData(off, sizeof(off)/sizeof(byte));
|
||||
if (send) publishTopic(item->itemArr->name,"OFF","/cmd");
|
||||
publishTopic(item->itemArr->name,"OFF","/cmd");
|
||||
return 1;
|
||||
break;
|
||||
case CMD_AUTO:
|
||||
@@ -334,7 +335,7 @@ int out_AC::Ctrl(short cmd, short n, int * Parameters, boolean send, int suffixC
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
if (send) publishTopic(item->itemArr->name,s_mode,"/cmd");
|
||||
publishTopic(item->itemArr->name,s_mode,"/cmd");
|
||||
break;
|
||||
|
||||
case S_FAN:
|
||||
@@ -361,7 +362,7 @@ int out_AC::Ctrl(short cmd, short n, int * Parameters, boolean send, int suffixC
|
||||
if (n) data[B_FAN_SPD] = Parameters[0];
|
||||
//TODO - mapping digits to speed
|
||||
}
|
||||
if (send) publishTopic(item->itemArr->name,s_mode,"/fan");
|
||||
publishTopic(item->itemArr->name,s_mode,"/fan");
|
||||
break;
|
||||
|
||||
case S_MODE:
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
int Stop() override;
|
||||
int Status() override;
|
||||
int isActive() override;
|
||||
int Ctrl(short cmd, short n=0, int * Parameters=NULL, boolean send=true, int suffixCode=0, char* subItem=NULL) override;
|
||||
int Ctrl(short cmd, short n=0, int * Parameters=NULL, int suffixCode=0, char* subItem=NULL) override;
|
||||
|
||||
protected:
|
||||
void InsertData(byte data[], size_t size);
|
||||
|
||||
412
lighthub/modules/out_modbus.cpp
Normal file
412
lighthub/modules/out_modbus.cpp
Normal file
@@ -0,0 +1,412 @@
|
||||
#ifndef MBUS_DISABLE
|
||||
|
||||
#include "modules/out_modbus.h"
|
||||
#include "Arduino.h"
|
||||
#include "options.h"
|
||||
#include "utils.h"
|
||||
#include "Streaming.h"
|
||||
|
||||
#include "item.h"
|
||||
#include <ModbusMaster.h>
|
||||
#include "main.h"
|
||||
#include <HardwareSerial.h>
|
||||
|
||||
extern aJsonObject *modbusObj;
|
||||
extern ModbusMaster node;
|
||||
extern short modbusBusy;
|
||||
extern void modbusIdle(void) ;
|
||||
|
||||
struct reg_t
|
||||
{
|
||||
const char verb[4];
|
||||
const uint8_t id;
|
||||
};
|
||||
|
||||
struct serial_t
|
||||
{
|
||||
const char verb[4];
|
||||
const uint16_t mode;
|
||||
};
|
||||
|
||||
#define PAR_I16 1
|
||||
#define PAR_I32 2
|
||||
#define PAR_U16 3
|
||||
#define PAR_U32 4
|
||||
#define PAR_I8H 5
|
||||
#define PAR_I8L 6
|
||||
#define PAR_U8H 7
|
||||
#define PAR_U8L 8
|
||||
|
||||
|
||||
const reg_t regSize_P[] PROGMEM =
|
||||
{
|
||||
{ "i16", (uint8_t) PAR_I16 },
|
||||
{ "i32", (uint8_t) PAR_I32 },
|
||||
{ "u16", (uint8_t) PAR_U16 },
|
||||
{ "u32", (uint8_t) PAR_U32 },
|
||||
{ "i8h", (uint8_t) PAR_I8H },
|
||||
{ "i8l", (uint8_t) PAR_I8L },
|
||||
{ "u8h", (uint8_t) PAR_U8H },
|
||||
{ "u8l", (uint8_t) PAR_U8L }
|
||||
} ;
|
||||
#define regSizeNum sizeof(regSize_P)/sizeof(reg_t)
|
||||
|
||||
const serial_t serialModes_P[] PROGMEM =
|
||||
{
|
||||
{ "8E1", (uint16_t) SERIAL_8E1},//(uint16_t) US_MR_CHRL_8_BIT | US_MR_NBSTOP_1_BIT | UART_MR_PAR_EVEN },
|
||||
{ "8N1", (uint16_t) SERIAL_8N1},
|
||||
{ "8E2", (uint16_t) SERIAL_8E2},
|
||||
{ "8N2", (uint16_t) SERIAL_8N2},
|
||||
{ "8O1", (uint16_t) SERIAL_8O1},
|
||||
{ "8O2", (uint16_t) SERIAL_8O2},
|
||||
// { "8M1", SERIAL_8M1},
|
||||
// { "8S1", SERIAL_8S1},
|
||||
{ "7E1", (uint16_t) SERIAL_7E1},//(uint16_t) US_MR_CHRL_8_BIT | US_MR_NBSTOP_1_BIT | UART_MR_PAR_EVEN },
|
||||
{ "7N1", (uint16_t) SERIAL_7N1},
|
||||
{ "7E2", (uint16_t) SERIAL_7E2},
|
||||
{ "7N2", (uint16_t) SERIAL_7N2},
|
||||
{ "7O1", (uint16_t) SERIAL_7O1},
|
||||
{ "7O2", (uint16_t) SERIAL_7O2}
|
||||
// { "7M1", SERIAL_7M1},
|
||||
// { "7S1", SERIAL_7S1}
|
||||
} ;
|
||||
|
||||
#define serialModesNum sizeof(serialModes_P)/sizeof(serial_t)
|
||||
|
||||
uint16_t str2SerialParam(char * str)
|
||||
{ debugSerial<<str<<F(" =>");
|
||||
for(uint8_t i=0; i<serialModesNum && str;i++)
|
||||
if (strcmp_P(str, serialModes_P[i].verb) == 0)
|
||||
{
|
||||
|
||||
debugSerial<< i << F(" ") << pgm_read_word_near(&serialModes_P[i].mode)<< endl;
|
||||
return pgm_read_word_near(&serialModes_P[i].mode);
|
||||
}
|
||||
debugSerial<< F("Default serial mode N81 used");
|
||||
return static_cast<uint16_t> (SERIAL_8N1);
|
||||
}
|
||||
int str2regSize(char * str)
|
||||
{
|
||||
for(uint8_t i=0; i<regSizeNum && str;i++)
|
||||
if (strcmp_P(str, regSize_P[i].verb) == 0)
|
||||
return pgm_read_byte_near(®Size_P[i].id);
|
||||
return (int) PAR_I16;
|
||||
}
|
||||
|
||||
bool out_Modbus::getConfig()
|
||||
{
|
||||
// Retrieve and store template values from global modbus settings
|
||||
if (!store || !item || !item->itemArg || (item->itemArg->type != aJson_Array) || aJson.getArraySize(item->itemArg)<2)
|
||||
{
|
||||
errorSerial<<F("MBUS: config failed:")<<(bool)store<<F(",")<<(bool)item<<F(",")<<(bool)item->itemArg<<F(",")<<(item->itemArg->type != aJson_Array)<<F(",")<< (aJson.getArraySize(item->itemArg)<2)<<endl;
|
||||
return false;
|
||||
}
|
||||
aJsonObject * templateIdObj = aJson.getArrayItem(item->itemArg, 1);
|
||||
if (templateIdObj->type != aJson_String || !templateIdObj->valuestring)
|
||||
{
|
||||
errorSerial<<F("Invalid template.")<<endl;
|
||||
return false;
|
||||
}
|
||||
aJsonObject * templateObj = aJson.getObjectItem(modbusObj, templateIdObj->valuestring);
|
||||
if (! templateObj)
|
||||
{
|
||||
errorSerial<<F("Modbus template not found: ")<<templateIdObj->valuestring<<endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
aJsonObject * serialParamObj=aJson.getObjectItem(templateObj, "serial");
|
||||
if (serialParamObj && serialParamObj->type == aJson_String) store->serialParam = str2SerialParam(serialParamObj->valuestring);
|
||||
else store->serialParam = SERIAL_8N1;
|
||||
|
||||
aJsonObject * baudObj=aJson.getObjectItem(templateObj, "baud");
|
||||
if (baudObj && baudObj->type == aJson_Int && baudObj->valueint) store->baud = baudObj->valueint;
|
||||
else store->baud = 9600;
|
||||
aJsonObject * pollObj=aJson.getObjectItem(templateObj, "poll");
|
||||
if (pollObj && pollObj->type == aJson_Object)
|
||||
{
|
||||
store->pollingRegisters=aJson.getObjectItem(pollObj, "regs");
|
||||
store->pollingInterval =aJson.getObjectItem(pollObj, "delay")->valueint;
|
||||
}
|
||||
else {store->pollingRegisters=NULL;store->pollingInterval = 1000;}
|
||||
|
||||
store->parameters=aJson.getObjectItem(templateObj, "par");
|
||||
return true;
|
||||
//store->addr=item->getArg(0);
|
||||
}
|
||||
|
||||
|
||||
int out_Modbus::Setup()
|
||||
{
|
||||
if (!store) store= (mbPersistent *)item->setPersistent(new mbPersistent);
|
||||
if (!store)
|
||||
{ errorSerial<<F("MBUS: Out of memory")<<endl;
|
||||
return 0;}
|
||||
|
||||
store->timestamp=millis();
|
||||
if (getConfig())
|
||||
{
|
||||
//item->clearFlag(ACTION_NEEDED);
|
||||
//item->clearFlag(ACTION_IN_PROCESS);
|
||||
infoSerial<<F("Modbus config loaded ")<< item->itemArr->name<<endl;
|
||||
store->driverStatus = CST_INITIALIZED;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{ errorSerial<<F("Modbus config error")<<endl;
|
||||
store->driverStatus = CST_FAILED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int out_Modbus::Stop()
|
||||
{
|
||||
Serial.println("Modbus De-Init");
|
||||
|
||||
delete store;
|
||||
item->setPersistent(NULL);
|
||||
store = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int out_Modbus::Status()
|
||||
{
|
||||
if (store)
|
||||
return store->driverStatus;
|
||||
return CST_UNKNOWN;
|
||||
}
|
||||
|
||||
int out_Modbus::isActive()
|
||||
{
|
||||
return item->getVal();
|
||||
}
|
||||
|
||||
|
||||
bool readModbus(uint16_t reg, int regType, int count)
|
||||
{
|
||||
uint8_t result;
|
||||
switch (regType) {
|
||||
case MODBUS_HOLDING_REG_TYPE:
|
||||
result = node.readHoldingRegisters(reg, count);
|
||||
break;
|
||||
case MODBUS_COIL_REG_TYPE:
|
||||
result = node.readCoils(reg, count);
|
||||
break;
|
||||
case MODBUS_DISCRETE_REG_TYPE:
|
||||
result = node.readDiscreteInputs(reg, count);
|
||||
break;
|
||||
case MODBUS_INPUT_REG_TYPE:
|
||||
result = node.readInputRegisters(reg, count);
|
||||
break;
|
||||
default:
|
||||
debugSerial<<F("Not supported reg type\n");
|
||||
}
|
||||
if (result != node.ku8MBSuccess) errorSerial<<F("MBUS: Polling error")<<endl;
|
||||
return (result == node.ku8MBSuccess);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int out_Modbus::findRegister(int registerNum, int posInBuffer)
|
||||
{
|
||||
aJsonObject * paramObj = store->parameters->child;
|
||||
bool is8bit = false;
|
||||
while (paramObj)
|
||||
{
|
||||
aJsonObject *regObj = aJson.getObjectItem(paramObj, "reg");
|
||||
if (regObj && regObj->valueint ==registerNum)
|
||||
{
|
||||
aJsonObject *typeObj = aJson.getObjectItem(paramObj, "type");
|
||||
aJsonObject *mapObj = aJson.getObjectItem(paramObj, "map");
|
||||
aJsonObject * itemParametersObj = aJson.getArrayItem(item->itemArg, 2);
|
||||
uint16_t data = node.getResponseBuffer(posInBuffer);
|
||||
int8_t regType = PAR_I16;
|
||||
uint32_t param =0;
|
||||
itemCmd mappedParam;
|
||||
bool isSigned=false;
|
||||
if (typeObj && typeObj->type == aJson_String) regType=str2regSize(typeObj->valuestring);
|
||||
switch(regType) {
|
||||
|
||||
case PAR_I16:
|
||||
isSigned=true;
|
||||
case PAR_U16:
|
||||
param=data;
|
||||
break;
|
||||
case PAR_I32:
|
||||
isSigned=true;
|
||||
case PAR_U32:
|
||||
param = data | (node.getResponseBuffer(posInBuffer+1)<<16);
|
||||
break;
|
||||
case PAR_U8L:
|
||||
is8bit=true;
|
||||
param = data & 0xFF;
|
||||
break;
|
||||
case PAR_U8H:
|
||||
is8bit=true;
|
||||
param = data << 8;
|
||||
}
|
||||
|
||||
if (mapObj && (mapObj->type==aJson_Array || mapObj->type==aJson_Object))
|
||||
mappedParam = mapInt(param,mapObj);
|
||||
else mappedParam.Int(param);
|
||||
|
||||
if (itemParametersObj && itemParametersObj->type ==aJson_Object)
|
||||
{
|
||||
aJsonObject *execObj = aJson.getObjectItem(itemParametersObj,paramObj->name);
|
||||
if (execObj) executeCommand(execObj, -1, mappedParam);
|
||||
}
|
||||
debugSerial << F("MB got ")<<param<< F(" from ")<<regType<<F(":")<<paramObj->name<<endl;
|
||||
|
||||
if (!is8bit) return 1;
|
||||
}
|
||||
paramObj=paramObj->next;
|
||||
}
|
||||
return is8bit;
|
||||
}
|
||||
|
||||
int out_Modbus::Poll(short cause)
|
||||
{
|
||||
if (store->pollingRegisters && !modbusBusy && (Status() == CST_INITIALIZED) && isTimeOver(store->timestamp,millis(),store->pollingInterval))
|
||||
{
|
||||
debugSerial<<F("Poll ")<< item->itemArr->name << endl;
|
||||
modbusBusy=1;
|
||||
//store->serialParam=(USARTClass::USARTModes) SERIAL_8N1;
|
||||
#if defined (__SAM3X8E__)
|
||||
modbusSerial.begin(store->baud, static_cast <USARTClass::USARTModes> (store->serialParam));
|
||||
#elif defined (ARDUINO_ARCH_ESP8266)
|
||||
modbusSerial.begin(store->baud, static_cast <SerialConfig>(store->serialParam));
|
||||
#else
|
||||
modbusSerial.begin(store->baud, (store->serialParam));
|
||||
#endif
|
||||
debugSerial<< store->baud << F("---")<< store->serialParam<<endl;
|
||||
node.begin(item->getArg(0), modbusSerial);
|
||||
|
||||
aJsonObject * reg = store->pollingRegisters->child;
|
||||
while (reg)
|
||||
{
|
||||
switch (reg->type)
|
||||
{
|
||||
case aJson_Int:
|
||||
{
|
||||
int registerNum = reg->valueint;
|
||||
if (readModbus(registerNum,MODBUS_HOLDING_REG_TYPE,1))
|
||||
{
|
||||
findRegister(registerNum,0);
|
||||
// data = node.getResponseBuffer(j);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case aJson_Array:
|
||||
if (aJson.getArraySize(reg)==2)
|
||||
{
|
||||
int registerFrom=aJson.getArrayItem(reg, 0)->valueint;
|
||||
int registerTo=aJson.getArrayItem(reg, 1)->valueint;
|
||||
|
||||
if (readModbus(registerFrom,MODBUS_HOLDING_REG_TYPE,registerTo-registerFrom+1))
|
||||
{
|
||||
for(int i=registerFrom;i<=registerTo;i++)
|
||||
{
|
||||
findRegister(i,i-registerFrom);
|
||||
}
|
||||
//data = node.getResponseBuffer(j);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
reg = reg->next;
|
||||
}
|
||||
|
||||
store->timestamp=millis();
|
||||
debugSerial<<F("endPoll ")<< item->itemArr->name << endl;
|
||||
|
||||
//Non blocking waiting to release line
|
||||
uint32_t time = millis()+50;
|
||||
while (millis()<time)
|
||||
modbusIdle();
|
||||
|
||||
modbusBusy =0;
|
||||
}
|
||||
|
||||
return store->pollingInterval;
|
||||
};
|
||||
|
||||
int out_Modbus::getChanType()
|
||||
{
|
||||
return CH_MODBUS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int out_Modbus::Ctrl(short cmd, short n, int * Parameters, int suffixCode, char* subItem)
|
||||
{
|
||||
int chActive = item->isActive();
|
||||
bool toExecute = (chActive>0);
|
||||
long st;
|
||||
if (cmd>0 && !suffixCode) suffixCode=S_CMD; //if some known command find, but w/o correct suffix - got it
|
||||
|
||||
//item->setFlag(ACTION_NEEDED);
|
||||
|
||||
switch(suffixCode)
|
||||
{
|
||||
case S_NOTFOUND:
|
||||
// turn on and set
|
||||
toExecute = true;
|
||||
debugSerial<<F("Forced execution");
|
||||
case S_SET:
|
||||
if (!Parameters || n==0) return 0;
|
||||
item->setVal(st=Parameters[0]); //Store
|
||||
if (!suffixCode)
|
||||
{
|
||||
if (chActive>0 && !st) item->setCmd(CMD_OFF);
|
||||
if (chActive==0 && st) item->setCmd(CMD_ON);
|
||||
item->SendStatus(SEND_COMMAND | SEND_PARAMETERS | SEND_DEFFERED);
|
||||
// if (item->getExt()) item->setExt(millis()+maxOnTime); //Extend motor time
|
||||
}
|
||||
else item->SendStatus(SEND_PARAMETERS | SEND_DEFFERED);
|
||||
|
||||
return 1;
|
||||
//break;
|
||||
|
||||
case S_CMD:
|
||||
item->setCmd(cmd);
|
||||
switch (cmd)
|
||||
{
|
||||
case CMD_ON:
|
||||
//retrive stored values
|
||||
st = item->getVal();
|
||||
|
||||
|
||||
if (st && (st<MIN_VOLUME) /* && send */) st=INIT_VOLUME;
|
||||
item->setVal(st);
|
||||
|
||||
if (st) //Stored smthng
|
||||
{
|
||||
item->SendStatus(SEND_COMMAND | SEND_PARAMETERS);
|
||||
debugSerial<<F("Restored: ")<<st<<endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
debugSerial<<st<<F(": No stored values - default\n");
|
||||
// Store
|
||||
st=100;
|
||||
item->setVal(st);
|
||||
item->SendStatus(SEND_COMMAND | SEND_PARAMETERS );
|
||||
}
|
||||
// if (item->getExt()) item->setExt(millis()+maxOnTime); //Extend motor time
|
||||
return 1;
|
||||
|
||||
case CMD_OFF:
|
||||
item->SendStatus(SEND_COMMAND);
|
||||
// if (item->getExt()) item->setExt(millis()+maxOnTime); //Extend motor time
|
||||
return 1;
|
||||
|
||||
} //switch cmd
|
||||
|
||||
break;
|
||||
} //switch suffix
|
||||
debugSerial<<F("Unknown cmd")<<endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
42
lighthub/modules/out_modbus.h
Normal file
42
lighthub/modules/out_modbus.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
#include "options.h"
|
||||
#ifndef MBUS_DISABLE
|
||||
#include <abstractout.h>
|
||||
#include <item.h>
|
||||
|
||||
|
||||
class mbPersistent : public chPersistent {
|
||||
|
||||
public:
|
||||
// int addr
|
||||
int8_t driverStatus;
|
||||
int baud;
|
||||
uint16_t serialParam;
|
||||
uint16_t pollingInterval;
|
||||
uint32_t timestamp;
|
||||
aJsonObject * pollingRegisters;
|
||||
aJsonObject * parameters;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
class out_Modbus : public abstractOut {
|
||||
public:
|
||||
|
||||
out_Modbus(Item * _item):abstractOut(_item){store = (mbPersistent *) item->getPersistent();};
|
||||
int Setup() override;
|
||||
int Poll(short cause) override;
|
||||
int Stop() override;
|
||||
int Status() override;
|
||||
int isActive() override;
|
||||
int getChanType() override;
|
||||
int Ctrl(short cmd, short n=0, int * Parameters=NULL, int suffixCode=0, char* subItem=NULL) override;
|
||||
|
||||
|
||||
protected:
|
||||
mbPersistent * store;
|
||||
bool getConfig();
|
||||
int findRegister(int registerNum, int posInBuffer);
|
||||
};
|
||||
#endif
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "Streaming.h"
|
||||
|
||||
#include "item.h"
|
||||
#include "main.h"
|
||||
|
||||
static int driverStatus = CST_UNKNOWN;
|
||||
|
||||
@@ -210,7 +211,7 @@ int out_Motor::getChanType()
|
||||
|
||||
|
||||
|
||||
int out_Motor::Ctrl(short cmd, short n, int * Parameters, boolean send, int suffixCode, char* subItem)
|
||||
int out_Motor::Ctrl(short cmd, short n, int * Parameters, int suffixCode, char* subItem)
|
||||
{
|
||||
int chActive = item->isActive();
|
||||
bool toExecute = (chActive>0);
|
||||
@@ -249,12 +250,12 @@ case S_CMD:
|
||||
st = item->getVal();
|
||||
|
||||
|
||||
if (st && (st<MIN_VOLUME) && send) st=INIT_VOLUME;
|
||||
if (st && (st<MIN_VOLUME) /* && send */) st=INIT_VOLUME;
|
||||
item->setVal(st);
|
||||
|
||||
if (st) //Stored smthng
|
||||
{
|
||||
if (send) item->SendStatus(SEND_COMMAND | SEND_PARAMETERS);
|
||||
item->SendStatus(SEND_COMMAND | SEND_PARAMETERS);
|
||||
debugSerial<<F("Restored: ")<<st<<endl;
|
||||
}
|
||||
else
|
||||
@@ -263,13 +264,13 @@ case S_CMD:
|
||||
// Store
|
||||
st=100;
|
||||
item->setVal(st);
|
||||
if (send) item->SendStatus(SEND_COMMAND | SEND_PARAMETERS );
|
||||
item->SendStatus(SEND_COMMAND | SEND_PARAMETERS );
|
||||
}
|
||||
if (item->getExt()) item->setExt(millis()+maxOnTime); //Extend motor time
|
||||
return 1;
|
||||
|
||||
case CMD_OFF:
|
||||
if (send) item->SendStatus(SEND_COMMAND);
|
||||
item->SendStatus(SEND_COMMAND);
|
||||
if (item->getExt()) item->setExt(millis()+maxOnTime); //Extend motor time
|
||||
return 1;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ public:
|
||||
int Status() override;
|
||||
int isActive() override;
|
||||
int getChanType() override;
|
||||
int Ctrl(short cmd, short n=0, int * Parameters=NULL, boolean send=true, int suffixCode=0, char* subItem=NULL) override;
|
||||
int Ctrl(short cmd, short n=0, int * Parameters=NULL, int suffixCode=0, char* subItem=NULL) override;
|
||||
|
||||
int8_t pinUp;
|
||||
int8_t pinDown;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "Streaming.h"
|
||||
|
||||
#include "item.h"
|
||||
#include "main.h"
|
||||
|
||||
#ifdef ADAFRUIT_LED
|
||||
|
||||
@@ -88,7 +89,7 @@ return driverStatus;
|
||||
|
||||
int out_SPILed::isActive()
|
||||
{
|
||||
CHstore st;
|
||||
itemStore st;
|
||||
st.aslong = item->getVal(); //Restore old params
|
||||
debugSerial<< F(" val:")<<st.v<<endl;
|
||||
return st.v;
|
||||
@@ -107,7 +108,7 @@ int out_SPILed::getChanType()
|
||||
return CH_RGBW;
|
||||
}
|
||||
|
||||
int out_SPILed::PixelCtrl(CHstore *st, short cmd, int from, int to, bool show, bool rgb)
|
||||
int out_SPILed::PixelCtrl(itemStore *st, short cmd, int from, int to, bool show, bool rgb)
|
||||
{
|
||||
//debugSerial<<F("cmd: ")<<cmd<<endl;
|
||||
#ifdef ADAFRUIT_LED
|
||||
@@ -188,11 +189,11 @@ CRGB pixel;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int out_SPILed::Ctrl(short cmd, short n, int * Parameters, boolean send, int suffixCode, char* subItem)
|
||||
int out_SPILed::Ctrl(short cmd, short n, int * Parameters, int suffixCode, char* subItem)
|
||||
{
|
||||
int chActive = item->isActive();
|
||||
bool toExecute = (chActive>0);
|
||||
CHstore st;
|
||||
itemStore st;
|
||||
if (cmd>0 && !suffixCode) suffixCode=S_CMD; //if some known command find, but w/o correct suffix - got it
|
||||
|
||||
int from=0, to=numLeds-1; //All LEDs on the strip by default
|
||||
@@ -287,12 +288,12 @@ case S_CMD:
|
||||
PixelCtrl(&st,CMD_ON,from,to);
|
||||
else //whole strip
|
||||
{
|
||||
if (st.aslong && (st.v<MIN_VOLUME) && send) st.v=INIT_VOLUME;
|
||||
if (st.aslong && (st.v<MIN_VOLUME) /* && send */) st.v=INIT_VOLUME;
|
||||
item->setVal(st.aslong);
|
||||
|
||||
if (st.aslong ) //Stored smthng
|
||||
{
|
||||
if (send) item->SendStatus(SEND_COMMAND | SEND_PARAMETERS);
|
||||
item->SendStatus(SEND_COMMAND | SEND_PARAMETERS);
|
||||
debugSerial<<F("Restored: ")<<st.h<<F(",")<<st.s<<F(",")<<st.v<<endl;
|
||||
}
|
||||
else
|
||||
@@ -304,7 +305,7 @@ case S_CMD:
|
||||
st.hsv_flag=1;
|
||||
// Store
|
||||
item->setVal(st.aslong);
|
||||
if (send) item->SendStatus(SEND_COMMAND | SEND_PARAMETERS );
|
||||
item->SendStatus(SEND_COMMAND | SEND_PARAMETERS );
|
||||
}
|
||||
|
||||
PixelCtrl(&st,0,from,to);
|
||||
@@ -319,7 +320,7 @@ case S_CMD:
|
||||
{
|
||||
st.v=0;
|
||||
PixelCtrl(&st,0,from,to);
|
||||
if (send) item->SendStatus(SEND_COMMAND);
|
||||
item->SendStatus(SEND_COMMAND);
|
||||
// if (send) item->publishTopic(item->itemArr->name,"OFF","/cmd");
|
||||
}
|
||||
return 1;
|
||||
|
||||
@@ -21,8 +21,8 @@ public:
|
||||
int Status() override;
|
||||
int isActive() override;
|
||||
int getChanType() override;
|
||||
int Ctrl(short cmd, short n=0, int * Parameters=NULL, boolean send=true, int suffixCode=0, char* subItem=NULL) override;
|
||||
int PixelCtrl(CHstore *st, short cmd, int from =0 , int to = 1024, bool show = 1, bool rgb = 0);
|
||||
int Ctrl(short cmd, short n=0, int * Parameters=NULL, int suffixCode=0, char* subItem=NULL) override;
|
||||
int PixelCtrl(itemStore *st, short cmd, int from =0 , int to = 1024, bool show = 1, bool rgb = 0);
|
||||
int numLeds;
|
||||
int8_t pin;
|
||||
int ledsType;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// Configuration of drivers enabled
|
||||
#define SYSLOG_LOCAL_SOCKET 514
|
||||
|
||||
#ifndef FASTLED
|
||||
#define ADAFRUIT_LED
|
||||
@@ -19,7 +20,12 @@
|
||||
#define ORDER BRG
|
||||
#endif
|
||||
|
||||
#ifndef MODBUS_TX_PIN
|
||||
#define TXEnablePin 13
|
||||
#else
|
||||
#define TXEnablePin MODBUS_TX_PIN
|
||||
#endif
|
||||
|
||||
#define ESP_EEPROM_SIZE 2048
|
||||
|
||||
#ifndef AVR_DMXOUT_PIN
|
||||
@@ -39,6 +45,8 @@
|
||||
|
||||
#define MAXFLASHSTR 32
|
||||
#define PWDFLASHSTR 16
|
||||
#define EEPROM_SIGNATURE "LHCF"
|
||||
#define EEPROM_SIGNATURE_LENGTH 4
|
||||
|
||||
#define OFFSET_MAC 0
|
||||
#define OFFSET_IP OFFSET_MAC+6
|
||||
@@ -47,8 +55,11 @@
|
||||
#define OFFSET_MASK OFFSET_GW+4
|
||||
#define OFFSET_CONFIGSERVER OFFSET_MASK+4
|
||||
#define OFFSET_MQTT_PWD OFFSET_CONFIGSERVER+MAXFLASHSTR
|
||||
#define EEPROM_offset_NotAlligned OFFSET_MQTT_PWD+PWDFLASHSTR
|
||||
#define EEPROM_offset EEPROM_offset_NotAlligned + (4 -(EEPROM_offset_NotAlligned & 3))
|
||||
#define OFFSET_SIGNATURE OFFSET_MQTT_PWD+PWDFLASHSTR
|
||||
#define EEPROM_offset_NotAlligned OFFSET_SIGNATURE+EEPROM_SIGNATURE_LENGTH
|
||||
#define EEPROM_offsetJSON EEPROM_offset_NotAlligned + (4 -(EEPROM_offset_NotAlligned & 3))
|
||||
#define EEPROM_FIX_PART_LEN EEPROM_offsetJSON-OFFSET_MAC
|
||||
|
||||
|
||||
#ifndef INTERVAL_CHECK_INPUT
|
||||
#define INTERVAL_CHECK_INPUT 15
|
||||
@@ -122,7 +133,7 @@
|
||||
#define _owire
|
||||
#endif
|
||||
|
||||
#ifndef MODBUS_DISABLE
|
||||
#if !(defined (MODBUS_DISABLE) && defined (MBUS_DISABLE))
|
||||
#define _modbus
|
||||
#endif
|
||||
|
||||
@@ -165,7 +176,7 @@
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP8266)
|
||||
#undef _dmxin
|
||||
#undef _modbus
|
||||
//#undef _modbus
|
||||
|
||||
#ifndef DMX_DISABLE
|
||||
#define _espdmx
|
||||
@@ -177,13 +188,15 @@
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP32)
|
||||
#undef _dmxin
|
||||
#undef _modbus
|
||||
//#undef _modbus
|
||||
|
||||
#ifndef DMX_DISABLE
|
||||
#define _espdmx
|
||||
#endif
|
||||
//#undef _dmxout
|
||||
#undef modbusSerial
|
||||
//#undef modbusSerial
|
||||
#define modbusSerial Serial2
|
||||
#define AC_Serial Serial2
|
||||
#endif
|
||||
|
||||
#ifndef _dmxout
|
||||
@@ -215,10 +228,11 @@
|
||||
//#define debugSerial M5.Lcd
|
||||
//#endif
|
||||
|
||||
#ifndef debugSerial
|
||||
#define debugSerial Serial
|
||||
#ifndef debugSerialPort
|
||||
#define debugSerialPort Serial
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef Wiz5500
|
||||
#define W5100_ETHERNET_SHIELD
|
||||
#else
|
||||
|
||||
@@ -24,6 +24,7 @@ e-mail anklimov@gmail.com
|
||||
#include <Arduino.h>
|
||||
#include "utils.h"
|
||||
#include "options.h"
|
||||
#include "main.h"
|
||||
|
||||
|
||||
OneWire *oneWire = NULL;
|
||||
|
||||
86
lighthub/streamlog.cpp
Normal file
86
lighthub/streamlog.cpp
Normal file
@@ -0,0 +1,86 @@
|
||||
#include "streamlog.h"
|
||||
#include <Arduino.h>
|
||||
#include "utils.h"
|
||||
|
||||
#if defined (STATUSLED)
|
||||
extern statusLED LED;
|
||||
#endif
|
||||
|
||||
#ifdef SYSLOG_ENABLE
|
||||
extern bool syslogInitialized;
|
||||
Streamlog::Streamlog (HardwareSerial * _serialPort, int _severity , Syslog * _syslog, uint8_t _ledPattern )
|
||||
{
|
||||
serialPort=_serialPort;
|
||||
severity=_severity;
|
||||
syslog=_syslog;
|
||||
ledPattern=_ledPattern;
|
||||
}
|
||||
#else
|
||||
Streamlog::Streamlog (HardwareSerial * _serialPort, int _severity, uint8_t _ledPattern)
|
||||
{
|
||||
serialPort=_serialPort;
|
||||
severity=_severity;
|
||||
}
|
||||
#endif
|
||||
|
||||
void Streamlog::begin(unsigned long speed)
|
||||
{
|
||||
if (serialPort) serialPort->begin(speed);
|
||||
};
|
||||
|
||||
void Streamlog::end()
|
||||
{
|
||||
if (serialPort) serialPort->end();
|
||||
};
|
||||
|
||||
int Streamlog::available(void)
|
||||
{
|
||||
if (serialPort) return serialPort->available();
|
||||
return 0;
|
||||
};
|
||||
|
||||
int Streamlog::peek(void)
|
||||
{
|
||||
if (serialPort) return serialPort->peek();
|
||||
return 0;
|
||||
};
|
||||
|
||||
int Streamlog::read(void)
|
||||
{
|
||||
if (serialPort) return serialPort->read();
|
||||
return 0;
|
||||
};
|
||||
|
||||
|
||||
void Streamlog::flush(void)
|
||||
{
|
||||
if (serialPort) serialPort->flush();
|
||||
|
||||
};
|
||||
|
||||
size_t Streamlog::write(uint8_t ch)
|
||||
{
|
||||
#ifdef SYSLOG_ENABLE
|
||||
if (syslogInitialized)
|
||||
{
|
||||
if (ch=='\n')
|
||||
{
|
||||
logBuffer[logBufferPos]=0;
|
||||
if (syslog) syslog->log(severity,(char *)logBuffer);
|
||||
logBufferPos=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (logBufferPos<LOGBUFFER_SIZE-1 && (ch!='\r')) logBuffer[logBufferPos++]=ch;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined (STATUSLED)
|
||||
if ((ch=='\n') && ledPattern) LED.flash(ledPattern);
|
||||
#endif
|
||||
|
||||
if (serialPort) return serialPort->write(ch);
|
||||
|
||||
return 1;
|
||||
};
|
||||
48
lighthub/streamlog.h
Normal file
48
lighthub/streamlog.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#include <Print.h>
|
||||
#include <HardwareSerial.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#ifndef LOGBUFFER_SIZE
|
||||
#define LOGBUFFER_SIZE 80
|
||||
#endif
|
||||
|
||||
#ifdef SYSLOG_ENABLE
|
||||
#include <Syslog.h>
|
||||
static char logBuffer[LOGBUFFER_SIZE];
|
||||
static int logBufferPos=0;
|
||||
#endif
|
||||
|
||||
#define LOG_DEBUG 7
|
||||
#define LOG_INFO 6
|
||||
#define LOG_ERROR 3
|
||||
|
||||
static uint8_t serialDebugLevel = 7;
|
||||
static uint8_t udpDebugLevel =7;
|
||||
|
||||
class Streamlog : public Print
|
||||
{
|
||||
public:
|
||||
#ifdef SYSLOG_ENABLE
|
||||
Streamlog (HardwareSerial * _serialPort, int _severity = LOG_DEBUG, Syslog * _syslog = NULL, uint8_t _ledPattern = 0);
|
||||
#else
|
||||
Streamlog (HardwareSerial * _serialPort, int _severity = LOG_DEBUG, uint8_t _ledPattern = 0);
|
||||
#endif
|
||||
// {serialPort=_serialPort;severity=_severity; syslog=_syslog; }
|
||||
void begin(unsigned long speed);
|
||||
void end() ;
|
||||
|
||||
int available(void);
|
||||
int peek(void);
|
||||
int read(void);
|
||||
void flush(void);
|
||||
size_t write(uint8_t ch);
|
||||
using Print::write; // pull in write(str) and write(buf, size) from Print
|
||||
operator bool() {return true;};
|
||||
private:
|
||||
uint16_t severity;
|
||||
HardwareSerial *serialPort;
|
||||
#ifdef SYSLOG_ENABLE
|
||||
Syslog * syslog;
|
||||
uint8_t ledPattern;
|
||||
#endif
|
||||
};
|
||||
@@ -5,12 +5,15 @@ const char disconnected_P[] PROGMEM = "disconnected";
|
||||
const char ready_P[] PROGMEM = "ready";
|
||||
|
||||
const char homie_P[] PROGMEM = "$homie";
|
||||
const char homiever_P[] PROGMEM = "2.1.0";
|
||||
const char homiever_P[] PROGMEM = "3.0.1";
|
||||
|
||||
const char name_P[] PROGMEM = "$name";
|
||||
const char nameval_P[] PROGMEM = "LightHub ";
|
||||
|
||||
const char nodes_P[] PROGMEM = "$nodes";
|
||||
const char properties_P[] PROGMEM = "$properties";
|
||||
const char propertiesVal_P[] PROGMEM = "set,cmd";
|
||||
const char settable_P[] PROGMEM = "settable";
|
||||
const char localip_P[] PROGMEM = "$localip";
|
||||
const char mac_P[] PROGMEM = "$mac";
|
||||
const char fwname_P[] PROGMEM = "$fw/name";
|
||||
@@ -37,8 +40,40 @@ const char statsval_P[] PROGMEM = "uptime,freeheap";
|
||||
const char uptime_P[] PROGMEM = "uptime";
|
||||
const char freeheap_P[] PROGMEM = "freeheap";
|
||||
|
||||
/*
|
||||
|
||||
{"name": "Спальня LED",
|
||||
"command_topic": "myhome/in/bedr/cmd",
|
||||
"state_topic": "myhome/s_out/bedr/cmd",
|
||||
"hs_command_topic": "myhome/in/bedr/set",
|
||||
"hs_state_topic": "myhome/s_out/bedr/set",
|
||||
"hs_value_template": "{%set a=value.split(',')%} {% if a[1] -%} {{a[0]+','+a[1]}} {%- endif %}",
|
||||
"brightness_scale": 100,
|
||||
"brightness_command_topic": "myhome/in/bedr/set",
|
||||
"brightness_state_topic": "myhome/s_out/bedr/set",
|
||||
"brightness_value_template": "{{ value.split(',')[2] }}"
|
||||
}
|
||||
|
||||
{
|
||||
"~":"myhome"
|
||||
"name": "Спальня LED",
|
||||
"cmd_t": "~/in/bedr/cmd",
|
||||
"tat_t": "~/s_out/bedr/cmd",
|
||||
"hs_cmd_t": "~/in/bedr/set",
|
||||
"hs_stat_t": "~/s_out/bedr/set",
|
||||
"hs_val_tpl": "{%set a=value.split(',')%}{% if a[1] -%}{{a[0]+','+a[1]}}{%- endif %}",
|
||||
"bri_scl": 100,
|
||||
"bri_cmd_t": "~/in/bedr/set",
|
||||
"bri_stat_t": "~/s_out/bedr/set",
|
||||
"bri_val_tpl": "{{ value.split(',')[2] }}"
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//Commands
|
||||
|
||||
const char ON_P[] PROGMEM = "ON";
|
||||
const char OFF_P[] PROGMEM = "OFF";
|
||||
const char REST_P[] PROGMEM = "REST";
|
||||
@@ -46,6 +81,7 @@ const char TOGGLE_P[] PROGMEM = "TOGGLE";
|
||||
const char HALT_P[] PROGMEM = "HALT";
|
||||
const char XON_P[] PROGMEM = "XON";
|
||||
const char XOFF_P[] PROGMEM = "XOFF";
|
||||
/*
|
||||
const char INCREASE_P[] PROGMEM = "INCREASE";
|
||||
const char DECREASE_P[] PROGMEM = "DECREASE";
|
||||
const char TRUE_P[] PROGMEM = "TRUE";
|
||||
@@ -53,15 +89,20 @@ const char FALSE_P[] PROGMEM = "FALSE";
|
||||
|
||||
const char ENABLED_P[] PROGMEM = "ENABLED";
|
||||
const char DISABLED_P[] PROGMEM = "DISABLED";
|
||||
|
||||
*/
|
||||
const char HEAT_P[] PROGMEM = "HEAT";
|
||||
const char COOL_P[] PROGMEM = "COOL";
|
||||
const static char AUTO_P[] PROGMEM = "AUTO";
|
||||
|
||||
|
||||
const char FAN_ONLY_P[] PROGMEM = "FAN_ONLY";
|
||||
const char DRY_P[] PROGMEM = "DRY";
|
||||
const char HIGH_P[] PROGMEM = "HIGH";
|
||||
const char MED_P[] PROGMEM = "MEDIUM";
|
||||
const char LOW_P[] PROGMEM = "LOW";
|
||||
|
||||
|
||||
|
||||
// SubTopics
|
||||
const char SET_P[] PROGMEM = "set";
|
||||
const char CMD_P[] PROGMEM = "cmd";
|
||||
@@ -69,13 +110,7 @@ const char MODE_P[] PROGMEM = "mode";
|
||||
const char FAN_P[] PROGMEM = "fan";
|
||||
const char HUE_P[] PROGMEM = "hue";
|
||||
const char SAT_P[] PROGMEM = "sat";
|
||||
/*
|
||||
const char TEMP_P[] PROGMEM = "temp";
|
||||
const char SETPOINT_P[] PROGMEM = "setpoint";
|
||||
const char POWER_P[] PROGMEM = "power";
|
||||
const char VOL_P[] PROGMEM = "vol";
|
||||
const char HEAT_P[] PROGMEM = "heat";
|
||||
*/
|
||||
|
||||
const char HSV_P[] PROGMEM = "HSV";
|
||||
const char RGB_P[] PROGMEM = "RGB";
|
||||
|
||||
@@ -83,3 +118,4 @@ const char RGB_P[] PROGMEM = "RGB";
|
||||
const char RPM_P[] PROGMEM = "rpm";
|
||||
const char STATE_P[] PROGMEM = "state";
|
||||
*/
|
||||
const char EEPROM_signature[] = EEPROM_SIGNATURE;
|
||||
|
||||
@@ -22,6 +22,15 @@ e-mail anklimov@gmail.com
|
||||
#include "options.h"
|
||||
#include "stdarg.h"
|
||||
#include <Wire.h>
|
||||
#include "main.h"
|
||||
|
||||
#include "item.h"
|
||||
#include <PubSubClient.h>
|
||||
extern int8_t configLocked;
|
||||
extern int8_t ethernetIdleCount;
|
||||
extern PubSubClient mqttClient;
|
||||
|
||||
|
||||
|
||||
#if defined(__SAM3X8E__) || defined(ARDUINO_ARCH_STM32)
|
||||
#include <malloc.h>
|
||||
@@ -512,5 +521,182 @@ bool isTimeOver(uint32_t timestamp, uint32_t currTime, uint32_t time, uint32_t m
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool executeCommand(aJsonObject* cmd, int8_t toggle)
|
||||
{
|
||||
itemCmd _itemCmd;
|
||||
_itemCmd.type = ST_VOID;
|
||||
return executeCommand(cmd,toggle,_itemCmd);
|
||||
}
|
||||
|
||||
bool executeCommand(aJsonObject* cmd, int8_t toggle, itemCmd _itemCmd)
|
||||
//bool executeCommand(aJsonObject* cmd, int8_t toggle, char* defCmd)
|
||||
{
|
||||
switch (cmd->type)
|
||||
{
|
||||
case aJson_String: //legacy - no action
|
||||
break;
|
||||
case aJson_Array: //array - recursive iterate
|
||||
{
|
||||
configLocked++;
|
||||
aJsonObject * command = cmd->child;
|
||||
while (command)
|
||||
{
|
||||
executeCommand(command,toggle,_itemCmd);
|
||||
command = command->next;
|
||||
}
|
||||
configLocked--;
|
||||
}
|
||||
break;
|
||||
case aJson_Object:
|
||||
{
|
||||
aJsonObject *item = aJson.getObjectItem(cmd, "item");
|
||||
aJsonObject *emit = aJson.getObjectItem(cmd, "emit");
|
||||
aJsonObject *icmd = NULL;
|
||||
aJsonObject *ecmd = NULL;
|
||||
|
||||
switch (toggle)
|
||||
{
|
||||
case 0:
|
||||
icmd = aJson.getObjectItem(cmd, "icmd");
|
||||
ecmd = aJson.getObjectItem(cmd, "ecmd");
|
||||
break;
|
||||
case 1:
|
||||
icmd = aJson.getObjectItem(cmd, "irev");
|
||||
ecmd = aJson.getObjectItem(cmd, "erev");
|
||||
//no *rev parameters - fallback
|
||||
if (!icmd) icmd = aJson.getObjectItem(cmd, "icmd");
|
||||
if (!ecmd) ecmd = aJson.getObjectItem(cmd, "ecmd");
|
||||
}
|
||||
|
||||
char * itemCommand;
|
||||
char Buffer[16];
|
||||
if(icmd && icmd->type == aJson_String) itemCommand = icmd->valuestring;
|
||||
else itemCommand = _itemCmd.toString(Buffer,sizeof(Buffer));
|
||||
|
||||
char * emitCommand;
|
||||
if(ecmd && ecmd->type == aJson_String) emitCommand = ecmd->valuestring;
|
||||
else emitCommand = _itemCmd.toString(Buffer,sizeof(Buffer));
|
||||
|
||||
//debugSerial << F("IN:") << (pin) << F(" : ") <<endl;
|
||||
if (item) debugSerial << item->valuestring<< F(" -> ")<<itemCommand<<endl;
|
||||
if (emit) debugSerial << emit->valuestring<< F(" -> ")<<emitCommand<<endl;
|
||||
|
||||
|
||||
|
||||
|
||||
if (emit && emitCommand && emit->type == aJson_String) {
|
||||
/*
|
||||
TODO implement
|
||||
#ifdef WITH_DOMOTICZ
|
||||
if (getIdxField())
|
||||
{ (newValue) ? publishDataToDomoticz(0, emit, "{\"command\":\"switchlight\",\"idx\":%s,\"switchcmd\":\"On\"}",
|
||||
: publishDataToDomoticz(0,emit,"{\"command\":\"switchlight\",\"idx\":%s,\"switchcmd\":\"Off\"}",getIdxField()); getIdxField())
|
||||
: publishDataToDomoticz(0, emit,
|
||||
"{\"command\":\"switchlight\",\"idx\":%s,\"switchcmd\":\"Off\"}",
|
||||
getIdxField());
|
||||
} else
|
||||
#endif
|
||||
*/
|
||||
|
||||
{
|
||||
char addrstr[MQTT_TOPIC_LENGTH];
|
||||
strncpy(addrstr,emit->valuestring,sizeof(addrstr));
|
||||
if (mqttClient.connected() && !ethernetIdleCount)
|
||||
{
|
||||
if (!strchr(addrstr,'/')) setTopic(addrstr,sizeof(addrstr),T_OUT,emit->valuestring);
|
||||
mqttClient.publish(addrstr, emitCommand , true);
|
||||
}
|
||||
}
|
||||
} // emit
|
||||
if (item && itemCommand && item->type == aJson_String) {
|
||||
//debugSerial <<F("Controlled item:")<< item->valuestring <<endl;
|
||||
Item it(item->valuestring);
|
||||
if (it.isValid()) it.Ctrl(itemCommand);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
} //switch type
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
itemCmd mapInt(int32_t arg, aJsonObject* map)
|
||||
{
|
||||
itemCmd _itemCmd;
|
||||
return _itemCmd.Int(arg);
|
||||
}
|
||||
|
||||
statusLED::statusLED(uint8_t pattern)
|
||||
{
|
||||
#if defined (STATUSLED)
|
||||
pinMode(pinRED, OUTPUT);
|
||||
pinMode(pinGREEN, OUTPUT);
|
||||
pinMode(pinBLUE, OUTPUT);
|
||||
set(pattern);
|
||||
timestamp=millis()+ledDelayms;
|
||||
#endif
|
||||
}
|
||||
|
||||
void statusLED::show (uint8_t pattern)
|
||||
{
|
||||
#if defined (STATUSLED)
|
||||
digitalWrite(pinRED,(pattern & ledRED)?HIGH:LOW );
|
||||
digitalWrite(pinGREEN,(pattern & ledGREEN)?HIGH:LOW);
|
||||
digitalWrite(pinBLUE,(pattern & ledBLUE)?HIGH:LOW);
|
||||
#endif
|
||||
}
|
||||
|
||||
void statusLED::set (uint8_t pattern)
|
||||
{
|
||||
#if defined (STATUSLED)
|
||||
short newStat = pattern & ledParams;
|
||||
|
||||
if (newStat!=(curStat & ledParams))
|
||||
{
|
||||
//if (!(curStat & ledHidden))
|
||||
show(pattern);
|
||||
curStat=newStat | (curStat & ~ledParams);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void statusLED::flash(uint8_t pattern)
|
||||
{
|
||||
#if defined (STATUSLED)
|
||||
show(pattern);
|
||||
curStat|=ledFlash;
|
||||
#endif
|
||||
}
|
||||
|
||||
void statusLED::poll()
|
||||
{
|
||||
#if defined (STATUSLED)
|
||||
if (curStat & ledFlash)
|
||||
{
|
||||
curStat&=~ledFlash;
|
||||
show(curStat);
|
||||
}
|
||||
if (millis()>timestamp)
|
||||
{
|
||||
|
||||
if (curStat & ledFASTBLINK) timestamp=millis()+ledFastDelayms;
|
||||
else timestamp=millis()+ledDelayms;
|
||||
|
||||
if (( curStat & ledBLINK) || (curStat & ledFASTBLINK))
|
||||
{
|
||||
curStat^=ledHidden;
|
||||
if (curStat & ledHidden)
|
||||
show(0);
|
||||
else show(curStat);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#pragma message(VAR_NAME_VALUE(debugSerial))
|
||||
#pragma message(VAR_NAME_VALUE(SERIAL_BAUD))
|
||||
|
||||
@@ -29,6 +29,7 @@ e-mail anklimov@gmail.com
|
||||
#include <IPAddress.h>
|
||||
#include "aJSON.h"
|
||||
#include "options.h"
|
||||
#include "item.h"
|
||||
#ifdef WITH_PRINTEX_LIB
|
||||
#include "PrintEx.h"
|
||||
using namespace ios;
|
||||
@@ -60,3 +61,36 @@ void printUlongValueToStr(char *valstr, unsigned long value);
|
||||
void scan_i2c_bus();
|
||||
void softRebootFunc();
|
||||
bool isTimeOver(uint32_t timestamp, uint32_t currTime, uint32_t time, uint32_t modulo = 0xFFFFFFFF);
|
||||
//bool executeCommand(aJsonObject* cmd, int8_t toggle = -1, char* defCmd = NULL);
|
||||
bool executeCommand(aJsonObject* cmd, int8_t toggle = -1);
|
||||
bool executeCommand(aJsonObject* cmd, int8_t toggle, itemCmd _itemCmd);
|
||||
itemCmd mapInt(int32_t arg, aJsonObject* map);
|
||||
|
||||
#define ledRED 1
|
||||
#define ledGREEN 2
|
||||
#define ledBLUE 4
|
||||
#define ledBLINK 8
|
||||
#define ledFASTBLINK 16
|
||||
#define ledParams (ledRED | ledGREEN | ledBLUE | ledBLINK | ledFASTBLINK)
|
||||
|
||||
#define ledFlash 32
|
||||
#define ledHidden 64
|
||||
|
||||
#define pinRED 50
|
||||
#define pinGREEN 51
|
||||
#define pinBLUE 52
|
||||
|
||||
#define ledDelayms 1000UL
|
||||
#define ledFastDelayms 300UL
|
||||
|
||||
class statusLED {
|
||||
public:
|
||||
statusLED(uint8_t pattern = 0);
|
||||
void set (uint8_t pattern);
|
||||
void show (uint8_t pattern);
|
||||
void poll();
|
||||
void flash(uint8_t pattern);
|
||||
private:
|
||||
uint8_t curStat;
|
||||
uint32_t timestamp;
|
||||
};
|
||||
|
||||
114
platformio.ini
114
platformio.ini
@@ -28,6 +28,8 @@ default_envs =
|
||||
; Arduino DUE + Ethernet shield Wiznet 5100
|
||||
; due-5100
|
||||
|
||||
; Generic DUE
|
||||
; due
|
||||
; Arduino DUE + Ethernet shield Wiznet 5500
|
||||
; due-5500
|
||||
|
||||
@@ -72,6 +74,7 @@ lib_ignore =
|
||||
Ethernet
|
||||
Ethernet5100
|
||||
Ethernet3
|
||||
Ethernet5100
|
||||
httpClient
|
||||
FastLED
|
||||
ESPDMX
|
||||
@@ -107,7 +110,9 @@ lib_deps =
|
||||
https://github.com/anklimov/NRFFlashStorage
|
||||
https://github.com/adafruit/Adafruit_NeoPixel.git
|
||||
https://github.com/anklimov/ArduinoOTA
|
||||
; https://github.com/livello/PrintEx#is-select-redecl
|
||||
https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library
|
||||
https://github.com/arcao/Syslog.git
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -129,6 +134,7 @@ lib_ignore =
|
||||
Ethernet5100
|
||||
Ethernet2
|
||||
Ethernet3
|
||||
Ethernet5100
|
||||
EEPROM
|
||||
Artnet
|
||||
UIPEthernet
|
||||
@@ -160,16 +166,21 @@ lib_deps =
|
||||
M5Stack
|
||||
Adafruit NeoPixel
|
||||
https://github.com/anklimov/ArduinoOTA
|
||||
https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library
|
||||
https://github.com/arcao/Syslog.git
|
||||
|
||||
[env:esp32-wifi]
|
||||
platform = espressif32
|
||||
framework = arduino
|
||||
monitor_filters = esp32_exception_decoder
|
||||
build_type = debug
|
||||
;board = pico32
|
||||
board = esp32-evb
|
||||
upload_speed = 115200
|
||||
build_flags = !python get_build_flags.py esp32-wifi
|
||||
lib_ignore =
|
||||
;DS2482_OneWire //UNCOMMENT for software 1-wire driver
|
||||
;COMMENT/UNCOMMENT next line for software 1-wire driver on/off
|
||||
;DS2482_OneWire
|
||||
DmxSimple
|
||||
DMXSerial
|
||||
DmxDue
|
||||
@@ -180,8 +191,8 @@ lib_ignore =
|
||||
Ethernet5100
|
||||
Ethernet2
|
||||
Ethernet3
|
||||
Ethernet5100
|
||||
EEPROM
|
||||
Artnet
|
||||
UIPEthernet
|
||||
ESP_EEPROM
|
||||
httpClient
|
||||
@@ -211,6 +222,9 @@ lib_deps =
|
||||
SparkFun CCS811 Arduino Library@~1.0.7
|
||||
Adafruit NeoPixel
|
||||
https://github.com/anklimov/ArduinoOTA
|
||||
https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library
|
||||
https://github.com/arcao/Syslog.git
|
||||
|
||||
|
||||
[env:due-5100]
|
||||
platform = atmelsam
|
||||
@@ -228,8 +242,6 @@ lib_ignore =
|
||||
ESP-Dmx
|
||||
WifiManager
|
||||
Ethernet3
|
||||
Ethernet
|
||||
Ethernet2
|
||||
NRFFlashStorage
|
||||
WebServer
|
||||
UIPEthernet
|
||||
@@ -259,11 +271,69 @@ lib_deps =
|
||||
SparkFun CCS811 Arduino Library@~1.0.7
|
||||
Adafruit NeoPixel
|
||||
https://github.com/anklimov/ArduinoOTA
|
||||
https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library
|
||||
|
||||
|
||||
[env:due]
|
||||
;Experimental target with universal Ethernet Library
|
||||
platform = atmelsam
|
||||
framework = arduino
|
||||
board = due
|
||||
build_flags = !python get_build_flags.py due
|
||||
; Need to place arduinoOTA utility from Arduino IDE distribution to folder in your PATH
|
||||
;fix address and password
|
||||
;upload_flags =
|
||||
;upload_command = arduinoOTA -address 192.168.88.21 -port 65280 -username arduino -password password -b -upload /sketch -sketch $SOURCE
|
||||
;upload_protocol = custom
|
||||
lib_ignore =
|
||||
;DS2482_OneWire //UNCOMMENT for software 1-wire driver
|
||||
DHT sensor library for ESPx
|
||||
ESP_EEPROM
|
||||
DMXSerial
|
||||
DmxSimple
|
||||
httpClient
|
||||
ESPDMX
|
||||
ESP-Dmx
|
||||
WifiManager
|
||||
Ethernet3
|
||||
Ethernet2
|
||||
Ethernet5100
|
||||
NRFFlashStorage
|
||||
WebServer
|
||||
UIPEthernet
|
||||
EEPROM
|
||||
M5Stack
|
||||
;ArduinoOTA
|
||||
lib_deps =
|
||||
https://github.com/sebnil/DueFlashStorage
|
||||
https://github.com/anklimov/Arduino-Temperature-Control-Library.git
|
||||
https://github.com/anklimov/DS2482_OneWire
|
||||
https://github.com/anklimov/DmxDue
|
||||
ArduinoHttpClient
|
||||
https://github.com/anklimov/aJson
|
||||
https://github.com/anklimov/CmdArduino
|
||||
https://github.com/anklimov/ModbusMaster
|
||||
https://github.com/anklimov/Ethernet.git
|
||||
https://github.com/knolleary/pubsubclient.git
|
||||
https://github.com/anklimov/Artnet.git
|
||||
FastLED@3.3.2
|
||||
SD
|
||||
SdFat
|
||||
Adafruit Unified Sensor
|
||||
DHT sensor library
|
||||
https://github.com/arcao/Syslog.git
|
||||
Streaming
|
||||
ClosedCube HDC1080
|
||||
SparkFun CCS811 Arduino Library@~1.0.7
|
||||
Adafruit NeoPixel
|
||||
https://github.com/anklimov/ArduinoOTA
|
||||
https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library
|
||||
|
||||
[env:mega2560slim-5100]
|
||||
platform = atmelavr
|
||||
board = megaatmega2560
|
||||
;upload_port = net:192.168.88.31:23
|
||||
upload_port = net:192.168.88.2:23000
|
||||
framework = arduino
|
||||
build_flags = !python get_build_flags.py mega2560slim-5100
|
||||
lib_ignore =
|
||||
@@ -273,6 +343,7 @@ lib_ignore =
|
||||
DueFlashStorage
|
||||
WifiManager
|
||||
Ethernet3
|
||||
Ethernet2
|
||||
HTTPClient
|
||||
NRFFlashStorage
|
||||
WebServer
|
||||
@@ -288,7 +359,8 @@ lib_deps =
|
||||
https://github.com/anklimov/CmdArduino
|
||||
https://github.com/anklimov/ModbusMaster
|
||||
https://github.com/anklimov/DMXSerial
|
||||
https://github.com/anklimov/Ethernet5100
|
||||
https://github.com/anklimov/Ethernet
|
||||
;5100 lib have ~90 bytes less footprint of RAM
|
||||
https://github.com/knolleary/pubsubclient.git
|
||||
https://github.com/anklimov/Artnet.git
|
||||
FastLED@3.3.2
|
||||
@@ -301,6 +373,7 @@ lib_deps =
|
||||
SparkFun CCS811 Arduino Library@~1.0.7
|
||||
Adafruit NeoPixel
|
||||
https://github.com/anklimov/ArduinoOTA
|
||||
https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library
|
||||
|
||||
[env:mega2560-5500]
|
||||
platform = atmelavr
|
||||
@@ -316,6 +389,7 @@ lib_ignore =
|
||||
Ethernet
|
||||
Ethernet5100
|
||||
Ethernet3
|
||||
Ethernet5100
|
||||
HTTPClient
|
||||
NRFFlashStorage
|
||||
WebServer
|
||||
@@ -343,6 +417,7 @@ lib_deps =
|
||||
SparkFun CCS811 Arduino Library@~1.0.7
|
||||
Adafruit NeoPixel
|
||||
https://github.com/anklimov/ArduinoOTA
|
||||
https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library
|
||||
|
||||
|
||||
[env:esp8266-wifi]
|
||||
@@ -359,7 +434,8 @@ upload_protocol = esptool
|
||||
; --port=65280
|
||||
build_flags = !python get_build_flags.py esp8266-wifi
|
||||
lib_ignore =
|
||||
;DS2482_OneWire //UNCOMMENT for software 1-wire driver
|
||||
;COMMENT/UNCOMMENT next line for software 1-wire driver on/off
|
||||
DS2482_OneWire
|
||||
DmxSimple
|
||||
DMXSerial
|
||||
DmxDue
|
||||
@@ -373,6 +449,7 @@ lib_ignore =
|
||||
ArduinoHttpClient
|
||||
Ethernet3
|
||||
Ethernet2
|
||||
Ethernet5100
|
||||
Ethernet
|
||||
Ethernet5100
|
||||
NRFFlashStorage
|
||||
@@ -381,7 +458,8 @@ lib_ignore =
|
||||
M5Stack
|
||||
lib_deps =
|
||||
https://github.com/anklimov/Arduino-Temperature-Control-Library.git
|
||||
https://github.com/anklimov/DS2482_OneWire
|
||||
;COMMENT/UNCOMMENT next line for software 1-wire driver on/off
|
||||
;https://github.com/anklimov/DS2482_OneWire
|
||||
https://github.com/anklimov/ESP-Dmx
|
||||
ESP8266HTTPClient
|
||||
https://github.com/anklimov/aJson
|
||||
@@ -401,6 +479,7 @@ lib_deps =
|
||||
SparkFun CCS811 Arduino Library@~1.0.7
|
||||
Adafruit NeoPixel
|
||||
https://github.com/anklimov/ArduinoOTA.git
|
||||
https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library
|
||||
|
||||
|
||||
|
||||
@@ -447,6 +526,7 @@ lib_deps =
|
||||
SparkFun CCS811 Arduino Library@~1.0.7
|
||||
Adafruit NeoPixel
|
||||
https://github.com/anklimov/ArduinoOTA
|
||||
https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library
|
||||
|
||||
[env:due-5500]
|
||||
platform = atmelsam
|
||||
@@ -465,6 +545,7 @@ lib_ignore =
|
||||
httpClient
|
||||
Ethernet
|
||||
Ethernet3
|
||||
Ethernet5100
|
||||
NRFFlashStorage
|
||||
WebServer
|
||||
UIPEthernet
|
||||
@@ -496,12 +577,16 @@ lib_deps =
|
||||
SparkFun CCS811 Arduino Library@~1.0.7
|
||||
Adafruit NeoPixel
|
||||
https://github.com/anklimov/ArduinoOTA
|
||||
https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library
|
||||
|
||||
[env:lighthub21]
|
||||
platform = atmelsam
|
||||
framework = arduino
|
||||
board = due
|
||||
build_flags = !python get_build_flags.py lighthub21
|
||||
;upload_command = arduinoOTA -address 192.168.11.172 -port 65280 -username arduino -password password -b -upload /sketch -sketch $SOURCE
|
||||
;upload_command = arduinoOTA -address 192.168.88.34 -port 65280 -username arduino -password password -b -upload /sketch -sketch $SOURCE
|
||||
;upload_protocol = custom
|
||||
lib_ignore =
|
||||
;DS2482_OneWire //UNCOMMENT for software 1-wire driver
|
||||
DHT sensor library for ESPx
|
||||
@@ -511,9 +596,10 @@ lib_ignore =
|
||||
WifiManager
|
||||
DmxSimple
|
||||
httpClient
|
||||
Ethernet
|
||||
Ethernet5100
|
||||
Ethernet2
|
||||
;Ethernet
|
||||
Ethernet3
|
||||
Ethernet5100
|
||||
NRFFlashStorage
|
||||
WebServer
|
||||
UIPEthernet
|
||||
@@ -530,7 +616,8 @@ lib_deps =
|
||||
https://github.com/anklimov/aJson
|
||||
https://github.com/anklimov/CmdArduino
|
||||
https://github.com/anklimov/ModbusMaster
|
||||
https://github.com/anklimov/Ethernet2
|
||||
;https://github.com/anklimov/Ethernet2
|
||||
https://github.com/anklimov/Ethernet
|
||||
https://github.com/knolleary/pubsubclient.git
|
||||
https://github.com/anklimov/Artnet.git
|
||||
FastLED@3.3.2
|
||||
@@ -545,6 +632,7 @@ lib_deps =
|
||||
SparkFun CCS811 Arduino Library@~1.0.7
|
||||
Adafruit NeoPixel
|
||||
https://github.com/anklimov/ArduinoOTA
|
||||
https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library
|
||||
|
||||
|
||||
[env:controllino]
|
||||
@@ -590,6 +678,8 @@ lib_deps =
|
||||
SparkFun CCS811 Arduino Library@~1.0.7
|
||||
Adafruit NeoPixel
|
||||
https://github.com/anklimov/ArduinoOTA
|
||||
https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library
|
||||
https://github.com/arcao/Syslog.git
|
||||
|
||||
[env:stm32-enc2860]
|
||||
platform = ststm32
|
||||
@@ -639,3 +729,5 @@ lib_deps =
|
||||
UIPEthernet
|
||||
https://github.com/anklimov/NRFFlashStorage
|
||||
Adafruit NeoPixel
|
||||
https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library
|
||||
SPI
|
||||
|
||||
Reference in New Issue
Block a user