mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-05 19:19:18 +00:00
Merge branch 'master' into tft-gui-work
This commit is contained in:
commit
3872c4ecfc
5
debian/changelog
vendored
5
debian/changelog
vendored
@ -1,7 +1,8 @@
|
|||||||
meshtasticd (2.5.20.0) UNRELEASED; urgency=medium
|
meshtasticd (2.5.21.0) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
* Initial packaging
|
* Initial packaging
|
||||||
* GitHub Actions Automatic version bump
|
* GitHub Actions Automatic version bump
|
||||||
* GitHub Actions Automatic version bump
|
* GitHub Actions Automatic version bump
|
||||||
|
* GitHub Actions Automatic version bump
|
||||||
|
|
||||||
-- Austin Lane <github-actions[bot]@users.noreply.github.com> Wed, 15 Jan 2025 14:08:54 +0000
|
-- Austin Lane <github-actions[bot]@users.noreply.github.com> Sat, 25 Jan 2025 01:39:16 +0000
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit fde27e4ef0fcee967063ba353422ed5f9a1c4790
|
Subproject commit 7f13df0e5f7cbb07f0e6f3a57c0d86ad448738db
|
@ -2662,13 +2662,14 @@ int Screen::handleStatusUpdate(const meshtastic::Status *arg)
|
|||||||
|
|
||||||
int Screen::handleTextMessage(const meshtastic_MeshPacket *packet)
|
int Screen::handleTextMessage(const meshtastic_MeshPacket *packet)
|
||||||
{
|
{
|
||||||
// If auto carousel is disabled -> return 0 and skip new messages handling
|
|
||||||
if (config.display.auto_screen_carousel_secs == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// Handle focus change based on message type
|
|
||||||
if (showingNormalScreen) {
|
if (showingNormalScreen) {
|
||||||
setFrames(packet->from == 0 ? FOCUS_PRESERVE : FOCUS_TEXTMESSAGE);
|
// Outgoing message
|
||||||
|
if (packet->from == 0)
|
||||||
|
setFrames(FOCUS_PRESERVE); // Return to same frame (quietly hiding the rx text message frame)
|
||||||
|
|
||||||
|
// Incoming message
|
||||||
|
else
|
||||||
|
setFrames(FOCUS_TEXTMESSAGE); // Focus on the new message
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
38
src/main.cpp
38
src/main.cpp
@ -127,10 +127,6 @@ void tft_task_handler(void *);
|
|||||||
DeviceScreen *deviceScreen = nullptr;
|
DeviceScreen *deviceScreen = nullptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TCXO_OPTIONAL)
|
|
||||||
float tcxoVoltage = SX126X_DIO3_TCXO_VOLTAGE; // if TCXO is optional, put this here so it can be changed further down.
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace concurrency;
|
using namespace concurrency;
|
||||||
|
|
||||||
volatile static const char slipstreamTZString[] = USERPREFS_TZ_STRING;
|
volatile static const char slipstreamTZString[] = USERPREFS_TZ_STRING;
|
||||||
@ -1021,13 +1017,16 @@ void setup()
|
|||||||
|
|
||||||
#if defined(USE_SX1262) && !defined(ARCH_PORTDUINO) && !defined(TCXO_OPTIONAL) && RADIOLIB_EXCLUDE_SX126X != 1
|
#if defined(USE_SX1262) && !defined(ARCH_PORTDUINO) && !defined(TCXO_OPTIONAL) && RADIOLIB_EXCLUDE_SX126X != 1
|
||||||
if ((!rIf) && (config.lora.region != meshtastic_Config_LoRaConfig_RegionCode_LORA_24)) {
|
if ((!rIf) && (config.lora.region != meshtastic_Config_LoRaConfig_RegionCode_LORA_24)) {
|
||||||
rIf = new SX1262Interface(RadioLibHAL, SX126X_CS, SX126X_DIO1, SX126X_RESET, SX126X_BUSY);
|
auto *sxIf = new SX1262Interface(RadioLibHAL, SX126X_CS, SX126X_DIO1, SX126X_RESET, SX126X_BUSY);
|
||||||
if (!rIf->init()) {
|
#ifdef SX126X_DIO3_TCXO_VOLTAGE
|
||||||
|
sxIf->setTCXOVoltage(SX126X_DIO3_TCXO_VOLTAGE);
|
||||||
|
#endif
|
||||||
|
if (!sxIf->init()) {
|
||||||
LOG_WARN("No SX1262 radio");
|
LOG_WARN("No SX1262 radio");
|
||||||
delete rIf;
|
delete sxIf;
|
||||||
rIf = NULL;
|
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO("SX1262 init success");
|
LOG_INFO("SX1262 init success");
|
||||||
|
rIf = sxIf;
|
||||||
radioType = SX1262_RADIO;
|
radioType = SX1262_RADIO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1035,29 +1034,28 @@ void setup()
|
|||||||
|
|
||||||
#if defined(USE_SX1262) && !defined(ARCH_PORTDUINO) && defined(TCXO_OPTIONAL)
|
#if defined(USE_SX1262) && !defined(ARCH_PORTDUINO) && defined(TCXO_OPTIONAL)
|
||||||
if ((!rIf) && (config.lora.region != meshtastic_Config_LoRaConfig_RegionCode_LORA_24)) {
|
if ((!rIf) && (config.lora.region != meshtastic_Config_LoRaConfig_RegionCode_LORA_24)) {
|
||||||
// Try using the specified TCXO voltage
|
// try using the specified TCXO voltage
|
||||||
rIf = new SX1262Interface(RadioLibHAL, SX126X_CS, SX126X_DIO1, SX126X_RESET, SX126X_BUSY);
|
auto *sxIf = new SX1262Interface(RadioLibHAL, SX126X_CS, SX126X_DIO1, SX126X_RESET, SX126X_BUSY);
|
||||||
if (!rIf->init()) {
|
sxIf->setTCXOVoltage(SX126X_DIO3_TCXO_VOLTAGE);
|
||||||
LOG_WARN("No SX1262 radio with TCXO, Vref %f V", tcxoVoltage);
|
if (!sxIf->init()) {
|
||||||
delete rIf;
|
LOG_WARN("No SX1262 radio with TCXO, Vref %fV", SX126X_DIO3_TCXO_VOLTAGE);
|
||||||
rIf = NULL;
|
delete sxIf;
|
||||||
tcxoVoltage = 0; // if it fails, set the TCXO voltage to zero for the next attempt
|
|
||||||
} else {
|
} else {
|
||||||
LOG_WARN("SX1262 init success, TCXO, Vref %f V", tcxoVoltage);
|
LOG_INFO("SX1262 init success, TCXO, Vref %fV", SX126X_DIO3_TCXO_VOLTAGE);
|
||||||
|
rIf = sxIf;
|
||||||
radioType = SX1262_RADIO;
|
radioType = SX1262_RADIO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!rIf) && (config.lora.region != meshtastic_Config_LoRaConfig_RegionCode_LORA_24)) {
|
if ((!rIf) && (config.lora.region != meshtastic_Config_LoRaConfig_RegionCode_LORA_24)) {
|
||||||
// If specified TCXO voltage fails, attempt to use DIO3 as a reference instea
|
// If specified TCXO voltage fails, attempt to use DIO3 as a reference instead
|
||||||
rIf = new SX1262Interface(RadioLibHAL, SX126X_CS, SX126X_DIO1, SX126X_RESET, SX126X_BUSY);
|
rIf = new SX1262Interface(RadioLibHAL, SX126X_CS, SX126X_DIO1, SX126X_RESET, SX126X_BUSY);
|
||||||
if (!rIf->init()) {
|
if (!rIf->init()) {
|
||||||
LOG_WARN("No SX1262 radio with XTAL, Vref %f V", tcxoVoltage);
|
LOG_WARN("No SX1262 radio with XTAL, Vref 0.0V");
|
||||||
delete rIf;
|
delete rIf;
|
||||||
rIf = NULL;
|
rIf = NULL;
|
||||||
tcxoVoltage = SX126X_DIO3_TCXO_VOLTAGE; // if it fails, set the TCXO voltage back for the next radio search
|
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO("SX1262 init success, XTAL, Vref %f V", tcxoVoltage);
|
LOG_INFO("SX1262 init success, XTAL, Vref 0.0V");
|
||||||
radioType = SX1262_RADIO;
|
radioType = SX1262_RADIO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
std::vector<MeshModule *> *MeshModule::modules;
|
std::vector<MeshModule *> *MeshModule::modules;
|
||||||
|
|
||||||
const meshtastic_MeshPacket *MeshModule::currentRequest;
|
const meshtastic_MeshPacket *MeshModule::currentRequest;
|
||||||
|
uint8_t MeshModule::numPeriodicModules = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If any of the current chain of modules has already sent a reply, it will be here. This is useful to allow
|
* If any of the current chain of modules has already sent a reply, it will be here. This is useful to allow
|
||||||
@ -35,6 +36,15 @@ MeshModule::~MeshModule()
|
|||||||
modules->erase(it);
|
modules->erase(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ⚠️ **Only call once** to set the initial delay before a module starts broadcasting periodically
|
||||||
|
int32_t MeshModule::setStartDelay()
|
||||||
|
{
|
||||||
|
int32_t startDelay = MESHMODULE_MIN_BROADCAST_DELAY_MS + numPeriodicModules * MESHMODULE_BROADCAST_SPACING_MS;
|
||||||
|
numPeriodicModules++;
|
||||||
|
|
||||||
|
return startDelay;
|
||||||
|
}
|
||||||
|
|
||||||
meshtastic_MeshPacket *MeshModule::allocAckNak(meshtastic_Routing_Error err, NodeNum to, PacketId idFrom, ChannelIndex chIndex,
|
meshtastic_MeshPacket *MeshModule::allocAckNak(meshtastic_Routing_Error err, NodeNum to, PacketId idFrom, ChannelIndex chIndex,
|
||||||
uint8_t hopLimit)
|
uint8_t hopLimit)
|
||||||
{
|
{
|
||||||
|
@ -9,6 +9,9 @@
|
|||||||
#include <OLEDDisplayUi.h>
|
#include <OLEDDisplayUi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define MESHMODULE_MIN_BROADCAST_DELAY_MS 30 * 1000 // Min. delay after boot before sending first broadcast by any module
|
||||||
|
#define MESHMODULE_BROADCAST_SPACING_MS 15 * 1000 // Initial spacing between broadcasts of different modules
|
||||||
|
|
||||||
/** handleReceived return enumeration
|
/** handleReceived return enumeration
|
||||||
*
|
*
|
||||||
* Use ProcessMessage::CONTINUE to allows other modules to process a message.
|
* Use ProcessMessage::CONTINUE to allows other modules to process a message.
|
||||||
@ -119,6 +122,12 @@ class MeshModule
|
|||||||
*/
|
*/
|
||||||
static const meshtastic_MeshPacket *currentRequest;
|
static const meshtastic_MeshPacket *currentRequest;
|
||||||
|
|
||||||
|
// We keep track of the number of modules that send a periodic broadcast to schedule them spaced out over time
|
||||||
|
static uint8_t numPeriodicModules;
|
||||||
|
|
||||||
|
// Set the start delay for module that broadcasts periodically
|
||||||
|
int32_t setStartDelay();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If your handler wants to send a response, simply set currentReply and it will be sent at the end of response handling.
|
* If your handler wants to send a response, simply set currentReply and it will be sent at the end of response handling.
|
||||||
*/
|
*/
|
||||||
|
@ -50,22 +50,13 @@ template <typename T> bool SX126xInterface<T>::init()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ARCH_PORTDUINO
|
#if ARCH_PORTDUINO
|
||||||
float tcxoVoltage = (float)settingsMap[dio3_tcxo_voltage] / 1000;
|
tcxoVoltage = (float)settingsMap[dio3_tcxo_voltage] / 1000;
|
||||||
if (settingsMap[sx126x_ant_sw_pin] != RADIOLIB_NC) {
|
if (settingsMap[sx126x_ant_sw_pin] != RADIOLIB_NC) {
|
||||||
digitalWrite(settingsMap[sx126x_ant_sw_pin], HIGH);
|
digitalWrite(settingsMap[sx126x_ant_sw_pin], HIGH);
|
||||||
pinMode(settingsMap[sx126x_ant_sw_pin], OUTPUT);
|
pinMode(settingsMap[sx126x_ant_sw_pin], OUTPUT);
|
||||||
}
|
}
|
||||||
// FIXME: correct logic to default to not using TCXO if no voltage is specified for SX126X_DIO3_TCXO_VOLTAGE
|
|
||||||
#elif !defined(SX126X_DIO3_TCXO_VOLTAGE)
|
|
||||||
float tcxoVoltage =
|
|
||||||
0; // "TCXO reference voltage to be set on DIO3. Defaults to 1.6 V, set to 0 to skip." per
|
|
||||||
// https://github.com/jgromes/RadioLib/blob/690a050ebb46e6097c5d00c371e961c1caa3b52e/src/modules/SX126x/SX126x.h#L471C26-L471C104
|
|
||||||
// (DIO3 is free to be used as an IRQ)
|
|
||||||
#elif !defined(TCXO_OPTIONAL)
|
|
||||||
float tcxoVoltage = SX126X_DIO3_TCXO_VOLTAGE;
|
|
||||||
// (DIO3 is not free to be used as an IRQ)
|
|
||||||
#endif
|
#endif
|
||||||
if (tcxoVoltage == 0)
|
if (tcxoVoltage == 0.0)
|
||||||
LOG_DEBUG("SX126X_DIO3_TCXO_VOLTAGE not defined, not using DIO3 as TCXO reference voltage");
|
LOG_DEBUG("SX126X_DIO3_TCXO_VOLTAGE not defined, not using DIO3 as TCXO reference voltage");
|
||||||
else
|
else
|
||||||
LOG_DEBUG("SX126X_DIO3_TCXO_VOLTAGE defined, using DIO3 as TCXO reference voltage at %f V", tcxoVoltage);
|
LOG_DEBUG("SX126X_DIO3_TCXO_VOLTAGE defined, using DIO3 as TCXO reference voltage at %f V", tcxoVoltage);
|
||||||
@ -83,7 +74,7 @@ template <typename T> bool SX126xInterface<T>::init()
|
|||||||
int res = lora.begin(getFreq(), bw, sf, cr, syncWord, power, preambleLength, tcxoVoltage, useRegulatorLDO);
|
int res = lora.begin(getFreq(), bw, sf, cr, syncWord, power, preambleLength, tcxoVoltage, useRegulatorLDO);
|
||||||
// \todo Display actual typename of the adapter, not just `SX126x`
|
// \todo Display actual typename of the adapter, not just `SX126x`
|
||||||
LOG_INFO("SX126x init result %d", res);
|
LOG_INFO("SX126x init result %d", res);
|
||||||
if (res == RADIOLIB_ERR_CHIP_NOT_FOUND)
|
if (res == RADIOLIB_ERR_CHIP_NOT_FOUND || res == RADIOLIB_ERR_SPI_CMD_FAILED)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
LOG_INFO("Frequency set to %f", getFreq());
|
LOG_INFO("Frequency set to %f", getFreq());
|
||||||
|
@ -28,8 +28,11 @@ template <class T> class SX126xInterface : public RadioLibInterface
|
|||||||
|
|
||||||
bool isIRQPending() override { return lora.getIrqFlags() != 0; }
|
bool isIRQPending() override { return lora.getIrqFlags() != 0; }
|
||||||
|
|
||||||
|
void setTCXOVoltage(float voltage) { tcxoVoltage = voltage; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
float currentLimit = 140; // Higher OCP limit for SX126x PA
|
float currentLimit = 140; // Higher OCP limit for SX126x PA
|
||||||
|
float tcxoVoltage = 0.0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specific module instance
|
* Specific module instance
|
||||||
|
@ -223,6 +223,9 @@ typedef enum _meshtastic_HardwareModel {
|
|||||||
/* Mesh-Tab, esp32 based
|
/* Mesh-Tab, esp32 based
|
||||||
https://github.com/valzzu/Mesh-Tab */
|
https://github.com/valzzu/Mesh-Tab */
|
||||||
meshtastic_HardwareModel_MESH_TAB = 86,
|
meshtastic_HardwareModel_MESH_TAB = 86,
|
||||||
|
/* MeshLink board developed by LoraItalia. NRF52840, eByte E22900M22S (Will also come with other frequencies), 25w MPPT solar charger (5v,12v,18v selectable), support for gps, buzzer, oled or e-ink display, 10 gpios, hardware watchdog
|
||||||
|
https://www.loraitalia.it */
|
||||||
|
meshtastic_HardwareModel_MESHLINK = 87,
|
||||||
/* ------------------------------------------------------------------------------------------------------------------------------------------
|
/* ------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
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.
|
||||||
------------------------------------------------------------------------------------------------------------------------------------------ */
|
------------------------------------------------------------------------------------------------------------------------------------------ */
|
||||||
|
@ -81,7 +81,7 @@ int32_t DetectionSensorModule::runOnce()
|
|||||||
}
|
}
|
||||||
LOG_INFO("Detection Sensor Module: init");
|
LOG_INFO("Detection Sensor Module: init");
|
||||||
|
|
||||||
return DELAYED_INTERVAL;
|
return setStartDelay();
|
||||||
}
|
}
|
||||||
|
|
||||||
// LOG_DEBUG("Detection Sensor Module: Current pin state: %i", digitalRead(moduleConfig.detection_sensor.monitor_pin));
|
// LOG_DEBUG("Detection Sensor Module: Current pin state: %i", digitalRead(moduleConfig.detection_sensor.monitor_pin));
|
||||||
|
@ -97,8 +97,9 @@ NodeInfoModule::NodeInfoModule()
|
|||||||
: ProtobufModule("nodeinfo", meshtastic_PortNum_NODEINFO_APP, &meshtastic_User_msg), concurrency::OSThread("NodeInfo")
|
: ProtobufModule("nodeinfo", meshtastic_PortNum_NODEINFO_APP, &meshtastic_User_msg), concurrency::OSThread("NodeInfo")
|
||||||
{
|
{
|
||||||
isPromiscuous = true; // We always want to update our nodedb, even if we are sniffing on others
|
isPromiscuous = true; // We always want to update our nodedb, even if we are sniffing on others
|
||||||
setIntervalFromNow(30 *
|
|
||||||
1000); // Send our initial owner announcement 30 seconds after we start (to give network time to setup)
|
setIntervalFromNow(setStartDelay()); // Send our initial owner announcement 30 seconds
|
||||||
|
// after we start (to give network time to setup)
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t NodeInfoModule::runOnce()
|
int32_t NodeInfoModule::runOnce()
|
||||||
|
@ -28,8 +28,9 @@ PositionModule::PositionModule()
|
|||||||
nodeStatusObserver.observe(&nodeStatus->onNewStatus);
|
nodeStatusObserver.observe(&nodeStatus->onNewStatus);
|
||||||
|
|
||||||
if (config.device.role != meshtastic_Config_DeviceConfig_Role_TRACKER &&
|
if (config.device.role != meshtastic_Config_DeviceConfig_Role_TRACKER &&
|
||||||
config.device.role != meshtastic_Config_DeviceConfig_Role_TAK_TRACKER)
|
config.device.role != meshtastic_Config_DeviceConfig_Role_TAK_TRACKER) {
|
||||||
setIntervalFromNow(60 * 1000);
|
setIntervalFromNow(setStartDelay());
|
||||||
|
}
|
||||||
|
|
||||||
// Power saving trackers should clear their position on startup to avoid waking up and sending a stale position
|
// Power saving trackers should clear their position on startup to avoid waking up and sending a stale position
|
||||||
if ((config.device.role == meshtastic_Config_DeviceConfig_Role_TRACKER ||
|
if ((config.device.role == meshtastic_Config_DeviceConfig_Role_TRACKER ||
|
||||||
@ -160,7 +161,8 @@ bool PositionModule::hasGPS()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
meshtastic_MeshPacket *PositionModule::allocReply()
|
// Allocate a packet with our position data if we have one
|
||||||
|
meshtastic_MeshPacket *PositionModule::allocPositionPacket()
|
||||||
{
|
{
|
||||||
if (precision == 0) {
|
if (precision == 0) {
|
||||||
LOG_DEBUG("Skip location send because precision is set to 0!");
|
LOG_DEBUG("Skip location send because precision is set to 0!");
|
||||||
@ -262,7 +264,8 @@ meshtastic_MeshPacket *PositionModule::allocReply()
|
|||||||
p.has_ground_speed = true;
|
p.has_ground_speed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_INFO("Position reply: time=%i lat=%i lon=%i", p.time, p.latitude_i, p.longitude_i);
|
LOG_INFO("Position packet: time=%i lat=%i lon=%i", p.time, p.latitude_i, p.longitude_i);
|
||||||
|
lastSentToMesh = millis();
|
||||||
|
|
||||||
// TAK Tracker devices should send their position in a TAK packet over the ATAK port
|
// TAK Tracker devices should send their position in a TAK packet over the ATAK port
|
||||||
if (config.device.role == meshtastic_Config_DeviceConfig_Role_TAK_TRACKER)
|
if (config.device.role == meshtastic_Config_DeviceConfig_Role_TAK_TRACKER)
|
||||||
@ -271,6 +274,16 @@ meshtastic_MeshPacket *PositionModule::allocReply()
|
|||||||
return allocDataProtobuf(p);
|
return allocDataProtobuf(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
meshtastic_MeshPacket *PositionModule::allocReply()
|
||||||
|
{
|
||||||
|
if (lastSentToMesh && Throttle::isWithinTimespanMs(lastSentToMesh, 3 * 60 * 1000)) {
|
||||||
|
LOG_DEBUG("Skip Position reply since we sent it <3min ago");
|
||||||
|
ignoreRequest = true; // Mark it as ignored for MeshModule
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
return allocPositionPacket();
|
||||||
|
}
|
||||||
|
|
||||||
meshtastic_MeshPacket *PositionModule::allocAtakPli()
|
meshtastic_MeshPacket *PositionModule::allocAtakPli()
|
||||||
{
|
{
|
||||||
LOG_INFO("Send TAK PLI packet");
|
LOG_INFO("Send TAK PLI packet");
|
||||||
@ -333,9 +346,9 @@ void PositionModule::sendOurPosition(NodeNum dest, bool wantReplies, uint8_t cha
|
|||||||
precision = 0;
|
precision = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
meshtastic_MeshPacket *p = allocReply();
|
meshtastic_MeshPacket *p = allocPositionPacket();
|
||||||
if (p == nullptr) {
|
if (p == nullptr) {
|
||||||
LOG_DEBUG("allocReply returned a nullptr");
|
LOG_DEBUG("allocPositionPacket returned a nullptr");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ class PositionModule : public ProtobufModule<meshtastic_Position>, private concu
|
|||||||
virtual int32_t runOnce() override;
|
virtual int32_t runOnce() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
meshtastic_MeshPacket *allocPositionPacket();
|
||||||
struct SmartPosition getDistanceTraveledSinceLastSend(meshtastic_PositionLite currentPosition);
|
struct SmartPosition getDistanceTraveledSinceLastSend(meshtastic_PositionLite currentPosition);
|
||||||
meshtastic_MeshPacket *allocAtakPli();
|
meshtastic_MeshPacket *allocAtakPli();
|
||||||
void trySetRtc(meshtastic_Position p, bool isLocal, bool forceUpdate = false);
|
void trySetRtc(meshtastic_Position p, bool isLocal, bool forceUpdate = false);
|
||||||
@ -62,6 +63,7 @@ class PositionModule : public ProtobufModule<meshtastic_Position>, private concu
|
|||||||
void sendLostAndFoundText();
|
void sendLostAndFoundText();
|
||||||
bool hasQualityTimesource();
|
bool hasQualityTimesource();
|
||||||
bool hasGPS();
|
bool hasGPS();
|
||||||
|
uint32_t lastSentToMesh = 0; // Last time we sent our position to the mesh
|
||||||
|
|
||||||
const uint32_t minimumTimeThreshold =
|
const uint32_t minimumTimeThreshold =
|
||||||
Default::getConfiguredOrDefaultMs(config.position.broadcast_smart_minimum_interval_secs, 30);
|
Default::getConfiguredOrDefaultMs(config.position.broadcast_smart_minimum_interval_secs, 30);
|
||||||
|
@ -50,12 +50,12 @@ int32_t AirQualityTelemetryModule::runOnce()
|
|||||||
nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_PMSA003I].first = found.address.address;
|
nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_PMSA003I].first = found.address.address;
|
||||||
nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_PMSA003I].second =
|
nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_PMSA003I].second =
|
||||||
i2cScanner->fetchI2CBus(found.address);
|
i2cScanner->fetchI2CBus(found.address);
|
||||||
return 1000;
|
return setStartDelay();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return disable();
|
return disable();
|
||||||
}
|
}
|
||||||
return 1000;
|
return setStartDelay();
|
||||||
}
|
}
|
||||||
return disable();
|
return disable();
|
||||||
} else {
|
} else {
|
||||||
|
@ -18,7 +18,7 @@ class DeviceTelemetryModule : private concurrency::OSThread, public ProtobufModu
|
|||||||
uptimeWrapCount = 0;
|
uptimeWrapCount = 0;
|
||||||
uptimeLastMs = millis();
|
uptimeLastMs = millis();
|
||||||
nodeStatusObserver.observe(&nodeStatus->onNewStatus);
|
nodeStatusObserver.observe(&nodeStatus->onNewStatus);
|
||||||
setIntervalFromNow(45 * 1000); // Wait until NodeInfo is sent
|
setIntervalFromNow(setStartDelay()); // Wait until NodeInfo is sent
|
||||||
}
|
}
|
||||||
virtual bool wantUIFrame() { return false; }
|
virtual bool wantUIFrame() { return false; }
|
||||||
|
|
||||||
|
@ -107,8 +107,6 @@ int32_t EnvironmentTelemetryModule::runOnce()
|
|||||||
|
|
||||||
if (moduleConfig.telemetry.environment_measurement_enabled) {
|
if (moduleConfig.telemetry.environment_measurement_enabled) {
|
||||||
LOG_INFO("Environment Telemetry: init");
|
LOG_INFO("Environment Telemetry: init");
|
||||||
// it's possible to have this module enabled, only for displaying values on the screen.
|
|
||||||
// therefore, we should only enable the sensor loop if measurement is also enabled
|
|
||||||
#ifdef SENSECAP_INDICATOR
|
#ifdef SENSECAP_INDICATOR
|
||||||
result = indicatorSensor.runOnce();
|
result = indicatorSensor.runOnce();
|
||||||
#endif
|
#endif
|
||||||
@ -171,7 +169,9 @@ int32_t EnvironmentTelemetryModule::runOnce()
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return result;
|
// it's possible to have this module enabled, only for displaying values on the screen.
|
||||||
|
// therefore, we should only enable the sensor loop if measurement is also enabled
|
||||||
|
return result == UINT32_MAX ? disable() : setStartDelay();
|
||||||
} else {
|
} else {
|
||||||
// if we somehow got to a second run of this module with measurement disabled, then just wait forever
|
// if we somehow got to a second run of this module with measurement disabled, then just wait forever
|
||||||
if (!moduleConfig.telemetry.environment_measurement_enabled) {
|
if (!moduleConfig.telemetry.environment_measurement_enabled) {
|
||||||
|
@ -62,7 +62,7 @@ int32_t HealthTelemetryModule::runOnce()
|
|||||||
if (max30102Sensor.hasSensor())
|
if (max30102Sensor.hasSensor())
|
||||||
result = max30102Sensor.runOnce();
|
result = max30102Sensor.runOnce();
|
||||||
}
|
}
|
||||||
return result;
|
return result == UINT32_MAX ? disable() : setStartDelay();
|
||||||
} else {
|
} else {
|
||||||
// if we somehow got to a second run of this module with measurement disabled, then just wait forever
|
// if we somehow got to a second run of this module with measurement disabled, then just wait forever
|
||||||
if (!moduleConfig.telemetry.health_measurement_enabled) {
|
if (!moduleConfig.telemetry.health_measurement_enabled) {
|
||||||
|
@ -65,7 +65,7 @@ int32_t PowerTelemetryModule::runOnce()
|
|||||||
if (max17048Sensor.hasSensor() && !max17048Sensor.isInitialized())
|
if (max17048Sensor.hasSensor() && !max17048Sensor.isInitialized())
|
||||||
result = max17048Sensor.runOnce();
|
result = max17048Sensor.runOnce();
|
||||||
}
|
}
|
||||||
return result;
|
return result == UINT32_MAX ? disable() : setStartDelay();
|
||||||
#else
|
#else
|
||||||
return disable();
|
return disable();
|
||||||
#endif
|
#endif
|
||||||
|
@ -184,7 +184,6 @@ settings.
|
|||||||
|
|
||||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||||
#define TCXO_OPTIONAL // make it so that the firmware can try both TCXO and XTAL
|
#define TCXO_OPTIONAL // make it so that the firmware can try both TCXO and XTAL
|
||||||
extern float tcxoVoltage; // make this available everywhere
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,9 @@ lib_deps =
|
|||||||
${esp32_base.lib_deps}
|
${esp32_base.lib_deps}
|
||||||
zinggjm/GxEPD2@^1.5.1
|
zinggjm/GxEPD2@^1.5.1
|
||||||
adafruit/Adafruit NeoPixel @ ^1.12.0
|
adafruit/Adafruit NeoPixel @ ^1.12.0
|
||||||
build_unflags = -DARDUINO_USB_MODE=1
|
build_unflags =
|
||||||
|
${esp32s3_base.build_unflags}
|
||||||
|
-DARDUINO_USB_MODE=1
|
||||||
build_flags =
|
build_flags =
|
||||||
;${esp32_base.build_flags} -D MY_ESP32S3_DIY -I variants/my_esp32s3_diy_eink
|
;${esp32_base.build_flags} -D MY_ESP32S3_DIY -I variants/my_esp32s3_diy_eink
|
||||||
${esp32_base.build_flags} -D PRIVATE_HW -I variants/my_esp32s3_diy_eink
|
${esp32_base.build_flags} -D PRIVATE_HW -I variants/my_esp32s3_diy_eink
|
||||||
|
@ -13,7 +13,9 @@ platform_packages =
|
|||||||
lib_deps =
|
lib_deps =
|
||||||
${esp32_base.lib_deps}
|
${esp32_base.lib_deps}
|
||||||
adafruit/Adafruit NeoPixel @ ^1.12.0
|
adafruit/Adafruit NeoPixel @ ^1.12.0
|
||||||
build_unflags = -DARDUINO_USB_MODE=1
|
build_unflags =
|
||||||
|
${esp32s3_base.build_unflags}
|
||||||
|
-DARDUINO_USB_MODE=1
|
||||||
build_flags =
|
build_flags =
|
||||||
;${esp32_base.build_flags} -D MY_ESP32S3_DIY -I variants/my_esp32s3_diy_oled
|
;${esp32_base.build_flags} -D MY_ESP32S3_DIY -I variants/my_esp32s3_diy_oled
|
||||||
${esp32_base.build_flags} -D PRIVATE_HW -I variants/my_esp32s3_diy_oled
|
${esp32_base.build_flags} -D PRIVATE_HW -I variants/my_esp32s3_diy_oled
|
||||||
|
@ -70,5 +70,8 @@
|
|||||||
#define SX126X_RESET LORA_RESET
|
#define SX126X_RESET LORA_RESET
|
||||||
#define SX126X_DIO2_AS_RF_SWITCH
|
#define SX126X_DIO2_AS_RF_SWITCH
|
||||||
|
|
||||||
|
#define TCXO_OPTIONAL // handle Indicator V1 and V2
|
||||||
|
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||||
|
|
||||||
#define USE_VIRTUAL_KEYBOARD 1
|
#define USE_VIRTUAL_KEYBOARD 1
|
||||||
#define DISPLAY_CLOCK_FRAME 1
|
#define DISPLAY_CLOCK_FRAME 1
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
[VERSION]
|
[VERSION]
|
||||||
major = 2
|
major = 2
|
||||||
minor = 5
|
minor = 5
|
||||||
build = 20
|
build = 21
|
||||||
|
Loading…
Reference in New Issue
Block a user