mirror of
https://github.com/anklimov/lighthub
synced 2025-12-07 12:19:49 +03:00
Merge pull request #53 from anklimov/develop
Major release commit Windows compilation fixed (removed dependency from bash) Core logic refactored - modularity for new devices added -New module: Haier Air Conditioner UART control -New module: SPI Led (not finalized yet, need remove hardcodes) - just as module example now MQTT structure unified: split Commands and Settings topics HomeAssistant compatibility (+HomeKit, GoogleHome, Alice) HomeBridge compatibility (Homekit)
This commit is contained in:
21
.gitignore
vendored
21
.gitignore
vendored
@@ -6,13 +6,16 @@
|
||||
.DS_Store
|
||||
CMakeListsPrivate.txt
|
||||
custom-build-flags/*
|
||||
build_flags_due.sh
|
||||
build_flags_esp32.sh
|
||||
build_flags_esp8266.sh
|
||||
build_flags_stm32.sh
|
||||
build_flags_due-5500.sh
|
||||
build_flags_mega2560.sh
|
||||
build_flags_mega2560-net.sh
|
||||
build_flags_controllino.sh
|
||||
build_flags_nrf52840.sh
|
||||
custom-build-flags/build_flags_due
|
||||
custom-build-flags/build_flags_esp32
|
||||
custom-build-flags/build_flags_esp8266
|
||||
custom-build-flags/build_flags_stm32
|
||||
custom-build-flags/build_flags_due-5500
|
||||
custom-build-flags/build_flags_mega2560
|
||||
custom-build-flags/build_flags_mega2560-net
|
||||
custom-build-flags/build_flags_controllino
|
||||
custom-build-flags/build_flags_nrf52840
|
||||
.vscode/*
|
||||
.vscode/.browse.c_cpp.db
|
||||
.vscode/c_cpp_properties.json
|
||||
.vscode/launch.json
|
||||
|
||||
2
build-flags/build_flags_controllino
Normal file
2
build-flags/build_flags_controllino
Normal file
@@ -0,0 +1,2 @@
|
||||
-DCONTROLLINO
|
||||
-DCUSTOM_FIRMWARE_MAC=de:ad:be:ef:fe:07
|
||||
1
build-flags/build_flags_due-5100
Normal file
1
build-flags/build_flags_due-5100
Normal file
@@ -0,0 +1 @@
|
||||
#NO special flags
|
||||
2
build-flags/build_flags_due-5500
Normal file
2
build-flags/build_flags_due-5500
Normal file
@@ -0,0 +1,2 @@
|
||||
-DWiz5500
|
||||
-DARTNET_ENABLE
|
||||
8
build-flags/build_flags_esp32-wifi
Normal file
8
build-flags/build_flags_esp32-wifi
Normal file
@@ -0,0 +1,8 @@
|
||||
-DDMX_DISABLE
|
||||
-DMODBUS_DISABLE
|
||||
-DOWIRE_DISABLE
|
||||
-DDHT_DISABLE
|
||||
-DCOUNTER_DISABLE
|
||||
-DSPILED_DISABLE
|
||||
-DAC_DISABLE
|
||||
#-DM5STACK
|
||||
2
build-flags/build_flags_esp8266-wifi
Normal file
2
build-flags/build_flags_esp8266-wifi
Normal file
@@ -0,0 +1,2 @@
|
||||
-DMODBUS_DISABLE
|
||||
#-DCOUNTER_DISABLE
|
||||
3
build-flags/build_flags_lighthub21
Normal file
3
build-flags/build_flags_lighthub21
Normal file
@@ -0,0 +1,3 @@
|
||||
-DWiz5500
|
||||
-DW5500_CS_PIN=53
|
||||
-DARTNET_ENABLE
|
||||
8
build-flags/build_flags_m5stack
Normal file
8
build-flags/build_flags_m5stack
Normal file
@@ -0,0 +1,8 @@
|
||||
-DDMX_DISABLE
|
||||
-DMODBUS_DISABLE
|
||||
-DOWIRE_DISABLE
|
||||
-DDHT_DISABLE
|
||||
-DCOUNTER_DISABLE
|
||||
-DSPILED_DISABLE
|
||||
-DAC_DISABLE
|
||||
-DM5STACK
|
||||
2
build-flags/build_flags_mega2560-5100
Normal file
2
build-flags/build_flags_mega2560-5100
Normal file
@@ -0,0 +1,2 @@
|
||||
-DMODBUS_DIMMER_PARAM=SERIAL_8E1
|
||||
-DAVR_DMXOUT_PIN=18
|
||||
3
build-flags/build_flags_mega2560-5500
Normal file
3
build-flags/build_flags_mega2560-5500
Normal file
@@ -0,0 +1,3 @@
|
||||
-DWiz5500
|
||||
-DMODBUS_DIMMER_PARAM=SERIAL_8E1
|
||||
-DAVR_DMXOUT_PIN=18
|
||||
2
build-flags/build_flags_mega2560-slim-5100
Normal file
2
build-flags/build_flags_mega2560-slim-5100
Normal file
@@ -0,0 +1,2 @@
|
||||
-DMODBUS_DIMMER_PARAM=SERIAL_8E1
|
||||
-DAVR_DMXOUT_PIN=18
|
||||
11
build-flags/build_flags_nrf52840-5500
Normal file
11
build-flags/build_flags_nrf52840-5500
Normal file
@@ -0,0 +1,11 @@
|
||||
-DWiz5500
|
||||
#-DW5500_CS_PIN=10
|
||||
-DDMX_DISABLE
|
||||
-DMODBUS_DISABLE
|
||||
#-DOWIRE_DISABLE
|
||||
-std=gnu++11
|
||||
-DWIFI_MANAGER_DISABLE
|
||||
-DCOUNTER_DISABLE
|
||||
-DCSSHDC_DISABLE
|
||||
-DSPILED_DISABLE
|
||||
-DAC_DISABLE
|
||||
9
build-flags/build_flags_stm32-enc2860
Normal file
9
build-flags/build_flags_stm32-enc2860
Normal file
@@ -0,0 +1,9 @@
|
||||
-DDMX_DISABLE
|
||||
-DMODBUS_DISABLE
|
||||
-DOWIRE_DISABLE
|
||||
-DDHT_DISABLE
|
||||
-DCOUNTER_DISABLE
|
||||
-DNO_HOMIE
|
||||
-DCSSHDC_DISABLE
|
||||
-DSPILED_DISABLE
|
||||
-DAC_DISABLE
|
||||
33
build-flags/build_flags_template
Normal file
33
build-flags/build_flags_template
Normal file
@@ -0,0 +1,33 @@
|
||||
|
||||
# usage:
|
||||
# first make your own copy of template
|
||||
# cp build_flags_template build_flags_ENVNAME
|
||||
# then edit, change or comment something
|
||||
# place to custom-build-flags dir if you would like have your own private settings
|
||||
# -DMY_CONFIG_SERVER=lazyhome.ru
|
||||
# -DWATCH_DOG_TICKER_DISABLE
|
||||
# -DUSE_1W_PIN=12
|
||||
# -DSD_CARD_INSERTED
|
||||
# -DSERIAL_BAUD=115200
|
||||
# -DWiz5500
|
||||
# -DDISABLE_FREERAM_PRINT
|
||||
# -DCUSTOM_FIRMWARE_MAC=de:ad:be:ef:fe:ff
|
||||
# -DDMX_DISABLE
|
||||
# -DMODBUS_DISABLE
|
||||
# -DOWIRE_DISABLE
|
||||
# -DAVR_DMXOUT_PIN=18
|
||||
# -DLAN_INIT_DELAY=2000
|
||||
# -DCONTROLLINO
|
||||
# -DESP_WIFI_AP=MYAP
|
||||
# -DESP_WIFI_PWD=MYPWD
|
||||
# -DWIFI_MANAGER_DISABLE
|
||||
# -DRESET_PIN=5
|
||||
# -DDHCP_RETRY_INTERVAL=60000
|
||||
# -DRESTART_LAN_ON_MQTT_ERRORS
|
||||
# -DW5500_CS_PIN=53
|
||||
# -DSYSLOG_ENABLE
|
||||
# -DDEVICE_NAME=MYDEVICE
|
||||
# -DDHT_DISABLE
|
||||
# -DCOUNTER_DISABLE
|
||||
# -DWITH_PRINTEX_LIB
|
||||
# -DCSSHDC_DISABLE
|
||||
@@ -1,30 +0,0 @@
|
||||
#! /bin/bash
|
||||
# usage:
|
||||
# first make your own copy of template
|
||||
# cp build_flags_template.sh build_flags_ENVNAME.sh
|
||||
# then edit, change or comment something
|
||||
export FLAGS="-DMY_CONFIG_SERVER=lazyhome.ru"
|
||||
#export FLAGS="$FLAGS -DWATCH_DOG_TICKER_DISABLE"
|
||||
#export FLAGS="$FLAGS -DUSE_1W_PIN=12"
|
||||
#export FLAGS="$FLAGS -DSD_CARD_INSERTED"
|
||||
export FLAGS="$FLAGS -DSERIAL_BAUD=115200"
|
||||
#export FLAGS="$FLAGS -DWiz5500"
|
||||
#export FLAGS="$FLAGS -DDISABLE_FREERAM_PRINT"
|
||||
export FLAGS="$FLAGS -DCUSTOM_FIRMWARE_MAC=de:ad:be:ef:fe:fe"
|
||||
# export FLAGS="$FLAGS -DDMX_DISABLE"
|
||||
# export FLAGS="$FLAGS -DARTNET_ENABLE"
|
||||
# export FLAGS="$FLAGS -DMODBUS_DISABLE"
|
||||
# export FLAGS="$FLAGS -DOWIRE_DISABLE"
|
||||
# export FLAGS="$FLAGS -DAVR_DMXOUT_PIN=18"
|
||||
# export FLAGS="$FLAGS -DLAN_INIT_DELAY=2000"
|
||||
# export FLAGS="$FLAGS -DCONTROLLINO"
|
||||
# export FLAGS="$FLAGS -DESP_WIFI_AP=MYAP"
|
||||
# export FLAGS="$FLAGS -DESP_WIFI_PWD=MYPWD"
|
||||
# export FLAGS="$FLAGS -DWIFI_MANAGER_DISABLE"
|
||||
export FLAGS="$FLAGS -DDHT_DISABLE"
|
||||
# export FLAGS="$FLAGS -DRESET_PIN=5"
|
||||
# export FLAGS="$FLAGS -DDHCP_RETRY_INTERVAL=60000"
|
||||
# export FLAGS="$FLAGS -DRESTART_LAN_ON_MQTT_ERRORS"
|
||||
# export FLAGS="$FLAGS -DW5500_CS_PIN=53"
|
||||
export FLAGS="$FLAGS -DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
|
||||
echo $FLAGS
|
||||
@@ -1,9 +0,0 @@
|
||||
#! /bin/bash
|
||||
export FLAGS="$FLAGS -DCONTROLLINO"
|
||||
export FLAGS="$FLAGS -DCUSTOM_FIRMWARE_MAC=de:ad:be:ef:fe:07"
|
||||
export FLAGS="$FLAGS -DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
|
||||
CUSTOM_BUILD_FLAGS_FILE=custom-build-flags/build_flags_controllino.sh
|
||||
if [ -f $CUSTOM_BUILD_FLAGS_FILE ]; then
|
||||
source $CUSTOM_BUILD_FLAGS_FILE
|
||||
fi
|
||||
echo $FLAGS
|
||||
@@ -1,9 +0,0 @@
|
||||
#! /bin/bash
|
||||
export FLAGS="$FLAGS -DWiz5500"
|
||||
export FLAGS="$FLAGS -DARTNET_ENABLE"
|
||||
export FLAGS="$FLAGS -DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
|
||||
CUSTOM_BUILD_FLAGS_FILE=custom-build-flags/build_flags_due-5500.sh
|
||||
if [ -f $CUSTOM_BUILD_FLAGS_FILE ]; then
|
||||
source $CUSTOM_BUILD_FLAGS_FILE
|
||||
fi
|
||||
echo $FLAGS
|
||||
@@ -1,7 +0,0 @@
|
||||
#! /bin/bash
|
||||
export FLAGS="$FLAGS -DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
|
||||
CUSTOM_BUILD_FLAGS_FILE=custom-build-flags/build_flags_due.sh
|
||||
if [ -f $CUSTOM_BUILD_FLAGS_FILE ]; then
|
||||
source $CUSTOM_BUILD_FLAGS_FILE
|
||||
fi
|
||||
echo $FLAGS
|
||||
@@ -1,14 +0,0 @@
|
||||
#! /bin/bash
|
||||
export FLAGS="$FLAGS -DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
|
||||
export FLAGS="$FLAGS -DDMX_DISABLE"
|
||||
export FLAGS="$FLAGS -DMODBUS_DISABLE"
|
||||
export FLAGS="$FLAGS -DOWIRE_DISABLE"
|
||||
export FLAGS="$FLAGS -DDHT_DISABLE"
|
||||
export FLAGS="$FLAGS -DCOUNTER_DISABLE"
|
||||
#export FLAGS="$FLAGS -DM5STACK"
|
||||
#export FLAGS="$FLAGS -std=gnu++11"
|
||||
CUSTOM_BUILD_FLAGS_FILE=custom-build-flags/build_flags_esp32.sh
|
||||
if [ -f $CUSTOM_BUILD_FLAGS_FILE ]; then
|
||||
source $CUSTOM_BUILD_FLAGS_FILE
|
||||
fi
|
||||
echo $FLAGS
|
||||
@@ -1,9 +0,0 @@
|
||||
#! /bin/bash
|
||||
export FLAGS="$FLAGS -DMODBUS_DISABLE"
|
||||
#export FLAGS="$FLAGS -DCOUNTER_DISABLE"
|
||||
export FLAGS="$FLAGS -DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
|
||||
CUSTOM_BUILD_FLAGS_FILE=custom-build-flags/build_flags_esp8266.sh
|
||||
if [ -f $CUSTOM_BUILD_FLAGS_FILE ]; then
|
||||
source $CUSTOM_BUILD_FLAGS_FILE
|
||||
fi
|
||||
echo $FLAGS
|
||||
@@ -1,10 +0,0 @@
|
||||
#! /bin/bash
|
||||
export FLAGS="$FLAGS -DWiz5500"
|
||||
export FLAGS="$FLAGS -DW5500_CS_PIN=53"
|
||||
export FLAGS="$FLAGS -DARTNET_ENABLE"
|
||||
export FLAGS="$FLAGS -DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
|
||||
CUSTOM_BUILD_FLAGS_FILE=custom-build-flags/build_flags_due-5500.sh
|
||||
if [ -f $CUSTOM_BUILD_FLAGS_FILE ]; then
|
||||
source $CUSTOM_BUILD_FLAGS_FILE
|
||||
fi
|
||||
echo $FLAGS
|
||||
@@ -1,12 +0,0 @@
|
||||
#! /bin/bash
|
||||
CUSTOM_BUILD_FLAGS_FILE="custom-build-flags/build_flags_mega2560-5500.sh"
|
||||
export FLAGS="$FLAGS -DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
|
||||
export FLAGS="$FLAGS -DWiz5500"
|
||||
export FLAGS="$FLAGS -DMODBUS_DIMMER_PARAM=SERIAL_8E1"
|
||||
export FLAGS="$FLAGS -DAVR_DMXOUT_PIN=18"
|
||||
|
||||
#TODO: make one file for all envs
|
||||
if [ -f $CUSTOM_BUILD_FLAGS_FILE ]; then
|
||||
source $CUSTOM_BUILD_FLAGS_FILE
|
||||
fi
|
||||
echo $FLAGS
|
||||
@@ -1,10 +0,0 @@
|
||||
#! /bin/bash
|
||||
CUSTOM_BUILD_FLAGS_FILE="custom-build-flags/build_flags_mega2560-slim.sh"
|
||||
export FLAGS="$FLAGS -DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
|
||||
export FLAGS="$FLAGS -DMODBUS_DIMMER_PARAM=SERIAL_8E1"
|
||||
export FLAGS="$FLAGS -DAVR_DMXOUT_PIN=18"
|
||||
#TODO: make one file for all envs
|
||||
if [ -f $CUSTOM_BUILD_FLAGS_FILE ]; then
|
||||
source $CUSTOM_BUILD_FLAGS_FILE
|
||||
fi
|
||||
echo $FLAGS
|
||||
@@ -1,9 +0,0 @@
|
||||
#! /bin/bash
|
||||
CUSTOM_BUILD_FLAGS_FILE=custom-build-flags/build_flags_mega2560.sh
|
||||
export FLAGS="$FLAGS -DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
|
||||
export FLAGS="$FLAGS -DMODBUS_DIMMER_PARAM=SERIAL_8E1"
|
||||
export FLAGS="$FLAGS -DAVR_DMXOUT_PIN=18"
|
||||
if [ -f $CUSTOM_BUILD_FLAGS_FILE ]; then
|
||||
source $CUSTOM_BUILD_FLAGS_FILE
|
||||
fi
|
||||
echo $FLAGS
|
||||
@@ -1,17 +0,0 @@
|
||||
#! /bin/bash
|
||||
export FLAGS="$FLAGS -DWiz5500"
|
||||
#export FLAGS="$FLAGS -DW5500_CS_PIN=10"
|
||||
export FLAGS="$FLAGS -DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
|
||||
export FLAGS="$FLAGS -DDMX_DISABLE"
|
||||
export FLAGS="$FLAGS -DMODBUS_DISABLE"
|
||||
#export FLAGS="$FLAGS -DOWIRE_DISABLE"
|
||||
export FLAGS="$FLAGS -std=gnu++11"
|
||||
export FLAGS="$FLAGS -DWIFI_MANAGER_DISABLE"
|
||||
export FLAGS="$FLAGS -DCOUNTER_DISABLE"
|
||||
export FLAGS="$FLAGS -DCSSHDC_DISABLE"
|
||||
|
||||
CUSTOM_BUILD_FLAGS_FILE=custom-build-flags/build_flags_nrf52840.sh
|
||||
if [ -f $CUSTOM_BUILD_FLAGS_FILE ]; then
|
||||
source $CUSTOM_BUILD_FLAGS_FILE
|
||||
fi
|
||||
echo $FLAGS
|
||||
@@ -1,14 +0,0 @@
|
||||
#! /bin/bash
|
||||
CUSTOM_BUILD_FLAGS_FILE=custom-build-flags/build_flags_stm32.sh
|
||||
export FLAGS="$FLAGS -DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
|
||||
export FLAGS="$FLAGS -DDMX_DISABLE"
|
||||
export FLAGS="$FLAGS -DMODBUS_DISABLE"
|
||||
export FLAGS="$FLAGS -DOWIRE_DISABLE"
|
||||
export FLAGS="$FLAGS -DDHT_DISABLE"
|
||||
export FLAGS="$FLAGS -DCOUNTER_DISABLE"
|
||||
export FLAGS="$FLAGS -DNO_HOMIE"
|
||||
export FLAGS="$FLAGS -DCSSHDC_DISABLE"
|
||||
if [ -f $CUSTOM_BUILD_FLAGS_FILE ]; then
|
||||
source $CUSTOM_BUILD_FLAGS_FILE
|
||||
fi
|
||||
echo $FLAGS
|
||||
273
compiled/DUE_16u2_reflash/16u2.hex
Normal file
273
compiled/DUE_16u2_reflash/16u2.hex
Normal file
@@ -0,0 +1,273 @@
|
||||
:10000000A7C00000C0C00000BEC00000BCC000000F
|
||||
:10001000BAC00000B8C00000B6C00000B4C0000004
|
||||
:10002000B2C00000B0C00000AEC00000C1C40000FB
|
||||
:1000300085C40000A8C00000A6C00000A4C0000045
|
||||
:10004000A2C00000A0C000009EC000009CC0000034
|
||||
:100050009AC0000098C0000096C0000021C10000B6
|
||||
:1000600092C0000090C000008EC000008CC0000054
|
||||
:100070008AC0000088C0000086C0000084C0000064
|
||||
:1000800082C0000080C000007EC000007CC0000074
|
||||
:100090007AC0000078C000001201100102000008C0
|
||||
:1000A00041233D0001000102DC0109023E00020182
|
||||
:1000B00000C0320904000001020201000524000111
|
||||
:1000C0001004240206052406000107058203080027
|
||||
:1000D000FF09040100020A000000070504024000B5
|
||||
:1000E00001070583024000010403090432034100B3
|
||||
:1000F00072006400750069006E006F002000280027
|
||||
:100100007700770077002E006100720064007500B0
|
||||
:1001100069006E006F002E0063006300290000007C
|
||||
:100120002E03410072006400750069006E006F00CC
|
||||
:1001300020004400750065002000500072006F0030
|
||||
:1001400067002E00200050006F0072007400000055
|
||||
:1001500011241FBECFEFD2E0DEBFCDBF11E0A0E083
|
||||
:10016000B1E0E4EDF0E102C005900D92A831B107D5
|
||||
:10017000D9F712E0A8E1B1E001C01D92A833B107A0
|
||||
:10018000E1F72BD1A5C73CCF9C01DC01AE57BF4F97
|
||||
:10019000ED91FC91119741911196FC93EE9380584B
|
||||
:1001A0009F4FE817F90711F42D933C939FB7F894EC
|
||||
:1001B000F901EC57FF4F8081815080839FBF842FCE
|
||||
:1001C0000895882311F03F9A01C03F9847980895F9
|
||||
:1001D000882311F046980895469A0895DF92EF9289
|
||||
:1001E000FF920F931F93FC018489813019F08230B4
|
||||
:1001F00019F404C010E303C010E001C010E28389C9
|
||||
:10020000823009F418608589873031F0883031F008
|
||||
:10021000863029F4126003C0146001C01660109289
|
||||
:10022000C9001092C8001092CA000785F088E188C2
|
||||
:10023000D288202F3F2D4E2D5D2D10921E01203B88
|
||||
:1002400084E0380780E0480780E0580719F481E02F
|
||||
:1002500080931E01CA01B90122E030E040E050E085
|
||||
:100260001CD720583B47414E5F4FCA01B901202F90
|
||||
:100270003F2D4E2D5D2DEFD6215030403093CD00D7
|
||||
:100280002093CC001093CA0082E08093C80088E9D4
|
||||
:100290008093C9001F910F91FF90EF90DF90089518
|
||||
:1002A0001F920F920FB60F9211242F938F939F934B
|
||||
:1002B000EF93FF939091CE008EB38430F1F4E091F0
|
||||
:1002C000A201F091A3019083E091A201F091A3011A
|
||||
:1002D000CF0101969093A3018093A201825A91408D
|
||||
:1002E00021F482E291E0928381839FB7F894809118
|
||||
:1002F000A6018F5F8093A6019FBFFF91EF919F9111
|
||||
:100300008F912F910F900FBE0F901F901895FC01A9
|
||||
:1003100040911A0140931B0180911C0180931D01A3
|
||||
:100320008585282F30E02170307020931A01858553
|
||||
:1003300090E096958795817080931C0180911E01B5
|
||||
:10034000882339F088E790E0909319018093180191
|
||||
:100350000895442341F4222331F082E390E0909306
|
||||
:10036000190180931801089580E091E00AC680E0A9
|
||||
:1003700091E0BDC584B7877F84BF88E10FB6F8944C
|
||||
:1003800080936000109260000FBE81E01ADF16BCFF
|
||||
:1003900083E085BD86B58831E8F315BC16BC80E0E6
|
||||
:1003A00010DF469A3E9A87E690E09093CD008093C6
|
||||
:1003B000CC0086E08093CA001092C80088E1809348
|
||||
:1003C000C900539A5A9A8AB180638AB98BB1806303
|
||||
:1003D0008BB9A9D284E085BD08950F931F93CF9365
|
||||
:1003E000DF93C8DF2FB7F89487EA91E09093280253
|
||||
:1003F0008093270290932A02809329022FBF2FB760
|
||||
:10040000F89482E291E09093A3018093A2019093EB
|
||||
:10041000A5018093A4012FBF7894C7EAD1E003E03F
|
||||
:100420008FB7F89490912B028FBF903809F180E03C
|
||||
:1004300091E0D3D497FD1CC0E0912702F0912802EF
|
||||
:100440008083E0912702F0912802CF0101969093DA
|
||||
:100450002802809327028752924011F4D283C183ED
|
||||
:100460009FB7F89480912B028F5F80932B029FBFE0
|
||||
:100470008FB7F8941091A6018FBFA89903C01136C9
|
||||
:1004800008F456C0A89A8091A601882361F05D986F
|
||||
:1004900000931F0108C082E291E076DE682F80E0C1
|
||||
:1004A00091E001D511501123B1F780911F018823EC
|
||||
:1004B00051F080911F01815080931F0180911F0195
|
||||
:1004C000882309F45D9A80912001882351F080915E
|
||||
:1004D000200181508093200180912001882309F41C
|
||||
:1004E0005C9A809118019091190118161906E4F48C
|
||||
:1004F000CC97CD9710F481E001C080E069DE809157
|
||||
:100500001801909119010197C29710F481E001C080
|
||||
:1005100080E057DE80911801909119010197909326
|
||||
:1005200019018093180104C080E052DE80E049DEAA
|
||||
:100530008FB7F89490912B028FBF992369F087EAC7
|
||||
:1005400091E022DE982F8091C80085FFFCCF909328
|
||||
:10055000CE005C980093200180E091E095D42AD4ED
|
||||
:100560005FCFDA01923049F0933061F09130F9F4C5
|
||||
:10057000E8E9F0E022E130E01EC0EAEAF0E02EE334
|
||||
:1005800030E019C0813049F0813018F0823079F4C0
|
||||
:1005900008C0E8EEF0E0849107C0ECEEF0E0849152
|
||||
:1005A00003C0E0E2F1E08491282F30E004C0E0E0F5
|
||||
:1005B000F0E020E030E0ED93FC93C901089528E0DD
|
||||
:1005C00030E040E003C04F5F220F331F2817390788
|
||||
:1005D000D0F3842F8295807F08958093E9008091E5
|
||||
:1005E000EB0081608093EB001092ED006093EC00D3
|
||||
:1005F0004093ED008091EE00881F8827881F0895A2
|
||||
:100600001092F40090E09093E9001092F0001092A4
|
||||
:10061000E8001092ED008091EB008E7F8093EB005C
|
||||
:100620009F5F953081F708958091300288238CF484
|
||||
:1006300003C08EB38823B1F08091E80082FFF9CF28
|
||||
:100640008091E8008B778093E80008958EB388232B
|
||||
:1006500049F08091E80080FFF9CF8091E8008E7723
|
||||
:100660008093E800089594E68091EC0080FF05C037
|
||||
:100670008091E80080FF05C023C08091E80082FDE2
|
||||
:100680001FC08EB3882311F482E008958EB38530A5
|
||||
:1006900011F483E008958091EB0085FF02C081E0B2
|
||||
:1006A00008958091E10082FFDFCF8091E1008B7F90
|
||||
:1006B0008093E100992311F484E008959150D4CF00
|
||||
:1006C00080E008959C014091360250913702461710
|
||||
:1006D000570718F4F90120E038C06115710511F0D1
|
||||
:1006E000AB01F8CF8091E8008E778093E80040E07E
|
||||
:1006F00050E0F0CF8091E80083FF02C081E00895D0
|
||||
:100700008091E80082FD2DC08EB3882381F18EB3E5
|
||||
:10071000853079F18091E80080FF17C09091F20058
|
||||
:1007200006C081918093F100415050409F5F411578
|
||||
:10073000510511F09830A8F320E0983009F421E039
|
||||
:100740008091E8008E778093E8004115510591F67D
|
||||
:10075000222381F606C08EB3882349F08EB38530FC
|
||||
:1007600041F08091E80082FFF6CF80E0089582E0BA
|
||||
:10077000089583E008959C0140913602509137021C
|
||||
:100780004617570710F490E03BC06115710511F052
|
||||
:10079000AB01F9CF8091E8008E778093E80040E0CC
|
||||
:1007A00050E0F1CF8091E80083FF02C081E008951E
|
||||
:1007B0008091E80082FD30C08EB3882399F18EB31A
|
||||
:1007C000853091F18091E80080FF1AC08091F2009D
|
||||
:1007D00009C0F9012F5F3F4FE491E093F1004150D0
|
||||
:1007E00050408F5F4115510511F0883090F390E033
|
||||
:1007F000883009F491E08091E8008E778093E800DA
|
||||
:100800004115510579F6992369F606C08EB3882300
|
||||
:1008100049F08EB3853041F08091E80082FFF6CF39
|
||||
:1008200080E0089582E0089583E008959C016115B9
|
||||
:10083000710529F48091E8008B778093E800F90135
|
||||
:1008400020C08091E80083FF02C081E008958EB34C
|
||||
:10085000882339F18EB3853031F18091E80082FF31
|
||||
:10086000F0CF06C08091F10081936150704021F07B
|
||||
:100870008091F2008823B1F78091E8008B77809314
|
||||
:10088000E80061157105E9F606C08EB3882349F0CA
|
||||
:100890008EB3853041F08091E80080FFF6CF80E094
|
||||
:1008A000089582E0089583E0089542D044D01EBAAE
|
||||
:1008B00010922E0210922D0210922C0284E089BD1B
|
||||
:1008C00089B5826089BD09B400FEFDCF8091D80052
|
||||
:1008D000982F9F779093D80080688093D80080915C
|
||||
:1008E00063008E7F809363008091D8008F7D80931A
|
||||
:1008F000D8008091E0008E7F8093E0008091E1003D
|
||||
:100900008E7F8093E1008091E20081608093E2001D
|
||||
:100910008091E100877F8093E1008091E200886010
|
||||
:100920008093E2000895C1DF81E080932F02089553
|
||||
:100930001092E20008951092E10008951F920F9224
|
||||
:100940000FB60F9211241F932F933F934F935F93F2
|
||||
:100950006F937F938F939F93AF93BF93EF93FF9387
|
||||
:10096000E9EEF0E0108117701082E0EFF0E0808196
|
||||
:10097000877F80837894C3D0F894A9EEB0E01C926E
|
||||
:10098000E0EFF0E08081886080831C93FF91EF911D
|
||||
:10099000BF91AF919F918F917F916F915F914F9197
|
||||
:1009A0003F912F911F910F900FBE0F901F901895A0
|
||||
:1009B0001F920F920FB60F9211242F933F934F93D4
|
||||
:1009C0005F936F937F938F939F93AF93BF93EF93B7
|
||||
:1009D000FF938091E10080FF1BC08091E20080FFC7
|
||||
:1009E00017C08091E1008E7F8093E1008091E2004A
|
||||
:1009F0008E7F8093E2008091E20080618093E2002C
|
||||
:100A00008091D80080628093D80019BC1EBAD1D1E1
|
||||
:100A10008091E10084FF29C08091E20084FF25C01D
|
||||
:100A200084E089BD89B5826089BD09B400FEFDCF2F
|
||||
:100A30008091D8008F7D8093D8008091E1008F7ED7
|
||||
:100A40008093E1008091E2008F7E8093E2008091AC
|
||||
:100A5000E20081608093E20080912E02882311F4ED
|
||||
:100A600081E001C084E08EBBA4D18091E10083FFCE
|
||||
:100A700027C08091E20083FF23C08091E100877F3F
|
||||
:100A80008093E10082E08EBB10922E028091E10003
|
||||
:100A90008E7F8093E1008091E2008E7F8093E20060
|
||||
:100AA0008091E20080618093E200AADD80E060E056
|
||||
:100AB00042E093DD8091F00088608093F00079D16E
|
||||
:100AC0008091E10082FF0AC08091E20082FF06C0AF
|
||||
:100AD0008091E1008B7F8093E1006BD1FF91EF91DA
|
||||
:100AE000BF91AF919F918F917F916F915F914F9146
|
||||
:100AF0003F912F910F900FBE0F901F9018951F934D
|
||||
:100B0000DF93CF93CDB7DEB7AC970FB6F894DEBFC7
|
||||
:100B10000FBECDBFE0E3F2E08091F100819322E0CF
|
||||
:100B2000E833F207C9F78091300230913102353055
|
||||
:100B300009F487C0363040F43130C9F1313070F0FB
|
||||
:100B4000333009F01DC133C0383009F4EFC03930FB
|
||||
:100B500009F4FEC0363009F013C192C0803821F08C
|
||||
:100B6000823809F00DC108C090912C0280912D02AD
|
||||
:100B7000882399F0926011C080913402877080932D
|
||||
:100B8000E9008091EB0090E025E0969587952A9505
|
||||
:100B9000E1F7982F91701092E9008091E800877F2B
|
||||
:100BA0008093E8009093F1001092F100CAC088236E
|
||||
:100BB00019F0823009F0E4C090E08F7190700097D6
|
||||
:100BC00021F0029709F0DDC00CC080913202813023
|
||||
:100BD00009F0D7C010922D02333069F580932D02B1
|
||||
:100BE0002AC080913202882331F520913402277087
|
||||
:100BF00009F4C7C02093E9008091EB0080FFC1C0D9
|
||||
:100C0000333021F48091EB00806213C08091EB00BF
|
||||
:100C100080618093EB0081E090E002C0880F991F13
|
||||
:100C20002A95E2F78093EA001092EA008091EB00A7
|
||||
:100C300088608093EB001092E9008091E800877F44
|
||||
:100C400083C0882309F09CC0109132028091E80093
|
||||
:100C5000877F8093E800E8DC04C08EB3882309F422
|
||||
:100C600090C08091E80080FFF8CF812F8F7711F43A
|
||||
:100C700092E001C093E09EBB80688093E30081C056
|
||||
:100C80008058823008F07CC080913202909133020B
|
||||
:100C900023E08C3D920799F55FB7F894DE01159635
|
||||
:100CA0004EE020E030E061E2E42FF0E06093570096
|
||||
:100CB000849120FF03C082958F704F5F982F9F70A3
|
||||
:100CC000892F805D8A3308F0895F8C9311961C927E
|
||||
:100CD00011972F5F3F4F12962431310529F75FBFDF
|
||||
:100CE0008AE28B8383E08C838091E800877F809306
|
||||
:100CF000E800CE0103966AE270E0E4DC11C0609186
|
||||
:100D00003402AE014F5F5F4F2CDCBC010097C9F18C
|
||||
:100D10008091E800877F8093E80089819A812BDDAC
|
||||
:100D20008091E8008B778093E8002BC0803841F5F4
|
||||
:100D30008091E800877F8093E80080912E02809365
|
||||
:100D4000F1008091E8008E778093E8006DDC19C097
|
||||
:100D50008823B1F490913202923098F48091E800A7
|
||||
:100D6000877F8093E80090932E025EDC80912E02B4
|
||||
:100D7000882311F483E001C084E08EBBF8DA01C05F
|
||||
:100D8000F3DA8091E80083FF0AC08091EB00806273
|
||||
:100D90008093EB008091E800877F8093E800AC9619
|
||||
:100DA0000FB6F894DEBF0FBECDBFCF91DF911F917C
|
||||
:100DB000089508951F938EB3882361F01091E90080
|
||||
:100DC0001092E9008091E80083FF01C098DE17705F
|
||||
:100DD0001093E9001F9108950895FC018EB38430AB
|
||||
:100DE00021F587859089A189B2890097A105B10570
|
||||
:100DF000E1F085818093E9008091E80082FF15C0D1
|
||||
:100E00008091F200882319F42FEF3FEF04C0809106
|
||||
:100E1000F100282F30E08091F200882341F4809186
|
||||
:100E2000E8008B778093E80002C02FEF3FEFC90105
|
||||
:100E30000895FC018EB3843011F587859089A189CE
|
||||
:100E4000B2890097A105B105D1F081818093E900B5
|
||||
:100E50008091F2008823A9F09091E8008091E80049
|
||||
:100E60008E778093E80095FD0CC0FDDB982F8823DA
|
||||
:100E700049F48091E8008E778093E80003C092E007
|
||||
:100E800001C090E0892F0895FC018EB3843051F4A5
|
||||
:100E900087859089A189B2890097A105B10511F0D4
|
||||
:100EA000CF01C7CF08951F93FC01162F8EB3843056
|
||||
:100EB000D9F487859089A189B2890097A105B105E8
|
||||
:100EC00099F081818093E9008091E80085FD08C058
|
||||
:100ED0008091E8008E778093E800C5DB882329F4B1
|
||||
:100EE0001093F10080E001C082E01F9108950F93FC
|
||||
:100EF0001F93CF93DF93EC010D96FC0189E0DF0196
|
||||
:100F00001D928A95E9F72A813B8109818C8188238A
|
||||
:100F100011F410E001C014E0C90151DB182B12607C
|
||||
:100F2000802F61E8412F59DB882329F12E813F81F1
|
||||
:100F30000D818885882311F410E001C014E0C901F7
|
||||
:100F40003EDB182B1260802F60E8412F46DB8823A0
|
||||
:100F500091F02A853B8509858C85882311F410E062
|
||||
:100F600001C014E0C9012BDB182B1260802F61EC4B
|
||||
:100F7000412F33DB01C080E0DF91CF911F910F91B2
|
||||
:100F80000895CF93DF93EC018091E80083FF60C068
|
||||
:100F9000888190E02091340230913502281739077A
|
||||
:100FA00009F056C080913102813261F0823220F422
|
||||
:100FB000803209F04DC019C0823269F1833209F0E4
|
||||
:100FC00047C038C080913002813A09F041C0809119
|
||||
:100FD000E800877F8093E800CE010F9667E070E01D
|
||||
:100FE00071DB8091E8008B7713C0809130028132F1
|
||||
:100FF00079F58091E800877F8093E800CE010F9615
|
||||
:1010000067E070E013DCCE01E9D88091E8008E77CC
|
||||
:101010008093E8001DC0809130028132C9F4809134
|
||||
:10102000E800877F8093E800809132028D87CE01AF
|
||||
:101030006ED90DC080913002813251F48091E80068
|
||||
:10104000877F8093E800CE0160913202C5DEECDA42
|
||||
:10105000DF91CF910895A1E21A2EAA1BBB1BFD01BF
|
||||
:101060000DC0AA1FBB1FEE1FFF1FA217B307E40787
|
||||
:10107000F50720F0A21BB30BE40BF50B661F771FDF
|
||||
:10108000881F991F1A9469F76095709580959095BF
|
||||
:101090009B01AC01BD01CF01089597FB092E0526E8
|
||||
:1010A0000ED057FD04D0D7DF0AD0001C38F450957D
|
||||
:1010B0004095309521953F4F4F4F5F4F0895F6F77C
|
||||
:1010C00090958095709561957F4F8F4F9F4F0895B4
|
||||
:0410D000F894FFCFC2
|
||||
:1010D400000340000004400000020800000000007B
|
||||
:0810E4000000000000001400F0
|
||||
:00000001FF
|
||||
0
compiled/DUE_16u2_reflash/reflash16u2DUE.sh
Normal file → Executable file
0
compiled/DUE_16u2_reflash/reflash16u2DUE.sh
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Binary file not shown.
@@ -1,12 +1,12 @@
|
||||
cp ../.pioenvs/controllino/firmware.hex controllino
|
||||
cp ../.pioenvs/m5stack/firmware.bin m5stack
|
||||
cp ../.pioenvs/mega2560slim-5100/firmware.hex mega2560slim-5100
|
||||
cp ../.pioenvs/due-5100/firmware.bin due-5100
|
||||
cp ../.pioenvs/mega2560-5100/firmware.hex mega2560-5100
|
||||
cp ../.pioenvs/due-5500/firmware.bin due-5500
|
||||
cp ../.pioenvs/nrf52840-5500/firmware.hex nrf52840-5500
|
||||
cp ../.pioenvs/esp32-wifi/firmware.bin esp32-wifi
|
||||
cp ../.pioenvs/stm32-enc2860/firmware.bin stm32-enc2860
|
||||
cp ../.pioenvs/esp8266-wifi/firmware.bin esp8266-wifi
|
||||
cp ../.pioenvs/lighthub21/firmware.bin lighthub21
|
||||
cp ../.pioenvs/mega2560-5500/firmware.hex mega2560-5500
|
||||
cp ../.pio/build/controllino/firmware.hex controllino
|
||||
cp ../.pio/build/m5stack/firmware.bin m5stack
|
||||
cp ../.pio/build/mega2560slim-5100/firmware.hex mega2560slim-5100
|
||||
cp ../.pio/build/due-5100/firmware.bin due-5100
|
||||
cp ../.pio/build/mega2560-5100/firmware.hex mega2560-5100
|
||||
cp ../.pio/build/due-5500/firmware.bin due-5500
|
||||
cp ../.pio/build/nrf52840-5500/firmware.hex nrf52840-5500
|
||||
cp ../.pio/build/esp32-wifi/firmware.bin esp32-wifi
|
||||
cp ../.pio/build/stm32-enc2860/firmware.bin stm32-enc2860
|
||||
cp ../.pio/build/esp8266-wifi/firmware.bin esp8266-wifi
|
||||
cp ../.pio/build/lighthub21/firmware.bin lighthub21
|
||||
cp ../.pio/build/mega2560-5500/firmware.hex mega2560-5500
|
||||
@@ -1,32 +0,0 @@
|
||||
#! /bin/bash
|
||||
# usage:
|
||||
# first make your own copy of template
|
||||
# cp build_flags_template.sh my_build_flags.sh
|
||||
# then edit, change or comment something
|
||||
# nano my_build_flags.sh
|
||||
# and source it
|
||||
# source my_build_flags.sh
|
||||
#export FLAGS="$FLAGS -DMY_CONFIG_SERVER=lighthub.elistech.ru"
|
||||
#export FLAGS="$FLAGS -DWATCH_DOG_TICKER_DISABLE"
|
||||
#export FLAGS="$FLAGS -DUSE_1W_PIN=12"
|
||||
#export FLAGS="$FLAGS -DSD_CARD_INSERTED"
|
||||
export FLAGS="$FLAGS -DSERIAL_BAUD=115200"
|
||||
# export FLAGS="$FLAGS -DWiz5500"
|
||||
export FLAGS="$FLAGS -DDISABLE_FREERAM_PRINT"
|
||||
export FLAGS="$FLAGS -DCUSTOM_FIRMWARE_MAC=C2:3E:1f:03:1B:1E"
|
||||
# export FLAGS="$FLAGS -DDMX_DISABLE"
|
||||
# export FLAGS="$FLAGS -DMODBUS_DISABLE"
|
||||
# export FLAGS="$FLAGS -DOWIRE_DISABLE"
|
||||
#export FLAGS="$FLAGS -DAVR_DMXOUT_PIN=18"
|
||||
#export FLAGS="$FLAGS -DCONTROLLINO"
|
||||
# export FLAGS="$FLAGS -DRESET_PIN=8"
|
||||
# export FLAGS="$FLAGS -DLAN_INIT_DELAY=2000"
|
||||
# export FLAGS="$FLAGS -DESP_WIFI_AP=vent"
|
||||
# export FLAGS="$FLAGS -DESP_WIFI_PWD=kk007remont"
|
||||
# export FLAGS="$FLAGS -DSYSLOG_ENABLE"
|
||||
export FLAGS="$FLAGS -DDEVICE_NAME=kk007_mega2560"
|
||||
export FLAGS="$FLAGS -DCOUNTER_DISABLE"
|
||||
export FLAGS="$FLAGS -DDHT_DISABLE"
|
||||
#export FLAGS="$FLAGS -DWITH_DOMOTICZ"
|
||||
#export FLAGS="$FLAGS -DWITH_PRINTEX_LIB"
|
||||
export FLAGS="$FLAGS -DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
|
||||
@@ -1,30 +0,0 @@
|
||||
#! /bin/bash
|
||||
# usage:
|
||||
# first make your own copy of template
|
||||
# cp build_flags_template.sh build_flags_ENVNAME.sh
|
||||
# then edit, change or comment something
|
||||
#export FLAGS="$FLAGS -DMY_CONFIG_SERVER=lazyhome.ru"
|
||||
export FLAGS="$FLAGS -DWATCH_DOG_TICKER_DISABLE"
|
||||
#export FLAGS="$FLAGS -DUSE_1W_PIN=12"
|
||||
#export FLAGS="$FLAGS -DSD_CARD_INSERTED"
|
||||
#export FLAGS="$FLAGS -DSERIAL_BAUD=115200"
|
||||
#export FLAGS="$FLAGS -DWiz5500"
|
||||
export FLAGS="$FLAGS -DDISABLE_FREERAM_PRINT"
|
||||
#export FLAGS="$FLAGS -DCUSTOM_FIRMWARE_MAC=de:ad:be:ef:fe:ff"
|
||||
#export FLAGS="$FLAGS -DDMX_DISABLE"
|
||||
#export FLAGS="$FLAGS -DMODBUS_DISABLE"
|
||||
#export FLAGS="$FLAGS -DOWIRE_DISABLE"
|
||||
# export FLAGS="$FLAGS -DAVR_DMXOUT_PIN=18"
|
||||
# export FLAGS="$FLAGS -DLAN_INIT_DELAY=2000"
|
||||
# export FLAGS="$FLAGS -DCONTROLLINO"
|
||||
# export FLAGS="$FLAGS -DWIFI_MANAGER_DISABLE"
|
||||
# export FLAGS="$FLAGS -DRESET_PIN=5"
|
||||
# export FLAGS="$FLAGS -DDHCP_RETRY_INTERVAL=60000"
|
||||
# export FLAGS="$FLAGS -DRESTART_LAN_ON_MQTT_ERRORS"
|
||||
# export FLAGS="$FLAGS -DW5500_CS_PIN=53"
|
||||
#export FLAGS="$FLAGS -std=gnu++11"
|
||||
#export FLAGS="$FLAGS -DDEVICE_NAME=MYDEVICE"
|
||||
#export FLAGS="$FLAGS -DDHT_COUNTER_DISABLE"
|
||||
#export FLAGS="$FLAGS -DWITH_PRINTEX_LIB"
|
||||
#export FLAGS="$FLAGS -DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
|
||||
echo $FLAGS
|
||||
@@ -1,34 +0,0 @@
|
||||
#! /bin/bash
|
||||
# usage:
|
||||
# first make your own copy of template
|
||||
# cp build_flags_template.sh build_flags_ENVNAME.sh
|
||||
# then edit, change or comment something
|
||||
# export FLAGS="$FLAGS -DMY_CONFIG_SERVER=lazyhome.ru"
|
||||
# export FLAGS="$FLAGS -DWATCH_DOG_TICKER_DISABLE"
|
||||
# export FLAGS="$FLAGS -DUSE_1W_PIN=12"
|
||||
# export FLAGS="$FLAGS -DSD_CARD_INSERTED"
|
||||
# export FLAGS="$FLAGS -DSERIAL_BAUD=115200"
|
||||
# export FLAGS="$FLAGS -DWiz5500"
|
||||
# export FLAGS="$FLAGS -DDISABLE_FREERAM_PRINT"
|
||||
# export FLAGS="$FLAGS -DCUSTOM_FIRMWARE_MAC=de:ad:be:ef:fe:ff"
|
||||
# export FLAGS="$FLAGS -DDMX_DISABLE"
|
||||
# export FLAGS="$FLAGS -DMODBUS_DISABLE"
|
||||
# export FLAGS="$FLAGS -DOWIRE_DISABLE"
|
||||
# export FLAGS="$FLAGS -DAVR_DMXOUT_PIN=18"
|
||||
# export FLAGS="$FLAGS -DLAN_INIT_DELAY=2000"
|
||||
# export FLAGS="$FLAGS -DCONTROLLINO"
|
||||
# export FLAGS="$FLAGS -DESP_WIFI_AP=MYAP"
|
||||
# export FLAGS="$FLAGS -DESP_WIFI_PWD=MYPWD"
|
||||
# export FLAGS="$FLAGS -DWIFI_MANAGER_DISABLE"
|
||||
# export FLAGS="$FLAGS -DRESET_PIN=5"
|
||||
# export FLAGS="$FLAGS -DDHCP_RETRY_INTERVAL=60000"
|
||||
# export FLAGS="$FLAGS -DRESTART_LAN_ON_MQTT_ERRORS"
|
||||
# export FLAGS="$FLAGS -DW5500_CS_PIN=53"
|
||||
# export FLAGS="$FLAGS -DSYSLOG_ENABLE"
|
||||
# export FLAGS="$FLAGS -DDEVICE_NAME=MYDEVICE"
|
||||
# export FLAGS="$FLAGS -DDHT_DISABLE"
|
||||
# export FLAGS="$FLAGS -DCOUNTER_DISABLE"
|
||||
# export FLAGS="$FLAGS -DWITH_PRINTEX_LIB"
|
||||
# export FLAGS="$FLAGS -DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
|
||||
# export FLAGS="$FLAGS -DCSSHDC_DISABLE"
|
||||
echo $FLAGS
|
||||
31
get_build_flags.py
Normal file
31
get_build_flags.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import print_function
|
||||
import os
|
||||
import sys
|
||||
print(sys.argv[1:], file=sys.stderr)
|
||||
#print("build_flags_"+sys.argv[1:][0])
|
||||
try:
|
||||
file = open("build-flags/build_flags_"+sys.argv[1:][0])
|
||||
except IOError as e:
|
||||
print(u'No build flags file ', file=sys.stderr)
|
||||
else:
|
||||
with file:
|
||||
for line in file.readlines():
|
||||
if not line.startswith('#'):
|
||||
print (line)
|
||||
file.close()
|
||||
|
||||
try:
|
||||
file = open("custom-build-flags/build_flags_"+sys.argv[1:][0])
|
||||
except IOError as e:
|
||||
print(u'No custom build flags file ', file=sys.stderr)
|
||||
else:
|
||||
with file:
|
||||
for line in file.readlines():
|
||||
if not line.startswith('#'):
|
||||
print (line)
|
||||
file.close()
|
||||
|
||||
sys.stdout.write("-DPIO_SRC_REV=")
|
||||
sys.stdout.flush()
|
||||
os.system("git log --pretty=format:%h_%ad -1 --date=short")
|
||||
41
lighthub/abstractch.cpp
Normal file
41
lighthub/abstractch.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
|
||||
#include "abstractch.h"
|
||||
#include <PubSubClient.h>
|
||||
#include "utils.h"
|
||||
#include <aJSON.h>
|
||||
#include "main.h"
|
||||
|
||||
extern lan_status lanStatus;
|
||||
extern PubSubClient mqttClient;
|
||||
|
||||
int abstractCh::publishTopic(const char* topic, long value, const char* subtopic)
|
||||
{
|
||||
char valstr[16];
|
||||
printUlongValueToStr(valstr, value);
|
||||
return publishTopic(topic, valstr,subtopic);
|
||||
};
|
||||
|
||||
int abstractCh::publishTopic(const char* topic, float value, const char* subtopic)
|
||||
{
|
||||
char valstr[16];
|
||||
printFloatValueToStr(value, valstr);
|
||||
return publishTopic(topic, valstr,subtopic);
|
||||
};
|
||||
|
||||
int abstractCh::publishTopic(const char* topic, const char * value, const char* subtopic)
|
||||
{
|
||||
char addrstr[MQTT_TOPIC_LENGTH];
|
||||
|
||||
if (topic)
|
||||
{
|
||||
strncpy(addrstr,topic,sizeof(addrstr));
|
||||
if (!strchr(addrstr,'/')) setTopic(addrstr,sizeof(addrstr),T_OUT,topic);
|
||||
strncat(addrstr,subtopic,sizeof(addrstr));
|
||||
if (mqttClient.connected() && lanStatus == OPERATION)
|
||||
{
|
||||
mqttClient.publish(addrstr, value, true);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
23
lighthub/abstractch.h
Normal file
23
lighthub/abstractch.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
#include "Arduino.h"
|
||||
|
||||
#define CST_UNKNOWN 0
|
||||
#define CST_INITIALIZED 1
|
||||
|
||||
class abstractCh {
|
||||
public:
|
||||
abstractCh(){};
|
||||
virtual ~abstractCh(){};
|
||||
virtual int Poll() = 0;
|
||||
virtual int Setup() =0; //Should initialize hardware and reserve resources
|
||||
virtual int Anounce () {return 0;};
|
||||
virtual int Stop() {return 0;}; //Should free resources
|
||||
virtual int Status() {return CST_UNKNOWN;}
|
||||
|
||||
|
||||
protected:
|
||||
virtual int publishTopic(const char* topic, long value, const char* subtopic = NULL);
|
||||
virtual int publishTopic(const char* topic, float value, const char* subtopic = NULL );
|
||||
virtual int publishTopic(const char* topic, const char * value, const char* subtopic = NULL);
|
||||
//friend Input;
|
||||
};
|
||||
@@ -1,5 +1,6 @@
|
||||
|
||||
#include "abstractin.h"
|
||||
#include "abstractch.h"
|
||||
#include <PubSubClient.h>
|
||||
#include "utils.h"
|
||||
#include <aJSON.h>
|
||||
@@ -9,21 +10,21 @@
|
||||
extern lan_status lanStatus;
|
||||
extern PubSubClient mqttClient;
|
||||
|
||||
int abstractIn::publish(long value, char* subtopic)
|
||||
int abstractIn::publish(long value, const char* subtopic)
|
||||
{
|
||||
char valstr[16];
|
||||
printUlongValueToStr(valstr, value);
|
||||
return publish(valstr,subtopic);
|
||||
};
|
||||
|
||||
int abstractIn::publish(float value, char* subtopic)
|
||||
int abstractIn::publish(float value, const char* subtopic)
|
||||
{
|
||||
char valstr[16];
|
||||
printFloatValueToStr(value, valstr);
|
||||
return publish(valstr,subtopic);
|
||||
};
|
||||
|
||||
int abstractIn::publish(char * value, char* subtopic)
|
||||
int abstractIn::publish(char * value, const char* subtopic)
|
||||
{
|
||||
char addrstr[MQTT_TOPIC_LENGTH];
|
||||
if (in)
|
||||
@@ -31,14 +32,7 @@ int abstractIn::publish(char * value, char* subtopic)
|
||||
aJsonObject *emit = aJson.getObjectItem(in->inputObj, "emit");
|
||||
if (emit)
|
||||
{
|
||||
strncpy(addrstr,emit->valuestring,sizeof(addrstr));
|
||||
if (!strchr(addrstr,'/')) setTopic(addrstr,sizeof(addrstr),T_OUT,emit->valuestring);
|
||||
strncat(addrstr,subtopic,sizeof(addrstr));
|
||||
if (mqttClient.connected() && lanStatus == OPERATION)
|
||||
{
|
||||
mqttClient.publish(addrstr, value, true);
|
||||
return 1;
|
||||
}
|
||||
return publishTopic(emit->valuestring,value,subtopic);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
#pragma once
|
||||
#include "Arduino.h"
|
||||
#include "abstractch.h"
|
||||
|
||||
class Input;
|
||||
class abstractIn {
|
||||
class abstractIn : public abstractCh{
|
||||
public:
|
||||
abstractIn(Input * _in){in=_in;};
|
||||
virtual int Setup(int addr) = 0;
|
||||
virtual int Poll() = 0;
|
||||
abstractIn(Input * _in):abstractCh(){in=_in;};
|
||||
|
||||
protected:
|
||||
Input * in;
|
||||
int publish(long value, char* subtopic = NULL);
|
||||
int publish(float value, char* subtopic = NULL );
|
||||
int publish(char * value, char* subtopic = NULL);
|
||||
int publish(long value, const char* subtopic = NULL);
|
||||
int publish(float value, const char* subtopic = NULL );
|
||||
int publish(char * value, const char* subtopic = NULL);
|
||||
friend Input;
|
||||
};
|
||||
|
||||
14
lighthub/abstractout.h
Normal file
14
lighthub/abstractout.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
#include "Arduino.h"
|
||||
#include "abstractch.h"
|
||||
|
||||
class Item;
|
||||
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 isActive(){return 0;};
|
||||
virtual int getDefaultOnVal(){return 100;};
|
||||
protected:
|
||||
Item * item;
|
||||
};
|
||||
@@ -1,38 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
const char state_P[] PROGMEM = "$state";
|
||||
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 name_P[] PROGMEM = "$name";
|
||||
const char nameval_P[] PROGMEM = "LightHub ";
|
||||
|
||||
const char nodes_P[] PROGMEM = "$nodes";
|
||||
const char localip_P[] PROGMEM = "$localip";
|
||||
const char mac_P[] PROGMEM = "$mac";
|
||||
const char fwname_P[] PROGMEM = "$fw/name";
|
||||
const char fwversion_P[] PROGMEM = "$fw/version";
|
||||
const char implementation_P[] PROGMEM = "$implementation";
|
||||
const char interval_P[] PROGMEM = "$stats/interval";
|
||||
const char color_P[] PROGMEM = "color";
|
||||
|
||||
const char datatype_P[] PROGMEM = "$datatype";
|
||||
|
||||
const char float_P[] PROGMEM = "float";
|
||||
const char hsv_P[] PROGMEM = "hsv";
|
||||
const char int_P[] PROGMEM = "integer";
|
||||
const char enum_P[] PROGMEM = "enum";
|
||||
const char format_P[] PROGMEM = "$format";
|
||||
const char true_P[] PROGMEM = "true";
|
||||
const char false_P[] PROGMEM = "false";
|
||||
|
||||
const char enumformat_P[] PROGMEM = "ON,OFF,HALT,REST,XON,XOFF,TOGGLE";
|
||||
const char intformat_P[] PROGMEM = "0-100";
|
||||
|
||||
const char stats_P[] PROGMEM = "$stats";
|
||||
const char statsval_P[] PROGMEM = "uptime,freeheap";
|
||||
const char uptime_P[] PROGMEM = "uptime";
|
||||
const char freeheap_P[] PROGMEM = "freeheap";
|
||||
@@ -118,12 +118,12 @@ if (!isValid() || (!root)) return;
|
||||
if (inType == IN_CCS811)
|
||||
{
|
||||
in_ccs811 ccs811(this);
|
||||
ccs811.Setup(pin);
|
||||
ccs811.Setup();
|
||||
}
|
||||
else if (inType == IN_HDC1080)
|
||||
{
|
||||
in_hdc1080 hdc1080(this);
|
||||
hdc1080.Setup(pin);
|
||||
hdc1080.Setup();
|
||||
}
|
||||
// TODO rest types setup
|
||||
#endif
|
||||
@@ -188,6 +188,7 @@ switch (cause) {
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef COUNTER_DISABLE
|
||||
@@ -226,11 +227,11 @@ void Input::counterPoll() {
|
||||
char addrstr[MQTT_TOPIC_LENGTH];
|
||||
strncpy(addrstr,emit->valuestring,sizeof(addrstr));
|
||||
if (!strchr(addrstr,'/')) setTopic(addrstr,sizeof(addrstr),T_OUT,emit->valuestring);
|
||||
sprintf(valstr, "%d", counterValue);
|
||||
sprintf(valstr, "%ld", counterValue);
|
||||
if (mqttClient.connected() && !ethernetIdleCount)
|
||||
mqttClient.publish(addrstr, valstr);
|
||||
setNextPollTime(millis() + DHT_POLL_DELAY_DEFAULT);
|
||||
debugSerial<<F(" NextPollMillis=")<<nextPollTime();
|
||||
// debugSerial<<F(" NextPollMillis=")<<nextPollTime();
|
||||
}
|
||||
else
|
||||
debugSerial<<F(" No emit data!");
|
||||
@@ -399,7 +400,7 @@ void Input::dht22Poll() {
|
||||
mqttClient.publish(addrstr, valstr);
|
||||
|
||||
setNextPollTime(millis() + DHT_POLL_DELAY_DEFAULT);
|
||||
debugSerial << F(" NextPollMillis=") << nextPollTime() << endl;
|
||||
// debugSerial << F(" NextPollMillis=") << nextPollTime() << endl;
|
||||
} else
|
||||
setNextPollTime(millis() + DHT_POLL_DELAY_DEFAULT / 3);
|
||||
}
|
||||
@@ -435,13 +436,15 @@ void Input::contactPoll() {
|
||||
if (inType & IN_PUSH_TOGGLE) {
|
||||
if (currentInputState) { //react on leading edge only (change from 0 to 1)
|
||||
store->logicState = !store->logicState;
|
||||
store->currentValue = currentInputState;
|
||||
onContactChanged(store->logicState);
|
||||
}
|
||||
} else {
|
||||
store->logicState = currentInputState;
|
||||
store->currentValue = currentInputState;
|
||||
onContactChanged(currentInputState);
|
||||
}
|
||||
store->currentValue = currentInputState;
|
||||
// store->currentValue = currentInputState;
|
||||
}
|
||||
} else // no change
|
||||
store->bounce = SAME_STATE_ATTEMPTS;
|
||||
@@ -616,7 +619,7 @@ bool Input::publishDataToDomoticz(int pollTimeIncrement, aJsonObject *emit, cons
|
||||
mqttClient.publish(emit->valuestring, valstr);
|
||||
if (pollTimeIncrement)
|
||||
setNextPollTime(millis() + pollTimeIncrement);
|
||||
debugSerial << F(" NextPollMillis=") << nextPollTime() << endl;
|
||||
// debugSerial << F(" NextPollMillis=") << nextPollTime() << endl;
|
||||
|
||||
#endif
|
||||
return true;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
147
lighthub/item.h
147
lighthub/item.h
@@ -18,18 +18,26 @@ e-mail anklimov@gmail.com
|
||||
|
||||
*/
|
||||
#include "options.h"
|
||||
#include "abstractout.h"
|
||||
|
||||
#define S_SET 1
|
||||
#define S_TEMP 2
|
||||
#define S_MODE 3
|
||||
#define S_SETPOINT 4
|
||||
#define S_POWER 5
|
||||
#define S_VOL 6
|
||||
#define S_HEAT 7
|
||||
#define S_HSV 8
|
||||
#define S_RGB 9
|
||||
#define S_RPM 10
|
||||
#define S_NOTFOUND 0
|
||||
#define S_SETnCMD 0
|
||||
#define S_CMD 1
|
||||
#define S_SET 2
|
||||
#define S_HSV 3
|
||||
#define S_RGB 4
|
||||
#define S_FAN 5
|
||||
#define S_MODE 6
|
||||
#define S_ADDITIONAL 64
|
||||
/*
|
||||
|
||||
#define S_RPM 11
|
||||
#define S_TEMP 3
|
||||
#define S_SETPOINT 5
|
||||
#define S_POWER 6
|
||||
#define S_VOL 7
|
||||
#define S_HEAT 8
|
||||
*/
|
||||
#define CH_DIMMER 0 //DMX 1 ch
|
||||
#define CH_RGBW 1 //DMX 4 ch
|
||||
#define CH_RGB 2 //DMX 3 ch
|
||||
@@ -40,7 +48,8 @@ e-mail anklimov@gmail.com
|
||||
#define CH_GROUP 7 //Group pseudochannel
|
||||
#define CH_VCTEMP 8 //Vacom PID regulator
|
||||
#define CH_VC 9 //Vacom modbus motor regulator
|
||||
#define CH_AC_HAIER 10 //AC Haier
|
||||
#define CH_AC 10 //AC Haier
|
||||
#define CH_SPILED 11
|
||||
#define CH_WHITE 127//
|
||||
|
||||
#define CMD_NUM 0
|
||||
@@ -58,12 +67,27 @@ e-mail anklimov@gmail.com
|
||||
#define CMD_XOFF 7 //off only if was previously turned on by CMD_XON
|
||||
#define CMD_UP 8 //increase
|
||||
#define CMD_DN 9 //decrease
|
||||
#define CMD_SET 0xe
|
||||
#define CMD_MASK 0xf
|
||||
#define CMD_HEAT 0xa
|
||||
#define CMD_COOL 0xb
|
||||
#define CMD_AUTO 0xc
|
||||
#define CMD_FAN 0xd
|
||||
#define CMD_DRY 0xe
|
||||
#define CMD_SET 0xf
|
||||
#define CMD_HIGH 0x10
|
||||
#define CMD_MED 0x11
|
||||
#define CMD_LOW 0x12
|
||||
//#define CMD_CURTEMP 0xf
|
||||
#define CMD_MASK 0xff
|
||||
#define FLAG_MASK 0x0f00
|
||||
|
||||
#define CMD_CURTEMP 127
|
||||
#define CMD_RETRY 64
|
||||
#define CMD_REPORT 32
|
||||
|
||||
#define SEND_COMMAND 0x100
|
||||
#define SEND_PARAMETERS 0x200
|
||||
#define SEND_RETRY 0x400
|
||||
#define SEND_DEFFERED 0x800
|
||||
|
||||
|
||||
//#define CMD_REPORT 32
|
||||
|
||||
#define I_TYPE 0 //Type of item
|
||||
#define I_ARG 1 //Chanel-type depended argument or array of arguments (pin, address etc)
|
||||
@@ -89,49 +113,61 @@ extern short thermoSetCurTemp(char *name, float t);
|
||||
|
||||
int txt2cmd (char * payload);
|
||||
|
||||
#pragma pack(push, 1)
|
||||
typedef union
|
||||
{
|
||||
long int aslong;
|
||||
float asfloat;
|
||||
struct
|
||||
{ uint8_t v;
|
||||
uint8_t s;
|
||||
uint16_t h:15;
|
||||
uint16_t hsv_flag:1;
|
||||
};
|
||||
struct
|
||||
{
|
||||
uint8_t r;
|
||||
uint8_t g;
|
||||
uint8_t b;
|
||||
uint8_t w:7;
|
||||
uint8_t rgb_flag:1;
|
||||
};
|
||||
} CHstore;
|
||||
|
||||
/*
|
||||
typedef union
|
||||
{
|
||||
long int aslong;
|
||||
struct
|
||||
{
|
||||
int16_t h;
|
||||
int8_t s;
|
||||
int8_t v;
|
||||
};
|
||||
} HSVstore;
|
||||
|
||||
|
||||
typedef union
|
||||
{
|
||||
long int aslong;
|
||||
struct
|
||||
{
|
||||
int8_t r;
|
||||
int8_t g;
|
||||
int8_t b;
|
||||
int8_t v;
|
||||
};
|
||||
} RGBVstore;
|
||||
} RGBWstore;
|
||||
*/
|
||||
#pragma pack(pop)
|
||||
|
||||
class Item
|
||||
{
|
||||
public:
|
||||
aJsonObject *itemArr, *itemArg,*itemVal;
|
||||
uint8_t itemType;
|
||||
|
||||
abstractOut * driver;
|
||||
|
||||
Item(char * name);
|
||||
Item(aJsonObject * obj);
|
||||
~Item();
|
||||
|
||||
boolean isValid ();
|
||||
virtual int Ctrl(short cmd, short n=0, int * Parameters=NULL, boolean send=true, int subItem=0);
|
||||
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);
|
||||
|
||||
int getArg(short n=0);
|
||||
boolean getEnableCMD(int delta);
|
||||
//int getVal(short n); //From VAL array. Negative if no array
|
||||
long int getVal(); //From int val OR array
|
||||
uint8_t getCmd(bool ext = false);
|
||||
uint8_t getCmd();
|
||||
void setCmd(uint8_t cmdValue);
|
||||
short getFlag (short flag=FLAG_MASK);
|
||||
void setFlag (short flag);
|
||||
void clearFlag (short flag);
|
||||
//void setVal(uint8_t n, int par);
|
||||
void setVal(long int par);
|
||||
//void copyPar (aJsonObject *itemV);
|
||||
@@ -139,13 +175,15 @@ class Item
|
||||
inline int Off(){return Ctrl(CMD_OFF);};
|
||||
inline int Toggle(){return Ctrl(CMD_TOGGLE);};
|
||||
int Poll();
|
||||
int SendStatus(short cmd, short n=0, int * Par=NULL, boolean deferred = false);
|
||||
int SendStatus(int sendFlags);
|
||||
|
||||
protected:
|
||||
short cmd2changeActivity(int lastActivity, short defaultCmd = CMD_SET);
|
||||
int VacomSetFan (int8_t val, int8_t cmd=0);
|
||||
int VacomSetHeat(int addr, int8_t val, int8_t cmd=0);
|
||||
int modbusDimmerSet(int addr, uint16_t _reg, int _regType, int _mask, uint16_t value);
|
||||
void mb_fail(short addr, short op, int val, int cmd);
|
||||
int modbusDimmerSet(uint16_t value);
|
||||
void mb_fail();
|
||||
int isActive();
|
||||
void Parse();
|
||||
int checkModbusDimmer();
|
||||
@@ -156,32 +194,3 @@ class Item
|
||||
int checkFM();
|
||||
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
|
||||
class PooledItem : public Item
|
||||
{
|
||||
public:
|
||||
virtual int onContactChanged() = 0;
|
||||
virtual void Idle ();
|
||||
protected:
|
||||
int PoolingInterval;
|
||||
unsigned long next;
|
||||
virtual int Pool() =0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class Vacon : public Item
|
||||
{
|
||||
public:
|
||||
int Pool ();
|
||||
virtual int Ctrl(short cmd, short n=0, int * Par=NULL);
|
||||
protected:
|
||||
};
|
||||
|
||||
*/
|
||||
|
||||
@@ -265,8 +265,9 @@ else
|
||||
|
||||
Item item(itemName);
|
||||
if (item.isValid()) {
|
||||
/*
|
||||
if (item.itemType == CH_GROUP && (lanStatus == RETAINING_COLLECTING))
|
||||
return; //Do not restore group channels - they consist not relevant data
|
||||
return; //Do not restore group channels - they consist not relevant data */
|
||||
item.Ctrl((char *)payload, !(lanStatus == RETAINING_COLLECTING),subItem);
|
||||
} //valid item
|
||||
}
|
||||
@@ -317,7 +318,7 @@ lan_status lanLoop() {
|
||||
//Unsubscribe from status topics..
|
||||
//strncpy_P(buf, outprefix, sizeof(buf));
|
||||
setTopic(buf,sizeof(buf),T_OUT);
|
||||
strncat(buf, "#", sizeof(buf));
|
||||
strncat(buf, "+/+/#", sizeof(buf)); // Subscribing only on separated command/parameters topics
|
||||
mqttClient.unsubscribe(buf);
|
||||
|
||||
lanStatus = OPERATION;//3;
|
||||
@@ -582,7 +583,7 @@ void ip_ready_config_loaded_connecting_to_broker() {
|
||||
|
||||
// strncpy_P(buf, outprefix, sizeof(buf));
|
||||
setTopic(buf,sizeof(buf),T_OUT);
|
||||
strncat(buf, "#", sizeof(buf));
|
||||
strncat(buf, "+/+/#", sizeof(buf)); // Only on separated cmd/val topics
|
||||
mqttClient.subscribe(buf);
|
||||
|
||||
//Subscribing for command topics
|
||||
@@ -907,7 +908,8 @@ void applyConfig() {
|
||||
while (items && item)
|
||||
if (item->type == aJson_Array && aJson.getArraySize(item)>1) {
|
||||
Item it(item);
|
||||
if (it.isValid()) {
|
||||
if (it.isValid() && !it.Setup()) {
|
||||
//Legacy Setup
|
||||
short inverse = 0;
|
||||
int pin=it.getArg();
|
||||
if (pin<0) {pin=-pin; inverse = 1;}
|
||||
@@ -1140,7 +1142,7 @@ void cmdFunctionPwd(int arg_cnt, char **args)
|
||||
}
|
||||
|
||||
void cmdFunctionSetMac(int arg_cnt, char **args) {
|
||||
if (sscanf(args[1], "%x:%x:%x:%x:%x:%x%с", &mac[0], &mac[1], &mac[2], &mac[3], &mac[4], &mac[5]) < 6) {
|
||||
if (sscanf(args[1], "%x:%x:%x:%x:%x:%x%c", &mac[0], &mac[1], &mac[2], &mac[3], &mac[4], &mac[5]) < 6) {
|
||||
debugSerial<<F("could not parse: ")<<args[1];
|
||||
return;
|
||||
}
|
||||
@@ -1162,12 +1164,12 @@ void saveFlash(short n, char *str) {
|
||||
if (len>MAXFLASHSTR-1) len=MAXFLASHSTR-1;
|
||||
for(int i=0;i<len;i++) EEPROM.write(n+i,str[i]);
|
||||
EEPROM.write(n+len,0);
|
||||
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP8266)
|
||||
// write the data to EEPROM
|
||||
short res = EEPROM.commitReset();
|
||||
Serial.println((res) ? "EEPROM Commit OK" : "Commit failed");
|
||||
#endif.
|
||||
#endif
|
||||
}
|
||||
|
||||
int loadFlash(short n, char *str, short l) {
|
||||
@@ -1186,7 +1188,7 @@ void saveFlash(short n, IPAddress& ip) {
|
||||
// write the data to EEPROM
|
||||
short res = EEPROM.commitReset();
|
||||
Serial.println((res) ? "EEPROM Commit OK" : "Commit failed");
|
||||
#endif.
|
||||
#endif
|
||||
}
|
||||
|
||||
int ipLoadFromFlash(short n, IPAddress &ip) {
|
||||
@@ -1743,9 +1745,10 @@ void inputSetup(void) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef MODBUS_DISABLE
|
||||
//#ifndef MODBUS_DISABLE
|
||||
void pollingLoop(void) {
|
||||
boolean done = false;
|
||||
if (lanStatus == RETAINING_COLLECTING) return;
|
||||
if (millis() > nextPollingCheck) {
|
||||
while (pollingItem && !done) {
|
||||
if (pollingItem->type == aJson_Array) {
|
||||
@@ -1761,7 +1764,7 @@ void pollingLoop(void) {
|
||||
} //while
|
||||
}//if
|
||||
}
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
bool isThermostatWithMinArraySize(aJsonObject *item, int minimalArraySize) {
|
||||
return (item->type == aJson_Array) && (aJson.getArrayItem(item, I_TYPE)->valueint == CH_THERMO) &&
|
||||
@@ -1769,8 +1772,15 @@ bool isThermostatWithMinArraySize(aJsonObject *item, int minimalArraySize) {
|
||||
}
|
||||
|
||||
bool thermoDisabledOrDisconnected(aJsonObject *thermoExtensionArray, int thermoStateCommand) {
|
||||
return thermoStateCommand == CMD_OFF || thermoStateCommand == CMD_HALT ||
|
||||
aJson.getArrayItem(thermoExtensionArray, IET_ATTEMPTS)->valueint == 0;
|
||||
if (aJson.getArrayItem(thermoExtensionArray, IET_ATTEMPTS)->valueint == 0) return true;
|
||||
switch (thermoStateCommand) {
|
||||
case CMD_ON:
|
||||
case CMD_XON:
|
||||
case CMD_AUTO:
|
||||
case CMD_HEAT:
|
||||
return false;
|
||||
default: return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "utils.h"
|
||||
#include "homiedef.h"
|
||||
#include "textconst.h"
|
||||
#include <PubSubClient.h>
|
||||
#include <SPI.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -17,7 +17,7 @@ static bool HDC1080ready = false;
|
||||
static bool CCS811ready = false;
|
||||
|
||||
|
||||
int in_ccs811::Setup(int addr)
|
||||
int in_ccs811::Setup()
|
||||
{
|
||||
if (CCS811ready) {debugSerial<<F("ccs811 is already initialized")<<endl; return 0;}
|
||||
|
||||
@@ -52,7 +52,7 @@ delay(2000); */
|
||||
return 1;
|
||||
}
|
||||
|
||||
int in_hdc1080::Setup(int addr)
|
||||
int in_hdc1080::Setup()
|
||||
{
|
||||
if (HDC1080ready) {debugSerial<<F("hdc1080 is already initialized")<<endl; return 0;}
|
||||
Serial.println("HDC1080 Init ");
|
||||
@@ -156,10 +156,11 @@ int in_ccs811::Poll()
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
if (co2<10000.) //Spontaneous calculation error suppress
|
||||
{
|
||||
publish(co2,"/CO2");
|
||||
publish(tvoc,"/TVOC");
|
||||
publish(ccs811Baseline,"/base");
|
||||
publish(ccs811Baseline,"/base");}
|
||||
Serial.println("]");
|
||||
printSensorError();
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
//CCS811 ccs811(CCS811_ADDR);
|
||||
//uint16_t ccs811Baseline;
|
||||
in_ccs811(Input * _in):abstractIn(_in){};
|
||||
int Setup(int addr) override;
|
||||
int Setup() override;
|
||||
int Poll() override;
|
||||
|
||||
protected:
|
||||
@@ -52,7 +52,7 @@ class in_hdc1080 : public abstractIn {
|
||||
public:
|
||||
//ClosedCube_HDC1080 hdc1080;
|
||||
in_hdc1080(Input * _in):abstractIn(_in){};
|
||||
int Setup(int addr) override;
|
||||
int Setup() override;
|
||||
int Poll() override;
|
||||
|
||||
protected:
|
||||
|
||||
468
lighthub/modules/out_ac.cpp
Normal file
468
lighthub/modules/out_ac.cpp
Normal file
@@ -0,0 +1,468 @@
|
||||
#ifndef AC_DISABLE
|
||||
|
||||
#include "modules/out_ac.h"
|
||||
#include "Arduino.h"
|
||||
#include "options.h"
|
||||
#include "Streaming.h"
|
||||
#include "item.h"
|
||||
#include "textconst.h"
|
||||
|
||||
#ifndef AC_Serial
|
||||
#define AC_Serial Serial3
|
||||
#endif
|
||||
|
||||
#define INTERVAL_AC_POLLING 5000L
|
||||
|
||||
static int driverStatus = CST_UNKNOWN;
|
||||
|
||||
static int fresh =0;
|
||||
static int power = 0;
|
||||
static int swing =0;
|
||||
static int lock_rem =0;
|
||||
static int cur_tmp = 0;
|
||||
static int set_tmp = 0;
|
||||
static int fan_spd = 0;
|
||||
static int mode = 0;
|
||||
|
||||
long prevPolling = 0;
|
||||
byte inCheck = 0;
|
||||
byte qstn[] = {255,255,10,0,0,0,0,0,1,1,77,1,90}; // Команда опроса
|
||||
byte data[37] = {}; //Массив данных
|
||||
byte on[] = {255,255,10,0,0,0,0,0,1,1,77,2,91}; // Включение кондиционера
|
||||
byte off[] = {255,255,10,0,0,0,0,0,1,1,77,3,92}; // Выключение кондиционера
|
||||
byte lock[] = {255,255,10,0,0,0,0,0,1,3,0,0,14}; // Блокировка пульта
|
||||
|
||||
//Extended subItem set
|
||||
const char LOCK_P[] PROGMEM = "lock";
|
||||
const char QUIET_P[] PROGMEM = "queit";
|
||||
const char SWING_P[] PROGMEM = "swing";
|
||||
const char RAW_P[] PROGMEM = "raw";
|
||||
//const char IDLE_P[] PROGMEM = "IDLE";
|
||||
/*
|
||||
extern const char HEAT_P[] PROGMEM;
|
||||
extern const char COOL_P[] PROGMEM;
|
||||
extern const char AUTO_P[] PROGMEM;
|
||||
extern const char FAN_ONLY_P[] PROGMEM;
|
||||
extern const char DRY_P[] PROGMEM;
|
||||
extern const char HIGH_P[] PROGMEM;
|
||||
extern const char MED_P[] PROGMEM;
|
||||
extern const char LOW_P[] PROGMEM;
|
||||
*/
|
||||
void out_AC::InsertData(byte data[], size_t size){
|
||||
|
||||
char s_mode[10];
|
||||
set_tmp = data[B_SET_TMP]+16;
|
||||
cur_tmp = data[B_CUR_TMP];
|
||||
mode = data[B_MODE];
|
||||
fan_spd = data[B_FAN_SPD];
|
||||
swing = data[B_SWING];
|
||||
power = data[B_POWER];
|
||||
lock_rem = data[B_LOCK_REM];
|
||||
fresh = data[B_FRESH];
|
||||
/////////////////////////////////
|
||||
if (fresh & 0x01)
|
||||
publishTopic(item->itemArr->name, "ON","/fresh");
|
||||
else publishTopic(item->itemArr->name, "OFF","/fresh");
|
||||
|
||||
/////////////////////////////////
|
||||
if (lock_rem == 0x80){
|
||||
publishTopic(item->itemArr->name, "ON","/lock");
|
||||
}
|
||||
if (lock_rem == 0x00){
|
||||
publishTopic(item->itemArr->name, "OFF","/lock");
|
||||
}
|
||||
/////////////////////////////////
|
||||
/*
|
||||
if (power == 0x01 || power == 0x11){
|
||||
publishTopic(item->itemArr->name,"Power", "on");
|
||||
}
|
||||
if (power == 0x00 || power == 0x10){
|
||||
publishTopic(item->itemArr->name,"Power", "off");
|
||||
}
|
||||
*/
|
||||
|
||||
Serial.print ("Power=");
|
||||
Serial.println(power);
|
||||
|
||||
if (power & 0x08)
|
||||
publishTopic(item->itemArr->name, "ON", "/quiet");
|
||||
else publishTopic(item->itemArr->name, "OFF" , "/quiet");
|
||||
|
||||
|
||||
if (power & 0x02) //Compressor on
|
||||
publishTopic(item->itemArr->name, "ON","/compressor");
|
||||
else
|
||||
publishTopic(item->itemArr->name, "OFF","/compressor");
|
||||
|
||||
|
||||
publishTopic(item->itemArr->name, (long) swing,"/swing");
|
||||
//publishTopic(item->itemArr->name, (long) fan_spd,"/fan");
|
||||
|
||||
/////////////////////////////////
|
||||
if (fan_spd == 0x00){
|
||||
publishTopic(item->itemArr->name, "high","/fan");
|
||||
}
|
||||
if (fan_spd == 0x01){
|
||||
publishTopic(item->itemArr->name, "medium","/fan");
|
||||
}
|
||||
if (fan_spd == 0x02){
|
||||
publishTopic(item->itemArr->name, "low","/fan");
|
||||
}
|
||||
if (fan_spd == 0x03){
|
||||
publishTopic(item->itemArr->name, "auto","/fan");
|
||||
}
|
||||
|
||||
if (swing == 0x00)
|
||||
publishTopic(item->itemArr->name, "OFF","/swing");
|
||||
else publishTopic(item->itemArr->name, "ON","/swing");
|
||||
/*
|
||||
if (swing == 0x01){
|
||||
publishTopic(item->itemArr->name, "ud","swing");
|
||||
}
|
||||
if (swing == 0x02){
|
||||
publishTopic(item->itemArr->name, "lr","swing");
|
||||
}
|
||||
if (swing == 0x03){
|
||||
publishTopic(item->itemArr->name, "all","swing");
|
||||
}*/
|
||||
/////////////////////////////////
|
||||
|
||||
publishTopic(item->itemArr->name,(long)set_tmp,"/set");
|
||||
publishTopic(item->itemArr->name, (long)cur_tmp, "/temp");
|
||||
////////////////////////////////////
|
||||
s_mode[0]='\0';
|
||||
|
||||
if (mode == 0x00){
|
||||
strcpy_P(s_mode,AUTO_P);
|
||||
}
|
||||
else if (mode == 0x01){
|
||||
strcpy_P(s_mode,COOL_P);
|
||||
}
|
||||
else if (mode == 0x02){
|
||||
strcpy_P(s_mode,HEAT_P);
|
||||
}
|
||||
else if (mode == 0x03){
|
||||
strcpy_P(s_mode,FAN_ONLY_P);
|
||||
}
|
||||
else if (mode == 0x04){
|
||||
strcpy_P(s_mode,DRY_P);
|
||||
}
|
||||
|
||||
publishTopic(item->itemArr->name, (long) mode, "/mode");
|
||||
|
||||
if (power & 0x01)
|
||||
publishTopic(item->itemArr->name, s_mode,"/cmd");
|
||||
|
||||
else publishTopic(item->itemArr->name, "OFF","/cmd");
|
||||
|
||||
String raw_str;
|
||||
char raw[75];
|
||||
for (int i=0; i < 37; i++){
|
||||
if (data[i] < 10){
|
||||
raw_str += "0";
|
||||
raw_str += String(data[i], HEX);
|
||||
} else {
|
||||
raw_str += String(data[i], HEX);
|
||||
}
|
||||
}
|
||||
raw_str.toUpperCase();
|
||||
raw_str.toCharArray(raw,75);
|
||||
publishTopic(item->itemArr->name, raw,"/raw");
|
||||
Serial.println(raw);
|
||||
|
||||
///////////////////////////////////
|
||||
}
|
||||
|
||||
byte getCRC(byte req[], size_t size){
|
||||
byte crc = 0;
|
||||
for (int i=2; i < size; i++){
|
||||
crc += req[i];
|
||||
}
|
||||
return crc;
|
||||
}
|
||||
|
||||
void SendData(byte req[], size_t size){
|
||||
AC_Serial.write(req, size - 1);
|
||||
AC_Serial.write(getCRC(req, size-1));
|
||||
AC_Serial.flush();
|
||||
|
||||
Serial.print("<<");
|
||||
for (int i=0; i < size-1; i++)
|
||||
{
|
||||
if (req[i] < 10){
|
||||
Serial.print("0");
|
||||
Serial.print(req[i], HEX);
|
||||
}
|
||||
else
|
||||
{
|
||||
Serial.print(req[i], HEX);
|
||||
}
|
||||
}
|
||||
Serial.println();
|
||||
}
|
||||
|
||||
inline unsigned char toHex( char ch ){
|
||||
return ( ( ch >= 'A' ) ? ( ch - 'A' + 0xA ) : ( ch - '0' ) ) & 0x0F;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int out_AC::Setup()
|
||||
{
|
||||
Serial.println("AC Init");
|
||||
AC_Serial.begin(9600);
|
||||
driverStatus = CST_INITIALIZED;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int out_AC::Stop()
|
||||
{
|
||||
Serial.println("AC De-Init");
|
||||
|
||||
driverStatus = CST_UNKNOWN;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int out_AC::Status()
|
||||
{
|
||||
return driverStatus;
|
||||
}
|
||||
|
||||
int out_AC::isActive()
|
||||
{
|
||||
return (power & 1);
|
||||
}
|
||||
|
||||
int out_AC::Poll()
|
||||
{
|
||||
long now = millis();
|
||||
if (now - prevPolling > INTERVAL_AC_POLLING) {
|
||||
prevPolling = now;
|
||||
Serial.println ("Polling");
|
||||
SendData(qstn, sizeof(qstn)/sizeof(byte)); //Опрос кондиционера
|
||||
}
|
||||
delay(100);
|
||||
if(AC_Serial.available() > 0){
|
||||
AC_Serial.readBytes(data, 37);
|
||||
while(AC_Serial.available()){
|
||||
delay(2);
|
||||
AC_Serial.read();
|
||||
}
|
||||
if (data[36] != inCheck){
|
||||
inCheck = data[36];
|
||||
InsertData(data, 37);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
};
|
||||
|
||||
int out_AC::Ctrl(short cmd, short n, int * Parameters, boolean send, int suffixCode, char* subItem)
|
||||
{char s_mode[10];
|
||||
// Some additional Subitems
|
||||
if (strcmp_P(subItem, LOCK_P) == 0) suffixCode = S_LOCK;
|
||||
else if (strcmp_P(subItem, SWING_P) == 0) suffixCode = S_SWING;
|
||||
else if (strcmp_P(subItem, QUIET_P) == 0) suffixCode = S_QUIET;
|
||||
else if (strcmp_P(subItem, RAW_P) == 0) suffixCode = S_RAW;
|
||||
|
||||
//data[B_POWER] = power;
|
||||
// debugSerial<<F(".");
|
||||
switch(suffixCode)
|
||||
{
|
||||
case S_SET:
|
||||
set_tmp = Parameters[0];
|
||||
if (set_tmp >= 10 && set_tmp <= 30)
|
||||
{
|
||||
data[B_SET_TMP] = set_tmp -16;
|
||||
if (send) publishTopic(item->itemArr->name,(long) set_tmp,"/set");
|
||||
}
|
||||
break;
|
||||
|
||||
case S_CMD:
|
||||
s_mode[0]='\0';
|
||||
switch (cmd)
|
||||
{
|
||||
case CMD_ON:
|
||||
case CMD_XON:
|
||||
data[B_POWER] = power;
|
||||
data[B_POWER] |= 1;
|
||||
SendData(on, sizeof(on)/sizeof(byte));
|
||||
if (send) publishTopic(item->itemArr->name,"ON","/cmd");
|
||||
return 1;
|
||||
break;
|
||||
case CMD_OFF:
|
||||
case CMD_HALT:
|
||||
data[B_POWER] = power;
|
||||
data[B_POWER] &= ~1;
|
||||
SendData(off, sizeof(off)/sizeof(byte));
|
||||
if (send) publishTopic(item->itemArr->name,"OFF","/cmd");
|
||||
return 1;
|
||||
break;
|
||||
case CMD_AUTO:
|
||||
data[B_MODE] = 0;
|
||||
data[B_POWER] = power;
|
||||
data[B_POWER] |= 1;
|
||||
strcpy_P(s_mode,AUTO_P);
|
||||
break;
|
||||
case CMD_COOL:
|
||||
data[B_MODE] = 1;
|
||||
data[B_POWER] = power;
|
||||
data[B_POWER] |= 1;
|
||||
strcpy_P(s_mode,COOL_P);
|
||||
break;
|
||||
case CMD_HEAT:
|
||||
data[B_MODE] = 2;
|
||||
data[B_POWER] = power;
|
||||
data[B_POWER] |= 1;
|
||||
strcpy_P(s_mode,HEAT_P);
|
||||
break;
|
||||
case CMD_DRY:
|
||||
data[B_MODE] = 4;
|
||||
data[B_POWER] = power;
|
||||
data[B_POWER] |= 1;
|
||||
strcpy_P(s_mode,DRY_P);
|
||||
break;
|
||||
case CMD_FAN:
|
||||
data[B_MODE] = 3;
|
||||
debugSerial<<"fan\n";
|
||||
data[B_POWER] = power;
|
||||
data[B_POWER] |= 1;
|
||||
strcpy_P(s_mode,FAN_ONLY_P);
|
||||
break;
|
||||
case CMD_UNKNOWN:
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
if (send) publishTopic(item->itemArr->name,s_mode,"/cmd");
|
||||
break;
|
||||
|
||||
case S_FAN:
|
||||
s_mode[0]='\0';
|
||||
switch (cmd)
|
||||
{
|
||||
case CMD_AUTO:
|
||||
data[B_FAN_SPD] = 3;
|
||||
strcpy_P(s_mode,AUTO_P);
|
||||
break;
|
||||
case CMD_HIGH:
|
||||
data[B_FAN_SPD] = 0;
|
||||
strcpy_P(s_mode,HIGH_P);
|
||||
break;
|
||||
case CMD_MED:
|
||||
data[B_FAN_SPD] = 1;
|
||||
strcpy_P(s_mode,MED_P);
|
||||
break;
|
||||
case CMD_LOW:
|
||||
data[B_FAN_SPD] = 2;
|
||||
strcpy_P(s_mode,LOW_P);
|
||||
break;
|
||||
default:
|
||||
if (n) data[B_FAN_SPD] = Parameters[0];
|
||||
//TODO - mapping digits to speed
|
||||
}
|
||||
if (send) publishTopic(item->itemArr->name,s_mode,"/fan");
|
||||
break;
|
||||
|
||||
case S_MODE:
|
||||
data[B_MODE] = Parameters[0];
|
||||
break;
|
||||
|
||||
case S_LOCK:
|
||||
switch (cmd)
|
||||
{
|
||||
case CMD_ON:
|
||||
data[B_LOCK_REM] = 80;
|
||||
break;
|
||||
case CMD_OFF:
|
||||
data[B_LOCK_REM] = 0;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case S_SWING:
|
||||
switch (cmd)
|
||||
{
|
||||
case CMD_ON:
|
||||
data[B_LOCK_REM] = 3;
|
||||
break;
|
||||
case CMD_OFF:
|
||||
data[B_LOCK_REM] = 0;
|
||||
break;
|
||||
default:
|
||||
if (n) data[B_SWING] = Parameters[0];
|
||||
}
|
||||
break;
|
||||
|
||||
case S_QUIET:
|
||||
switch (cmd)
|
||||
{
|
||||
case CMD_ON:
|
||||
data[B_POWER] |= 8;
|
||||
break;
|
||||
case CMD_OFF:
|
||||
data[B_POWER] &= ~8;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case S_RAW:
|
||||
/*
|
||||
{
|
||||
char buf[75];
|
||||
char hexbyte[3] = {0};
|
||||
strPayload.toCharArray(buf, 75);
|
||||
int octets[sizeof(buf) / 2] ;
|
||||
for (int i=0; i < 76; i += 2){
|
||||
hexbyte[0] = buf[i] ;
|
||||
hexbyte[1] = buf[i+1] ;
|
||||
data[i/2] = (toHex(hexbyte[0]) << 4) | toHex(hexbyte[1]);
|
||||
AC_Serial.write(data, 37);
|
||||
AC_Serial.flush();
|
||||
publishTopic("RAW", buf);
|
||||
}
|
||||
*/
|
||||
|
||||
break;
|
||||
|
||||
case S_NOTFOUND:
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
//////////
|
||||
|
||||
if (strTopic == "/myhome/in/Conditioner/Swing"){
|
||||
if (strPayload == "off"){
|
||||
data[B_SWING] = 0;
|
||||
}
|
||||
if (strPayload == "ud"){
|
||||
data[B_SWING] = 1;
|
||||
}
|
||||
if (strPayload == "lr"){
|
||||
data[B_SWING] = 2;
|
||||
}
|
||||
if (strPayload == "all"){
|
||||
data[B_SWING] = 3;
|
||||
}
|
||||
}
|
||||
////////
|
||||
|
||||
*/
|
||||
|
||||
//if (strTopic == "/myhome/in/Conditioner/RAW")
|
||||
|
||||
data[B_CMD] = 0;
|
||||
data[9] = 1;
|
||||
data[10] = 77;
|
||||
data[11] = 95;
|
||||
SendData(data, sizeof(data)/sizeof(byte));
|
||||
//InsertData(data, sizeof(data)/sizeof(byte));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
37
lighthub/modules/out_ac.h
Normal file
37
lighthub/modules/out_ac.h
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
#pragma once
|
||||
#ifndef AC_DISABLE
|
||||
#include <abstractout.h>
|
||||
|
||||
#define LEN_B 37
|
||||
#define B_CUR_TMP 13 //Текущая температура
|
||||
#define B_CMD 17 // 00-команда 7F-ответ ???
|
||||
#define B_MODE 23 //04 - DRY, 01 - cool, 02 - heat, 00 - smart 03 - вентиляция
|
||||
#define B_FAN_SPD 25 //Скорость 02 - min, 01 - mid, 00 - max, 03 - auto
|
||||
#define B_SWING 27 //01 - верхний и нижний предел вкл. 00 - выкл. 02 - левый/правый вкл. 03 - оба вкл
|
||||
#define B_LOCK_REM 28 //80 блокировка вкл. 00 - выкл
|
||||
#define B_POWER 29 //on/off 01 - on, 00 - off (10, 11)-Компрессор??? 09 - QUIET
|
||||
#define B_FRESH 31 //fresh 00 - off, 01 - on
|
||||
#define B_SET_TMP 35 //Установленная температура
|
||||
|
||||
#define S_LOCK S_ADDITIONAL+1
|
||||
#define S_QUIET S_ADDITIONAL+2
|
||||
#define S_SWING S_ADDITIONAL+3
|
||||
#define S_RAW S_ADDITIONAL+4
|
||||
|
||||
extern void modbusIdle(void) ;
|
||||
class out_AC : public abstractOut {
|
||||
public:
|
||||
|
||||
out_AC(Item * _item):abstractOut(_item){};
|
||||
int Setup() override;
|
||||
int Poll() override;
|
||||
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;
|
||||
|
||||
protected:
|
||||
void InsertData(byte data[], size_t size);
|
||||
};
|
||||
#endif
|
||||
97
lighthub/modules/out_spiled.cpp
Normal file
97
lighthub/modules/out_spiled.cpp
Normal file
@@ -0,0 +1,97 @@
|
||||
#ifndef SPILED_DISABLE
|
||||
|
||||
#include "modules/out_spiled.h"
|
||||
#include "Arduino.h"
|
||||
#include "options.h"
|
||||
#include "Streaming.h"
|
||||
#include "FastLED.h"
|
||||
#include "item.h"
|
||||
|
||||
#define NUM_LEDS 15
|
||||
#define DATA_PIN 4
|
||||
|
||||
static CRGB leds[NUM_LEDS];
|
||||
static int driverStatus = CST_UNKNOWN;
|
||||
|
||||
int out_SPILed::Setup()
|
||||
{
|
||||
Serial.println("SPI-LED Init");
|
||||
FastLED.addLeds<TM1809, DATA_PIN, BRG>(leds, NUM_LEDS);
|
||||
driverStatus = CST_INITIALIZED;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int out_SPILed::Stop()
|
||||
{
|
||||
Serial.println("SPI-LED De-Init");
|
||||
//FastLED.addLeds<TM1809, DATA_PIN, BRG>(leds, NUM_LEDS);
|
||||
FastLED.clear(true);
|
||||
driverStatus = CST_UNKNOWN;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int out_SPILed::Status()
|
||||
{
|
||||
return driverStatus;
|
||||
}
|
||||
|
||||
int out_SPILed::isActive()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
int out_SPILed::Poll()
|
||||
{
|
||||
//FastLED.show();
|
||||
return 1;
|
||||
};
|
||||
|
||||
int out_SPILed::Ctrl(short cmd, short n, int * Parameters, boolean send, int suffixCode, char* subItem)
|
||||
{
|
||||
int from=0, to=NUM_LEDS-1;
|
||||
|
||||
if (subItem)
|
||||
{ //Just single LED to control
|
||||
from=atoi(subItem);
|
||||
to=from;
|
||||
}
|
||||
debugSerial<<from<<F("-")<<to<<F(" cmd=")<<cmd<<endl;
|
||||
for (int i=from;i<=to;i++)
|
||||
{
|
||||
// debugSerial<<F(".");
|
||||
switch(cmd)
|
||||
{
|
||||
case CMD_ON:
|
||||
debugSerial<<F("Ch: ")<<i<<F(" White")<<endl;
|
||||
leds[i] = CRGB::White;
|
||||
break;
|
||||
case CMD_OFF:
|
||||
debugSerial<<F("Ch: ")<<i<<F(" Black")<<endl;
|
||||
leds[i] = CRGB::Black;
|
||||
break;
|
||||
case CMD_NUM:
|
||||
switch (suffixCode)
|
||||
{
|
||||
|
||||
// case S_POWER:
|
||||
// case S_VOL:
|
||||
//leds[n].setBrightness(Parameters[0]);
|
||||
// break;
|
||||
case S_SET:
|
||||
case S_HSV:
|
||||
debugSerial<<F("HSV: ")<<i<<F(" :")<<Parameters[0]<<Parameters[1]<<Parameters[2]<<endl;
|
||||
leds[i] = CHSV(Parameters[0],Parameters[1],Parameters[2]);
|
||||
break;
|
||||
case S_RGB:
|
||||
debugSerial<<F("RGB: ")<<i<<F(" :")<<Parameters[0]<<Parameters[1]<<Parameters[2]<<endl;
|
||||
leds[i] = CRGB(Parameters[0],Parameters[1],Parameters[2]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
FastLED.show();
|
||||
debugSerial<<F("Show ")<<endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
19
lighthub/modules/out_spiled.h
Normal file
19
lighthub/modules/out_spiled.h
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
#pragma once
|
||||
#ifndef SPILED_DISABLE
|
||||
#include <abstractout.h>
|
||||
|
||||
class out_SPILed : public abstractOut {
|
||||
public:
|
||||
|
||||
out_SPILed(Item * _item):abstractOut(_item){};
|
||||
int Setup() override;
|
||||
int Poll() override;
|
||||
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;
|
||||
|
||||
protected:
|
||||
};
|
||||
#endif
|
||||
1
lighthub/monitor.bat
Normal file
1
lighthub/monitor.bat
Normal file
@@ -0,0 +1 @@
|
||||
pio device monitor -b 115200
|
||||
@@ -18,7 +18,7 @@
|
||||
#define THERMO_OVERHEAT_CELSIUS 38.
|
||||
#define FM_OVERHEAT_CELSIUS 40.
|
||||
|
||||
#define MIN_VOLUME 10
|
||||
#define MIN_VOLUME 25
|
||||
#define INIT_VOLUME 50
|
||||
|
||||
#define MAXFLASHSTR 32
|
||||
@@ -135,8 +135,10 @@
|
||||
//All options available
|
||||
#ifdef CONTROLLINO
|
||||
#define modbusSerial Serial3
|
||||
#define AC_Serial Serial2
|
||||
#else
|
||||
#define modbusSerial Serial2
|
||||
#define AC_Serial Serial3
|
||||
#endif
|
||||
#define dmxin DMXSerial
|
||||
#define dmxout DmxSimple
|
||||
@@ -144,6 +146,7 @@
|
||||
|
||||
#if defined(__SAM3X8E__)
|
||||
#define modbusSerial Serial2
|
||||
#define AC_Serial Serial3
|
||||
#define dmxout DmxDue1
|
||||
#define dmxin DmxDue1
|
||||
#endif
|
||||
@@ -162,7 +165,9 @@
|
||||
#ifndef DMX_DISABLE
|
||||
#define _espdmx
|
||||
#endif
|
||||
|
||||
#define modbusSerial Serial1
|
||||
#define AC_Serial Serial1
|
||||
#endif
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP32)
|
||||
|
||||
82
lighthub/textconst.h
Normal file
82
lighthub/textconst.h
Normal file
@@ -0,0 +1,82 @@
|
||||
#pragma once
|
||||
|
||||
const char state_P[] PROGMEM = "$state";
|
||||
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 name_P[] PROGMEM = "$name";
|
||||
const char nameval_P[] PROGMEM = "LightHub ";
|
||||
|
||||
const char nodes_P[] PROGMEM = "$nodes";
|
||||
const char localip_P[] PROGMEM = "$localip";
|
||||
const char mac_P[] PROGMEM = "$mac";
|
||||
const char fwname_P[] PROGMEM = "$fw/name";
|
||||
const char fwversion_P[] PROGMEM = "$fw/version";
|
||||
const char implementation_P[] PROGMEM = "$implementation";
|
||||
const char interval_P[] PROGMEM = "$stats/interval";
|
||||
const char color_P[] PROGMEM = "color";
|
||||
|
||||
const char datatype_P[] PROGMEM = "$datatype";
|
||||
|
||||
const char float_P[] PROGMEM = "float";
|
||||
const char hsv_P[] PROGMEM = "hsv";
|
||||
const char int_P[] PROGMEM = "integer";
|
||||
const char enum_P[] PROGMEM = "enum";
|
||||
const char format_P[] PROGMEM = "$format";
|
||||
const char true_P[] PROGMEM = "true";
|
||||
const char false_P[] PROGMEM = "false";
|
||||
|
||||
const char enumformat_P[] PROGMEM = "ON,OFF,HALT,REST,XON,XOFF,TOGGLE";
|
||||
const char intformat_P[] PROGMEM = "0-100";
|
||||
|
||||
const char stats_P[] PROGMEM = "$stats";
|
||||
const char statsval_P[] PROGMEM = "uptime,freeheap";
|
||||
const char uptime_P[] PROGMEM = "uptime";
|
||||
const char freeheap_P[] PROGMEM = "freeheap";
|
||||
|
||||
|
||||
//Commands
|
||||
const char ON_P[] PROGMEM = "ON";
|
||||
const char OFF_P[] PROGMEM = "OFF";
|
||||
const char REST_P[] PROGMEM = "REST";
|
||||
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";
|
||||
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";
|
||||
const char MODE_P[] PROGMEM = "mode";
|
||||
const char FAN_P[] PROGMEM = "fan";
|
||||
/*
|
||||
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";
|
||||
/*
|
||||
const char RPM_P[] PROGMEM = "rpm";
|
||||
const char STATE_P[] PROGMEM = "state";
|
||||
*/
|
||||
@@ -377,7 +377,7 @@ void printIPAddress(IPAddress ipAddress) {
|
||||
}
|
||||
|
||||
|
||||
char* setTopic(char* buf, int8_t buflen, topicType tt, char* suffix)
|
||||
char* setTopic(char* buf, int8_t buflen, topicType tt, const char* suffix)
|
||||
{
|
||||
aJsonObject *_root = NULL;
|
||||
aJsonObject *_l2 = NULL;
|
||||
|
||||
@@ -55,7 +55,7 @@ void ReadUniqueID( uint32_t * pdwUniqueID );
|
||||
int inet_aton(const char* aIPAddrString, IPAddress& aResult);
|
||||
char *inet_ntoa_r(IPAddress addr, char *buf, int buflen);
|
||||
void printIPAddress(IPAddress ipAddress);
|
||||
char* setTopic(char* buf, int8_t buflen, topicType tt, char* suffix = NULL);
|
||||
char* setTopic(char* buf, int8_t buflen, topicType tt, const char* suffix = NULL);
|
||||
void printUlongValueToStr(char *valstr, unsigned long value);
|
||||
void scan_i2c_bus();
|
||||
void softRebootFunc();
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
#! /bin/bash
|
||||
echo /tmp/$1/pioenvs
|
||||
@@ -1,2 +0,0 @@
|
||||
#! /bin/bash
|
||||
echo /tmp/$1/piolibdeps
|
||||
@@ -11,7 +11,7 @@
|
||||
;home_dir = C:\platformio
|
||||
src_dir = lighthub
|
||||
;monitor_speed = 115200
|
||||
env_default =
|
||||
default_envs =
|
||||
; ****** UNCOMMENT single environment name for target platform below *******
|
||||
; Arduino Mega (without onewire) + Ethernet shield Wiznet 5100
|
||||
; mega2560slim-5100
|
||||
@@ -20,7 +20,7 @@ env_default =
|
||||
; mega2560-5100
|
||||
|
||||
; Arduino Mega + Ethernet shield Wiznet 5500
|
||||
mega2560-5500
|
||||
; mega2560-5500
|
||||
|
||||
; LightHub controller HW revision 2.1 and above (Wiznet 5500 CS on pin 53)
|
||||
; lighthub21
|
||||
@@ -29,7 +29,7 @@ env_default =
|
||||
; due-5100
|
||||
|
||||
; Arduino DUE + Ethernet shield Wiznet 5500
|
||||
; due-5500
|
||||
; due-5500
|
||||
|
||||
; ESP 8266
|
||||
; esp8266-wifi
|
||||
@@ -58,7 +58,7 @@ board = nrf52840_dk
|
||||
;upload_protocol = mbed
|
||||
;upload_port = /dev/cu.SLAB_USBtoUART
|
||||
framework = arduino
|
||||
build_flags = !bash check_custom_build_flags_nrf52840.sh
|
||||
build_flags = !python get_build_flags.py nrf52840-5500
|
||||
lib_ignore =
|
||||
ESP_EEPROM
|
||||
DmxSimple
|
||||
@@ -110,7 +110,7 @@ platform = espressif32
|
||||
board = m5stack-core-esp32
|
||||
framework = arduino
|
||||
upload_speed = 921600
|
||||
build_flags = !bash check_custom_build_flags_esp32.sh
|
||||
build_flags = !python get_build_flags.py m5stack
|
||||
lib_ignore =
|
||||
DmxSimple
|
||||
DMXSerial
|
||||
@@ -157,7 +157,7 @@ framework = arduino
|
||||
;board = pico32
|
||||
board = esp32-evb
|
||||
upload_speed = 115200
|
||||
build_flags = !bash check_custom_build_flags_esp32.sh
|
||||
build_flags = !python get_build_flags.py esp32-wifi
|
||||
lib_ignore =
|
||||
DmxSimple
|
||||
DMXSerial
|
||||
@@ -201,7 +201,7 @@ lib_deps =
|
||||
platform = atmelsam
|
||||
framework = arduino
|
||||
board = due
|
||||
build_flags = !bash check_custom_build_flags_due.sh
|
||||
build_flags = !python get_build_flags.py due-5100
|
||||
lib_ignore =
|
||||
DHT sensor library for ESPx
|
||||
ESP_EEPROM
|
||||
@@ -244,7 +244,7 @@ platform = atmelavr
|
||||
board = megaatmega2560
|
||||
;upload_port = net:192.168.88.31:23
|
||||
framework = arduino
|
||||
build_flags = !bash check_custom_build_flags_mega2560-slim.sh
|
||||
build_flags = !python get_build_flags.py mega2560slim-5100
|
||||
lib_ignore =
|
||||
DHT sensor library for ESPx
|
||||
DmxDue
|
||||
@@ -282,7 +282,7 @@ lib_deps =
|
||||
platform = atmelavr
|
||||
board = megaatmega2560
|
||||
framework = arduino
|
||||
build_flags = !bash check_custom_build_flags_mega2560-5500.sh
|
||||
build_flags = !python get_build_flags.py mega2560-5500
|
||||
lib_ignore =
|
||||
DHT sensor library for ESPx
|
||||
DmxDue
|
||||
@@ -321,7 +321,7 @@ lib_deps =
|
||||
platform = espressif8266
|
||||
framework = arduino
|
||||
board = nodemcuv2
|
||||
build_flags = !bash check_custom_build_flags_esp8266.sh
|
||||
build_flags = !python get_build_flags.py esp8266-wifi
|
||||
lib_ignore =
|
||||
DmxSimple
|
||||
DMXSerial
|
||||
@@ -367,7 +367,7 @@ platform = atmelavr
|
||||
board = megaatmega2560
|
||||
framework = arduino
|
||||
upload_port = net:192.168.88.2:23000
|
||||
build_flags = !bash check_custom_build_flags_mega2560.sh
|
||||
build_flags = !python get_build_flags.py mega2560-5100
|
||||
lib_ignore =
|
||||
DHT sensor library for ESPx
|
||||
DmxDue
|
||||
@@ -406,7 +406,8 @@ lib_deps =
|
||||
platform = atmelsam
|
||||
framework = arduino
|
||||
board = due
|
||||
build_flags = !bash check_custom_build_flags_due-5500.sh
|
||||
;build_flags = !bash check_custom_build_flags_due-5500.sh
|
||||
build_flags = !python get_build_flags.py due-5500
|
||||
lib_ignore =
|
||||
DHT sensor library for ESPx
|
||||
ESPDMX
|
||||
@@ -450,7 +451,7 @@ lib_deps =
|
||||
platform = atmelsam
|
||||
framework = arduino
|
||||
board = due
|
||||
build_flags = !bash check_custom_build_flags_lighthub21.sh
|
||||
build_flags = !python get_build_flags.py lighthub21
|
||||
lib_ignore =
|
||||
DHT sensor library for ESPx
|
||||
ESPDMX
|
||||
@@ -495,7 +496,7 @@ lib_deps =
|
||||
platform = atmelavr
|
||||
board = megaatmega2560
|
||||
framework = arduino
|
||||
build_flags = !bash check_custom_build_flags_controllino.sh
|
||||
build_flags = !python get_build_flags.py controllino
|
||||
lib_ignore =
|
||||
DHT sensor library for ESPx
|
||||
DmxDue
|
||||
@@ -537,7 +538,7 @@ framework = arduino
|
||||
board = nucleo_f103rb
|
||||
upload_protocol = stlink
|
||||
debug_tool = stlink
|
||||
build_flags = !bash check_custom_build_flags_stm32.sh
|
||||
build_flags = !python get_build_flags.py stm32-enc2860
|
||||
lib_ignore =
|
||||
DHT sensor library for ESPx
|
||||
DmxDue
|
||||
|
||||
0
mosquitto_examples.sh → spare_files/mosquitto_examples.sh
Normal file → Executable file
0
mosquitto_examples.sh → spare_files/mosquitto_examples.sh
Normal file → Executable file
Reference in New Issue
Block a user