mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-23 09:06:02 +00:00
Fix conflicts
This commit is contained in:
parent
f0f2cd0e0e
commit
09222fde96
10
.gitignore
vendored
10
.gitignore
vendored
@ -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
6
CMakeLists.txt
Normal 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)
|
@ -46,7 +46,7 @@ lib_deps =
|
||||
${environmental_base.lib_deps}
|
||||
${radiolib_base.lib_deps}
|
||||
https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2
|
||||
h2zero/NimBLE-Arduino@^1.4.3
|
||||
h2zero/NimBLE-Arduino@^2.1.0
|
||||
https://github.com/dbinfrago/libpax.git#3cdc0371c375676a97967547f4065607d4c53fd1
|
||||
lewisxhe/XPowersLib@^0.2.7
|
||||
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f
|
||||
|
@ -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,7 +131,8 @@ flags = [
|
||||
print ("Using flags:")
|
||||
for flag in flags:
|
||||
print(flag)
|
||||
|
||||
projenv.Append(
|
||||
CCFLAGS=flags,
|
||||
)
|
||||
|
||||
if projenv:
|
||||
projenv.Append(CCFLAGS=flags)
|
||||
|
||||
env.Append(CCFLAGS=flags)
|
@ -56,7 +56,7 @@ build_flags = -Wno-missing-field-initializers
|
||||
monitor_speed = 115200
|
||||
monitor_filters = direct
|
||||
lib_deps =
|
||||
https://github.com/meshtastic/esp8266-oled-ssd1306.git#e16cee124fe26490cb14880c679321ad8ac89c95
|
||||
https://github.com/meshtastic/esp8266-oled-ssd1306.git#3e9fce851952aa78ef6ce44e892ec9bcf31e1c0b
|
||||
mathertel/OneButton@2.6.1
|
||||
https://github.com/meshtastic/arduino-fsm.git#7db3702bf0cfe97b783d6c72595e3f38e0b19159
|
||||
https://github.com/meshtastic/TinyGPSPlus.git#71a82db35f3b973440044c476d4bcdc673b104f4
|
||||
|
34
sdkconfig.defaults
Normal file
34
sdkconfig.defaults
Normal file
@ -0,0 +1,34 @@
|
||||
# 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
14
src/CMakeLists.txt
Normal 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)
|
@ -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>
|
||||
|
@ -9,9 +9,9 @@
|
||||
#include "GpioLogic.h"
|
||||
#include "NodeDB.h"
|
||||
#include "PowerMon.h"
|
||||
#include "RTC.h"
|
||||
#include "Throttle.h"
|
||||
#include "buzz.h"
|
||||
#include "gps/RTC.h"
|
||||
#include "meshUtils.h"
|
||||
|
||||
#include "main.h" // pmu_found
|
||||
|
@ -1,7 +1,7 @@
|
||||
#if !MESHTASTIC_EXCLUDE_GPS
|
||||
#include "NMEAWPL.h"
|
||||
#include "GeoCoord.h"
|
||||
#include "RTC.h"
|
||||
#include "gps/RTC.h"
|
||||
#include <time.h>
|
||||
|
||||
/* -------------------------------------------
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "RTC.h"
|
||||
#include "gps/RTC.h"
|
||||
#include "configuration.h"
|
||||
#include "detect/ScanI2C.h"
|
||||
#include "main.h"
|
||||
|
14
src/main.cpp
14
src/main.cpp
@ -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
|
||||
@ -1275,4 +1275,16 @@ void loop()
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_AUTOSTART_ARDUINO) && (ESP_IDF_VERSION_MAJOR * 100 + ESP_IDF_VERSION_MINOR * 10 + ESP_IDF_VERSION_PATCH) > 514
|
||||
// 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
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "mqtt/MQTT.h"
|
||||
#endif
|
||||
#include "Throttle.h"
|
||||
#include <RTC.h>
|
||||
#include "gps/RTC.h"
|
||||
|
||||
PhoneAPI::PhoneAPI()
|
||||
{
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -4,8 +4,8 @@
|
||||
#include "FSCommon.h"
|
||||
#include "MeshService.h"
|
||||
#include "NodeDB.h"
|
||||
#include "RTC.h"
|
||||
#include "Router.h"
|
||||
#include "gps/RTC.h"
|
||||
|
||||
/*
|
||||
AudioModule
|
||||
|
@ -49,7 +49,7 @@ static uint8_t lastToRadio[MAX_TO_FROM_RADIO_SIZE];
|
||||
|
||||
class NimbleBluetoothToRadioCallback : public NimBLECharacteristicCallbacks
|
||||
{
|
||||
virtual void onWrite(NimBLECharacteristic *pCharacteristic)
|
||||
virtual void onWrite(NimBLECharacteristic *pCharacteristic, NimBLEConnInfo &connInfo)
|
||||
{
|
||||
LOG_DEBUG("To Radio onwrite");
|
||||
auto val = pCharacteristic->getValue();
|
||||
@ -66,7 +66,7 @@ class NimbleBluetoothToRadioCallback : public NimBLECharacteristicCallbacks
|
||||
|
||||
class NimbleBluetoothFromRadioCallback : public NimBLECharacteristicCallbacks
|
||||
{
|
||||
virtual void onRead(NimBLECharacteristic *pCharacteristic)
|
||||
virtual void onRead(NimBLECharacteristic *pCharacteristic, NimBLEConnInfo &connInfo)
|
||||
{
|
||||
uint8_t fromRadioBytes[meshtastic_FromRadio_size];
|
||||
size_t numBytes = bluetoothPhoneAPI->getFromRadio(fromRadioBytes);
|
||||
@ -79,7 +79,7 @@ class NimbleBluetoothFromRadioCallback : public NimBLECharacteristicCallbacks
|
||||
|
||||
class NimbleBluetoothServerCallback : public NimBLEServerCallbacks
|
||||
{
|
||||
virtual uint32_t onPassKeyRequest()
|
||||
virtual void onPassKeyEntry(NimBLEConnInfo &connInfo)
|
||||
{
|
||||
uint32_t passkey = config.bluetooth.fixed_pin;
|
||||
|
||||
@ -122,10 +122,10 @@ class NimbleBluetoothServerCallback : public NimBLEServerCallbacks
|
||||
#endif
|
||||
passkeyShowing = true;
|
||||
|
||||
return passkey;
|
||||
NimBLEDevice::injectPassKey(connInfo, passkey);
|
||||
}
|
||||
|
||||
virtual void onAuthenticationComplete(ble_gap_conn_desc *desc)
|
||||
virtual void onAuthenticationComplete(NimBLEConnInfo &connInfo)
|
||||
{
|
||||
LOG_INFO("BLE authentication complete");
|
||||
|
||||
@ -138,9 +138,9 @@ class NimbleBluetoothServerCallback : public NimBLEServerCallbacks
|
||||
}
|
||||
}
|
||||
|
||||
virtual void onDisconnect(NimBLEServer *pServer, ble_gap_conn_desc *desc)
|
||||
virtual void onDisconnect(NimBLEServer *pServer, NimBLEConnInfo &connInfo, int reason)
|
||||
{
|
||||
LOG_INFO("BLE disconnect");
|
||||
LOG_INFO("BLE disconnect. Reason %i", reason);
|
||||
|
||||
bluetoothStatus->updateStatus(
|
||||
new meshtastic::BluetoothStatus(meshtastic::BluetoothStatus::ConnectionState::DISCONNECTED));
|
||||
@ -191,7 +191,7 @@ int NimbleBluetooth::getRssi()
|
||||
if (bleServer && isConnected()) {
|
||||
auto service = bleServer->getServiceByUUID(MESH_SERVICE_UUID);
|
||||
uint16_t handle = service->getHandle();
|
||||
return NimBLEDevice::getClientByID(handle)->getRssi();
|
||||
return NimBLEDevice::getClientByHandle(handle)->getRssi();
|
||||
}
|
||||
return 0; // FIXME figure out where to source this
|
||||
}
|
||||
@ -216,6 +216,7 @@ void NimbleBluetooth::setup()
|
||||
|
||||
NimbleBluetoothServerCallback *serverCallbacks = new NimbleBluetoothServerCallback();
|
||||
bleServer->setCallbacks(serverCallbacks, true);
|
||||
bleServer->advertiseOnDisconnect(true);
|
||||
setupService();
|
||||
startAdvertising();
|
||||
}
|
||||
|
@ -109,9 +109,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);
|
||||
@ -155,8 +160,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);
|
||||
@ -168,6 +174,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
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "RTC.h"
|
||||
#include "configuration.h"
|
||||
#include "gps/RTC.h"
|
||||
#include <stm32wle5xx.h>
|
||||
#include <stm32wlxx_hal.h>
|
||||
|
||||
|
40
variants/seeed_xiao_esp32c6/platformio.ini
Normal file
40
variants/seeed_xiao_esp32c6/platformio.ini
Normal file
@ -0,0 +1,40 @@
|
||||
[env:seeed-xiao-esp32c6]
|
||||
extends = esp32c6_base
|
||||
platform = https://github.com/pioarduino/platform-espressif32.git#f5d602fa7b4b778604306a149fe474723e79be2d
|
||||
framework = arduino, espidf
|
||||
board = esp32-c6-devkitm-1
|
||||
board_check = true
|
||||
board_build.partitions = partition-table.csv
|
||||
upload_protocol = esptool
|
||||
upload_speed = 921600
|
||||
monitor_speed = 460800
|
||||
monitor_filters = esp32_c3_exception_decoder
|
||||
extra_scripts = pre:bin/platformio-custom.py
|
||||
build_unflags =
|
||||
-D HAS_BLUETOOTH
|
||||
-D MESHTASTIC_EXCLUDE_BLUETOOTH
|
||||
-D HAS_WIFI
|
||||
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
|
||||
|
||||
board_build.embed_txtfiles =
|
||||
managed_components/espressif__esp_insights/server_certs/https_server.crt
|
||||
managed_components/espressif__esp_rainmaker/server_certs/rmaker_mqtt_server.crt
|
||||
managed_components/espressif__esp_rainmaker/server_certs/rmaker_claim_service_server.crt
|
||||
managed_components/espressif__esp_rainmaker/server_certs/rmaker_ota_server.crt
|
||||
|
||||
lib_deps =
|
||||
${esp32c6_base.lib_deps}
|
||||
https://github.com/h2zero/esp-nimble-cpp.git#2.0.2
|
||||
|
||||
lib_ignore =
|
||||
${esp32c6_base.lib_ignore}
|
43
variants/seeed_xiao_esp32c6/variant.h
Normal file
43
variants/seeed_xiao_esp32c6/variant.h
Normal file
@ -0,0 +1,43 @@
|
||||
#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
|
||||
|
||||
#define USE_XIAO_ESP32C6_EXTERNAL_ANTENNA
|
@ -1,10 +1,41 @@
|
||||
[env:tlora-c6]
|
||||
extends = esp32c6_base
|
||||
platform = https://github.com/pioarduino/platform-espressif32.git#f5d602fa7b4b778604306a149fe474723e79be2d
|
||||
framework = arduino, espidf
|
||||
board = esp32-c6-devkitm-1
|
||||
build_flags =
|
||||
board_build.partitions = partition-table.csv
|
||||
upload_protocol = esptool
|
||||
upload_speed = 921600
|
||||
monitor_speed = 460800
|
||||
monitor_filters = esp32_c3_exception_decoder
|
||||
extra_scripts = pre:bin/platformio-custom.py
|
||||
|
||||
build_unflags =
|
||||
-D HAS_BLUETOOTH
|
||||
-D MESHTASTIC_EXCLUDE_BLUETOOTH
|
||||
-D HAS_WIFI
|
||||
|
||||
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"
|
||||
-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
|
||||
|
||||
board_build.embed_txtfiles =
|
||||
managed_components/espressif__esp_insights/server_certs/https_server.crt
|
||||
managed_components/espressif__esp_rainmaker/server_certs/rmaker_mqtt_server.crt
|
||||
managed_components/espressif__esp_rainmaker/server_certs/rmaker_claim_service_server.crt
|
||||
managed_components/espressif__esp_rainmaker/server_certs/rmaker_ota_server.crt
|
||||
|
||||
lib_deps =
|
||||
${esp32c6_base.lib_deps}
|
||||
https://github.com/h2zero/esp-nimble-cpp.git#2.0.2
|
||||
|
||||
lib_ignore =
|
||||
${esp32c6_base.lib_ignore}
|
||||
|
Loading…
Reference in New Issue
Block a user