mirror of
https://github.com/anklimov/lighthub
synced 2025-12-06 11:49:51 +03:00
platformio.ini
This commit is contained in:
@@ -13,7 +13,7 @@ Lighthub allows connecting together:
|
|||||||
* Modbus RTU devices (Currently, are deployed two types of Modbus devices: AC Dimmer and Ventilation set (Based on [Vacon 10 controller](http://files.danfoss.com/download/Drives/Vacon-10-Quick-Guide-DPD00714F1-UK.pdf))
|
* Modbus RTU devices (Currently, are deployed two types of Modbus devices: AC Dimmer and Ventilation set (Based on [Vacon 10 controller](http://files.danfoss.com/download/Drives/Vacon-10-Quick-Guide-DPD00714F1-UK.pdf))
|
||||||
* Simple DMX wall sensor panel [like this](https://aliexpress.com/item/New-Ltech-D8-LED-rgb-RGBW-touch-panel-controller-DMX512-controller-DC12-24V-4-zones-4/32800199589.html)
|
* Simple DMX wall sensor panel [like this](https://aliexpress.com/item/New-Ltech-D8-LED-rgb-RGBW-touch-panel-controller-DMX512-controller-DC12-24V-4-zones-4/32800199589.html)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Where is possible both, to configure local control/mapping between inputs and outputs (light, floor heating thermostats) and remote control from MQTT enabled software. At the moment, LightHub tested with following set of complementary free software:
|
Where is possible both, to configure local control/mapping between inputs and outputs (light, floor heating thermostats) and remote control from MQTT enabled software. At the moment, LightHub tested with following set of complementary free software:
|
||||||
* [Openhab or Openhab2 Smarthome software](http://www.openhab.org/)
|
* [Openhab or Openhab2 Smarthome software](http://www.openhab.org/)
|
||||||
@@ -90,7 +90,9 @@ Prefered way to compile project is using platformio toolchain, suitable for Ardu
|
|||||||
|
|
||||||
# Due compilation issue "USART0_Handler redefinition"
|
# Due compilation issue "USART0_Handler redefinition"
|
||||||
Please, open /variants/arduino_due_x/variant.cpp file, then add USART0_Handler method definition like this
|
Please, open /variants/arduino_due_x/variant.cpp file, then add USART0_Handler method definition like this
|
||||||
|
```
|
||||||
void USART0_Handler(void) __attribute__((weak));
|
void USART0_Handler(void) __attribute__((weak));
|
||||||
|
```
|
||||||
|
|
||||||
The normal path to find this file in platformio is:
|
The normal path to find this file in platformio is:
|
||||||
.platformio/packages/framework-arduinosam/variants/arduino_due_x
|
.platformio/packages/framework-arduinosam/variants/arduino_due_x
|
||||||
@@ -114,7 +116,6 @@ cp build_flags_template.sh my_build_flags.sh
|
|||||||
```
|
```
|
||||||
then edit, change or comment unnecessary sections and source it
|
then edit, change or comment unnecessary sections and source it
|
||||||
```bash
|
```bash
|
||||||
nano my_build_flags.sh
|
|
||||||
source my_build_flags.sh
|
source my_build_flags.sh
|
||||||
```
|
```
|
||||||
build and upload firmware for due|megaatmega2560|esp8266 board
|
build and upload firmware for due|megaatmega2560|esp8266 board
|
||||||
@@ -144,7 +145,10 @@ platformio device monitor -b 115200
|
|||||||
* MODBUS_DISABLE // disable Modbus support
|
* MODBUS_DISABLE // disable Modbus support
|
||||||
* OWIRE_DISABLE // disable OneWire support
|
* OWIRE_DISABLE // disable OneWire support
|
||||||
* ARTNET_ENABLE //Enable Artnet protocol support
|
* ARTNET_ENABLE //Enable Artnet protocol support
|
||||||
|
* AVR_DMXOUT_PIN=18 // Set Pin for DMXOUT on megaatmega2560
|
||||||
* CONTROLLINO //Change Modbus port, direction pins and Wiznet SS pins to be working on [Controllino](http://controllino.biz/)
|
* CONTROLLINO //Change Modbus port, direction pins and Wiznet SS pins to be working on [Controllino](http://controllino.biz/)
|
||||||
|
* LAN_INIT_DELAY=2000 // set lan init delay for Wiznet ethernet shield
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Default compilation behavior:
|
# Default compilation behavior:
|
||||||
@@ -160,6 +164,7 @@ platformio device monitor -b 115200
|
|||||||
* Modbus support enabled
|
* Modbus support enabled
|
||||||
* OneWire support enabled
|
* OneWire support enabled
|
||||||
* Artnet disabled
|
* Artnet disabled
|
||||||
|
* LAN_INIT_DELAY=500 //ms
|
||||||
* Defailt MQTT input topic: /myhome/in
|
* Defailt MQTT input topic: /myhome/in
|
||||||
* Default MQTT topic to publish device status: /myhome/s_out
|
* Default MQTT topic to publish device status: /myhome/s_out
|
||||||
* Default Alarm output topic /alarm
|
* Default Alarm output topic /alarm
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
# nano my_build_flags.sh
|
# nano my_build_flags.sh
|
||||||
# and source it
|
# and source it
|
||||||
# source my_build_flags.sh
|
# source my_build_flags.sh
|
||||||
|
echo "==============================================Custom build flags are:====================================================="
|
||||||
export FLAGS="-DMY_CONFIG_SERVER=lazyhome.ru"
|
export FLAGS="-DMY_CONFIG_SERVER=lazyhome.ru"
|
||||||
export FLAGS="$FLAGS -DWATCH_DOG_TICKER_DISABLE"
|
export FLAGS="$FLAGS -DWATCH_DOG_TICKER_DISABLE"
|
||||||
export FLAGS="$FLAGS -DUSE_1W_PIN=12"
|
export FLAGS="$FLAGS -DUSE_1W_PIN=12"
|
||||||
@@ -17,5 +18,10 @@
|
|||||||
export FLAGS="$FLAGS -DDMX_DISABLE"
|
export FLAGS="$FLAGS -DDMX_DISABLE"
|
||||||
export FLAGS="$FLAGS -DMODBUS_DISABLE"
|
export FLAGS="$FLAGS -DMODBUS_DISABLE"
|
||||||
export FLAGS="$FLAGS -DOWIRE_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 PLATFORMIO_BUILD_FLAGS="$FLAGS"
|
export PLATFORMIO_BUILD_FLAGS="$FLAGS"
|
||||||
|
echo PLATFORMIO_BUILD_FLAGS=$PLATFORMIO_BUILD_FLAGS
|
||||||
|
echo "==============================================Custom build flags END====================================================="
|
||||||
unset FLAGS
|
unset FLAGS
|
||||||
29
config/c4-3e-11-03-1b-1e.config.json
Normal file
29
config/c4-3e-11-03-1b-1e.config.json
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"mqtt":["garden","192.168.10.115",1883,"test","test"],
|
||||||
|
"ow":{
|
||||||
|
"28FFADCE601705A3":{"emit":"t_soil1","item":"h_relay6"},
|
||||||
|
"286164123FF96F55":{"emit":"t_soil2"},
|
||||||
|
"28FFEF6D60170335":{"emit":"t_soil3"}
|
||||||
|
},
|
||||||
|
"items":{
|
||||||
|
"h_relay1":[6,39,1,1],
|
||||||
|
"h_relay2":[6,38,1,1],
|
||||||
|
"h_relay3":[6,37,1,1],
|
||||||
|
"h_relay4":[6,36,1,1],
|
||||||
|
"h_relay5":[6,35,1,1],
|
||||||
|
"h_relay6":[5,34,23],
|
||||||
|
"h_relay7":[6,33,1,1],
|
||||||
|
"h_relay8":[6,32,1,1],
|
||||||
|
"h_auto":[6,29,1,1]
|
||||||
|
},
|
||||||
|
"in":{
|
||||||
|
"40":{"emit":"/garden/s_in/1"},
|
||||||
|
"41":{"emit":"/garden/s_in/2"},
|
||||||
|
"42":{"emit":"/garden/s_in/3"},
|
||||||
|
"43":{"emit":"/garden/s_in/4"},
|
||||||
|
"44":{"emit":"/garden/s_in/5"},
|
||||||
|
"45":{"emit":"/garden/s_in/6"},
|
||||||
|
"46":{"emit":"/garden/s_in/7"},
|
||||||
|
"47":{"emit":"/garden/s_in/8"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 178 KiB After Width: | Height: | Size: 178 KiB |
@@ -297,7 +297,8 @@ if((wifiMulti.run() == WL_CONNECTED)) lanStatus=1;
|
|||||||
|
|
||||||
|
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
Serial.println(F("Failed to configure Ethernet using DHCP"));
|
Serial.println(F("Failed to configure Ethernet using DHCP. You can set ip manually!"));
|
||||||
|
Serial.print(F("'ip [ip[,dns[,gw[,subnet]]]]' - set static IP\n"));
|
||||||
lanStatus = -10;
|
lanStatus = -10;
|
||||||
lanCheck = millis() + 60000;
|
lanCheck = millis() + 60000;
|
||||||
} else {
|
} else {
|
||||||
@@ -577,7 +578,8 @@ void cmdFunctionHelp(int arg_cnt, char **args)
|
|||||||
"'get' [config addr]' - get config from pre-configured URL and store addr\n"
|
"'get' [config addr]' - get config from pre-configured URL and store addr\n"
|
||||||
"'load' - load config from NVRAM\n"
|
"'load' - load config from NVRAM\n"
|
||||||
"'pwd' - define MQTT password\n"
|
"'pwd' - define MQTT password\n"
|
||||||
"'kill' - test watchdog"));
|
"'kill' - test watchdog\n"
|
||||||
|
"'clear' - clear EEPROM"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmdFunctionKill(int arg_cnt, char **args) {
|
void cmdFunctionKill(int arg_cnt, char **args) {
|
||||||
@@ -783,6 +785,13 @@ void cmdFunctionIp(int arg_cnt, char **args)
|
|||||||
Serial.println(F("Saved"));
|
Serial.println(F("Saved"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cmdFunctionClearEEPROM(int arg_cnt, char **args){
|
||||||
|
for (int i = 0; i < 512; i++)
|
||||||
|
EEPROM.write(i, 0);
|
||||||
|
Serial.println(F("EEPROM cleared"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void cmdFunctionPwd(int arg_cnt, char **args)
|
void cmdFunctionPwd(int arg_cnt, char **args)
|
||||||
//(char* tokens)
|
//(char* tokens)
|
||||||
{ char empty[]="";
|
{ char empty[]="";
|
||||||
@@ -990,7 +999,6 @@ void postTransmission() {
|
|||||||
digitalWrite(TXEnablePin, 0);
|
digitalWrite(TXEnablePin, 0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
//#define PIO_SRC_REV commit 8034a6b765229d94a94d90fd08dd9588acf5f3da Author: livello <livello@bk.ru> Date: Wed Mar 28 02:35:50 2018 +0300 refactoring
|
|
||||||
|
|
||||||
void setup_main() {
|
void setup_main() {
|
||||||
setupCmdArduino();
|
setupCmdArduino();
|
||||||
@@ -1005,7 +1013,6 @@ void setup_main() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
setupMacAddress();
|
setupMacAddress();
|
||||||
|
|
||||||
loadConfigFromEEPROM(0, NULL);
|
loadConfigFromEEPROM(0, NULL);
|
||||||
|
|
||||||
#ifdef _modbus
|
#ifdef _modbus
|
||||||
@@ -1019,7 +1026,6 @@ pinMode(TXEnablePin, OUTPUT);
|
|||||||
#endif
|
#endif
|
||||||
modbusSerial.begin(MODBUS_SERIAL_BAUD);
|
modbusSerial.begin(MODBUS_SERIAL_BAUD);
|
||||||
node.idle(&modbusIdle);
|
node.idle(&modbusIdle);
|
||||||
// Callbacks allow us to configure the RS485 transceiver correctly
|
|
||||||
node.preTransmission(preTransmission);
|
node.preTransmission(preTransmission);
|
||||||
node.postTransmission(postTransmission);
|
node.postTransmission(postTransmission);
|
||||||
#endif
|
#endif
|
||||||
@@ -1040,13 +1046,16 @@ pinMode(TXEnablePin, OUTPUT);
|
|||||||
SPI.begin();
|
SPI.begin();
|
||||||
while (Ethernet.maintain() == NO_LINK && millis()<3000UL) {delay(500);Serial.print(F("."));}
|
while (Ethernet.maintain() == NO_LINK && millis()<3000UL) {delay(500);Serial.print(F("."));}
|
||||||
*/
|
*/
|
||||||
delay(500); //Wiz5500
|
delay(LAN_INIT_DELAY);//for LAN-shield initializing
|
||||||
//TODO: checkForRemoteSketchUpdate();
|
//TODO: checkForRemoteSketchUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void printFirmwareVersionAndBuildOptions() {
|
void printFirmwareVersionAndBuildOptions() {
|
||||||
Serial.print(F("\nLazyhome.ru LightHub controller "));
|
Serial.print(F("\nLazyhome.ru LightHub controller "));
|
||||||
Serial.println(F(QUOTE(PIO_SRC_REV)));
|
Serial.println(F(QUOTE(PIO_SRC_REV)));
|
||||||
|
#ifdef CONTROLLINO
|
||||||
|
Serial.println(F("(+)CONTROLLINO"));
|
||||||
|
#endif
|
||||||
#ifdef WATCH_DOG_TICKER_DISABLE
|
#ifdef WATCH_DOG_TICKER_DISABLE
|
||||||
Serial.println(F("(-)WATCHDOG"));
|
Serial.println(F("(-)WATCHDOG"));
|
||||||
#else
|
#else
|
||||||
@@ -1134,6 +1143,7 @@ void setupCmdArduino() {
|
|||||||
cmdAdd("req", cmdFunctionReq);
|
cmdAdd("req", cmdFunctionReq);
|
||||||
cmdAdd("ip", cmdFunctionIp);
|
cmdAdd("ip", cmdFunctionIp);
|
||||||
cmdAdd("pwd", cmdFunctionPwd);
|
cmdAdd("pwd", cmdFunctionPwd);
|
||||||
|
cmdAdd("clear",cmdFunctionClearEEPROM);
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop_main() {
|
void loop_main() {
|
||||||
|
|||||||
@@ -81,6 +81,10 @@
|
|||||||
#define _artnet
|
#define _artnet
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef LAN_INIT_DELAY
|
||||||
|
#define LAN_INIT_DELAY 500
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(ESP8266)
|
#if defined(ESP8266)
|
||||||
#define __ESP__
|
#define __ESP__
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
27
my_builds_flags.sh
Normal file
27
my_builds_flags.sh
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
#! /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
|
||||||
|
echo "==============================================Custom build flags are:====================================================="
|
||||||
|
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:00"
|
||||||
|
# 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=500"
|
||||||
|
# export FLAGS="$FLAGS -DCONTROLLINO"
|
||||||
|
export PLATFORMIO_BUILD_FLAGS="$FLAGS"
|
||||||
|
echo PLATFORMIO_BUILD_FLAGS=$PLATFORMIO_BUILD_FLAGS
|
||||||
|
echo "==============================================Custom build flags END====================================================="
|
||||||
|
unset FLAGS
|
||||||
89
platformio.bak
Normal file
89
platformio.bak
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
; PlatformIO Project Configuration File (for copy and paste)
|
||||||
|
;
|
||||||
|
; Build options: build flags, source filter
|
||||||
|
; Upload options: custom upload port, speed and extra flags
|
||||||
|
; Library options: dependencies, extra library storages
|
||||||
|
; Advanced options: extra scripting
|
||||||
|
;
|
||||||
|
; Please visit documentation for the other options and examples
|
||||||
|
; http://docs.platformio.org/page/projectconf.html
|
||||||
|
[platformio]
|
||||||
|
src_dir = lighthub
|
||||||
|
env_default =
|
||||||
|
<<<<<<< HEAD
|
||||||
|
due-5500
|
||||||
|
; controllino
|
||||||
|
; megaatmega2560
|
||||||
|
; megaatmega2560-5500
|
||||||
|
; due
|
||||||
|
=======
|
||||||
|
; megaatmega2560
|
||||||
|
due
|
||||||
|
>>>>>>> 2b56dcd8dd4e7b95e02c88bcbbbdec0a400a6dc4
|
||||||
|
; esp8266
|
||||||
|
[env:due]
|
||||||
|
platform = atmelsam
|
||||||
|
framework = arduino
|
||||||
|
board = due
|
||||||
|
lib_ldf_mode = chain+
|
||||||
|
build_flags = !echo -n "-DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
|
||||||
|
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
|
||||||
|
https://github.com/anklimov/ArduinoHttpClient
|
||||||
|
https://github.com/anklimov/aJson
|
||||||
|
https://github.com/anklimov/CmdArduino
|
||||||
|
https://github.com/anklimov/ModbusMaster
|
||||||
|
https://github.com/anklimov/Ethernet
|
||||||
|
https://github.com/anklimov/Ethernet2
|
||||||
|
https://github.com/knolleary/pubsubclient.git
|
||||||
|
https://github.com/anklimov/Artnet.git
|
||||||
|
FastLED
|
||||||
|
SD
|
||||||
|
SdFat
|
||||||
|
|
||||||
|
|
||||||
|
[env:megaatmega2560]
|
||||||
|
platform = atmelavr
|
||||||
|
board = megaatmega2560
|
||||||
|
framework = arduino
|
||||||
|
;lib_ldf_mode = chain+
|
||||||
|
build_flags = !echo -n "-DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
|
||||||
|
lib_deps =
|
||||||
|
https://github.com/anklimov/Arduino-Temperature-Control-Library.git
|
||||||
|
https://github.com/anklimov/DS2482_OneWire
|
||||||
|
https://github.com/anklimov/DmxSimple
|
||||||
|
https://github.com/anklimov/httpClient
|
||||||
|
https://github.com/anklimov/aJson
|
||||||
|
https://github.com/anklimov/CmdArduino
|
||||||
|
https://github.com/anklimov/ModbusMaster
|
||||||
|
https://github.com/anklimov/DMXSerial
|
||||||
|
https://github.com/anklimov/Ethernet
|
||||||
|
https://github.com/anklimov/Ethernet2
|
||||||
|
https://github.com/PaulStoffregen/SPI.git
|
||||||
|
https://github.com/knolleary/pubsubclient.git
|
||||||
|
https://github.com/anklimov/Artnet.git
|
||||||
|
FastLED
|
||||||
|
EEPROM
|
||||||
|
|
||||||
|
|
||||||
|
[env:esp8266]
|
||||||
|
platform = espressif8266
|
||||||
|
framework = arduino
|
||||||
|
board = nodemcuv2
|
||||||
|
lib_ldf_mode = chain+
|
||||||
|
build_flags = !echo -n "-DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
|
||||||
|
lib_deps =
|
||||||
|
https://github.com/anklimov/Arduino-Temperature-Control-Library.git
|
||||||
|
https://github.com/anklimov/DS2482_OneWire
|
||||||
|
https://github.com/anklimov/ESP-Dmx
|
||||||
|
https://github.com/arduino-libraries/ArduinoHttpClient
|
||||||
|
https://github.com/anklimov/aJson
|
||||||
|
https://github.com/anklimov/CmdArduino
|
||||||
|
https://github.com/anklimov/ModbusMaster
|
||||||
|
https://github.com/anklimov/DMXSerial
|
||||||
|
https://github.com/knolleary/pubsubclient.git
|
||||||
|
https://github.com/anklimov/Artnet.git
|
||||||
|
FastLED
|
||||||
Reference in New Issue
Block a user