Fix after merging PR.(DUE and Mega)

This commit is contained in:
2018-10-13 23:03:59 +03:00
parent 87e7bcbd6a
commit 3038e41788
7 changed files with 112 additions and 14 deletions

31
build_flags_due-5500.sh Normal file
View File

@@ -0,0 +1,31 @@
#! /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:ff"
# 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 -DWITH_STREAMING_LIB"
export FLAGS="$FLAGS -DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
echo $FLAGS

View File

@@ -0,0 +1,31 @@
#! /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 -DWITH_STREAMING_LIB"
export FLAGS="$FLAGS -DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short)
echo $FLAGS

30
build_flags_mega2560.sh Normal file
View File

@@ -0,0 +1,30 @@
#! /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:ed"
# 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

View File

@@ -173,7 +173,7 @@ void mqttCallback(char *topic, byte *payload, unsigned int length) {
return;
}
for (int i = 0; i < length; i++)
for (int i = 0; i < length; i++)
debugSerial<<((char) payload[i]);
debugSerial<<endl;
@@ -368,7 +368,7 @@ void ip_ready_config_loaded_connecting_to_broker() {
udpSyslog.defaultPriority(LOG_KERN);
udpSyslog.log(LOG_INFO, F("UDP Syslog initialized!"));
debugSerial<<F("UDP Syslog initialized!");
}
}
#endif
if (!mqttClient.connected() && mqttArr && ((n = aJson.getArraySize(mqttArr)) > 1)) {
@@ -937,7 +937,7 @@ lan_status loadConfigFromHttp(int arg_cnt, char **args)
if (configStream != NULL) {
if (responseStatusCode == 200) {
debugSerial<<F("got Config"));
debugSerial<<F("got Config");
char c;
aJsonFileStream as = aJsonFileStream(configStream);
noInterrupts();
@@ -948,29 +948,29 @@ lan_status loadConfigFromHttp(int arg_cnt, char **args)
hclient.closeStream(configStream); // this is very important -- be sure to close the STREAM
if (!root) {
debugSerial<<F("Config parsing failed"));
debugSerial<<F("Config parsing failed");
nextLanCheckTime = millis() + 15000;
return READ_RE_CONFIG;//-11;
} else {
// char *outstr = aJson.print(root);
// debugSerial<<outstr);
// free(outstr);
debugSerial<<F("Applying."));
debugSerial<<F("Applying.");
applyConfig();
}
} else {
debugSerial<<F("ERROR: Server returned "));
debugSerial<<responseStatusCode);
debugSerial<<F("ERROR: Server returned ");
debugSerial<<responseStatusCode;
nextLanCheckTime = millis() + 5000;
return READ_RE_CONFIG;//-11;
}
} else {
debugSerial<<F("failed to connect"));
debugSerial<<F(" try again in 5 seconds"));
debugSerial<<F("failed to connect");
debugSerial<<F(" try again in 5 seconds");
nextLanCheckTime = millis() + 5000;
return READ_RE_CONFIG;//-11;
}

2
pioenvs.sh Executable file
View File

@@ -0,0 +1,2 @@
#! /bin/bash
echo /tmp/$1/pioenvs

2
piolibdeps.sh Executable file
View File

@@ -0,0 +1,2 @@
#! /bin/bash
echo /tmp/$1/piolibdeps

View File

@@ -13,15 +13,15 @@ env_default =
; megaatmega2560
; megaatmega2560-net
; due
esp8266
; esp8266
; esp32
; megaatmega2560-5500
; due-5500
due-5500
; controllino
; stm32
build_dir = /tmp/pioenvs
libdeps_dir = /tmp/piolibdeps
;build_dir = !sh pioenvs.sh ${platformio.env_default}
;libdeps_dir = !sh piolibdeps.sh ${platformio.env_default}
[env:esp32]
platform = espressif32
@@ -171,6 +171,8 @@ lib_deps =
FastLED
Adafruit Unified Sensor
DHT sensor library
https://github.com/arcao/Syslog.git
Streaming
[env:due-5500]
@@ -198,7 +200,7 @@ lib_deps =
Adafruit Unified Sensor
DHT sensor library
https://github.com/arcao/Syslog.git
; Streaming
Streaming
; PrintEx
https://github.com/livello/PrintEx.git#is-select-redecl