Initial IPv6 support (SLAAC). Builds against 2.5.2 and 2.6.0 staging. iram1_0_seg problems with larger configurations.

This commit is contained in:
hkrupp 2019-10-11 07:40:55 +02:00
parent 3cd6abe0bf
commit 3596e4c77f
24 changed files with 114 additions and 3 deletions

View File

@ -95,6 +95,32 @@ build_flags = ${esp82xx_defaults.build_flags}
-fno-exceptions
-lstdc++
[core_2_5_2_ipv6]
; *** Esp8266 core for Arduino version 2.5.2
platform = espressif8266@~2.2.2
build_flags = ${esp82xx_defaults.build_flags}
-Wl,-Teagle.flash.1m.ld
; Code optimization see https://github.com/esp8266/Arduino/issues/5790#issuecomment-475672473
-O2
-DBEARSSL_SSL_BASIC
; nonos-sdk 22x
-DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x
; nonos-sdk-pre-v3
; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK3
; lwIP 1.4
; -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH
; lwIP 2 - Low Memory
; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
; lwIP 2 - Higher Bandwidth
; -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
; lwIP 2 - Higher Bandwidth Low Memory no Features
; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY_LOW_FLASH
; lwIP 2 - Higher Bandwidth IPv6
-DPIO_FRAMEWORK_ARDUINO_LWIP2_IPV6_HIGHER_BANDWIDTH
-DVTABLES_IN_FLASH
-fno-exceptions
-lstdc++
[core_stage]
; *** Esp8266 core for Arduino version latest beta
platform = https://github.com/platformio/platform-espressif8266.git#feature/stage
@ -117,7 +143,7 @@ build_flags = ${esp82xx_defaults.build_flags}
; -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
; lwIP 2 - Higher Bandwitdh Low Memory no Features
; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY_LOW_FLASH
; lwIP 2 - Higher Bandwitdh no Features
; lwIP 2 - Higher Bandwidth no Features (Tasmota default)
-DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH
; VTABLES in Flash (default)
-DVTABLES_IN_FLASH
@ -133,6 +159,44 @@ build_flags = ${esp82xx_defaults.build_flags}
; -fexceptions
; -lstdc++-exc
[core_stage_ipv6]
; *** Esp8266 core for Arduino version latest beta
platform = https://github.com/platformio/platform-espressif8266.git#feature/stage
build_flags = ${esp82xx_defaults.build_flags}
-Wl,-Teagle.flash.1m.ld
; Code optimization see https://github.com/esp8266/Arduino/issues/5790#issuecomment-475672473
-O2
-DBEARSSL_SSL_BASIC
; nonos-sdk 22y
-DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22y
; nonos-sdk 22x
; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x
; nonos-sdk-pre-v3
; -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK3
; lwIP 1.4
; -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH
; lwIP 2 - Low Memory
; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
; lwIP 2 - Higher Bandwidth
; -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
; lwIP 2 - Higher Bandwitdh Low Memory no Features
; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY_LOW_FLASH
; lwIP 2 - Higher Bandwidth IPv6
-DPIO_FRAMEWORK_ARDUINO_LWIP2_IPV6_HIGHER_BANDWIDTH
; VTABLES in Flash (default)
-DVTABLES_IN_FLASH
; VTABLES in Heap
; -DVTABLES_IN_DRAM
; VTABLES in IRAM
; -DVTABLES_IN_IRAM
; enable one option set -> No exception recommended
; No exception code in firmware
-fno-exceptions
-lstdc++
; Exception code in firmware /needs much space! 90k
; -fexceptions
; -lstdc++-exc
[core_pre]
; *** Arduino Esp8266 core pre 2.6.x for Tasmota (mqtt reconnects fixed)
platform = https://github.com/Jason2866/platform-espressif8266.git#Tasmota
@ -178,10 +242,14 @@ build_flags = ${esp82xx_defaults.build_flags}
;build_flags = ${core_2_4_2.build_flags}
;platform = ${core_2_5_2.platform}
;build_flags = ${core_2_5_2.build_flags}
;platform = ${core_2_5_2_ipv6.platform}
;build_flags = ${core_2_5_2_ipv6.build_flags}
;platform = ${core_stage.platform}
;build_flags = ${core_stage.build_flags}
platform = ${core_pre.platform}
build_flags = ${core_pre.build_flags}
platform = ${core_stage_ipv6.platform}
build_flags = ${core_stage_ipv6.build_flags}
;platform = ${core_pre.platform}
;build_flags = ${core_pre.build_flags}
[common]
framework = arduino

View File

@ -213,6 +213,7 @@
#define D_MQTT_SERVICE_FOUND "MQTT услуга е намерена на"
#define D_FOUND_AT "намерена в"
#define D_SYSLOG_HOST_NOT_FOUND "Хостът на системния лог не е намерен"
#define D_CONNECT_V6_ADDR_INFO "Got IPv6 global address"
// settings.ino
#define D_SAVED_TO_FLASH_AT "Запазено във флаш паметта на"

View File

@ -213,6 +213,7 @@
#define D_MQTT_SERVICE_FOUND "Služba MQTT byla nalezena"
#define D_FOUND_AT "znalezeno v"
#define D_SYSLOG_HOST_NOT_FOUND "Syslog Host nebyl nalezen"
#define D_CONNECT_V6_ADDR_INFO "Got IPv6 global address"
// settings.ino
#define D_SAVED_TO_FLASH_AT "Uloženo do paměti flash v"

View File

@ -213,6 +213,7 @@
#define D_MQTT_SERVICE_FOUND "MQTT-Service gefunden bei"
#define D_FOUND_AT "gefunden bei"
#define D_SYSLOG_HOST_NOT_FOUND "Syslog-Host nicht gefunden"
#define D_CONNECT_V6_ADDR_INFO "IPv6 globale Adresse"
// settings.ino
#define D_SAVED_TO_FLASH_AT "in Flash gespeichert am"

View File

@ -213,6 +213,7 @@
#define D_MQTT_SERVICE_FOUND "Βρέθηκε υπηρεσία MQTT στο"
#define D_FOUND_AT "βρέθηκε στο"
#define D_SYSLOG_HOST_NOT_FOUND "Δε βρέθηκε Syslog Host"
#define D_CONNECT_V6_ADDR_INFO "Got IPv6 global address"
// settings.ino
#define D_SAVED_TO_FLASH_AT "Αποθηκεύτηκε από τη Flash στο"

View File

@ -213,6 +213,7 @@
#define D_MQTT_SERVICE_FOUND "MQTT service found on"
#define D_FOUND_AT "found at"
#define D_SYSLOG_HOST_NOT_FOUND "Syslog Host not found"
#define D_CONNECT_V6_ADDR_INFO "Got IPv6 global address"
// settings.ino
#define D_SAVED_TO_FLASH_AT "Saved to flash at"

View File

@ -213,6 +213,7 @@
#define D_MQTT_SERVICE_FOUND "Servicio MQTT encontrado en"
#define D_FOUND_AT "encontrado en"
#define D_SYSLOG_HOST_NOT_FOUND "Syslog Host no encontrado"
#define D_CONNECT_V6_ADDR_INFO "Got IPv6 global address"
// settings.ino
#define D_SAVED_TO_FLASH_AT "Grabado a la flash en"

View File

@ -213,6 +213,7 @@
#define D_MQTT_SERVICE_FOUND "Service MQTT trouvé sur"
#define D_FOUND_AT "trouvé à"
#define D_SYSLOG_HOST_NOT_FOUND "Hôte SysLog introuvable"
#define D_CONNECT_V6_ADDR_INFO "Got IPv6 global address"
// settings.ino
#define D_SAVED_TO_FLASH_AT "Enregistré en flash à"

View File

@ -213,6 +213,7 @@
#define D_MQTT_SERVICE_FOUND "MQTT נמצאו שירותי"
#define D_FOUND_AT "נמצא ב"
#define D_SYSLOG_HOST_NOT_FOUND "לא נמצא Syslog מארח"
#define D_CONNECT_V6_ADDR_INFO "Got IPv6 global address"
// settings.ino
#define D_SAVED_TO_FLASH_AT "נשמר לפלאש ב"

View File

@ -213,6 +213,7 @@
#define D_MQTT_SERVICE_FOUND "élő MQTT szolgáltatás a(z)"
#define D_FOUND_AT "a(z)"
#define D_SYSLOG_HOST_NOT_FOUND "Syslog hoszt nem található"
#define D_CONNECT_V6_ADDR_INFO "Got IPv6 global address"
// settings.ino
#define D_SAVED_TO_FLASH_AT "Flash-re mentve a(z)"

View File

@ -213,6 +213,7 @@
#define D_MQTT_SERVICE_FOUND "Servizio MQTT trovato su"
#define D_FOUND_AT "trovato a"
#define D_SYSLOG_HOST_NOT_FOUND "Syslog Host non trovato"
#define D_CONNECT_V6_ADDR_INFO "Got IPv6 global address"
// settings.ino
#define D_SAVED_TO_FLASH_AT "Salvato nella flash in"

View File

@ -213,6 +213,7 @@
#define D_MQTT_SERVICE_FOUND "MQTT 서비스 발견"
#define D_FOUND_AT "다음에서 발견"
#define D_SYSLOG_HOST_NOT_FOUND "Syslog 호스트가 발견되지 않았습니다"
#define D_CONNECT_V6_ADDR_INFO "Got IPv6 global address"
// settings.ino
#define D_SAVED_TO_FLASH_AT "플래시에 저장"

View File

@ -213,6 +213,7 @@
#define D_MQTT_SERVICE_FOUND "MQTT dienst gevonden op"
#define D_FOUND_AT "gevonden op"
#define D_SYSLOG_HOST_NOT_FOUND "Syslog Host niet gevonden"
#define D_CONNECT_V6_ADDR_INFO "Got IPv6 global address"
// settings.ino
#define D_SAVED_TO_FLASH_AT "Opgeslagen in flash op"

View File

@ -213,6 +213,7 @@
#define D_MQTT_SERVICE_FOUND "Usługa MQTT została znaleziona"
#define D_FOUND_AT "znalezione w"
#define D_SYSLOG_HOST_NOT_FOUND "Syslog Host nie znaleziony"
#define D_CONNECT_V6_ADDR_INFO "Got IPv6 global address"
// settings.ino
#define D_SAVED_TO_FLASH_AT "Zapisane do pamięci flash w"

View File

@ -213,6 +213,7 @@
#define D_MQTT_SERVICE_FOUND "Serviço MQTT encontrado em"
#define D_FOUND_AT "encontrado em"
#define D_SYSLOG_HOST_NOT_FOUND "Syslog anfitrião não encontrado"
#define D_CONNECT_V6_ADDR_INFO "Got IPv6 global address"
// settings.ino
#define D_SAVED_TO_FLASH_AT "Guardado na flash em"

View File

@ -213,6 +213,7 @@
#define D_MQTT_SERVICE_FOUND "Serviço MQTT encontrado em"
#define D_FOUND_AT "encontrado em"
#define D_SYSLOG_HOST_NOT_FOUND "Syslog anfitrião não encontrado"
#define D_CONNECT_V6_ADDR_INFO "Got IPv6 global address"
// settings.ino
#define D_SAVED_TO_FLASH_AT "Guardado na flash em"

View File

@ -213,6 +213,7 @@
#define D_MQTT_SERVICE_FOUND "MQTT сервис service найдено"
#define D_FOUND_AT "найдено в"
#define D_SYSLOG_HOST_NOT_FOUND "System лог хост не найден"
#define D_CONNECT_V6_ADDR_INFO "Got IPv6 global address"
// settings.ino
#define D_SAVED_TO_FLASH_AT "Сохранено во флэш-память"

View File

@ -213,6 +213,7 @@
#define D_MQTT_SERVICE_FOUND "Služba MQTT bola nájdená"
#define D_FOUND_AT "nájdené v"
#define D_SYSLOG_HOST_NOT_FOUND "Syslog Host nebol nájdený"
#define D_CONNECT_V6_ADDR_INFO "Got IPv6 global address"
// settings.ino
#define D_SAVED_TO_FLASH_AT "Uložené do flash pamäte v"

View File

@ -213,6 +213,7 @@
#define D_MQTT_SERVICE_FOUND "MQTT-tjänst hittades på"
#define D_FOUND_AT "hittades vid"
#define D_SYSLOG_HOST_NOT_FOUND "Syslog-värd hittades inte"
#define D_CONNECT_V6_ADDR_INFO "Got IPv6 global address"
// settings.ino
#define D_SAVED_TO_FLASH_AT "Sparade till flash vid"

View File

@ -213,6 +213,7 @@
#define D_MQTT_SERVICE_FOUND "Üzerinden MQTT serivisi tespit edildi"
#define D_FOUND_AT "(bulundu)"
#define D_SYSLOG_HOST_NOT_FOUND "Syslog hostu bulunamadı"
#define D_CONNECT_V6_ADDR_INFO "Got IPv6 global address"
// settings.ino
#define D_SAVED_TO_FLASH_AT "Bellekten (Flash) kaydedidi:"

View File

@ -213,6 +213,7 @@
#define D_MQTT_SERVICE_FOUND "MQTT сервер знайдено"
#define D_FOUND_AT "знайдено в"
#define D_SYSLOG_HOST_NOT_FOUND "Сервер журналу не знайдено"
#define D_CONNECT_V6_ADDR_INFO "Got IPv6 global address"
// settings.ino
#define D_SAVED_TO_FLASH_AT "Збережено в флэш-пам'ять"

View File

@ -213,6 +213,7 @@
#define D_MQTT_SERVICE_FOUND "发现 MQTT 服务:"
#define D_FOUND_AT "发现:"
#define D_SYSLOG_HOST_NOT_FOUND "Syslog 主机未找到"
#define D_CONNECT_V6_ADDR_INFO "Got IPv6 global address"
// settings.ino
#define D_SAVED_TO_FLASH_AT "保存到 flash:"

View File

@ -213,6 +213,7 @@
#define D_MQTT_SERVICE_FOUND "發現MQTT服務:"
#define D_FOUND_AT "found at"
#define D_SYSLOG_HOST_NOT_FOUND "Syslog主機未找到"
#define D_CONNECT_V6_ADDR_INFO "Got IPv6 global address"
// settings.ino
#define D_SAVED_TO_FLASH_AT "保存到 flash:"

View File

@ -33,6 +33,9 @@ const uint8_t WIFI_CHECK_SEC = 20; // seconds
const uint8_t WIFI_RETRY_OFFSET_SEC = 20; // seconds
#include <ESP8266WiFi.h> // Wifi, MQTT, Ota, WifiManager
#if LWIP_IPV6
#include <AddrList.h> // IPv6 DualStack
#endif
struct WIFI {
uint32_t last_event = 0; // Last wifi connection event
@ -235,6 +238,24 @@ void WifiBegin(uint8_t flag, uint8_t channel)
}
AddLog_P2(LOG_LEVEL_INFO, PSTR(D_LOG_WIFI D_CONNECTING_TO_AP "%d %s " D_IN_MODE " 11%c " D_AS " %s..."),
Settings.sta_active +1, Settings.sta_ssid[Settings.sta_active], kWifiPhyMode[WiFi.getPhyMode() & 0x3], my_hostname);
#if LWIP_IPV6
for (bool configured = false; !configured;) {
uint16_t cfgcnt=0;
for (auto addr : addrList)
{
if ((configured = !addr.isLocal() && addr.isV6()) || cfgcnt==30) break; // IPv6 is mandatory but stop after 15 seconds
delay(500); // Loop until real IPv6 address is aquired or too many tries failed
cfgcnt++;
}
}
for (auto a : addrList) {
if(!a.isLocal() && !a.isLegacy())
{
AddLog_P2(LOG_LEVEL_INFO, PSTR(D_LOG_WIFI D_CONNECT_V6_ADDR_INFO " %s"),a.toString().c_str());
}
}
#endif
}
void WifiBeginAfterScan()