mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-09 12:49:40 +00:00
Compare commits
13 Commits
c7c109367b
...
e0e3c8e6b9
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e0e3c8e6b9 | ||
![]() |
bd3cbfc1ad | ||
![]() |
fddc4e00ca | ||
![]() |
5f7eec5504 | ||
![]() |
6b94c297b9 | ||
![]() |
edeb25cab5 | ||
![]() |
44688e8363 | ||
![]() |
5ae4ff9162 | ||
![]() |
ed394f5f9d | ||
![]() |
11db6d4dcc | ||
![]() |
4e03df5ea7 | ||
![]() |
d3e3a91096 | ||
![]() |
b0e8321514 |
@ -8,15 +8,15 @@ plugins:
|
|||||||
uri: https://github.com/trunk-io/plugins
|
uri: https://github.com/trunk-io/plugins
|
||||||
lint:
|
lint:
|
||||||
enabled:
|
enabled:
|
||||||
- checkov@3.2.465
|
- checkov@3.2.467
|
||||||
- renovate@41.82.10
|
- renovate@41.90.1
|
||||||
- prettier@3.6.2
|
- prettier@3.6.2
|
||||||
- trufflehog@3.90.5
|
- trufflehog@3.90.5
|
||||||
- yamllint@1.37.1
|
- yamllint@1.37.1
|
||||||
- bandit@1.8.6
|
- bandit@1.8.6
|
||||||
- trivy@0.65.0
|
- trivy@0.65.0
|
||||||
- taplo@0.10.0
|
- taplo@0.10.0
|
||||||
- ruff@0.12.10
|
- ruff@0.12.11
|
||||||
- isort@6.0.1
|
- isort@6.0.1
|
||||||
- markdownlint@0.45.0
|
- markdownlint@0.45.0
|
||||||
- oxipng@9.1.5
|
- oxipng@9.1.5
|
||||||
|
@ -100,7 +100,6 @@ IF NOT "!FILENAME:update=!"=="!FILENAME!" (
|
|||||||
)
|
)
|
||||||
|
|
||||||
:skip-filename
|
:skip-filename
|
||||||
SET "ESPTOOL_BAUD=1200"
|
|
||||||
|
|
||||||
CALL :LOG_MESSAGE DEBUG "Determine the correct esptool command to use..."
|
CALL :LOG_MESSAGE DEBUG "Determine the correct esptool command to use..."
|
||||||
IF NOT "__%PYTHON%__"=="____" (
|
IF NOT "__%PYTHON%__"=="____" (
|
||||||
@ -142,7 +141,7 @@ CALL :LOG_MESSAGE INFO "Using esptool baud: !ESPTOOL_BAUD!."
|
|||||||
|
|
||||||
IF %BPS_RESET% EQU 1 (
|
IF %BPS_RESET% EQU 1 (
|
||||||
@REM Attempt to change mode via 1200bps Reset.
|
@REM Attempt to change mode via 1200bps Reset.
|
||||||
CALL :RUN_ESPTOOL !ESPTOOL_BAUD! --after no_reset read_flash_status
|
CALL :RUN_ESPTOOL 1200 --after no_reset read_flash_status
|
||||||
GOTO eof
|
GOTO eof
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -87,6 +87,9 @@
|
|||||||
</screenshots>
|
</screenshots>
|
||||||
|
|
||||||
<releases>
|
<releases>
|
||||||
|
<release version="2.7.8" date="2025-08-30">
|
||||||
|
<url type="details">https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.8</url>
|
||||||
|
</release>
|
||||||
<release version="2.7.7" date="2025-08-28">
|
<release version="2.7.7" date="2025-08-28">
|
||||||
<url type="details">https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.7</url>
|
<url type="details">https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.7</url>
|
||||||
</release>
|
</release>
|
||||||
|
7
debian/changelog
vendored
7
debian/changelog
vendored
@ -1,4 +1,4 @@
|
|||||||
meshtasticd (2.7.7.0) UNRELEASED; urgency=medium
|
meshtasticd (2.7.8.0) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
[ Austin Lane ]
|
[ Austin Lane ]
|
||||||
* Initial packaging
|
* Initial packaging
|
||||||
@ -41,4 +41,7 @@ meshtasticd (2.7.7.0) UNRELEASED; urgency=medium
|
|||||||
* GitHub Actions Automatic version bump
|
* GitHub Actions Automatic version bump
|
||||||
* GitHub Actions Automatic version bump
|
* GitHub Actions Automatic version bump
|
||||||
|
|
||||||
-- Ubuntu <github-actions[bot]@users.noreply.github.com> Thu, 28 Aug 2025 10:33:25 +0000
|
[ ]
|
||||||
|
* GitHub Actions Automatic version bump
|
||||||
|
|
||||||
|
-- <github-actions[bot]@users.noreply.github.com> Sat, 30 Aug 2025 00:26:04 +0000
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 8985852d752de3f7210f9a4a3e0923120ec438b3
|
Subproject commit 4c4427c4a73c86fed7dc8632188bb8be95349d81
|
@ -128,6 +128,7 @@ RAK9154Sensor rak9154Sensor;
|
|||||||
#ifdef HAS_PPM
|
#ifdef HAS_PPM
|
||||||
// note: XPOWERS_CHIP_XXX must be defined in variant.h
|
// note: XPOWERS_CHIP_XXX must be defined in variant.h
|
||||||
#include <XPowersLib.h>
|
#include <XPowersLib.h>
|
||||||
|
XPowersPPM *PPM = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_BQ27220
|
#ifdef HAS_BQ27220
|
||||||
@ -681,7 +682,7 @@ bool Power::setup()
|
|||||||
found = true;
|
found = true;
|
||||||
} else if (lipoChargerInit()) {
|
} else if (lipoChargerInit()) {
|
||||||
found = true;
|
found = true;
|
||||||
} else if (meshSolarInit()) {
|
} else if (meshSolarInit()) {
|
||||||
found = true;
|
found = true;
|
||||||
} else if (analogInit()) {
|
} else if (analogInit()) {
|
||||||
found = true;
|
found = true;
|
||||||
@ -745,7 +746,11 @@ void Power::shutdown()
|
|||||||
|
|
||||||
#if HAS_SCREEN
|
#if HAS_SCREEN
|
||||||
if (screen) {
|
if (screen) {
|
||||||
|
#ifdef T_DECK_PRO
|
||||||
|
screen->showSimpleBanner("Device is powered off.\nConnect USB to start!", 0); // T-Deck Pro has no power button
|
||||||
|
#else
|
||||||
screen->showSimpleBanner("Shutting Down...", 0); // stays on screen
|
screen->showSimpleBanner("Shutting Down...", 0); // stays on screen
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if !defined(ARCH_STM32WL)
|
#if !defined(ARCH_STM32WL)
|
||||||
@ -763,7 +768,7 @@ void Power::shutdown()
|
|||||||
#ifdef PIN_LED3
|
#ifdef PIN_LED3
|
||||||
ledOff(PIN_LED3);
|
ledOff(PIN_LED3);
|
||||||
#endif
|
#endif
|
||||||
doDeepSleep(DELAY_FOREVER, false, true);
|
doDeepSleep(DELAY_FOREVER, true, true);
|
||||||
#elif defined(ARCH_PORTDUINO)
|
#elif defined(ARCH_PORTDUINO)
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
#else
|
#else
|
||||||
@ -1320,7 +1325,6 @@ bool Power::lipoInit()
|
|||||||
class LipoCharger : public HasBatteryLevel
|
class LipoCharger : public HasBatteryLevel
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
XPowersPPM *ppm = nullptr;
|
|
||||||
BQ27220 *bq = nullptr;
|
BQ27220 *bq = nullptr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -1329,41 +1333,41 @@ class LipoCharger : public HasBatteryLevel
|
|||||||
*/
|
*/
|
||||||
bool runOnce()
|
bool runOnce()
|
||||||
{
|
{
|
||||||
if (ppm == nullptr) {
|
if (PPM == nullptr) {
|
||||||
ppm = new XPowersPPM;
|
PPM = new XPowersPPM;
|
||||||
bool result = ppm->init(Wire, I2C_SDA, I2C_SCL, BQ25896_ADDR);
|
bool result = PPM->init(Wire, I2C_SDA, I2C_SCL, BQ25896_ADDR);
|
||||||
if (result) {
|
if (result) {
|
||||||
LOG_INFO("PPM BQ25896 init succeeded");
|
LOG_INFO("PPM BQ25896 init succeeded");
|
||||||
// Set the minimum operating voltage. Below this voltage, the PPM will protect
|
// Set the minimum operating voltage. Below this voltage, the PPM will protect
|
||||||
// ppm->setSysPowerDownVoltage(3100);
|
// PPM->setSysPowerDownVoltage(3100);
|
||||||
|
|
||||||
// Set input current limit, default is 500mA
|
// Set input current limit, default is 500mA
|
||||||
// ppm->setInputCurrentLimit(800);
|
// PPM->setInputCurrentLimit(800);
|
||||||
|
|
||||||
// Disable current limit pin
|
// Disable current limit pin
|
||||||
// ppm->disableCurrentLimitPin();
|
// PPM->disableCurrentLimitPin();
|
||||||
|
|
||||||
// Set the charging target voltage, Range:3840 ~ 4608mV ,step:16 mV
|
// Set the charging target voltage, Range:3840 ~ 4608mV ,step:16 mV
|
||||||
ppm->setChargeTargetVoltage(4288);
|
PPM->setChargeTargetVoltage(4288);
|
||||||
|
|
||||||
// Set the precharge current , Range: 64mA ~ 1024mA ,step:64mA
|
// Set the precharge current , Range: 64mA ~ 1024mA ,step:64mA
|
||||||
// ppm->setPrechargeCurr(64);
|
// PPM->setPrechargeCurr(64);
|
||||||
|
|
||||||
// The premise is that limit pin is disabled, or it will
|
// The premise is that limit pin is disabled, or it will
|
||||||
// only follow the maximum charging current set by limit pin.
|
// only follow the maximum charging current set by limit pin.
|
||||||
// Set the charging current , Range:0~5056mA ,step:64mA
|
// Set the charging current , Range:0~5056mA ,step:64mA
|
||||||
ppm->setChargerConstantCurr(1024);
|
PPM->setChargerConstantCurr(1024);
|
||||||
|
|
||||||
// To obtain voltage data, the ADC must be enabled first
|
// To obtain voltage data, the ADC must be enabled first
|
||||||
ppm->enableMeasure();
|
PPM->enableMeasure();
|
||||||
|
|
||||||
// Turn on charging function
|
// Turn on charging function
|
||||||
// If there is no battery connected, do not turn on the charging function
|
// If there is no battery connected, do not turn on the charging function
|
||||||
ppm->enableCharge();
|
PPM->enableCharge();
|
||||||
} else {
|
} else {
|
||||||
LOG_WARN("PPM BQ25896 init failed");
|
LOG_WARN("PPM BQ25896 init failed");
|
||||||
delete ppm;
|
delete PPM;
|
||||||
ppm = nullptr;
|
PPM = nullptr;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1404,23 +1408,23 @@ class LipoCharger : public HasBatteryLevel
|
|||||||
/**
|
/**
|
||||||
* return true if there is a battery installed in this unit
|
* return true if there is a battery installed in this unit
|
||||||
*/
|
*/
|
||||||
virtual bool isBatteryConnect() override { return ppm->getBattVoltage() > 0; }
|
virtual bool isBatteryConnect() override { return PPM->getBattVoltage() > 0; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return true if there is an external power source detected
|
* return true if there is an external power source detected
|
||||||
*/
|
*/
|
||||||
virtual bool isVbusIn() override { return ppm->getVbusVoltage() > 0; }
|
virtual bool isVbusIn() override { return PPM->getVbusVoltage() > 0; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return true if the battery is currently charging
|
* return true if the battery is currently charging
|
||||||
*/
|
*/
|
||||||
virtual bool isCharging() override
|
virtual bool isCharging() override
|
||||||
{
|
{
|
||||||
bool isCharging = ppm->isCharging();
|
bool isCharging = PPM->isCharging();
|
||||||
if (isCharging) {
|
if (isCharging) {
|
||||||
LOG_DEBUG("BQ27220 time to full charge: %d min", bq->getTimeToFull());
|
LOG_DEBUG("BQ27220 time to full charge: %d min", bq->getTimeToFull());
|
||||||
} else {
|
} else {
|
||||||
if (!ppm->isVbusIn()) {
|
if (!PPM->isVbusIn()) {
|
||||||
LOG_DEBUG("BQ27220 time to empty: %d min (%d mAh)", bq->getTimeToEmpty(), bq->getRemainingCapacity());
|
LOG_DEBUG("BQ27220 time to empty: %d min (%d mAh)", bq->getTimeToEmpty(), bq->getRemainingCapacity());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1453,8 +1457,6 @@ bool Power::lipoChargerInit()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HELTEC_MESH_SOLAR
|
#ifdef HELTEC_MESH_SOLAR
|
||||||
#include "meshSolarApp.h"
|
#include "meshSolarApp.h"
|
||||||
|
|
||||||
@ -1492,7 +1494,7 @@ class meshSolarBatteryLevel : public HasBatteryLevel
|
|||||||
/**
|
/**
|
||||||
* return true if there is an external power source detected
|
* return true if there is an external power source detected
|
||||||
*/
|
*/
|
||||||
virtual bool isVbusIn() override { return meshSolarIsVbusIn();}
|
virtual bool isVbusIn() override { return meshSolarIsVbusIn(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return true if the battery is currently charging
|
* return true if the battery is currently charging
|
||||||
|
@ -26,10 +26,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
#ifdef RV3028_RTC
|
#if __has_include("Melopero_RV3028.h")
|
||||||
#include "Melopero_RV3028.h"
|
#include "Melopero_RV3028.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef PCF8563_RTC
|
#if __has_include("pcf8563.h")
|
||||||
#include "pcf8563.h"
|
#include "pcf8563.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1504,7 +1504,7 @@ static int32_t toDegInt(RawDegrees d)
|
|||||||
* Perform any processing that should be done only while the GPS is awake and looking for a fix.
|
* Perform any processing that should be done only while the GPS is awake and looking for a fix.
|
||||||
* Override this method to check for new locations
|
* Override this method to check for new locations
|
||||||
*
|
*
|
||||||
* @return true if we've acquired a new location
|
* @return true if we've set a new time
|
||||||
*/
|
*/
|
||||||
bool GPS::lookForTime()
|
bool GPS::lookForTime()
|
||||||
{
|
{
|
||||||
@ -1544,11 +1544,12 @@ The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of s
|
|||||||
if (t.tm_mon > -1) {
|
if (t.tm_mon > -1) {
|
||||||
LOG_DEBUG("NMEA GPS time %02d-%02d-%02d %02d:%02d:%02d age %d", d.year(), d.month(), t.tm_mday, t.tm_hour, t.tm_min,
|
LOG_DEBUG("NMEA GPS time %02d-%02d-%02d %02d:%02d:%02d age %d", d.year(), d.month(), t.tm_mday, t.tm_hour, t.tm_min,
|
||||||
t.tm_sec, ti.age());
|
t.tm_sec, ti.age());
|
||||||
if (perhapsSetRTC(RTCQualityGPS, t) == RTCSetResultInvalidTime) {
|
if (perhapsSetRTC(RTCQualityGPS, t) == RTCSetResultSuccess) {
|
||||||
// Clear the GPS buffer if we got an invalid time
|
LOG_DEBUG("Time set.");
|
||||||
clearBuffer();
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
} else
|
} else
|
||||||
return false;
|
return false;
|
||||||
} else
|
} else
|
||||||
|
@ -23,7 +23,7 @@ static uint64_t zeroOffsetSecs; // GPS based time in secs since 1970 - only upda
|
|||||||
* Reads the current date and time from the RTC module and updates the system time.
|
* Reads the current date and time from the RTC module and updates the system time.
|
||||||
* @return True if the RTC was successfully read and the system time was updated, false otherwise.
|
* @return True if the RTC was successfully read and the system time was updated, false otherwise.
|
||||||
*/
|
*/
|
||||||
void readFromRTC()
|
RTCSetResult readFromRTC()
|
||||||
{
|
{
|
||||||
struct timeval tv; /* btw settimeofday() is helpful here too*/
|
struct timeval tv; /* btw settimeofday() is helpful here too*/
|
||||||
#ifdef RV3028_RTC
|
#ifdef RV3028_RTC
|
||||||
@ -44,15 +44,23 @@ void readFromRTC()
|
|||||||
t.tm_sec = rtc.getSecond();
|
t.tm_sec = rtc.getSecond();
|
||||||
tv.tv_sec = gm_mktime(&t);
|
tv.tv_sec = gm_mktime(&t);
|
||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
|
|
||||||
uint32_t printableEpoch = tv.tv_sec; // Print lib only supports 32 bit but time_t can be 64 bit on some platforms
|
uint32_t printableEpoch = tv.tv_sec; // Print lib only supports 32 bit but time_t can be 64 bit on some platforms
|
||||||
|
|
||||||
|
#ifdef BUILD_EPOCH
|
||||||
|
if (tv.tv_sec < BUILD_EPOCH) {
|
||||||
|
LOG_WARN("Ignore time (%ld) before build epoch (%ld)!", printableEpoch, BUILD_EPOCH);
|
||||||
|
return RTCSetResultInvalidTime;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
LOG_DEBUG("Read RTC time from RV3028 getTime as %02d-%02d-%02d %02d:%02d:%02d (%ld)", t.tm_year + 1900, t.tm_mon + 1,
|
LOG_DEBUG("Read RTC time from RV3028 getTime as %02d-%02d-%02d %02d:%02d:%02d (%ld)", t.tm_year + 1900, t.tm_mon + 1,
|
||||||
t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, printableEpoch);
|
t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, printableEpoch);
|
||||||
timeStartMsec = now;
|
|
||||||
zeroOffsetSecs = tv.tv_sec;
|
|
||||||
if (currentQuality == RTCQualityNone) {
|
if (currentQuality == RTCQualityNone) {
|
||||||
|
timeStartMsec = now;
|
||||||
|
zeroOffsetSecs = tv.tv_sec;
|
||||||
currentQuality = RTCQualityDevice;
|
currentQuality = RTCQualityDevice;
|
||||||
}
|
}
|
||||||
|
return RTCSetResultSuccess;
|
||||||
}
|
}
|
||||||
#elif defined(PCF8563_RTC)
|
#elif defined(PCF8563_RTC)
|
||||||
if (rtc_found.address == PCF8563_RTC) {
|
if (rtc_found.address == PCF8563_RTC) {
|
||||||
@ -75,15 +83,23 @@ void readFromRTC()
|
|||||||
t.tm_sec = tc.second;
|
t.tm_sec = tc.second;
|
||||||
tv.tv_sec = gm_mktime(&t);
|
tv.tv_sec = gm_mktime(&t);
|
||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
|
|
||||||
uint32_t printableEpoch = tv.tv_sec; // Print lib only supports 32 bit but time_t can be 64 bit on some platforms
|
uint32_t printableEpoch = tv.tv_sec; // Print lib only supports 32 bit but time_t can be 64 bit on some platforms
|
||||||
|
|
||||||
|
#ifdef BUILD_EPOCH
|
||||||
|
if (tv.tv_sec < BUILD_EPOCH) {
|
||||||
|
LOG_WARN("Ignore time (%ld) before build epoch (%ld)!", printableEpoch, BUILD_EPOCH);
|
||||||
|
return RTCSetResultInvalidTime;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
LOG_DEBUG("Read RTC time from PCF8563 getDateTime as %02d-%02d-%02d %02d:%02d:%02d (%ld)", t.tm_year + 1900, t.tm_mon + 1,
|
LOG_DEBUG("Read RTC time from PCF8563 getDateTime as %02d-%02d-%02d %02d:%02d:%02d (%ld)", t.tm_year + 1900, t.tm_mon + 1,
|
||||||
t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, printableEpoch);
|
t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, printableEpoch);
|
||||||
timeStartMsec = now;
|
|
||||||
zeroOffsetSecs = tv.tv_sec;
|
|
||||||
if (currentQuality == RTCQualityNone) {
|
if (currentQuality == RTCQualityNone) {
|
||||||
|
timeStartMsec = now;
|
||||||
|
zeroOffsetSecs = tv.tv_sec;
|
||||||
currentQuality = RTCQualityDevice;
|
currentQuality = RTCQualityDevice;
|
||||||
}
|
}
|
||||||
|
return RTCSetResultSuccess;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (!gettimeofday(&tv, NULL)) {
|
if (!gettimeofday(&tv, NULL)) {
|
||||||
@ -92,8 +108,10 @@ void readFromRTC()
|
|||||||
LOG_DEBUG("Read RTC time as %ld", printableEpoch);
|
LOG_DEBUG("Read RTC time as %ld", printableEpoch);
|
||||||
timeStartMsec = now;
|
timeStartMsec = now;
|
||||||
zeroOffsetSecs = tv.tv_sec;
|
zeroOffsetSecs = tv.tv_sec;
|
||||||
|
return RTCSetResultSuccess;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
return RTCSetResultNotSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -101,7 +119,7 @@ void readFromRTC()
|
|||||||
*
|
*
|
||||||
* @param q The quality of the provided time.
|
* @param q The quality of the provided time.
|
||||||
* @param tv A pointer to a timeval struct containing the time to potentially set the RTC to.
|
* @param tv A pointer to a timeval struct containing the time to potentially set the RTC to.
|
||||||
* @return True if the RTC was set, false otherwise.
|
* @return RTCSetResult
|
||||||
*
|
*
|
||||||
* If we haven't yet set our RTC this boot, set it from a GPS derived time
|
* If we haven't yet set our RTC this boot, set it from a GPS derived time
|
||||||
*/
|
*/
|
||||||
|
@ -48,7 +48,7 @@ uint32_t getTime(bool local = false);
|
|||||||
/// Return time since 1970 in secs. If quality is RTCQualityNone return zero
|
/// Return time since 1970 in secs. If quality is RTCQualityNone return zero
|
||||||
uint32_t getValidTime(RTCQuality minQuality, bool local = false);
|
uint32_t getValidTime(RTCQuality minQuality, bool local = false);
|
||||||
|
|
||||||
void readFromRTC();
|
RTCSetResult readFromRTC();
|
||||||
|
|
||||||
time_t gm_mktime(struct tm *tm);
|
time_t gm_mktime(struct tm *tm);
|
||||||
|
|
||||||
|
@ -419,7 +419,7 @@ void setup()
|
|||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
tv.tv_sec = time(NULL);
|
tv.tv_sec = time(NULL);
|
||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
perhapsSetRTC(RTCQualityNTP, &tv);
|
perhapsSetRTC(RTCQualityDevice, &tv);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
powerMonInit();
|
powerMonInit();
|
||||||
|
@ -85,11 +85,8 @@ meshtastic_MeshPacket *MeshModule::allocErrorResponse(meshtastic_Routing_Error e
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MeshModule::callModules(meshtastic_MeshPacket &mp, RxSource src, const char *specificModule)
|
void MeshModule::callModules(meshtastic_MeshPacket &mp, RxSource src)
|
||||||
{
|
{
|
||||||
if (specificModule) {
|
|
||||||
LOG_DEBUG("Calling specific module: %s", specificModule);
|
|
||||||
}
|
|
||||||
// LOG_DEBUG("In call modules");
|
// LOG_DEBUG("In call modules");
|
||||||
bool moduleFound = false;
|
bool moduleFound = false;
|
||||||
|
|
||||||
@ -103,15 +100,11 @@ void MeshModule::callModules(meshtastic_MeshPacket &mp, RxSource src, const char
|
|||||||
// Was this message directed to us specifically? Will be false if we are sniffing someone elses packets
|
// Was this message directed to us specifically? Will be false if we are sniffing someone elses packets
|
||||||
auto ourNodeNum = nodeDB->getNodeNum();
|
auto ourNodeNum = nodeDB->getNodeNum();
|
||||||
bool toUs = isBroadcast(mp.to) || isToUs(&mp);
|
bool toUs = isBroadcast(mp.to) || isToUs(&mp);
|
||||||
|
bool fromUs = mp.from == ourNodeNum;
|
||||||
|
|
||||||
for (auto i = modules->begin(); i != modules->end(); ++i) {
|
for (auto i = modules->begin(); i != modules->end(); ++i) {
|
||||||
auto &pi = **i;
|
auto &pi = **i;
|
||||||
|
|
||||||
// If specificModule is provided, only call that specific module
|
|
||||||
if (specificModule && (!pi.name || strcmp(pi.name, specificModule) != 0)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
pi.currentRequest = ∓
|
pi.currentRequest = ∓
|
||||||
|
|
||||||
/// We only call modules that are interested in the packet (and the message is destined to us or we are promiscious)
|
/// We only call modules that are interested in the packet (and the message is destined to us or we are promiscious)
|
||||||
|
@ -73,7 +73,7 @@ class MeshModule
|
|||||||
|
|
||||||
/** For use only by MeshService
|
/** For use only by MeshService
|
||||||
*/
|
*/
|
||||||
static void callModules(meshtastic_MeshPacket &mp, RxSource src = RX_SRC_RADIO, const char *specificModule = nullptr);
|
static void callModules(meshtastic_MeshPacket &mp, RxSource src = RX_SRC_RADIO);
|
||||||
|
|
||||||
static std::vector<MeshModule *> GetMeshModulesWithUIFrames(int startIndex);
|
static std::vector<MeshModule *> GetMeshModulesWithUIFrames(int startIndex);
|
||||||
static void observeUIEvents(Observer<const UIFrameEvent *> *observer);
|
static void observeUIEvents(Observer<const UIFrameEvent *> *observer);
|
||||||
|
@ -1711,10 +1711,10 @@ bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelInde
|
|||||||
/// we updateGUI and updateGUIforNode if we think our this change is big enough for a redraw
|
/// we updateGUI and updateGUIforNode if we think our this change is big enough for a redraw
|
||||||
void NodeDB::updateFrom(const meshtastic_MeshPacket &mp)
|
void NodeDB::updateFrom(const meshtastic_MeshPacket &mp)
|
||||||
{
|
{
|
||||||
// if (mp.from == getNodeNum()) {
|
if (mp.from == getNodeNum()) {
|
||||||
// LOG_DEBUG("Ignore update from self");
|
LOG_DEBUG("Ignore update from self");
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
if (mp.which_payload_variant == meshtastic_MeshPacket_decoded_tag && mp.from) {
|
if (mp.which_payload_variant == meshtastic_MeshPacket_decoded_tag && mp.from) {
|
||||||
LOG_DEBUG("Update DB node 0x%x, rx_time=%u", mp.from, mp.rx_time);
|
LOG_DEBUG("Update DB node 0x%x, rx_time=%u", mp.from, mp.rx_time);
|
||||||
|
|
||||||
|
@ -562,7 +562,7 @@ meshtastic_Routing_Error perhapsEncode(meshtastic_MeshPacket *p)
|
|||||||
// Now that we are encrypting the packet channel should be the hash (no longer the index)
|
// Now that we are encrypting the packet channel should be the hash (no longer the index)
|
||||||
p->channel = hash;
|
p->channel = hash;
|
||||||
if (hash < 0) {
|
if (hash < 0) {
|
||||||
// No suitable channel could be found for sending
|
// No suitable channel could be found for
|
||||||
return meshtastic_Routing_Error_NO_CHANNEL;
|
return meshtastic_Routing_Error_NO_CHANNEL;
|
||||||
}
|
}
|
||||||
crypto->encryptPacket(getFrom(p), p->id, numbytes, bytes);
|
crypto->encryptPacket(getFrom(p), p->id, numbytes, bytes);
|
||||||
@ -578,7 +578,7 @@ meshtastic_Routing_Error perhapsEncode(meshtastic_MeshPacket *p)
|
|||||||
// Now that we are encrypting the packet channel should be the hash (no longer the index)
|
// Now that we are encrypting the packet channel should be the hash (no longer the index)
|
||||||
p->channel = hash;
|
p->channel = hash;
|
||||||
if (hash < 0) {
|
if (hash < 0) {
|
||||||
// No suitable channel could be found for sending
|
// No suitable channel could be found for
|
||||||
return meshtastic_Routing_Error_NO_CHANNEL;
|
return meshtastic_Routing_Error_NO_CHANNEL;
|
||||||
}
|
}
|
||||||
crypto->encryptPacket(getFrom(p), p->id, numbytes, bytes);
|
crypto->encryptPacket(getFrom(p), p->id, numbytes, bytes);
|
||||||
@ -671,7 +671,7 @@ void Router::handleReceived(meshtastic_MeshPacket *p, RxSource src)
|
|||||||
mqtt->onSend(*p_encrypted, *p, p->channel);
|
mqtt->onSend(*p_encrypted, *p, p->channel);
|
||||||
#endif
|
#endif
|
||||||
} else if (p->from == nodeDB->getNodeNum() && !skipHandle) {
|
} else if (p->from == nodeDB->getNodeNum() && !skipHandle) {
|
||||||
MeshModule::callModules(*p, src, ROUTING_MODULE);
|
MeshModule::callModules(*p, src);
|
||||||
}
|
}
|
||||||
|
|
||||||
packetPool.release(p_encrypted); // Release the encrypted packet
|
packetPool.release(p_encrypted); // Release the encrypted packet
|
||||||
|
@ -632,10 +632,10 @@ bool CannedMessageModule::handleMessageSelectorInput(const InputEvent *event, bo
|
|||||||
// Normal canned message selection
|
// Normal canned message selection
|
||||||
if (runState == CANNED_MESSAGE_RUN_STATE_INACTIVE || runState == CANNED_MESSAGE_RUN_STATE_DISABLED) {
|
if (runState == CANNED_MESSAGE_RUN_STATE_INACTIVE || runState == CANNED_MESSAGE_RUN_STATE_DISABLED) {
|
||||||
} else {
|
} else {
|
||||||
|
#if CANNED_MESSAGE_ADD_CONFIRMATION
|
||||||
// Show confirmation dialog before sending canned message
|
// Show confirmation dialog before sending canned message
|
||||||
NodeNum destNode = dest;
|
NodeNum destNode = dest;
|
||||||
ChannelIndex chan = channel;
|
ChannelIndex chan = channel;
|
||||||
#if CANNED_MESSAGE_ADD_CONFIRMATION
|
|
||||||
graphics::menuHandler::showConfirmationBanner("Send message?", [this, destNode, chan, current]() {
|
graphics::menuHandler::showConfirmationBanner("Send message?", [this, destNode, chan, current]() {
|
||||||
this->sendText(destNode, chan, current, false);
|
this->sendText(destNode, chan, current, false);
|
||||||
payload = runState;
|
payload = runState;
|
||||||
@ -991,7 +991,6 @@ int32_t CannedMessageModule::runOnce()
|
|||||||
this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE;
|
this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
e.action = UIFrameEvent::Action::REGENERATE_FRAMESET;
|
|
||||||
this->currentMessageIndex = -1;
|
this->currentMessageIndex = -1;
|
||||||
this->freetext = "";
|
this->freetext = "";
|
||||||
this->cursor = 0;
|
this->cursor = 0;
|
||||||
|
@ -105,14 +105,15 @@ void NeighborInfoModule::sendNeighborInfo(NodeNum dest, bool wantReplies)
|
|||||||
{
|
{
|
||||||
meshtastic_NeighborInfo neighborInfo = meshtastic_NeighborInfo_init_zero;
|
meshtastic_NeighborInfo neighborInfo = meshtastic_NeighborInfo_init_zero;
|
||||||
collectNeighborInfo(&neighborInfo);
|
collectNeighborInfo(&neighborInfo);
|
||||||
meshtastic_MeshPacket *p = allocDataProtobuf(neighborInfo);
|
// only send neighbours if we have some to send
|
||||||
// send regardless of whether or not we have neighbors in our DB,
|
if (neighborInfo.neighbors_count > 0) {
|
||||||
// because we want to get neighbors for the next cycle
|
meshtastic_MeshPacket *p = allocDataProtobuf(neighborInfo);
|
||||||
p->to = dest;
|
p->to = dest;
|
||||||
p->decoded.want_response = wantReplies;
|
p->decoded.want_response = wantReplies;
|
||||||
p->priority = meshtastic_MeshPacket_Priority_BACKGROUND;
|
p->priority = meshtastic_MeshPacket_Priority_BACKGROUND;
|
||||||
printNeighborInfo("SENDING", &neighborInfo);
|
printNeighborInfo("SENDING", &neighborInfo);
|
||||||
service->sendToMesh(p, RX_SRC_LOCAL, true);
|
service->sendToMesh(p, RX_SRC_LOCAL, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -73,7 +73,7 @@ uint8_t RoutingModule::getHopLimitForResponse(uint8_t hopStart, uint8_t hopLimit
|
|||||||
return Default::getConfiguredOrDefaultHopLimit(config.lora.hop_limit); // Use the default hop limit
|
return Default::getConfiguredOrDefaultHopLimit(config.lora.hop_limit); // Use the default hop limit
|
||||||
}
|
}
|
||||||
|
|
||||||
RoutingModule::RoutingModule() : ProtobufModule(ROUTING_MODULE, meshtastic_PortNum_ROUTING_APP, &meshtastic_Routing_msg)
|
RoutingModule::RoutingModule() : ProtobufModule("routing", meshtastic_PortNum_ROUTING_APP, &meshtastic_Routing_msg)
|
||||||
{
|
{
|
||||||
isPromiscuous = true;
|
isPromiscuous = true;
|
||||||
|
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
#include "Channels.h"
|
#include "Channels.h"
|
||||||
#include "ProtobufModule.h"
|
#include "ProtobufModule.h"
|
||||||
|
|
||||||
static const char *ROUTING_MODULE = "routing";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Routing module for router control messages
|
* Routing module for router control messages
|
||||||
*/
|
*/
|
||||||
|
@ -32,6 +32,16 @@ esp_sleep_source_t wakeCause; // the reason we booted this time
|
|||||||
#endif
|
#endif
|
||||||
#include "Throttle.h"
|
#include "Throttle.h"
|
||||||
|
|
||||||
|
#ifdef USE_XL9555
|
||||||
|
#include "ExtensionIOXL9555.hpp"
|
||||||
|
extern ExtensionIOXL9555 io;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAS_PPM
|
||||||
|
#include <XPowersLib.h>
|
||||||
|
extern XPowersPPM *PPM;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef INCLUDE_vTaskSuspend
|
#ifndef INCLUDE_vTaskSuspend
|
||||||
#define INCLUDE_vTaskSuspend 0
|
#define INCLUDE_vTaskSuspend 0
|
||||||
#endif
|
#endif
|
||||||
@ -297,6 +307,14 @@ void doDeepSleep(uint32_t msecToWake, bool skipPreflight = false, bool skipSaveN
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAS_PPM
|
||||||
|
if (PPM) {
|
||||||
|
LOG_INFO("PMM shutdown");
|
||||||
|
console->flush();
|
||||||
|
PPM->shutdown();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_PMU
|
#ifdef HAS_PMU
|
||||||
if (pmu_found && PMU) {
|
if (pmu_found && PMU) {
|
||||||
// Obsolete comment: from back when we we used to receive lora packets while CPU was in deep sleep.
|
// Obsolete comment: from back when we we used to receive lora packets while CPU was in deep sleep.
|
||||||
@ -412,6 +430,16 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r
|
|||||||
if (pmu_found)
|
if (pmu_found)
|
||||||
gpio_wakeup_enable((gpio_num_t)PMU_IRQ, GPIO_INTR_LOW_LEVEL); // pmu irq
|
gpio_wakeup_enable((gpio_num_t)PMU_IRQ, GPIO_INTR_LOW_LEVEL); // pmu irq
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef T_LORA_PAGER
|
||||||
|
LOG_DEBUG("power down XL9555 io");
|
||||||
|
io.digitalWrite(EXPANDS_DRV_EN, LOW);
|
||||||
|
io.digitalWrite(EXPANDS_AMP_EN, LOW);
|
||||||
|
io.digitalWrite(EXPANDS_KB_EN, LOW);
|
||||||
|
io.digitalWrite(EXPANDS_SD_EN, LOW);
|
||||||
|
io.digitalWrite(EXPANDS_GPIO_EN, LOW);
|
||||||
|
#endif
|
||||||
|
|
||||||
auto res = esp_sleep_enable_gpio_wakeup();
|
auto res = esp_sleep_enable_gpio_wakeup();
|
||||||
if (res != ESP_OK) {
|
if (res != ESP_OK) {
|
||||||
LOG_ERROR("esp_sleep_enable_gpio_wakeup result %d", res);
|
LOG_ERROR("esp_sleep_enable_gpio_wakeup result %d", res);
|
||||||
@ -452,6 +480,14 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r
|
|||||||
gpio_wakeup_disable((gpio_num_t)RF95_IRQ);
|
gpio_wakeup_disable((gpio_num_t)RF95_IRQ);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef T_LORA_PAGER
|
||||||
|
LOG_DEBUG("power up XL9555 io");
|
||||||
|
io.digitalWrite(EXPANDS_DRV_EN, HIGH);
|
||||||
|
io.digitalWrite(EXPANDS_AMP_EN, HIGH);
|
||||||
|
io.digitalWrite(EXPANDS_KB_EN, HIGH);
|
||||||
|
io.digitalWrite(EXPANDS_SD_EN, HIGH);
|
||||||
|
io.digitalWrite(EXPANDS_GPIO_EN, HIGH);
|
||||||
|
#endif
|
||||||
|
|
||||||
esp_sleep_wakeup_cause_t cause = esp_sleep_get_wakeup_cause();
|
esp_sleep_wakeup_cause_t cause = esp_sleep_get_wakeup_cause();
|
||||||
notifyLightSleepEnd.notifyObservers(cause); // Button interrupts are reattached here
|
notifyLightSleepEnd.notifyObservers(cause); // Button interrupts are reattached here
|
||||||
|
@ -3,7 +3,10 @@ extends = portduino_base
|
|||||||
build_flags = ${portduino_base.build_flags} -I variants/native/portduino
|
build_flags = ${portduino_base.build_flags} -I variants/native/portduino
|
||||||
-I /usr/include
|
-I /usr/include
|
||||||
board = cross_platform
|
board = cross_platform
|
||||||
lib_deps = ${portduino_base.lib_deps}
|
lib_deps =
|
||||||
|
${portduino_base.lib_deps}
|
||||||
|
melopero/Melopero RV3028@^1.1.0
|
||||||
|
|
||||||
build_src_filter = ${portduino_base.build_src_filter}
|
build_src_filter = ${portduino_base.build_src_filter}
|
||||||
|
|
||||||
[env:native]
|
[env:native]
|
||||||
|
@ -5,3 +5,6 @@
|
|||||||
#define HAS_GPS 1
|
#define HAS_GPS 1
|
||||||
#define MAX_RX_TOPHONE settingsMap[maxtophone]
|
#define MAX_RX_TOPHONE settingsMap[maxtophone]
|
||||||
#define MAX_NUM_NODES settingsMap[maxnodes]
|
#define MAX_NUM_NODES settingsMap[maxnodes]
|
||||||
|
|
||||||
|
// RAK12002 RTC Module
|
||||||
|
#define RV3028_RTC (uint8_t)0b1010010
|
@ -208,7 +208,7 @@ No longer populated on PCB
|
|||||||
#undef AREF_VOLTAGE
|
#undef AREF_VOLTAGE
|
||||||
#define AREF_VOLTAGE 3.0
|
#define AREF_VOLTAGE 3.0
|
||||||
#define VBAT_AR_INTERNAL AR_INTERNAL_3_0
|
#define VBAT_AR_INTERNAL AR_INTERNAL_3_0
|
||||||
#define ADC_MULTIPLIER (4.90F)
|
#define ADC_MULTIPLIER (4.99F)
|
||||||
|
|
||||||
#define HAS_RTC 0
|
#define HAS_RTC 0
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
[VERSION]
|
[VERSION]
|
||||||
major = 2
|
major = 2
|
||||||
minor = 7
|
minor = 7
|
||||||
build = 7
|
build = 8
|
||||||
|
Loading…
Reference in New Issue
Block a user