mirror of
https://github.com/anklimov/lighthub
synced 2025-12-07 04:09:49 +03:00
Merge pull request #20 from livello/patch
Esp8266 basic support, dmx now can be disabled, experiments with build scripts
This commit is contained in:
@@ -148,6 +148,8 @@ platformio device monitor -b 115200
|
|||||||
* AVR_DMXOUT_PIN=18 // Set Pin for DMXOUT on megaatmega2560
|
* 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
|
* LAN_INIT_DELAY=2000 // set lan init delay for Wiznet ethernet shield
|
||||||
|
* ESP_WIFI_AP=MYAP // esp wifi access point name
|
||||||
|
* ESP_WIFI_PWD=MYPWD // esp wifi access point password
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,8 @@
|
|||||||
export FLAGS="$FLAGS -DAVR_DMXOUT_PIN=18"
|
export FLAGS="$FLAGS -DAVR_DMXOUT_PIN=18"
|
||||||
export FLAGS="$FLAGS -DLAN_INIT_DELAY=2000"
|
export FLAGS="$FLAGS -DLAN_INIT_DELAY=2000"
|
||||||
export FLAGS="$FLAGS -DCONTROLLINO"
|
export FLAGS="$FLAGS -DCONTROLLINO"
|
||||||
|
export FLAGS="$FLAGS -DESP_WIFI_AP=MYAP"
|
||||||
|
export FLAGS="$FLAGS -DESP_WIFI_PWD=MYPWD"
|
||||||
export PLATFORMIO_BUILD_FLAGS="$FLAGS"
|
export PLATFORMIO_BUILD_FLAGS="$FLAGS"
|
||||||
echo PLATFORMIO_BUILD_FLAGS=$PLATFORMIO_BUILD_FLAGS
|
echo PLATFORMIO_BUILD_FLAGS=$PLATFORMIO_BUILD_FLAGS
|
||||||
echo "==============================================Custom build flags END====================================================="
|
echo "==============================================Custom build flags END====================================================="
|
||||||
|
|||||||
@@ -29,8 +29,10 @@ e-mail anklimov@gmail.com
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__ESP__)
|
#if defined(__ESP__)
|
||||||
|
#ifndef DMX_DISABLE
|
||||||
DMXESPSerial dmxout;
|
DMXESPSerial dmxout;
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
uint8_t * DMXin = NULL;
|
uint8_t * DMXin = NULL;
|
||||||
int D_State=0;
|
int D_State=0;
|
||||||
|
|||||||
@@ -753,8 +753,11 @@ void Item::mb_fail(short addr, short op, int val, int cmd) {
|
|||||||
setVal(val);
|
setVal(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef MODBUS_DISABLE
|
||||||
extern ModbusMaster node;
|
extern ModbusMaster node;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int Item::VacomSetFan(int8_t val, int8_t cmd) {
|
int Item::VacomSetFan(int8_t val, int8_t cmd) {
|
||||||
int addr = getArg();
|
int addr = getArg();
|
||||||
Serial.print(F("VC#"));
|
Serial.print(F("VC#"));
|
||||||
@@ -823,63 +826,6 @@ int Item::VacomSetHeat(int addr, int8_t val, int8_t cmd) {
|
|||||||
modbusBusy = 0;
|
modbusBusy = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int Item::SendStatus(short cmd, short n, int *Par, boolean deffered) {
|
|
||||||
|
|
||||||
/// ToDo: relative patches, configuration
|
|
||||||
|
|
||||||
if (deffered) {
|
|
||||||
setCmd(cmd | CMD_REPORT);
|
|
||||||
Serial.println(F("Status deffered"));
|
|
||||||
// mqttClient.publish("/push", "1");
|
|
||||||
return 0;
|
|
||||||
// Todo: Parameters? Now expected that parameters already stored by setVal()
|
|
||||||
}
|
|
||||||
else { //publush to MQTT
|
|
||||||
char addrstr[32];
|
|
||||||
//char addrbuf[17];
|
|
||||||
char valstr[16] = "";
|
|
||||||
|
|
||||||
strcpy_P(addrstr, outprefix);
|
|
||||||
strncat(addrstr, itemArr->name, sizeof(addrstr));
|
|
||||||
|
|
||||||
|
|
||||||
switch (cmd) {
|
|
||||||
case CMD_ON:
|
|
||||||
strcpy(valstr, "ON");
|
|
||||||
break;
|
|
||||||
case CMD_OFF:
|
|
||||||
case CMD_HALT:
|
|
||||||
strcpy(valstr, "OFF");
|
|
||||||
break;
|
|
||||||
// TODO send Par
|
|
||||||
case 0:
|
|
||||||
case CMD_SET:
|
|
||||||
if (Par)
|
|
||||||
for (short i = 0; i < n; i++) {
|
|
||||||
char num[4];
|
|
||||||
snprintf(num, sizeof(num), "%d", Par[i]);
|
|
||||||
strncat(valstr, num, sizeof(valstr));
|
|
||||||
if (i != n - 1) {
|
|
||||||
strcpy(num, ",");
|
|
||||||
strncat(valstr, num, sizeof(valstr));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Serial.println(F("Unknown cmd "));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
Serial.print(F("Pub: "));
|
|
||||||
Serial.print(addrstr);
|
|
||||||
Serial.print(F("->"));
|
|
||||||
Serial.println(valstr);
|
|
||||||
mqttClient.publish(addrstr, valstr,true);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int Item::modbusDimmerSet(int addr, uint16_t _reg, int _mask, uint16_t value) {
|
int Item::modbusDimmerSet(int addr, uint16_t _reg, int _mask, uint16_t value) {
|
||||||
|
|
||||||
if (modbusBusy) {
|
if (modbusBusy) {
|
||||||
@@ -913,7 +859,6 @@ int Item::modbusDimmerSet(int addr, uint16_t _reg, int _mask, uint16_t value) {
|
|||||||
modbusBusy = 0;
|
modbusBusy = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int Item::checkFM() {
|
int Item::checkFM() {
|
||||||
if (modbusBusy) return -1;
|
if (modbusBusy) return -1;
|
||||||
if (checkModbusRetry()) return -2;
|
if (checkModbusRetry()) return -2;
|
||||||
@@ -1175,3 +1120,59 @@ void Item::sendDelayedStatus(){
|
|||||||
setCmd(cmd);
|
setCmd(cmd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
int Item::SendStatus(short cmd, short n, int *Par, boolean deffered) {
|
||||||
|
|
||||||
|
/// ToDo: relative patches, configuration
|
||||||
|
|
||||||
|
if (deffered) {
|
||||||
|
setCmd(cmd | CMD_REPORT);
|
||||||
|
Serial.println(F("Status deffered"));
|
||||||
|
// mqttClient.publish("/push", "1");
|
||||||
|
return 0;
|
||||||
|
// Todo: Parameters? Now expected that parameters already stored by setVal()
|
||||||
|
}
|
||||||
|
else { //publush to MQTT
|
||||||
|
char addrstr[32];
|
||||||
|
//char addrbuf[17];
|
||||||
|
char valstr[16] = "";
|
||||||
|
|
||||||
|
strcpy_P(addrstr, outprefix);
|
||||||
|
strncat(addrstr, itemArr->name, sizeof(addrstr));
|
||||||
|
|
||||||
|
|
||||||
|
switch (cmd) {
|
||||||
|
case CMD_ON:
|
||||||
|
strcpy(valstr, "ON");
|
||||||
|
break;
|
||||||
|
case CMD_OFF:
|
||||||
|
case CMD_HALT:
|
||||||
|
strcpy(valstr, "OFF");
|
||||||
|
break;
|
||||||
|
// TODO send Par
|
||||||
|
case 0:
|
||||||
|
case CMD_SET:
|
||||||
|
if (Par)
|
||||||
|
for (short i = 0; i < n; i++) {
|
||||||
|
char num[4];
|
||||||
|
snprintf(num, sizeof(num), "%d", Par[i]);
|
||||||
|
strncat(valstr, num, sizeof(valstr));
|
||||||
|
if (i != n - 1) {
|
||||||
|
strcpy(num, ",");
|
||||||
|
strncat(valstr, num, sizeof(valstr));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Serial.println(F("Unknown cmd "));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
Serial.print(F("Pub: "));
|
||||||
|
Serial.print(addrstr);
|
||||||
|
Serial.print(F("->"));
|
||||||
|
Serial.println(valstr);
|
||||||
|
mqttClient.publish(addrstr, valstr,true);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ aJsonObject *mqttArr = NULL;
|
|||||||
aJsonObject *modbusArr = NULL;
|
aJsonObject *modbusArr = NULL;
|
||||||
aJsonObject *owArr = NULL;
|
aJsonObject *owArr = NULL;
|
||||||
aJsonObject *dmxArr = NULL;
|
aJsonObject *dmxArr = NULL;
|
||||||
|
aJsonObject *dhtArr = NULL;
|
||||||
|
|
||||||
unsigned long nextPollingCheck = 0;
|
unsigned long nextPollingCheck = 0;
|
||||||
unsigned long nextInputCheck = 0;
|
unsigned long nextInputCheck = 0;
|
||||||
@@ -212,9 +213,13 @@ int lanLoop() {
|
|||||||
case 0: //Ethernet.begin(mac,ip);
|
case 0: //Ethernet.begin(mac,ip);
|
||||||
{
|
{
|
||||||
#ifdef __ESP__
|
#ifdef __ESP__
|
||||||
//WiFi.mode(WIFI_STA);
|
WiFi.mode(WIFI_STA);
|
||||||
//wifiMulti.addAP("Smartbox", "");
|
Serial.print(F("WIFI AP/Password:"));
|
||||||
if((wifiMulti.run() == WL_CONNECTED)) lanStatus=1;
|
Serial.print(QUOTE(ESP_WIFI_AP));
|
||||||
|
Serial.print(F("/"));
|
||||||
|
Serial.println(QUOTE(ESP_WIFI_PWD));
|
||||||
|
wifiMulti.addAP(QUOTE(ESP_WIFI_AP), QUOTE(ESP_WIFI_PWD));
|
||||||
|
if((wifiMulti.run() == WL_CONNECTED)) lanStatus=1;
|
||||||
#else
|
#else
|
||||||
IPAddress ip;
|
IPAddress ip;
|
||||||
IPAddress dns;
|
IPAddress dns;
|
||||||
@@ -533,15 +538,18 @@ void cmdFunctionKill(int arg_cnt, char **args) {
|
|||||||
|
|
||||||
void applyConfig() {
|
void applyConfig() {
|
||||||
if (!root) return;
|
if (!root) return;
|
||||||
#ifdef _dmxin
|
#ifdef DHT_ENABLE
|
||||||
int itemsCount;
|
dhtArr = aJson.getObjectItem(root, "dht");
|
||||||
dmxArr = aJson.getObjectItem(root, "dmxin");
|
#endif
|
||||||
if (dmxArr && (itemsCount = aJson.getArraySize(dmxArr))) {
|
#ifdef _dmxin
|
||||||
DMXinSetup(itemsCount * 4);
|
int itemsCount;
|
||||||
Serial.print(F("DMX in started. Channels:"));
|
dmxArr = aJson.getObjectItem(root, "dmxin");
|
||||||
Serial.println(itemsCount * 4);
|
if (dmxArr && (itemsCount = aJson.getArraySize(dmxArr))) {
|
||||||
}
|
DMXinSetup(itemsCount * 4);
|
||||||
#endif
|
Serial.print(F("DMX in started. Channels:"));
|
||||||
|
Serial.println(itemsCount * 4);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#ifdef _dmxout
|
#ifdef _dmxout
|
||||||
int maxChannels;
|
int maxChannels;
|
||||||
aJsonObject *dmxoutArr = aJson.getObjectItem(root, "dmx");
|
aJsonObject *dmxoutArr = aJson.getObjectItem(root, "dmx");
|
||||||
@@ -558,9 +566,6 @@ void applyConfig() {
|
|||||||
|
|
||||||
#ifdef _owire
|
#ifdef _owire
|
||||||
owArr = aJson.getObjectItem(root, "ow");
|
owArr = aJson.getObjectItem(root, "ow");
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _owire
|
|
||||||
if (owArr && !owReady) {
|
if (owArr && !owReady) {
|
||||||
aJsonObject *item = owArr->child;
|
aJsonObject *item = owArr->child;
|
||||||
owReady = owSetup(&Changed);
|
owReady = owSetup(&Changed);
|
||||||
@@ -625,6 +630,8 @@ void printConfigSummary() {
|
|||||||
printBool(mqttArr);
|
printBool(mqttArr);
|
||||||
Serial.print(F("1-wire "));
|
Serial.print(F("1-wire "));
|
||||||
printBool(owArr);
|
printBool(owArr);
|
||||||
|
Serial.print(F("dht "));
|
||||||
|
printBool(dhtArr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmdFunctionLoad(int arg_cnt, char **args) {
|
void cmdFunctionLoad(int arg_cnt, char **args) {
|
||||||
@@ -800,10 +807,7 @@ return 0;
|
|||||||
}
|
}
|
||||||
|
|
||||||
int getConfig(int arg_cnt, char **args)
|
int getConfig(int arg_cnt, char **args)
|
||||||
//(char *tokens)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
int responseStatusCode = 0;
|
int responseStatusCode = 0;
|
||||||
char ch;
|
char ch;
|
||||||
char URI[40];
|
char URI[40];
|
||||||
@@ -870,9 +874,8 @@ int getConfig(int arg_cnt, char **args)
|
|||||||
lanCheck = millis() + 5000;
|
lanCheck = millis() + 5000;
|
||||||
return -11;
|
return -11;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#else
|
#if defined(__SAM3X8E__)
|
||||||
//Non AVR code
|
|
||||||
String response;
|
String response;
|
||||||
EthernetClient configEthClient;
|
EthernetClient configEthClient;
|
||||||
HttpClient htclient = HttpClient(configEthClient, configServer, 80);
|
HttpClient htclient = HttpClient(configEthClient, configServer, 80);
|
||||||
@@ -918,9 +921,39 @@ int getConfig(int arg_cnt, char **args)
|
|||||||
//lanCheck=millis()+15000;
|
//lanCheck=millis()+15000;
|
||||||
return -11; //Load from NVRAM
|
return -11; //Load from NVRAM
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(__ESP__)
|
||||||
|
HTTPClient httpClient;
|
||||||
|
String fullURI = "http://";
|
||||||
|
fullURI+=configServer;
|
||||||
|
fullURI+=URI;
|
||||||
|
httpClient.begin(fullURI);
|
||||||
|
int httpResponseCode = httpClient.GET();
|
||||||
|
if (httpResponseCode > 0) {
|
||||||
|
// HTTP header has been send and Server response header has been handled
|
||||||
|
Serial.printf("[HTTP] GET... code: %d\n", httpResponseCode);
|
||||||
|
// file found at server
|
||||||
|
if (httpResponseCode == HTTP_CODE_OK) {
|
||||||
|
String response = httpClient.getString();
|
||||||
|
Serial.println(response);
|
||||||
|
aJson.deleteItem(root);
|
||||||
|
root = aJson.parse((char *) response.c_str());
|
||||||
|
if (!root) {
|
||||||
|
Serial.println(F("Config parsing failed"));
|
||||||
|
return -11; //Load from NVRAM
|
||||||
|
} else {
|
||||||
|
Serial.println(F("Config OK, Applying"));
|
||||||
|
applyConfig();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Serial.printf("[HTTP] GET... failed, error: %s\n", httpClient.errorToString(httpResponseCode).c_str());
|
||||||
|
httpClient.end();
|
||||||
|
return -11; //Load from NVRAM
|
||||||
|
}
|
||||||
|
httpClient.end();
|
||||||
|
#endif
|
||||||
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1109,7 +1142,9 @@ void loop_main() {
|
|||||||
// if (lastpacket && (lastpacket%10==0)) Serial.println(lastpacket);
|
// if (lastpacket && (lastpacket%10==0)) Serial.println(lastpacket);
|
||||||
|
|
||||||
if (items) {
|
if (items) {
|
||||||
|
#ifndef MODBUS_DISABLE
|
||||||
if (lanStatus != 4) pollingLoop();
|
if (lanStatus != 4) pollingLoop();
|
||||||
|
#endif
|
||||||
#ifdef _owire
|
#ifdef _owire
|
||||||
thermoLoop();
|
thermoLoop();
|
||||||
#endif
|
#endif
|
||||||
@@ -1183,6 +1218,7 @@ void inputLoop(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef MODBUS_DISABLE
|
||||||
void pollingLoop(void) {
|
void pollingLoop(void) {
|
||||||
boolean done = false;
|
boolean done = false;
|
||||||
if (millis() > nextPollingCheck) {
|
if (millis() > nextPollingCheck) {
|
||||||
@@ -1200,6 +1236,7 @@ void pollingLoop(void) {
|
|||||||
} //while
|
} //while
|
||||||
}//if
|
}//if
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//TODO: refactoring
|
//TODO: refactoring
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
#include <FS.h> //this needs to be first, or it all crashes and burns...
|
#include <FS.h> //this needs to be first, or it all crashes and burns...
|
||||||
#include "esp.h"
|
#include "esp.h"
|
||||||
#include <EEPROM.h>
|
#include <EEPROM.h>
|
||||||
#include <ArduinoHttpClient.h>
|
#include <ESP8266HTTPClient.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _owire
|
#ifdef _owire
|
||||||
|
|||||||
@@ -115,10 +115,20 @@
|
|||||||
#if defined(__ESP__)
|
#if defined(__ESP__)
|
||||||
#undef _dmxin
|
#undef _dmxin
|
||||||
#undef _modbus
|
#undef _modbus
|
||||||
|
#ifndef DMX_DISABLE
|
||||||
#define _espdmx
|
#define _espdmx
|
||||||
|
#endif
|
||||||
#define modbusSerial Serial1
|
#define modbusSerial Serial1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _dmxout
|
#ifndef _dmxout
|
||||||
#undef _artnet
|
#undef _artnet
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef ESP_WIFI_AP
|
||||||
|
#define ESP_WIFI_AP mywifiap
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef ESP_WIFI_PWD
|
||||||
|
#define ESP_WIFI_PWD mywifipass
|
||||||
|
#endif
|
||||||
32
my_build_flags.py
Normal file
32
my_build_flags.py
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# from time import time
|
||||||
|
#
|
||||||
|
# from SCons.Script import DefaultEnvironment
|
||||||
|
#
|
||||||
|
# print("==============================================Custom build flags are:=====================================================")
|
||||||
|
# #FLAGS="-MY_CONFIG_SERVER=192.168.10.110"
|
||||||
|
# #FLAGS+=" -WATCH_DOG_TICKER_DISABLE"
|
||||||
|
# #FLAGS+=" -USE_1W_PIN=12"
|
||||||
|
# #FLAGS+=" -SD_CARD_INSERTED"
|
||||||
|
# #FLAGS+=" -SERIAL_BAUD=115200"
|
||||||
|
# #FLAGS+=" -Wiz5500"
|
||||||
|
# #FLAGS+=" -DISABLE_FREERAM_PRINT"
|
||||||
|
# #FLAGS+=" -CUSTOM_FIRMWARE_MAC=C4:3E:1f:03:1B:1B"
|
||||||
|
# #FLAGS+=" -DMX_DISABLE"
|
||||||
|
# FLAGS="MODBUS_DISABLE"
|
||||||
|
# #FLAGS+=" -OWIRE_DISABLE"
|
||||||
|
# #FLAGS+=" -ARTNET_ENABLE"
|
||||||
|
# #FLAGS+=" -CONTROLLINO"
|
||||||
|
# #FLAGS+=" -AVR_DMXOUT_PIN=18"
|
||||||
|
#
|
||||||
|
# print(FLAGS)
|
||||||
|
# print("==============================================Custom build flags END=====================================================")
|
||||||
|
#
|
||||||
|
# env = DefaultEnvironment()
|
||||||
|
# env.Append(CPPDEFINES=['MODBUS_DISABLE=1'])
|
||||||
|
|
||||||
|
from time import time
|
||||||
|
|
||||||
|
from SCons.Script import DefaultEnvironment
|
||||||
|
|
||||||
|
env = DefaultEnvironment()
|
||||||
|
env.Append(CPPDEFINES=['BUILD_TIMESTAMP=%d' % time()])
|
||||||
@@ -1,27 +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
|
|
||||||
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
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
; 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
|
|
||||||
247
platformio.ini
247
platformio.ini
@@ -10,35 +10,36 @@
|
|||||||
[platformio]
|
[platformio]
|
||||||
src_dir = lighthub
|
src_dir = lighthub
|
||||||
env_default =
|
env_default =
|
||||||
due-5500
|
; megaatmega2560
|
||||||
; controllino
|
; due
|
||||||
; megaatmega2560
|
; esp8266
|
||||||
; megaatmega2560-5500
|
megaatmega2560-5500
|
||||||
; due
|
; due-5500
|
||||||
; esp8266
|
; controllino
|
||||||
|
|
||||||
[env:due]
|
[env:due]
|
||||||
platform = atmelsam
|
platform = atmelsam
|
||||||
framework = arduino
|
framework = arduino
|
||||||
board = due
|
board = due
|
||||||
lib_ldf_mode = chain+
|
lib_ldf_mode = chain+
|
||||||
build_flags = !echo -n "-DPIO_SRC_REV="$(git rev-parse --short HEAD)
|
extra_scripts = pre:my_build_flags.py
|
||||||
|
build_flags = !echo -n "-DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
|
||||||
lib_deps =
|
lib_deps =
|
||||||
https://github.com/sebnil/DueFlashStorage
|
https://github.com/sebnil/DueFlashStorage
|
||||||
https://github.com/anklimov/Arduino-Temperature-Control-Library.git
|
https://github.com/anklimov/Arduino-Temperature-Control-Library.git
|
||||||
https://github.com/anklimov/DS2482_OneWire
|
https://github.com/anklimov/DS2482_OneWire
|
||||||
https://github.com/anklimov/DmxDue
|
https://github.com/anklimov/DmxDue
|
||||||
https://github.com/anklimov/ArduinoHttpClient
|
https://github.com/anklimov/ArduinoHttpClient
|
||||||
https://github.com/anklimov/aJson
|
https://github.com/anklimov/aJson
|
||||||
https://github.com/anklimov/CmdArduino
|
https://github.com/anklimov/CmdArduino
|
||||||
https://github.com/anklimov/ModbusMaster
|
https://github.com/anklimov/ModbusMaster
|
||||||
https://github.com/anklimov/Ethernet
|
https://github.com/anklimov/Ethernet
|
||||||
; https://github.com/PaulStoffregen/SPI.git
|
https://github.com/anklimov/Ethernet2
|
||||||
https://github.com/knolleary/pubsubclient.git
|
https://github.com/knolleary/pubsubclient.git
|
||||||
https://github.com/anklimov/Artnet.git
|
https://github.com/anklimov/Artnet.git
|
||||||
FastLED
|
FastLED
|
||||||
161
|
SD
|
||||||
322
|
SdFat
|
||||||
|
|
||||||
|
|
||||||
[env:megaatmega2560]
|
[env:megaatmega2560]
|
||||||
@@ -46,110 +47,116 @@ platform = atmelavr
|
|||||||
board = megaatmega2560
|
board = megaatmega2560
|
||||||
framework = arduino
|
framework = arduino
|
||||||
;lib_ldf_mode = chain+
|
;lib_ldf_mode = chain+
|
||||||
build_flags = !echo -n "-DPIO_SRC_REV="$(git rev-parse --short HEAD)
|
build_flags = !echo -n "-DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
|
||||||
lib_deps =
|
lib_deps =
|
||||||
https://github.com/anklimov/Arduino-Temperature-Control-Library.git
|
https://github.com/anklimov/Arduino-Temperature-Control-Library.git
|
||||||
https://github.com/anklimov/DS2482_OneWire
|
https://github.com/anklimov/DS2482_OneWire
|
||||||
https://github.com/anklimov/DmxSimple
|
https://github.com/anklimov/DmxSimple
|
||||||
https://github.com/anklimov/httpClient
|
https://github.com/anklimov/httpClient
|
||||||
https://github.com/anklimov/aJson
|
https://github.com/anklimov/aJson
|
||||||
https://github.com/anklimov/CmdArduino
|
https://github.com/anklimov/CmdArduino
|
||||||
https://github.com/anklimov/ModbusMaster
|
https://github.com/anklimov/ModbusMaster
|
||||||
https://github.com/anklimov/DMXSerial
|
https://github.com/anklimov/DMXSerial
|
||||||
https://github.com/anklimov/Ethernet
|
https://github.com/anklimov/Ethernet
|
||||||
https://github.com/PaulStoffregen/SPI.git
|
https://github.com/anklimov/Ethernet2
|
||||||
https://github.com/knolleary/pubsubclient.git
|
https://github.com/PaulStoffregen/SPI.git
|
||||||
https://github.com/anklimov/Artnet.git
|
https://github.com/knolleary/pubsubclient.git
|
||||||
FastLED
|
https://github.com/anklimov/Artnet.git
|
||||||
; 161
|
FastLED
|
||||||
; 322
|
EEPROM
|
||||||
|
|
||||||
[env:controllino]
|
|
||||||
platform = atmelavr
|
|
||||||
board = megaatmega2560
|
|
||||||
framework = arduino
|
|
||||||
build_flags = !echo -n "-DPIO_SRC_REV="$(git rev-parse --short HEAD)
|
|
||||||
build_flags = -D CONTROLLINO -D CUSTOM_FIRMWARE_MAC=de:ad:be:ef:fe:07
|
|
||||||
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/PaulStoffregen/SPI.git
|
|
||||||
https://github.com/knolleary/pubsubclient.git
|
|
||||||
https://github.com/anklimov/Artnet.git
|
|
||||||
FastLED
|
|
||||||
; 161
|
|
||||||
; 322
|
|
||||||
|
|
||||||
[env:due-5500]
|
|
||||||
platform = atmelsam
|
|
||||||
framework = arduino
|
|
||||||
board = due
|
|
||||||
lib_ldf_mode = chain+
|
|
||||||
build_flags = !echo -n "-DPIO_SRC_REV="$(git rev-parse --short HEAD)
|
|
||||||
build_flags = -D Wiz5500 -D ARTNET_ENABLE
|
|
||||||
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/Ethernet2
|
|
||||||
; https://github.com/PaulStoffregen/SPI.git
|
|
||||||
https://github.com/knolleary/pubsubclient.git
|
|
||||||
https://github.com/anklimov/Artnet.git
|
|
||||||
FastLED
|
|
||||||
; 161
|
|
||||||
; 322
|
|
||||||
|
|
||||||
[env:megaatmega2560-5500]
|
|
||||||
platform = atmelavr
|
|
||||||
board = megaatmega2560
|
|
||||||
framework = arduino
|
|
||||||
lib_ldf_mode = chain+
|
|
||||||
build_flags = !echo -n "-DPIO_SRC_REV="$(git rev-parse --short HEAD)
|
|
||||||
build_flags = -D Wiz5500 -D AVR_DMXOUT_PIN=18
|
|
||||||
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/Ethernet2
|
|
||||||
https://github.com/PaulStoffregen/SPI.git
|
|
||||||
https://github.com/knolleary/pubsubclient.git
|
|
||||||
https://github.com/anklimov/Artnet.git
|
|
||||||
FastLED
|
|
||||||
EEPROM
|
|
||||||
; 161
|
|
||||||
; 322
|
|
||||||
|
|
||||||
[env:esp8266]
|
[env:esp8266]
|
||||||
platform = espressif8266
|
platform = espressif8266
|
||||||
framework = arduino
|
framework = arduino
|
||||||
board = nodemcuv2
|
board = nodemcuv2
|
||||||
lib_ldf_mode = chain+
|
lib_ldf_mode = chain+
|
||||||
|
build_flags = !echo -n "-DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
|
||||||
|
;extra_scripts = pre:my_build_flags.py
|
||||||
lib_deps =
|
lib_deps =
|
||||||
https://github.com/anklimov/Arduino-Temperature-Control-Library.git
|
https://github.com/anklimov/Arduino-Temperature-Control-Library.git
|
||||||
https://github.com/anklimov/DS2482_OneWire
|
https://github.com/anklimov/DS2482_OneWire
|
||||||
https://github.com/anklimov/ESP-Dmx
|
https://github.com/anklimov/ESP-Dmx
|
||||||
https://github.com/arduino-libraries/ArduinoHttpClient
|
ESP8266HTTPClient
|
||||||
https://github.com/anklimov/aJson
|
https://github.com/anklimov/aJson
|
||||||
https://github.com/anklimov/CmdArduino
|
https://github.com/anklimov/CmdArduino
|
||||||
https://github.com/anklimov/ModbusMaster
|
https://github.com/anklimov/ModbusMaster
|
||||||
https://github.com/anklimov/DMXSerial
|
https://github.com/knolleary/pubsubclient.git
|
||||||
https://github.com/knolleary/pubsubclient.git
|
https://github.com/anklimov/Artnet.git
|
||||||
https://github.com/anklimov/Artnet.git
|
FastLED
|
||||||
FastLED
|
WifiManager
|
||||||
|
|
||||||
|
[env:megaatmega2560-5500]
|
||||||
|
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)
|
||||||
|
build_flags = -D Wiz5500 -D AVR_DMXOUT_PIN=18
|
||||||
|
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:due-5500]
|
||||||
|
platform = atmelsam
|
||||||
|
framework = arduino
|
||||||
|
board = due
|
||||||
|
lib_ldf_mode = chain+
|
||||||
|
extra_scripts = pre:my_build_flags.py
|
||||||
|
build_flags = !echo -n "-DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
|
||||||
|
build_flags = -D Wiz5500 -D ARTNET_ENABLE
|
||||||
|
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:controllino]
|
||||||
|
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)
|
||||||
|
build_flags = -D CONTROLLINO -D CUSTOM_FIRMWARE_MAC=de:ad:be:ef:fe:07
|
||||||
|
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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user