Compare commits

...

24 Commits

Author SHA1 Message Date
Alexander Begoon
6bfae08965
Merge 310e605af0 into 46c7d74760 2025-06-07 17:53:06 +02:00
github-actions[bot]
46c7d74760
Upgrade trunk (#6968)
Some checks are pending
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 / build-debian-src (push) Waiting to run
CI / package-pio-deps-native-tft (push) Waiting to run
CI / test-native (push) Waiting to run
CI / docker-deb-amd64 (push) Waiting to run
CI / docker-deb-amd64-tft (push) Waiting to run
CI / docker-alp-amd64 (push) Waiting to run
CI / docker-alp-amd64-tft (push) Waiting to run
CI / docker-deb-arm64 (push) Waiting to run
CI / docker-deb-armv7 (push) Waiting to run
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
CI / publish-firmware (push) Blocked by required conditions
Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com>
2025-06-07 07:58:01 -05:00
Tom
15d2ae17f8
Add note to hydra to note that the button pin has no pull-up (#6979)
Add note to hydra to note that the button pin has no pull-up. Use an external resistor or remove the `#define`.
2025-06-07 06:55:58 -05:00
github-actions[bot]
91579c4650
[create-pull-request] automated change (#6980)
Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
2025-06-07 06:55:25 -05:00
Andrew Yong
79b710a108
fix: Respect LED_STATE_ON for power and user LED (#6976)
Signed-off-by: Andrew Yong <me@ndoo.sg>
2025-06-07 06:44:54 -05:00
Thomas Göttgens
310e605af0
Merge branch 'master' into xiao_esp32c6_with_ble 2025-06-05 14:31:56 +02:00
Alexander Begoon
685c8c1df7
Add support for CONFIG_NIMBLE_CPP_IDF in NimbleBluetooth callbacks
Add support 1.x.x version of NimBLE-Arduino
2025-04-29 18:43:41 +02:00
Alexander Begoon
19fa899627
Merge remote-tracking branch 'upstream/master' into xiao_esp32c6_with_ble 2025-04-29 17:50:20 +02: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
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
51 changed files with 328 additions and 76 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,8 +16,8 @@
- 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

8
.gitignore vendored
View File

@ -38,3 +38,11 @@ release/
/compile_commands.json
src/mesh/raspihttp/certificate.pem
src/mesh/raspihttp/private_key.pem
managed_components
dependencies.lock
log_*
sdkconfig
sdkconfig.*
!sdkconfig.defaults

View File

@ -9,7 +9,7 @@ plugins:
lint:
enabled:
- checkov@3.2.436
- renovate@40.41.0
- renovate@40.42.2
- prettier@3.5.3
- trufflehog@3.88.35
- yamllint@1.37.1

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,7 +30,9 @@ lib_deps =
# renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master
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
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:
@ -123,9 +132,10 @@ 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":

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",

@ -1 +1 @@
Subproject commit 24c7a3d287a4bd269ce191827e5dabd8ce8f57a7
Subproject commit db60f07ac298b6161ca553b3868b542cceadcac4

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

@ -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
@ -337,12 +337,12 @@ void setup()
#ifdef LED_POWER
pinMode(LED_POWER, OUTPUT);
digitalWrite(LED_POWER, HIGH);
digitalWrite(LED_POWER, LED_STATE_ON);
#endif
#ifdef USER_LED
pinMode(USER_LED, OUTPUT);
digitalWrite(USER_LED, LOW);
digitalWrite(USER_LED, HIGH ^ LED_STATE_ON);
#endif
#if defined(T_DECK)
@ -1403,3 +1403,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

@ -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

@ -65,6 +65,8 @@ PB_BIND(meshtastic_Config_SessionkeyConfig, meshtastic_Config_SessionkeyConfig,

View File

@ -88,6 +88,23 @@ typedef enum _meshtastic_Config_DeviceConfig_RebroadcastMode {
meshtastic_Config_DeviceConfig_RebroadcastMode_CORE_PORTNUMS_ONLY = 5
} meshtastic_Config_DeviceConfig_RebroadcastMode;
/* Defines buzzer behavior for audio feedback */
typedef enum _meshtastic_Config_DeviceConfig_BuzzerMode {
/* Default behavior.
Buzzer is enabled for all audio feedback including button presses and alerts. */
meshtastic_Config_DeviceConfig_BuzzerMode_ALL_ENABLED = 0,
/* Disabled.
All buzzer audio feedback is disabled. */
meshtastic_Config_DeviceConfig_BuzzerMode_DISABLED = 1,
/* Notifications Only.
Buzzer is enabled only for notifications and alerts, but not for button presses.
External notification config determines the specifics of the notification behavior. */
meshtastic_Config_DeviceConfig_BuzzerMode_NOTIFICATIONS_ONLY = 2,
/* Non-notification system buzzer tones only.
Buzzer is enabled only for non-notification tones such as button presses, startup, shutdown, but not for alerts. */
meshtastic_Config_DeviceConfig_BuzzerMode_SYSTEM_ONLY = 3
} meshtastic_Config_DeviceConfig_BuzzerMode;
/* Bit field of boolean configuration options, indicating which optional
fields to include when assembling POSITION messages.
Longitude, latitude, altitude, speed, heading, and DOP
@ -335,6 +352,9 @@ typedef struct _meshtastic_Config_DeviceConfig {
char tzdef[65];
/* If true, disable the default blinking LED (LED_PIN) behavior on the device */
bool led_heartbeat_disabled;
/* Controls buzzer behavior for audio feedback
Defaults to ENABLED */
meshtastic_Config_DeviceConfig_BuzzerMode buzzer_mode;
} meshtastic_Config_DeviceConfig;
/* Position Config */
@ -618,6 +638,10 @@ extern "C" {
#define _meshtastic_Config_DeviceConfig_RebroadcastMode_MAX meshtastic_Config_DeviceConfig_RebroadcastMode_CORE_PORTNUMS_ONLY
#define _meshtastic_Config_DeviceConfig_RebroadcastMode_ARRAYSIZE ((meshtastic_Config_DeviceConfig_RebroadcastMode)(meshtastic_Config_DeviceConfig_RebroadcastMode_CORE_PORTNUMS_ONLY+1))
#define _meshtastic_Config_DeviceConfig_BuzzerMode_MIN meshtastic_Config_DeviceConfig_BuzzerMode_ALL_ENABLED
#define _meshtastic_Config_DeviceConfig_BuzzerMode_MAX meshtastic_Config_DeviceConfig_BuzzerMode_SYSTEM_ONLY
#define _meshtastic_Config_DeviceConfig_BuzzerMode_ARRAYSIZE ((meshtastic_Config_DeviceConfig_BuzzerMode)(meshtastic_Config_DeviceConfig_BuzzerMode_SYSTEM_ONLY+1))
#define _meshtastic_Config_PositionConfig_PositionFlags_MIN meshtastic_Config_PositionConfig_PositionFlags_UNSET
#define _meshtastic_Config_PositionConfig_PositionFlags_MAX meshtastic_Config_PositionConfig_PositionFlags_SPEED
#define _meshtastic_Config_PositionConfig_PositionFlags_ARRAYSIZE ((meshtastic_Config_PositionConfig_PositionFlags)(meshtastic_Config_PositionConfig_PositionFlags_SPEED+1))
@ -669,6 +693,7 @@ extern "C" {
#define meshtastic_Config_DeviceConfig_role_ENUMTYPE meshtastic_Config_DeviceConfig_Role
#define meshtastic_Config_DeviceConfig_rebroadcast_mode_ENUMTYPE meshtastic_Config_DeviceConfig_RebroadcastMode
#define meshtastic_Config_DeviceConfig_buzzer_mode_ENUMTYPE meshtastic_Config_DeviceConfig_BuzzerMode
#define meshtastic_Config_PositionConfig_gps_mode_ENUMTYPE meshtastic_Config_PositionConfig_GpsMode
@ -692,7 +717,7 @@ extern "C" {
/* Initializer values for message structs */
#define meshtastic_Config_init_default {0, {meshtastic_Config_DeviceConfig_init_default}}
#define meshtastic_Config_DeviceConfig_init_default {_meshtastic_Config_DeviceConfig_Role_MIN, 0, 0, 0, _meshtastic_Config_DeviceConfig_RebroadcastMode_MIN, 0, 0, 0, 0, "", 0}
#define meshtastic_Config_DeviceConfig_init_default {_meshtastic_Config_DeviceConfig_Role_MIN, 0, 0, 0, _meshtastic_Config_DeviceConfig_RebroadcastMode_MIN, 0, 0, 0, 0, "", 0, _meshtastic_Config_DeviceConfig_BuzzerMode_MIN}
#define meshtastic_Config_PositionConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _meshtastic_Config_PositionConfig_GpsMode_MIN}
#define meshtastic_Config_PowerConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0}
#define meshtastic_Config_NetworkConfig_init_default {0, "", "", "", 0, _meshtastic_Config_NetworkConfig_AddressMode_MIN, false, meshtastic_Config_NetworkConfig_IpV4Config_init_default, "", 0, 0}
@ -703,7 +728,7 @@ extern "C" {
#define meshtastic_Config_SecurityConfig_init_default {{0, {0}}, {0, {0}}, 0, {{0, {0}}, {0, {0}}, {0, {0}}}, 0, 0, 0, 0}
#define meshtastic_Config_SessionkeyConfig_init_default {0}
#define meshtastic_Config_init_zero {0, {meshtastic_Config_DeviceConfig_init_zero}}
#define meshtastic_Config_DeviceConfig_init_zero {_meshtastic_Config_DeviceConfig_Role_MIN, 0, 0, 0, _meshtastic_Config_DeviceConfig_RebroadcastMode_MIN, 0, 0, 0, 0, "", 0}
#define meshtastic_Config_DeviceConfig_init_zero {_meshtastic_Config_DeviceConfig_Role_MIN, 0, 0, 0, _meshtastic_Config_DeviceConfig_RebroadcastMode_MIN, 0, 0, 0, 0, "", 0, _meshtastic_Config_DeviceConfig_BuzzerMode_MIN}
#define meshtastic_Config_PositionConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _meshtastic_Config_PositionConfig_GpsMode_MIN}
#define meshtastic_Config_PowerConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0}
#define meshtastic_Config_NetworkConfig_init_zero {0, "", "", "", 0, _meshtastic_Config_NetworkConfig_AddressMode_MIN, false, meshtastic_Config_NetworkConfig_IpV4Config_init_zero, "", 0, 0}
@ -726,6 +751,7 @@ extern "C" {
#define meshtastic_Config_DeviceConfig_disable_triple_click_tag 10
#define meshtastic_Config_DeviceConfig_tzdef_tag 11
#define meshtastic_Config_DeviceConfig_led_heartbeat_disabled_tag 12
#define meshtastic_Config_DeviceConfig_buzzer_mode_tag 13
#define meshtastic_Config_PositionConfig_position_broadcast_secs_tag 1
#define meshtastic_Config_PositionConfig_position_broadcast_smart_enabled_tag 2
#define meshtastic_Config_PositionConfig_fixed_position_tag 3
@ -849,7 +875,8 @@ X(a, STATIC, SINGULAR, BOOL, double_tap_as_button_press, 8) \
X(a, STATIC, SINGULAR, BOOL, is_managed, 9) \
X(a, STATIC, SINGULAR, BOOL, disable_triple_click, 10) \
X(a, STATIC, SINGULAR, STRING, tzdef, 11) \
X(a, STATIC, SINGULAR, BOOL, led_heartbeat_disabled, 12)
X(a, STATIC, SINGULAR, BOOL, led_heartbeat_disabled, 12) \
X(a, STATIC, SINGULAR, UENUM, buzzer_mode, 13)
#define meshtastic_Config_DeviceConfig_CALLBACK NULL
#define meshtastic_Config_DeviceConfig_DEFAULT NULL
@ -995,7 +1022,7 @@ extern const pb_msgdesc_t meshtastic_Config_SessionkeyConfig_msg;
/* Maximum encoded size of messages (where known) */
#define MESHTASTIC_MESHTASTIC_CONFIG_PB_H_MAX_SIZE meshtastic_Config_size
#define meshtastic_Config_BluetoothConfig_size 10
#define meshtastic_Config_DeviceConfig_size 98
#define meshtastic_Config_DeviceConfig_size 100
#define meshtastic_Config_DisplayConfig_size 32
#define meshtastic_Config_LoRaConfig_size 85
#define meshtastic_Config_NetworkConfig_IpV4Config_size 20

View File

@ -55,6 +55,8 @@ typedef enum _meshtastic_Language {
meshtastic_Language_SLOVENIAN = 15,
/* Ukrainian */
meshtastic_Language_UKRAINIAN = 16,
/* Bulgarian */
meshtastic_Language_BULGARIAN = 17,
/* Simplified Chinese (experimental) */
meshtastic_Language_SIMPLIFIED_CHINESE = 30,
/* Traditional Chinese (experimental) */

View File

@ -360,7 +360,7 @@ extern const pb_msgdesc_t meshtastic_BackupPreferences_msg;
/* Maximum encoded size of messages (where known) */
/* meshtastic_NodeDatabase_size depends on runtime parameters */
#define MESHTASTIC_MESHTASTIC_DEVICEONLY_PB_H_MAX_SIZE meshtastic_BackupPreferences_size
#define meshtastic_BackupPreferences_size 2269
#define meshtastic_BackupPreferences_size 2271
#define meshtastic_ChannelFile_size 718
#define meshtastic_DeviceState_size 1722
#define meshtastic_NodeInfoLite_size 196

View File

@ -187,7 +187,7 @@ extern const pb_msgdesc_t meshtastic_LocalModuleConfig_msg;
/* Maximum encoded size of messages (where known) */
#define MESHTASTIC_MESHTASTIC_LOCALONLY_PB_H_MAX_SIZE meshtastic_LocalConfig_size
#define meshtastic_LocalConfig_size 745
#define meshtastic_LocalConfig_size 747
#define meshtastic_LocalModuleConfig_size 669
#ifdef __cplusplus

View File

@ -258,6 +258,12 @@ typedef enum _meshtastic_HardwareModel {
meshtastic_HardwareModel_SEEED_WIO_TRACKER_L1_EINK = 100,
/* Reserved ID for future and past use */
meshtastic_HardwareModel_QWANTZ_TINY_ARMS = 101,
/* *
Lilygo T-Deck Pro */
meshtastic_HardwareModel_T_DECK_PRO = 102,
/* *
Lilygo TLora Pager */
meshtastic_HardwareModel_T_LORA_PAGER = 103,
/* ------------------------------------------------------------------------------------------------------------------------------------------
Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits.
------------------------------------------------------------------------------------------------------------------------------------------ */

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 "memGet.h"
#include <OLEDDisplay.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

@ -49,38 +49,53 @@ static uint8_t lastToRadio[MAX_TO_FROM_RADIO_SIZE];
class NimbleBluetoothToRadioCallback : public NimBLECharacteristicCallbacks
{
#ifdef CONFIG_NIMBLE_CPP_IDF
virtual void onWrite(NimBLECharacteristic *pCharacteristic, NimBLEConnInfo &connInfo){
#else
virtual void onWrite(NimBLECharacteristic *pCharacteristic)
{
#endif
LOG_DEBUG("To Radio onwrite");
auto val = pCharacteristic->getValue();
auto val = pCharacteristic->getValue();
if (memcmp(lastToRadio, val.data(), val.length()) != 0) {
LOG_DEBUG("New ToRadio packet");
memcpy(lastToRadio, val.data(), val.length());
bluetoothPhoneAPI->handleToRadio(val.data(), val.length());
} else {
LOG_DEBUG("Drop dup ToRadio packet we just saw");
}
if (memcmp(lastToRadio, val.data(), val.length()) != 0) {
LOG_DEBUG("New ToRadio packet");
memcpy(lastToRadio, val.data(), val.length());
bluetoothPhoneAPI->handleToRadio(val.data(), val.length());
} else {
LOG_DEBUG("Drop dup ToRadio packet we just saw");
}
};
}
}
;
class NimbleBluetoothFromRadioCallback : public NimBLECharacteristicCallbacks
{
#ifdef CONFIG_NIMBLE_CPP_IDF
virtual void onRead(NimBLECharacteristic *pCharacteristic, NimBLEConnInfo &connInfo){
#else
virtual void onRead(NimBLECharacteristic *pCharacteristic)
{
#endif
uint8_t fromRadioBytes[meshtastic_FromRadio_size];
size_t numBytes = bluetoothPhoneAPI->getFromRadio(fromRadioBytes);
size_t numBytes = bluetoothPhoneAPI->getFromRadio(fromRadioBytes);
std::string fromRadioByteString(fromRadioBytes, fromRadioBytes + numBytes);
std::string fromRadioByteString(fromRadioBytes, fromRadioBytes + numBytes);
pCharacteristic->setValue(fromRadioByteString);
}
};
pCharacteristic->setValue(fromRadioByteString);
}
}
;
class NimbleBluetoothServerCallback : public NimBLEServerCallbacks
{
#ifdef CONFIG_NIMBLE_CPP_IDF
virtual uint32_t onPassKeyDisplay()
{
#else
virtual uint32_t onPassKeyRequest()
{
#endif
uint32_t passkey = config.bluetooth.fixed_pin;
if (config.bluetooth.mode == meshtastic_Config_BluetoothConfig_PairingMode_RANDOM_PIN) {
@ -124,9 +139,13 @@ class NimbleBluetoothServerCallback : public NimBLEServerCallbacks
return passkey;
}
#ifdef CONFIG_NIMBLE_CPP_IDF
virtual void onAuthenticationComplete(NimBLEConnInfo &connInfo)
{
#else
virtual void onAuthenticationComplete(ble_gap_conn_desc *desc)
{
#endif
LOG_INFO("BLE authentication complete");
bluetoothStatus->updateStatus(new meshtastic::BluetoothStatus(meshtastic::BluetoothStatus::ConnectionState::CONNECTED));
@ -138,10 +157,15 @@ class NimbleBluetoothServerCallback : public NimBLEServerCallbacks
}
}
#ifdef CONFIG_NIMBLE_CPP_IDF
virtual void onDisconnect(NimBLEServer *pServer, NimBLEConnInfo &connInfo, int reason)
{
LOG_INFO("BLE disconnect. Reason: %i", reason);
#else
virtual void onDisconnect(NimBLEServer *pServer, ble_gap_conn_desc *desc)
{
LOG_INFO("BLE disconnect");
#endif
bluetoothStatus->updateStatus(
new meshtastic::BluetoothStatus(meshtastic::BluetoothStatus::ConnectionState::DISCONNECTED));
@ -191,7 +215,11 @@ int NimbleBluetooth::getRssi()
if (bleServer && isConnected()) {
auto service = bleServer->getServiceByUUID(MESH_SERVICE_UUID);
uint16_t handle = service->getHandle();
#ifdef CONFIG_NIMBLE_CPP_IDF
return NimBLEDevice::getClientByHandle(handle)->getRssi();
#else
return NimBLEDevice::getClientByID(handle)->getRssi();
#endif
}
return 0; // FIXME figure out where to source this
}
@ -216,6 +244,9 @@ void NimbleBluetooth::setup()
NimbleBluetoothServerCallback *serverCallbacks = new NimbleBluetoothServerCallback();
bleServer->setCallbacks(serverCallbacks, true);
#ifdef CONFIG_NIMBLE_CPP_IDF
bleServer->advertiseOnDisconnect(true);
#endif
setupService();
startAdvertising();
}
@ -259,7 +290,11 @@ void NimbleBluetooth::setupService()
BatteryCharacteristic = batteryService->createCharacteristic( // 0x2A19 is the Battery Level characteristic)
(uint16_t)0x2a19, NIMBLE_PROPERTY::READ | NIMBLE_PROPERTY::NOTIFY, 1);
#ifdef CONFIG_NIMBLE_CPP_IDF
NimBLE2904 *batteryLevelDescriptor = (NimBLE2904 *)BatteryCharacteristic->create2904();
#else
NimBLE2904 *batteryLevelDescriptor = (NimBLE2904 *)BatteryCharacteristic->createDescriptor((uint16_t)0x2904);
#endif
batteryLevelDescriptor->setFormat(NimBLE2904::FORMAT_UINT8);
batteryLevelDescriptor->setNamespace(1);
batteryLevelDescriptor->setUnit(0x27ad);

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

@ -9,6 +9,8 @@
#define GPS_POWER_TOGGLE // Moved definition from platformio.ini to here
#define BUTTON_PIN 39 // The middle button GPIO on the T-Beam
// Note: On the ESP32 base version, gpio34-39 are input-only, and do not have internal pull-ups.
// If 39 is not being used for a button, it is suggested to remove the #define.
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
#define ADC_MULTIPLIER 1.85 // (R1 = 470k, R2 = 680k)

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,9 +1,20 @@
[env:tlora-c6]
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 TLORA_C6
-I variants/tlora_c6
-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_USB_MODE=1
-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