From 91dd39a651fbf098e8ce528688da16a52c577257 Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Fri, 16 Jan 2026 10:18:02 +1100 Subject: [PATCH 1/2] Add sqlite depdendency (Cherry-picks from sfpp) (#9328) * Add sqlite to build requires * Add missed comma * Add sqlite dev to more dockerfiles * Alpine docker fix * Add sqlite to build requires * Add sqlite depdendency (Cherry-picks from sfpp) Store and Forward Plus Plus requires sqlite to work. This PR cherry picks the commits that added the dependency so that this can be added, and reduce the amount of effort to review sfpp. Authored-By: @jp-bennett --------- Co-authored-by: Jonathan Bennett --- .clusterfuzzlite/Dockerfile | 2 +- Dockerfile | 2 +- alpine.Dockerfile | 2 +- debian/control | 3 ++- meshtasticd.spec.rpkg | 1 + 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.clusterfuzzlite/Dockerfile b/.clusterfuzzlite/Dockerfile index a769a976d..54b5cda0f 100644 --- a/.clusterfuzzlite/Dockerfile +++ b/.clusterfuzzlite/Dockerfile @@ -20,7 +20,7 @@ ENV PIP_ROOT_USER_ACTION=ignore RUN apt-get update && apt-get install --no-install-recommends -y \ cmake git zip libgpiod-dev libbluetooth-dev libi2c-dev \ libunistring-dev libmicrohttpd-dev libgnutls28-dev libgcrypt20-dev \ - libusb-1.0-0-dev libssl-dev pkg-config && \ + libusb-1.0-0-dev libssl-dev pkg-config libsqlite3-dev && \ apt-get clean && rm -rf /var/lib/apt/lists/* && \ pip install --no-cache-dir -U \ platformio==6.1.16 \ diff --git a/Dockerfile b/Dockerfile index 111dd69fc..91d3f7796 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ curl wget g++ zip git ca-certificates pkg-config \ libgpiod-dev libyaml-cpp-dev libbluetooth-dev libi2c-dev libuv1-dev \ libusb-1.0-0-dev libulfius-dev liborcania-dev libssl-dev \ - libx11-dev libinput-dev libxkbcommon-x11-dev \ + libx11-dev libinput-dev libxkbcommon-x11-dev libsqlite3-dev \ && apt-get clean && rm -rf /var/lib/apt/lists/* \ && pip install --no-cache-dir -U platformio \ && mkdir /tmp/firmware diff --git a/alpine.Dockerfile b/alpine.Dockerfile index b3b384101..64c281788 100644 --- a/alpine.Dockerfile +++ b/alpine.Dockerfile @@ -11,7 +11,7 @@ RUN apk --no-cache add \ bash g++ libstdc++-dev linux-headers zip git ca-certificates libbsd-dev \ libgpiod-dev yaml-cpp-dev bluez-dev \ libusb-dev i2c-tools-dev libuv-dev openssl-dev pkgconf argp-standalone \ - libx11-dev libinput-dev libxkbcommon-dev \ + libx11-dev libinput-dev libxkbcommon-dev sqlite-dev \ && rm -rf /var/cache/apk/* \ && pip install --no-cache-dir -U platformio \ && mkdir /tmp/firmware diff --git a/debian/control b/debian/control index 679a444c9..46c932a80 100644 --- a/debian/control +++ b/debian/control @@ -25,7 +25,8 @@ Build-Depends: debhelper-compat (= 13), liborcania-dev, libx11-dev, libinput-dev, - libxkbcommon-x11-dev + libxkbcommon-x11-dev, + libsqlite3-dev Standards-Version: 4.6.2 Homepage: https://github.com/meshtastic/firmware Rules-Requires-Root: no diff --git a/meshtasticd.spec.rpkg b/meshtasticd.spec.rpkg index 0819d5f8d..fc14ede7f 100644 --- a/meshtasticd.spec.rpkg +++ b/meshtasticd.spec.rpkg @@ -39,6 +39,7 @@ BuildRequires: pkgconfig(bluez) BuildRequires: pkgconfig(libusb-1.0) BuildRequires: libi2c-devel BuildRequires: pkgconfig(libuv) +BuildRequires: pkgconfig(sqlite3) # Web components: BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(liborcania) From 93e2c945fe1e3b717ab9d2a72411b5eb91566405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Mon, 22 Sep 2025 09:28:25 +0200 Subject: [PATCH 2/2] ThinkNode G3, ETH support WIP --- src/DebugConfiguration.h | 9 ++++- src/main.cpp | 2 +- src/mesh/InterfacesTemplates.cpp | 2 +- src/mesh/api/ethServerAPI.cpp | 2 +- src/mesh/api/ethServerAPI.h | 2 +- src/mesh/wifi/WiFiAPClient.cpp | 8 ++--- src/modules/AdminModule.cpp | 2 +- src/mqtt/MQTT.h | 2 +- .../ELECROW-ThinkNode-G3/pins_arduino.h | 26 ++++++++++++++ .../ELECROW-ThinkNode-G3/platformio.ini | 22 ++++++++++++ .../esp32s3/ELECROW-ThinkNode-G3/variant.h | 36 +++++++++++++++++++ 11 files changed, 102 insertions(+), 11 deletions(-) create mode 100644 variants/esp32s3/ELECROW-ThinkNode-G3/pins_arduino.h create mode 100644 variants/esp32s3/ELECROW-ThinkNode-G3/platformio.ini create mode 100644 variants/esp32s3/ELECROW-ThinkNode-G3/variant.h diff --git a/src/DebugConfiguration.h b/src/DebugConfiguration.h index eac6260fc..a78dde78e 100644 --- a/src/DebugConfiguration.h +++ b/src/DebugConfiguration.h @@ -13,6 +13,11 @@ extern MemGet memGet; #define LED_STATE_ON 1 #endif +// WIFI LED +#ifndef WIFI_STATE_ON +#define WIFI_STATE_ON 1 +#endif + // ----------------------------------------------------------------------------- // DEBUG // ----------------------------------------------------------------------------- @@ -147,7 +152,9 @@ extern "C" void logLegacy(const char *level, const char *fmt, ...); // Default Bluetooth PIN #define defaultBLEPin 123456 -#if HAS_ETHERNET && !defined(USE_WS5500) +#if HAS_ETHERNET && defined(USE_CH390D) +#include +#elif HAS_ETHERNET && !defined(USE_WS5500) #include #endif // HAS_ETHERNET diff --git a/src/main.cpp b/src/main.cpp index 88282c837..69678237d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -337,7 +337,7 @@ void setup() #ifdef WIFI_LED pinMode(WIFI_LED, OUTPUT); - digitalWrite(WIFI_LED, LOW); + digitalWrite(WIFI_LED, HIGH ^ WIFI_STATE_ON); #endif #ifdef BLE_LED diff --git a/src/mesh/InterfacesTemplates.cpp b/src/mesh/InterfacesTemplates.cpp index 57abbf0ee..c246141dc 100644 --- a/src/mesh/InterfacesTemplates.cpp +++ b/src/mesh/InterfacesTemplates.cpp @@ -25,7 +25,7 @@ template class LR11x0Interface; template class SX126xInterface; #endif -#if HAS_ETHERNET && !defined(USE_WS5500) +#if HAS_ETHERNET && !defined(USE_WS5500) && !defined(USE_CH390D) #include "api/ethServerAPI.h" template class ServerAPI; template class APIServerPort; diff --git a/src/mesh/api/ethServerAPI.cpp b/src/mesh/api/ethServerAPI.cpp index 10ff06df2..892718e04 100644 --- a/src/mesh/api/ethServerAPI.cpp +++ b/src/mesh/api/ethServerAPI.cpp @@ -1,7 +1,7 @@ #include "configuration.h" #include -#if HAS_ETHERNET && !defined(USE_WS5500) +#if HAS_ETHERNET && !defined(USE_WS5500) && !defined(USE_CH390D) #include "ethServerAPI.h" diff --git a/src/mesh/api/ethServerAPI.h b/src/mesh/api/ethServerAPI.h index c616c87be..5667dea15 100644 --- a/src/mesh/api/ethServerAPI.h +++ b/src/mesh/api/ethServerAPI.h @@ -1,7 +1,7 @@ #pragma once #include "ServerAPI.h" -#ifndef USE_WS5500 +#if !defined(USE_WS5500) && !defined(USE_CH390D) #include /** diff --git a/src/mesh/wifi/WiFiAPClient.cpp b/src/mesh/wifi/WiFiAPClient.cpp index a95dfa58f..7bb5220e5 100644 --- a/src/mesh/wifi/WiFiAPClient.cpp +++ b/src/mesh/wifi/WiFiAPClient.cpp @@ -384,13 +384,13 @@ static void WiFiEvent(WiFiEvent_t event) #endif } #ifdef WIFI_LED - digitalWrite(WIFI_LED, HIGH); + digitalWrite(WIFI_LED, LOW ^ WIFI_STATE_ON); #endif break; case ARDUINO_EVENT_WIFI_STA_DISCONNECTED: LOG_INFO("Disconnected from WiFi access point"); #ifdef WIFI_LED - digitalWrite(WIFI_LED, LOW); + digitalWrite(WIFI_LED, HIGH ^ WIFI_STATE_ON); #endif if (!isReconnecting) { WiFi.disconnect(false, true); @@ -442,13 +442,13 @@ static void WiFiEvent(WiFiEvent_t event) case ARDUINO_EVENT_WIFI_AP_START: LOG_INFO("WiFi access point started"); #ifdef WIFI_LED - digitalWrite(WIFI_LED, HIGH); + digitalWrite(WIFI_LED, LOW ^ WIFI_STATE_ON); #endif break; case ARDUINO_EVENT_WIFI_AP_STOP: LOG_INFO("WiFi access point stopped"); #ifdef WIFI_LED - digitalWrite(WIFI_LED, LOW); + digitalWrite(WIFI_LED, HIGH ^ WIFI_STATE_ON); #endif break; case ARDUINO_EVENT_WIFI_AP_STACONNECTED: diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 990ca0f46..75a6ebff8 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -1238,7 +1238,7 @@ void AdminModule::handleGetDeviceConnectionStatus(const meshtastic_MeshPacket &r } #endif -#if HAS_ETHERNET && !defined(USE_WS5500) +#if HAS_ETHERNET && !defined(USE_WS5500) && !defined(USE_CH390D) conn.has_ethernet = true; conn.ethernet.has_status = true; if (Ethernet.linkStatus() == LinkON) { diff --git a/src/mqtt/MQTT.h b/src/mqtt/MQTT.h index 7d5715602..b1b143f04 100644 --- a/src/mqtt/MQTT.h +++ b/src/mqtt/MQTT.h @@ -15,7 +15,7 @@ #include #endif #endif -#if HAS_ETHERNET && !defined(USE_WS5500) +#if HAS_ETHERNET && !defined(USE_WS5500) && !defined(USE_CH390D) #include #endif diff --git a/variants/esp32s3/ELECROW-ThinkNode-G3/pins_arduino.h b/variants/esp32s3/ELECROW-ThinkNode-G3/pins_arduino.h new file mode 100644 index 000000000..359355772 --- /dev/null +++ b/variants/esp32s3/ELECROW-ThinkNode-G3/pins_arduino.h @@ -0,0 +1,26 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +#define USB_VID 0x303a +#define USB_PID 0x1001 + +// The default Wire will be mapped to PMU and RTC +static const uint8_t SDA = 17; +static const uint8_t SCL = 18; + +// Default SPI will be mapped to Radio +static const uint8_t SS = 39; +static const uint8_t MOSI = 40; +static const uint8_t MISO = 41; +static const uint8_t SCK = 42; + +// #define SPI_MOSI (11) +// #define SPI_SCK (10) +// #define SPI_MISO (9) +// #define SPI_CS (12) + +// #define SDCARD_CS SPI_CS + +#endif /* Pins_Arduino_h */ \ No newline at end of file diff --git a/variants/esp32s3/ELECROW-ThinkNode-G3/platformio.ini b/variants/esp32s3/ELECROW-ThinkNode-G3/platformio.ini new file mode 100644 index 000000000..6271b99ac --- /dev/null +++ b/variants/esp32s3/ELECROW-ThinkNode-G3/platformio.ini @@ -0,0 +1,22 @@ +[env:thinknode_g3] +extends = esp32s3_base +board = ESP32-S3-WROOM-1-N4 +board_build.psram_type = opi + +build_flags = + ${esp32s3_base.build_flags} + -D ELECROW_ThinkNode_G3 + -D HAS_UDP_MULTICAST=1 + -D BOARD_HAS_PSRAM + -D PRIVATE_HW +# -D CONFIG_ETH_ENABLED=1 +# -D CONFIG_ETH_USE_ESP32_EMAC=1 + -I variants/esp32s3/ELECROW-ThinkNode-G3 + -mfix-esp32-psram-cache-issue + +lib_ignore = + Ethernet + +lib_deps = + ${esp32s3_base.lib_deps} +# file://../ESP32-CH390/ESP32-CH390-1.0.1.tar.gz diff --git a/variants/esp32s3/ELECROW-ThinkNode-G3/variant.h b/variants/esp32s3/ELECROW-ThinkNode-G3/variant.h new file mode 100644 index 000000000..4ec352d23 --- /dev/null +++ b/variants/esp32s3/ELECROW-ThinkNode-G3/variant.h @@ -0,0 +1,36 @@ +#define HAS_GPS 0 +#define HAS_WIRE 0 +#define I2C_NO_RESCAN + +#define WIFI_LED 5 +#define WIFI_STATE_ON 0 + +#define LED_PIN 6 // The blue LORA LED +#define LED_STATE_ON 0 +#define BUTTON_PIN 4 // the external user button of the device, BOOT and RESET are not accessible without opening it up. + +#define USE_SX1262 +#define LORA_SCK 42 +#define LORA_MISO 41 +#define LORA_MOSI 40 +#define LORA_CS 39 +#define LORA_RESET 21 + +#define SX126X_CS LORA_CS +#define SX126X_DIO1 15 +#define SX126X_BUSY 47 +#define SX126X_RESET LORA_RESET +#define SX126X_DIO2_AS_RF_SWITCH +#define SX126X_DIO3_TCXO_VOLTAGE 1.8 +#define PIN_POWER_EN 45 + +// #define HAS_ETHERNET 1 +// #define USE_CH390D 1 // this driver uses the same stack as the ESP32 Wifi driver + +// #define ETH_MISO_PIN 47 +// #define ETH_MOSI_PIN 21 +// #define ETH_SCLK_PIN 48 +// #define ETH_CS_PIN 45 +// #define ETH_INT_PIN 14 +// #define ETH_RST_PIN -1 +// #define ETH_ADDR 1 \ No newline at end of file