mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-18 16:15:36 +00:00
Merge branch 'master' into master
This commit is contained in:
commit
98b8776d65
@ -1 +1 @@
|
|||||||
Subproject commit 035a8017b87379f17624f7bba9b6a5b127bc026c
|
Subproject commit 14ec205865592fcfa798065bb001a549fc77b438
|
@ -121,10 +121,15 @@ extern "C" void logLegacy(const char *level, const char *fmt, ...);
|
|||||||
// Default Bluetooth PIN
|
// Default Bluetooth PIN
|
||||||
#define defaultBLEPin 123456
|
#define defaultBLEPin 123456
|
||||||
|
|
||||||
#if HAS_ETHERNET
|
#if HAS_ETHERNET && !defined(USE_WS5500)
|
||||||
#include <RAK13800_W5100S.h>
|
#include <RAK13800_W5100S.h>
|
||||||
#endif // HAS_ETHERNET
|
#endif // HAS_ETHERNET
|
||||||
|
|
||||||
|
#if HAS_ETHERNET && defined(USE_WS5500)
|
||||||
|
#include <ETHClass2.h>
|
||||||
|
#define ETH ETH2
|
||||||
|
#endif // HAS_ETHERNET
|
||||||
|
|
||||||
#if HAS_WIFI
|
#if HAS_WIFI
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
#endif // HAS_WIFI
|
#endif // HAS_WIFI
|
||||||
@ -164,4 +169,4 @@ class Syslog
|
|||||||
bool vlogf(uint16_t pri, const char *appName, const char *fmt, va_list args) __attribute__((format(printf, 3, 0)));
|
bool vlogf(uint16_t pri, const char *appName, const char *fmt, va_list args) __attribute__((format(printf, 3, 0)));
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // HAS_ETHERNET || HAS_WIFI
|
#endif // HAS_NETWORKING
|
@ -32,6 +32,11 @@
|
|||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if HAS_ETHERNET && defined(USE_WS5500)
|
||||||
|
#include <ETHClass2.h>
|
||||||
|
#define ETH ETH2
|
||||||
|
#endif // HAS_ETHERNET
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef DELAY_FOREVER
|
#ifndef DELAY_FOREVER
|
||||||
|
@ -1104,12 +1104,16 @@ int32_t GPS::runOnce()
|
|||||||
return (powerState == GPS_ACTIVE) ? GPS_THREAD_INTERVAL : 5000;
|
return (powerState == GPS_ACTIVE) ? GPS_THREAD_INTERVAL : 5000;
|
||||||
}
|
}
|
||||||
|
|
||||||
// clear the GPS rx buffer as quickly as possible
|
// clear the GPS rx/tx buffer as quickly as possible
|
||||||
void GPS::clearBuffer()
|
void GPS::clearBuffer()
|
||||||
{
|
{
|
||||||
|
#ifdef ARCH_ESP32
|
||||||
|
_serial_gps->flush(false);
|
||||||
|
#else
|
||||||
int x = _serial_gps->available();
|
int x = _serial_gps->available();
|
||||||
while (x--)
|
while (x--)
|
||||||
_serial_gps->read();
|
_serial_gps->read();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Prepare the GPS for the cpu entering deep or light sleep, expect to be gone for at least 100s of msecs
|
/// Prepare the GPS for the cpu entering deep or light sleep, expect to be gone for at least 100s of msecs
|
||||||
|
@ -55,12 +55,12 @@ NimbleBluetooth *nimbleBluetooth = nullptr;
|
|||||||
NRF52Bluetooth *nrf52Bluetooth = nullptr;
|
NRF52Bluetooth *nrf52Bluetooth = nullptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_WIFI
|
#if HAS_WIFI || defined(USE_WS5500)
|
||||||
#include "mesh/api/WiFiServerAPI.h"
|
#include "mesh/api/WiFiServerAPI.h"
|
||||||
#include "mesh/wifi/WiFiAPClient.h"
|
#include "mesh/wifi/WiFiAPClient.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_ETHERNET
|
#if HAS_ETHERNET && !defined(USE_WS5500)
|
||||||
#include "mesh/api/ethServerAPI.h"
|
#include "mesh/api/ethServerAPI.h"
|
||||||
#include "mesh/eth/ethClient.h"
|
#include "mesh/eth/ethClient.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -25,7 +25,7 @@ template class LR11x0Interface<LR1121>;
|
|||||||
template class SX126xInterface<STM32WLx>;
|
template class SX126xInterface<STM32WLx>;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_ETHERNET
|
#if HAS_ETHERNET && !defined(USE_WS5500)
|
||||||
#include "api/ethServerAPI.h"
|
#include "api/ethServerAPI.h"
|
||||||
template class ServerAPI<EthernetClient>;
|
template class ServerAPI<EthernetClient>;
|
||||||
template class APIServerPort<ethServerAPI, EthernetServer>;
|
template class APIServerPort<ethServerAPI, EthernetServer>;
|
||||||
|
@ -3,6 +3,11 @@
|
|||||||
#include "ServerAPI.h"
|
#include "ServerAPI.h"
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
|
|
||||||
|
#if HAS_ETHERNET && defined(USE_WS5500)
|
||||||
|
#include <ETHClass2.h>
|
||||||
|
#define ETH ETH2
|
||||||
|
#endif // HAS_ETHERNET
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides both debug printing and, if the client starts sending protobufs to us, switches to send/receive protobufs
|
* Provides both debug printing and, if the client starts sending protobufs to us, switches to send/receive protobufs
|
||||||
* (and starts dropping debug printing - FIXME, eventually those prints should be encapsulated in protobufs).
|
* (and starts dropping debug printing - FIXME, eventually those prints should be encapsulated in protobufs).
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
#if HAS_ETHERNET
|
#if HAS_ETHERNET && !defined(USE_WS5500)
|
||||||
|
|
||||||
#include "ethServerAPI.h"
|
#include "ethServerAPI.h"
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "ServerAPI.h"
|
#include "ServerAPI.h"
|
||||||
|
#ifndef USE_WS5500
|
||||||
#include <RAK13800_W5100S.h>
|
#include <RAK13800_W5100S.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -23,3 +24,4 @@ class ethServerPort : public APIServerPort<ethServerAPI, EthernetServer>
|
|||||||
};
|
};
|
||||||
|
|
||||||
void initApiServer(int port = SERVER_API_DEFAULT_PORT);
|
void initApiServer(int port = SERVER_API_DEFAULT_PORT);
|
||||||
|
#endif
|
||||||
|
@ -34,7 +34,7 @@ typedef enum _meshtastic_AdminMessage_ConfigType {
|
|||||||
meshtastic_AdminMessage_ConfigType_BLUETOOTH_CONFIG = 6,
|
meshtastic_AdminMessage_ConfigType_BLUETOOTH_CONFIG = 6,
|
||||||
/* TODO: REPLACE */
|
/* TODO: REPLACE */
|
||||||
meshtastic_AdminMessage_ConfigType_SECURITY_CONFIG = 7,
|
meshtastic_AdminMessage_ConfigType_SECURITY_CONFIG = 7,
|
||||||
/* */
|
/* Session key config */
|
||||||
meshtastic_AdminMessage_ConfigType_SESSIONKEY_CONFIG = 8,
|
meshtastic_AdminMessage_ConfigType_SESSIONKEY_CONFIG = 8,
|
||||||
/* device-ui config */
|
/* device-ui config */
|
||||||
meshtastic_AdminMessage_ConfigType_DEVICEUI_CONFIG = 9
|
meshtastic_AdminMessage_ConfigType_DEVICEUI_CONFIG = 9
|
||||||
|
@ -426,7 +426,7 @@ typedef struct _meshtastic_Config_NetworkConfig {
|
|||||||
char wifi_ssid[33];
|
char wifi_ssid[33];
|
||||||
/* If set, will be use to authenticate to the named wifi */
|
/* If set, will be use to authenticate to the named wifi */
|
||||||
char wifi_psk[65];
|
char wifi_psk[65];
|
||||||
/* NTP server to use if WiFi is conneced, defaults to `0.pool.ntp.org` */
|
/* NTP server to use if WiFi is conneced, defaults to `meshtastic.pool.ntp.org` */
|
||||||
char ntp_server[33];
|
char ntp_server[33];
|
||||||
/* Enable Ethernet */
|
/* Enable Ethernet */
|
||||||
bool eth_enabled;
|
bool eth_enabled;
|
||||||
|
@ -53,6 +53,8 @@ typedef enum _meshtastic_Language {
|
|||||||
meshtastic_Language_NORWEGIAN = 14,
|
meshtastic_Language_NORWEGIAN = 14,
|
||||||
/* Slovenian */
|
/* Slovenian */
|
||||||
meshtastic_Language_SLOVENIAN = 15,
|
meshtastic_Language_SLOVENIAN = 15,
|
||||||
|
/* Ukrainian */
|
||||||
|
meshtastic_Language_UKRAINIAN = 16,
|
||||||
/* Simplified Chinese (experimental) */
|
/* Simplified Chinese (experimental) */
|
||||||
meshtastic_Language_SIMPLIFIED_CHINESE = 30,
|
meshtastic_Language_SIMPLIFIED_CHINESE = 30,
|
||||||
/* Traditional Chinese (experimental) */
|
/* Traditional Chinese (experimental) */
|
||||||
|
@ -228,6 +228,13 @@ typedef enum _meshtastic_HardwareModel {
|
|||||||
meshtastic_HardwareModel_MESHLINK = 87,
|
meshtastic_HardwareModel_MESHLINK = 87,
|
||||||
/* Seeed XIAO nRF52840 + Wio SX1262 kit */
|
/* Seeed XIAO nRF52840 + Wio SX1262 kit */
|
||||||
meshtastic_HardwareModel_XIAO_NRF52_KIT = 88,
|
meshtastic_HardwareModel_XIAO_NRF52_KIT = 88,
|
||||||
|
/* Elecrow ThinkNode M1 & M2
|
||||||
|
https://www.elecrow.com/wiki/ThinkNode-M1_Transceiver_Device(Meshtastic)_Power_By_nRF52840.html
|
||||||
|
https://www.elecrow.com/wiki/ThinkNode-M2_Transceiver_Device(Meshtastic)_Power_By_NRF52840.html (this actually uses ESP32-S3) */
|
||||||
|
meshtastic_HardwareModel_THINKNODE_M1 = 89,
|
||||||
|
meshtastic_HardwareModel_THINKNODE_M2 = 90,
|
||||||
|
/* Lilygo T-ETH-Elite */
|
||||||
|
meshtastic_HardwareModel_T_ETH_ELITE = 91,
|
||||||
/* ------------------------------------------------------------------------------------------------------------------------------------------
|
/* ------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
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.
|
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.
|
||||||
------------------------------------------------------------------------------------------------------------------------------------------ */
|
------------------------------------------------------------------------------------------------------------------------------------------ */
|
||||||
|
@ -12,6 +12,11 @@
|
|||||||
#include <WebServer.h>
|
#include <WebServer.h>
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
|
|
||||||
|
#if HAS_ETHERNET && defined(USE_WS5500)
|
||||||
|
#include <ETHClass2.h>
|
||||||
|
#define ETH ETH2
|
||||||
|
#endif // HAS_ETHERNET
|
||||||
|
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
#include "esp_task_wdt.h"
|
#include "esp_task_wdt.h"
|
||||||
#endif
|
#endif
|
||||||
@ -166,14 +171,14 @@ WebServerThread *webServerThread;
|
|||||||
|
|
||||||
WebServerThread::WebServerThread() : concurrency::OSThread("WebServer")
|
WebServerThread::WebServerThread() : concurrency::OSThread("WebServer")
|
||||||
{
|
{
|
||||||
if (!config.network.wifi_enabled) {
|
if (!config.network.wifi_enabled && !config.network.eth_enabled) {
|
||||||
disable();
|
disable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t WebServerThread::runOnce()
|
int32_t WebServerThread::runOnce()
|
||||||
{
|
{
|
||||||
if (!config.network.wifi_enabled) {
|
if (!config.network.wifi_enabled && !config.network.eth_enabled) {
|
||||||
disable();
|
disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,11 @@
|
|||||||
#include <AsyncUDP.h>
|
#include <AsyncUDP.h>
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
|
|
||||||
|
#if HAS_ETHERNET && defined(USE_WS5500)
|
||||||
|
#include <ETHClass2.h>
|
||||||
|
#define ETH ETH2
|
||||||
|
#endif // HAS_ETHERNET
|
||||||
|
|
||||||
#define UDP_MULTICAST_DEFAUL_PORT 4403 // Default port for UDP multicast is same as TCP api server
|
#define UDP_MULTICAST_DEFAUL_PORT 4403 // Default port for UDP multicast is same as TCP api server
|
||||||
#define UDP_MULTICAST_THREAD_INTERVAL_MS 15000
|
#define UDP_MULTICAST_THREAD_INTERVAL_MS 15000
|
||||||
|
|
||||||
|
@ -9,6 +9,12 @@
|
|||||||
#include "mesh/api/WiFiServerAPI.h"
|
#include "mesh/api/WiFiServerAPI.h"
|
||||||
#include "target_specific.h"
|
#include "target_specific.h"
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
|
|
||||||
|
#if HAS_ETHERNET && defined(USE_WS5500)
|
||||||
|
#include <ETHClass2.h>
|
||||||
|
#define ETH ETH2
|
||||||
|
#endif // HAS_ETHERNET
|
||||||
|
|
||||||
#include <WiFiUdp.h>
|
#include <WiFiUdp.h>
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
#if !MESHTASTIC_EXCLUDE_WEBSERVER
|
#if !MESHTASTIC_EXCLUDE_WEBSERVER
|
||||||
@ -52,11 +58,28 @@ Syslog syslog(syslogClient);
|
|||||||
|
|
||||||
Periodic *wifiReconnect;
|
Periodic *wifiReconnect;
|
||||||
|
|
||||||
|
#ifdef USE_WS5500
|
||||||
|
// Startup Ethernet
|
||||||
|
bool initEthernet()
|
||||||
|
{
|
||||||
|
if ((config.network.eth_enabled) && (ETH.begin(ETH_PHY_W5500, 1, ETH_CS_PIN, ETH_INT_PIN, ETH_RST_PIN, SPI3_HOST,
|
||||||
|
ETH_SCLK_PIN, ETH_MISO_PIN, ETH_MOSI_PIN))) {
|
||||||
|
WiFi.onEvent(WiFiEvent);
|
||||||
|
#if !MESHTASTIC_EXCLUDE_WEBSERVER
|
||||||
|
createSSLCert(); // For WebServer
|
||||||
|
#endif
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void onNetworkConnected()
|
static void onNetworkConnected()
|
||||||
{
|
{
|
||||||
if (!APStartupComplete) {
|
if (!APStartupComplete) {
|
||||||
// Start web server
|
// Start web server
|
||||||
LOG_INFO("Start WiFi network services");
|
LOG_INFO("Start network services");
|
||||||
|
|
||||||
// start mdns
|
// start mdns
|
||||||
if (!MDNS.begin("Meshtastic")) {
|
if (!MDNS.begin("Meshtastic")) {
|
||||||
@ -188,6 +211,10 @@ bool isWifiAvailable()
|
|||||||
|
|
||||||
if (config.network.wifi_enabled && (config.network.wifi_ssid[0])) {
|
if (config.network.wifi_enabled && (config.network.wifi_ssid[0])) {
|
||||||
return true;
|
return true;
|
||||||
|
#ifdef USE_WS5500
|
||||||
|
} else if (config.network.eth_enabled) {
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -282,7 +309,7 @@ bool initWifi()
|
|||||||
// Called by the Espressif SDK to
|
// Called by the Espressif SDK to
|
||||||
static void WiFiEvent(WiFiEvent_t event)
|
static void WiFiEvent(WiFiEvent_t event)
|
||||||
{
|
{
|
||||||
LOG_DEBUG("WiFi-Event %d: ", event);
|
LOG_DEBUG("Network-Event %d: ", event);
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case ARDUINO_EVENT_WIFI_READY:
|
case ARDUINO_EVENT_WIFI_READY:
|
||||||
@ -377,19 +404,32 @@ static void WiFiEvent(WiFiEvent_t event)
|
|||||||
LOG_INFO("Ethernet started");
|
LOG_INFO("Ethernet started");
|
||||||
break;
|
break;
|
||||||
case ARDUINO_EVENT_ETH_STOP:
|
case ARDUINO_EVENT_ETH_STOP:
|
||||||
|
syslog.disable();
|
||||||
LOG_INFO("Ethernet stopped");
|
LOG_INFO("Ethernet stopped");
|
||||||
break;
|
break;
|
||||||
case ARDUINO_EVENT_ETH_CONNECTED:
|
case ARDUINO_EVENT_ETH_CONNECTED:
|
||||||
LOG_INFO("Ethernet connected");
|
LOG_INFO("Ethernet connected");
|
||||||
break;
|
break;
|
||||||
case ARDUINO_EVENT_ETH_DISCONNECTED:
|
case ARDUINO_EVENT_ETH_DISCONNECTED:
|
||||||
|
syslog.disable();
|
||||||
LOG_INFO("Ethernet disconnected");
|
LOG_INFO("Ethernet disconnected");
|
||||||
break;
|
break;
|
||||||
case ARDUINO_EVENT_ETH_GOT_IP:
|
case ARDUINO_EVENT_ETH_GOT_IP:
|
||||||
LOG_INFO("Obtained IP address (ARDUINO_EVENT_ETH_GOT_IP)");
|
#ifdef USE_WS5500
|
||||||
|
LOG_INFO("Obtained IP address: %s, %u Mbps, %s", ETH.localIP().toString().c_str(), ETH.linkSpeed(),
|
||||||
|
ETH.fullDuplex() ? "FULL_DUPLEX" : "HALF_DUPLEX");
|
||||||
|
onNetworkConnected();
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case ARDUINO_EVENT_ETH_GOT_IP6:
|
case ARDUINO_EVENT_ETH_GOT_IP6:
|
||||||
LOG_INFO("Obtained IP6 address (ARDUINO_EVENT_ETH_GOT_IP6)");
|
#ifdef USE_WS5500
|
||||||
|
#if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0)
|
||||||
|
LOG_INFO("Obtained Local IP6 address: %s", ETH.linkLocalIPv6().toString().c_str());
|
||||||
|
LOG_INFO("Obtained GlobalIP6 address: %s", ETH.globalIPv6().toString().c_str());
|
||||||
|
#else
|
||||||
|
LOG_INFO("Obtained IP6 address: %s", ETH.localIPv6().toString().c_str());
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case ARDUINO_EVENT_SC_SCAN_DONE:
|
case ARDUINO_EVENT_SC_SCAN_DONE:
|
||||||
LOG_INFO("SmartConfig: Scan done");
|
LOG_INFO("SmartConfig: Scan done");
|
||||||
|
@ -9,6 +9,11 @@
|
|||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if HAS_ETHERNET && defined(USE_WS5500)
|
||||||
|
#include <ETHClass2.h>
|
||||||
|
#define ETH ETH2
|
||||||
|
#endif // HAS_ETHERNET
|
||||||
|
|
||||||
extern bool needReconnect;
|
extern bool needReconnect;
|
||||||
extern concurrency::Periodic *wifiReconnect;
|
extern concurrency::Periodic *wifiReconnect;
|
||||||
|
|
||||||
@ -20,3 +25,8 @@ void deinitWifi();
|
|||||||
bool isWifiAvailable();
|
bool isWifiAvailable();
|
||||||
|
|
||||||
uint8_t getWifiDisconnectReason();
|
uint8_t getWifiDisconnectReason();
|
||||||
|
|
||||||
|
#ifdef USE_WS5500
|
||||||
|
// Startup Ethernet
|
||||||
|
bool initEthernet();
|
||||||
|
#endif
|
@ -988,7 +988,7 @@ void AdminModule::handleGetDeviceConnectionStatus(const meshtastic_MeshPacket &r
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_ETHERNET
|
#if HAS_ETHERNET && !defined(USE_WS5500)
|
||||||
conn.has_ethernet = true;
|
conn.has_ethernet = true;
|
||||||
conn.ethernet.has_status = true;
|
conn.ethernet.has_status = true;
|
||||||
if (Ethernet.linkStatus() == LinkON) {
|
if (Ethernet.linkStatus() == LinkON) {
|
||||||
|
@ -19,6 +19,10 @@
|
|||||||
#include "mesh/wifi/WiFiAPClient.h"
|
#include "mesh/wifi/WiFiAPClient.h"
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
#endif
|
#endif
|
||||||
|
#if HAS_ETHERNET && defined(USE_WS5500)
|
||||||
|
#include <ETHClass2.h>
|
||||||
|
#define ETH ETH2
|
||||||
|
#endif // HAS_ETHERNET
|
||||||
#include "Default.h"
|
#include "Default.h"
|
||||||
#if !defined(ARCH_NRF52) || NRF52_USE_JSON
|
#if !defined(ARCH_NRF52) || NRF52_USE_JSON
|
||||||
#include "serialization/JSON.h"
|
#include "serialization/JSON.h"
|
||||||
@ -295,6 +299,11 @@ bool connectPubSub(const PubSubConfig &config, PubSubClient &pubSub, Client &cli
|
|||||||
|
|
||||||
inline bool isConnectedToNetwork()
|
inline bool isConnectedToNetwork()
|
||||||
{
|
{
|
||||||
|
#ifdef USE_WS5500
|
||||||
|
if (ETH.connected())
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAS_WIFI
|
#if HAS_WIFI
|
||||||
return WiFi.isConnected();
|
return WiFi.isConnected();
|
||||||
#elif HAS_ETHERNET
|
#elif HAS_ETHERNET
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#include <WiFiClientSecure.h>
|
#include <WiFiClientSecure.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#if HAS_ETHERNET
|
#if HAS_ETHERNET && !defined(USE_WS5500)
|
||||||
#include <EthernetClient.h>
|
#include <EthernetClient.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -176,6 +176,8 @@
|
|||||||
#define HW_VENDOR meshtastic_HardwareModel_SEEED_XIAO_S3
|
#define HW_VENDOR meshtastic_HardwareModel_SEEED_XIAO_S3
|
||||||
#elif defined(MESH_TAB)
|
#elif defined(MESH_TAB)
|
||||||
#define HW_VENDOR meshtastic_HardwareModel_MESH_TAB
|
#define HW_VENDOR meshtastic_HardwareModel_MESH_TAB
|
||||||
|
#elif defined(T_ETH_ELITE)
|
||||||
|
#define HW_VENDOR meshtastic_HardwareModel_T_ETH_ELITE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
@ -26,7 +26,9 @@
|
|||||||
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !MESHTASTIC_EXCLUDE_BLUETOOTH
|
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !MESHTASTIC_EXCLUDE_BLUETOOTH
|
||||||
void setBluetoothEnable(bool enable)
|
void setBluetoothEnable(bool enable)
|
||||||
{
|
{
|
||||||
#if HAS_WIFI
|
#ifdef USE_WS5500
|
||||||
|
if ((config.bluetooth.enabled == true) && (config.network.wifi_enabled == false))
|
||||||
|
#elif HAS_WIFI
|
||||||
if (!isWifiAvailable() && config.bluetooth.enabled == true)
|
if (!isWifiAvailable() && config.bluetooth.enabled == true)
|
||||||
#else
|
#else
|
||||||
if (config.bluetooth.enabled == true)
|
if (config.bluetooth.enabled == true)
|
||||||
|
26
variants/t-eth-elite/pins_arduino.h
Normal file
26
variants/t-eth-elite/pins_arduino.h
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#ifndef Pins_Arduino_h
|
||||||
|
#define Pins_Arduino_h
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#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 = 40;
|
||||||
|
static const uint8_t MOSI = 11;
|
||||||
|
static const uint8_t MISO = 9;
|
||||||
|
static const uint8_t SCK = 10;
|
||||||
|
|
||||||
|
#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 */
|
16
variants/t-eth-elite/platformio.ini
Normal file
16
variants/t-eth-elite/platformio.ini
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
[env:t-eth-elite]
|
||||||
|
extends = esp32s3_base
|
||||||
|
board = esp32s3box
|
||||||
|
board_check = true
|
||||||
|
build_flags =
|
||||||
|
${esp32s3_base.build_flags}
|
||||||
|
-D T_ETH_ELITE
|
||||||
|
-I variants/t-eth-elite
|
||||||
|
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||||
|
|
||||||
|
lib_ignore =
|
||||||
|
Ethernet
|
||||||
|
|
||||||
|
lib_deps =
|
||||||
|
${esp32s3_base.lib_deps}
|
||||||
|
https://github.com/meshtastic/ETHClass2#v1.0.0
|
11
variants/t-eth-elite/rfswitch.h
Normal file
11
variants/t-eth-elite/rfswitch.h
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#include "RadioLib.h"
|
||||||
|
|
||||||
|
static const uint32_t rfswitch_dio_pins[] = {RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6, RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC};
|
||||||
|
|
||||||
|
static const Module::RfSwitchMode_t rfswitch_table[] = {
|
||||||
|
// mode DIO5 DIO6
|
||||||
|
{LR11x0::MODE_STBY, {LOW, LOW}}, {LR11x0::MODE_RX, {HIGH, LOW}},
|
||||||
|
{LR11x0::MODE_TX, {LOW, HIGH}}, {LR11x0::MODE_TX_HP, {LOW, HIGH}},
|
||||||
|
{LR11x0::MODE_TX_HF, {LOW, LOW}}, {LR11x0::MODE_GNSS, {LOW, LOW}},
|
||||||
|
{LR11x0::MODE_WIFI, {LOW, LOW}}, END_OF_MODE_TABLE,
|
||||||
|
};
|
83
variants/t-eth-elite/variant.h
Normal file
83
variants/t-eth-elite/variant.h
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
#define HAS_SDCARD
|
||||||
|
#define SDCARD_USE_SPI1
|
||||||
|
|
||||||
|
#define HAS_GPS 1
|
||||||
|
#define GPS_RX_PIN 39
|
||||||
|
#define GPS_TX_PIN 42
|
||||||
|
#define GPS_BAUDRATE_FIXED 1
|
||||||
|
#define GPS_BAUDRATE 9600
|
||||||
|
|
||||||
|
#define I2C_SDA 17 // I2C pins for this board
|
||||||
|
#define I2C_SCL 18
|
||||||
|
|
||||||
|
#define HAS_SCREEN 1 // Allow for OLED Screens on I2C Header of shield
|
||||||
|
|
||||||
|
#define LED_PIN 38 // If defined we will blink this LED
|
||||||
|
#define BUTTON_PIN 0 // If defined, this will be used for user button presses,
|
||||||
|
|
||||||
|
#define BUTTON_NEED_PULLUP
|
||||||
|
|
||||||
|
// TTGO uses a common pinout for their SX1262 vs RF95 modules - both can be enabled and we will probe at runtime for RF95 and if
|
||||||
|
// not found then probe for SX1262
|
||||||
|
#define USE_RF95 // RFM95/SX127x
|
||||||
|
#define USE_SX1262
|
||||||
|
#define USE_SX1280
|
||||||
|
#define USE_LR1121
|
||||||
|
|
||||||
|
#define LORA_SCK 10
|
||||||
|
#define LORA_MISO 9
|
||||||
|
#define LORA_MOSI 11
|
||||||
|
#define LORA_CS 40
|
||||||
|
#define LORA_RESET 46
|
||||||
|
|
||||||
|
// per SX1276_Receive_Interrupt/utilities.h
|
||||||
|
#define LORA_DIO0 8
|
||||||
|
#define LORA_DIO1 16
|
||||||
|
#define LORA_DIO2 RADIOLIB_NC
|
||||||
|
|
||||||
|
// per SX1262_Receive_Interrupt/utilities.h
|
||||||
|
#ifdef USE_SX1262
|
||||||
|
#define SX126X_CS LORA_CS
|
||||||
|
#define SX126X_DIO1 8
|
||||||
|
#define SX126X_BUSY 16
|
||||||
|
#define SX126X_RESET LORA_RESET
|
||||||
|
#define SX126X_DIO2_AS_RF_SWITCH
|
||||||
|
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// per SX128x_Receive_Interrupt/utilities.h
|
||||||
|
#ifdef USE_SX1280
|
||||||
|
#define SX128X_CS LORA_CS
|
||||||
|
#define SX128X_DIO1 8
|
||||||
|
#define SX128X_DIO2 33
|
||||||
|
#define SX128X_DIO3 34
|
||||||
|
#define SX128X_BUSY 16
|
||||||
|
#define SX128X_RESET LORA_RESET
|
||||||
|
#define SX128X_RXEN 13
|
||||||
|
#define SX128X_TXEN 38
|
||||||
|
#define SX128X_MAX_POWER 3
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// LR1121
|
||||||
|
#ifdef USE_LR1121
|
||||||
|
#define LR1121_IRQ_PIN 8
|
||||||
|
#define LR1121_NRESET_PIN LORA_RESET
|
||||||
|
#define LR1121_BUSY_PIN 16
|
||||||
|
#define LR1121_SPI_NSS_PIN LORA_CS
|
||||||
|
#define LR1121_SPI_SCK_PIN LORA_SCK
|
||||||
|
#define LR1121_SPI_MOSI_PIN LORA_MOSI
|
||||||
|
#define LR1121_SPI_MISO_PIN LORA_MISO
|
||||||
|
#define LR11X0_DIO3_TCXO_VOLTAGE 3.0
|
||||||
|
#define LR11X0_DIO_AS_RF_SWITCH
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define HAS_ETHERNET 1
|
||||||
|
#define USE_WS5500 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
|
@ -1,7 +1,6 @@
|
|||||||
[env:tlora-v3-3-0-tcxo]
|
[env:tlora-v3-3-0-tcxo]
|
||||||
extends = esp32_base
|
extends = esp32_base
|
||||||
board = ttgo-lora32-v21
|
board = ttgo-lora32-v21
|
||||||
board_level = extra
|
|
||||||
build_flags =
|
build_flags =
|
||||||
${esp32_base.build_flags}
|
${esp32_base.build_flags}
|
||||||
-D TLORA_V2_1_16
|
-D TLORA_V2_1_16
|
||||||
|
Loading…
Reference in New Issue
Block a user