Merge branch 'master' into arduino-esp32-v3.2

This commit is contained in:
Manuel 2025-07-01 00:56:56 +02:00 committed by GitHub
commit dda4b90e34
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 72 additions and 60 deletions

View File

@ -87,7 +87,7 @@
</screenshots> </screenshots>
<releases> <releases>
<release version="2.7.1" date="2025-06-21"> <release version="2.7.1" date="2025-06-27">
<url type="details">https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.1</url> <url type="details">https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.1</url>
</release> </release>
<release version="2.7.0" date="2025-06-20"> <release version="2.7.0" date="2025-06-20">

2
debian/changelog vendored
View File

@ -25,4 +25,4 @@ meshtasticd (2.7.1.0) UNRELEASED; urgency=medium
[ ] [ ]
* GitHub Actions Automatic version bump * GitHub Actions Automatic version bump
-- <github-actions[bot]@users.noreply.github.com> Sat, 21 Jun 2025 15:51:49 +0000 -- <github-actions[bot]@users.noreply.github.com> Fri, 27 Jun 2025 20:12:21 +0000

View File

@ -110,7 +110,7 @@ lib_deps =
[device-ui_base] [device-ui_base]
lib_deps = lib_deps =
# renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master
https://github.com/meshtastic/device-ui/archive/cdc6e5bdeedb8293d10e4a02be6ca64e95a7c515.zip https://github.com/meshtastic/device-ui/archive/4b7bf369adfa5a7bd419fa8293d21206576d52d0.zip
; Common libs for environmental measurements in telemetry module ; Common libs for environmental measurements in telemetry module
[environmental_base] [environmental_base]

View File

@ -682,7 +682,7 @@ bool Power::setup()
void Power::shutdown() void Power::shutdown()
{ {
LOG_INFO("Shutting down"); LOG_INFO("Shutting Down");
#if defined(ARCH_NRF52) || defined(ARCH_ESP32) || defined(ARCH_RP2040) #if defined(ARCH_NRF52) || defined(ARCH_ESP32) || defined(ARCH_RP2040)
#ifdef PIN_LED1 #ifdef PIN_LED1

View File

@ -58,14 +58,14 @@ bool ButtonThread::initButton(const ButtonConfig &config)
userButton.attachLongPressStart( userButton.attachLongPressStart(
[](void *callerThread) -> void { [](void *callerThread) -> void {
ButtonThread *thread = (ButtonThread *)callerThread; ButtonThread *thread = (ButtonThread *)callerThread;
if (millis() > 30000) // hold off 30s after boot // if (millis() > 30000) // hold off 30s after boot
thread->btnEvent = BUTTON_EVENT_LONG_PRESSED; thread->btnEvent = BUTTON_EVENT_LONG_PRESSED;
}, },
this); this);
userButton.attachLongPressStop( userButton.attachLongPressStop(
[](void *callerThread) -> void { [](void *callerThread) -> void {
ButtonThread *thread = (ButtonThread *)callerThread; ButtonThread *thread = (ButtonThread *)callerThread;
if (millis() > 30000) // hold off 30s after boot // if (millis() > 30000) // hold off 30s after boot
thread->btnEvent = BUTTON_EVENT_LONG_RELEASED; thread->btnEvent = BUTTON_EVENT_LONG_RELEASED;
}, },
this); this);
@ -254,7 +254,8 @@ int32_t ButtonThread::runOnce()
case BUTTON_EVENT_LONG_RELEASED: { case BUTTON_EVENT_LONG_RELEASED: {
LOG_INFO("LONG PRESS RELEASE"); LOG_INFO("LONG PRESS RELEASE");
if (_longLongPress != INPUT_BROKER_NONE && (millis() - buttonPressStartTime) >= _longLongPressTime) { if (millis() > 30000 && _longLongPress != INPUT_BROKER_NONE &&
(millis() - buttonPressStartTime) >= _longLongPressTime) {
evt.inputEvent = _longLongPress; evt.inputEvent = _longLongPress;
this->notifyObservers(&evt); this->notifyObservers(&evt);
} }

View File

@ -235,7 +235,7 @@ void ExpressLRSFiveWay::shutdown()
{ {
LOG_INFO("Shutdown from long press"); LOG_INFO("Shutdown from long press");
powerFSM.trigger(EVENT_PRESS); powerFSM.trigger(EVENT_PRESS);
screen->startAlert("Shutting down..."); screen->startAlert("Shutting Down...");
// Don't set alerting = true. We don't want to auto-dismiss this alert. // Don't set alerting = true. We don't want to auto-dismiss this alert.
playShutdownMelody(); // In case user adds a buzzer playShutdownMelody(); // In case user adds a buzzer

View File

@ -1156,7 +1156,7 @@ void NodeDB::loadFromDisk()
LOG_WARN("Node count %d exceeds MAX_NUM_NODES %d, truncating", numMeshNodes, MAX_NUM_NODES); LOG_WARN("Node count %d exceeds MAX_NUM_NODES %d, truncating", numMeshNodes, MAX_NUM_NODES);
numMeshNodes = MAX_NUM_NODES; numMeshNodes = MAX_NUM_NODES;
} }
meshNodes->resize(MAX_NUM_NODES); meshNodes->resize(MAX_NUM_NODES + 1); // The rp2040, rp2035, and maybe other targets, have a problem doing a sort() when full
// static DeviceState scratch; We no longer read into a tempbuf because this structure is 15KB of valuable RAM // static DeviceState scratch; We no longer read into a tempbuf because this structure is 15KB of valuable RAM
state = loadProto(deviceStateFileName, meshtastic_DeviceState_size, sizeof(meshtastic_DeviceState), state = loadProto(deviceStateFileName, meshtastic_DeviceState_size, sizeof(meshtastic_DeviceState),
@ -1694,7 +1694,10 @@ void NodeDB::sortMeshDB()
{ {
if (!Throttle::isWithinTimespanMs(lastSort, 1000 * 5)) { if (!Throttle::isWithinTimespanMs(lastSort, 1000 * 5)) {
lastSort = millis(); lastSort = millis();
std::sort(meshNodes->begin(), meshNodes->end(), [](const meshtastic_NodeInfoLite &a, const meshtastic_NodeInfoLite &b) { std::sort(meshNodes->begin(), meshNodes->begin() + numMeshNodes,
[](const meshtastic_NodeInfoLite &a, const meshtastic_NodeInfoLite &b) {
if (a.num == myNodeInfo.my_node_num && b.num == myNodeInfo.my_node_num) // in theory impossible
return false;
if (a.num == myNodeInfo.my_node_num) { if (a.num == myNodeInfo.my_node_num) {
return true; return true;
} }
@ -1705,10 +1708,6 @@ void NodeDB::sortMeshDB()
bool bFav = b.is_favorite; bool bFav = b.is_favorite;
if (aFav != bFav) if (aFav != bFav)
return aFav; return aFav;
if (a.last_heard == 0 || a.last_heard == UINT32_MAX)
return false;
if (b.last_heard == 0 || b.last_heard == UINT32_MAX)
return true;
return a.last_heard > b.last_heard; return a.last_heard > b.last_heard;
}); });
} }

View File

@ -44,7 +44,10 @@ class UdpMulticastHandler final
meshtastic_MeshPacket mp; meshtastic_MeshPacket mp;
LOG_DEBUG("Decoding MeshPacket from UDP len=%u", packetLength); LOG_DEBUG("Decoding MeshPacket from UDP len=%u", packetLength);
bool isPacketDecoded = pb_decode_from_bytes(packet.data(), packetLength, &meshtastic_MeshPacket_msg, &mp); bool isPacketDecoded = pb_decode_from_bytes(packet.data(), packetLength, &meshtastic_MeshPacket_msg, &mp);
if (isPacketDecoded && router) { if (isPacketDecoded && router && mp.which_payload_variant == meshtastic_MeshPacket_encrypted_tag) {
mp.pki_encrypted = false;
mp.public_key.size = 0;
memset(mp.public_key.bytes, 0, sizeof(mp.public_key.bytes));
UniquePacketPoolPacket p = packetPool.allocUniqueCopy(mp); UniquePacketPoolPacket p = packetPool.allocUniqueCopy(mp);
// Unset received SNR/RSSI // Unset received SNR/RSSI
p->rx_snr = 0; p->rx_snr = 0;

View File

@ -107,8 +107,8 @@ int SystemCommandsModule::handleInputEvent(const InputEvent *event)
return true; return true;
// Power control // Power control
case INPUT_BROKER_SHUTDOWN: case INPUT_BROKER_SHUTDOWN:
LOG_ERROR("Shutting down"); LOG_ERROR("Shutting Down");
IF_SCREEN(screen->showOverlayBanner("Shutting down...")); IF_SCREEN(screen->showOverlayBanner("Shutting Down..."));
nodeDB->saveToDisk(); nodeDB->saveToDisk();
shutdownAtMsec = millis() + DEFAULT_SHUTDOWN_SECONDS * 1000; shutdownAtMsec = millis() + DEFAULT_SHUTDOWN_SECONDS * 1000;
// runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; // runState = CANNED_MESSAGE_RUN_STATE_INACTIVE;

View File

@ -314,7 +314,9 @@ void NRF52Bluetooth::onConnectionSecured(uint16_t conn_handle)
} }
bool NRF52Bluetooth::onPairingPasskey(uint16_t conn_handle, uint8_t const passkey[6], bool match_request) bool NRF52Bluetooth::onPairingPasskey(uint16_t conn_handle, uint8_t const passkey[6], bool match_request)
{ {
LOG_INFO("BLE pair process started with passkey %.3s %.3s", passkey, passkey + 3); char passkey1[4] = {passkey[0], passkey[1], passkey[2], '\0'};
char passkey2[4] = {passkey[3], passkey[4], passkey[5], '\0'};
LOG_INFO("BLE pair process started with passkey %s %s", passkey1, passkey2);
powerFSM.trigger(EVENT_BLUETOOTH_PAIR); powerFSM.trigger(EVENT_BLUETOOTH_PAIR);
// Get passkey as string // Get passkey as string
@ -327,6 +329,7 @@ bool NRF52Bluetooth::onPairingPasskey(uint16_t conn_handle, uint8_t const passke
bluetoothStatus->updateStatus(new meshtastic::BluetoothStatus(textkey)); bluetoothStatus->updateStatus(new meshtastic::BluetoothStatus(textkey));
#if !defined(MESHTASTIC_EXCLUDE_SCREEN) // Todo: migrate this display code back into Screen class, and observe bluetoothStatus #if !defined(MESHTASTIC_EXCLUDE_SCREEN) // Todo: migrate this display code back into Screen class, and observe bluetoothStatus
if (screen) {
screen->startAlert([](OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -> void { screen->startAlert([](OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) -> void {
char btPIN[16] = "888888"; char btPIN[16] = "888888";
snprintf(btPIN, sizeof(btPIN), "%06u", configuredPasskey); snprintf(btPIN, sizeof(btPIN), "%06u", configuredPasskey);
@ -352,6 +355,7 @@ bool NRF52Bluetooth::onPairingPasskey(uint16_t conn_handle, uint8_t const passke
y_offset = display->height() == 64 ? y_offset + FONT_HEIGHT_LARGE - 6 : y_offset + FONT_HEIGHT_LARGE + 5; y_offset = display->height() == 64 ? y_offset + FONT_HEIGHT_LARGE - 6 : y_offset + FONT_HEIGHT_LARGE + 5;
display->drawString(x_offset + x, y_offset + y, deviceName); display->drawString(x_offset + x, y_offset + y, deviceName);
}); });
}
#endif #endif
if (match_request) { if (match_request) {
uint32_t start_time = millis(); uint32_t start_time = millis();
@ -394,8 +398,7 @@ void NRF52Bluetooth::onPairingCompleted(uint16_t conn_handle, uint8_t auth_statu
{ {
if (auth_status == BLE_GAP_SEC_STATUS_SUCCESS) { if (auth_status == BLE_GAP_SEC_STATUS_SUCCESS) {
LOG_INFO("BLE pair success"); LOG_INFO("BLE pair success");
bluetoothStatus->updateStatus( bluetoothStatus->updateStatus(new meshtastic::BluetoothStatus(meshtastic::BluetoothStatus::ConnectionState::CONNECTED));
new meshtastic::BluetoothStatus(meshtastic::BluetoothStatus::ConnectionState::DISCONNECTED));
} else { } else {
LOG_INFO("BLE pair failed"); LOG_INFO("BLE pair failed");
// Notify UI (or any other interested firmware components) // Notify UI (or any other interested firmware components)
@ -404,8 +407,10 @@ void NRF52Bluetooth::onPairingCompleted(uint16_t conn_handle, uint8_t auth_statu
} }
// Todo: migrate this display code back into Screen class, and observe bluetoothStatus // Todo: migrate this display code back into Screen class, and observe bluetoothStatus
if (screen) {
screen->endAlert(); screen->endAlert();
} }
}
void NRF52Bluetooth::sendLog(const uint8_t *logMessage, size_t length) void NRF52Bluetooth::sendLog(const uint8_t *logMessage, size_t length)
{ {

View File

@ -179,7 +179,11 @@ static const uint8_t SCK = PIN_SPI_SCK;
#define I2C_NO_RESCAN // I2C is a bit finicky, don't scan too much #define I2C_NO_RESCAN // I2C is a bit finicky, don't scan too much
#define WIRE_INTERFACES_COUNT 1 #define WIRE_INTERFACES_COUNT 1
#if !defined(XIAO_BLE_LEGACY_PINOUT) && !defined(GPS_L76K) #if defined(XIAO_BLE_LEGACY_PINOUT)
// Used for I2C by DIY xiao_ble variant
#define PIN_WIRE_SDA D4
#define PIN_WIRE_SCL D5
#elif !defined(GPS_L76K)
// If D6 and D7 are free, I2C is probably the most versatile assignment // If D6 and D7 are free, I2C is probably the most versatile assignment
#define PIN_WIRE_SDA D6 #define PIN_WIRE_SDA D6
#define PIN_WIRE_SCL D7 #define PIN_WIRE_SCL D7