From b17d7cfa5ab9282ce96fa261e4ffcf584de1df7c Mon Sep 17 00:00:00 2001 From: Andrey Klimov Date: Sun, 6 May 2018 17:57:28 +0300 Subject: [PATCH] Fixes --- lighthub/main.cpp | 18 +++++++++++++----- lighthub/options.h | 9 +++++---- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/lighthub/main.cpp b/lighthub/main.cpp index 6f3f689..35b7be4 100644 --- a/lighthub/main.cpp +++ b/lighthub/main.cpp @@ -285,10 +285,15 @@ if((wifiMulti.run() == WL_CONNECTED)) lanStatus=1; else Ethernet.begin(mac,ip,dns,gw); else Ethernet.begin(mac,ip,dns); else Ethernet.begin(mac,ip); - else res = Ethernet.begin(mac, 12000); + else + { + wdt_dis(); + res = Ethernet.begin(mac, 12000); + wdt_en(); + wdt_res(); + } - wdt_dis(); if (res == 0) { Serial.println(F("Failed to configure Ethernet using DHCP")); lanStatus = -10; @@ -297,8 +302,7 @@ if((wifiMulti.run() == WL_CONNECTED)) lanStatus=1; printIPAddress(); lanStatus = 1; } - wdt_en(); - wdt_res(); + #endif break; @@ -997,7 +1001,11 @@ void setup_main() { #ifdef _artnet ArtnetSetup(); #endif - +/* +SPI.begin(); +while (Ethernet.maintain() == NO_LINK && millis()<3000UL) {delay(500);Serial.print(F("."));} +*/ +delay(1000); //Wiz5500 //TODO: checkForRemoteSketchUpdate(); } diff --git a/lighthub/options.h b/lighthub/options.h index 89dcefd..25aab04 100644 --- a/lighthub/options.h +++ b/lighthub/options.h @@ -1,6 +1,6 @@ // Configuration of drivers enabled #ifndef PIO_SRC_REV -#define PIO_SRC_REV v0.997 +#define PIO_SRC_REV v0.998 #endif #define TXEnablePin 13 @@ -20,7 +20,8 @@ #define OFFSET_GW OFFSET_DNS+4 #define OFFSET_MASK OFFSET_GW+4 #define OFFSET_CONFIGSERVER OFFSET_MASK+4 -#define EEPROM_offset OFFSET_CONFIGSERVER+32 +#define OFFSET_MQTT_PWD OFFSET_CONFIGSERVER+32 +#define EEPROM_offset OFFSET_MQTT_PWD+16 #define INTERVAL_CHECK_INPUT 50 #define INTERVAL_CHECK_MODBUS 2000 @@ -46,11 +47,11 @@ #endif #ifndef OUTTOPIC -#define OUTTOPIC "/myhome/s_out1/" +#define OUTTOPIC "/myhome/s_out/" #endif #ifndef INTOPIC -#define INTOPIC "/myhome/in1/" +#define INTOPIC "/myhome/in/" #endif #define MQTT_SUBJECT_LENGTH 20