From 3aee4bfc6bf2a67fe2c18664dcae2ee7d4fafb21 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 10 May 2025 19:01:03 +0800 Subject: [PATCH 01/13] Upgrade trunk (#6758) Co-authored-by: sachaw <11172820+sachaw@users.noreply.github.com> --- .trunk/trunk.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 364ed746b..ca38c978a 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -10,11 +10,11 @@ lint: enabled: - renovate@40.0.6 - prettier@3.5.3 - - trufflehog@3.88.27 + - trufflehog@3.88.28 - yamllint@1.37.1 - bandit@1.8.3 - terrascan@1.19.9 - - trivy@0.61.1 + - trivy@0.62.1 - taplo@0.9.3 - ruff@0.11.8 - isort@6.0.1 From c2a38357f174f301f344f960ed43a9d6f368b537 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 10 May 2025 14:54:58 +0200 Subject: [PATCH 02/13] chore(deps): update meshtastic/device-ui digest to 09b1780 (#6782) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 8ceca3d87..042853ec6 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # 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/09b1780c8f944cffbc18a8ec5713cdfe03278503.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 23fe093a6556a9be577fedfa63ec7411711283dc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 10 May 2025 11:49:01 -0400 Subject: [PATCH 03/13] chore(config): migrate renovate config (#6784) * chore(config): migrate config renovate.json * Prettier: Ignore renovate --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: vidplace7 --- .trunk/configs/.prettierignore | 1 + renovate.json | 44 ++++++++++++++++++++++++---------- 2 files changed, 33 insertions(+), 12 deletions(-) create mode 100644 .trunk/configs/.prettierignore diff --git a/.trunk/configs/.prettierignore b/.trunk/configs/.prettierignore new file mode 100644 index 000000000..a63a557a4 --- /dev/null +++ b/.trunk/configs/.prettierignore @@ -0,0 +1 @@ +renovate.json diff --git a/renovate.json b/renovate.json index 3403e7211..e90462cc3 100644 --- a/renovate.json +++ b/renovate.json @@ -9,15 +9,21 @@ "workarounds:all" ], "forkProcessing": "enabled", - "ignoreDeps": ["protobufs"], + "ignoreDeps": [ + "protobufs" + ], "git-submodules": { "enabled": true }, "pip_requirements": { - "fileMatch": ["bin/bump_metainfo/requirements.txt"] + "managerFilePatterns": [ + "/bin/bump_metainfo/requirements.txt/" + ] }, "commitMessageTopic": "{{depName}}", - "labels": ["dependencies"], + "labels": [ + "dependencies" + ], "customDatasources": { "pio": { "description": "PlatformIO Registry", @@ -32,8 +38,12 @@ { "customType": "regex", "description": "Match meshtastic/web version", - "fileMatch": ["bin/web.version"], - "matchStrings": ["(?.+)$"], + "managerFilePatterns": [ + "/bin/web.version/" + ], + "matchStrings": [ + "(?.+)$" + ], "datasourceTemplate": "github-releases", "depNameTemplate": "meshtastic/web", "versioningTemplate": "semver-coerced" @@ -41,7 +51,9 @@ { "customType": "regex", "description": "Match normal PIO dependencies", - "fileMatch": [".*\\.ini$"], + "managerFilePatterns": [ + "/.*\\.ini$/" + ], "matchStrings": [ "# renovate: datasource=(?.*?)(?: depName=(?.+?))? packageName=(?.+?)(?: versioning=(?[a-z-]+?))?\\s+?.+?@(?.+?)\\s" ], @@ -50,9 +62,11 @@ { "customType": "regex", "description": "Match PIO zipped dependencies with github tag ref", - "fileMatch": [".*\\.ini$"], + "managerFilePatterns": [ + "/.*\\.ini$/" + ], "matchStrings": [ - "# renovate: datasource=github-tags(?: depName=(?.+?))? packageName=(?.+?)(?: versioning=(?[a-z-]+?))?\\s+?https:\/\/.+?archive\/(?.+?).zip\\s" + "# renovate: datasource=github-tags(?: depName=(?.+?))? packageName=(?.+?)(?: versioning=(?[a-z-]+?))?\\s+?https://.+?archive/(?.+?).zip\\s" ], "datasourceTemplate": "github-tags", "versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver-coerced{{/if}}" @@ -60,9 +74,11 @@ { "customType": "regex", "description": "Match PIO zipped dependencies with git commit ref", - "fileMatch": [".*\\.ini$"], + "managerFilePatterns": [ + "/.*\\.ini$/" + ], "matchStrings": [ - "# renovate: datasource=git-refs(?: depName=(?.+?))? packageName=(?.+?)(?: versioning=(?[a-z-]+?))?\\sgitBranch=(?.+?)\\s+?https:\/\/.+?archive\/(?.+?).zip\\s" + "# renovate: datasource=git-refs(?: depName=(?.+?))? packageName=(?.+?)(?: versioning=(?[a-z-]+?))?\\sgitBranch=(?.+?)\\s+?https://.+?archive/(?.+?).zip\\s" ], "datasourceTemplate": "git-refs", "currentValueTemplate": "{{{gitBranch}}}", @@ -71,8 +87,12 @@ ], "packageRules": [ { - "matchDepNames": ["meshtastic/device-ui"], - "reviewers": ["mverch67"], + "matchDepNames": [ + "meshtastic/device-ui" + ], + "reviewers": [ + "mverch67" + ], "changelogUrl": "https://github.com/meshtastic/device-ui/compare/{{currentDigest}}...{{newDigest}}" } ] From 7c9296b0f43348204f8f1356e8a9fb8bec57b12c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 10 May 2025 18:48:39 +0200 Subject: [PATCH 04/13] chore(deps): update meshtastic/device-ui digest to 027f5a5 (#6783) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 042853ec6..427ff1702 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/09b1780c8f944cffbc18a8ec5713cdfe03278503.zip + https://github.com/meshtastic/device-ui/archive/027f5a5bace46e75a8208239b20655140dc186df.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From b17bb49a6333facf9dee585ac3dd914c13cfcf8f Mon Sep 17 00:00:00 2001 From: Austin Date: Sat, 10 May 2025 17:21:23 -0400 Subject: [PATCH 05/13] Actions: Fix end to end tests (#6776) --- .github/workflows/tests.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0f0ee0af4..28b6a40a5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,7 +5,10 @@ on: - cron: 0 0 * * * # Run every day at midnight workflow_dispatch: {} -permissions: read-all +permissions: + contents: read + actions: read + checks: write jobs: native-tests: @@ -44,7 +47,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 22 - name: Setup pnpm uses: pnpm/action-setup@v4 From b208e1924fb82c9ab9eb273a8679b0edfdc11821 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 11 May 2025 00:59:38 +0200 Subject: [PATCH 06/13] chore(deps): update meshtastic/device-ui digest to 7dee10a (#6786) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 427ff1702..b78ecdc1a 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/027f5a5bace46e75a8208239b20655140dc186df.zip + https://github.com/meshtastic/device-ui/archive/7dee10ad31a0c6ea04880cba399e240be743d752.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 62e1974d092453d481dfa2546bcb34180707a029 Mon Sep 17 00:00:00 2001 From: Tom <116762865+NomDeTom@users.noreply.github.com> Date: Sun, 11 May 2025 10:17:37 +0100 Subject: [PATCH 07/13] Add clarifying note about AHT20 also being included with AHT10 library (#6787) * Update AHT10.h Add clarifying note about AHT20 also being included * Update AHT10.cpp Add clarifying note about AHT20 also being included --- src/modules/Telemetry/Sensor/AHT10.cpp | 6 +++++- src/modules/Telemetry/Sensor/AHT10.h | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/modules/Telemetry/Sensor/AHT10.cpp b/src/modules/Telemetry/Sensor/AHT10.cpp index 096a131b9..35934533b 100644 --- a/src/modules/Telemetry/Sensor/AHT10.cpp +++ b/src/modules/Telemetry/Sensor/AHT10.cpp @@ -1,3 +1,7 @@ +/* + * Worth noting that both the AHT10 and AHT20 are supported without alteration. + */ + #include "configuration.h" #if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() @@ -41,4 +45,4 @@ bool AHT10Sensor::getMetrics(meshtastic_Telemetry *measurement) return true; } -#endif \ No newline at end of file +#endif diff --git a/src/modules/Telemetry/Sensor/AHT10.h b/src/modules/Telemetry/Sensor/AHT10.h index b2f0d8ae5..a6fa19952 100644 --- a/src/modules/Telemetry/Sensor/AHT10.h +++ b/src/modules/Telemetry/Sensor/AHT10.h @@ -1,3 +1,7 @@ +/* + * Worth noting that both the AHT10 and AHT20 are supported without alteration. + */ + #include "configuration.h" #if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() @@ -20,4 +24,4 @@ class AHT10Sensor : public TelemetrySensor virtual bool getMetrics(meshtastic_Telemetry *measurement) override; }; -#endif \ No newline at end of file +#endif From 2a06b058fdd7dca02667635ba9415030b675b9cc Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 11 May 2025 15:18:53 -0500 Subject: [PATCH 08/13] Only send nodes on want_config of 69421 (#6792) --- src/mesh/PhoneAPI.cpp | 28 +++++++++++++++++++++++----- src/mesh/PhoneAPI.h | 3 ++- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index 0e18b8ab1..db01e95f3 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -54,7 +54,13 @@ void PhoneAPI::handleStartConfig() } // 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; spiLock->lock(); 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 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; } @@ -388,8 +399,14 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) config_state++; // Advance when we have sent all of our ModuleConfig objects if (config_state > (_meshtastic_AdminMessage_ModuleConfigType_MAX + 1)) { - // Clients sending special nonce don't want to see other nodeinfos - state = config_nonce == SPECIAL_NONCE ? STATE_SEND_FILEMANIFEST : STATE_SEND_OTHER_NODEINFOS; + // Handle special nonce behaviors: + // - 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; } break; @@ -415,7 +432,8 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) case STATE_SEND_FILEMANIFEST: { LOG_DEBUG("FromRadio=STATE_SEND_FILEMANIFEST"); // 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; filesManifest.clear(); // Skip to complete packet diff --git a/src/mesh/PhoneAPI.h b/src/mesh/PhoneAPI.h index 681b244c8..0d7772d17 100644 --- a/src/mesh/PhoneAPI.h +++ b/src/mesh/PhoneAPI.h @@ -18,7 +18,8 @@ #error "meshtastic_ToRadio_size is too large for our BLE packets" #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 From b9fcd9da233ad5b7438f2b836b612eba15b149ef Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 11 May 2025 18:08:29 -0500 Subject: [PATCH 09/13] Add some no-nonsense coercion for self-reporting node values (#6793) * Add some no-nonsense coercion for self-reporting node values * Update src/mesh/PhoneAPI.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/mesh/PhoneAPI.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index db01e95f3..e2acd8463 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -565,9 +565,12 @@ bool PhoneAPI::available() auto nextNode = nodeDB->readNextMeshNode(readIndex); if (nextNode) { nodeInfoForPhone = TypeConversions::ConvertToNodeInfo(nextNode); - nodeInfoForPhone.hops_away = nodeInfoForPhone.num == nodeDB->getNodeNum() ? 0 : nodeInfoForPhone.hops_away; - nodeInfoForPhone.is_favorite = - nodeInfoForPhone.is_favorite || nodeInfoForPhone.num == nodeDB->getNodeNum(); // Our node is always a favorite + bool isUs = nodeInfoForPhone.num == nodeDB->getNodeNum(); + nodeInfoForPhone.hops_away = isUs ? 0 : nodeInfoForPhone.hops_away; + 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 From 98e0d32f3484fe4c34a5b86894871f554f900f24 Mon Sep 17 00:00:00 2001 From: rcarteraz Date: Wed, 7 May 2025 19:46:51 -0700 Subject: [PATCH 10/13] Update Seeed Solar Node --- variants/Seeed_Solar_Node/platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/Seeed_Solar_Node/platformio.ini b/variants/Seeed_Solar_Node/platformio.ini index 5ee0a5e8f..7a23882e4 100644 --- a/variants/Seeed_Solar_Node/platformio.ini +++ b/variants/Seeed_Solar_Node/platformio.ini @@ -1,5 +1,5 @@ [env:Seeed_Solar_Node] -board = Seeed_Solar_Node +board = seeed_solar_node extends = nrf52840_base ;board_level = extra build_flags = ${nrf52840_base.build_flags} From e1417cff2e8796b3c8c7af5988b7955ae59d9054 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 13 May 2025 06:59:26 -0500 Subject: [PATCH 11/13] [create-pull-request] automated change (#6804) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/admin.pb.cpp | 3 +++ src/mesh/generated/meshtastic/admin.pb.h | 28 ++++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/protobufs b/protobufs index 078ac8dfb..816595c8b 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 078ac8dfbe5f7533d7755cbe2ca3d08d86e5af34 +Subproject commit 816595c8bbdfc3b4388e11348ccd043294d58705 diff --git a/src/mesh/generated/meshtastic/admin.pb.cpp b/src/mesh/generated/meshtastic/admin.pb.cpp index 2e527f669..9bf40870f 100644 --- a/src/mesh/generated/meshtastic/admin.pb.cpp +++ b/src/mesh/generated/meshtastic/admin.pb.cpp @@ -15,6 +15,9 @@ PB_BIND(meshtastic_HamParameters, meshtastic_HamParameters, AUTO) PB_BIND(meshtastic_NodeRemoteHardwarePinsResponse, meshtastic_NodeRemoteHardwarePinsResponse, 2) +PB_BIND(meshtastic_SharedContact, meshtastic_SharedContact, AUTO) + + diff --git a/src/mesh/generated/meshtastic/admin.pb.h b/src/mesh/generated/meshtastic/admin.pb.h index efe60f493..09499b075 100644 --- a/src/mesh/generated/meshtastic/admin.pb.h +++ b/src/mesh/generated/meshtastic/admin.pb.h @@ -99,6 +99,14 @@ typedef struct _meshtastic_NodeRemoteHardwarePinsResponse { meshtastic_NodeRemoteHardwarePin node_remote_hardware_pins[16]; } meshtastic_NodeRemoteHardwarePinsResponse; +typedef struct _meshtastic_SharedContact { + /* The node number of the contact */ + uint32_t node_num; + /* The User of the contact */ + bool has_user; + meshtastic_User user; +} meshtastic_SharedContact; + typedef PB_BYTES_ARRAY_T(8) meshtastic_AdminMessage_session_passkey_t; /* This message is handled by the Admin module and is responsible for all settings/channel read/write operations. This message is used to do settings operations to both remote AND local nodes. @@ -202,6 +210,8 @@ typedef struct _meshtastic_AdminMessage { bool begin_edit_settings; /* Commits an open transaction for any edits made to config, module config, owner, and channel settings */ bool commit_edit_settings; + /* Add a contact (User) to the nodedb */ + meshtastic_SharedContact add_contact; /* Tell the node to factory reset config everything; all device state and configuration will be returned to factory defaults and BLE bonds will be cleared. */ int32_t factory_reset_device; /* Tell the node to reboot into the OTA Firmware in this many seconds (or <0 to cancel reboot) @@ -252,13 +262,16 @@ extern "C" { + /* Initializer values for message structs */ #define meshtastic_AdminMessage_init_default {0, {0}, {0, {0}}} #define meshtastic_HamParameters_init_default {"", 0, 0, ""} #define meshtastic_NodeRemoteHardwarePinsResponse_init_default {0, {meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default}} +#define meshtastic_SharedContact_init_default {0, false, meshtastic_User_init_default} #define meshtastic_AdminMessage_init_zero {0, {0}, {0, {0}}} #define meshtastic_HamParameters_init_zero {"", 0, 0, ""} #define meshtastic_NodeRemoteHardwarePinsResponse_init_zero {0, {meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero}} +#define meshtastic_SharedContact_init_zero {0, false, meshtastic_User_init_zero} /* Field tags (for use in manual encoding/decoding) */ #define meshtastic_HamParameters_call_sign_tag 1 @@ -266,6 +279,8 @@ extern "C" { #define meshtastic_HamParameters_frequency_tag 3 #define meshtastic_HamParameters_short_name_tag 4 #define meshtastic_NodeRemoteHardwarePinsResponse_node_remote_hardware_pins_tag 1 +#define meshtastic_SharedContact_node_num_tag 1 +#define meshtastic_SharedContact_user_tag 2 #define meshtastic_AdminMessage_get_channel_request_tag 1 #define meshtastic_AdminMessage_get_channel_response_tag 2 #define meshtastic_AdminMessage_get_owner_request_tag 3 @@ -310,6 +325,7 @@ extern "C" { #define meshtastic_AdminMessage_remove_ignored_node_tag 48 #define meshtastic_AdminMessage_begin_edit_settings_tag 64 #define meshtastic_AdminMessage_commit_edit_settings_tag 65 +#define meshtastic_AdminMessage_add_contact_tag 66 #define meshtastic_AdminMessage_factory_reset_device_tag 94 #define meshtastic_AdminMessage_reboot_ota_seconds_tag 95 #define meshtastic_AdminMessage_exit_simulator_tag 96 @@ -365,6 +381,7 @@ X(a, STATIC, ONEOF, UINT32, (payload_variant,set_ignored_node,set_ignored X(a, STATIC, ONEOF, UINT32, (payload_variant,remove_ignored_node,remove_ignored_node), 48) \ X(a, STATIC, ONEOF, BOOL, (payload_variant,begin_edit_settings,begin_edit_settings), 64) \ X(a, STATIC, ONEOF, BOOL, (payload_variant,commit_edit_settings,commit_edit_settings), 65) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,add_contact,add_contact), 66) \ X(a, STATIC, ONEOF, INT32, (payload_variant,factory_reset_device,factory_reset_device), 94) \ X(a, STATIC, ONEOF, INT32, (payload_variant,reboot_ota_seconds,reboot_ota_seconds), 95) \ X(a, STATIC, ONEOF, BOOL, (payload_variant,exit_simulator,exit_simulator), 96) \ @@ -390,6 +407,7 @@ X(a, STATIC, SINGULAR, BYTES, session_passkey, 101) #define meshtastic_AdminMessage_payload_variant_set_fixed_position_MSGTYPE meshtastic_Position #define meshtastic_AdminMessage_payload_variant_get_ui_config_response_MSGTYPE meshtastic_DeviceUIConfig #define meshtastic_AdminMessage_payload_variant_store_ui_config_MSGTYPE meshtastic_DeviceUIConfig +#define meshtastic_AdminMessage_payload_variant_add_contact_MSGTYPE meshtastic_SharedContact #define meshtastic_HamParameters_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, STRING, call_sign, 1) \ @@ -405,20 +423,30 @@ X(a, STATIC, REPEATED, MESSAGE, node_remote_hardware_pins, 1) #define meshtastic_NodeRemoteHardwarePinsResponse_DEFAULT NULL #define meshtastic_NodeRemoteHardwarePinsResponse_node_remote_hardware_pins_MSGTYPE meshtastic_NodeRemoteHardwarePin +#define meshtastic_SharedContact_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT32, node_num, 1) \ +X(a, STATIC, OPTIONAL, MESSAGE, user, 2) +#define meshtastic_SharedContact_CALLBACK NULL +#define meshtastic_SharedContact_DEFAULT NULL +#define meshtastic_SharedContact_user_MSGTYPE meshtastic_User + extern const pb_msgdesc_t meshtastic_AdminMessage_msg; extern const pb_msgdesc_t meshtastic_HamParameters_msg; extern const pb_msgdesc_t meshtastic_NodeRemoteHardwarePinsResponse_msg; +extern const pb_msgdesc_t meshtastic_SharedContact_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ #define meshtastic_AdminMessage_fields &meshtastic_AdminMessage_msg #define meshtastic_HamParameters_fields &meshtastic_HamParameters_msg #define meshtastic_NodeRemoteHardwarePinsResponse_fields &meshtastic_NodeRemoteHardwarePinsResponse_msg +#define meshtastic_SharedContact_fields &meshtastic_SharedContact_msg /* Maximum encoded size of messages (where known) */ #define MESHTASTIC_MESHTASTIC_ADMIN_PB_H_MAX_SIZE meshtastic_AdminMessage_size #define meshtastic_AdminMessage_size 511 #define meshtastic_HamParameters_size 31 #define meshtastic_NodeRemoteHardwarePinsResponse_size 496 +#define meshtastic_SharedContact_size 121 #ifdef __cplusplus } /* extern "C" */ From cc66f7c79ba976dc780cd2082258c6c5c4126fbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Tue, 13 May 2025 14:15:52 +0200 Subject: [PATCH 12/13] Crowpanel 4.3, 5.0, 7.0 support (#6611) * SD software SPI control * fix notification crash; * allow wake on touch * don't build non-MUI variants * use pwm buzzer * Finalize support for Crowpanel TFT 2.4, 2.8 and 3.5 * add hardware ID for TFT panels * Add stubs for the bigger panels. WIP! * fix braces * elecrow 4.3, 5.0, 7.0 support * completed implementation 4.3, 5.0, 7.0 variants * NodeDB default config & simplified light sleep macros * trunk fmt * remove flags * removed leftovers (note: rtc gpios are only needed for deep sleep; the remove section caused issues with the elecrows) --------- Co-authored-by: mverch67 Co-authored-by: Manuel <71137295+mverch67@users.noreply.github.com> Co-authored-by: Austin --- boards/crowpanel.json | 4 +- src/graphics/ScreenFonts.h | 4 +- src/mesh/NodeDB.cpp | 4 +- src/sleep.cpp | 35 ++++--- variants/elecrow_panel/pins_arduino.h | 14 +-- variants/elecrow_panel/platformio.ini | 73 ++++++------- variants/elecrow_panel/variant.h | 141 ++++---------------------- variants/mesh-tab/variant.h | 3 +- variants/rak_wismeshtap/variant.h | 3 + variants/t-deck/variant.h | 1 + variants/t-watch-s3/variant.h | 2 + variants/unphone/variant.h | 3 + 12 files changed, 98 insertions(+), 189 deletions(-) diff --git a/boards/crowpanel.json b/boards/crowpanel.json index 570961ed7..75b097ef7 100644 --- a/boards/crowpanel.json +++ b/boards/crowpanel.json @@ -8,8 +8,8 @@ "core": "esp32", "extra_flags": [ "-DBOARD_HAS_PSRAM", - "-DARDUINO_USB_CDC_ON_BOOT=1", - "-DARDUINO_USB_MODE=0", + "-DARDUINO_USB_CDC_ON_BOOT=0", + "-DARDUINO_USB_MODE=1", "-DARDUINO_RUNNING_CORE=1", "-DARDUINO_EVENT_RUNNING_CORE=0" ], diff --git a/src/graphics/ScreenFonts.h b/src/graphics/ScreenFonts.h index 0be0dc814..3373a47a7 100644 --- a/src/graphics/ScreenFonts.h +++ b/src/graphics/ScreenFonts.h @@ -65,8 +65,8 @@ #endif #if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \ - defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS)) || \ - defined(ILI9488_CS) && !defined(DISPLAY_FORCE_SMALL_FONTS) + defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS) || defined(ILI9488_CS)) && \ + !defined(DISPLAY_FORCE_SMALL_FONTS) // The screen is bigger so use bigger fonts #define FONT_SMALL FONT_MEDIUM_LOCAL // Height: 19 #define FONT_MEDIUM FONT_LARGE_LOCAL // Height: 28 diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 67f0da600..b64cb0fe1 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -584,7 +584,7 @@ void NodeDB::installDefaultConfig(bool preserveKey = false) strncpy(config.network.ntp_server, "meshtastic.pool.ntp.org", 32); #if (defined(T_DECK) || defined(T_WATCH_S3) || defined(UNPHONE) || defined(PICOMPUTER_S3) || defined(SENSECAP_INDICATOR) || \ - defined(ELECROW)) && \ + defined(ELECROW_PANEL)) && \ HAS_TFT // switch BT off by default; use TFT programming mode or hotkey to enable config.bluetooth.enabled = false; @@ -689,7 +689,7 @@ void NodeDB::initConfigIntervals() config.display.screen_on_secs = default_screen_on_secs; -#if defined(T_WATCH_S3) || defined(T_DECK) || defined(UNPHONE) || defined(MESH_TAB) || defined(RAK14014) || defined(ELECROW) +#if defined(USE_POWERSAVE) config.power.is_power_saving = true; config.display.screen_on_secs = 30; config.power.wait_bluetooth_secs = 30; diff --git a/src/sleep.cpp b/src/sleep.cpp index 2985db0c2..8ffb08b04 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -24,6 +24,7 @@ #include "mesh/wifi/WiFiAPClient.h" #endif #include "rom/rtc.h" +#include #include #include @@ -284,6 +285,8 @@ void doDeepSleep(uint32_t msecToWake, bool skipPreflight = false, bool skipSaveN pinMode(LORA_CS, OUTPUT); digitalWrite(LORA_CS, HIGH); gpio_hold_en((gpio_num_t)LORA_CS); +#elif defined(ELECROW_PANEL) + // Elecrow panels do not use LORA_CS, do nothing #else if (GPIO_IS_VALID_OUTPUT_GPIO(LORA_CS)) { // LoRa CS (RADIO_NSS) needs to stay HIGH, even during deep sleep @@ -400,7 +403,7 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r #ifdef INPUTDRIVER_ENCODER_BTN gpio_wakeup_enable((gpio_num_t)INPUTDRIVER_ENCODER_BTN, GPIO_INTR_LOW_LEVEL); #endif -#if defined(T_WATCH_S3) || defined(ELECROW) +#if defined(WAKE_ON_TOUCH) gpio_wakeup_enable((gpio_num_t)SCREEN_TOUCH_INT, GPIO_INTR_LOW_LEVEL); #endif enableLoraInterrupt(); @@ -433,11 +436,12 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r // Disable wake-on-button interrupt. Re-attach normal button-interrupts gpio_wakeup_disable(pin); #endif - -#if defined(T_WATCH_S3) || defined(ELECROW) +#if defined(INPUTDRIVER_ENCODER_BTN) + gpio_wakeup_disable((gpio_num_t)INPUTDRIVER_ENCODER_BTN); +#endif +#if defined(WAKE_ON_TOUCH) gpio_wakeup_disable((gpio_num_t)SCREEN_TOUCH_INT); #endif - #if !defined(SOC_PM_SUPPORT_EXT_WAKEUP) && defined(LORA_DIO1) && (LORA_DIO1 != RADIOLIB_NC) if (radioType != RF95_RADIO) { gpio_wakeup_disable((gpio_num_t)LORA_DIO1); @@ -506,23 +510,24 @@ bool shouldLoraWake(uint32_t msecToWake) void enableLoraInterrupt() { + esp_err_t res; #if SOC_PM_SUPPORT_EXT_WAKEUP && defined(LORA_DIO1) && (LORA_DIO1 != RADIOLIB_NC) - gpio_pulldown_en((gpio_num_t)LORA_DIO1); + res = gpio_pulldown_en((gpio_num_t)LORA_DIO1); + if (res != ESP_OK) { + LOG_ERROR("gpio_pulldown_en(LORA_DIO1) result %d", res); + } #if defined(LORA_RESET) && (LORA_RESET != RADIOLIB_NC) - gpio_pullup_en((gpio_num_t)LORA_RESET); + res = gpio_pullup_en((gpio_num_t)LORA_RESET); + if (res != ESP_OK) { + LOG_ERROR("gpio_pullup_en(LORA_RESET) result %d", res); + } #endif -#if defined(LORA_CS) && (LORA_CS != RADIOLIB_NC) +#if defined(LORA_CS) && (LORA_CS != RADIOLIB_NC) && !defined(ELECROW_PANEL) gpio_pullup_en((gpio_num_t)LORA_CS); #endif - if (rtc_gpio_is_valid_gpio((gpio_num_t)LORA_DIO1)) { - // Setup light/deep sleep with wakeup by external source - LOG_INFO("setup LORA_DIO1 (GPIO%02d) with wakeup by external source", LORA_DIO1); - esp_sleep_enable_ext0_wakeup((gpio_num_t)LORA_DIO1, HIGH); - } else { - LOG_INFO("setup LORA_DIO1 (GPIO%02d) with wakeup by gpio interrupt", LORA_DIO1); - gpio_wakeup_enable((gpio_num_t)LORA_DIO1, GPIO_INTR_HIGH_LEVEL); - } + LOG_INFO("setup LORA_DIO1 (GPIO%02d) with wakeup by gpio interrupt", LORA_DIO1); + gpio_wakeup_enable((gpio_num_t)LORA_DIO1, GPIO_INTR_HIGH_LEVEL); #elif defined(LORA_DIO1) && (LORA_DIO1 != RADIOLIB_NC) if (radioType != RF95_RADIO) { diff --git a/variants/elecrow_panel/pins_arduino.h b/variants/elecrow_panel/pins_arduino.h index b98530378..81c9e0a2c 100644 --- a/variants/elecrow_panel/pins_arduino.h +++ b/variants/elecrow_panel/pins_arduino.h @@ -3,13 +3,11 @@ #include -// static const uint8_t LED_BUILTIN = -1; +static const uint8_t TX = 43; +static const uint8_t RX = 44; -// static const uint8_t TX = 43; -// static const uint8_t RX = 44; - -static const uint8_t SDA = 39; -static const uint8_t SCL = 40; +static const uint8_t SDA = 15; +static const uint8_t SCL = 16; // Default SPI will be mapped to Radio static const uint8_t SS = -1; @@ -17,13 +15,9 @@ static const uint8_t MOSI = 48; static const uint8_t MISO = 47; static const uint8_t SCK = 41; -#ifndef CROW_SELECT static const uint8_t SPI_MOSI = 6; static const uint8_t SPI_SCK = 5; static const uint8_t SPI_MISO = 4; -static const uint8_t SPI_CS = 7; // SD does not support -1 -static const uint8_t SDCARD_CS = SPI_CS; -#endif static const uint8_t A0 = 1; static const uint8_t A1 = 2; diff --git a/variants/elecrow_panel/platformio.ini b/variants/elecrow_panel/platformio.ini index 66dc35c3b..963174560 100644 --- a/variants/elecrow_panel/platformio.ini +++ b/variants/elecrow_panel/platformio.ini @@ -4,10 +4,8 @@ board = crowpanel board_check = true upload_protocol = esptool board_build.partitions = default_16MB.csv ; must be here for some reason, board.json is not enough !? - build_flags = ${esp32s3_base.build_flags} -Os -I variants/elecrow_panel - -D ELECROW -D ELECROW_PANEL -D CONFIG_ARDUHAL_LOG_COLORS -D RADIOLIB_DEBUG_SPI=0 @@ -22,15 +20,15 @@ build_flags = ${esp32s3_base.build_flags} -Os -D MESHTASTIC_EXCLUDE_SOCKETAPI=1 -D MESHTASTIC_EXCLUDE_SCREEN=1 -D MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1 -; -D INPUTDRIVER_BUTTON_TYPE=0 -D HAS_TELEMETRY=0 -D CONFIG_DISABLE_HAL_LOCKS=1 + -D USE_PIN_BUZZER -D HAS_SCREEN=0 -D HAS_TFT=1 -D RAM_SIZE=6144 - -D LV_LVGL_H_INCLUDE_SIMPLE - -D LV_CONF_INCLUDE_SIMPLE - -D LV_COMP_CONF_INCLUDE_SIMPLE + -D LV_LVGL_H_INCLUDE_SIMPLE + -D LV_CONF_INCLUDE_SIMPLE + -D LV_COMP_CONF_INCLUDE_SIMPLE -D LV_USE_SYSMON=0 -D LV_USE_PROFILER=0 -D LV_USE_PERF_MONITOR=0 @@ -40,29 +38,44 @@ build_flags = ${esp32s3_base.build_flags} -Os -D USE_LOG_DEBUG -D LOG_DEBUG_INC=\"DebugConfiguration.h\" -D USE_PACKET_API + -D HAS_SDCARD + -D SD_SPI_FREQUENCY=75000000 lib_deps = ${esp32s3_base.lib_deps} ${device-ui_base.lib_deps} - earlephilhower/ESP8266Audio@^1.9.9 - earlephilhower/ESP8266SAM@^1.0.1 - lovyan03/LovyanGFX@^1.2.0 - hideakitai/TCA9534@^0.1.1 + earlephilhower/ESP8266Audio@1.9.9 + earlephilhower/ESP8266SAM@1.0.1 + lovyan03/LovyanGFX@1.2.0 ; note: v1.2.7 breaks the elecrow 7" display functionality + hideakitai/TCA9534@0.1.1 -[env:elecrow-24-28-tft] +[crowpanel_small] ; 2.4, 2.8, 3.5 inch extends = crowpanel_base - build_flags = ${crowpanel_base.build_flags} - -D TFT_HEIGHT=320 ; needed in variant.h - -D HAS_SDCARD + -D CROW_SELECT=1 -D SDCARD_USE_SOFT_SPI + -D SDCARD_CS=7 -D SPI_DRIVER_SELECT=2 - -D USE_PIN_BUZZER -; -D INPUTDRIVER_BUTTON_TYPE=0 ; no button as this pin is assigned to LoRa cs! - -D SCREEN_TOUCH_INT=47 ; used to wake up the MCU by touch -D LGFX_DRIVER_TEMPLATE -D LGFX_DRIVER=LGFX_GENERIC -D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_GENERIC.h\" + -D VIEW_320x240 + -D MAP_FULL_REDRAW + +[crowpanel_large] ; 4.3, 5.0, 7.0 inch +extends = crowpanel_base +build_flags = + ${crowpanel_base.build_flags} + -D CROW_SELECT=2 + -D SDCARD_CS=7 + -D LGFX_DRIVER=LGFX_ELECROW70 + -D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_ELECROW70.h\" + -D DISPLAY_SET_RESOLUTION + +[env:elecrow-adv-24-28-tft] +extends = crowpanel_small +build_flags = + ${crowpanel_small.build_flags} -D SPI_FREQUENCY=80000000 -D LGFX_SCREEN_WIDTH=240 -D LGFX_SCREEN_HEIGHT=320 @@ -81,25 +94,12 @@ build_flags = -D LGFX_TOUCH_INT=47 -D LGFX_TOUCH_RST=48 -D LGFX_TOUCH_ROTATION=0 - -D VIEW_320x240 - -D MAP_FULL_REDRAW - -[env:elecrow-35-tft] -extends = crowpanel_base +[env:elecrow-adv-35-tft] +extends = crowpanel_small build_flags = - ${crowpanel_base.build_flags} - -D TFT_HEIGHT=480 ; needed in variant.h - -D HAS_SDCARD - -D SDCARD_USE_SOFT_SPI - -D SPI_DRIVER_SELECT=2 - -D USE_PIN_BUZZER -; -D INPUTDRIVER_BUTTON_TYPE=0 ; no button as this pin is assigned to LoRa cs! - -D SCREEN_TOUCH_INT=47 ; used to wake up the MCU by touch + ${crowpanel_small.build_flags} -D LV_CACHE_DEF_SIZE=2097152 - -D LGFX_DRIVER_TEMPLATE - -D LGFX_DRIVER=LGFX_GENERIC - -D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_GENERIC.h\" -D SPI_FREQUENCY=60000000 -D LGFX_SCREEN_WIDTH=320 -D LGFX_SCREEN_HEIGHT=480 @@ -119,5 +119,10 @@ build_flags = -D LGFX_TOUCH_RST=48 -D LGFX_TOUCH_ROTATION=0 -D DISPLAY_SET_RESOLUTION + +; 4.3, 5.0, 7.0 inch 800x480 IPS (V1) +[env:elecrow-adv1-43-50-70-tft] +extends = crowpanel_large +build_flags = + ${crowpanel_large.build_flags} -D VIEW_320x240 - -D MAP_FULL_REDRAW diff --git a/variants/elecrow_panel/variant.h b/variants/elecrow_panel/variant.h index b1035ed31..99069b723 100644 --- a/variants/elecrow_panel/variant.h +++ b/variants/elecrow_panel/variant.h @@ -1,124 +1,14 @@ #define I2C_SDA 15 #define I2C_SCL 16 -#if TFT_HEIGHT == 320 && not defined(HAS_TFT) // 2.4 and 2.8 TFT -// ST7789 TFT LCD -#define ST7789_CS 40 -#define ST7789_RS 41 // DC -#define ST7789_SDA 39 // MOSI -#define ST7789_SCK 42 -#define ST7789_RESET -1 -#define ST7789_MISO 38 -#define ST7789_BUSY -1 -#define ST7789_BL 38 -#define ST7789_SPI_HOST SPI2_HOST -#define TFT_BL 38 -#define SPI_FREQUENCY 60000000 -#define SPI_READ_FREQUENCY 16000000 -#define TFT_OFFSET_ROTATION 0 -#define SCREEN_ROTATE -#define TFT_DUMMY_READ_PIXELS 8 -#define SCREEN_TRANSITION_FRAMERATE 5 -#define BRIGHTNESS_DEFAULT 130 // Medium Low Brightness - -#define HAS_TOUCHSCREEN 1 +#if CROW_SELECT == 1 +#define WAKE_ON_TOUCH #define SCREEN_TOUCH_INT 47 -#define SCREEN_TOUCH_RST 48 -#define TOUCH_I2C_PORT 0 -#define TOUCH_SLAVE_ADDRESS 0x38 // FT5x06 +#define USE_POWERSAVE +#define SLEEP_TIME 180 #endif -#if TFT_HEIGHT == 480 && not defined(HAS_TFT) // 3.5 TFT -// ILI9488 TFT LCD -#define ILI9488_CS 40 -#define ILI9488_RS 41 // DC -#define ILI9488_SDA 39 // MOSI -#define ILI9488_SCK 42 -#define ILI9488_RESET -1 -#define ILI9488_MISO 38 -#define ILI9488_BUSY -1 -#define ILI9488_BL 38 -#define ILI9488_SPI_HOST SPI2_HOST -#define TFT_BL 38 -#define SPI_FREQUENCY 40000000 -#define SPI_READ_FREQUENCY 16000000 -#define TFT_OFFSET_ROTATION 0 -#define SCREEN_ROTATE -#define TFT_DUMMY_READ_PIXELS 8 -#define SCREEN_TRANSITION_FRAMERATE 5 -#define BRIGHTNESS_DEFAULT 130 // Medium Low Brightness - -#define HAS_TOUCHSCREEN 1 -#define SCREEN_TOUCH_INT 47 -#define SCREEN_TOUCH_RST 48 -#define TOUCH_I2C_PORT 0 -#define TOUCH_SLAVE_ADDRESS 0x5D // GT911 -#endif - -#ifdef CROW_SELECT -#define ST72xx_DE 42 -#define ST72xx_VSYNC 41 -#define ST72xx_HSYNC 40 -#define ST72xx_PCLK 39 -#define ST72xx_R0 7 -#define ST72xx_R1 17 -#define ST72xx_R2 18 -#define ST72xx_R3 3 -#define ST72xx_R4 46 -#define ST72xx_G0 9 -#define ST72xx_G1 10 -#define ST72xx_G2 11 -#define ST72xx_G3 12 -#define ST72xx_G4 13 -#define ST72xx_G5 14 -#define ST72xx_B0 21 -#define ST72xx_B1 47 -#define ST72xx_B2 48 -#define ST72xx_B3 45 -#define ST72xx_B4 38 - -#define HAS_TOUCHSCREEN 1 -#define TOUCH_I2C_PORT 0 -#define TOUCH_SLAVE_ADDRESS 0x5D // GT911 -#endif - -#if defined(CROW_SELECT) && CROW_SELECT == 1 // 4.3 TFT 800x480 -#define ST7265_HSYNC_POLARITY 0 -#define ST7265_HSYNC_FRONT_PORCH 24 -#define ST7265_HSYNC_PULSE_WIDTH 8 -#define ST7265_HSYNC_BACK_PORCH 24 -#define ST7265_VSYNC_POLARITY 1 -#define ST7265_VSYNC_FRONT_PORCH 24 -#define ST7265_VSYNC_PULSE_WIDTH 8 -#define ST7265_VSYNC_BACK_PORCH 24 -#define ST7265_PCLK_ACTIVE_NEG 1 -#endif - -#if defined(CROW_SELECT) && CROW_SELECT == 2 // 5.0 TFT 800x480 -#define ST7262_HSYNC_POLARITY 0 -#define ST7262_HSYNC_FRONT_PORCH 8 -#define ST7262_HSYNC_PULSE_WIDTH 4 -#define ST7262_HSYNC_BACK_PORCH 8 -#define ST7262_VSYNC_POLARITY 0 -#define ST7262_VSYNC_FRONT_PORCH 8 -#define ST7262_VSYNC_PULSE_WIDTH 4 -#define ST7262_VSYNC_BACK_PORCH 8 -#define ST7262_PCLK_ACTIVE_NEG 0 -#endif - -#if defined(CROW_SELECT) && CROW_SELECT == 3 // 7.0 TFT 800x480 -#define SC7277_HSYNC_POLARITY 0 -#define SC7277_HSYNC_FRONT_PORCH 8 -#define SC7277_HSYNC_PULSE_WIDTH 4 -#define SC7277_HSYNC_BACK_PORCH 8 -#define SC7277_VSYNC_POLARITY 0 -#define SC7277_VSYNC_FRONT_PORCH 8 -#define SC7277_VSYNC_PULSE_WIDTH 4 -#define SC7277_VSYNC_BACK_PORCH 8 -#define SC7277_PCLK_ACTIVE_NEG 0 -#endif - -#if TFT_HEIGHT == 320 // 2.4-2.8 have I2S audio +#if CROW_SELECT == 1 // dac / amp // #define HAS_I2S // didn't get I2S sound working #define PIN_BUZZER 8 // using pwm buzzer instead (nobody will notice, lol) @@ -131,10 +21,16 @@ #endif // GPS via UART1 connector -#define HAS_GPS 1 #define GPS_DEFAULT_NOT_PRESENT 1 +#define HAS_GPS 1 +#if CROW_SELECT == 1 #define GPS_RX_PIN 18 #define GPS_TX_PIN 17 +#else +// GPIOs shared with LoRa or MIC module +#define GPS_RX_PIN 19 +#define GPS_TX_PIN 20 +#endif // Extension Slot Layout, viewed from above (2.4-3.5) // DIO1/IO1 o o IO2/NRESET @@ -158,9 +54,11 @@ // LoRa #define USE_SX1262 -#define LORA_CS 0 // GND -#if TFT_HEIGHT == 320 || TFT_HEIGHT == 480 // 2.4 - 3.5 TFT +#if CROW_SELECT == 1 +// 2.4", 2.8, 3.5""" +#define HW_SPI1_DEVICE +#define LORA_CS 0 #define LORA_SCK 10 #define LORA_MISO 9 #define LORA_MOSI 3 @@ -173,6 +71,8 @@ #define SENSOR_POWER_CTRL_PIN 45 #define SENSOR_POWER_ON LOW #else +// 4.3", 5.0", 7.0" +#define LORA_CS 0 #define LORA_SCK 5 #define LORA_MISO 4 #define LORA_MOSI 6 @@ -182,14 +82,9 @@ #define LORA_DIO2 2 // SX1262 BUSY #endif -#define HW_SPI1_DEVICE #define SX126X_CS LORA_CS #define SX126X_DIO1 LORA_DIO1 #define SX126X_BUSY LORA_DIO2 #define SX126X_RESET LORA_RESET #define SX126X_DIO2_AS_RF_SWITCH - #define SX126X_DIO3_TCXO_VOLTAGE 3.3 - -#define USE_VIRTUAL_KEYBOARD 1 -#define DISPLAY_CLOCK_FRAME 1 \ No newline at end of file diff --git a/variants/mesh-tab/variant.h b/variants/mesh-tab/variant.h index 533c931bc..63ef17d85 100644 --- a/variants/mesh-tab/variant.h +++ b/variants/mesh-tab/variant.h @@ -3,7 +3,8 @@ #define HAS_TOUCHSCREEN 1 -#define SLEEP_TIME 120 +#define USE_POWERSAVE +#define SLEEP_TIME 180 // Analog pins #define BATTERY_PIN 4 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage diff --git a/variants/rak_wismeshtap/variant.h b/variants/rak_wismeshtap/variant.h index c21a11ac1..1980dc4a1 100644 --- a/variants/rak_wismeshtap/variant.h +++ b/variants/rak_wismeshtap/variant.h @@ -305,6 +305,9 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG #define HAS_TOUCHSCREEN 1 #define SCREEN_TOUCH_INT WB_IO6 +#define USE_POWERSAVE +#define SLEEP_TIME 120 + #define CANNED_MESSAGE_MODULE_ENABLE 1 #define USE_VIRTUAL_KEYBOARD 1 /*---------------------------------------------------------------------------- diff --git a/variants/t-deck/variant.h b/variants/t-deck/variant.h index 5b2c13a91..a21c786b3 100644 --- a/variants/t-deck/variant.h +++ b/variants/t-deck/variant.h @@ -31,6 +31,7 @@ #define TOUCH_I2C_PORT 0 #define TOUCH_SLAVE_ADDRESS 0x5D // GT911 +#define USE_POWERSAVE #define SLEEP_TIME 120 #ifndef HAS_TFT diff --git a/variants/t-watch-s3/variant.h b/variants/t-watch-s3/variant.h index 5a6aebfa2..578c23c0a 100644 --- a/variants/t-watch-s3/variant.h +++ b/variants/t-watch-s3/variant.h @@ -24,7 +24,9 @@ #define SCREEN_TOUCH_USE_I2C1 #define TOUCH_I2C_PORT 1 #define TOUCH_SLAVE_ADDRESS 0x38 +#define WAKE_ON_TOUCH +#define USE_POWERSAVE #define SLEEP_TIME 180 #define I2C_SDA1 39 // Used for capacitive touch diff --git a/variants/unphone/variant.h b/variants/unphone/variant.h index 7b39a5aa5..eaf142721 100644 --- a/variants/unphone/variant.h +++ b/variants/unphone/variant.h @@ -41,6 +41,9 @@ #define USE_XPT2046 1 #define TOUCH_CS 38 +#define USE_POWERSAVE +#define SLEEP_TIME 180 + #define HAS_GPS \ 0 // the unphone doesn't have a gps module by default (though // GPS featherwing -- https://www.adafruit.com/product/3133 From a7415791a56cca7816c52ee7cda74e532dcccd11 Mon Sep 17 00:00:00 2001 From: Chris Vogel Date: Tue, 13 May 2025 15:10:57 +0200 Subject: [PATCH 13/13] device-install.sh: detect t-eth-elite as s3 device (#6767) device-install.sh: detect t-eth-elite as s3 device fixes https://github.com/meshtastic/firmware/issues/6754#issuecomment-2857468902 Thanks @mverch67! --- bin/device-install.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bin/device-install.sh b/bin/device-install.sh index a43ccbdb4..7fa5ffdbb 100755 --- a/bin/device-install.sh +++ b/bin/device-install.sh @@ -43,6 +43,16 @@ S3_VARIANTS=( "wireless-tracker" "station-g2" "unphone" + "t-eth-elite" + "mesh-tab" + "dreamcatcher" + "ESP32-S3-Pico" + "seeed-sensecap-indicator" + "heltec_capsule_sensor_v3" + "vision-master" + "icarus" + "tracksenger" + "elecrow-adv" ) # Determine the correct esptool command to use