Merge branch 'meshtastic:master' into T-beam-display-no-touch

This commit is contained in:
Nasimovy 2025-05-13 08:44:18 +02:00 committed by GitHub
commit 95160c436e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 82 additions and 28 deletions

View File

@ -5,7 +5,10 @@ on:
- cron: 0 0 * * * # Run every day at midnight - cron: 0 0 * * * # Run every day at midnight
workflow_dispatch: {} workflow_dispatch: {}
permissions: read-all permissions:
contents: read
actions: read
checks: write
jobs: jobs:
native-tests: native-tests:
@ -44,7 +47,7 @@ jobs:
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: 18 node-version: 22
- name: Setup pnpm - name: Setup pnpm
uses: pnpm/action-setup@v4 uses: pnpm/action-setup@v4

View File

@ -0,0 +1 @@
renovate.json

View File

@ -10,11 +10,11 @@ lint:
enabled: enabled:
- renovate@40.0.6 - renovate@40.0.6
- prettier@3.5.3 - prettier@3.5.3
- trufflehog@3.88.27 - trufflehog@3.88.28
- yamllint@1.37.1 - yamllint@1.37.1
- bandit@1.8.3 - bandit@1.8.3
- terrascan@1.19.9 - terrascan@1.19.9
- trivy@0.61.1 - trivy@0.62.1
- taplo@0.9.3 - taplo@0.9.3
- ruff@0.11.8 - ruff@0.11.8
- isort@6.0.1 - isort@6.0.1

View File

@ -108,7 +108,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/35576e131e250f259878ea81819a90df837d1307.zip https://github.com/meshtastic/device-ui/archive/7dee10ad31a0c6ea04880cba399e240be743d752.zip
; Common libs for environmental measurements in telemetry module ; Common libs for environmental measurements in telemetry module
[environmental_base] [environmental_base]

View File

@ -9,15 +9,21 @@
"workarounds:all" "workarounds:all"
], ],
"forkProcessing": "enabled", "forkProcessing": "enabled",
"ignoreDeps": ["protobufs"], "ignoreDeps": [
"protobufs"
],
"git-submodules": { "git-submodules": {
"enabled": true "enabled": true
}, },
"pip_requirements": { "pip_requirements": {
"fileMatch": ["bin/bump_metainfo/requirements.txt"] "managerFilePatterns": [
"/bin/bump_metainfo/requirements.txt/"
]
}, },
"commitMessageTopic": "{{depName}}", "commitMessageTopic": "{{depName}}",
"labels": ["dependencies"], "labels": [
"dependencies"
],
"customDatasources": { "customDatasources": {
"pio": { "pio": {
"description": "PlatformIO Registry", "description": "PlatformIO Registry",
@ -32,8 +38,12 @@
{ {
"customType": "regex", "customType": "regex",
"description": "Match meshtastic/web version", "description": "Match meshtastic/web version",
"fileMatch": ["bin/web.version"], "managerFilePatterns": [
"matchStrings": ["(?<currentValue>.+)$"], "/bin/web.version/"
],
"matchStrings": [
"(?<currentValue>.+)$"
],
"datasourceTemplate": "github-releases", "datasourceTemplate": "github-releases",
"depNameTemplate": "meshtastic/web", "depNameTemplate": "meshtastic/web",
"versioningTemplate": "semver-coerced" "versioningTemplate": "semver-coerced"
@ -41,7 +51,9 @@
{ {
"customType": "regex", "customType": "regex",
"description": "Match normal PIO dependencies", "description": "Match normal PIO dependencies",
"fileMatch": [".*\\.ini$"], "managerFilePatterns": [
"/.*\\.ini$/"
],
"matchStrings": [ "matchStrings": [
"# renovate: datasource=(?<datasource>.*?)(?: depName=(?<depName>.+?))? packageName=(?<packageName>.+?)(?: versioning=(?<versioning>[a-z-]+?))?\\s+?.+?@(?<currentValue>.+?)\\s" "# renovate: datasource=(?<datasource>.*?)(?: depName=(?<depName>.+?))? packageName=(?<packageName>.+?)(?: versioning=(?<versioning>[a-z-]+?))?\\s+?.+?@(?<currentValue>.+?)\\s"
], ],
@ -50,9 +62,11 @@
{ {
"customType": "regex", "customType": "regex",
"description": "Match PIO zipped dependencies with github tag ref", "description": "Match PIO zipped dependencies with github tag ref",
"fileMatch": [".*\\.ini$"], "managerFilePatterns": [
"/.*\\.ini$/"
],
"matchStrings": [ "matchStrings": [
"# renovate: datasource=github-tags(?: depName=(?<depName>.+?))? packageName=(?<packageName>.+?)(?: versioning=(?<versioning>[a-z-]+?))?\\s+?https:\/\/.+?archive\/(?<currentValue>.+?).zip\\s" "# renovate: datasource=github-tags(?: depName=(?<depName>.+?))? packageName=(?<packageName>.+?)(?: versioning=(?<versioning>[a-z-]+?))?\\s+?https://.+?archive/(?<currentValue>.+?).zip\\s"
], ],
"datasourceTemplate": "github-tags", "datasourceTemplate": "github-tags",
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver-coerced{{/if}}" "versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver-coerced{{/if}}"
@ -60,9 +74,11 @@
{ {
"customType": "regex", "customType": "regex",
"description": "Match PIO zipped dependencies with git commit ref", "description": "Match PIO zipped dependencies with git commit ref",
"fileMatch": [".*\\.ini$"], "managerFilePatterns": [
"/.*\\.ini$/"
],
"matchStrings": [ "matchStrings": [
"# renovate: datasource=git-refs(?: depName=(?<depName>.+?))? packageName=(?<packageName>.+?)(?: versioning=(?<versioning>[a-z-]+?))?\\sgitBranch=(?<gitBranch>.+?)\\s+?https:\/\/.+?archive\/(?<currentDigest>.+?).zip\\s" "# renovate: datasource=git-refs(?: depName=(?<depName>.+?))? packageName=(?<packageName>.+?)(?: versioning=(?<versioning>[a-z-]+?))?\\sgitBranch=(?<gitBranch>.+?)\\s+?https://.+?archive/(?<currentDigest>.+?).zip\\s"
], ],
"datasourceTemplate": "git-refs", "datasourceTemplate": "git-refs",
"currentValueTemplate": "{{{gitBranch}}}", "currentValueTemplate": "{{{gitBranch}}}",
@ -71,8 +87,12 @@
], ],
"packageRules": [ "packageRules": [
{ {
"matchDepNames": ["meshtastic/device-ui"], "matchDepNames": [
"reviewers": ["mverch67"], "meshtastic/device-ui"
],
"reviewers": [
"mverch67"
],
"changelogUrl": "https://github.com/meshtastic/device-ui/compare/{{currentDigest}}...{{newDigest}}" "changelogUrl": "https://github.com/meshtastic/device-ui/compare/{{currentDigest}}...{{newDigest}}"
} }
] ]

View File

@ -54,7 +54,13 @@ void PhoneAPI::handleStartConfig()
} }
// even if we were already connected - restart our state machine // even if we were already connected - restart our state machine
state = STATE_SEND_MY_INFO; if (config_nonce == SPECIAL_NONCE_ONLY_NODES) {
// If client only wants node info, jump directly to sending nodes
state = STATE_SEND_OWN_NODEINFO;
LOG_INFO("Client only wants node info, skipping other config");
} else {
state = STATE_SEND_MY_INFO;
}
pauseBluetoothLogging = true; pauseBluetoothLogging = true;
spiLock->lock(); spiLock->lock();
filesManifest = getFiles("/", 10); filesManifest = getFiles("/", 10);
@ -224,7 +230,12 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
// Should allow us to resume sending NodeInfo in STATE_SEND_OTHER_NODEINFOS // Should allow us to resume sending NodeInfo in STATE_SEND_OTHER_NODEINFOS
nodeInfoForPhone.num = 0; nodeInfoForPhone.num = 0;
} }
state = STATE_SEND_METADATA; if (config_nonce == SPECIAL_NONCE_ONLY_NODES) {
// If client only wants node info, jump directly to sending nodes
state = STATE_SEND_OTHER_NODEINFOS;
} else {
state = STATE_SEND_METADATA;
}
break; break;
} }
@ -388,8 +399,14 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
config_state++; config_state++;
// Advance when we have sent all of our ModuleConfig objects // Advance when we have sent all of our ModuleConfig objects
if (config_state > (_meshtastic_AdminMessage_ModuleConfigType_MAX + 1)) { if (config_state > (_meshtastic_AdminMessage_ModuleConfigType_MAX + 1)) {
// Clients sending special nonce don't want to see other nodeinfos // Handle special nonce behaviors:
state = config_nonce == SPECIAL_NONCE ? STATE_SEND_FILEMANIFEST : STATE_SEND_OTHER_NODEINFOS; // - SPECIAL_NONCE_ONLY_CONFIG: Skip node info, go directly to file manifest
// - SPECIAL_NONCE_ONLY_NODES: After sending nodes, skip to complete
if (config_nonce == SPECIAL_NONCE_ONLY_CONFIG) {
state = STATE_SEND_FILEMANIFEST;
} else {
state = STATE_SEND_OTHER_NODEINFOS;
}
config_state = 0; config_state = 0;
} }
break; break;
@ -415,7 +432,8 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
case STATE_SEND_FILEMANIFEST: { case STATE_SEND_FILEMANIFEST: {
LOG_DEBUG("FromRadio=STATE_SEND_FILEMANIFEST"); LOG_DEBUG("FromRadio=STATE_SEND_FILEMANIFEST");
// last element // last element
if (config_state == filesManifest.size()) { // also handles an empty filesManifest if (config_state == filesManifest.size() ||
config_nonce == SPECIAL_NONCE_ONLY_NODES) { // also handles an empty filesManifest
config_state = 0; config_state = 0;
filesManifest.clear(); filesManifest.clear();
// Skip to complete packet // Skip to complete packet
@ -547,9 +565,12 @@ bool PhoneAPI::available()
auto nextNode = nodeDB->readNextMeshNode(readIndex); auto nextNode = nodeDB->readNextMeshNode(readIndex);
if (nextNode) { if (nextNode) {
nodeInfoForPhone = TypeConversions::ConvertToNodeInfo(nextNode); nodeInfoForPhone = TypeConversions::ConvertToNodeInfo(nextNode);
nodeInfoForPhone.hops_away = nodeInfoForPhone.num == nodeDB->getNodeNum() ? 0 : nodeInfoForPhone.hops_away; bool isUs = nodeInfoForPhone.num == nodeDB->getNodeNum();
nodeInfoForPhone.is_favorite = nodeInfoForPhone.hops_away = isUs ? 0 : nodeInfoForPhone.hops_away;
nodeInfoForPhone.is_favorite || nodeInfoForPhone.num == nodeDB->getNodeNum(); // Our node is always a favorite nodeInfoForPhone.last_heard = isUs ? getValidTime(RTCQualityFromNet) : nodeInfoForPhone.last_heard;
nodeInfoForPhone.snr = isUs ? 0 : nodeInfoForPhone.snr;
nodeInfoForPhone.via_mqtt = isUs ? false : nodeInfoForPhone.via_mqtt;
nodeInfoForPhone.is_favorite = nodeInfoForPhone.is_favorite || isUs; // Our node is always a favorite
} }
} }
return true; // Always say we have something, because we might need to advance our state machine return true; // Always say we have something, because we might need to advance our state machine

View File

@ -18,7 +18,8 @@
#error "meshtastic_ToRadio_size is too large for our BLE packets" #error "meshtastic_ToRadio_size is too large for our BLE packets"
#endif #endif
#define SPECIAL_NONCE 69420 #define SPECIAL_NONCE_ONLY_CONFIG 69420
#define SPECIAL_NONCE_ONLY_NODES 69421 // ( ͡° ͜ʖ ͡°)
/** /**
* Provides our protobuf based API which phone/PC clients can use to talk to our device * Provides our protobuf based API which phone/PC clients can use to talk to our device

View File

@ -1,3 +1,7 @@
/*
* Worth noting that both the AHT10 and AHT20 are supported without alteration.
*/
#include "configuration.h" #include "configuration.h"
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include(<Adafruit_AHTX0.h>) #if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include(<Adafruit_AHTX0.h>)
@ -41,4 +45,4 @@ bool AHT10Sensor::getMetrics(meshtastic_Telemetry *measurement)
return true; return true;
} }
#endif #endif

View File

@ -1,3 +1,7 @@
/*
* Worth noting that both the AHT10 and AHT20 are supported without alteration.
*/
#include "configuration.h" #include "configuration.h"
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include(<Adafruit_AHTX0.h>) #if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include(<Adafruit_AHTX0.h>)
@ -20,4 +24,4 @@ class AHT10Sensor : public TelemetrySensor
virtual bool getMetrics(meshtastic_Telemetry *measurement) override; virtual bool getMetrics(meshtastic_Telemetry *measurement) override;
}; };
#endif #endif