mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-23 00:58:14 +00:00
RP2040: Update core; add mDNS support (#5355)
Some checks failed
CI / setup (check) (push) Waiting to run
CI / setup (esp32) (push) Waiting to run
CI / setup (esp32c3) (push) Waiting to run
CI / setup (esp32c6) (push) Waiting to run
CI / setup (esp32s3) (push) Waiting to run
CI / setup (nrf52840) (push) Waiting to run
CI / setup (rp2040) (push) Waiting to run
CI / setup (stm32) (push) Waiting to run
CI / check (push) Blocked by required conditions
CI / build-esp32 (push) Blocked by required conditions
CI / build-esp32-s3 (push) Blocked by required conditions
CI / build-esp32-c3 (push) Blocked by required conditions
CI / build-esp32-c6 (push) Blocked by required conditions
CI / build-nrf52 (push) Blocked by required conditions
CI / build-rpi2040 (push) Blocked by required conditions
CI / build-stm32 (push) Blocked by required conditions
CI / package-raspbian (push) Waiting to run
CI / package-raspbian-armv7l (push) Waiting to run
CI / package-native (push) Waiting to run
CI / after-checks (push) Blocked by required conditions
CI / gather-artifacts (esp32) (push) Blocked by required conditions
CI / gather-artifacts (esp32c3) (push) Blocked by required conditions
CI / gather-artifacts (esp32c6) (push) Blocked by required conditions
CI / gather-artifacts (esp32s3) (push) Blocked by required conditions
CI / gather-artifacts (nrf52840) (push) Blocked by required conditions
CI / gather-artifacts (rp2040) (push) Blocked by required conditions
CI / gather-artifacts (stm32) (push) Blocked by required conditions
CI / release-artifacts (push) Blocked by required conditions
CI / release-firmware (esp32) (push) Blocked by required conditions
CI / release-firmware (esp32c3) (push) Blocked by required conditions
CI / release-firmware (esp32c6) (push) Blocked by required conditions
CI / release-firmware (esp32s3) (push) Blocked by required conditions
CI / release-firmware (nrf52840) (push) Blocked by required conditions
CI / release-firmware (rp2040) (push) Blocked by required conditions
CI / release-firmware (stm32) (push) Blocked by required conditions
Flawfinder Scan / Flawfinder (push) Waiting to run
Semgrep Full Scan / semgrep-full (push) Has been cancelled
Some checks failed
CI / setup (check) (push) Waiting to run
CI / setup (esp32) (push) Waiting to run
CI / setup (esp32c3) (push) Waiting to run
CI / setup (esp32c6) (push) Waiting to run
CI / setup (esp32s3) (push) Waiting to run
CI / setup (nrf52840) (push) Waiting to run
CI / setup (rp2040) (push) Waiting to run
CI / setup (stm32) (push) Waiting to run
CI / check (push) Blocked by required conditions
CI / build-esp32 (push) Blocked by required conditions
CI / build-esp32-s3 (push) Blocked by required conditions
CI / build-esp32-c3 (push) Blocked by required conditions
CI / build-esp32-c6 (push) Blocked by required conditions
CI / build-nrf52 (push) Blocked by required conditions
CI / build-rpi2040 (push) Blocked by required conditions
CI / build-stm32 (push) Blocked by required conditions
CI / package-raspbian (push) Waiting to run
CI / package-raspbian-armv7l (push) Waiting to run
CI / package-native (push) Waiting to run
CI / after-checks (push) Blocked by required conditions
CI / gather-artifacts (esp32) (push) Blocked by required conditions
CI / gather-artifacts (esp32c3) (push) Blocked by required conditions
CI / gather-artifacts (esp32c6) (push) Blocked by required conditions
CI / gather-artifacts (esp32s3) (push) Blocked by required conditions
CI / gather-artifacts (nrf52840) (push) Blocked by required conditions
CI / gather-artifacts (rp2040) (push) Blocked by required conditions
CI / gather-artifacts (stm32) (push) Blocked by required conditions
CI / release-artifacts (push) Blocked by required conditions
CI / release-firmware (esp32) (push) Blocked by required conditions
CI / release-firmware (esp32c3) (push) Blocked by required conditions
CI / release-firmware (esp32c6) (push) Blocked by required conditions
CI / release-firmware (esp32s3) (push) Blocked by required conditions
CI / release-firmware (nrf52840) (push) Blocked by required conditions
CI / release-firmware (rp2040) (push) Blocked by required conditions
CI / release-firmware (stm32) (push) Blocked by required conditions
Flawfinder Scan / Flawfinder (push) Waiting to run
Semgrep Full Scan / semgrep-full (push) Has been cancelled
* Update arduino-pico core * RP2040: Add mDNS support * SimpleMDNS `begin` now returns a bool * Add `-g` option to `debug_build_flags` to link files for gdb * RAK11310 needs old platform as well * Change defines to specific architecture * Core version 4.2.1 is out
This commit is contained in:
parent
d4d89447bd
commit
9545a10361
@ -1,8 +1,8 @@
|
|||||||
; Common settings for rp2040 Processor based targets
|
; Common settings for rp2040 Processor based targets
|
||||||
[rp2040_base]
|
[rp2040_base]
|
||||||
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#v1.2.0-gcc12
|
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#a606be683748c73e9a0d46baf70163478d298f0f ; For arduino-pico 4.2.0
|
||||||
extends = arduino_base
|
extends = arduino_base
|
||||||
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#4.0.3
|
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#4.2.1
|
||||||
|
|
||||||
board_build.core = earlephilhower
|
board_build.core = earlephilhower
|
||||||
board_build.filesystem_size = 0.5m
|
board_build.filesystem_size = 0.5m
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
; Common settings for rp2040 Processor based targets
|
; Common settings for rp2040 Processor based targets
|
||||||
[rp2350_base]
|
[rp2350_base]
|
||||||
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#9e55f6db5c56b9867c69fe473f388beea4546672
|
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#a606be683748c73e9a0d46baf70163478d298f0f ; For arduino-pico 4.2.0
|
||||||
extends = arduino_base
|
extends = arduino_base
|
||||||
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#a6ab6e1f95bc1428d667d55ea7173c0744acc03c ; 4.0.2+
|
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#4.2.1
|
||||||
|
|
||||||
board_build.core = earlephilhower
|
board_build.core = earlephilhower
|
||||||
board_build.filesystem_size = 0.5m
|
board_build.filesystem_size = 0.5m
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
#include <ESPmDNS.h>
|
#include <ESPmDNS.h>
|
||||||
#include <esp_wifi.h>
|
#include <esp_wifi.h>
|
||||||
static void WiFiEvent(WiFiEvent_t event);
|
static void WiFiEvent(WiFiEvent_t event);
|
||||||
|
#elif defined(ARCH_RP2040)
|
||||||
|
#include <SimpleMDNS.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef DISABLE_NTP
|
#ifndef DISABLE_NTP
|
||||||
@ -59,19 +61,21 @@ static void onNetworkConnected()
|
|||||||
// Start web server
|
// Start web server
|
||||||
LOG_INFO("Start WiFi network services");
|
LOG_INFO("Start WiFi network services");
|
||||||
|
|
||||||
#ifdef ARCH_ESP32
|
|
||||||
// start mdns
|
// start mdns
|
||||||
if (!MDNS.begin("Meshtastic")) {
|
if (!MDNS.begin("Meshtastic")) {
|
||||||
LOG_ERROR("Error setting up MDNS responder!");
|
LOG_ERROR("Error setting up MDNS responder!");
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO("mDNS responder started");
|
|
||||||
LOG_INFO("mDNS Host: Meshtastic.local");
|
LOG_INFO("mDNS Host: Meshtastic.local");
|
||||||
|
#ifdef ARCH_ESP32
|
||||||
MDNS.addService("http", "tcp", 80);
|
MDNS.addService("http", "tcp", 80);
|
||||||
MDNS.addService("https", "tcp", 443);
|
MDNS.addService("https", "tcp", 443);
|
||||||
}
|
#elif defined(ARCH_RP2040)
|
||||||
#else // ESP32 handles this in WiFiEvent
|
// ARCH_RP2040 does not support HTTPS, create a "meshtastic" service
|
||||||
|
MDNS.addService("meshtastic", "tcp", 4403);
|
||||||
|
// ESP32 handles this in WiFiEvent
|
||||||
LOG_INFO("Obtained IP address: %s", WiFi.localIP().toString().c_str());
|
LOG_INFO("Obtained IP address: %s", WiFi.localIP().toString().c_str());
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef DISABLE_NTP
|
#ifndef DISABLE_NTP
|
||||||
LOG_INFO("Start NTP time client");
|
LOG_INFO("Start NTP time client");
|
||||||
@ -129,7 +133,7 @@ static int32_t reconnectWiFi()
|
|||||||
// Make sure we clear old connection credentials
|
// Make sure we clear old connection credentials
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
WiFi.disconnect(false, true);
|
WiFi.disconnect(false, true);
|
||||||
#else
|
#elif defined(ARCH_RP2040)
|
||||||
WiFi.disconnect(false);
|
WiFi.disconnect(false);
|
||||||
#endif
|
#endif
|
||||||
LOG_INFO("Reconnecting to WiFi access point %s", wifiName);
|
LOG_INFO("Reconnecting to WiFi access point %s", wifiName);
|
||||||
@ -193,7 +197,7 @@ void deinitWifi()
|
|||||||
if (isWifiAvailable()) {
|
if (isWifiAvailable()) {
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
WiFi.disconnect(true, false);
|
WiFi.disconnect(true, false);
|
||||||
#else
|
#elif defined(ARCH_RP2040)
|
||||||
WiFi.disconnect(true);
|
WiFi.disconnect(true);
|
||||||
#endif
|
#endif
|
||||||
WiFi.mode(WIFI_OFF);
|
WiFi.mode(WIFI_OFF);
|
||||||
@ -229,15 +233,15 @@ bool initWifi()
|
|||||||
|
|
||||||
if (config.network.address_mode == meshtastic_Config_NetworkConfig_AddressMode_STATIC &&
|
if (config.network.address_mode == meshtastic_Config_NetworkConfig_AddressMode_STATIC &&
|
||||||
config.network.ipv4_config.ip != 0) {
|
config.network.ipv4_config.ip != 0) {
|
||||||
#ifndef ARCH_RP2040
|
#ifdef ARCH_ESP32
|
||||||
WiFi.config(config.network.ipv4_config.ip, config.network.ipv4_config.gateway, config.network.ipv4_config.subnet,
|
WiFi.config(config.network.ipv4_config.ip, config.network.ipv4_config.gateway, config.network.ipv4_config.subnet,
|
||||||
config.network.ipv4_config.dns);
|
config.network.ipv4_config.dns);
|
||||||
#else
|
#elif defined(ARCH_RP2040)
|
||||||
WiFi.config(config.network.ipv4_config.ip, config.network.ipv4_config.dns, config.network.ipv4_config.gateway,
|
WiFi.config(config.network.ipv4_config.ip, config.network.ipv4_config.dns, config.network.ipv4_config.gateway,
|
||||||
config.network.ipv4_config.subnet);
|
config.network.ipv4_config.subnet);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#ifndef ARCH_RP2040
|
#ifdef ARCH_ESP32
|
||||||
WiFi.onEvent(WiFiEvent);
|
WiFi.onEvent(WiFiEvent);
|
||||||
WiFi.setAutoReconnect(true);
|
WiFi.setAutoReconnect(true);
|
||||||
WiFi.setSleep(false);
|
WiFi.setSleep(false);
|
||||||
|
@ -3,6 +3,7 @@ extends = rp2040_base
|
|||||||
board = wiscore_rak11300
|
board = wiscore_rak11300
|
||||||
upload_protocol = picotool
|
upload_protocol = picotool
|
||||||
# keep an old SDK to use less memory.
|
# keep an old SDK to use less memory.
|
||||||
|
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#v1.2.0-gcc12
|
||||||
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#3.7.2
|
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#3.7.2
|
||||||
|
|
||||||
# add our variants files to the include and src paths
|
# add our variants files to the include and src paths
|
||||||
@ -13,5 +14,5 @@ build_flags = ${rp2040_base.build_flags}
|
|||||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus"
|
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus"
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${rp2040_base.lib_deps}
|
${rp2040_base.lib_deps}
|
||||||
debug_build_flags = ${rp2040_base.build_flags}
|
debug_build_flags = ${rp2040_base.build_flags}, -g
|
||||||
debug_tool = cmsis-dap ; for e.g. Picotool
|
debug_tool = cmsis-dap ; for e.g. Picotool
|
@ -12,5 +12,5 @@ build_flags = ${rp2040_base.build_flags}
|
|||||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus"
|
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus"
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${rp2040_base.lib_deps}
|
${rp2040_base.lib_deps}
|
||||||
debug_build_flags = ${rp2040_base.build_flags}
|
debug_build_flags = ${rp2040_base.build_flags}, -g
|
||||||
debug_tool = cmsis-dap ; for e.g. Picotool
|
debug_tool = cmsis-dap ; for e.g. Picotool
|
@ -12,5 +12,5 @@ build_flags = ${rp2040_base.build_flags}
|
|||||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus"
|
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus"
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${rp2040_base.lib_deps}
|
${rp2040_base.lib_deps}
|
||||||
debug_build_flags = ${rp2040_base.build_flags}
|
debug_build_flags = ${rp2040_base.build_flags}, -g
|
||||||
debug_tool = cmsis-dap ; for e.g. Picotool
|
debug_tool = cmsis-dap ; for e.g. Picotool
|
@ -12,5 +12,5 @@ build_flags = ${rp2350_base.build_flags}
|
|||||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus"
|
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus"
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${rp2350_base.lib_deps}
|
${rp2350_base.lib_deps}
|
||||||
debug_build_flags = ${rp2350_base.build_flags}
|
debug_build_flags = ${rp2350_base.build_flags}, -g
|
||||||
debug_tool = cmsis-dap ; for e.g. Picotool
|
debug_tool = cmsis-dap ; for e.g. Picotool
|
@ -14,5 +14,5 @@ build_src_filter = ${rp2040_base.build_src_filter} +<mesh/wifi/>
|
|||||||
lib_deps =
|
lib_deps =
|
||||||
${rp2040_base.lib_deps}
|
${rp2040_base.lib_deps}
|
||||||
${networking_base.lib_deps}
|
${networking_base.lib_deps}
|
||||||
debug_build_flags = ${rp2040_base.build_flags}
|
debug_build_flags = ${rp2040_base.build_flags}, -g
|
||||||
debug_tool = cmsis-dap ; for e.g. Picotool
|
debug_tool = cmsis-dap ; for e.g. Picotool
|
Loading…
Reference in New Issue
Block a user