mirror of
https://github.com/meshtastic/firmware.git
synced 2025-07-31 02:45:41 +00:00
Merge cf5ecd4c8f
into b5a8e8f51b
This commit is contained in:
commit
d9249c5567
@ -24,6 +24,8 @@
|
|||||||
#define min_node_info_broadcast_secs 60 * 60 // No regular broadcasts of more than once an hour
|
#define min_node_info_broadcast_secs 60 * 60 // No regular broadcasts of more than once an hour
|
||||||
#define min_neighbor_info_broadcast_secs 4 * 60 * 60
|
#define min_neighbor_info_broadcast_secs 4 * 60 * 60
|
||||||
#define default_map_publish_interval_secs 60 * 60
|
#define default_map_publish_interval_secs 60 * 60
|
||||||
|
#define default_network_ipv6_enabled true
|
||||||
|
|
||||||
#ifdef USERPREFS_RINGTONE_NAG_SECS
|
#ifdef USERPREFS_RINGTONE_NAG_SECS
|
||||||
#define default_ringtone_nag_secs USERPREFS_RINGTONE_NAG_SECS
|
#define default_ringtone_nag_secs USERPREFS_RINGTONE_NAG_SECS
|
||||||
#else
|
#else
|
||||||
|
@ -723,6 +723,12 @@ void NodeDB::installDefaultConfig(bool preserveKey = false)
|
|||||||
strncpy(config.network.wifi_psk, USERPREFS_NETWORK_WIFI_PSK, sizeof(config.network.wifi_psk));
|
strncpy(config.network.wifi_psk, USERPREFS_NETWORK_WIFI_PSK, sizeof(config.network.wifi_psk));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(USERPREFS_NETWORK_IPV6_ENABLED)
|
||||||
|
config.network.ipv6_enabled = USERPREFS_NETWORK_IPV6_ENABLED;
|
||||||
|
#else
|
||||||
|
config.network.ipv6_enabled = default_network_ipv6_enabled;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef DISPLAY_FLIP_SCREEN
|
#ifdef DISPLAY_FLIP_SCREEN
|
||||||
config.display.flip_screen = true;
|
config.display.flip_screen = true;
|
||||||
#endif
|
#endif
|
||||||
|
@ -327,6 +327,24 @@ bool initWifi()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
|
#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(3, 0, 0)
|
||||||
|
// Most of the next 12 lines of code are adapted from espressif/arduino-esp32
|
||||||
|
// Licensed under the GNU Lesser General Public License v2.1
|
||||||
|
// https://github.com/espressif/arduino-esp32/blob/1f038677eb2eaf5e9ca6b6074486803c15468bed/libraries/WiFi/src/WiFiSTA.cpp#L755
|
||||||
|
esp_netif_t *get_esp_interface_netif(esp_interface_t interface);
|
||||||
|
IPv6Address GlobalIPv6()
|
||||||
|
{
|
||||||
|
esp_ip6_addr_t addr;
|
||||||
|
if (WiFiGenericClass::getMode() == WIFI_MODE_NULL) {
|
||||||
|
return IPv6Address();
|
||||||
|
}
|
||||||
|
if (esp_netif_get_ip6_global(get_esp_interface_netif(ESP_IF_WIFI_STA), &addr)) {
|
||||||
|
return IPv6Address();
|
||||||
|
}
|
||||||
|
return IPv6Address(addr.addr);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Called by the Espressif SDK to
|
// Called by the Espressif SDK to
|
||||||
static void WiFiEvent(WiFiEvent_t event)
|
static void WiFiEvent(WiFiEvent_t event)
|
||||||
{
|
{
|
||||||
@ -348,6 +366,18 @@ static void WiFiEvent(WiFiEvent_t event)
|
|||||||
break;
|
break;
|
||||||
case ARDUINO_EVENT_WIFI_STA_CONNECTED:
|
case ARDUINO_EVENT_WIFI_STA_CONNECTED:
|
||||||
LOG_INFO("Connected to access point");
|
LOG_INFO("Connected to access point");
|
||||||
|
if (config.network.ipv6_enabled) {
|
||||||
|
#if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0)
|
||||||
|
if (!WiFi.enableIPv6()) {
|
||||||
|
LOG_WARN("Failed to enable IPv6");
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
if (!WiFi.enableIpV6()) {
|
||||||
|
LOG_WARN("Failed to enable IPv6");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef WIFI_LED
|
#ifdef WIFI_LED
|
||||||
digitalWrite(WIFI_LED, HIGH);
|
digitalWrite(WIFI_LED, HIGH);
|
||||||
#endif
|
#endif
|
||||||
@ -376,7 +406,8 @@ static void WiFiEvent(WiFiEvent_t event)
|
|||||||
LOG_INFO("Obtained Local IP6 address: %s", WiFi.linkLocalIPv6().toString().c_str());
|
LOG_INFO("Obtained Local IP6 address: %s", WiFi.linkLocalIPv6().toString().c_str());
|
||||||
LOG_INFO("Obtained GlobalIP6 address: %s", WiFi.globalIPv6().toString().c_str());
|
LOG_INFO("Obtained GlobalIP6 address: %s", WiFi.globalIPv6().toString().c_str());
|
||||||
#else
|
#else
|
||||||
LOG_INFO("Obtained IP6 address: %s", WiFi.localIPv6().toString().c_str());
|
LOG_INFO("Obtained Local IP6 address: %s", WiFi.localIPv6().toString().c_str());
|
||||||
|
LOG_INFO("Obtained GlobalIP6 address: %s", GlobalIPv6().toString().c_str());
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case ARDUINO_EVENT_WIFI_STA_LOST_IP:
|
case ARDUINO_EVENT_WIFI_STA_LOST_IP:
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
// "USERPREFS_MQTT_ENCRYPTION_ENABLED": "true",
|
// "USERPREFS_MQTT_ENCRYPTION_ENABLED": "true",
|
||||||
// "USERPREFS_MQTT_TLS_ENABLED": "false",
|
// "USERPREFS_MQTT_TLS_ENABLED": "false",
|
||||||
// "USERPREFS_MQTT_ROOT_TOPIC": "event/REPLACEME",
|
// "USERPREFS_MQTT_ROOT_TOPIC": "event/REPLACEME",
|
||||||
|
// "USERPREFS_NETWORK_IPV6_ENABLED": "1",
|
||||||
// "USERPREFS_RINGTONE_NAG_SECS": "60",
|
// "USERPREFS_RINGTONE_NAG_SECS": "60",
|
||||||
"USERPREFS_RINGTONE_RTTTL": "24:d=32,o=5,b=565:f6,p,f6,4p,p,f6,p,f6,2p,p,b6,p,b6,p,b6,p,b6,p,b,p,b,p,b,p,b,p,b,p,b,p,b,p,b,1p.,2p.,p",
|
"USERPREFS_RINGTONE_RTTTL": "24:d=32,o=5,b=565:f6,p,f6,4p,p,f6,p,f6,2p,p,b6,p,b6,p,b6,p,b6,p,b,p,b,p,b,p,b,p,b,p,b,p,b,p,b,1p.,2p.,p",
|
||||||
"USERPREFS_TZ_STRING": "tzplaceholder "
|
"USERPREFS_TZ_STRING": "tzplaceholder "
|
||||||
|
Loading…
Reference in New Issue
Block a user