1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-27 18:02:17 +03:00

update AddrList and examples (#5422)

This commit is contained in:
david gauchard
2018-12-03 19:15:50 +01:00
committed by Develo
parent 31bee50102
commit 50cbdc0b92
6 changed files with 80 additions and 48 deletions

View File

@ -66,11 +66,11 @@ void status(Print& out) {
out.println(F("(with 'telnet <addr> or 'nc -u <addr> 23')"));
for (auto a : addrList) {
out.printf("IF='%s' IPv6=%d local=%d hostname='%s' addr= %s",
a.iface().c_str(),
!a.addr().isV4(),
a.addr().isLocal(),
a.hostname(),
a.addr().toString().c_str());
a.ifname().c_str(),
a.isV6(),
a.isLocal(),
a.ifhostname(),
a.toString().c_str());
if (a.isLegacy()) {
out.printf(" / mask:%s / gw:%s",
@ -79,6 +79,7 @@ void status(Print& out) {
}
out.println();
}
// lwIP's dns client will ask for IPv4 first (by default)
@ -96,12 +97,14 @@ void setup() {
Serial.println();
Serial.println(ESP.getFullVersion());
Serial.printf("IPV6 is%s enabled\n", LWIP_IPV6 ? emptyString.c_str() : " NOT");
WiFi.mode(WIFI_STA);
WiFi.begin(STASSID, STAPSK);
status(Serial);
#if 0
#if 0 // 0: legacy connecting loop - 1: wait for IPv6
// legacy loop (still valid with IPv4 only)

View File

@ -21,6 +21,11 @@
#include <ESP8266HTTPClient.h>
#include <ESP8266httpUpdate.h>
#ifndef STASSID
#define STASSID "your-ssid"
#define STAPSK "your-password"
#endif
ESP8266WiFiMulti WiFiMulti;
#define MANUAL_SIGNING 0
@ -66,7 +71,7 @@ void setup() {
}
WiFi.mode(WIFI_STA);
WiFiMulti.addAP("SSID", "PASS");
WiFiMulti.addAP(STASSID, STAPSK);
#if MANUAL_SIGNING
signPubKey = new BearSSL::PublicKey(pubkey);