From 255713d23dad6a2cfd41fe973ca67d1d8ef7a6df Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 19:33:20 -0600 Subject: [PATCH 01/13] [create-pull-request] automated change (#5258) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.properties b/version.properties index 6664f69b9..91c1f4823 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 5 -build = 11 +build = 12 From 8498b175e74fdb883eaef20e0e8f56c6726cef71 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 5 Nov 2024 20:06:43 -0600 Subject: [PATCH 02/13] Add exception for RTC to not strip time from position (#5262) * Add exception for RTC to not strip time from position * t --- src/modules/PositionModule.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/PositionModule.cpp b/src/modules/PositionModule.cpp index 1baa550c0..b9847c22b 100644 --- a/src/modules/PositionModule.cpp +++ b/src/modules/PositionModule.cpp @@ -251,6 +251,9 @@ meshtastic_MeshPacket *PositionModule::allocReply() if (getRTCQuality() < RTCQualityNTP) { LOG_INFO("Strip time %u from position send", p.time); p.time = 0; + } else if (rtc_found.address != ScanI2C::ADDRESS_NONE.address) { + LOG_INFO("Using RTC time %u for position send", p.time); + p.time = getValidTime(RTCQualityDevice); } else { p.time = getValidTime(RTCQualityNTP); LOG_INFO("Provide time to mesh %u", p.time); From 982190936dfe47b20a7147d4a6627a3ade7ac3c5 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 6 Nov 2024 07:03:25 -0600 Subject: [PATCH 03/13] More log reductions. I'll probably stop now ;-) (#5263) --- src/FSCommon.cpp | 2 +- src/airtime.cpp | 11 +++++------ src/graphics/EInkDynamicDisplay.cpp | 2 +- src/graphics/Screen.cpp | 2 +- src/input/MPR121Keyboard.cpp | 2 +- src/main.cpp | 4 ++-- src/mesh/NodeDB.cpp | 8 ++++---- src/mesh/RF95Interface.cpp | 2 +- src/mesh/SX128xInterface.cpp | 4 ++-- src/mesh/eth/ethClient.cpp | 6 +++--- src/mesh/http/ContentHandler.cpp | 4 ++-- src/mesh/http/WebServer.cpp | 8 ++++---- src/modules/AdminModule.cpp | 2 +- src/modules/DetectionSensorModule.cpp | 2 +- src/modules/NodeInfoModule.cpp | 4 ++-- src/modules/PositionModule.cpp | 4 ++-- src/modules/Telemetry/Sensor/TelemetrySensor.h | 2 +- src/shutdown.h | 2 +- 18 files changed, 35 insertions(+), 36 deletions(-) diff --git a/src/FSCommon.cpp b/src/FSCommon.cpp index 5eacead1f..6cd17dac8 100644 --- a/src/FSCommon.cpp +++ b/src/FSCommon.cpp @@ -329,7 +329,7 @@ void fsInit() { #ifdef FSCom if (!FSBegin()) { - LOG_ERROR("Filesystem mount Failed."); + LOG_ERROR("Filesystem mount failed"); // assert(0); This auto-formats the partition, so no need to fail here. } #if defined(ARCH_ESP32) diff --git a/src/airtime.cpp b/src/airtime.cpp index cbd30a2d0..a7736d667 100644 --- a/src/airtime.cpp +++ b/src/airtime.cpp @@ -13,17 +13,17 @@ void AirTime::logAirtime(reportTypes reportType, uint32_t airtime_ms) { if (reportType == TX_LOG) { - LOG_DEBUG("Packet transmitted : %ums", airtime_ms); + LOG_DEBUG("Packet TX: %ums", airtime_ms); this->airtimes.periodTX[0] = this->airtimes.periodTX[0] + airtime_ms; air_period_tx[0] = air_period_tx[0] + airtime_ms; this->utilizationTX[this->getPeriodUtilHour()] = this->utilizationTX[this->getPeriodUtilHour()] + airtime_ms; } else if (reportType == RX_LOG) { - LOG_DEBUG("Packet received : %ums", airtime_ms); + LOG_DEBUG("Packet RX: %ums", airtime_ms); this->airtimes.periodRX[0] = this->airtimes.periodRX[0] + airtime_ms; air_period_rx[0] = air_period_rx[0] + airtime_ms; } else if (reportType == RX_ALL_LOG) { - LOG_DEBUG("Packet received (noise?) : %ums", airtime_ms); + LOG_DEBUG("Packet RX (noise?) : %ums", airtime_ms); this->airtimes.periodRX_ALL[0] = this->airtimes.periodRX_ALL[0] + airtime_ms; } @@ -126,7 +126,7 @@ bool AirTime::isTxAllowedChannelUtil(bool polite) if (channelUtilizationPercent() < percentage) { return true; } else { - LOG_WARN("Channel utilization is >%d percent. Skip opportunity to send.", percentage); + LOG_WARN("Ch. util >%d%%. Skip send", percentage); return false; } } @@ -137,8 +137,7 @@ bool AirTime::isTxAllowedAirUtil() if (utilizationTXPercent() < myRegion->dutyCycle * polite_duty_cycle_percent / 100) { return true; } else { - LOG_WARN("Tx air utilization is >%f percent. Skip opportunity to send.", - myRegion->dutyCycle * polite_duty_cycle_percent / 100); + LOG_WARN("TX air util. >%f%%. Skip send", myRegion->dutyCycle * polite_duty_cycle_percent / 100); return false; } } diff --git a/src/graphics/EInkDynamicDisplay.cpp b/src/graphics/EInkDynamicDisplay.cpp index 9a76a38c2..6664646b9 100644 --- a/src/graphics/EInkDynamicDisplay.cpp +++ b/src/graphics/EInkDynamicDisplay.cpp @@ -170,7 +170,7 @@ bool EInkDynamicDisplay::determineMode() checkFastRequested(); if (refresh == UNSPECIFIED) - LOG_WARN("There was a flaw in the determineMode() logic."); + LOG_WARN("There was a flaw in the determineMode() logic"); // -- Decision has been reached -- applyRefreshMode(); diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 3e1361f1e..bd0133740 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -1789,7 +1789,7 @@ int32_t Screen::runOnce() // serialSinceMsec adjusts for additional serial wait time during nRF52 bootup static bool showingBootScreen = true; if (showingBootScreen && (millis() > (logo_timeout + serialSinceMsec))) { - LOG_INFO("Done with boot screen..."); + LOG_INFO("Done with boot screen"); stopBootScreen(); showingBootScreen = false; } diff --git a/src/input/MPR121Keyboard.cpp b/src/input/MPR121Keyboard.cpp index 04a424543..078d80272 100644 --- a/src/input/MPR121Keyboard.cpp +++ b/src/input/MPR121Keyboard.cpp @@ -116,7 +116,7 @@ void MPR121Keyboard::begin(i2c_com_fptr_t r, i2c_com_fptr_t w, uint8_t addr) void MPR121Keyboard::reset() { - LOG_DEBUG("MPR121 Reset..."); + LOG_DEBUG("MPR121 Reset"); // Trigger a MPR121 Soft Reset if (m_wire) { m_wire->beginTransmission(m_addr); diff --git a/src/main.cpp b/src/main.cpp index 7f16d95b0..9f765eeb2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -435,7 +435,7 @@ void setup() // accessories auto i2cScanner = std::unique_ptr(new ScanI2CTwoWire()); #if HAS_WIRE - LOG_INFO("Scan for i2c devices..."); + LOG_INFO("Scan for i2c devices"); #endif #if defined(I2C_SDA1) && defined(ARCH_RP2040) @@ -460,7 +460,7 @@ void setup() i2cScanner->scanPort(ScanI2C::I2CPort::WIRE); #elif defined(ARCH_PORTDUINO) if (settingsStrings[i2cdev] != "") { - LOG_INFO("Scan for i2c devices..."); + LOG_INFO("Scan for i2c devices"); i2cScanner->scanPort(ScanI2C::I2CPort::WIRE); } #elif HAS_WIRE diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 928b62e06..bb5a09eaa 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -647,7 +647,7 @@ void NodeDB::removeNodeByNum(NodeNum nodeNum) numMeshNodes -= removed; std::fill(devicestate.node_db_lite.begin() + numMeshNodes, devicestate.node_db_lite.begin() + numMeshNodes + 1, meshtastic_NodeInfoLite()); - LOG_DEBUG("NodeDB::removeNodeByNum purged %d entries. Save changes...", removed); + LOG_DEBUG("NodeDB::removeNodeByNum purged %d entries. Save changes", removed); saveDeviceStateToDisk(); } @@ -976,7 +976,7 @@ bool NodeDB::saveToDisk(int saveWhat) bool success = saveToDiskNoRetry(saveWhat); if (!success) { - LOG_ERROR("Failed to save to disk, retrying..."); + LOG_ERROR("Failed to save to disk, retrying"); #ifdef ARCH_NRF52 // @geeksville is not ready yet to say we should do this on other platforms. See bug #4184 discussion FSCom.format(); @@ -1152,7 +1152,7 @@ bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelInde // We just changed something about the user, store our DB Throttle::execute( &lastNodeDbSave, ONE_MINUTE_MS, []() { nodeDB->saveToDisk(SEGMENT_DEVICESTATE); }, - []() { LOG_DEBUG("Deferring NodeDB saveToDisk for now"); }); // since we saved less than a minute ago + []() { LOG_DEBUG("Defer NodeDB saveToDisk for now"); }); // since we saved less than a minute ago } return changed; @@ -1282,7 +1282,7 @@ void recordCriticalError(meshtastic_CriticalErrorCode code, uint32_t address, co // Currently portuino is mostly used for simulation. Make sure the user notices something really bad happened #ifdef ARCH_PORTDUINO - LOG_ERROR("A critical failure occurred, portduino is exiting..."); + LOG_ERROR("A critical failure occurred, portduino is exiting"); exit(2); #endif } \ No newline at end of file diff --git a/src/mesh/RF95Interface.cpp b/src/mesh/RF95Interface.cpp index db56659bd..9ef045099 100644 --- a/src/mesh/RF95Interface.cpp +++ b/src/mesh/RF95Interface.cpp @@ -230,7 +230,7 @@ bool RF95Interface::reconfigure() err = lora->setPreambleLength(preambleLength); if (err != RADIOLIB_ERR_NONE) - LOG_ERROR(" RF95 setPreambleLength %s%d", radioLibErr, err); + LOG_ERROR("RF95 setPreambleLength %s%d", radioLibErr, err); assert(err == RADIOLIB_ERR_NONE); err = lora->setFrequency(getFreq()); diff --git a/src/mesh/SX128xInterface.cpp b/src/mesh/SX128xInterface.cpp index 9fe1f645f..013164bca 100644 --- a/src/mesh/SX128xInterface.cpp +++ b/src/mesh/SX128xInterface.cpp @@ -71,7 +71,7 @@ template bool SX128xInterface::init() LOG_INFO("SX128x init result %d", res); if ((config.lora.region != meshtastic_Config_LoRaConfig_RegionCode_LORA_24) && (res == RADIOLIB_ERR_INVALID_FREQUENCY)) { - LOG_WARN("Radio chip only supports 2.4GHz LoRa. Adjusting Region and rebooting."); + LOG_WARN("Radio only supports 2.4GHz LoRa. Adjusting Region and rebooting"); config.lora.region = meshtastic_Config_LoRaConfig_RegionCode_LORA_24; nodeDB->saveToDisk(SEGMENT_CONFIG); delay(2000); @@ -80,7 +80,7 @@ template bool SX128xInterface::init() #elif defined(ARCH_NRF52) NVIC_SystemReset(); #else - LOG_ERROR("FIXME implement reboot for this platform. Skip for now."); + LOG_ERROR("FIXME implement reboot for this platform. Skip for now"); #endif } diff --git a/src/mesh/eth/ethClient.cpp b/src/mesh/eth/ethClient.cpp index c275d9c06..3b4d716f5 100644 --- a/src/mesh/eth/ethClient.cpp +++ b/src/mesh/eth/ethClient.cpp @@ -141,13 +141,13 @@ bool initEthernet() if (status == 0) { if (Ethernet.hardwareStatus() == EthernetNoHardware) { - LOG_ERROR("Ethernet shield was not found."); + LOG_ERROR("Ethernet shield was not found"); return false; } else if (Ethernet.linkStatus() == LinkOFF) { - LOG_ERROR("Ethernet cable is not connected."); + LOG_ERROR("Ethernet cable is not connected"); return false; } else { - LOG_ERROR("Unknown Ethernet error."); + LOG_ERROR("Unknown Ethernet error"); return false; } } else { diff --git a/src/mesh/http/ContentHandler.cpp b/src/mesh/http/ContentHandler.cpp index 0fdfaabb9..efa816438 100644 --- a/src/mesh/http/ContentHandler.cpp +++ b/src/mesh/http/ContentHandler.cpp @@ -441,8 +441,8 @@ void handleStatic(HTTPRequest *req, HTTPResponse *res) return; } else { - LOG_ERROR("This should not have happened..."); - res->println("ERROR: This should not have happened..."); + LOG_ERROR("This should not have happened"); + res->println("ERROR: This should not have happened"); } } diff --git a/src/mesh/http/WebServer.cpp b/src/mesh/http/WebServer.cpp index 20a200624..d9856e157 100644 --- a/src/mesh/http/WebServer.cpp +++ b/src/mesh/http/WebServer.cpp @@ -95,7 +95,7 @@ static void taskCreateCert(void *parameter) LOG_DEBUG("Retrieved Certificate: %d Bytes", cert->getCertLength()); } else { - LOG_INFO("Creating the certificate. This may take a while. Please wait..."); + LOG_INFO("Creating the certificate. This may take a while. Please wait"); yield(); cert = new SSLCert(); yield(); @@ -189,7 +189,7 @@ int32_t WebServerThread::runOnce() void initWebServer() { - LOG_DEBUG("Init Web Server..."); + LOG_DEBUG("Init Web Server"); // We can now use the new certificate to setup our server as usual. secureServer = new HTTPSServer(cert); @@ -198,10 +198,10 @@ void initWebServer() registerHandlers(insecureServer, secureServer); if (secureServer) { - LOG_INFO("Start Secure Web Server..."); + LOG_INFO("Start Secure Web Server"); secureServer->start(); } - LOG_INFO("Start Insecure Web Server..."); + LOG_INFO("Start Insecure Web Server"); insecureServer->start(); if (insecureServer->isRunning()) { LOG_INFO("Web Servers Ready! :-) "); diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index fea199225..5401e1fdb 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -369,7 +369,7 @@ void AdminModule::handleGetModuleConfigResponse(const meshtastic_MeshPacket &mp, // Skip if it's disabled or no pins are exposed if (!r->get_module_config_response.payload_variant.remote_hardware.enabled || r->get_module_config_response.payload_variant.remote_hardware.available_pins_count == 0) { - LOG_DEBUG("Remote hardware module disabled or no available_pins. Skip..."); + LOG_DEBUG("Remote hardware module disabled or no available_pins. Skip"); return; } for (uint8_t i = 0; i < devicestate.node_remote_hardware_pins_count; i++) { diff --git a/src/modules/DetectionSensorModule.cpp b/src/modules/DetectionSensorModule.cpp index 0b9e74f32..cb27cbd48 100644 --- a/src/modules/DetectionSensorModule.cpp +++ b/src/modules/DetectionSensorModule.cpp @@ -76,7 +76,7 @@ int32_t DetectionSensorModule::runOnce() if (moduleConfig.detection_sensor.monitor_pin > 0) { pinMode(moduleConfig.detection_sensor.monitor_pin, moduleConfig.detection_sensor.use_pullup ? INPUT_PULLUP : INPUT); } else { - LOG_WARN("Detection Sensor Module: Set to enabled but no monitor pin is set. Disable module..."); + LOG_WARN("Detection Sensor Module: Set to enabled but no monitor pin is set. Disable module"); return disable(); } LOG_INFO("Detection Sensor Module: init"); diff --git a/src/modules/NodeInfoModule.cpp b/src/modules/NodeInfoModule.cpp index 680ef0890..b55d47d5b 100644 --- a/src/modules/NodeInfoModule.cpp +++ b/src/modules/NodeInfoModule.cpp @@ -70,11 +70,11 @@ meshtastic_MeshPacket *NodeInfoModule::allocReply() } // If we sent our NodeInfo less than 5 min. ago, don't send it again as it may be still underway. if (!shorterTimeout && lastSentToMesh && Throttle::isWithinTimespanMs(lastSentToMesh, 5 * 60 * 1000)) { - LOG_DEBUG("Skip send NodeInfo since we sent it <5 mins ago."); + LOG_DEBUG("Skip send NodeInfo since we sent it <5min ago"); ignoreRequest = true; // Mark it as ignored for MeshModule return NULL; } else if (shorterTimeout && lastSentToMesh && Throttle::isWithinTimespanMs(lastSentToMesh, 60 * 1000)) { - LOG_DEBUG("Skip send requested NodeInfo since we sent it <60s ago."); + LOG_DEBUG("Skip send NodeInfo since we sent it <60s ago"); ignoreRequest = true; // Mark it as ignored for MeshModule return NULL; } else { diff --git a/src/modules/PositionModule.cpp b/src/modules/PositionModule.cpp index b9847c22b..b7def8242 100644 --- a/src/modules/PositionModule.cpp +++ b/src/modules/PositionModule.cpp @@ -249,10 +249,10 @@ meshtastic_MeshPacket *PositionModule::allocReply() // nodes shouldn't trust it anyways) Note: we allow a device with a local GPS or NTP to include the time, so that devices // without can get time. if (getRTCQuality() < RTCQualityNTP) { - LOG_INFO("Strip time %u from position send", p.time); + LOG_INFO("Strip time %u from position", p.time); p.time = 0; } else if (rtc_found.address != ScanI2C::ADDRESS_NONE.address) { - LOG_INFO("Using RTC time %u for position send", p.time); + LOG_INFO("Use RTC time %u for position", p.time); p.time = getValidTime(RTCQualityDevice); } else { p.time = getValidTime(RTCQualityNTP); diff --git a/src/modules/Telemetry/Sensor/TelemetrySensor.h b/src/modules/Telemetry/Sensor/TelemetrySensor.h index 0e38949d3..08cc1125d 100644 --- a/src/modules/Telemetry/Sensor/TelemetrySensor.h +++ b/src/modules/Telemetry/Sensor/TelemetrySensor.h @@ -31,7 +31,7 @@ class TelemetrySensor int32_t initI2CSensor() { if (!status) { - LOG_WARN("Could not connect to detected %s sensor. Remove from nodeTelemetrySensorsMap.", sensorName); + LOG_WARN("Can't connect to detected %s sensor. Remove from nodeTelemetrySensorsMap", sensorName); nodeTelemetrySensorsMap[sensorType].first = 0; } else { LOG_INFO("Opened %s sensor on i2c bus", sensorName); diff --git a/src/shutdown.h b/src/shutdown.h index ad44045e5..9e30e772c 100644 --- a/src/shutdown.h +++ b/src/shutdown.h @@ -32,7 +32,7 @@ void powerCommandsCheck() reboot(); #else rebootAtMsec = -1; - LOG_WARN("FIXME implement reboot for this platform. Note that some settings require a restart to be applied."); + LOG_WARN("FIXME implement reboot for this platform. Note that some settings require a restart to be applied"); #endif } From 3bd391191320387b418a397f278bb46e0849b2c1 Mon Sep 17 00:00:00 2001 From: GUVWAF <78759985+GUVWAF@users.noreply.github.com> Date: Wed, 6 Nov 2024 22:00:26 +0100 Subject: [PATCH 04/13] Only PKC encrypt when packet originates from us (#5267) --- src/mesh/Router.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index 5eb2a5f50..ca9600cab 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -489,7 +489,8 @@ meshtastic_Routing_Error perhapsEncode(meshtastic_MeshPacket *p) meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(p->to); // We may want to retool things so we can send a PKC packet when the client specifies a key and nodenum, even if the node // is not in the local nodedb - if ( + // First, only PKC encrypt packets we are originating + if (isFromUs(p) && // Don't use PKC with Ham mode !owner.is_licensed && // Don't use PKC if it's not explicitly requested and a non-primary channel is requested @@ -671,4 +672,4 @@ void Router::perhapsHandleReceived(meshtastic_MeshPacket *p) // cache/learn of the existence of nodes (i.e. FloodRouter) that they should not handleReceived(p); packetPool.release(p); -} +} \ No newline at end of file From 73e2e25eb1d3e953fae438997b75c29e3e8ed07e Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 6 Nov 2024 15:00:53 -0600 Subject: [PATCH 05/13] Smarter traffic scaling (#5264) --- src/mesh/Default.cpp | 5 +++++ src/mesh/Default.h | 27 +++++++++++++++++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/mesh/Default.cpp b/src/mesh/Default.cpp index 653528b60..ba1dafe70 100644 --- a/src/mesh/Default.cpp +++ b/src/mesh/Default.cpp @@ -1,5 +1,6 @@ #include "Default.h" #include "../userPrefs.h" +#include "meshUtils.h" uint32_t Default::getConfiguredOrDefaultMs(uint32_t configuredInterval, uint32_t defaultInterval) { @@ -40,6 +41,10 @@ uint32_t Default::getConfiguredOrDefaultMsScaled(uint32_t configured, uint32_t d if (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER) return getConfiguredOrDefaultMs(configured, defaultValue); + // Additionally if we're a tracker or sensor, we want priority to send position and telemetry + if (IS_ONE_OF(config.device.role, meshtastic_Config_DeviceConfig_Role_SENSOR, meshtastic_Config_DeviceConfig_Role_TRACKER)) + return getConfiguredOrDefaultMs(configured, defaultValue); + return getConfiguredOrDefaultMs(configured, defaultValue) * congestionScalingCoefficient(numOnlineNodes); } diff --git a/src/mesh/Default.h b/src/mesh/Default.h index 2406dafc5..7a7507c84 100644 --- a/src/mesh/Default.h +++ b/src/mesh/Default.h @@ -1,6 +1,7 @@ #pragma once #include #include +#include #define ONE_DAY 24 * 60 * 60 #define ONE_MINUTE_MS 60 * 1000 #define THIRTY_SECONDS_MS 30 * 1000 @@ -41,12 +42,30 @@ class Default private: static float congestionScalingCoefficient(int numOnlineNodes) { - if (numOnlineNodes <= 40) { - return 1.0; // No scaling for 40 or fewer nodes + // Increase frequency of broadcasts for small networks regardless of preset + if (numOnlineNodes <= 10) { + return 0.6; + } else if (numOnlineNodes <= 20) { + return 0.7; + } else if (numOnlineNodes <= 30) { + return 0.8; + } else if (numOnlineNodes <= 40) { + return 1.0; } else { - // Sscaling based on number of nodes over 40 + float throttlingFactor = 0.075; + if (config.lora.use_preset && config.lora.modem_preset == meshtastic_Config_LoRaConfig_ModemPreset_MEDIUM_SLOW) + throttlingFactor = 0.04; + else if (config.lora.use_preset && config.lora.modem_preset == meshtastic_Config_LoRaConfig_ModemPreset_MEDIUM_FAST) + throttlingFactor = 0.02; + else if (config.lora.use_preset && config.lora.modem_preset == meshtastic_Config_LoRaConfig_ModemPreset_SHORT_SLOW) + throttlingFactor = 0.01; + else if (config.lora.use_preset && + IS_ONE_OF(config.lora.modem_preset, meshtastic_Config_LoRaConfig_ModemPreset_SHORT_FAST, + meshtastic_Config_LoRaConfig_ModemPreset_SHORT_TURBO)) + return 1.0; // Don't bother throttling for highest bandwidth presets + // Scaling up traffic based on number of nodes over 40 int nodesOverForty = (numOnlineNodes - 40); - return 1.0 + (nodesOverForty * 0.075); // Each number of online node scales by 0.075 + return 1.0 + (nodesOverForty * throttlingFactor); // Each number of online node scales by 0.075 (default) } } }; \ No newline at end of file From bd3755bb336f7100c4c249271d0077d621cdf3f0 Mon Sep 17 00:00:00 2001 From: Jeremiah K <17190268+jeremiah-k@users.noreply.github.com> Date: Wed, 6 Nov 2024 19:43:34 -0600 Subject: [PATCH 06/13] Fix device flashing scripts so they work with esptool when it's installed via pipx (#5269) * Try esptool.py in device flashing scripts for pipx compatibility * esptool detection fixes in device flashing .bat's --- bin/device-install.bat | 28 ++++++++++++++++++---------- bin/device-install.sh | 24 ++++++++++++++++++------ bin/device-update.bat | 16 ++++++++++++---- bin/device-update.sh | 18 +++++++++++++++--- 4 files changed, 63 insertions(+), 23 deletions(-) diff --git a/bin/device-install.bat b/bin/device-install.bat index 6c880185e..f8ca9e408 100755 --- a/bin/device-install.bat +++ b/bin/device-install.bat @@ -2,6 +2,14 @@ set PYTHON=python +:: Determine the correct esptool command to use +where esptool >nul 2>&1 +if %ERRORLEVEL% EQU 0 ( + set "ESPTOOL_CMD=esptool" +) else ( + set "ESPTOOL_CMD=%PYTHON% -m esptool" +) + goto GETOPTS :HELP echo Usage: %~nx0 [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME^|FILENAME] @@ -24,32 +32,32 @@ IF NOT "__%1__"=="____" goto GETOPTS IF "__%FILENAME%__" == "____" ( echo "Missing FILENAME" - goto HELP + goto HELP ) IF EXIST %FILENAME% IF x%FILENAME:update=%==x%FILENAME% ( echo Trying to flash update %FILENAME%, but first erasing and writing system information" - %PYTHON% -m esptool --baud 115200 erase_flash - %PYTHON% -m esptool --baud 115200 write_flash 0x00 %FILENAME% + %ESPTOOL_CMD% --baud 115200 erase_flash + %ESPTOOL_CMD% --baud 115200 write_flash 0x00 %FILENAME% @REM Account for S3 and C3 board's different OTA partition IF x%FILENAME:s3=%==x%FILENAME% IF x%FILENAME:v3=%==x%FILENAME% IF x%FILENAME:t-deck=%==x%FILENAME% IF x%FILENAME:wireless-paper=%==x%FILENAME% IF x%FILENAME:wireless-tracker=%==x%FILENAME% IF x%FILENAME:station-g2=%==x%FILENAME% IF x%FILENAME:unphone=%==x%FILENAME% ( IF x%FILENAME:esp32c3=%==x%FILENAME% ( - %PYTHON% -m esptool --baud 115200 write_flash 0x260000 bleota.bin + %ESPTOOL_CMD% --baud 115200 write_flash 0x260000 bleota.bin ) else ( - %PYTHON% -m esptool --baud 115200 write_flash 0x260000 bleota-c3.bin + %ESPTOOL_CMD% --baud 115200 write_flash 0x260000 bleota-c3.bin ) - ) else ( - %PYTHON% -m esptool --baud 115200 write_flash 0x260000 bleota-s3.bin + ) else ( + %ESPTOOL_CMD% --baud 115200 write_flash 0x260000 bleota-s3.bin ) for %%f in (littlefs-*.bin) do ( - %PYTHON% -m esptool --baud 115200 write_flash 0x300000 %%f + %ESPTOOL_CMD% --baud 115200 write_flash 0x300000 %%f ) ) else ( echo "Invalid file: %FILENAME%" - goto HELP + goto HELP ) else ( echo "Invalid file: %FILENAME%" - goto HELP + goto HELP ) :EOF diff --git a/bin/device-install.sh b/bin/device-install.sh index 563a87af4..b2a5684ee 100755 --- a/bin/device-install.sh +++ b/bin/device-install.sh @@ -2,6 +2,18 @@ PYTHON=${PYTHON:-$(which python3 python | head -n 1)} +# Determine the correct esptool command to use +if "$PYTHON" -m esptool version >/dev/null 2>&1; then + ESPTOOL_CMD="$PYTHON -m esptool" +elif command -v esptool >/dev/null 2>&1; then + ESPTOOL_CMD="esptool" +elif command -v esptool.py >/dev/null 2>&1; then + ESPTOOL_CMD="esptool.py" +else + echo "Error: esptool not found" + exit 1 +fi + set -e # Usage info @@ -49,19 +61,19 @@ shift "$((OPTIND - 1))" if [ -f "${FILENAME}" ] && [ -n "${FILENAME##*"update"*}" ]; then echo "Trying to flash ${FILENAME}, but first erasing and writing system information" - "$PYTHON" -m esptool erase_flash - "$PYTHON" -m esptool write_flash 0x00 ${FILENAME} + $ESPTOOL_CMD erase_flash + $ESPTOOL_CMD write_flash 0x00 ${FILENAME} # Account for S3 board's different OTA partition if [ -n "${FILENAME##*"s3"*}" ] && [ -n "${FILENAME##*"-v3"*}" ] && [ -n "${FILENAME##*"t-deck"*}" ] && [ -n "${FILENAME##*"wireless-paper"*}" ] && [ -n "${FILENAME##*"wireless-tracker"*}" ] && [ -n "${FILENAME##*"station-g2"*}" ] && [ -n "${FILENAME##*"unphone"*}" ]; then if [ -n "${FILENAME##*"esp32c3"*}" ]; then - "$PYTHON" -m esptool write_flash 0x260000 bleota.bin + $ESPTOOL_CMD write_flash 0x260000 bleota.bin else - "$PYTHON" -m esptool write_flash 0x260000 bleota-c3.bin + $ESPTOOL_CMD write_flash 0x260000 bleota-c3.bin fi else - "$PYTHON" -m esptool write_flash 0x260000 bleota-s3.bin + $ESPTOOL_CMD write_flash 0x260000 bleota-s3.bin fi - "$PYTHON" -m esptool write_flash 0x300000 littlefs-*.bin + $ESPTOOL_CMD write_flash 0x300000 littlefs-*.bin else show_help diff --git a/bin/device-update.bat b/bin/device-update.bat index 2ac649be4..a52f3d33f 100755 --- a/bin/device-update.bat +++ b/bin/device-update.bat @@ -2,6 +2,14 @@ set PYTHON=python +:: Determine the correct esptool command to use +where esptool >nul 2>&1 +if %ERRORLEVEL% EQU 0 ( + set "ESPTOOL_CMD=esptool" +) else ( + set "ESPTOOL_CMD=%PYTHON% -m esptool" +) + goto GETOPTS :HELP echo Usage: %~nx0 [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME^|FILENAME] @@ -24,17 +32,17 @@ IF NOT "__%1__"=="____" goto GETOPTS IF "__%FILENAME%__" == "____" ( echo "Missing FILENAME" - goto HELP + goto HELP ) IF EXIST %FILENAME% IF NOT x%FILENAME:update=%==x%FILENAME% ( echo Trying to flash update %FILENAME% - %PYTHON% -m esptool --baud 115200 write_flash 0x10000 %FILENAME% + %ESPTOOL_CMD% --baud 115200 write_flash 0x10000 %FILENAME% ) else ( echo "Invalid file: %FILENAME%" - goto HELP + goto HELP ) else ( echo "Invalid file: %FILENAME%" - goto HELP + goto HELP ) :EOF diff --git a/bin/device-update.sh b/bin/device-update.sh index 7233f61f6..67281dc4f 100755 --- a/bin/device-update.sh +++ b/bin/device-update.sh @@ -2,6 +2,18 @@ PYTHON=${PYTHON:-$(which python3 python|head -n 1)} +# Determine the correct esptool command to use +if "$PYTHON" -m esptool version >/dev/null 2>&1; then + ESPTOOL_CMD="$PYTHON -m esptool" +elif command -v esptool >/dev/null 2>&1; then + ESPTOOL_CMD="esptool" +elif command -v esptool.py >/dev/null 2>&1; then + ESPTOOL_CMD="esptool.py" +else + echo "Error: esptool not found" + exit 1 +fi + # Usage info show_help() { cat << EOF @@ -9,7 +21,7 @@ Usage: $(basename $0) [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME|FILENAME] Flash image file to device, leave existing system intact." -h Display this help and exit - -p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerrous). + -p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerous). -P PYTHON Specify alternate python interpreter to use to invoke esptool. (Default: "$PYTHON") -f FILENAME The *update.bin file to flash. Custom to your device type. @@ -30,7 +42,7 @@ while getopts ":hp:P:f:" opt; do f) FILENAME=${OPTARG} ;; *) - echo "Invalid flag." + echo "Invalid flag." show_help >&2 exit 1 ;; @@ -45,7 +57,7 @@ shift "$((OPTIND-1))" if [ -f "${FILENAME}" ] && [ -z "${FILENAME##*"update"*}" ]; then printf "Trying to flash update ${FILENAME}" - $PYTHON -m esptool --baud 115200 write_flash 0x10000 ${FILENAME} + $ESPTOOL_CMD --baud 115200 write_flash 0x10000 ${FILENAME} else show_help echo "Invalid file: ${FILENAME}" From b506f6dcb025a61fac0cf7745dc60348c4e9c2d3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2024 07:17:23 -0600 Subject: [PATCH 07/13] [create-pull-request] automated change (#5272) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/deviceonly.pb.h | 2 +- src/mesh/generated/meshtastic/mesh.pb.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/protobufs b/protobufs index 06cf134e2..034a18143 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 06cf134e2b3d035c3ca6cbbb90b4c017d4715398 +Subproject commit 034a18143632d4cf17e0acfff66915646f217c27 diff --git a/src/mesh/generated/meshtastic/deviceonly.pb.h b/src/mesh/generated/meshtastic/deviceonly.pb.h index a90e72244..39d056061 100644 --- a/src/mesh/generated/meshtastic/deviceonly.pb.h +++ b/src/mesh/generated/meshtastic/deviceonly.pb.h @@ -81,7 +81,7 @@ typedef struct _meshtastic_NodeInfoLite { uint8_t channel; /* True if we witnessed the node over MQTT instead of LoRA transport */ bool via_mqtt; - /* Number of hops away from us this node is (0 if adjacent) */ + /* Number of hops away from us this node is (0 if direct neighbor) */ bool has_hops_away; uint8_t hops_away; /* True if node is in our favorites list diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index 8b49d3195..e45d60a19 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -720,7 +720,7 @@ typedef struct _meshtastic_MeshPacket { Set during reception to indicate the SNR of this packet. Used to collect statistics on current link quality. */ float rx_snr; - /* If unset treated as zero (no forwarding, send to adjacent nodes only) + /* If unset treated as zero (no forwarding, send to direct neighbor nodes only) if 1, allow hopping through one node, etc... For our usecase real world topologies probably have a max of about 3. This field is normally placed into a few of bits in the header. */ @@ -791,7 +791,7 @@ typedef struct _meshtastic_NodeInfo { uint8_t channel; /* True if we witnessed the node over MQTT instead of LoRA transport */ bool via_mqtt; - /* Number of hops away from us this node is (0 if adjacent) */ + /* Number of hops away from us this node is (0 if direct neighbor) */ bool has_hops_away; uint8_t hops_away; /* True if node is in our favorites list From 286f3c645825d1bb98eb2c0eaeb9ac0eec449731 Mon Sep 17 00:00:00 2001 From: Austin Date: Thu, 7 Nov 2024 08:23:08 -0500 Subject: [PATCH 08/13] uClibc compatibility (#5270) * uclibc compatibility Adds compatibility with uclibc, the officially supported toolchain of the luckfox pico * Explicitly link stdc++fs for std::filesystem Bringing this over from buildroot-meshtastic --- arch/portduino/portduino.ini | 1 + src/mesh/StreamAPI.h | 1 + src/modules/PositionModule.cpp | 3 --- variants/portduino/platformio.ini | 3 ++- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini index 976951b4f..39d1c0b8c 100644 --- a/arch/portduino/portduino.ini +++ b/arch/portduino/portduino.ini @@ -32,6 +32,7 @@ build_flags = -Isrc/platform/portduino -DRADIOLIB_EEPROM_UNSUPPORTED -DPORTDUINO_LINUX_HARDWARE + -lstdc++fs -lbluetooth -lgpiod -lyaml-cpp diff --git a/src/mesh/StreamAPI.h b/src/mesh/StreamAPI.h index 45cbb231c..6e0364bc1 100644 --- a/src/mesh/StreamAPI.h +++ b/src/mesh/StreamAPI.h @@ -3,6 +3,7 @@ #include "PhoneAPI.h" #include "Stream.h" #include "concurrency/OSThread.h" +#include // A To/FromRadio packet + our 32 bit header #define MAX_STREAM_BUF_SIZE (MAX_TO_FROM_RADIO_SIZE + sizeof(uint32_t)) diff --git a/src/modules/PositionModule.cpp b/src/modules/PositionModule.cpp index b7def8242..f80d3eb67 100644 --- a/src/modules/PositionModule.cpp +++ b/src/modules/PositionModule.cpp @@ -16,10 +16,7 @@ #include "meshtastic/atak.pb.h" #include "sleep.h" #include "target_specific.h" - -extern "C" { #include -} PositionModule *positionModule; diff --git a/variants/portduino/platformio.ini b/variants/portduino/platformio.ini index 46417e388..aa11142f7 100644 --- a/variants/portduino/platformio.ini +++ b/variants/portduino/platformio.ini @@ -2,7 +2,8 @@ extends = portduino_base ; The pkg-config commands below optionally add link flags. ; the || : is just a "or run the null command" to avoid returning an error code -build_flags = ${portduino_base.build_flags} -O0 -I variants/portduino -I /usr/include +build_flags = ${portduino_base.build_flags} -O0 -I variants/portduino + -I /usr/include !pkg-config --libs libulfius --silence-errors || : !pkg-config --libs openssl --silence-errors || : board = cross_platform From a815a770b4916a9e4b02e9297fb2bf0a2ae3e253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 7 Nov 2024 15:03:05 +0100 Subject: [PATCH 09/13] Sync up ESP32 build variants --- .github/workflows/build_esp32.yml | 3 +++ .github/workflows/build_esp32_c3.yml | 2 ++ .github/workflows/build_esp32_c6.yml | 1 + .github/workflows/build_esp32_s3.yml | 3 +++ 4 files changed, 9 insertions(+) diff --git a/.github/workflows/build_esp32.yml b/.github/workflows/build_esp32.yml index 7d069e3db..4fc31f22c 100644 --- a/.github/workflows/build_esp32.yml +++ b/.github/workflows/build_esp32.yml @@ -7,6 +7,8 @@ on: required: true type: string +permissions: read-all + jobs: build-esp32: runs-on: ubuntu-latest @@ -24,6 +26,7 @@ jobs: ./arch/esp32/esp32s2.ini ./arch/esp32/esp32s3.ini ./arch/esp32/esp32c3.ini + ./arch/esp32/esp32c6.ini build-script-path: bin/build-esp32.sh ota-firmware-source: firmware.bin ota-firmware-target: release/bleota.bin diff --git a/.github/workflows/build_esp32_c3.yml b/.github/workflows/build_esp32_c3.yml index 5234dbe81..546762952 100644 --- a/.github/workflows/build_esp32_c3.yml +++ b/.github/workflows/build_esp32_c3.yml @@ -26,10 +26,12 @@ jobs: ./arch/esp32/esp32s2.ini ./arch/esp32/esp32s3.ini ./arch/esp32/esp32c3.ini + ./arch/esp32/esp32c6.ini build-script-path: bin/build-esp32.sh ota-firmware-source: firmware-c3.bin ota-firmware-target: release/bleota-c3.bin artifact-paths: | release/*.bin release/*.elf + include-web-ui: true arch: esp32c3 diff --git a/.github/workflows/build_esp32_c6.yml b/.github/workflows/build_esp32_c6.yml index 66f2764a6..56d4d806d 100644 --- a/.github/workflows/build_esp32_c6.yml +++ b/.github/workflows/build_esp32_c6.yml @@ -33,4 +33,5 @@ jobs: artifact-paths: | release/*.bin release/*.elf + include-web-ui: true arch: esp32c6 diff --git a/.github/workflows/build_esp32_s3.yml b/.github/workflows/build_esp32_s3.yml index 554b37cef..a9c067ee1 100644 --- a/.github/workflows/build_esp32_s3.yml +++ b/.github/workflows/build_esp32_s3.yml @@ -7,6 +7,8 @@ on: required: true type: string +permissions: read-all + jobs: build-esp32-s3: runs-on: ubuntu-latest @@ -24,6 +26,7 @@ jobs: ./arch/esp32/esp32s2.ini ./arch/esp32/esp32s3.ini ./arch/esp32/esp32c3.ini + ./arch/esp32/esp32c6.ini build-script-path: bin/build-esp32.sh ota-firmware-source: firmware-s3.bin ota-firmware-target: release/bleota-s3.bin From b0a5a26f5839cfaaf45944f4a96eb1fb4dca20d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 7 Nov 2024 18:01:58 +0100 Subject: [PATCH 10/13] fix wio-tracker-dev sensor scan (#5274) --- src/configuration.h | 5 +++-- src/detect/ScanI2CTwoWire.cpp | 12 +++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/configuration.h b/src/configuration.h index 33f11bd76..15912be3f 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -153,8 +153,9 @@ along with this program. If not, see . // ACCELEROMETER // ----------------------------------------------------------------------------- #define MPU6050_ADDR 0x68 -#define STK8BXX_ADR 0x18 -#define LIS3DH_ADR 0x18 +#define STK8BXX_ADDR 0x18 +#define LIS3DH_ADDR 0x18 +#define LIS3DH_ADDR_ALT 0x19 #define BMA423_ADDR 0x19 #define LSM6DS3_ADDR 0x6A #define BMX160_ADDR 0x69 diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index 995acbdb1..ef5e5ee00 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -409,7 +409,17 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) #else SCAN_SIMPLE_CASE(PMSA0031_ADDR, PMSA0031, "PMSA0031 air quality sensor found") #endif - SCAN_SIMPLE_CASE(BMA423_ADDR, BMA423, "BMA423 accelerometer found"); + case BMA423_ADDR: // this can also be LIS3DH_ADDR_ALT + registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0F), 2); + if (registerValue == 0x3300 || registerValue == 0x3333) { // RAK4631 WisBlock has LIS3DH register at 0x3333 + type = LIS3DH; + LOG_INFO("LIS3DH accelerometer found"); + } else { + type = BMA423; + LOG_INFO("BMA423 accelerometer found"); + } + break; + SCAN_SIMPLE_CASE(LSM6DS3_ADDR, LSM6DS3, "LSM6DS3 accelerometer found at address 0x%x", (uint8_t)addr.address); SCAN_SIMPLE_CASE(TCA9535_ADDR, TCA9535, "TCA9535 I2C expander found"); SCAN_SIMPLE_CASE(TCA9555_ADDR, TCA9555, "TCA9555 I2C expander found"); From 2eea412f1c5e5ff5dff0bef6d631316c32012dcd Mon Sep 17 00:00:00 2001 From: Marco Veneziano Date: Thu, 7 Nov 2024 23:19:31 +0100 Subject: [PATCH 11/13] Fixed compile error when using GPS_DEBUG (#5275) --- src/gps/GPS.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index 662fcf2bc..099a21f82 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -794,7 +794,7 @@ void GPS::writePinEN(bool on) // Write and log enablePin->set(on); #ifdef GPS_DEBUG - LOG_DEBUG("Pin EN %s", val == HIGH ? "HI" : "LOW"); + LOG_DEBUG("Pin EN %s", on == HIGH ? "HI" : "LOW"); #endif } From aa184e6d8b6ef75fbb122f0c00dbfceeb89b4e59 Mon Sep 17 00:00:00 2001 From: Tavis Date: Thu, 7 Nov 2024 13:59:36 -1000 Subject: [PATCH 12/13] copy the has_relative_humidity value to telem packet from AHTX0 packet (#5277) Co-authored-by: Ben Meadors --- src/modules/Telemetry/EnvironmentTelemetry.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/Telemetry/EnvironmentTelemetry.cpp b/src/modules/Telemetry/EnvironmentTelemetry.cpp index 64e936e29..c18944ebd 100644 --- a/src/modules/Telemetry/EnvironmentTelemetry.cpp +++ b/src/modules/Telemetry/EnvironmentTelemetry.cpp @@ -376,12 +376,14 @@ bool EnvironmentTelemetryModule::getEnvironmentTelemetry(meshtastic_Telemetry *m LOG_INFO("AHTX0+BMP280 module detected: using temp from BMP280 and humy from AHTX0"); aht10Sensor.getMetrics(&m_ahtx); m->variant.environment_metrics.relative_humidity = m_ahtx.variant.environment_metrics.relative_humidity; + m->variant.environment_metrics.has_relative_humidity = m_ahtx.variant.environment_metrics.has_relative_humidity; } else { // prefer bmp3xx temp if both sensors are present, fetch only humidity meshtastic_Telemetry m_ahtx = meshtastic_Telemetry_init_zero; LOG_INFO("AHTX0+BMP3XX module detected: using temp from BMP3XX and humy from AHTX0"); aht10Sensor.getMetrics(&m_ahtx); m->variant.environment_metrics.relative_humidity = m_ahtx.variant.environment_metrics.relative_humidity; + m->variant.environment_metrics.has_relative_humidity = m_ahtx.variant.environment_metrics.has_relative_humidity; } } if (max17048Sensor.hasSensor()) { From 439c1dec08a29beaa4939458aeb75a9924a67c74 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 8 Nov 2024 07:53:55 -0600 Subject: [PATCH 13/13] [create-pull-request] automated change (#5284) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/localonly.pb.h | 2 +- src/mesh/generated/meshtastic/module_config.pb.h | 15 ++++++++++----- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/protobufs b/protobufs index 034a18143..834915aa0 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 034a18143632d4cf17e0acfff66915646f217c27 +Subproject commit 834915aa046532da0bd8478c250eb33847e9518f diff --git a/src/mesh/generated/meshtastic/localonly.pb.h b/src/mesh/generated/meshtastic/localonly.pb.h index 6409aef74..8f92b2a77 100644 --- a/src/mesh/generated/meshtastic/localonly.pb.h +++ b/src/mesh/generated/meshtastic/localonly.pb.h @@ -188,7 +188,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 735 -#define meshtastic_LocalModuleConfig_size 697 +#define meshtastic_LocalModuleConfig_size 699 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/module_config.pb.h b/src/mesh/generated/meshtastic/module_config.pb.h index 32d5ded23..8f7bb701d 100644 --- a/src/mesh/generated/meshtastic/module_config.pb.h +++ b/src/mesh/generated/meshtastic/module_config.pb.h @@ -153,8 +153,11 @@ typedef struct _meshtastic_ModuleConfig_NeighborInfoConfig { /* Whether the Module is enabled */ bool enabled; /* Interval in seconds of how often we should try to send our - Neighbor Info to the mesh */ + Neighbor Info (minimum is 14400, i.e., 4 hours) */ uint32_t update_interval; + /* Whether in addition to sending it to MQTT and the PhoneAPI, our NeighborInfo should be transmitted over LoRa. + Note that this is not available on a channel with default key and name. */ + bool transmit_over_lora; } meshtastic_ModuleConfig_NeighborInfoConfig; /* Detection Sensor Module Config */ @@ -501,7 +504,7 @@ extern "C" { #define meshtastic_ModuleConfig_MQTTConfig_init_default {0, "", "", "", 0, 0, 0, "", 0, 0, false, meshtastic_ModuleConfig_MapReportSettings_init_default} #define meshtastic_ModuleConfig_MapReportSettings_init_default {0, 0} #define meshtastic_ModuleConfig_RemoteHardwareConfig_init_default {0, 0, 0, {meshtastic_RemoteHardwarePin_init_default, meshtastic_RemoteHardwarePin_init_default, meshtastic_RemoteHardwarePin_init_default, meshtastic_RemoteHardwarePin_init_default}} -#define meshtastic_ModuleConfig_NeighborInfoConfig_init_default {0, 0} +#define meshtastic_ModuleConfig_NeighborInfoConfig_init_default {0, 0, 0} #define meshtastic_ModuleConfig_DetectionSensorConfig_init_default {0, 0, 0, 0, "", 0, _meshtastic_ModuleConfig_DetectionSensorConfig_TriggerType_MIN, 0} #define meshtastic_ModuleConfig_AudioConfig_init_default {0, 0, _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_MIN, 0, 0, 0, 0} #define meshtastic_ModuleConfig_PaxcounterConfig_init_default {0, 0, 0, 0} @@ -517,7 +520,7 @@ extern "C" { #define meshtastic_ModuleConfig_MQTTConfig_init_zero {0, "", "", "", 0, 0, 0, "", 0, 0, false, meshtastic_ModuleConfig_MapReportSettings_init_zero} #define meshtastic_ModuleConfig_MapReportSettings_init_zero {0, 0} #define meshtastic_ModuleConfig_RemoteHardwareConfig_init_zero {0, 0, 0, {meshtastic_RemoteHardwarePin_init_zero, meshtastic_RemoteHardwarePin_init_zero, meshtastic_RemoteHardwarePin_init_zero, meshtastic_RemoteHardwarePin_init_zero}} -#define meshtastic_ModuleConfig_NeighborInfoConfig_init_zero {0, 0} +#define meshtastic_ModuleConfig_NeighborInfoConfig_init_zero {0, 0, 0} #define meshtastic_ModuleConfig_DetectionSensorConfig_init_zero {0, 0, 0, 0, "", 0, _meshtastic_ModuleConfig_DetectionSensorConfig_TriggerType_MIN, 0} #define meshtastic_ModuleConfig_AudioConfig_init_zero {0, 0, _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_MIN, 0, 0, 0, 0} #define meshtastic_ModuleConfig_PaxcounterConfig_init_zero {0, 0, 0, 0} @@ -546,6 +549,7 @@ extern "C" { #define meshtastic_ModuleConfig_MQTTConfig_map_report_settings_tag 11 #define meshtastic_ModuleConfig_NeighborInfoConfig_enabled_tag 1 #define meshtastic_ModuleConfig_NeighborInfoConfig_update_interval_tag 2 +#define meshtastic_ModuleConfig_NeighborInfoConfig_transmit_over_lora_tag 3 #define meshtastic_ModuleConfig_DetectionSensorConfig_enabled_tag 1 #define meshtastic_ModuleConfig_DetectionSensorConfig_minimum_broadcast_secs_tag 2 #define meshtastic_ModuleConfig_DetectionSensorConfig_state_broadcast_secs_tag 3 @@ -709,7 +713,8 @@ X(a, STATIC, REPEATED, MESSAGE, available_pins, 3) #define meshtastic_ModuleConfig_NeighborInfoConfig_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, BOOL, enabled, 1) \ -X(a, STATIC, SINGULAR, UINT32, update_interval, 2) +X(a, STATIC, SINGULAR, UINT32, update_interval, 2) \ +X(a, STATIC, SINGULAR, BOOL, transmit_over_lora, 3) #define meshtastic_ModuleConfig_NeighborInfoConfig_CALLBACK NULL #define meshtastic_ModuleConfig_NeighborInfoConfig_DEFAULT NULL @@ -884,7 +889,7 @@ extern const pb_msgdesc_t meshtastic_RemoteHardwarePin_msg; #define meshtastic_ModuleConfig_ExternalNotificationConfig_size 42 #define meshtastic_ModuleConfig_MQTTConfig_size 254 #define meshtastic_ModuleConfig_MapReportSettings_size 12 -#define meshtastic_ModuleConfig_NeighborInfoConfig_size 8 +#define meshtastic_ModuleConfig_NeighborInfoConfig_size 10 #define meshtastic_ModuleConfig_PaxcounterConfig_size 30 #define meshtastic_ModuleConfig_RangeTestConfig_size 10 #define meshtastic_ModuleConfig_RemoteHardwareConfig_size 96