From b33c62192656b1ec9f7902836b7c8bfc4b6de979 Mon Sep 17 00:00:00 2001 From: Andrey Klimov Date: Mon, 10 Sep 2018 01:40:35 +0300 Subject: [PATCH] Critical fix: DUE with WIZ5500 working again now: EthernetX lib mess fixed, IP stack startup code fixed --- lighthub/lighthub.ino.cpp | 13 +++++++++++++ lighthub/main.cpp | 11 +++++++---- lighthub/options.h | 2 +- platformio.ini | 2 -- 4 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 lighthub/lighthub.ino.cpp diff --git a/lighthub/lighthub.ino.cpp b/lighthub/lighthub.ino.cpp new file mode 100644 index 0000000..7aa3b5e --- /dev/null +++ b/lighthub/lighthub.ino.cpp @@ -0,0 +1,13 @@ +# 1 "/var/folders/kt/8psth65x03v6tw_phdhbj12r0000gn/T/tmpFdKT_0" +#include +# 1 "/Users/andrey/Documents/Arduino/lighthub/lighthub/lighthub.ino" +#include "main.h" +void setup(); +void loop(); +#line 2 "/Users/andrey/Documents/Arduino/lighthub/lighthub/lighthub.ino" +void setup(){ + setup_main(); +} +void loop(){ + loop_main(); +} \ No newline at end of file diff --git a/lighthub/main.cpp b/lighthub/main.cpp index a1c5da3..71fe828 100644 --- a/lighthub/main.cpp +++ b/lighthub/main.cpp @@ -107,7 +107,7 @@ EthernetClient ethClient; #endif #ifndef SYSLOG_DISABLE -#include +//#include #include EthernetUDP udpSyslogClient; Syslog udpSyslog(udpSyslogClient, SYSLOG_PROTO_IETF); @@ -490,7 +490,7 @@ void onInitialStateInitLAN() { } #endif - #if defined(__AVR__) || defined(__SAM3X8E__)||defined(ARDUINO_ARCH_STM32F1) +#if defined(__AVR__) || defined(__SAM3X8E__)||defined(ARDUINO_ARCH_STM32F1) IPAddress ip, dns, gw, mask; int res = 1; debugSerial.println(F("Starting lan")); @@ -510,6 +510,8 @@ void onInitialStateInitLAN() { } else Ethernet.begin(mac, ip, dns, gw); } else Ethernet.begin(mac, ip, dns); } else Ethernet.begin(mac, ip); + debugSerial.println(); + lanStatus = HAVE_IP_ADDRESS; } else { debugSerial.println("No IP data found in flash"); @@ -522,7 +524,7 @@ void onInitialStateInitLAN() { #endif wdt_en(); wdt_res(); - } + if (res == 0) { debugSerial.println(F("Failed to configure Ethernet using DHCP. You can set ip manually!")); @@ -533,10 +535,11 @@ void onInitialStateInitLAN() { resetHard(); #endif } else { - debugSerial.print(F("Got IP address:")); + debugSerial.println(F("Got IP address:")); printIPAddress(Ethernet.localIP()); lanStatus = HAVE_IP_ADDRESS;//1; } + } #endif } diff --git a/lighthub/options.h b/lighthub/options.h index 6b8b5a6..00a9fcc 100644 --- a/lighthub/options.h +++ b/lighthub/options.h @@ -50,7 +50,7 @@ #endif #ifndef CUSTOM_FIRMWARE_MAC -#define DEFAULT_FIRMWARE_MAC {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xFE} +#define DEFAULT_FIRMWARE_MAC {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xFF} #endif #ifndef MY_CONFIG_SERVER diff --git a/platformio.ini b/platformio.ini index 728267e..4f3fe38 100644 --- a/platformio.ini +++ b/platformio.ini @@ -86,7 +86,6 @@ lib_deps = 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 @@ -184,7 +183,6 @@ lib_deps = 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