diff --git a/README.md b/README.md index 7c245fa..8a48d22 100644 --- a/README.md +++ b/README.md @@ -143,8 +143,9 @@ platformio device monitor -b 115200 * MODBUS_DISABLE // disable Modbus support * OWIRE_DISABLE // disable OneWire support * ARTNET_ENABLE //Enable Artnet protocol support -* DAVR_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/) +* LAN_INIT_DELAY=2000 // set lan init delay for Wiznet ethernet shield @@ -161,6 +162,7 @@ platformio device monitor -b 115200 * Modbus support enabled * OneWire support enabled * Artnet disabled +* LAN_INIT_DELAY=0 * Defailt MQTT input topic: /myhome/in * Default MQTT topic to publish device status: /myhome/s_out * Default Alarm output topic /alarm diff --git a/build_flags_template.sh b/build_flags_template.sh index da7f737..27ed24f 100644 --- a/build_flags_template.sh +++ b/build_flags_template.sh @@ -6,7 +6,7 @@ # nano my_build_flags.sh # and source it # source my_build_flags.sh - echo "\n==============================================Custom build flags are:=====================================================\n" + 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" @@ -19,8 +19,9 @@ 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 PLATFORMIO_BUILD_FLAGS="$FLAGS" echo PLATFORMIO_BUILD_FLAGS=$PLATFORMIO_BUILD_FLAGS - echo "\n==============================================Custom build flags END=====================================================\n" + echo "==============================================Custom build flags END=====================================================" unset FLAGS \ No newline at end of file diff --git a/lighthub/main.cpp b/lighthub/main.cpp index 8aebf7f..b06883f 100644 --- a/lighthub/main.cpp +++ b/lighthub/main.cpp @@ -279,6 +279,7 @@ if((wifiMulti.run() == WL_CONNECTED)) lanStatus=1; IPAddress gw; IPAddress mask; int res = 1; + delay(LAN_INIT_DELAY);//for LAN-shield initializing Serial.println(F("Starting lan")); if (loadFlash(OFFSET_IP,ip)) if (loadFlash(OFFSET_DNS,dns)) @@ -297,7 +298,8 @@ if((wifiMulti.run() == WL_CONNECTED)) lanStatus=1; 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; lanCheck = millis() + 60000; } else { diff --git a/lighthub/options.h b/lighthub/options.h index c65fb9c..b031e9e 100644 --- a/lighthub/options.h +++ b/lighthub/options.h @@ -81,6 +81,10 @@ #define _artnet #endif +#ifndef LAN_INIT_DELAY +#define LAN_INIT_DELAY 0 +#endif + #if defined(ESP8266) #define __ESP__ #endif