Compare commits

...

19 Commits

Author SHA1 Message Date
Alexander Begoon
421965789e
Merge 41db0aff3d into 5d48d2c0a7 2025-04-20 13:00:06 +00:00
Alexander Begoon
41db0aff3d
Merge remote-tracking branch 'upstream/master' into xiao_esp32c6_with_ble 2025-04-20 14:56:09 +02:00
Alexander Begoon
0e95ed2979
Fix a dependency source 2025-04-20 14:55:46 +02:00
Nivek-domo
5d48d2c0a7
Add IP Address Frame (#6615)
* Update Screen.cpp

add ip on screen if has ethernet pcb like w5500 spi

* Run Trunk Format and Translate Comments FR->EN

---------

Co-authored-by: Tom Fifield <tom@tomfifield.net>
2025-04-20 20:06:39 +10:00
Nivek-domo
2b57ffafd7
Rak13800 Ethernet works on rak11310 too
we can use rak13800 on rak11310 too
2025-04-20 18:51:01 +10:00
Alexander Begoon
ba0f5688ae
Fix lint 2025-04-19 12:01:22 +02:00
Alexander Begoon
9874c5c696
Fix lint 2025-04-19 12:00:20 +02:00
Alexander Begoon
7cad7d3864
Improve pio config.
Fix Nimble pin code issue.
Address some PR comments.
2025-04-19 11:56:55 +02:00
Alexander Begoon
5c2ee2bb9d
Merge remote-tracking branch 'upstream/master' into xiao_esp32c6_with_ble 2025-04-19 09:46:12 +02:00
Thomas Göttgens
6e012f4774
Merge branch 'master' into xiao_esp32c6_with_ble 2025-04-18 00:12:05 +02:00
Thomas Göttgens
2fb7cc7900
Merge branch 'master' into xiao_esp32c6_with_ble 2025-04-18 00:11:11 +02:00
Thomas Göttgens
3dbc5715d1
Merge branch 'master' into xiao_esp32c6_with_ble 2025-04-07 10:05:08 +02:00
Ben Meadors
d0b6a76119
Merge branch 'master' into xiao_esp32c6_with_ble 2025-03-31 05:59:49 -05:00
Thomas Göttgens
4678059779
Merge branch 'master' into xiao_esp32c6_with_ble 2025-03-31 11:21:33 +02:00
Alexander Begoon
1e2b92d1a0
Merge remote-tracking branch 'upstream/master' into xiao_esp32c6_with_ble 2025-03-29 11:10:48 +01:00
Alexander Begoon
5336a1d747
Merge remote-tracking branch 'upstream/master' into xiao_esp32c6_with_ble 2025-03-10 13:25:30 +01:00
Alexander Begoon
53b5a59115
bump deps version 2025-03-06 13:29:48 +01:00
Alexander Begoon
cb96a9eba4
Merge remote-tracking branch 'upstream/master' into xiao_esp32c6_with_ble
Conflicts:
	bin/platformio-custom.py
	src/main.cpp
2025-03-06 13:10:47 +01:00
Alexander Begoon
09222fde96
Fix conflicts 2025-03-05 15:32:28 +01:00
43 changed files with 274 additions and 51 deletions

View File

@ -1,6 +1,7 @@
## 🙏 Thank you for sending in a pull request, here's some tips to get started!
### ❌ (Please delete all these tips and replace them with your text) ❌
- Before starting on some new big chunk of code, it it is optional but highly recommended to open an issue first
to say "Hey, I think this idea X should be implemented and I'm starting work on it. My general plan is Y, any feedback
is appreciated." This will allow other devs to potentially save you time by not accidentially duplicating work etc...
@ -15,12 +16,12 @@
- If you do not have the affected hardware to test your code changes adequately against regressions, please indicate this, so that contributors and commnunity members can help test your changes.
- If your PR gets accepted you can request a "Contributor" role in the Meshtastic Discord
## 🤝 Attestations
- [ ] I have tested that my proposed changes behave as described.
- [ ] I have tested that my proposed changes do not cause any obvious regressions on the following devices:
- [ ] Heltec (Lora32) V3
- [ ] LilyGo T-Deck
- [ ] LilyGo T-Deck
- [ ] LilyGo T-Beam
- [ ] RAK WisBlock 4631
- [ ] Seeed Studio T-1000E tracker card

10
.gitignore vendored
View File

@ -37,4 +37,12 @@ release/
.vscode/extensions.json
/compile_commands.json
src/mesh/raspihttp/certificate.pem
src/mesh/raspihttp/private_key.pem
src/mesh/raspihttp/private_key.pem
managed_components
dependencies.lock
log_*
sdkconfig
sdkconfig.*
!sdkconfig.defaults

6
CMakeLists.txt Normal file
View File

@ -0,0 +1,6 @@
# This file supports the ESP-IDF framework only.
# Specifically, it targets the ESP32-C6 due to limited support in PlatformIO (see: https://github.com/platformio/platform-espressif32/issues/1225).
# Currently, we need to compile NimBLE CPP manually to enable BLE, and possibly WiFi, for ESP32-C6 targets.
cmake_minimum_required(VERSION 3.16.0)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(firmware)

View File

@ -17,9 +17,7 @@ build_flags =
-DMESHTASTIC_EXCLUDE_WEBSERVER
;-DDEBUG_HEAP
; TEMP
-DHAS_BLUETOOTH=0
-DMESHTASTIC_EXCLUDE_PAXCOUNTER
-DMESHTASTIC_EXCLUDE_BLUETOOTH
lib_deps =
${arduino_base.lib_deps}
@ -32,6 +30,8 @@ lib_deps =
https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip
# renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto
rweather/Crypto@^0.4.0
# renovate: datasource=github-tags depName=esp-nimble-cpp packageName=h2zero/esp-nimble-cpp
https://github.com/h2zero/esp-nimble-cpp/archive/2.2.1.zip
build_src_filter =
${esp32_base.build_src_filter} -<mesh/http>

View File

@ -86,11 +86,20 @@ if platform.name == "nordicnrf52":
env.VerboseAction(f"\"{sys.executable}\" ./bin/uf2conv.py $BUILD_DIR/firmware.hex -c -f 0xADA52840 -o $BUILD_DIR/firmware.uf2",
"Generating UF2 file"))
Import("projenv")
verPropFile = "version.properties"
try:
# See: https://github.com/platformio/platform-espressif32/issues/953
Import("projenv")
prefsLoc = projenv["PROJECT_DIR"] + "/" + verPropFile
except Exception as e:
print(f"Warning: Unable to import 'projenv'. Falling back. Error: {e}")
projenv = None
prefsLoc = "./" + verPropFile # Fallback location
prefsLoc = projenv["PROJECT_DIR"] + "/version.properties"
verObj = readProps(prefsLoc)
print("Using meshtastic platformio-custom.py, firmware version " + verObj["long"] + " on " + env.get("PIOENV"))
appEnv = env.get("PIOENV")
jsonLoc = env["PROJECT_DIR"] + "/userPrefs.jsonc"
with open(jsonLoc) as f:
@ -122,12 +131,13 @@ flags = [
print ("Using flags:")
for flag in flags:
print(flag)
projenv.Append(
CCFLAGS=flags,
)
if projenv:
projenv.Append(CCFLAGS=flags)
env.Append(CCFLAGS=flags)
for lb in env.GetLibBuilders():
if lb.name == "meshtastic-device-ui":
lb.env.Append(CPPDEFINES=[("APP_VERSION", verObj["long"])])
break
break

View File

@ -7,9 +7,7 @@
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_MDBT50Q_RX -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
["0x2886", "0x0166"]
],
"hwids": [["0x2886", "0x0166"]],
"usb_product": "XIAO-BOOT",
"mcu": "nrf52840",
"variant": "seeed_xiao_nrf52840_kit",

37
sdkconfig.defaults Normal file
View File

@ -0,0 +1,37 @@
# # This file configures the ESP-IDF framework for the ESP32 platform.
# It enables BLE functionality using NimBLE and optimizes for minimal power consumption and size.
# Refer to the ESP-IDF Kconfig documentation for more details: https://docs.espressif.com/projects/esp-idf/en/v5.1.6/esp32c6/api-reference/kconfig.html
# CONFIG_AUTOSTART_ARDUINO is not set
# CONFIG_WS2812_LED_ENABLE is not set
CONFIG_FREERTOS_HZ=1000
CONFIG_MBEDTLS_PSK_MODES=y
CONFIG_MBEDTLS_KEY_EXCHANGE_PSK=y
CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y
CONFIG_COMPILER_OPTIMIZATION_SIZE=y
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE=y
# Override some defaults so BT stack is enabled
# in this example
#
# BT config
#
CONFIG_BT_ENABLED=y
CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y
CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=n
CONFIG_BTDM_CTRL_MODE_BTDM=n
CONFIG_BT_BLUEDROID_ENABLED=n
CONFIG_BT_NIMBLE_ENABLED=y
#
# Arduino Configuration
#
#
# Disable all Arduino included BLE libraries
#
CONFIG_ARDUINO_SELECTIVE_COMPILATION=y
# CONFIG_ARDUINO_SELECTIVE_WiFiProv is not set
# CONFIG_ARDUINO_SELECTIVE_BLE is not set
# CONFIG_ARDUINO_SELECTIVE_BluetoothSerial is not set
# CONFIG_ARDUINO_SELECTIVE_SimpleBLE is not set
# end of Arduino Configuration

14
src/CMakeLists.txt Normal file
View File

@ -0,0 +1,14 @@
# This file supports the ESP-IDF framework only.
# Specifically, it targets the ESP32-C6 due to limited support in PlatformIO (see: https://github.com/platformio/platform-espressif32/issues/1225).
# Currently, we need to compile NimBLE CPP manually to enable BLE, and possibly WiFi, for ESP32-C6 targets.
FILE(GLOB_RECURSE app_sources ${CMAKE_SOURCE_DIR}/src/*.*)
FILE(GLOB_RECURSE platform_sources ${CMAKE_SOURCE_DIR}/src/platform/**/*.*)
list(REMOVE_ITEM app_sources ${platform_sources})
FILE(GLOB_RECURSE esp32_sources ${CMAKE_SOURCE_DIR}/src/platform/esp32/*.*)
list(APPEND app_sources ${esp32_sources})
FILE(GLOB_RECURSE esp32_sources ${CMAKE_SOURCE_DIR}/src/platform/esp32/**/*.*)
list(APPEND app_sources ${esp32_sources})
list(REMOVE_ITEM app_sources ${CMAKE_SOURCE_DIR}/src/mesh/eth/ethClient.cpp)
# Register the component with ESP-IDF
idf_component_register(SRCS ${app_sources} INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/src)

View File

@ -1,8 +1,8 @@
#include "RedirectablePrint.h"
#include "NodeDB.h"
#include "RTC.h"
#include "concurrency/OSThread.h"
#include "configuration.h"
#include "gps/RTC.h"
#include "main.h"
#include "mesh/generated/meshtastic/mesh.pb.h"
#include <assert.h>

View File

@ -9,10 +9,10 @@
#include "GpioLogic.h"
#include "NodeDB.h"
#include "PowerMon.h"
#include "RTC.h"
#include "Throttle.h"
#include "buzz.h"
#include "concurrency/Periodic.h"
#include "gps/RTC.h"
#include "meshUtils.h"
#include "main.h" // pmu_found

View File

@ -1,7 +1,7 @@
#if !MESHTASTIC_EXCLUDE_GPS
#include "NMEAWPL.h"
#include "GeoCoord.h"
#include "RTC.h"
#include "gps/RTC.h"
#include <time.h>
/* -------------------------------------------

View File

@ -1,4 +1,4 @@
#include "RTC.h"
#include "gps/RTC.h"
#include "configuration.h"
#include "detect/ScanI2C.h"
#include "main.h"

View File

@ -56,6 +56,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "mesh/wifi/WiFiAPClient.h"
#endif
#if HAS_ETHERNET
#include "mesh/eth/ethClient.h"
#endif
#ifdef ARCH_ESP32
#include "esp_task_wdt.h"
#include "modules/StoreForwardModule.h"
@ -232,6 +236,42 @@ static void drawOEMBootScreen(OLEDDisplay *display, OLEDDisplayUiState *state, i
#endif
#if HAS_ETHERNET
static void drawEthernetFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
{
display->setFont(FONT_SMALL);
display->setTextAlignment(TEXT_ALIGN_LEFT);
if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_INVERTED) {
display->fillRect(0 + x, 0 + y, x + display->getWidth(), y + FONT_HEIGHT_SMALL);
display->setColor(BLACK);
}
display->setColor(WHITE);
// Adjust vertical position verticale ajustée - starts higher
int16_t y_offset = y + 2; // Reduces space at top
// Left Alignement (x + small offset)
int16_t x_offset = x + 2;
// Display is not centered, align left
display->drawString(x_offset, y_offset, "Ethernet Config:");
y_offset += FONT_HEIGHT_SMALL + 2; // Slightly reduced spacing
display->drawString(x_offset, y_offset, "IP: " + Ethernet.localIP().toString());
y_offset += FONT_HEIGHT_SMALL;
display->drawString(x_offset, y_offset, "Mask: " + Ethernet.subnetMask().toString());
y_offset += FONT_HEIGHT_SMALL;
display->drawString(x_offset, y_offset, "GW: " + Ethernet.gatewayIP().toString());
// y_offset += FONT_HEIGHT_SMALL;
// display->drawString(x_offset, y_offset, "DNS: " + Ethernet.dnsServerIP().toString());
}
#endif
void Screen::drawFrameText(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y, const char *message)
{
uint16_t x_offset = display->width() / 2;
@ -2182,6 +2222,12 @@ void Screen::setFrames(FrameFocus focus)
}
#endif
#if HAS_ETHERNET
if (Ethernet.hardwareStatus() != EthernetNoHardware) {
normalFrames[numframes++] = drawEthernetFrame;
}
#endif
fsi.frameCount = numframes; // Total framecount is used to apply FOCUS_PRESERVE
LOG_DEBUG("Finished build frames. numframes: %d", numframes);

View File

@ -13,13 +13,13 @@
#include "FSCommon.h"
#include "Led.h"
#include "RTC.h"
#include "SPILock.h"
#include "Throttle.h"
#include "concurrency/OSThread.h"
#include "concurrency/Periodic.h"
#include "detect/ScanI2C.h"
#include "error.h"
#include "gps/RTC.h"
#include "power.h"
#if !MESHTASTIC_EXCLUDE_I2C
@ -1414,3 +1414,15 @@ void loop()
}
}
#endif
#if !defined(CONFIG_AUTOSTART_ARDUINO) && (ESP_IDF_VERSION_MAJOR * 100 + ESP_IDF_VERSION_MINOR * 10 + ESP_IDF_VERSION_PATCH) > 512
// Define app_main to bridge Arduino and ESP-IDF
extern "C" void app_main(void)
{
setup();
while (1) {
loop();
vTaskDelay(1); // Allows FreeRTOS to manage tasks
}
}
#endif

View File

@ -9,8 +9,8 @@
#include "MeshService.h"
#include "NodeDB.h"
#include "PowerFSM.h"
#include "RTC.h"
#include "TypeConversions.h"
#include "gps/RTC.h"
#include "main.h"
#include "mesh-pb-constants.h"
#include "meshUtils.h"

View File

@ -11,12 +11,12 @@
#include "NodeDB.h"
#include "PacketHistory.h"
#include "PowerFSM.h"
#include "RTC.h"
#include "Router.h"
#include "SPILock.h"
#include "SafeFile.h"
#include "TypeConversions.h"
#include "error.h"
#include "gps/RTC.h"
#include "main.h"
#include "mesh-pb-constants.h"
#include "meshUtils.h"

View File

@ -29,7 +29,7 @@
#include "mqtt/MQTT.h"
#endif
#include "Throttle.h"
#include <RTC.h>
#include "gps/RTC.h"
PhoneAPI::PhoneAPI()
{

View File

@ -4,9 +4,9 @@
#include "MeshRadio.h"
#include "MeshService.h"
#include "NodeDB.h"
#include "RTC.h"
#include "configuration.h"
#include "detect/LoRaRadioType.h"
#include "gps/RTC.h"
#include "main.h"
#include "mesh-pb-constants.h"
#include "meshUtils.h"

View File

@ -1,8 +1,8 @@
#include "StreamAPI.h"
#include "PowerFSM.h"
#include "RTC.h"
#include "Throttle.h"
#include "configuration.h"
#include "gps/RTC.h"
#define START1 0x94
#define START2 0xc3

View File

@ -43,7 +43,7 @@ template <class T, class U> class APIServerPort : public U, private concurrency:
* delegate to the worker. Once coroutines are implemented we can relax this restriction.
*/
T *openAPI = NULL;
#if RAK_4631
#if defined(RAK_4631) || defined(RAK11310)
// Track wait time for RAK13800 Ethernet requests
int32_t waitTime = 100;
#endif

View File

@ -1,8 +1,8 @@
#include "mesh/eth/ethClient.h"
#include "NodeDB.h"
#include "RTC.h"
#include "concurrency/Periodic.h"
#include "configuration.h"
#include "gps/RTC.h"
#include "main.h"
#include "mesh/api/ethServerAPI.h"
#include "target_specific.h"

View File

@ -1,8 +1,8 @@
#include "configuration.h"
#if HAS_WIFI
#include "NodeDB.h"
#include "RTC.h"
#include "concurrency/Periodic.h"
#include "gps/RTC.h"
#include "mesh/wifi/WiFiAPClient.h"
#include "main.h"

View File

@ -3,8 +3,8 @@
#include "MeshService.h"
#include "NodeDB.h"
#include "PowerFSM.h"
#include "RTC.h"
#include "SPILock.h"
#include "gps/RTC.h"
#include "meshUtils.h"
#include <FSCommon.h>
#if defined(ARCH_ESP32) && !MESHTASTIC_EXCLUDE_BLUETOOTH

View File

@ -16,10 +16,10 @@
#include "ExternalNotificationModule.h"
#include "MeshService.h"
#include "NodeDB.h"
#include "RTC.h"
#include "Router.h"
#include "buzz/buzz.h"
#include "configuration.h"
#include "gps/RTC.h"
#include "main.h"
#include "mesh/generated/meshtastic/rtttl.pb.h"
#include <Arduino.h>

View File

@ -2,7 +2,7 @@
#include "Default.h"
#include "MeshService.h"
#include "NodeDB.h"
#include "RTC.h"
#include "gps/RTC.h"
#include <Throttle.h>
NeighborInfoModule *neighborInfoModule;

View File

@ -2,9 +2,9 @@
#include "Default.h"
#include "MeshService.h"
#include "NodeDB.h"
#include "RTC.h"
#include "Router.h"
#include "configuration.h"
#include "gps/RTC.h"
#include "main.h"
#include <Throttle.h>

View File

@ -4,12 +4,12 @@
#include "GPS.h"
#include "MeshService.h"
#include "NodeDB.h"
#include "RTC.h"
#include "Router.h"
#include "TypeConversions.h"
#include "airtime.h"
#include "configuration.h"
#include "gps/GeoCoord.h"
#include "gps/RTC.h"
#include "main.h"
#include "mesh/compression/unishox2.h"
#include "meshUtils.h"

View File

@ -3,9 +3,9 @@
#include "MeshService.h"
#include "NodeDB.h"
#include "PowerMon.h"
#include "RTC.h"
#include "Router.h"
#include "configuration.h"
#include "gps/RTC.h"
#include "main.h"
#include "sleep.h"
#include "target_specific.h"

View File

@ -13,12 +13,12 @@
#include "MeshService.h"
#include "NodeDB.h"
#include "PowerFSM.h"
#include "RTC.h"
#include "Router.h"
#include "SPILock.h"
#include "airtime.h"
#include "configuration.h"
#include "gps/GeoCoord.h"
#include "gps/RTC.h"
#include <Arduino.h>
#include <Throttle.h>

View File

@ -1,9 +1,9 @@
#include "RemoteHardwareModule.h"
#include "MeshService.h"
#include "NodeDB.h"
#include "RTC.h"
#include "Router.h"
#include "configuration.h"
#include "gps/RTC.h"
#include "main.h"
#include <Throttle.h>

View File

@ -3,9 +3,9 @@
#include "MeshService.h"
#include "NMEAWPL.h"
#include "NodeDB.h"
#include "RTC.h"
#include "Router.h"
#include "configuration.h"
#include "gps/RTC.h"
#include <Arduino.h>
#include <Throttle.h>

View File

@ -15,11 +15,11 @@
#include "StoreForwardModule.h"
#include "MeshService.h"
#include "NodeDB.h"
#include "RTC.h"
#include "Router.h"
#include "Throttle.h"
#include "airtime.h"
#include "configuration.h"
#include "gps/RTC.h"
#include "memGet.h"
#include "mesh-pb-constants.h"
#include "mesh/generated/meshtastic/storeforward.pb.h"

View File

@ -8,9 +8,9 @@
#include "MeshService.h"
#include "NodeDB.h"
#include "PowerFSM.h"
#include "RTC.h"
#include "Router.h"
#include "detect/ScanI2CTwoWire.h"
#include "gps/RTC.h"
#include "main.h"
#include <Throttle.h>

View File

@ -4,10 +4,10 @@
#include "MeshService.h"
#include "NodeDB.h"
#include "PowerFSM.h"
#include "RTC.h"
#include "RadioLibInterface.h"
#include "Router.h"
#include "configuration.h"
#include "gps/RTC.h"
#include "main.h"
#include <OLEDDisplay.h>
#include <OLEDDisplayUi.h>

View File

@ -8,9 +8,9 @@
#include "MeshService.h"
#include "NodeDB.h"
#include "PowerFSM.h"
#include "RTC.h"
#include "Router.h"
#include "UnitConversions.h"
#include "gps/RTC.h"
#include "main.h"
#include "power.h"
#include "sleep.h"

View File

@ -8,9 +8,9 @@
#include "MeshService.h"
#include "NodeDB.h"
#include "PowerFSM.h"
#include "RTC.h"
#include "Router.h"
#include "UnitConversions.h"
#include "gps/RTC.h"
#include "main.h"
#include "power.h"
#include "sleep.h"

View File

@ -8,8 +8,8 @@
#include "NodeDB.h"
#include "PowerFSM.h"
#include "PowerTelemetry.h"
#include "RTC.h"
#include "Router.h"
#include "gps/RTC.h"
#include "main.h"
#include "power.h"
#include "sleep.h"

View File

@ -4,8 +4,8 @@
#include "FSCommon.h"
#include "MeshService.h"
#include "NodeDB.h"
#include "RTC.h"
#include "Router.h"
#include "gps/RTC.h"
/*
AudioModule

View File

@ -117,9 +117,14 @@ void esp32Setup()
LOG_DEBUG("Free heap: %d", ESP.getFreeHeap());
LOG_DEBUG("Total PSRAM: %d", ESP.getPsramSize());
LOG_DEBUG("Free PSRAM: %d", ESP.getFreePsram());
esp_log_level_set("gpio", ESP_LOG_WARN);
auto res = nvs_flash_init();
assert(res == ESP_OK);
nvs_stats_t nvs_stats;
auto res = nvs_get_stats(NULL, &nvs_stats);
res = nvs_get_stats(NULL, &nvs_stats);
assert(res == ESP_OK);
LOG_DEBUG("NVS: UsedEntries %d, FreeEntries %d, AllEntries %d, NameSpaces %d", nvs_stats.used_entries, nvs_stats.free_entries,
nvs_stats.total_entries, nvs_stats.namespace_count);
@ -170,8 +175,9 @@ void esp32Setup()
#ifdef CONFIG_IDF_TARGET_ESP32C6
esp_task_wdt_config_t *wdt_config = (esp_task_wdt_config_t *)malloc(sizeof(esp_task_wdt_config_t));
wdt_config->timeout_ms = APP_WATCHDOG_SECS * 1000;
wdt_config->idle_core_mask = 0;
wdt_config->trigger_panic = true;
res = esp_task_wdt_init(wdt_config);
res = esp_task_wdt_reconfigure(wdt_config);
assert(res == ESP_OK);
#else
res = esp_task_wdt_init(APP_WATCHDOG_SECS, true);
@ -183,6 +189,17 @@ void esp32Setup()
#ifdef HAS_32768HZ
enableSlowCLK();
#endif
#ifdef USE_XIAO_ESP32C6_EXTERNAL_ANTENNA
#warning "Connect an external antenna to your XIAO ESP32C6; otherwise, it may be damaged!"
gpio_reset_pin(GPIO_NUM_3);
gpio_set_direction(GPIO_NUM_3, GPIO_MODE_OUTPUT);
gpio_set_level(GPIO_NUM_3, LOW);
gpio_reset_pin(GPIO_NUM_14);
gpio_set_direction(GPIO_NUM_14, GPIO_MODE_OUTPUT);
gpio_set_level(GPIO_NUM_14, HIGH);
#endif
}
/// loop code specific to ESP32 targets

View File

@ -1,5 +1,5 @@
#include "RTC.h"
#include "configuration.h"
#include "gps/RTC.h"
#include <stm32wle5xx.h>
#include <stm32wlxx_hal.h>

View File

@ -0,0 +1,20 @@
[env:seeed-xiao-esp32c6]
extends = esp32c6_base
framework = arduino, espidf
board = esp32-c6-devkitm-1
board_check = true
board_build.partitions = partition-table.csv
upload_protocol = esptool
upload_speed = 921600
extra_scripts = pre:bin/platformio-custom.py
build_flags =
${esp32c6_base.build_flags}
-D PRIVATE_HW
-I variants/seeed_xiao_esp32c6
-D ARDUINO_USB_CDC_ON_BOOT=1
-D ARDUINO_USB_MODE=1
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/esp32c3"
-D HAS_BLUETOOTH=1
-D MESHTASTIC_EXCLUDE_WEBSERVER
-D MESHTASTIC_EXCLUDE_MQTT
-D CONFIG_NIMBLE_CPP_FREERTOS_TASK_BLOCK_BIT=1

View File

@ -0,0 +1,44 @@
#define LED_PIN 15
#define LED_STATE_ON 0 // State when LED is lit
#define BUTTON_PIN 21 // This is the Program Button
#define BUTTON_NEED_PULLUP
#define I2C_SDA 22
#define I2C_SCL 23
// #define USE_RF95
#define USE_SX1262
#define LORA_MISO 20
#define LORA_SCK 19
#define LORA_MOSI 18
#ifdef USE_RF95
#define LORA_CS 17
#define LORA_RESET 1
#define LORA_DIO0 0
#define LORA_DIO1 16
#endif
#ifdef USE_SX1262
#define LORA_CS 21
#define LORA_DIO1 2
#define LORA_BUSY 0
#define LORA_RESET 5
#define SX126X_CS LORA_CS
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY LORA_BUSY
#define SX126X_RESET LORA_RESET
#define SX126X_RXEN 4
#define SX126X_TXEN RADIOLIB_NC
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
#endif
#define HAS_GPS 0
#undef GPS_RX_PIN
#undef GPS_TX_PIN
// For BLE/WiFi connectivity
#define USE_XIAO_ESP32C6_EXTERNAL_ANTENNA

View File

@ -1,10 +1,20 @@
[env:tlora-c6]
extends = esp32c6_base
framework = arduino, espidf
board = esp32-c6-devkitm-1
build_flags =
board_check = true
board_build.partitions = partition-table.csv
upload_protocol = esptool
upload_speed = 921600
extra_scripts = pre:bin/platformio-custom.py
build_flags =
${esp32c6_base.build_flags}
-D TLORA_C6
-I variants/tlora_c6
-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_USB_MODE=1
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/esp32c3"
-D ARDUINO_USB_CDC_ON_BOOT=1
-D ARDUINO_USB_MODE=1
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/esp32c3"
-D HAS_BLUETOOTH=1
-D MESHTASTIC_EXCLUDE_WEBSERVER
-D MESHTASTIC_EXCLUDE_MQTT
-D CONFIG_NIMBLE_CPP_FREERTOS_TASK_BLOCK_BIT=1