mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-08 06:02:05 +00:00
add Config Option
This commit is contained in:
parent
d4256e4190
commit
935c4360dd
@ -22,6 +22,7 @@
|
|||||||
#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 false
|
||||||
|
|
||||||
#define default_mqtt_address "mqtt.meshtastic.org"
|
#define default_mqtt_address "mqtt.meshtastic.org"
|
||||||
#define default_mqtt_username "meshdev"
|
#define default_mqtt_username "meshdev"
|
||||||
|
@ -654,6 +654,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(ARCH_ESP32) && 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
|
||||||
|
@ -345,13 +345,15 @@ 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 ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0)
|
||||||
WiFi.enableIPv6();
|
WiFi.enableIPv6();
|
||||||
#else
|
#else
|
||||||
if (!WiFi.enableIpV6()) {
|
if (!WiFi.enableIpV6()) {
|
||||||
LOG_WARN("Failed to enable IPv6");
|
LOG_WARN("Failed to enable IPv6");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ARDUINO_EVENT_WIFI_STA_DISCONNECTED:
|
case ARDUINO_EVENT_WIFI_STA_DISCONNECTED:
|
||||||
LOG_INFO("Disconnected from WiFi access point");
|
LOG_INFO("Disconnected from WiFi access point");
|
||||||
|
@ -51,5 +51,6 @@
|
|||||||
// "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_TZ_STRING": "tzplaceholder "
|
"USERPREFS_TZ_STRING": "tzplaceholder "
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user