From 16d265023626a3820deb5fa6835065c89f7eb8db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sun, 13 Jul 2025 19:16:14 +0200 Subject: [PATCH 001/180] add pioenv to version string in debug log (#7328) --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 773145951..395291766 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -286,7 +286,7 @@ void lateInitVariant() {} */ void printInfo() { - LOG_INFO("S:B:%d,%s", HW_VENDOR, optstr(APP_VERSION)); + LOG_INFO("S:B:%d,%s,%s", HW_VENDOR, optstr(APP_VERSION), optstr(APP_ENV)); } #ifndef PIO_UNIT_TESTING void setup() From 45e428eb25acbd297dd570a32c57eca5f07c65d7 Mon Sep 17 00:00:00 2001 From: Austin Date: Sun, 13 Jul 2025 16:22:42 -0400 Subject: [PATCH 002/180] PPA: Add Ubuntu Questing (25.10) to daily builds (#7329) --- .github/workflows/daily_packaging.yml | 6 +++++- .github/workflows/release_channels.yml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/daily_packaging.yml b/.github/workflows/daily_packaging.yml index 63d24687b..eb61554f2 100644 --- a/.github/workflows/daily_packaging.yml +++ b/.github/workflows/daily_packaging.yml @@ -30,7 +30,11 @@ jobs: strategy: fail-fast: false matrix: - series: [plucky, noble, jammy] + series: + - jammy # 22.04 + - noble # 24.04 + - plucky # 25.04 + - questing # 25.10 uses: ./.github/workflows/package_ppa.yml with: ppa_repo: ppa:meshtastic/daily diff --git a/.github/workflows/release_channels.yml b/.github/workflows/release_channels.yml index ed2de1717..ef03be9dc 100644 --- a/.github/workflows/release_channels.yml +++ b/.github/workflows/release_channels.yml @@ -20,7 +20,11 @@ jobs: strategy: fail-fast: false matrix: - series: [plucky, noble, jammy] + series: + - jammy # 22.04 + - noble # 24.04 + - plucky # 25.04 + # - questing # 25.10 uses: ./.github/workflows/package_ppa.yml with: ppa_repo: |- From f3ff80963afd5cafa840849c70023817de330863 Mon Sep 17 00:00:00 2001 From: Austin Date: Sun, 13 Jul 2025 20:48:17 -0400 Subject: [PATCH 003/180] Actions: Move all Linux packaging into subdir (#7332) --- .github/workflows/daily_packaging.yml | 18 +++++++++--------- .../copr.yml} | 0 .../debian_src.yml} | 0 .../{ => linux_packaging}/docker_build.yml | 1 + .../{ => linux_packaging}/docker_manifest.yml | 12 ++++++------ .../obs.yml} | 2 +- .../ppa.yml} | 2 +- .github/workflows/main_matrix.yml | 14 +++++++------- .github/workflows/release_channels.yml | 8 ++++---- .../{nightly.yml => trunk_nightly.yml} | 2 +- bin/build-firmware.sh | 4 ++-- 11 files changed, 32 insertions(+), 31 deletions(-) rename .github/workflows/{hook_copr.yml => linux_packaging/copr.yml} (100%) rename .github/workflows/{build_debian_src.yml => linux_packaging/debian_src.yml} (100%) rename .github/workflows/{ => linux_packaging}/docker_build.yml (98%) rename .github/workflows/{ => linux_packaging}/docker_manifest.yml (93%) rename .github/workflows/{package_obs.yml => linux_packaging/obs.yml} (98%) rename .github/workflows/{package_ppa.yml => linux_packaging/ppa.yml} (96%) rename .github/workflows/{nightly.yml => trunk_nightly.yml} (97%) diff --git a/.github/workflows/daily_packaging.yml b/.github/workflows/daily_packaging.yml index eb61554f2..b9b52c5e8 100644 --- a/.github/workflows/daily_packaging.yml +++ b/.github/workflows/daily_packaging.yml @@ -9,11 +9,11 @@ on: paths: - debian/** - "*.rpkg" - - .github/workflows/nightly_packaging.yml - - .github/workflows/build_debian_src.yml - - .github/workflows/package_ppa.yml - - .github/workflows/package_obs.yml - - .github/workflows/hook_copr.yml + - .github/workflows/daily_packaging.yml + - .github/workflows/linux_packaging/debian_src.yml + - .github/workflows/linux_packaging/ppa.yml + - .github/workflows/linux_packaging/obs.yml + - .github/workflows/linux_packaging/copr.yml permissions: contents: write @@ -21,7 +21,7 @@ permissions: jobs: docker-multiarch: - uses: ./.github/workflows/docker_manifest.yml + uses: ./.github/workflows/linux_packaging/docker_manifest.yml with: release_channel: daily secrets: inherit @@ -35,21 +35,21 @@ jobs: - noble # 24.04 - plucky # 25.04 - questing # 25.10 - uses: ./.github/workflows/package_ppa.yml + uses: ./.github/workflows/linux_packaging/ppa.yml with: ppa_repo: ppa:meshtastic/daily series: ${{ matrix.series }} secrets: inherit package-obs: - uses: ./.github/workflows/package_obs.yml + uses: ./.github/workflows/linux_packaging/obs.yml with: obs_project: network:Meshtastic:daily series: unstable secrets: inherit hook-copr: - uses: ./.github/workflows/hook_copr.yml + uses: ./.github/workflows/linux_packaging/copr.yml with: copr_project: daily secrets: inherit diff --git a/.github/workflows/hook_copr.yml b/.github/workflows/linux_packaging/copr.yml similarity index 100% rename from .github/workflows/hook_copr.yml rename to .github/workflows/linux_packaging/copr.yml diff --git a/.github/workflows/build_debian_src.yml b/.github/workflows/linux_packaging/debian_src.yml similarity index 100% rename from .github/workflows/build_debian_src.yml rename to .github/workflows/linux_packaging/debian_src.yml diff --git a/.github/workflows/docker_build.yml b/.github/workflows/linux_packaging/docker_build.yml similarity index 98% rename from .github/workflows/docker_build.yml rename to .github/workflows/linux_packaging/docker_build.yml index cde7fd274..a6173eac5 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/linux_packaging/docker_build.yml @@ -42,6 +42,7 @@ permissions: jobs: docker-build: + name: docker-${{ inputs.distro }} outputs: digest: ${{ steps.docker_variant.outputs.digest }} runs-on: ${{ inputs.runs-on }} diff --git a/.github/workflows/docker_manifest.yml b/.github/workflows/linux_packaging/docker_manifest.yml similarity index 93% rename from .github/workflows/docker_manifest.yml rename to .github/workflows/linux_packaging/docker_manifest.yml index d1d1a5634..6585212a4 100644 --- a/.github/workflows/docker_manifest.yml +++ b/.github/workflows/linux_packaging/docker_manifest.yml @@ -17,7 +17,7 @@ permissions: jobs: docker-debian-amd64: - uses: ./.github/workflows/docker_build.yml + uses: ./.github/workflows/linux_packaging/docker_build.yml with: distro: debian platform: linux/amd64 @@ -26,7 +26,7 @@ jobs: secrets: inherit docker-debian-arm64: - uses: ./.github/workflows/docker_build.yml + uses: ./.github/workflows/linux_packaging/docker_build.yml with: distro: debian platform: linux/arm64 @@ -35,7 +35,7 @@ jobs: secrets: inherit docker-debian-armv7: - uses: ./.github/workflows/docker_build.yml + uses: ./.github/workflows/linux_packaging/docker_build.yml with: distro: debian platform: linux/arm/v7 @@ -44,7 +44,7 @@ jobs: secrets: inherit docker-alpine-amd64: - uses: ./.github/workflows/docker_build.yml + uses: ./.github/workflows/linux_packaging/docker_build.yml with: distro: alpine platform: linux/amd64 @@ -53,7 +53,7 @@ jobs: secrets: inherit docker-alpine-arm64: - uses: ./.github/workflows/docker_build.yml + uses: ./.github/workflows/linux_packaging/docker_build.yml with: distro: alpine platform: linux/arm64 @@ -62,7 +62,7 @@ jobs: secrets: inherit docker-alpine-armv7: - uses: ./.github/workflows/docker_build.yml + uses: ./.github/workflows/linux_packaging/docker_build.yml with: distro: alpine platform: linux/arm/v7 diff --git a/.github/workflows/package_obs.yml b/.github/workflows/linux_packaging/obs.yml similarity index 98% rename from .github/workflows/package_obs.yml rename to .github/workflows/linux_packaging/obs.yml index 275ffce0e..5156dee2e 100644 --- a/.github/workflows/package_obs.yml +++ b/.github/workflows/linux_packaging/obs.yml @@ -23,7 +23,7 @@ permissions: jobs: build-debian-src: - uses: ./.github/workflows/build_debian_src.yml + uses: ./.github/workflows/linux_packaging/debian_src.yml secrets: inherit with: series: ${{ inputs.series }} diff --git a/.github/workflows/package_ppa.yml b/.github/workflows/linux_packaging/ppa.yml similarity index 96% rename from .github/workflows/package_ppa.yml rename to .github/workflows/linux_packaging/ppa.yml index a54b0bd36..ef089eefb 100644 --- a/.github/workflows/package_ppa.yml +++ b/.github/workflows/linux_packaging/ppa.yml @@ -21,7 +21,7 @@ permissions: jobs: build-debian-src: - uses: ./.github/workflows/build_debian_src.yml + uses: ./.github/workflows/linux_packaging/debian_src.yml secrets: inherit with: series: ${{ inputs.series }} diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index a676efa1e..3aafced62 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -136,7 +136,7 @@ jobs: build-debian-src: if: github.repository == 'meshtastic/firmware' - uses: ./.github/workflows/build_debian_src.yml + uses: ./.github/workflows/linux_packaging/debian_src.yml with: series: UNRELEASED build_location: local @@ -154,7 +154,7 @@ jobs: uses: ./.github/workflows/test_native.yml docker-deb-amd64: - uses: ./.github/workflows/docker_build.yml + uses: ./.github/workflows/linux_packaging/docker_build.yml with: distro: debian platform: linux/amd64 @@ -162,7 +162,7 @@ jobs: push: false docker-deb-amd64-tft: - uses: ./.github/workflows/docker_build.yml + uses: ./.github/workflows/linux_packaging/docker_build.yml with: distro: debian platform: linux/amd64 @@ -171,7 +171,7 @@ jobs: pio_env: native-tft docker-alp-amd64: - uses: ./.github/workflows/docker_build.yml + uses: ./.github/workflows/linux_packaging/docker_build.yml with: distro: alpine platform: linux/amd64 @@ -179,7 +179,7 @@ jobs: push: false docker-alp-amd64-tft: - uses: ./.github/workflows/docker_build.yml + uses: ./.github/workflows/linux_packaging/docker_build.yml with: distro: alpine platform: linux/amd64 @@ -188,7 +188,7 @@ jobs: pio_env: native-tft docker-deb-arm64: - uses: ./.github/workflows/docker_build.yml + uses: ./.github/workflows/linux_packaging/docker_build.yml with: distro: debian platform: linux/arm64 @@ -196,7 +196,7 @@ jobs: push: false docker-deb-armv7: - uses: ./.github/workflows/docker_build.yml + uses: ./.github/workflows/linux_packaging/docker_build.yml with: distro: debian platform: linux/arm/v7 diff --git a/.github/workflows/release_channels.yml b/.github/workflows/release_channels.yml index ef03be9dc..50bd1fba1 100644 --- a/.github/workflows/release_channels.yml +++ b/.github/workflows/release_channels.yml @@ -10,7 +10,7 @@ permissions: jobs: build-docker: - uses: ./.github/workflows/docker_manifest.yml + uses: ./.github/workflows/linux_packaging/docker_manifest.yml with: release_channel: |- ${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }} @@ -25,7 +25,7 @@ jobs: - noble # 24.04 - plucky # 25.04 # - questing # 25.10 - uses: ./.github/workflows/package_ppa.yml + uses: ./.github/workflows/linux_packaging/ppa.yml with: ppa_repo: |- ppa:meshtastic/${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }} @@ -33,7 +33,7 @@ jobs: secrets: inherit package-obs: - uses: ./.github/workflows/package_obs.yml + uses: ./.github/workflows/linux_packaging/obs.yml with: obs_project: |- network:Meshtastic:${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }} @@ -42,7 +42,7 @@ jobs: secrets: inherit hook-copr: - uses: ./.github/workflows/hook_copr.yml + uses: ./.github/workflows/linux_packaging/copr.yml with: copr_project: |- ${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/trunk_nightly.yml similarity index 97% rename from .github/workflows/nightly.yml rename to .github/workflows/trunk_nightly.yml index 309772b12..4f1e9b426 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/trunk_nightly.yml @@ -1,4 +1,4 @@ -name: Nightly +name: Trunk Nightly on: schedule: - cron: 0 8 * * 1-5 diff --git a/bin/build-firmware.sh b/bin/build-firmware.sh index c53f1b660..933c9bfe6 100644 --- a/bin/build-firmware.sh +++ b/bin/build-firmware.sh @@ -10,8 +10,8 @@ elif (echo $2 | grep -q "nrf52"); then bin/build-nrf52.sh $1 elif (echo $2 | grep -q "stm32"); then bin/build-stm32.sh $1 -elif (echo $2 | grep -q "rpi2040"); then - bin/build-rpi2040.sh $1 +elif (echo $2 | grep -q "rp2xx0"); then + bin/build-rp2xx0.sh $1 else echo "Unknown target $2" exit 1 From 29cca4d62113f4627bcd8b9f33cc553a22f16fba Mon Sep 17 00:00:00 2001 From: Austin Date: Sun, 13 Jul 2025 20:54:52 -0400 Subject: [PATCH 004/180] Revert "Actions: Move all Linux packaging into subdir (#7332)" (#7334) This reverts commit f3ff80963afd5cafa840849c70023817de330863. --- .../debian_src.yml => build_debian_src.yml} | 0 .github/workflows/daily_packaging.yml | 18 +++++++++--------- .../{linux_packaging => }/docker_build.yml | 1 - .../{linux_packaging => }/docker_manifest.yml | 12 ++++++------ .../copr.yml => hook_copr.yml} | 0 .github/workflows/main_matrix.yml | 14 +++++++------- .../{trunk_nightly.yml => nightly.yml} | 2 +- .../obs.yml => package_obs.yml} | 2 +- .../ppa.yml => package_ppa.yml} | 2 +- .github/workflows/release_channels.yml | 8 ++++---- bin/build-firmware.sh | 4 ++-- 11 files changed, 31 insertions(+), 32 deletions(-) rename .github/workflows/{linux_packaging/debian_src.yml => build_debian_src.yml} (100%) rename .github/workflows/{linux_packaging => }/docker_build.yml (98%) rename .github/workflows/{linux_packaging => }/docker_manifest.yml (93%) rename .github/workflows/{linux_packaging/copr.yml => hook_copr.yml} (100%) rename .github/workflows/{trunk_nightly.yml => nightly.yml} (97%) rename .github/workflows/{linux_packaging/obs.yml => package_obs.yml} (98%) rename .github/workflows/{linux_packaging/ppa.yml => package_ppa.yml} (96%) diff --git a/.github/workflows/linux_packaging/debian_src.yml b/.github/workflows/build_debian_src.yml similarity index 100% rename from .github/workflows/linux_packaging/debian_src.yml rename to .github/workflows/build_debian_src.yml diff --git a/.github/workflows/daily_packaging.yml b/.github/workflows/daily_packaging.yml index b9b52c5e8..eb61554f2 100644 --- a/.github/workflows/daily_packaging.yml +++ b/.github/workflows/daily_packaging.yml @@ -9,11 +9,11 @@ on: paths: - debian/** - "*.rpkg" - - .github/workflows/daily_packaging.yml - - .github/workflows/linux_packaging/debian_src.yml - - .github/workflows/linux_packaging/ppa.yml - - .github/workflows/linux_packaging/obs.yml - - .github/workflows/linux_packaging/copr.yml + - .github/workflows/nightly_packaging.yml + - .github/workflows/build_debian_src.yml + - .github/workflows/package_ppa.yml + - .github/workflows/package_obs.yml + - .github/workflows/hook_copr.yml permissions: contents: write @@ -21,7 +21,7 @@ permissions: jobs: docker-multiarch: - uses: ./.github/workflows/linux_packaging/docker_manifest.yml + uses: ./.github/workflows/docker_manifest.yml with: release_channel: daily secrets: inherit @@ -35,21 +35,21 @@ jobs: - noble # 24.04 - plucky # 25.04 - questing # 25.10 - uses: ./.github/workflows/linux_packaging/ppa.yml + uses: ./.github/workflows/package_ppa.yml with: ppa_repo: ppa:meshtastic/daily series: ${{ matrix.series }} secrets: inherit package-obs: - uses: ./.github/workflows/linux_packaging/obs.yml + uses: ./.github/workflows/package_obs.yml with: obs_project: network:Meshtastic:daily series: unstable secrets: inherit hook-copr: - uses: ./.github/workflows/linux_packaging/copr.yml + uses: ./.github/workflows/hook_copr.yml with: copr_project: daily secrets: inherit diff --git a/.github/workflows/linux_packaging/docker_build.yml b/.github/workflows/docker_build.yml similarity index 98% rename from .github/workflows/linux_packaging/docker_build.yml rename to .github/workflows/docker_build.yml index a6173eac5..cde7fd274 100644 --- a/.github/workflows/linux_packaging/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -42,7 +42,6 @@ permissions: jobs: docker-build: - name: docker-${{ inputs.distro }} outputs: digest: ${{ steps.docker_variant.outputs.digest }} runs-on: ${{ inputs.runs-on }} diff --git a/.github/workflows/linux_packaging/docker_manifest.yml b/.github/workflows/docker_manifest.yml similarity index 93% rename from .github/workflows/linux_packaging/docker_manifest.yml rename to .github/workflows/docker_manifest.yml index 6585212a4..d1d1a5634 100644 --- a/.github/workflows/linux_packaging/docker_manifest.yml +++ b/.github/workflows/docker_manifest.yml @@ -17,7 +17,7 @@ permissions: jobs: docker-debian-amd64: - uses: ./.github/workflows/linux_packaging/docker_build.yml + uses: ./.github/workflows/docker_build.yml with: distro: debian platform: linux/amd64 @@ -26,7 +26,7 @@ jobs: secrets: inherit docker-debian-arm64: - uses: ./.github/workflows/linux_packaging/docker_build.yml + uses: ./.github/workflows/docker_build.yml with: distro: debian platform: linux/arm64 @@ -35,7 +35,7 @@ jobs: secrets: inherit docker-debian-armv7: - uses: ./.github/workflows/linux_packaging/docker_build.yml + uses: ./.github/workflows/docker_build.yml with: distro: debian platform: linux/arm/v7 @@ -44,7 +44,7 @@ jobs: secrets: inherit docker-alpine-amd64: - uses: ./.github/workflows/linux_packaging/docker_build.yml + uses: ./.github/workflows/docker_build.yml with: distro: alpine platform: linux/amd64 @@ -53,7 +53,7 @@ jobs: secrets: inherit docker-alpine-arm64: - uses: ./.github/workflows/linux_packaging/docker_build.yml + uses: ./.github/workflows/docker_build.yml with: distro: alpine platform: linux/arm64 @@ -62,7 +62,7 @@ jobs: secrets: inherit docker-alpine-armv7: - uses: ./.github/workflows/linux_packaging/docker_build.yml + uses: ./.github/workflows/docker_build.yml with: distro: alpine platform: linux/arm/v7 diff --git a/.github/workflows/linux_packaging/copr.yml b/.github/workflows/hook_copr.yml similarity index 100% rename from .github/workflows/linux_packaging/copr.yml rename to .github/workflows/hook_copr.yml diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 3aafced62..a676efa1e 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -136,7 +136,7 @@ jobs: build-debian-src: if: github.repository == 'meshtastic/firmware' - uses: ./.github/workflows/linux_packaging/debian_src.yml + uses: ./.github/workflows/build_debian_src.yml with: series: UNRELEASED build_location: local @@ -154,7 +154,7 @@ jobs: uses: ./.github/workflows/test_native.yml docker-deb-amd64: - uses: ./.github/workflows/linux_packaging/docker_build.yml + uses: ./.github/workflows/docker_build.yml with: distro: debian platform: linux/amd64 @@ -162,7 +162,7 @@ jobs: push: false docker-deb-amd64-tft: - uses: ./.github/workflows/linux_packaging/docker_build.yml + uses: ./.github/workflows/docker_build.yml with: distro: debian platform: linux/amd64 @@ -171,7 +171,7 @@ jobs: pio_env: native-tft docker-alp-amd64: - uses: ./.github/workflows/linux_packaging/docker_build.yml + uses: ./.github/workflows/docker_build.yml with: distro: alpine platform: linux/amd64 @@ -179,7 +179,7 @@ jobs: push: false docker-alp-amd64-tft: - uses: ./.github/workflows/linux_packaging/docker_build.yml + uses: ./.github/workflows/docker_build.yml with: distro: alpine platform: linux/amd64 @@ -188,7 +188,7 @@ jobs: pio_env: native-tft docker-deb-arm64: - uses: ./.github/workflows/linux_packaging/docker_build.yml + uses: ./.github/workflows/docker_build.yml with: distro: debian platform: linux/arm64 @@ -196,7 +196,7 @@ jobs: push: false docker-deb-armv7: - uses: ./.github/workflows/linux_packaging/docker_build.yml + uses: ./.github/workflows/docker_build.yml with: distro: debian platform: linux/arm/v7 diff --git a/.github/workflows/trunk_nightly.yml b/.github/workflows/nightly.yml similarity index 97% rename from .github/workflows/trunk_nightly.yml rename to .github/workflows/nightly.yml index 4f1e9b426..309772b12 100644 --- a/.github/workflows/trunk_nightly.yml +++ b/.github/workflows/nightly.yml @@ -1,4 +1,4 @@ -name: Trunk Nightly +name: Nightly on: schedule: - cron: 0 8 * * 1-5 diff --git a/.github/workflows/linux_packaging/obs.yml b/.github/workflows/package_obs.yml similarity index 98% rename from .github/workflows/linux_packaging/obs.yml rename to .github/workflows/package_obs.yml index 5156dee2e..275ffce0e 100644 --- a/.github/workflows/linux_packaging/obs.yml +++ b/.github/workflows/package_obs.yml @@ -23,7 +23,7 @@ permissions: jobs: build-debian-src: - uses: ./.github/workflows/linux_packaging/debian_src.yml + uses: ./.github/workflows/build_debian_src.yml secrets: inherit with: series: ${{ inputs.series }} diff --git a/.github/workflows/linux_packaging/ppa.yml b/.github/workflows/package_ppa.yml similarity index 96% rename from .github/workflows/linux_packaging/ppa.yml rename to .github/workflows/package_ppa.yml index ef089eefb..a54b0bd36 100644 --- a/.github/workflows/linux_packaging/ppa.yml +++ b/.github/workflows/package_ppa.yml @@ -21,7 +21,7 @@ permissions: jobs: build-debian-src: - uses: ./.github/workflows/linux_packaging/debian_src.yml + uses: ./.github/workflows/build_debian_src.yml secrets: inherit with: series: ${{ inputs.series }} diff --git a/.github/workflows/release_channels.yml b/.github/workflows/release_channels.yml index 50bd1fba1..ef03be9dc 100644 --- a/.github/workflows/release_channels.yml +++ b/.github/workflows/release_channels.yml @@ -10,7 +10,7 @@ permissions: jobs: build-docker: - uses: ./.github/workflows/linux_packaging/docker_manifest.yml + uses: ./.github/workflows/docker_manifest.yml with: release_channel: |- ${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }} @@ -25,7 +25,7 @@ jobs: - noble # 24.04 - plucky # 25.04 # - questing # 25.10 - uses: ./.github/workflows/linux_packaging/ppa.yml + uses: ./.github/workflows/package_ppa.yml with: ppa_repo: |- ppa:meshtastic/${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }} @@ -33,7 +33,7 @@ jobs: secrets: inherit package-obs: - uses: ./.github/workflows/linux_packaging/obs.yml + uses: ./.github/workflows/package_obs.yml with: obs_project: |- network:Meshtastic:${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }} @@ -42,7 +42,7 @@ jobs: secrets: inherit hook-copr: - uses: ./.github/workflows/linux_packaging/copr.yml + uses: ./.github/workflows/hook_copr.yml with: copr_project: |- ${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }} diff --git a/bin/build-firmware.sh b/bin/build-firmware.sh index 933c9bfe6..c53f1b660 100644 --- a/bin/build-firmware.sh +++ b/bin/build-firmware.sh @@ -10,8 +10,8 @@ elif (echo $2 | grep -q "nrf52"); then bin/build-nrf52.sh $1 elif (echo $2 | grep -q "stm32"); then bin/build-stm32.sh $1 -elif (echo $2 | grep -q "rp2xx0"); then - bin/build-rp2xx0.sh $1 +elif (echo $2 | grep -q "rpi2040"); then + bin/build-rpi2040.sh $1 else echo "Unknown target $2" exit 1 From ac3e5684d6887704eb0e317223e0c7bc8394ac76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Mon, 14 Jul 2025 12:11:26 +0200 Subject: [PATCH 005/180] get git url part from local repo (#7331) --- bin/platformio-custom.py | 13 +++++++++++++ src/main.cpp | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/bin/platformio-custom.py b/bin/platformio-custom.py index be2a9ab71..fc1b4bc2e 100644 --- a/bin/platformio-custom.py +++ b/bin/platformio-custom.py @@ -3,6 +3,7 @@ # trunk-ignore-all(flake8/F821): For SConstruct imports import sys from os.path import join +import subprocess import json import re @@ -92,6 +93,17 @@ prefsLoc = projenv["PROJECT_DIR"] + "/version.properties" verObj = readProps(prefsLoc) print("Using meshtastic platformio-custom.py, firmware version " + verObj["long"] + " on " + env.get("PIOENV")) +# get repository owner if git is installed +try: + r_owner = ( + subprocess.check_output(["git", "config", "--get", "remote.origin.url"]) + .decode("utf-8") + .strip().split("/") + ) + repo_owner = r_owner[-2] + "/" + r_owner[-1].replace(".git", "") +except subprocess.CalledProcessError: + repo_owner = "unknown" + jsonLoc = env["PROJECT_DIR"] + "/userPrefs.jsonc" with open(jsonLoc) as f: jsonStr = re.sub("//.*","", f.read(), flags=re.MULTILINE) @@ -117,6 +129,7 @@ flags = [ "-DAPP_VERSION=" + verObj["long"], "-DAPP_VERSION_SHORT=" + verObj["short"], "-DAPP_ENV=" + env.get("PIOENV"), + "-DAPP_REPO=" + repo_owner, ] + pref_flags print ("Using flags:") diff --git a/src/main.cpp b/src/main.cpp index 395291766..640f0b1fe 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -286,7 +286,7 @@ void lateInitVariant() {} */ void printInfo() { - LOG_INFO("S:B:%d,%s,%s", HW_VENDOR, optstr(APP_VERSION), optstr(APP_ENV)); + LOG_INFO("S:B:%d,%s,%s,%s", HW_VENDOR, optstr(APP_VERSION), optstr(APP_ENV), optstr(APP_REPO)); } #ifndef PIO_UNIT_TESTING void setup() From 1be4fc5ae95dc22e63688f78e9050981d50d88d8 Mon Sep 17 00:00:00 2001 From: Chloe Bethel Date: Mon, 14 Jul 2025 11:12:26 +0100 Subject: [PATCH 006/180] GPS for STM32WL (#7297) * Enable GPS for Wio-E5 variant on Serial2 * Add ability to override GPS serial port using GPS_SERIAL_PORT, and make RAK2560 use it. * Don't try to send ATAK packets if ATAK is disabled, +4k flash --- arch/stm32/stm32.ini | 4 ++-- src/gps/GPS.cpp | 6 +++--- src/modules/PositionModule.cpp | 2 ++ variants/rak2560/variant.h | 1 + variants/wio-e5/platformio.ini | 7 ++++++- variants/wio-e5/variant.h | 2 ++ 6 files changed, 16 insertions(+), 6 deletions(-) diff --git a/arch/stm32/stm32.ini b/arch/stm32/stm32.ini index be1ed662f..03e0bf392 100644 --- a/arch/stm32/stm32.ini +++ b/arch/stm32/stm32.ini @@ -23,11 +23,11 @@ build_flags = -DMESHTASTIC_EXCLUDE_SCREEN=1 -DMESHTASTIC_EXCLUDE_MQTT=1 -DMESHTASTIC_EXCLUDE_BLUETOOTH=1 - -DMESHTASTIC_EXCLUDE_GPS=1 -DMESHTASTIC_EXCLUDE_WIFI=1 -DMESHTASTIC_EXCLUDE_TZ=1 ; Exclude TZ to save some flash space. + -DSERIAL_RX_BUFFER_SIZE=256 ; For GPS - the default of 64 is too small. -DPIO_FRAMEWORK_ARDUINO_NANOLIB_FLOAT_PRINTF ; This is REQUIRED for at least traceroute debug prints - without it the length ends up uninitialized. - ;-DDEBUG_MUTE + -DDEBUG_MUTE ; You can #undef DEBUG_MUTE in certain source files if you need the logs. -fmerge-all-constants -ffunction-sections -fdata-sections diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index 345c738d6..3a6b19f64 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -39,9 +39,9 @@ template std::size_t array_count(const T (&)[N]) return N; } -#if defined(NRF52840_XXAA) || defined(NRF52833_XXAA) || defined(ARCH_ESP32) || defined(ARCH_PORTDUINO) -#if defined(RAK2560) -HardwareSerial *GPS::_serial_gps = &Serial2; +#if defined(NRF52840_XXAA) || defined(NRF52833_XXAA) || defined(ARCH_ESP32) || defined(ARCH_PORTDUINO) || defined(ARCH_STM32WL) +#if defined(GPS_SERIAL_PORT) +HardwareSerial *GPS::_serial_gps = &GPS_SERIAL_PORT; #else HardwareSerial *GPS::_serial_gps = &Serial1; #endif diff --git a/src/modules/PositionModule.cpp b/src/modules/PositionModule.cpp index 93c65ecc1..8b6a9f19c 100644 --- a/src/modules/PositionModule.cpp +++ b/src/modules/PositionModule.cpp @@ -266,9 +266,11 @@ meshtastic_MeshPacket *PositionModule::allocPositionPacket() LOG_INFO("Position packet: time=%i lat=%i lon=%i", p.time, p.latitude_i, p.longitude_i); +#ifndef MESHTASTIC_EXCLUDE_ATAK // TAK Tracker devices should send their position in a TAK packet over the ATAK port if (config.device.role == meshtastic_Config_DeviceConfig_Role_TAK_TRACKER) return allocAtakPli(); +#endif return allocDataProtobuf(p); } diff --git a/variants/rak2560/variant.h b/variants/rak2560/variant.h index a03fc3933..f922e8a61 100644 --- a/variants/rak2560/variant.h +++ b/variants/rak2560/variant.h @@ -222,6 +222,7 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG // #define PIN_GPS_EN PIN_3V3_EN #define PIN_GPS_PPS (17) // Pulse per second input from the GPS +#define GPS_SERIAL_PORT Serial2 // On RAK2560 the GPS is be on a different UART // #define GPS_RX_PIN PIN_SERIAL2_RX // #define GPS_TX_PIN PIN_SERIAL2_TX diff --git a/variants/wio-e5/platformio.ini b/variants/wio-e5/platformio.ini index 1ef7abd78..90251c7aa 100644 --- a/variants/wio-e5/platformio.ini +++ b/variants/wio-e5/platformio.ini @@ -15,7 +15,12 @@ build_flags = -DRADIOLIB_EXCLUDE_SX128X=1 -DRADIOLIB_EXCLUDE_SX127X=1 -DRADIOLIB_EXCLUDE_LR11X0=1 - -DHAS_SENSOR + -DHAS_SENSOR=1 + -DENABLE_HWSERIAL2 + -DPIN_SERIAL2_TX=PA2 + -DPIN_SERIAL2_RX=PA3 + -DHAS_GPS=1 + -DGPS_SERIAL_PORT=Serial2 upload_port = stlink diff --git a/variants/wio-e5/variant.h b/variants/wio-e5/variant.h index 5421eaeb9..6098b4ce6 100644 --- a/variants/wio-e5/variant.h +++ b/variants/wio-e5/variant.h @@ -17,6 +17,8 @@ Do not expect a working Meshtastic device with this target. #define LED_PIN PB5 #define LED_STATE_ON 1 +#define WIO_E5 + #if (defined(LED_BUILTIN) && LED_BUILTIN == PNUM_NOT_DEFINED) #undef LED_BUILTIN #define LED_BUILTIN (LED_PIN) From 3599ca6845c3b9788226e875ef7c11a4a6be7da1 Mon Sep 17 00:00:00 2001 From: Chloe Bethel Date: Mon, 14 Jul 2025 11:12:38 +0100 Subject: [PATCH 007/180] Add heap info via standard mallinfo() function for STM32 (#7327) Co-authored-by: Ben Meadors --- src/memGet.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/memGet.cpp b/src/memGet.cpp index ef1102f1e..e8cd177dd 100644 --- a/src/memGet.cpp +++ b/src/memGet.cpp @@ -10,6 +10,10 @@ #include "memGet.h" #include "configuration.h" +#ifdef ARCH_STM32WL +#include +#endif + MemGet memGet; /** @@ -24,6 +28,9 @@ uint32_t MemGet::getFreeHeap() return dbgHeapFree(); #elif defined(ARCH_RP2040) return rp2040.getFreeHeap(); +#elif defined(ARCH_STM32WL) + struct mallinfo m = mallinfo(); + return m.fordblks; // Total free space (bytes) #else // this platform does not have heap management function implemented return UINT32_MAX; @@ -42,6 +49,9 @@ uint32_t MemGet::getHeapSize() return dbgHeapTotal(); #elif defined(ARCH_RP2040) return rp2040.getTotalHeap(); +#elif defined(ARCH_STM32WL) + struct mallinfo m = mallinfo(); + return m.arena; // Non-mmapped space allocated (bytes) #else // this platform does not have heap management function implemented return UINT32_MAX; From f197f0e5ec791c6944e73ec52ded417884ad3f08 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 05:12:52 -0500 Subject: [PATCH 008/180] Upgrade trunk (#7336) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> --- .trunk/trunk.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index f0271c856..7d27efe58 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,7 +9,7 @@ plugins: lint: enabled: - checkov@3.2.450 - - renovate@41.29.1 + - renovate@41.30.5 - prettier@3.6.2 - trufflehog@3.89.2 - yamllint@1.37.1 From daa1d582cbdf1a8ae20175d1353feb2e6524526f Mon Sep 17 00:00:00 2001 From: Quency-D <55523105+Quency-D@users.noreply.github.com> Date: Mon, 14 Jul 2025 18:43:25 +0800 Subject: [PATCH 009/180] The screen display of the heltec wireless tracker is abnormal. (#7337) The screen of the heltec wireless tracker uses the same power source as the GPS. If the GPS turns off the power during the screen shutdown period and then turns on the power, the screen will not function properly. So initialize the screen every time it starts. --- src/graphics/Screen.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 1f2e7e4d9..e46f7dffe 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -386,9 +386,7 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver) #ifdef T_WATCH_S3 PMU->enablePowerOutput(XPOWERS_ALDO2); #endif -#ifdef HELTEC_TRACKER_V1_X - uint8_t tft_vext_enabled = digitalRead(VEXT_ENABLE); -#endif + #if !ARCH_PORTDUINO dispdev->displayOn(); #endif @@ -400,10 +398,7 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver) dispdev->displayOn(); #ifdef HELTEC_TRACKER_V1_X - // If the TFT VEXT power is not enabled, initialize the UI. - if (!tft_vext_enabled) { ui->init(); - } #endif #ifdef USE_ST7789 pinMode(VTFT_CTRL, OUTPUT); From 86af5f5252f408fce0fc1509e2430c98395c7d49 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Mon, 14 Jul 2025 05:44:29 -0500 Subject: [PATCH 010/180] Trunk --- src/graphics/Screen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index e46f7dffe..e1b4101c4 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -398,7 +398,7 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver) dispdev->displayOn(); #ifdef HELTEC_TRACKER_V1_X - ui->init(); + ui->init(); #endif #ifdef USE_ST7789 pinMode(VTFT_CTRL, OUTPUT); From e864fcf9a81d2b7c2a356687231b39edb4c36569 Mon Sep 17 00:00:00 2001 From: "Daniel.Cao" <144674500+DanielCao0@users.noreply.github.com> Date: Mon, 14 Jul 2025 22:29:42 +0800 Subject: [PATCH 011/180] feat: add support for RAK Wismesh Tag hardware platform (#6853) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add new platform rak_wismeshtag * Remove RTC and Ethernet definitions from variant.h * Remove unused EINK and Ethernet definitions from variant.h and platformio.ini * Add WISMESH_TAG hardware model definition in architecture.h and update build flags in platformio.ini * Remove unused build flags and dependencies --------- Co-authored-by: Ben Meadors Co-authored-by: daniel Co-authored-by: Thomas Göttgens --- src/platform/nrf52/architecture.h | 2 + variants/rak_wismeshtag/platformio.ini | 15 ++ variants/rak_wismeshtag/variant.cpp | 45 +++++ variants/rak_wismeshtag/variant.h | 245 +++++++++++++++++++++++++ 4 files changed, 307 insertions(+) create mode 100644 variants/rak_wismeshtag/platformio.ini create mode 100644 variants/rak_wismeshtag/variant.cpp create mode 100644 variants/rak_wismeshtag/variant.h diff --git a/src/platform/nrf52/architecture.h b/src/platform/nrf52/architecture.h index 684d20e84..ba94f4a2a 100644 --- a/src/platform/nrf52/architecture.h +++ b/src/platform/nrf52/architecture.h @@ -49,6 +49,8 @@ #define HW_VENDOR meshtastic_HardwareModel_RAK2560 #elif defined(WISMESH_TAP) #define HW_VENDOR meshtastic_HardwareModel_WISMESH_TAP +#elif defined(WISMESH_TAG) +#define HW_VENDOR meshtastic_HardwareModel_WISMESH_TAG #elif defined(GAT562_MESH_TRIAL_TRACKER) #define HW_VENDOR meshtastic_HardwareModel_GAT562_MESH_TRIAL_TRACKER #elif defined(RAK4630) diff --git a/variants/rak_wismeshtag/platformio.ini b/variants/rak_wismeshtag/platformio.ini new file mode 100644 index 000000000..a066e5282 --- /dev/null +++ b/variants/rak_wismeshtag/platformio.ini @@ -0,0 +1,15 @@ +; The very slick RAK wireless RAK 4631 / 4630 board - Unified firmware for 5005/19003, with or without OLED RAK 1921 +[env:rak_wismeshtag] +extends = nrf52840_base +board = wiscore_rak4631 +board_check = true +build_flags = ${nrf52840_base.build_flags} -Ivariants/rak_wismeshtag -D WISMESH_TAG -D RAK_4631 + -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" + -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. + -DRADIOLIB_EXCLUDE_SX128X=1 + -DRADIOLIB_EXCLUDE_SX127X=1 + -DRADIOLIB_EXCLUDE_LR11X0=1 + -DMESHTASTIC_EXCLUDE_WIFI=1 +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak_wismeshtag> +lib_deps = + ${nrf52840_base.lib_deps} \ No newline at end of file diff --git a/variants/rak_wismeshtag/variant.cpp b/variants/rak_wismeshtag/variant.cpp new file mode 100644 index 000000000..e84b60b3b --- /dev/null +++ b/variants/rak_wismeshtag/variant.cpp @@ -0,0 +1,45 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + Copyright (c) 2016 Sandeep Mistry All right reserved. + Copyright (c) 2018, Adafruit Industries (adafruit.com) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "variant.h" +#include "nrf.h" +#include "wiring_constants.h" +#include "wiring_digital.h" + +const uint32_t g_ADigitalPinMap[] = { + // P0 + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + + // P1 + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}; + +void initVariant() +{ + // LED1 & LED2 + pinMode(PIN_LED1, OUTPUT); + ledOff(PIN_LED1); + + pinMode(PIN_LED2, OUTPUT); + ledOff(PIN_LED2); + + // 3V3 Power Rail + pinMode(PIN_3V3_EN, OUTPUT); + digitalWrite(PIN_3V3_EN, HIGH); +} diff --git a/variants/rak_wismeshtag/variant.h b/variants/rak_wismeshtag/variant.h new file mode 100644 index 000000000..dd82b76a1 --- /dev/null +++ b/variants/rak_wismeshtag/variant.h @@ -0,0 +1,245 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + Copyright (c) 2016 Sandeep Mistry All right reserved. + Copyright (c) 2018, Adafruit Industries (adafruit.com) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _VARIANT_RAK4630_ +#define _VARIANT_RAK4630_ + +#define RAK4630 + +/** Master clock frequency */ +#define VARIANT_MCK (64000000ul) + +#define USE_LFXO // Board uses 32khz crystal for LF +// define USE_LFRC // Board uses RC for LF + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "WVariant.h" + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +// Number of pins defined in PinDescription array +#define PINS_COUNT (48) +#define NUM_DIGITAL_PINS (48) +#define NUM_ANALOG_INPUTS (6) +#define NUM_ANALOG_OUTPUTS (0) + +// LEDs +#define PIN_LED1 (35) +#define PIN_LED2 (36) + +#define LED_BUILTIN PIN_LED1 +#define LED_CONN PIN_LED2 + +#define LED_GREEN PIN_LED1 +#define LED_BLUE PIN_LED2 + +#define LED_STATE_ON 1 // State when LED is litted + +/* + * Buttons + */ + +#define PIN_BUTTON1 9 // Pin for button on E-ink button module or IO expansion +#define BUTTON_NEED_PULLUP +#define PIN_BUTTON2 12 +#define PIN_BUTTON3 24 +#define PIN_BUTTON4 25 + +/* + * Analog pins + */ +#define PIN_A0 (5) +#define PIN_A1 (31) +#define PIN_A2 (28) +#define PIN_A3 (29) +#define PIN_A4 (30) +#define PIN_A5 (31) +#define PIN_A6 (0xff) +#define PIN_A7 (0xff) + +static const uint8_t A0 = PIN_A0; +static const uint8_t A1 = PIN_A1; +static const uint8_t A2 = PIN_A2; +static const uint8_t A3 = PIN_A3; +static const uint8_t A4 = PIN_A4; +static const uint8_t A5 = PIN_A5; +static const uint8_t A6 = PIN_A6; +static const uint8_t A7 = PIN_A7; +#define ADC_RESOLUTION 14 + +// Other pins +#define PIN_AREF (2) +#define PIN_NFC1 (9) +#define PIN_NFC2 (10) + +static const uint8_t AREF = PIN_AREF; + +/* + * Serial interfaces + */ +#define PIN_SERIAL1_RX (15) +#define PIN_SERIAL1_TX (16) + +// Connected to Jlink CDC +#define PIN_SERIAL2_RX (8) +#define PIN_SERIAL2_TX (6) + +/* + * SPI Interfaces + */ +#define SPI_INTERFACES_COUNT 2 + +#define PIN_SPI_MISO (45) +#define PIN_SPI_MOSI (44) +#define PIN_SPI_SCK (43) + +#define PIN_SPI1_MISO (29) // (0 + 29) +#define PIN_SPI1_MOSI (30) // (0 + 30) +#define PIN_SPI1_SCK (3) // (0 + 3) + +static const uint8_t SS = 42; +static const uint8_t MOSI = PIN_SPI_MOSI; +static const uint8_t MISO = PIN_SPI_MISO; +static const uint8_t SCK = PIN_SPI_SCK; + +/* + * eink display pins + */ + +#define PIN_EINK_CS (0 + 26) +#define PIN_EINK_BUSY (0 + 4) +#define PIN_EINK_DC (0 + 17) +#define PIN_EINK_RES (-1) +#define PIN_EINK_SCLK (0 + 3) +#define PIN_EINK_MOSI (0 + 30) // also called SDI + +/* + * Wire Interfaces + */ +#define WIRE_INTERFACES_COUNT 1 + +// RAK WISMESHTAG +#define PIN_WIRE_SDA (25) +#define PIN_WIRE_SCL (24) + +// QSPI Pins +#define PIN_QSPI_SCK 3 +#define PIN_QSPI_CS 26 +#define PIN_QSPI_IO0 30 +#define PIN_QSPI_IO1 29 +#define PIN_QSPI_IO2 28 +#define PIN_QSPI_IO3 2 + + +/* @note RAK5005-O GPIO mapping to RAK4631 GPIO ports + RAK5005-O <-> nRF52840 + IO1 <-> P0.17 (Arduino GPIO number 17) + IO2 <-> P1.02 (Arduino GPIO number 34) + IO3 <-> P0.21 (Arduino GPIO number 21) + IO4 <-> P0.04 (Arduino GPIO number 4) + IO5 <-> P0.09 (Arduino GPIO number 9) + IO6 <-> P0.10 (Arduino GPIO number 10) + IO7 <-> P0.28 (Arduino GPIO number 28) + SW1 <-> P0.01 (Arduino GPIO number 1) + A0 <-> P0.04/AIN2 (Arduino Analog A2 + A1 <-> P0.31/AIN7 (Arduino Analog A7 + SPI_CS <-> P0.26 (Arduino GPIO number 26) + */ + +// RAK4630 LoRa module + +/* Setup of the SX1262 LoRa module ( https://docs.rakwireless.com/Product-Categories/WisBlock/RAK4631/Datasheet/ ) + +P1.10 NSS SPI NSS (Arduino GPIO number 42) +P1.11 SCK SPI CLK (Arduino GPIO number 43) +P1.12 MOSI SPI MOSI (Arduino GPIO number 44) +P1.13 MISO SPI MISO (Arduino GPIO number 45) +P1.14 BUSY BUSY signal (Arduino GPIO number 46) +P1.15 DIO1 DIO1 event interrupt (Arduino GPIO number 47) +P1.06 NRESET NRESET manual reset of the SX1262 (Arduino GPIO number 38) + +Important for successful SX1262 initialization: + +* Setup DIO2 to control the antenna switch +* Setup DIO3 to control the TCXO power supply +* Setup the SX1262 to use it's DCDC regulator and not the LDO +* RAK4630 schematics show GPIO P1.07 connected to the antenna switch, but it should not be initialized, as DIO2 will do the +control of the antenna switch + +SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG + +*/ + +#define DETECTION_SENSOR_EN 4 + +#define USE_SX1262 +#define SX126X_CS (42) +#define SX126X_DIO1 (47) +#define SX126X_BUSY (46) +#define SX126X_RESET (38) +// #define SX126X_TXEN (39) +// #define SX126X_RXEN (37) +#define SX126X_POWER_EN (37) +// DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3 +#define SX126X_DIO2_AS_RF_SWITCH +#define SX126X_DIO3_TCXO_VOLTAGE 1.8 + +// Testing USB detection +#define NRF_APM + +// enables 3.3V periphery like GPS or IO Module +// Do not toggle this for GPS power savings +#define PIN_3V3_EN (34) + +// RAK WISMESHTAG +#define PIN_GPS_EN PIN_3V3_EN +#define PIN_GPS_PPS (17) // Pulse per second input from the GPS + +#define GPS_RX_PIN PIN_SERIAL1_RX +#define GPS_TX_PIN PIN_SERIAL1_TX + +// RAK WISMESHTAG +#define PIN_BUZZER 21 + +// Battery +// The battery sense is hooked to pin A0 (5) +#define BATTERY_PIN PIN_A0 +// and has 12 bit resolution +#define BATTERY_SENSE_RESOLUTION_BITS 12 +#define BATTERY_SENSE_RESOLUTION 4096.0 +#undef AREF_VOLTAGE +#define AREF_VOLTAGE 3.0 +#define VBAT_AR_INTERNAL AR_INTERNAL_3_0 +#define ADC_MULTIPLIER 1.73 + +#define RAK_4631 1 + +#ifdef __cplusplus +} +#endif + +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#endif \ No newline at end of file From 8f10de5684d189bda6169332b70fd690b5328e9a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 09:46:43 -0500 Subject: [PATCH 012/180] [create-pull-request] automated change (#7338) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/admin.pb.h | 2 +- src/mesh/generated/meshtastic/config.pb.h | 10 +++++-- src/mesh/generated/meshtastic/deviceonly.pb.h | 4 +-- src/mesh/generated/meshtastic/mesh.pb.h | 28 ++++++++----------- src/mesh/generated/meshtastic/powermon.pb.h | 10 +++---- 6 files changed, 27 insertions(+), 29 deletions(-) diff --git a/protobufs b/protobufs index 584f0a3a3..f6448be77 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 584f0a3a359103acf0bfce506c1b1fc32c639841 +Subproject commit f6448be7770a3521bf52407ff8f5fa5b9b06da7b diff --git a/src/mesh/generated/meshtastic/admin.pb.h b/src/mesh/generated/meshtastic/admin.pb.h index 071640b0d..bc0b780b9 100644 --- a/src/mesh/generated/meshtastic/admin.pb.h +++ b/src/mesh/generated/meshtastic/admin.pb.h @@ -7,9 +7,9 @@ #include "meshtastic/channel.pb.h" #include "meshtastic/config.pb.h" #include "meshtastic/connection_status.pb.h" +#include "meshtastic/device_ui.pb.h" #include "meshtastic/mesh.pb.h" #include "meshtastic/module_config.pb.h" -#include "meshtastic/device_ui.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. diff --git a/src/mesh/generated/meshtastic/config.pb.h b/src/mesh/generated/meshtastic/config.pb.h index f28daadbd..20bce5b78 100644 --- a/src/mesh/generated/meshtastic/config.pb.h +++ b/src/mesh/generated/meshtastic/config.pb.h @@ -102,7 +102,11 @@ typedef enum _meshtastic_Config_DeviceConfig_BuzzerMode { meshtastic_Config_DeviceConfig_BuzzerMode_NOTIFICATIONS_ONLY = 2, /* Non-notification system buzzer tones only. Buzzer is enabled only for non-notification tones such as button presses, startup, shutdown, but not for alerts. */ - meshtastic_Config_DeviceConfig_BuzzerMode_SYSTEM_ONLY = 3 + meshtastic_Config_DeviceConfig_BuzzerMode_SYSTEM_ONLY = 3, + /* Direct Message notifications only. + Buzzer is enabled only for direct messages and alerts, but not for button presses. + External notification config determines the specifics of the notification behavior. */ + meshtastic_Config_DeviceConfig_BuzzerMode_DIRECT_MSG_ONLY = 4 } meshtastic_Config_DeviceConfig_BuzzerMode; /* Bit field of boolean configuration options, indicating which optional @@ -645,8 +649,8 @@ extern "C" { #define _meshtastic_Config_DeviceConfig_RebroadcastMode_ARRAYSIZE ((meshtastic_Config_DeviceConfig_RebroadcastMode)(meshtastic_Config_DeviceConfig_RebroadcastMode_CORE_PORTNUMS_ONLY+1)) #define _meshtastic_Config_DeviceConfig_BuzzerMode_MIN meshtastic_Config_DeviceConfig_BuzzerMode_ALL_ENABLED -#define _meshtastic_Config_DeviceConfig_BuzzerMode_MAX meshtastic_Config_DeviceConfig_BuzzerMode_SYSTEM_ONLY -#define _meshtastic_Config_DeviceConfig_BuzzerMode_ARRAYSIZE ((meshtastic_Config_DeviceConfig_BuzzerMode)(meshtastic_Config_DeviceConfig_BuzzerMode_SYSTEM_ONLY+1)) +#define _meshtastic_Config_DeviceConfig_BuzzerMode_MAX meshtastic_Config_DeviceConfig_BuzzerMode_DIRECT_MSG_ONLY +#define _meshtastic_Config_DeviceConfig_BuzzerMode_ARRAYSIZE ((meshtastic_Config_DeviceConfig_BuzzerMode)(meshtastic_Config_DeviceConfig_BuzzerMode_DIRECT_MSG_ONLY+1)) #define _meshtastic_Config_PositionConfig_PositionFlags_MIN meshtastic_Config_PositionConfig_PositionFlags_UNSET #define _meshtastic_Config_PositionConfig_PositionFlags_MAX meshtastic_Config_PositionConfig_PositionFlags_SPEED diff --git a/src/mesh/generated/meshtastic/deviceonly.pb.h b/src/mesh/generated/meshtastic/deviceonly.pb.h index f78689cb2..b02b2083d 100644 --- a/src/mesh/generated/meshtastic/deviceonly.pb.h +++ b/src/mesh/generated/meshtastic/deviceonly.pb.h @@ -6,10 +6,10 @@ #include #include #include "meshtastic/channel.pb.h" -#include "meshtastic/mesh.pb.h" -#include "meshtastic/telemetry.pb.h" #include "meshtastic/config.pb.h" #include "meshtastic/localonly.pb.h" +#include "meshtastic/mesh.pb.h" +#include "meshtastic/telemetry.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index 9e0415198..584c3d647 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -6,11 +6,11 @@ #include #include "meshtastic/channel.pb.h" #include "meshtastic/config.pb.h" +#include "meshtastic/device_ui.pb.h" #include "meshtastic/module_config.pb.h" #include "meshtastic/portnums.pb.h" #include "meshtastic/telemetry.pb.h" #include "meshtastic/xmodem.pb.h" -#include "meshtastic/device_ui.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. @@ -247,32 +247,26 @@ typedef enum _meshtastic_HardwareModel { meshtastic_HardwareModel_NOMADSTAR_METEOR_PRO = 96, /* Elecrow CrowPanel Advance models, ESP32-S3 and TFT with SX1262 radio plugin */ meshtastic_HardwareModel_CROWPANEL = 97, - /* * - Lilygo LINK32 board with sensors */ + /* Lilygo LINK32 board with sensors */ meshtastic_HardwareModel_LINK_32 = 98, - /* * - Seeed Tracker L1 */ + /* Seeed Tracker L1 */ meshtastic_HardwareModel_SEEED_WIO_TRACKER_L1 = 99, - /* * - Seeed Tracker L1 EINK driver */ + /* Seeed Tracker L1 EINK driver */ meshtastic_HardwareModel_SEEED_WIO_TRACKER_L1_EINK = 100, /* Reserved ID for future and past use */ meshtastic_HardwareModel_QWANTZ_TINY_ARMS = 101, - /* * - Lilygo T-Deck Pro */ + /* Lilygo T-Deck Pro */ meshtastic_HardwareModel_T_DECK_PRO = 102, - /* * - Lilygo TLora Pager */ + /* Lilygo TLora Pager */ meshtastic_HardwareModel_T_LORA_PAGER = 103, - /* * - GAT562 Mesh Trial Tracker */ + /* GAT562 Mesh Trial Tracker */ meshtastic_HardwareModel_GAT562_MESH_TRIAL_TRACKER = 104, - /* * - RAKwireless WisMesh Tag */ + /* RAKwireless WisMesh Tag */ meshtastic_HardwareModel_WISMESH_TAG = 105, - /* * - RAKwireless WisBlock Core RAK3312 https://docs.rakwireless.com/product-categories/wisduo/rak3112-module/overview/ */ + /* RAKwireless WisBlock Core RAK3312 https://docs.rakwireless.com/product-categories/wisduo/rak3112-module/overview/ */ meshtastic_HardwareModel_RAK3312 = 106, + /* Elecrow ThinkNode M5 https://www.elecrow.com/wiki/ThinkNode_M5_Meshtastic_LoRa_Signal_Transceiver_ESP32-S3.html */ + meshtastic_HardwareModel_THINKNODE_M5 = 107, /* ------------------------------------------------------------------------------------------------------------------------------------------ Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. ------------------------------------------------------------------------------------------------------------------------------------------ */ diff --git a/src/mesh/generated/meshtastic/powermon.pb.h b/src/mesh/generated/meshtastic/powermon.pb.h index 9d4d94193..3072b8ac5 100644 --- a/src/mesh/generated/meshtastic/powermon.pb.h +++ b/src/mesh/generated/meshtastic/powermon.pb.h @@ -11,7 +11,7 @@ /* Enum definitions */ /* Any significant power changing event in meshtastic should be tagged with a powermon state transition. -If you are making new meshtastic features feel free to add new entries at the end of this definition. */ + If you are making new meshtastic features feel free to add new entries at the end of this definition. */ typedef enum _meshtastic_PowerMon_State { meshtastic_PowerMon_State_None = 0, meshtastic_PowerMon_State_CPU_DeepSleep = 1, @@ -34,13 +34,13 @@ something like "S:PM:C,0x00001234,REASON" where the hex number is the bitmask of meshtastic_PowerMon_State_Screen_Drawing = 512, meshtastic_PowerMon_State_Wifi_On = 1024, /* GPS is actively trying to find our location -See GPSPowerState for more details */ + See GPSPowerState for more details */ meshtastic_PowerMon_State_GPS_Active = 2048 } meshtastic_PowerMon_State; /* What operation would we like the UUT to perform. -note: senders should probably set want_response in their request packets, so that they can know when the state -machine has started processing their request */ + note: senders should probably set want_response in their request packets, so that they can know when the state + machine has started processing their request */ typedef enum _meshtastic_PowerStressMessage_Opcode { /* Unset/unused */ meshtastic_PowerStressMessage_Opcode_UNSET = 0, @@ -67,7 +67,7 @@ typedef enum _meshtastic_PowerStressMessage_Opcode { /* Struct definitions */ /* Note: There are no 'PowerMon' messages normally in use (PowerMons are sent only as structured logs - slogs). -But we wrap our State enum in this message to effectively nest a namespace (without our linter yelling at us) */ + But we wrap our State enum in this message to effectively nest a namespace (without our linter yelling at us) */ typedef struct _meshtastic_PowerMon { char dummy_field; } meshtastic_PowerMon; From 5776385e8cd20c31cc8e67a9f54f3a4c05a64678 Mon Sep 17 00:00:00 2001 From: Austin Date: Mon, 14 Jul 2025 13:52:21 -0400 Subject: [PATCH 013/180] STM32 PlatformIO cleanup (#7339) --- arch/stm32/stm32.ini | 6 ++++++ variants/CDEBYTE_E77-MBL/platformio.ini | 10 ---------- variants/rak3172/platformio.ini | 10 ---------- variants/wio-e5/platformio.ini | 5 ----- 4 files changed, 6 insertions(+), 25 deletions(-) diff --git a/arch/stm32/stm32.ini b/arch/stm32/stm32.ini index 03e0bf392..153ca9f3e 100644 --- a/arch/stm32/stm32.ini +++ b/arch/stm32/stm32.ini @@ -26,11 +26,17 @@ build_flags = -DMESHTASTIC_EXCLUDE_WIFI=1 -DMESHTASTIC_EXCLUDE_TZ=1 ; Exclude TZ to save some flash space. -DSERIAL_RX_BUFFER_SIZE=256 ; For GPS - the default of 64 is too small. + -DHAS_SCREEN=0 ; Always disable screen for STM32, it is not supported. -DPIO_FRAMEWORK_ARDUINO_NANOLIB_FLOAT_PRINTF ; This is REQUIRED for at least traceroute debug prints - without it the length ends up uninitialized. -DDEBUG_MUTE ; You can #undef DEBUG_MUTE in certain source files if you need the logs. -fmerge-all-constants -ffunction-sections -fdata-sections + -DRADIOLIB_EXCLUDE_SX128X=1 + -DRADIOLIB_EXCLUDE_SX127X=1 + -DRADIOLIB_EXCLUDE_LR11X0=1 + -DHAL_DAC_MODULE_ONLY + -DHAL_RNG_MODULE_ENABLED build_src_filter = ${arduino_base.build_src_filter} - - - - - - - - - - - - - - diff --git a/variants/CDEBYTE_E77-MBL/platformio.ini b/variants/CDEBYTE_E77-MBL/platformio.ini index 8a8002086..5c373875c 100644 --- a/variants/CDEBYTE_E77-MBL/platformio.ini +++ b/variants/CDEBYTE_E77-MBL/platformio.ini @@ -9,19 +9,9 @@ build_flags = -DSERIAL_UART_INSTANCE=1 -DPIN_SERIAL_RX=PA3 -DPIN_SERIAL_TX=PA2 - -DHAL_DAC_MODULE_ONLY - -DHAL_RNG_MODULE_ENABLED - -DRADIOLIB_EXCLUDE_SX128X=1 - -DRADIOLIB_EXCLUDE_SX127X=1 - -DRADIOLIB_EXCLUDE_LR11X0=1 -DMESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1 -DMESHTASTIC_EXCLUDE_I2C=1 - -DMESHTASTIC_EXCLUDE_WIFI=1 - -DMESHTASTIC_EXCLUDE_BLUETOOTH=1 -DMESHTASTIC_EXCLUDE_GPS=1 - -DMESHTASTIC_EXCLUDE_SCREEN=1 - -DMESHTASTIC_EXCLUDE_MQTT=1 - -DMESHTASTIC_EXCLUDE_POWERMON=1 ;-DPIO_FRAMEWORK_ARDUINO_NANOLIB_FLOAT_PRINTF ;-DCFG_DEBUG diff --git a/variants/rak3172/platformio.ini b/variants/rak3172/platformio.ini index 99610b17c..df2500f31 100644 --- a/variants/rak3172/platformio.ini +++ b/variants/rak3172/platformio.ini @@ -7,18 +7,8 @@ build_flags = -Ivariants/rak3172 -DPIN_WIRE_SDA=PA11 -DPIN_WIRE_SCL=PA12 - -DHAL_DAC_MODULE_ONLY - -DHAL_RNG_MODULE_ENABLED - -DRADIOLIB_EXCLUDE_SX128X=1 - -DRADIOLIB_EXCLUDE_SX127X=1 - -DRADIOLIB_EXCLUDE_LR11X0=1 -DMESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1 -DMESHTASTIC_EXCLUDE_I2C=1 - -DMESHTASTIC_EXCLUDE_WIFI=1 - -DMESHTASTIC_EXCLUDE_BLUETOOTH=1 -DMESHTASTIC_EXCLUDE_GPS=1 - -DMESHTASTIC_EXCLUDE_SCREEN=1 - -DMESHTASTIC_EXCLUDE_MQTT=1 - -DMESHTASTIC_EXCLUDE_POWERMON=1 ;-DCFG_DEBUG upload_port = stlink diff --git a/variants/wio-e5/platformio.ini b/variants/wio-e5/platformio.ini index 90251c7aa..5c9f433d4 100644 --- a/variants/wio-e5/platformio.ini +++ b/variants/wio-e5/platformio.ini @@ -10,11 +10,6 @@ build_flags = -DPIN_SERIAL_TX=PB6 -DPIN_WIRE_SDA=PA15 -DPIN_WIRE_SCL=PB15 - -DHAL_DAC_MODULE_ONLY - -DHAL_RNG_MODULE_ENABLED - -DRADIOLIB_EXCLUDE_SX128X=1 - -DRADIOLIB_EXCLUDE_SX127X=1 - -DRADIOLIB_EXCLUDE_LR11X0=1 -DHAS_SENSOR=1 -DENABLE_HWSERIAL2 -DPIN_SERIAL2_TX=PA2 From 31d56c16d57bca9817f80872e2f3010382446bfd Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Mon, 14 Jul 2025 20:13:34 -0500 Subject: [PATCH 014/180] Map report should work over devices which do not have network hardware (with client proxy) (#7341) * Map report should work over devices which do not have network hardware (with client proxy) * Fix else --- src/mqtt/MQTT.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index 137c92056..091612827 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -559,10 +559,8 @@ void MQTT::sendSubscriptions() int32_t MQTT::runOnce() { -#if HAS_NETWORKING if (!moduleConfig.mqtt.enabled || !(moduleConfig.mqtt.map_reporting_enabled || channels.anyMqttEnabled())) return disable(); - bool wantConnection = wantsLink(); perhapsReportToMap(); @@ -572,7 +570,7 @@ int32_t MQTT::runOnce() publishQueuedMessages(); return 200; } - +#if HAS_NETWORKING else if (!pubSub.loop()) { if (!wantConnection) return 5000; // If we don't want connection now, check again in 5 secs @@ -596,8 +594,10 @@ int32_t MQTT::runOnce() powerFSM.trigger(EVENT_CONTACT_FROM_PHONE); // Suppress entering light sleep (because that would turn off bluetooth) return 20; } -#endif +#else + // No networking available, return default interval return 30000; +#endif } bool MQTT::isValidConfig(const meshtastic_ModuleConfig_MQTTConfig &config, MQTTClient *client) From 625a529f6c53ba684e81838e753fbfdbb6a918e1 Mon Sep 17 00:00:00 2001 From: Jason P Date: Mon, 14 Jul 2025 20:59:22 -0500 Subject: [PATCH 015/180] Message frame New Message Options and Clock / TDeck / Brightness Refinements (#7344) * Clock updates and some TDeck corrections * TDeck Brightness Works in TFT Builds * Remove HAS_TFT from enabling Brightness, disable Brightness for TDeck * Add default textMessage frame actions and adjust SharedUIDisplay --------- Co-authored-by: Ben Meadors --- src/graphics/Screen.cpp | 9 ++++--- src/graphics/SharedUIDisplay.cpp | 2 +- src/graphics/draw/ClockRenderer.cpp | 7 ++++- src/graphics/draw/MenuHandler.cpp | 42 ++++++++++++++++++++++++++--- src/graphics/draw/MenuHandler.h | 1 + 5 files changed, 52 insertions(+), 9 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index e1b4101c4..dbd0445f7 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -1374,9 +1374,12 @@ int Screen::handleInputEvent(const InputEvent *event) menuHandler::clockMenu(); } else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.lora) { menuHandler::LoraRegionPicker(); - } else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.textMessage && - devicestate.rx_text_message.from) { - menuHandler::messageResponseMenu(); + } else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.textMessage) { + if (devicestate.rx_text_message.from) { + menuHandler::messageResponseMenu(); + } else { + menuHandler::textMessageBaseMenu(); + } } else if (framesetInfo.positions.firstFavorite != 255 && this->ui->getUiState()->currentFrame >= framesetInfo.positions.firstFavorite && this->ui->getUiState()->currentFrame <= framesetInfo.positions.lastFavorite) { diff --git a/src/graphics/SharedUIDisplay.cpp b/src/graphics/SharedUIDisplay.cpp index 7cd876ac5..b458e54e4 100644 --- a/src/graphics/SharedUIDisplay.cpp +++ b/src/graphics/SharedUIDisplay.cpp @@ -206,7 +206,7 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *ti timeX = screenW - xOffset - timeStrWidth + 3; // === Show Mail or Mute Icon to the Left of Time === - int iconRightEdge = timeX - 1; + int iconRightEdge = timeX - 2; bool showMail = false; diff --git a/src/graphics/draw/ClockRenderer.cpp b/src/graphics/draw/ClockRenderer.cpp index 8d7e91000..e3cb5fcb9 100644 --- a/src/graphics/draw/ClockRenderer.cpp +++ b/src/graphics/draw/ClockRenderer.cpp @@ -186,7 +186,7 @@ void drawDigitalClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int1 { display->clear(); display->setTextAlignment(TEXT_ALIGN_LEFT); - int line = 1; + // === Set Title, Blank for Clock const char *titleStr = ""; // === Header === @@ -230,6 +230,8 @@ void drawDigitalClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int1 #ifdef T_WATCH_S3 float scale = 1.5; +#elif defined(CHATTER_2) + float scale = 1.1; #else float scale = 0.75; if (isHighResolution) { @@ -285,6 +287,9 @@ void drawDigitalClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int1 int yOffset = (isHighResolution) ? 3 : 1; #ifdef SENSECAP_INDICATOR yOffset -= 3; +#endif +#ifdef T_DECK + yOffset -= 5; #endif if (config.display.use_12h_clock) { display->drawString(startingHourMinuteTextX + xOffset, (display->getHeight() - hourMinuteTextY) - yOffset - 2, diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index f6b250ebc..ded492da6 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -344,6 +344,35 @@ void menuHandler::homeBaseMenu() screen->showOverlayBanner(bannerOptions); } +void menuHandler::textMessageBaseMenu() +{ + enum optionsNumbers { Back, Preset, Freetext, enumEnd }; + + static const char *optionsArray[enumEnd] = {"Back"}; + static int optionsEnumArray[enumEnd] = {Back}; + int options = 1; + optionsArray[options] = "New Preset Msg"; + optionsEnumArray[options++] = Preset; + if (kb_found) { + optionsArray[options] = "New Freetext Msg"; + optionsEnumArray[options++] = Freetext; + } + + BannerOverlayOptions bannerOptions; + bannerOptions.message = "Message Action"; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsEnumPtr = optionsEnumArray; + bannerOptions.optionsCount = options; + bannerOptions.bannerCallback = [](int selected) -> void { + if (selected == Preset) { + cannedMessageModule->LaunchWithDestination(NODENUM_BROADCAST); + } else if (selected == Freetext) { + cannedMessageModule->LaunchFreetextWithDestination(NODENUM_BROADCAST); + } + }; + screen->showOverlayBanner(bannerOptions); +} + void menuHandler::systemBaseMenu() { // Check if brightness is supported @@ -729,7 +758,7 @@ void menuHandler::TFTColorPickerMenu(OLEDDisplay *display) screen->runNow(); } -#if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) || HAS_TFT +#if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) || defined(T_DECK) || HAS_TFT if (selected != 0) { display->setColor(BLACK); display->fillRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); @@ -924,23 +953,28 @@ void menuHandler::screenOptionsMenu() { // Check if brightness is supported bool hasSupportBrightness = false; -#if defined(ST7789_CS) || defined(USE_OLED) || defined(USE_SSD1306) || defined(USE_SH1106) || defined(USE_SH1107) || HAS_TFT +#if defined(ST7789_CS) || defined(USE_OLED) || defined(USE_SSD1306) || defined(USE_SH1106) || defined(USE_SH1107) hasSupportBrightness = true; #endif +#if defined(T_DECK) + // TDeck Doesn't seem to support brightness at all, at least not reliably + hasSupportBrightness = false; +#endif + enum optionsNumbers { Back, Brightness, ScreenColor }; static const char *optionsArray[4] = {"Back"}; static int optionsEnumArray[4] = {Back}; int options = 1; // Only show brightness for B&W displays - if (hasSupportBrightness && !HAS_TFT) { + if (hasSupportBrightness) { optionsArray[options] = "Brightness"; optionsEnumArray[options++] = Brightness; } // Only show screen color for TFT displays -#if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) || HAS_TFT +#if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) || defined(T_DECK) || HAS_TFT optionsArray[options] = "Screen Color"; optionsEnumArray[options++] = ScreenColor; #endif diff --git a/src/graphics/draw/MenuHandler.h b/src/graphics/draw/MenuHandler.h index 2273dbbed..1f989be79 100644 --- a/src/graphics/draw/MenuHandler.h +++ b/src/graphics/draw/MenuHandler.h @@ -48,6 +48,7 @@ class menuHandler static void ClockFacePicker(); static void messageResponseMenu(); static void homeBaseMenu(); + static void textMessageBaseMenu(); static void systemBaseMenu(); static void favoriteBaseMenu(); static void positionBaseMenu(); From 39716ed1baacbcdabd744dfbb6534a3dbbbbc495 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Mon, 14 Jul 2025 21:14:07 -0500 Subject: [PATCH 016/180] Fix L1 EInk HWModel (#7346) --- src/platform/nrf52/architecture.h | 2 ++ variants/seeed_wio_tracker_L1_eink/platformio.ini | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/platform/nrf52/architecture.h b/src/platform/nrf52/architecture.h index ba94f4a2a..1bbdd77e0 100644 --- a/src/platform/nrf52/architecture.h +++ b/src/platform/nrf52/architecture.h @@ -91,6 +91,8 @@ #define HW_VENDOR meshtastic_HardwareModel_HELTEC_MESH_POCKET #elif defined(NOMADSTAR_METEOR_PRO) #define HW_VENDOR meshtastic_HardwareModel_NOMADSTAR_METEOR_PRO +#elif defined(SEEED_WIO_TRACKER_L1_EINK) +#define HW_VENDOR meshtastic_HardwareModel_SEEED_WIO_TRACKER_L1_EINK #elif defined(SEEED_WIO_TRACKER_L1) #define HW_VENDOR meshtastic_HardwareModel_SEEED_WIO_TRACKER_L1 #else diff --git a/variants/seeed_wio_tracker_L1_eink/platformio.ini b/variants/seeed_wio_tracker_L1_eink/platformio.ini index b84757b9d..b310cce83 100644 --- a/variants/seeed_wio_tracker_L1_eink/platformio.ini +++ b/variants/seeed_wio_tracker_L1_eink/platformio.ini @@ -4,7 +4,8 @@ extends = nrf52840_base, inkhud ;board_level = extra build_flags = ${nrf52840_base.build_flags} ${inkhud.build_flags} -I $PROJECT_DIR/variants/seeed_wio_tracker_L1_eink - -D SEEED_WIO_TRACKER_L1 + -D SEEED_WIO_TRACKER_L1_EINK + -D SEEED_WIO_TRACKER_L1 -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld build_src_filter = ${nrf52_base.build_src_filter} +<../variants/seeed_wio_tracker_L1_eink> ${inkhud.build_src_filter} From c3b2b474c6f9247b01b815bf181fbe104d121a64 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Wed, 16 Jul 2025 16:05:34 -0500 Subject: [PATCH 017/180] Drop NodeInfo packets if the is_licensed bit doesn't match owner (#7361) --- src/modules/NodeInfoModule.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/NodeInfoModule.cpp b/src/modules/NodeInfoModule.cpp index cf9940e25..b6fee7703 100644 --- a/src/modules/NodeInfoModule.cpp +++ b/src/modules/NodeInfoModule.cpp @@ -14,6 +14,11 @@ bool NodeInfoModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, mes { auto p = *pptr; + if (p.is_licensed != owner.is_licensed) { + LOG_WARN("Invalid nodeInfo detected, is_licensed mismatch!"); + return true; + } + // Coerce user.id to be derived from the node number snprintf(p.id, sizeof(p.id), "!%08x", getFrom(&mp)); From 55fc4fcd9024df2f711bc797a467cea274e9ab4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 17 Jul 2025 00:40:29 +0200 Subject: [PATCH 018/180] clean up double i2c init/scan code (#7359) --- src/main.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 640f0b1fe..c37001307 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -515,25 +515,11 @@ void setup() LOG_INFO("Scan for i2c devices"); #endif -#if defined(I2C_SDA1) && defined(ARCH_RP2040) - Wire1.setSDA(I2C_SDA1); - Wire1.setSCL(I2C_SCL1); - Wire1.begin(); - i2cScanner->scanPort(ScanI2C::I2CPort::WIRE1); -#elif defined(I2C_SDA1) && !defined(ARCH_RP2040) - Wire1.begin(I2C_SDA1, I2C_SCL1); - i2cScanner->scanPort(ScanI2C::I2CPort::WIRE1); -#elif defined(NRF52840_XXAA) && (WIRE_INTERFACES_COUNT == 2) +#if defined(I2C_SDA1) || (defined(NRF52840_XXAA) && (WIRE_INTERFACES_COUNT == 2)) i2cScanner->scanPort(ScanI2C::I2CPort::WIRE1); #endif -#if defined(I2C_SDA) && defined(ARCH_RP2040) - Wire.setSDA(I2C_SDA); - Wire.setSCL(I2C_SCL); - Wire.begin(); - i2cScanner->scanPort(ScanI2C::I2CPort::WIRE); -#elif defined(I2C_SDA) && !defined(ARCH_RP2040) - Wire.begin(I2C_SDA, I2C_SCL); +#if defined(I2C_SDA) i2cScanner->scanPort(ScanI2C::I2CPort::WIRE); #elif defined(ARCH_PORTDUINO) if (settingsStrings[i2cdev] != "") { From 71b6508ad3a248360fe3d409eebdd44d1d3ad7b4 Mon Sep 17 00:00:00 2001 From: Jason P Date: Wed, 16 Jul 2025 19:44:23 -0500 Subject: [PATCH 019/180] BaseUI Updates (#7358) * Calculate the length of the right string and use it * Improve readability of Version Number * Prevent negative message IDs and proactively favorite DM'd nodes * Patch up Remove Favorite functionality * Fix warnings for TFT_MESH_* and hasSupportBrightness * Fix warning around casting variables * Correct Favorite Node Behavior to rebuild favorite nodes when updated. * Resolve bool kb_found issue not working for second discovery keyboards --------- Co-authored-by: Jonathan Bennett --- src/graphics/Screen.cpp | 2 ++ src/graphics/draw/DebugRenderer.cpp | 16 +++++++-- src/graphics/draw/MenuHandler.cpp | 17 ++++----- src/graphics/draw/NotificationRenderer.cpp | 2 +- src/graphics/draw/UIRenderer.cpp | 41 ++++++++++------------ src/graphics/draw/UIRenderer.h | 2 ++ src/input/cardKbI2cImpl.cpp | 1 + src/modules/CannedMessageModule.cpp | 8 ++++- 8 files changed, 52 insertions(+), 37 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index dbd0445f7..b9c9e2fbf 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -864,6 +864,8 @@ void Screen::setFrames(FrameFocus focus) uint8_t previousFrameCount = framesetInfo.frameCount; FramesetInfo fsi; // Location of specific frames, for applying focus parameter + graphics::UIRenderer::rebuildFavoritedNodes(); + LOG_DEBUG("Show standard frames"); showingNormalScreen = true; diff --git a/src/graphics/draw/DebugRenderer.cpp b/src/graphics/draw/DebugRenderer.cpp index b1a901f99..5420d1b4b 100644 --- a/src/graphics/draw/DebugRenderer.cpp +++ b/src/graphics/draw/DebugRenderer.cpp @@ -483,7 +483,7 @@ void drawLoRaFocused(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, } // **************************** -// * Memory Screen * +// * System Screen * // **************************** void drawMemoryUsage(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) { @@ -593,7 +593,19 @@ void drawMemoryUsage(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, } line += 1; char appversionstr[35]; - snprintf(appversionstr, sizeof(appversionstr), "Ver.: %s", optstr(APP_VERSION)); + snprintf(appversionstr, sizeof(appversionstr), "Ver: %s", optstr(APP_VERSION)); + char appversionstr_formatted[40]; + char *lastDot = strrchr(appversionstr, '.'); + if (lastDot) { + size_t prefixLen = lastDot - appversionstr; + strncpy(appversionstr_formatted, appversionstr, prefixLen); + appversionstr_formatted[prefixLen] = '\0'; + strncat(appversionstr_formatted, " (", sizeof(appversionstr_formatted) - strlen(appversionstr_formatted) - 1); + strncat(appversionstr_formatted, lastDot + 1, sizeof(appversionstr_formatted) - strlen(appversionstr_formatted) - 1); + strncat(appversionstr_formatted, ")", sizeof(appversionstr_formatted) - strlen(appversionstr_formatted) - 1); + strncpy(appversionstr, appversionstr_formatted, sizeof(appversionstr) - 1); + appversionstr[sizeof(appversionstr) - 1] = '\0'; + } int textWidth = display->getStringWidth(appversionstr); int nameX = (SCREEN_WIDTH - textWidth) / 2; display->drawString(nameX, getTextPositions(display)[line], appversionstr); diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index ded492da6..7ed9c4ea1 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -375,12 +375,6 @@ void menuHandler::textMessageBaseMenu() void menuHandler::systemBaseMenu() { - // Check if brightness is supported - bool hasSupportBrightness = false; -#if defined(ST7789_CS) || defined(USE_OLED) || defined(USE_SSD1306) || defined(USE_SH1106) || defined(USE_SH1107) || HAS_TFT - hasSupportBrightness = true; -#endif - enum optionsNumbers { Back, Notifications, ScreenOptions, PowerMenu, Test, enumEnd }; static const char *optionsArray[enumEnd] = {"Back"}; static int optionsEnumArray[enumEnd] = {Back}; @@ -450,11 +444,11 @@ void menuHandler::favoriteBaseMenu() bannerOptions.optionsEnumPtr = optionsEnumArray; bannerOptions.optionsCount = options; bannerOptions.bannerCallback = [](int selected) -> void { - if (selected == 1) { + if (selected == Preset) { cannedMessageModule->LaunchWithDestination(graphics::UIRenderer::currentFavoriteNodeNum); - } else if (selected == 2 && kb_found) { + } else if (selected == Freetext) { cannedMessageModule->LaunchFreetextWithDestination(graphics::UIRenderer::currentFavoriteNodeNum); - } else if ((!kb_found && selected == 2) || (selected == 3 && kb_found)) { + } else if (selected == Remove) { menuHandler::menuQueue = menuHandler::remove_favorite; screen->runNow(); } @@ -707,6 +701,7 @@ void menuHandler::TFTColorPickerMenu(OLEDDisplay *display) bannerOptions.optionsArrayPtr = optionsArray; bannerOptions.optionsCount = 10; bannerOptions.bannerCallback = [display](int selected) -> void { +#if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) || defined(T_DECK) || HAS_TFT uint8_t TFT_MESH_r = 0; uint8_t TFT_MESH_g = 0; uint8_t TFT_MESH_b = 0; @@ -758,7 +753,6 @@ void menuHandler::TFTColorPickerMenu(OLEDDisplay *display) screen->runNow(); } -#if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) || defined(T_DECK) || HAS_TFT if (selected != 0) { display->setColor(BLACK); display->fillRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); @@ -856,8 +850,9 @@ void menuHandler::removeFavoriteMenu() bannerOptions.optionsCount = 2; bannerOptions.bannerCallback = [](int selected) -> void { if (selected == 1) { + LOG_INFO("Removing %x as favorite node", graphics::UIRenderer::currentFavoriteNodeNum); nodeDB->set_favorite(false, graphics::UIRenderer::currentFavoriteNodeNum); - screen->setFrames(graphics::Screen::FOCUS_PRESERVE); + screen->setFrames(graphics::Screen::FOCUS_DEFAULT); } }; screen->showOverlayBanner(bannerOptions); diff --git a/src/graphics/draw/NotificationRenderer.cpp b/src/graphics/draw/NotificationRenderer.cpp index 7350c204f..d9cf280ac 100644 --- a/src/graphics/draw/NotificationRenderer.cpp +++ b/src/graphics/draw/NotificationRenderer.cpp @@ -156,7 +156,7 @@ void NotificationRenderer::drawNumberPicker(OLEDDisplay *display, OLEDDisplayUiS resetBanner(); return; } - if (curSelected == numDigits) { + if (curSelected == static_cast(numDigits)) { alertBannerCallback(currentNumber); resetBanner(); return; diff --git a/src/graphics/draw/UIRenderer.cpp b/src/graphics/draw/UIRenderer.cpp index 9be8b04f4..71d92616f 100644 --- a/src/graphics/draw/UIRenderer.cpp +++ b/src/graphics/draw/UIRenderer.cpp @@ -24,6 +24,23 @@ extern graphics::Screen *screen; namespace graphics { NodeNum UIRenderer::currentFavoriteNodeNum = 0; +std::vector graphics::UIRenderer::favoritedNodes; + +void graphics::UIRenderer::rebuildFavoritedNodes() +{ + favoritedNodes.clear(); + size_t total = nodeDB->getNumMeshNodes(); + for (size_t i = 0; i < total; i++) { + meshtastic_NodeInfoLite *n = nodeDB->getMeshNodeByIndex(i); + if (!n || n->num == nodeDB->getNodeNum()) + continue; + if (n->is_favorite) + favoritedNodes.push_back(n); + } + + std::sort(favoritedNodes.begin(), favoritedNodes.end(), + [](const meshtastic_NodeInfoLite *a, const meshtastic_NodeInfoLite *b) { return a->num < b->num; }); +} #if !MESHTASTIC_EXCLUDE_GPS // GeoCoord object for coordinate conversions @@ -201,27 +218,7 @@ void UIRenderer::drawNodes(OLEDDisplay *display, int16_t x, int16_t y, const mes // ********************** void UIRenderer::drawNodeInfo(OLEDDisplay *display, const OLEDDisplayUiState *state, int16_t x, int16_t y) { - // --- Cache favorite nodes for the current frame only, to save computation --- - static std::vector favoritedNodes; - static int prevFrame = -1; - // --- Only rebuild favorites list if we're on a new frame --- - if (state->currentFrame != prevFrame) { - prevFrame = state->currentFrame; - favoritedNodes.clear(); - size_t total = nodeDB->getNumMeshNodes(); - for (size_t i = 0; i < total; i++) { - meshtastic_NodeInfoLite *n = nodeDB->getMeshNodeByIndex(i); - // Skip nulls and ourself - if (!n || n->num == nodeDB->getNodeNum()) - continue; - if (n->is_favorite) - favoritedNodes.push_back(n); - } - // Keep a stable, consistent display order - std::sort(favoritedNodes.begin(), favoritedNodes.end(), - [](const meshtastic_NodeInfoLite *a, const meshtastic_NodeInfoLite *b) { return a->num < b->num; }); - } if (favoritedNodes.empty()) return; @@ -657,7 +654,7 @@ void UIRenderer::drawDeviceFocused(OLEDDisplay *display, OLEDDisplayUiState *sta char combinedName[50]; snprintf(combinedName, sizeof(combinedName), "%s (%s)", longNameStr.empty() ? "" : longNameStr.c_str(), shortnameble); - if (SCREEN_WIDTH - (display->getStringWidth(longName) + display->getStringWidth(shortnameble)) > 10) { + if (SCREEN_WIDTH - (display->getStringWidth(combinedName)) > 10) { size_t len = strlen(combinedName); if (len >= 3 && strcmp(combinedName + len - 3, " ()") == 0) { combinedName[len - 3] = '\0'; // Remove the last three characters @@ -668,7 +665,7 @@ void UIRenderer::drawDeviceFocused(OLEDDisplay *display, OLEDDisplayUiState *sta nameX, ((rows == 4) ? getTextPositions(display)[line++] : getTextPositions(display)[line++]) + yOffset, combinedName); } else { // === LongName Centered === - textWidth = display->getStringWidth(longName); + textWidth = display->getStringWidth(longNameStr.c_str()); nameX = (SCREEN_WIDTH - textWidth) / 2; display->drawString(nameX, getTextPositions(display)[line++], longNameStr.c_str()); diff --git a/src/graphics/draw/UIRenderer.h b/src/graphics/draw/UIRenderer.h index 9e5e8c4b4..3c8e1dd9d 100644 --- a/src/graphics/draw/UIRenderer.h +++ b/src/graphics/draw/UIRenderer.h @@ -61,6 +61,8 @@ class UIRenderer static void drawCompassAndLocationScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); static NodeNum currentFavoriteNodeNum; + static std::vector favoritedNodes; + static void rebuildFavoritedNodes(); // OEM screens #ifdef USERPREFS_OEM_TEXT diff --git a/src/input/cardKbI2cImpl.cpp b/src/input/cardKbI2cImpl.cpp index 21ecf381a..fcbdd0a3f 100644 --- a/src/input/cardKbI2cImpl.cpp +++ b/src/input/cardKbI2cImpl.cpp @@ -67,4 +67,5 @@ void CardKbI2cImpl::init() } #endif inputBroker->registerSource(this); + kb_found = true; } \ No newline at end of file diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index a1b89e0f8..2690c67f0 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -850,7 +850,13 @@ void CannedMessageModule::sendText(NodeNum dest, ChannelIndex channel, const cha this->waitingForAck = true; // Log outgoing message - LOG_INFO("Send message id=%d, dest=%x, msg=%.*s", p->id, p->to, p->decoded.payload.size, p->decoded.payload.bytes); + LOG_INFO("Send message id=%u, dest=%x, msg=%.*s", p->id, p->to, p->decoded.payload.size, p->decoded.payload.bytes); + + if (p->to != 0xffffffff) { + LOG_INFO("Proactively adding %x as favorite node", p->to); + nodeDB->set_favorite(true, p->to); + screen->setFrames(graphics::Screen::FOCUS_PRESERVE); + } // Send to mesh and phone (even if no phone connected, to track ACKs) service->sendToMesh(p, RX_SRC_LOCAL, true); From abe0a34fc0092937364c9045d7514a8ef568af74 Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Fri, 18 Jul 2025 20:49:19 +1000 Subject: [PATCH 020/180] Add additional Epoch check for time set (#7375) We have two perhapsSetRTC functions, which are called to set the time. The one with 3 parameters had a helpful check to reject an invalid time, by comparing the time from the source against when the firmware was compiled. The one with 2 parameters, which is called from the GPS lookForTime did not. As a result, certain GPS with bad time handling could set a time that was in the past. This patch adds the same epoch check code to the other perhapsSetRTC method. Fixes https://github.com/meshtastic/firmware/issues/7364 --- src/gps/RTC.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gps/RTC.cpp b/src/gps/RTC.cpp index 5054be3f0..c4d6065ff 100644 --- a/src/gps/RTC.cpp +++ b/src/gps/RTC.cpp @@ -228,6 +228,13 @@ RTCSetResult perhapsSetRTC(RTCQuality q, struct tm &t) tv.tv_sec = res; tv.tv_usec = 0; // time.centisecond() * (10 / 1000); +#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("Got time from GPS month=%d, year=%d, unixtime=%ld", t.tm_mon, t.tm_year, tv.tv_sec); if (t.tm_year < 0 || t.tm_year >= 300) { // LOG_DEBUG("Ignore invalid GPS month=%d, year=%d, unixtime=%ld", t.tm_mon, t.tm_year, tv.tv_sec); From cf574c71d8dbf6a28e279286b90deb7658e10bb4 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 18 Jul 2025 09:24:34 -0500 Subject: [PATCH 021/180] Fix build --- src/gps/RTC.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gps/RTC.cpp b/src/gps/RTC.cpp index c4d6065ff..d574c9ad0 100644 --- a/src/gps/RTC.cpp +++ b/src/gps/RTC.cpp @@ -226,10 +226,10 @@ RTCSetResult perhapsSetRTC(RTCQuality q, struct tm &t) time_t res = gm_mktime(&t); struct timeval tv; tv.tv_sec = res; - tv.tv_usec = 0; // time.centisecond() * (10 / 1000); - + tv.tv_usec = 0; // time.centisecond() * (10 / 1000); + 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) { + if (tv.tv_sec < BUILD_EPOCH) { LOG_WARN("Ignore time (%ld) before build epoch (%ld)!", printableEpoch, BUILD_EPOCH); return RTCSetResultInvalidTime; } From 3ca45ae99cac60073def445fcbed9787e9f1f5ac Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 19 Jul 2025 10:41:01 -0500 Subject: [PATCH 022/180] automated bumps (#7383) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- bin/org.meshtastic.meshtasticd.metainfo.xml | 3 +++ debian/changelog | 7 +++++-- version.properties | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/org.meshtastic.meshtasticd.metainfo.xml b/bin/org.meshtastic.meshtasticd.metainfo.xml index 291fe7a7c..116155807 100644 --- a/bin/org.meshtastic.meshtasticd.metainfo.xml +++ b/bin/org.meshtastic.meshtasticd.metainfo.xml @@ -87,6 +87,9 @@ + + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.4 + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.3 diff --git a/debian/changelog b/debian/changelog index b5009028a..02a32f2f1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -meshtasticd (2.7.3.0) UNRELEASED; urgency=medium +meshtasticd (2.7.4.0) UNRELEASED; urgency=medium [ Austin Lane ] * Initial packaging @@ -31,4 +31,7 @@ meshtasticd (2.7.3.0) UNRELEASED; urgency=medium [ Ubuntu ] * GitHub Actions Automatic version bump - -- Ubuntu Thu, 10 Jul 2025 16:29:27 +0000 + [ ] + * GitHub Actions Automatic version bump + + -- Sat, 19 Jul 2025 11:36:55 +0000 diff --git a/version.properties b/version.properties index 5de810523..aa959bcac 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 7 -build = 3 +build = 4 From 5d98f7e307941175f1fb658a168cc10fc6eeb147 Mon Sep 17 00:00:00 2001 From: Austin Date: Sat, 19 Jul 2025 12:38:05 -0400 Subject: [PATCH 023/180] Actions: Enforce PR labels (#7379) --- .github/workflows/pr_enforce_labels.yml | 24 ++++++++++++++++++++++++ .github/workflows/release_channels.yml | 3 ++- .github/workflows/update_protobufs.yml | 2 ++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pr_enforce_labels.yml diff --git a/.github/workflows/pr_enforce_labels.yml b/.github/workflows/pr_enforce_labels.yml new file mode 100644 index 000000000..93114e2c7 --- /dev/null +++ b/.github/workflows/pr_enforce_labels.yml @@ -0,0 +1,24 @@ +name: Check PR Labels + +on: + pull_request: + types: [opened, edited, labeled, unlabeled, synchronize, reopened] + +permissions: + pull-requests: read + contents: read + +jobs: + check-label: + runs-on: ubuntu-24.04 + steps: + - name: Check for PR labels + uses: actions/github-script@v7 + with: + script: | + const labels = context.payload.pull_request.labels.map(label => label.name); + const requiredLabels = ['bugfix', 'enhancement', 'hardware-support', 'dependencies', 'submodules', 'github_actions', 'trunk']; + const hasRequiredLabel = labels.some(label => requiredLabels.includes(label)); + if (!hasRequiredLabel) { + core.setFailed(`PR must have at least one of the following labels before it can be merged: ${requiredLabels.join(', ')}.`); + } diff --git a/.github/workflows/release_channels.yml b/.github/workflows/release_channels.yml index ef03be9dc..e52e67227 100644 --- a/.github/workflows/release_channels.yml +++ b/.github/workflows/release_channels.yml @@ -103,8 +103,9 @@ jobs: with: base: ${{ github.event.repository.default_branch }} branch: create-pull-request/bump-version + labels: github_actions title: Bump release version - commit-message: automated bumps + commit-message: Automated version bumps add-paths: | version.properties debian/changelog diff --git a/.github/workflows/update_protobufs.yml b/.github/workflows/update_protobufs.yml index ccdcc19ae..3952d9d02 100644 --- a/.github/workflows/update_protobufs.yml +++ b/.github/workflows/update_protobufs.yml @@ -34,7 +34,9 @@ jobs: uses: peter-evans/create-pull-request@v7 with: branch: create-pull-request/update-protobufs + labels: submodules title: Update protobufs and classes + commit-message: Update protobufs add-paths: | protobufs src/mesh From 974741a36640c36a6f62acfdce75cf54bd3f6c5e Mon Sep 17 00:00:00 2001 From: Austin Date: Sat, 19 Jul 2025 19:41:59 -0400 Subject: [PATCH 024/180] ESP32: Initial sort variants by platform (#7340) --- platformio.ini | 4 +- variants/diy/platformio.ini | 44 ------------------- .../betafpv_2400_tx_micro/platformio.ini | 4 +- .../betafpv_2400_tx_micro/variant.h | 0 .../betafpv_900_tx_nano/platformio.ini | 4 +- .../{ => esp32}/betafpv_900_tx_nano/variant.h | 0 variants/{ => esp32}/chatter2/platformio.ini | 2 +- variants/{ => esp32}/chatter2/variant.h | 0 variants/esp32/diy/dr-dev/platformio.ini | 11 +++++ variants/{ => esp32}/diy/dr-dev/variant.h | 0 variants/esp32/diy/hydra/platformio.ini | 8 ++++ variants/{ => esp32}/diy/hydra/variant.h | 0 variants/esp32/diy/v1/platformio.ini | 10 +++++ variants/{ => esp32}/diy/v1/variant.h | 0 variants/esp32/diy/v1_1/platformio.ini | 10 +++++ variants/{ => esp32}/diy/v1_1/variant.h | 0 .../hackerboxes_esp32_io/platformio.ini | 2 +- .../hackerboxes_esp32_io/variant.h | 0 variants/{ => esp32}/heltec_v1/platformio.ini | 4 +- variants/{ => esp32}/heltec_v1/variant.h | 0 .../{ => esp32}/heltec_v2.1/platformio.ini | 6 ++- variants/{ => esp32}/heltec_v2.1/variant.h | 0 variants/{ => esp32}/heltec_v2/platformio.ini | 4 +- variants/{ => esp32}/heltec_v2/variant.h | 0 .../heltec_wireless_bridge/platformio.ini | 2 +- .../heltec_wireless_bridge/variant.h | 0 .../heltec_wsl_v2.1/platformio.ini | 6 ++- .../{ => esp32}/heltec_wsl_v2.1/variant.h | 0 .../{ => esp32}/m5stack_core/pins_arduino.h | 0 .../{ => esp32}/m5stack_core/platformio.ini | 3 +- variants/{ => esp32}/m5stack_core/variant.h | 0 .../m5stack_coreink/pins_arduino.h | 0 .../m5stack_coreink/platformio.ini | 3 +- .../{ => esp32}/m5stack_coreink/variant.h | 0 .../nano-g1-explorer/platformio.ini | 4 +- .../{ => esp32}/nano-g1-explorer/variant.h | 0 variants/{ => esp32}/nano-g1/platformio.ini | 4 +- variants/{ => esp32}/nano-g1/variant.h | 0 .../radiomaster_900_bandit/platformio.ini | 2 +- .../radiomaster_900_bandit/variant.h | 0 .../platformio.ini | 4 +- .../platformio.ini | 4 +- .../radiomaster_900_bandit_nano/variant.h | 0 variants/{ => esp32}/rak11200/pins_arduino.h | 0 variants/{ => esp32}/rak11200/platformio.ini | 6 ++- variants/{ => esp32}/rak11200/variant.h | 0 .../{ => esp32}/station-g1/platformio.ini | 4 +- variants/{ => esp32}/station-g1/variant.h | 0 variants/{ => esp32}/tbeam/platformio.ini | 6 ++- variants/{ => esp32}/tbeam/variant.h | 0 variants/{ => esp32}/tbeam_v07/platformio.ini | 4 +- variants/{ => esp32}/tbeam_v07/variant.h | 0 variants/{ => esp32}/tlora_v1/platformio.ini | 6 ++- variants/{ => esp32}/tlora_v1/variant.h | 0 .../{ => esp32}/tlora_v1_3/platformio.ini | 4 +- variants/{ => esp32}/tlora_v1_3/variant.h | 0 variants/{ => esp32}/tlora_v2/platformio.ini | 4 +- variants/{ => esp32}/tlora_v2/variant.h | 0 .../{ => esp32}/tlora_v2_1_16/platformio.ini | 4 +- variants/{ => esp32}/tlora_v2_1_16/variant.h | 0 .../tlora_v2_1_16_tcxo/platformio.ini | 2 +- .../{ => esp32}/tlora_v2_1_18/platformio.ini | 4 +- variants/{ => esp32}/tlora_v2_1_18/variant.h | 0 .../tlora_v3_3_0_tcxo/platformio.ini | 2 +- variants/{ => esp32}/trackerd/platformio.ini | 2 +- variants/{ => esp32}/trackerd/variant.h | 0 variants/{ => esp32}/wiphone/pins_arduino.h | 0 variants/{ => esp32}/wiphone/platformio.ini | 4 +- variants/{ => esp32}/wiphone/variant.h | 0 69 files changed, 112 insertions(+), 85 deletions(-) rename variants/{ => esp32}/betafpv_2400_tx_micro/platformio.ini (81%) rename variants/{ => esp32}/betafpv_2400_tx_micro/variant.h (100%) rename variants/{ => esp32}/betafpv_900_tx_nano/platformio.ini (84%) rename variants/{ => esp32}/betafpv_900_tx_nano/variant.h (100%) rename variants/{ => esp32}/chatter2/platformio.ini (91%) rename variants/{ => esp32}/chatter2/variant.h (100%) create mode 100644 variants/esp32/diy/dr-dev/platformio.ini rename variants/{ => esp32}/diy/dr-dev/variant.h (100%) create mode 100644 variants/esp32/diy/hydra/platformio.ini rename variants/{ => esp32}/diy/hydra/variant.h (100%) create mode 100644 variants/esp32/diy/v1/platformio.ini rename variants/{ => esp32}/diy/v1/variant.h (100%) create mode 100644 variants/esp32/diy/v1_1/platformio.ini rename variants/{ => esp32}/diy/v1_1/variant.h (100%) rename variants/{ => esp32}/hackerboxes_esp32_io/platformio.ini (85%) rename variants/{ => esp32}/hackerboxes_esp32_io/variant.h (100%) rename variants/{ => esp32}/heltec_v1/platformio.ini (70%) rename variants/{ => esp32}/heltec_v1/variant.h (100%) rename variants/{ => esp32}/heltec_v2.1/platformio.ini (65%) rename variants/{ => esp32}/heltec_v2.1/variant.h (100%) rename variants/{ => esp32}/heltec_v2/platformio.ini (70%) rename variants/{ => esp32}/heltec_v2/variant.h (100%) rename variants/{ => esp32}/heltec_wireless_bridge/platformio.ini (94%) rename variants/{ => esp32}/heltec_wireless_bridge/variant.h (100%) rename variants/{ => esp32}/heltec_wsl_v2.1/platformio.ini (56%) rename variants/{ => esp32}/heltec_wsl_v2.1/variant.h (100%) rename variants/{ => esp32}/m5stack_core/pins_arduino.h (100%) rename variants/{ => esp32}/m5stack_core/platformio.ini (90%) rename variants/{ => esp32}/m5stack_core/variant.h (100%) rename variants/{ => esp32}/m5stack_coreink/pins_arduino.h (100%) rename variants/{ => esp32}/m5stack_coreink/platformio.ini (90%) rename variants/{ => esp32}/m5stack_coreink/variant.h (100%) rename variants/{ => esp32}/nano-g1-explorer/platformio.ini (65%) rename variants/{ => esp32}/nano-g1-explorer/variant.h (100%) rename variants/{ => esp32}/nano-g1/platformio.ini (67%) rename variants/{ => esp32}/nano-g1/variant.h (100%) rename variants/{ => esp32}/radiomaster_900_bandit/platformio.ini (90%) rename variants/{ => esp32}/radiomaster_900_bandit/variant.h (100%) rename variants/{ => esp32}/radiomaster_900_bandit_micro/platformio.ini (87%) rename variants/{ => esp32}/radiomaster_900_bandit_nano/platformio.ini (79%) rename variants/{ => esp32}/radiomaster_900_bandit_nano/variant.h (100%) rename variants/{ => esp32}/rak11200/pins_arduino.h (100%) rename variants/{ => esp32}/rak11200/platformio.ini (50%) rename variants/{ => esp32}/rak11200/variant.h (100%) rename variants/{ => esp32}/station-g1/platformio.ini (66%) rename variants/{ => esp32}/station-g1/variant.h (100%) rename variants/{ => esp32}/tbeam/platformio.ini (78%) rename variants/{ => esp32}/tbeam/variant.h (100%) rename variants/{ => esp32}/tbeam_v07/platformio.ini (69%) rename variants/{ => esp32}/tbeam_v07/variant.h (100%) rename variants/{ => esp32}/tlora_v1/platformio.ini (50%) rename variants/{ => esp32}/tlora_v1/variant.h (100%) rename variants/{ => esp32}/tlora_v1_3/platformio.ini (50%) rename variants/{ => esp32}/tlora_v1_3/variant.h (100%) rename variants/{ => esp32}/tlora_v2/platformio.ini (56%) rename variants/{ => esp32}/tlora_v2/variant.h (100%) rename variants/{ => esp32}/tlora_v2_1_16/platformio.ini (68%) rename variants/{ => esp32}/tlora_v2_1_16/variant.h (100%) rename variants/{ => esp32}/tlora_v2_1_16_tcxo/platformio.ini (90%) rename variants/{ => esp32}/tlora_v2_1_18/platformio.ini (55%) rename variants/{ => esp32}/tlora_v2_1_18/variant.h (100%) rename variants/{ => esp32}/tlora_v3_3_0_tcxo/platformio.ini (89%) rename variants/{ => esp32}/trackerd/platformio.ini (56%) rename variants/{ => esp32}/trackerd/variant.h (100%) rename variants/{ => esp32}/wiphone/pins_arduino.h (100%) rename variants/{ => esp32}/wiphone/platformio.ini (81%) rename variants/{ => esp32}/wiphone/variant.h (100%) diff --git a/platformio.ini b/platformio.ini index b1f89e5b4..c0eb6fedb 100644 --- a/platformio.ini +++ b/platformio.ini @@ -6,7 +6,9 @@ default_envs = tbeam extra_configs = arch/*/*.ini - variants/*/platformio.ini + variants/*/platformio.ini ; Remove when all variants migrated to new dir structure + variants/*/*/platformio.ini + variants/*/diy/*/platformio.ini src/graphics/niche/InkHUD/PlatformioConfig.ini description = Meshtastic diff --git a/variants/diy/platformio.ini b/variants/diy/platformio.ini index 1f0f6d126..fddfb154e 100644 --- a/variants/diy/platformio.ini +++ b/variants/diy/platformio.ini @@ -1,47 +1,3 @@ -; Meshtastic DIY v1 by Nano VHF Schematic based on ESP32-WROOM-32 (38 pins) devkit & EBYTE E22 SX1262/SX1268 module -[env:meshtastic-diy-v1] -extends = esp32_base -board = esp32doit-devkit-v1 -board_check = true -build_flags = - ${esp32_base.build_flags} - -D DIY_V1 - -D EBYTE_E22 - -I variants/diy/v1 - -; Meshtastic DIY v1.1 new schematic based on ESP32-WROOM-32 & SX1262/SX1268 modules -[env:meshtastic-diy-v1_1] -extends = esp32_base -board = esp32doit-devkit-v1 -board_level = extra -build_flags = - ${esp32_base.build_flags} - -D DIY_V1 - -D EBYTE_E22 - -I variants/diy/v1_1 - -; Port to Disaster Radio's ESP32-v3 Dev Board -[env:meshtastic-dr-dev] -extends = esp32_base -board = esp32doit-devkit-v1 -board_upload.maximum_size = 4194304 -board_upload.maximum_ram_size = 532480 -build_flags = - ${esp32_base.build_flags} - -D DR_DEV - -D EBYTE_E22 - -I variants/diy/dr-dev - -; Hydra - Meshtastic DIY v1 hardware with some specific changes -[env:hydra] -extends = esp32_base -board = esp32doit-devkit-v1 -build_flags = - ${esp32_base.build_flags} - -D DIY_V1 - -I variants/diy/hydra - - ; Promicro + E22(0)-xxxMM / RA-01SH modules board variant - DIY - without TCXO [env:nrf52_promicro_diy_xtal] extends = nrf52840_base diff --git a/variants/betafpv_2400_tx_micro/platformio.ini b/variants/esp32/betafpv_2400_tx_micro/platformio.ini similarity index 81% rename from variants/betafpv_2400_tx_micro/platformio.ini rename to variants/esp32/betafpv_2400_tx_micro/platformio.ini index 531e8532d..4d163d834 100644 --- a/variants/betafpv_2400_tx_micro/platformio.ini +++ b/variants/esp32/betafpv_2400_tx_micro/platformio.ini @@ -8,11 +8,11 @@ build_flags = -D VTABLES_IN_FLASH=1 -D CONFIG_DISABLE_HAL_LOCKS=1 -O2 - -I variants/betafpv_2400_tx_micro + -I variants/esp32/betafpv_2400_tx_micro board_build.f_cpu = 240000000L upload_protocol = esptool ;upload_port = /dev/ttyUSB0 upload_speed = 460800 lib_deps = ${esp32_base.lib_deps} - adafruit/Adafruit NeoPixel @ ^1.12.0 \ No newline at end of file + adafruit/Adafruit NeoPixel @ ^1.12.0 diff --git a/variants/betafpv_2400_tx_micro/variant.h b/variants/esp32/betafpv_2400_tx_micro/variant.h similarity index 100% rename from variants/betafpv_2400_tx_micro/variant.h rename to variants/esp32/betafpv_2400_tx_micro/variant.h diff --git a/variants/betafpv_900_tx_nano/platformio.ini b/variants/esp32/betafpv_900_tx_nano/platformio.ini similarity index 84% rename from variants/betafpv_900_tx_nano/platformio.ini rename to variants/esp32/betafpv_900_tx_nano/platformio.ini index 3bea16f6b..7e01fd2fa 100644 --- a/variants/betafpv_900_tx_nano/platformio.ini +++ b/variants/esp32/betafpv_900_tx_nano/platformio.ini @@ -8,10 +8,10 @@ build_flags = -D VTABLES_IN_FLASH=1 -D CONFIG_DISABLE_HAL_LOCKS=1 -O2 - -I variants/betafpv_900_tx_nano + -I variants/esp32/betafpv_900_tx_nano board_build.f_cpu = 240000000L upload_protocol = esptool ;upload_port = /dev/ttyUSB0 upload_speed = 460800 lib_deps = - ${esp32_base.lib_deps} \ No newline at end of file + ${esp32_base.lib_deps} diff --git a/variants/betafpv_900_tx_nano/variant.h b/variants/esp32/betafpv_900_tx_nano/variant.h similarity index 100% rename from variants/betafpv_900_tx_nano/variant.h rename to variants/esp32/betafpv_900_tx_nano/variant.h diff --git a/variants/chatter2/platformio.ini b/variants/esp32/chatter2/platformio.ini similarity index 91% rename from variants/chatter2/platformio.ini rename to variants/esp32/chatter2/platformio.ini index 83e00d0c4..bf496bf26 100644 --- a/variants/chatter2/platformio.ini +++ b/variants/esp32/chatter2/platformio.ini @@ -5,7 +5,7 @@ board = esp32doit-devkit-v1 build_flags = ${esp32_base.build_flags} -D CHATTER_2 - -I variants/chatter2 + -I variants/esp32/chatter2 lib_deps = ${esp32_base.lib_deps} diff --git a/variants/chatter2/variant.h b/variants/esp32/chatter2/variant.h similarity index 100% rename from variants/chatter2/variant.h rename to variants/esp32/chatter2/variant.h diff --git a/variants/esp32/diy/dr-dev/platformio.ini b/variants/esp32/diy/dr-dev/platformio.ini new file mode 100644 index 000000000..5461d27b3 --- /dev/null +++ b/variants/esp32/diy/dr-dev/platformio.ini @@ -0,0 +1,11 @@ +; Port to Disaster Radio's ESP32-v3 Dev Board +[env:meshtastic-dr-dev] +extends = esp32_base +board = esp32doit-devkit-v1 +board_upload.maximum_size = 4194304 +board_upload.maximum_ram_size = 532480 +build_flags = + ${esp32_base.build_flags} + -D DR_DEV + -D EBYTE_E22 + -I variants/esp32/diy/dr-dev diff --git a/variants/diy/dr-dev/variant.h b/variants/esp32/diy/dr-dev/variant.h similarity index 100% rename from variants/diy/dr-dev/variant.h rename to variants/esp32/diy/dr-dev/variant.h diff --git a/variants/esp32/diy/hydra/platformio.ini b/variants/esp32/diy/hydra/platformio.ini new file mode 100644 index 000000000..a922ed874 --- /dev/null +++ b/variants/esp32/diy/hydra/platformio.ini @@ -0,0 +1,8 @@ +; Hydra - Meshtastic DIY v1 hardware with some specific changes +[env:hydra] +extends = esp32_base +board = esp32doit-devkit-v1 +build_flags = + ${esp32_base.build_flags} + -D DIY_V1 + -I variants/esp32/diy/hydra diff --git a/variants/diy/hydra/variant.h b/variants/esp32/diy/hydra/variant.h similarity index 100% rename from variants/diy/hydra/variant.h rename to variants/esp32/diy/hydra/variant.h diff --git a/variants/esp32/diy/v1/platformio.ini b/variants/esp32/diy/v1/platformio.ini new file mode 100644 index 000000000..bcbd57cfa --- /dev/null +++ b/variants/esp32/diy/v1/platformio.ini @@ -0,0 +1,10 @@ +; Meshtastic DIY v1 by Nano VHF Schematic based on ESP32-WROOM-32 (38 pins) devkit & EBYTE E22 SX1262/SX1268 module +[env:meshtastic-diy-v1] +extends = esp32_base +board = esp32doit-devkit-v1 +board_check = true +build_flags = + ${esp32_base.build_flags} + -D DIY_V1 + -D EBYTE_E22 + -I variants/esp32/diy/v1 diff --git a/variants/diy/v1/variant.h b/variants/esp32/diy/v1/variant.h similarity index 100% rename from variants/diy/v1/variant.h rename to variants/esp32/diy/v1/variant.h diff --git a/variants/esp32/diy/v1_1/platformio.ini b/variants/esp32/diy/v1_1/platformio.ini new file mode 100644 index 000000000..1431bd4c8 --- /dev/null +++ b/variants/esp32/diy/v1_1/platformio.ini @@ -0,0 +1,10 @@ +; Meshtastic DIY v1.1 new schematic based on ESP32-WROOM-32 & SX1262/SX1268 modules +[env:meshtastic-diy-v1_1] +extends = esp32_base +board = esp32doit-devkit-v1 +board_level = extra +build_flags = + ${esp32_base.build_flags} + -D DIY_V1 + -D EBYTE_E22 + -I variants/esp32/diy/v1_1 diff --git a/variants/diy/v1_1/variant.h b/variants/esp32/diy/v1_1/variant.h similarity index 100% rename from variants/diy/v1_1/variant.h rename to variants/esp32/diy/v1_1/variant.h diff --git a/variants/hackerboxes_esp32_io/platformio.ini b/variants/esp32/hackerboxes_esp32_io/platformio.ini similarity index 85% rename from variants/hackerboxes_esp32_io/platformio.ini rename to variants/esp32/hackerboxes_esp32_io/platformio.ini index f024dac3e..fc5f6701c 100644 --- a/variants/hackerboxes_esp32_io/platformio.ini +++ b/variants/esp32/hackerboxes_esp32_io/platformio.ini @@ -5,7 +5,7 @@ board_level = extra build_flags = ${esp32_base.build_flags} -D PRIVATE_HW - -I variants/hackerboxes_esp32_io + -I variants/esp32/hackerboxes_esp32_io monitor_speed = 115200 upload_protocol = esptool ;upload_port = /dev/ttyUSB0 diff --git a/variants/hackerboxes_esp32_io/variant.h b/variants/esp32/hackerboxes_esp32_io/variant.h similarity index 100% rename from variants/hackerboxes_esp32_io/variant.h rename to variants/esp32/hackerboxes_esp32_io/variant.h diff --git a/variants/heltec_v1/platformio.ini b/variants/esp32/heltec_v1/platformio.ini similarity index 70% rename from variants/heltec_v1/platformio.ini rename to variants/esp32/heltec_v1/platformio.ini index ee10ef0f6..4be3ba655 100644 --- a/variants/heltec_v1/platformio.ini +++ b/variants/esp32/heltec_v1/platformio.ini @@ -4,4 +4,6 @@ extends = esp32_base board_level = extra board = heltec_wifi_lora_32 build_flags = - ${esp32_base.build_flags} -D HELTEC_V1 -I variants/heltec_v1 \ No newline at end of file + ${esp32_base.build_flags} + -D HELTEC_V1 + -I variants/esp32/heltec_v1 diff --git a/variants/heltec_v1/variant.h b/variants/esp32/heltec_v1/variant.h similarity index 100% rename from variants/heltec_v1/variant.h rename to variants/esp32/heltec_v1/variant.h diff --git a/variants/heltec_v2.1/platformio.ini b/variants/esp32/heltec_v2.1/platformio.ini similarity index 65% rename from variants/heltec_v2.1/platformio.ini rename to variants/esp32/heltec_v2.1/platformio.ini index ea2281911..763f9764c 100644 --- a/variants/heltec_v2.1/platformio.ini +++ b/variants/esp32/heltec_v2.1/platformio.ini @@ -4,5 +4,7 @@ board_level = extra extends = esp32_base board = heltec_wifi_lora_32_V2 build_flags = - ${esp32_base.build_flags} -D HELTEC_V2_1 -I variants/heltec_v2.1 - -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. \ No newline at end of file + ${esp32_base.build_flags} + -D HELTEC_V2_1 + -I variants/esp32/heltec_v2.1 + -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. diff --git a/variants/heltec_v2.1/variant.h b/variants/esp32/heltec_v2.1/variant.h similarity index 100% rename from variants/heltec_v2.1/variant.h rename to variants/esp32/heltec_v2.1/variant.h diff --git a/variants/heltec_v2/platformio.ini b/variants/esp32/heltec_v2/platformio.ini similarity index 70% rename from variants/heltec_v2/platformio.ini rename to variants/esp32/heltec_v2/platformio.ini index c81bca8ba..ed455616d 100644 --- a/variants/heltec_v2/platformio.ini +++ b/variants/esp32/heltec_v2/platformio.ini @@ -4,4 +4,6 @@ board_level = extra extends = esp32_base board = heltec_wifi_lora_32_V2 build_flags = - ${esp32_base.build_flags} -D HELTEC_V2_0 -I variants/heltec_v2 \ No newline at end of file + ${esp32_base.build_flags} + -D HELTEC_V2_0 + -I variants/esp32/heltec_v2 diff --git a/variants/heltec_v2/variant.h b/variants/esp32/heltec_v2/variant.h similarity index 100% rename from variants/heltec_v2/variant.h rename to variants/esp32/heltec_v2/variant.h diff --git a/variants/heltec_wireless_bridge/platformio.ini b/variants/esp32/heltec_wireless_bridge/platformio.ini similarity index 94% rename from variants/heltec_wireless_bridge/platformio.ini rename to variants/esp32/heltec_wireless_bridge/platformio.ini index ab30eb744..60e686f9e 100644 --- a/variants/heltec_wireless_bridge/platformio.ini +++ b/variants/esp32/heltec_wireless_bridge/platformio.ini @@ -4,7 +4,7 @@ extends = esp32_base board = heltec_wifi_lora_32 build_flags = ${esp32_base.build_flags} - -I variants/heltec_wireless_bridge + -I variants/esp32/heltec_wireless_bridge -D HELTEC_WIRELESS_BRIDGE -D BOARD_HAS_PSRAM -D RADIOLIB_EXCLUDE_LR11X0=1 diff --git a/variants/heltec_wireless_bridge/variant.h b/variants/esp32/heltec_wireless_bridge/variant.h similarity index 100% rename from variants/heltec_wireless_bridge/variant.h rename to variants/esp32/heltec_wireless_bridge/variant.h diff --git a/variants/heltec_wsl_v2.1/platformio.ini b/variants/esp32/heltec_wsl_v2.1/platformio.ini similarity index 56% rename from variants/heltec_wsl_v2.1/platformio.ini rename to variants/esp32/heltec_wsl_v2.1/platformio.ini index f4fff9698..eb44c88d2 100644 --- a/variants/heltec_wsl_v2.1/platformio.ini +++ b/variants/esp32/heltec_wsl_v2.1/platformio.ini @@ -3,5 +3,7 @@ extends = esp32_base board = heltec_wireless_stick_lite board_level = extra build_flags = - ${esp32_base.build_flags} -D PRIVATE_HW -I variants/heltec_wsl_v2.1 - -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. \ No newline at end of file + ${esp32_base.build_flags} + -D PRIVATE_HW + -I variants/esp32/heltec_wsl_v2.1 + -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. diff --git a/variants/heltec_wsl_v2.1/variant.h b/variants/esp32/heltec_wsl_v2.1/variant.h similarity index 100% rename from variants/heltec_wsl_v2.1/variant.h rename to variants/esp32/heltec_wsl_v2.1/variant.h diff --git a/variants/m5stack_core/pins_arduino.h b/variants/esp32/m5stack_core/pins_arduino.h similarity index 100% rename from variants/m5stack_core/pins_arduino.h rename to variants/esp32/m5stack_core/pins_arduino.h diff --git a/variants/m5stack_core/platformio.ini b/variants/esp32/m5stack_core/platformio.ini similarity index 90% rename from variants/m5stack_core/platformio.ini rename to variants/esp32/m5stack_core/platformio.ini index 7418d9e17..469d93f94 100644 --- a/variants/m5stack_core/platformio.ini +++ b/variants/esp32/m5stack_core/platformio.ini @@ -5,7 +5,8 @@ monitor_filters = esp32_exception_decoder build_src_filter = ${esp32_base.build_src_filter} build_flags = - ${esp32_base.build_flags} -I variants/m5stack_core + ${esp32_base.build_flags} + -I variants/esp32/m5stack_core -DILI9341_DRIVER -DM5STACK -DUSER_SETUP_LOADED diff --git a/variants/m5stack_core/variant.h b/variants/esp32/m5stack_core/variant.h similarity index 100% rename from variants/m5stack_core/variant.h rename to variants/esp32/m5stack_core/variant.h diff --git a/variants/m5stack_coreink/pins_arduino.h b/variants/esp32/m5stack_coreink/pins_arduino.h similarity index 100% rename from variants/m5stack_coreink/pins_arduino.h rename to variants/esp32/m5stack_coreink/pins_arduino.h diff --git a/variants/m5stack_coreink/platformio.ini b/variants/esp32/m5stack_coreink/platformio.ini similarity index 90% rename from variants/m5stack_coreink/platformio.ini rename to variants/esp32/m5stack_coreink/platformio.ini index 70da53379..1a00788e3 100644 --- a/variants/m5stack_coreink/platformio.ini +++ b/variants/esp32/m5stack_coreink/platformio.ini @@ -5,7 +5,8 @@ board_check = true build_src_filter = ${esp32_base.build_src_filter} build_flags = - ${esp32_base.build_flags} -I variants/m5stack_coreink + ${esp32_base.build_flags} + -I variants/esp32/m5stack_coreink ;-D RADIOLIB_VERBOSE -Ofast -D__MCUXPRESSO diff --git a/variants/m5stack_coreink/variant.h b/variants/esp32/m5stack_coreink/variant.h similarity index 100% rename from variants/m5stack_coreink/variant.h rename to variants/esp32/m5stack_coreink/variant.h diff --git a/variants/nano-g1-explorer/platformio.ini b/variants/esp32/nano-g1-explorer/platformio.ini similarity index 65% rename from variants/nano-g1-explorer/platformio.ini rename to variants/esp32/nano-g1-explorer/platformio.ini index 22037cbc9..2ba1f49e9 100644 --- a/variants/nano-g1-explorer/platformio.ini +++ b/variants/esp32/nano-g1-explorer/platformio.ini @@ -5,4 +5,6 @@ board = ttgo-t-beam lib_deps = ${esp32_base.lib_deps} build_flags = - ${esp32_base.build_flags} -D NANO_G1_EXPLORER -I variants/nano-g1-explorer \ No newline at end of file + ${esp32_base.build_flags} + -D NANO_G1_EXPLORER + -I variants/esp32/nano-g1-explorer diff --git a/variants/nano-g1-explorer/variant.h b/variants/esp32/nano-g1-explorer/variant.h similarity index 100% rename from variants/nano-g1-explorer/variant.h rename to variants/esp32/nano-g1-explorer/variant.h diff --git a/variants/nano-g1/platformio.ini b/variants/esp32/nano-g1/platformio.ini similarity index 67% rename from variants/nano-g1/platformio.ini rename to variants/esp32/nano-g1/platformio.ini index a3107423e..be8227de2 100644 --- a/variants/nano-g1/platformio.ini +++ b/variants/esp32/nano-g1/platformio.ini @@ -5,4 +5,6 @@ board = ttgo-t-beam lib_deps = ${esp32_base.lib_deps} build_flags = - ${esp32_base.build_flags} -D NANO_G1 -I variants/nano-g1 \ No newline at end of file + ${esp32_base.build_flags} + -D NANO_G1 + -I variants/esp32/nano-g1 diff --git a/variants/nano-g1/variant.h b/variants/esp32/nano-g1/variant.h similarity index 100% rename from variants/nano-g1/variant.h rename to variants/esp32/nano-g1/variant.h diff --git a/variants/radiomaster_900_bandit/platformio.ini b/variants/esp32/radiomaster_900_bandit/platformio.ini similarity index 90% rename from variants/radiomaster_900_bandit/platformio.ini rename to variants/esp32/radiomaster_900_bandit/platformio.ini index f87025937..d9eb78a57 100644 --- a/variants/radiomaster_900_bandit/platformio.ini +++ b/variants/esp32/radiomaster_900_bandit/platformio.ini @@ -8,7 +8,7 @@ build_flags = -DCONFIG_DISABLE_HAL_LOCKS=1 -DHAS_STK8XXX=1 -O2 - -Ivariants/radiomaster_900_bandit + -I variants/esp32/radiomaster_900_bandit board_build.f_cpu = 240000000L upload_protocol = esptool lib_deps = diff --git a/variants/radiomaster_900_bandit/variant.h b/variants/esp32/radiomaster_900_bandit/variant.h similarity index 100% rename from variants/radiomaster_900_bandit/variant.h rename to variants/esp32/radiomaster_900_bandit/variant.h diff --git a/variants/radiomaster_900_bandit_micro/platformio.ini b/variants/esp32/radiomaster_900_bandit_micro/platformio.ini similarity index 87% rename from variants/radiomaster_900_bandit_micro/platformio.ini rename to variants/esp32/radiomaster_900_bandit_micro/platformio.ini index 9e54f5859..36a45787b 100644 --- a/variants/radiomaster_900_bandit_micro/platformio.ini +++ b/variants/esp32/radiomaster_900_bandit_micro/platformio.ini @@ -12,8 +12,8 @@ build_flags = -DVTABLES_IN_FLASH=1 -DCONFIG_DISABLE_HAL_LOCKS=1 -O2 - -Ivariants/radiomaster_900_bandit_nano + -I variants/esp32/radiomaster_900_bandit_nano board_build.f_cpu = 240000000L upload_protocol = esptool lib_deps = - ${esp32_base.lib_deps} \ No newline at end of file + ${esp32_base.lib_deps} diff --git a/variants/radiomaster_900_bandit_nano/platformio.ini b/variants/esp32/radiomaster_900_bandit_nano/platformio.ini similarity index 79% rename from variants/radiomaster_900_bandit_nano/platformio.ini rename to variants/esp32/radiomaster_900_bandit_nano/platformio.ini index 0d43b8665..9a7fad83b 100644 --- a/variants/radiomaster_900_bandit_nano/platformio.ini +++ b/variants/esp32/radiomaster_900_bandit_nano/platformio.ini @@ -7,8 +7,8 @@ build_flags = -DVTABLES_IN_FLASH=1 -DCONFIG_DISABLE_HAL_LOCKS=1 -O2 - -Ivariants/radiomaster_900_bandit_nano + -I variants/esp32/radiomaster_900_bandit_nano board_build.f_cpu = 240000000L upload_protocol = esptool lib_deps = - ${esp32_base.lib_deps} \ No newline at end of file + ${esp32_base.lib_deps} diff --git a/variants/radiomaster_900_bandit_nano/variant.h b/variants/esp32/radiomaster_900_bandit_nano/variant.h similarity index 100% rename from variants/radiomaster_900_bandit_nano/variant.h rename to variants/esp32/radiomaster_900_bandit_nano/variant.h diff --git a/variants/rak11200/pins_arduino.h b/variants/esp32/rak11200/pins_arduino.h similarity index 100% rename from variants/rak11200/pins_arduino.h rename to variants/esp32/rak11200/pins_arduino.h diff --git a/variants/rak11200/platformio.ini b/variants/esp32/rak11200/platformio.ini similarity index 50% rename from variants/rak11200/platformio.ini rename to variants/esp32/rak11200/platformio.ini index eddc3458e..6149333f6 100644 --- a/variants/rak11200/platformio.ini +++ b/variants/esp32/rak11200/platformio.ini @@ -3,5 +3,7 @@ extends = esp32_base board = wiscore_rak11200 board_check = true build_flags = - ${esp32_base.build_flags} -D RAK_11200 -I variants/rak11200 -upload_speed = 115200 \ No newline at end of file + ${esp32_base.build_flags} + -D RAK_11200 + -I variants/esp32/rak11200 +upload_speed = 115200 diff --git a/variants/rak11200/variant.h b/variants/esp32/rak11200/variant.h similarity index 100% rename from variants/rak11200/variant.h rename to variants/esp32/rak11200/variant.h diff --git a/variants/station-g1/platformio.ini b/variants/esp32/station-g1/platformio.ini similarity index 66% rename from variants/station-g1/platformio.ini rename to variants/esp32/station-g1/platformio.ini index a466414d0..693a41ae8 100644 --- a/variants/station-g1/platformio.ini +++ b/variants/esp32/station-g1/platformio.ini @@ -5,4 +5,6 @@ board = ttgo-t-beam lib_deps = ${esp32_base.lib_deps} build_flags = - ${esp32_base.build_flags} -D STATION_G1 -I variants/station-g1 \ No newline at end of file + ${esp32_base.build_flags} + -D STATION_G1 + -I variants/esp32/station-g1 diff --git a/variants/station-g1/variant.h b/variants/esp32/station-g1/variant.h similarity index 100% rename from variants/station-g1/variant.h rename to variants/esp32/station-g1/variant.h diff --git a/variants/tbeam/platformio.ini b/variants/esp32/tbeam/platformio.ini similarity index 78% rename from variants/tbeam/platformio.ini rename to variants/esp32/tbeam/platformio.ini index 9049836a3..084a981da 100644 --- a/variants/tbeam/platformio.ini +++ b/variants/esp32/tbeam/platformio.ini @@ -6,8 +6,10 @@ board_check = true lib_deps = ${esp32_base.lib_deps} build_flags = - ${esp32_base.build_flags} -D TBEAM_V10 -I variants/tbeam + ${esp32_base.build_flags} + -D TBEAM_V10 + -I variants/esp32/tbeam -DGPS_POWER_TOGGLE ; comment this line to disable double press function on the user button to turn off gps entirely. -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -upload_speed = 921600 \ No newline at end of file +upload_speed = 921600 diff --git a/variants/tbeam/variant.h b/variants/esp32/tbeam/variant.h similarity index 100% rename from variants/tbeam/variant.h rename to variants/esp32/tbeam/variant.h diff --git a/variants/tbeam_v07/platformio.ini b/variants/esp32/tbeam_v07/platformio.ini similarity index 69% rename from variants/tbeam_v07/platformio.ini rename to variants/esp32/tbeam_v07/platformio.ini index 0cba92400..1647d9fd7 100644 --- a/variants/tbeam_v07/platformio.ini +++ b/variants/esp32/tbeam_v07/platformio.ini @@ -4,4 +4,6 @@ board_level = extra extends = esp32_base board = ttgo-t-beam build_flags = - ${esp32_base.build_flags} -D TBEAM_V07 -I variants/tbeam_v07 \ No newline at end of file + ${esp32_base.build_flags} + -D TBEAM_V07 + -I variants/esp32/tbeam_v07 diff --git a/variants/tbeam_v07/variant.h b/variants/esp32/tbeam_v07/variant.h similarity index 100% rename from variants/tbeam_v07/variant.h rename to variants/esp32/tbeam_v07/variant.h diff --git a/variants/tlora_v1/platformio.ini b/variants/esp32/tlora_v1/platformio.ini similarity index 50% rename from variants/tlora_v1/platformio.ini rename to variants/esp32/tlora_v1/platformio.ini index 17fc71d72..1d879b6b0 100644 --- a/variants/tlora_v1/platformio.ini +++ b/variants/esp32/tlora_v1/platformio.ini @@ -3,5 +3,7 @@ board_level = extra extends = esp32_base board = ttgo-lora32-v1 build_flags = - ${esp32_base.build_flags} -D TLORA_V1 -I variants/tlora_v1 -upload_speed = 115200 \ No newline at end of file + ${esp32_base.build_flags} + -D TLORA_V1 + -I variants/esp32/tlora_v1 +upload_speed = 115200 diff --git a/variants/tlora_v1/variant.h b/variants/esp32/tlora_v1/variant.h similarity index 100% rename from variants/tlora_v1/variant.h rename to variants/esp32/tlora_v1/variant.h diff --git a/variants/tlora_v1_3/platformio.ini b/variants/esp32/tlora_v1_3/platformio.ini similarity index 50% rename from variants/tlora_v1_3/platformio.ini rename to variants/esp32/tlora_v1_3/platformio.ini index c5eca589f..523c38a80 100644 --- a/variants/tlora_v1_3/platformio.ini +++ b/variants/esp32/tlora_v1_3/platformio.ini @@ -3,5 +3,5 @@ board_level = extra extends = esp32_base board = ttgo-lora32-v1 build_flags = - ${esp32_base.build_flags} -D TLORA_V1_3 -I variants/tlora_v1_3 -upload_speed = 115200 \ No newline at end of file + ${esp32_base.build_flags} -D TLORA_V1_3 -I variants/esp32/tlora_v1_3 +upload_speed = 115200 diff --git a/variants/tlora_v1_3/variant.h b/variants/esp32/tlora_v1_3/variant.h similarity index 100% rename from variants/tlora_v1_3/variant.h rename to variants/esp32/tlora_v1_3/variant.h diff --git a/variants/tlora_v2/platformio.ini b/variants/esp32/tlora_v2/platformio.ini similarity index 56% rename from variants/tlora_v2/platformio.ini rename to variants/esp32/tlora_v2/platformio.ini index 8087a30e3..4a710ee34 100644 --- a/variants/tlora_v2/platformio.ini +++ b/variants/esp32/tlora_v2/platformio.ini @@ -3,4 +3,6 @@ board_level = extra extends = esp32_base board = ttgo-lora32-v1 build_flags = - ${esp32_base.build_flags} -D TLORA_V2 -I variants/tlora_v2 \ No newline at end of file + ${esp32_base.build_flags} + -D TLORA_V2 + -I variants/esp32/tlora_v2 diff --git a/variants/tlora_v2/variant.h b/variants/esp32/tlora_v2/variant.h similarity index 100% rename from variants/tlora_v2/variant.h rename to variants/esp32/tlora_v2/variant.h diff --git a/variants/tlora_v2_1_16/platformio.ini b/variants/esp32/tlora_v2_1_16/platformio.ini similarity index 68% rename from variants/tlora_v2_1_16/platformio.ini rename to variants/esp32/tlora_v2_1_16/platformio.ini index 4253cc6af..bd85aa847 100644 --- a/variants/tlora_v2_1_16/platformio.ini +++ b/variants/esp32/tlora_v2_1_16/platformio.ini @@ -3,6 +3,6 @@ extends = esp32_base board = ttgo-lora32-v21 board_check = true build_flags = - ${esp32_base.build_flags} -D TLORA_V2_1_16 -I variants/tlora_v2_1_16 + ${esp32_base.build_flags} -D TLORA_V2_1_16 -I variants/esp32/tlora_v2_1_16 -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. -upload_speed = 115200 \ No newline at end of file +upload_speed = 115200 diff --git a/variants/tlora_v2_1_16/variant.h b/variants/esp32/tlora_v2_1_16/variant.h similarity index 100% rename from variants/tlora_v2_1_16/variant.h rename to variants/esp32/tlora_v2_1_16/variant.h diff --git a/variants/tlora_v2_1_16_tcxo/platformio.ini b/variants/esp32/tlora_v2_1_16_tcxo/platformio.ini similarity index 90% rename from variants/tlora_v2_1_16_tcxo/platformio.ini rename to variants/esp32/tlora_v2_1_16_tcxo/platformio.ini index 5c7cb7eb3..9404faa02 100644 --- a/variants/tlora_v2_1_16_tcxo/platformio.ini +++ b/variants/esp32/tlora_v2_1_16_tcxo/platformio.ini @@ -5,7 +5,7 @@ board = ttgo-lora32-v21 build_flags = ${esp32_base.build_flags} -D TLORA_V2_1_16 - -I variants/tlora_v2_1_16 + -I variants/esp32/tlora_v2_1_16 -D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. -D LORA_TCXO_GPIO=33 upload_speed = 115200 \ No newline at end of file diff --git a/variants/tlora_v2_1_18/platformio.ini b/variants/esp32/tlora_v2_1_18/platformio.ini similarity index 55% rename from variants/tlora_v2_1_18/platformio.ini rename to variants/esp32/tlora_v2_1_18/platformio.ini index 48a001ced..432117485 100644 --- a/variants/tlora_v2_1_18/platformio.ini +++ b/variants/esp32/tlora_v2_1_18/platformio.ini @@ -4,4 +4,6 @@ board_level = extra board = ttgo-lora32-v21 build_flags = - ${esp32_base.build_flags} -D TLORA_V2_1_18 -I variants/tlora_v2_1_18 \ No newline at end of file + ${esp32_base.build_flags} + -D TLORA_V2_1_18 + -I variants/esp32/tlora_v2_1_18 diff --git a/variants/tlora_v2_1_18/variant.h b/variants/esp32/tlora_v2_1_18/variant.h similarity index 100% rename from variants/tlora_v2_1_18/variant.h rename to variants/esp32/tlora_v2_1_18/variant.h diff --git a/variants/tlora_v3_3_0_tcxo/platformio.ini b/variants/esp32/tlora_v3_3_0_tcxo/platformio.ini similarity index 89% rename from variants/tlora_v3_3_0_tcxo/platformio.ini rename to variants/esp32/tlora_v3_3_0_tcxo/platformio.ini index 8d060a087..f1110386e 100644 --- a/variants/tlora_v3_3_0_tcxo/platformio.ini +++ b/variants/esp32/tlora_v3_3_0_tcxo/platformio.ini @@ -4,7 +4,7 @@ board = ttgo-lora32-v21 build_flags = ${esp32_base.build_flags} -D TLORA_V2_1_16 - -I variants/tlora_v2_1_16 + -I variants/esp32/tlora_v2_1_16 -D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. -D LORA_TCXO_GPIO=12 -D BUTTON_PIN=0 \ No newline at end of file diff --git a/variants/trackerd/platformio.ini b/variants/esp32/trackerd/platformio.ini similarity index 56% rename from variants/trackerd/platformio.ini rename to variants/esp32/trackerd/platformio.ini index 654534a15..3c2726a3c 100644 --- a/variants/trackerd/platformio.ini +++ b/variants/esp32/trackerd/platformio.ini @@ -4,5 +4,5 @@ board = pico32 board_build.f_flash = 80000000L build_flags = - ${esp32_base.build_flags} -D PRIVATE_HW -I variants/trackerd -D BSFILE=\"boards/dragino_lbt2.h\" + ${esp32_base.build_flags} -D PRIVATE_HW -I variants/esp32/trackerd -D BSFILE=\"boards/dragino_lbt2.h\" ;board_build.partitions = no_ota.csv \ No newline at end of file diff --git a/variants/trackerd/variant.h b/variants/esp32/trackerd/variant.h similarity index 100% rename from variants/trackerd/variant.h rename to variants/esp32/trackerd/variant.h diff --git a/variants/wiphone/pins_arduino.h b/variants/esp32/wiphone/pins_arduino.h similarity index 100% rename from variants/wiphone/pins_arduino.h rename to variants/esp32/wiphone/pins_arduino.h diff --git a/variants/wiphone/platformio.ini b/variants/esp32/wiphone/platformio.ini similarity index 81% rename from variants/wiphone/platformio.ini rename to variants/esp32/wiphone/platformio.ini index 362102731..5cce94b13 100644 --- a/variants/wiphone/platformio.ini +++ b/variants/esp32/wiphone/platformio.ini @@ -5,7 +5,9 @@ board_level = extra monitor_filters = esp32_exception_decoder board_build.partitions = default_16MB.csv build_flags = - ${esp32_base.build_flags} -D WIPHONE -I variants/wiphone + ${esp32_base.build_flags} + -D WIPHONE + -I variants/esp32/wiphone lib_deps = ${esp32_base.lib_deps} lovyan03/LovyanGFX@^1.2.0 diff --git a/variants/wiphone/variant.h b/variants/esp32/wiphone/variant.h similarity index 100% rename from variants/wiphone/variant.h rename to variants/esp32/wiphone/variant.h From 855514b4f33b0cb898feb75d23cd3ef3f7276e56 Mon Sep 17 00:00:00 2001 From: Austin Date: Sat, 19 Jul 2025 20:55:33 -0400 Subject: [PATCH 025/180] ESP32c3: Migrate variants to new structure (#7342) --- variants/diy/platformio.ini | 13 ------------- variants/{ => esp32c3}/ai-c3/platformio.ini | 6 +++--- variants/{ => esp32c3}/ai-c3/variant.h | 0 .../diy/esp32c3_super_mini/pins_arduino.h | 0 .../esp32c3/diy/esp32c3_super_mini/platformio.ini | 12 ++++++++++++ .../{ => esp32c3}/diy/esp32c3_super_mini/variant.h | 0 .../hackerboxes_esp32c3_oled/platformio.ini | 4 ++-- .../hackerboxes_esp32c3_oled/variant.h | 0 .../{ => esp32c3}/heltec_esp32c3/pins_arduino.h | 0 .../{ => esp32c3}/heltec_esp32c3/platformio.ini | 4 ++-- variants/{ => esp32c3}/heltec_esp32c3/variant.h | 0 .../{ => esp32c3}/heltec_hru_3601/pins_arduino.h | 0 .../{ => esp32c3}/heltec_hru_3601/platformio.ini | 2 +- variants/{ => esp32c3}/heltec_hru_3601/variant.h | 0 .../{ => esp32c3}/m5stack-stamp-c3/pins_arduino.h | 0 .../{ => esp32c3}/m5stack-stamp-c3/platformio.ini | 2 +- variants/{ => esp32c3}/m5stack-stamp-c3/variant.h | 0 .../{ => esp32s2}/nugget_s2_lora/platformio.ini | 4 +++- variants/{ => esp32s2}/nugget_s2_lora/variant.h | 0 19 files changed, 24 insertions(+), 23 deletions(-) rename variants/{ => esp32c3}/ai-c3/platformio.ini (57%) rename variants/{ => esp32c3}/ai-c3/variant.h (100%) rename variants/{ => esp32c3}/diy/esp32c3_super_mini/pins_arduino.h (100%) create mode 100644 variants/esp32c3/diy/esp32c3_super_mini/platformio.ini rename variants/{ => esp32c3}/diy/esp32c3_super_mini/variant.h (100%) rename variants/{ => esp32c3}/hackerboxes_esp32c3_oled/platformio.ini (80%) rename variants/{ => esp32c3}/hackerboxes_esp32c3_oled/variant.h (100%) rename variants/{ => esp32c3}/heltec_esp32c3/pins_arduino.h (100%) rename variants/{ => esp32c3}/heltec_esp32c3/platformio.ini (78%) rename variants/{ => esp32c3}/heltec_esp32c3/variant.h (100%) rename variants/{ => esp32c3}/heltec_hru_3601/pins_arduino.h (100%) rename variants/{ => esp32c3}/heltec_hru_3601/platformio.ini (84%) rename variants/{ => esp32c3}/heltec_hru_3601/variant.h (100%) rename variants/{ => esp32c3}/m5stack-stamp-c3/pins_arduino.h (100%) rename variants/{ => esp32c3}/m5stack-stamp-c3/platformio.ini (86%) rename variants/{ => esp32c3}/m5stack-stamp-c3/variant.h (100%) rename variants/{ => esp32s2}/nugget_s2_lora/platformio.ini (54%) rename variants/{ => esp32s2}/nugget_s2_lora/variant.h (100%) diff --git a/variants/diy/platformio.ini b/variants/diy/platformio.ini index fddfb154e..87451dfce 100644 --- a/variants/diy/platformio.ini +++ b/variants/diy/platformio.ini @@ -97,16 +97,3 @@ build_flags = -D ARDUINO_USB_MODE=0 -D ARDUINO_USB_CDC_ON_BOOT=1 -I variants/diy/t-energy-s3_e22 - -; ESP32 C3 Super Mini Development Board -; https://www.espboards.dev/esp32/esp32-c3-super-mini/ -[env:esp32c3_super_mini] -extends = esp32c3_base -board = esp32-c3-devkitm-1 -build_flags = - ${esp32_base.build_flags} - -D PRIVATE_HW - -I variants/diy/esp32c3_super_mini - -D ARDUINO_USB_MODE=1 - -D ARDUINO_USB_CDC_ON_BOOT=1 -board_level = extra diff --git a/variants/ai-c3/platformio.ini b/variants/esp32c3/ai-c3/platformio.ini similarity index 57% rename from variants/ai-c3/platformio.ini rename to variants/esp32c3/ai-c3/platformio.ini index 2869ca580..a25c0cb19 100644 --- a/variants/ai-c3/platformio.ini +++ b/variants/esp32c3/ai-c3/platformio.ini @@ -2,7 +2,7 @@ extends = esp32c3_base board = esp32-c3-devkitm-1 board_level = extra -build_flags = ${esp32c3_base.build_flags} +build_flags = + ${esp32c3_base.build_flags} -D PRIVATE_HW - -I variants/ai-c3 - + -I variants/esp32c3/ai-c3 diff --git a/variants/ai-c3/variant.h b/variants/esp32c3/ai-c3/variant.h similarity index 100% rename from variants/ai-c3/variant.h rename to variants/esp32c3/ai-c3/variant.h diff --git a/variants/diy/esp32c3_super_mini/pins_arduino.h b/variants/esp32c3/diy/esp32c3_super_mini/pins_arduino.h similarity index 100% rename from variants/diy/esp32c3_super_mini/pins_arduino.h rename to variants/esp32c3/diy/esp32c3_super_mini/pins_arduino.h diff --git a/variants/esp32c3/diy/esp32c3_super_mini/platformio.ini b/variants/esp32c3/diy/esp32c3_super_mini/platformio.ini new file mode 100644 index 000000000..c87baa7bf --- /dev/null +++ b/variants/esp32c3/diy/esp32c3_super_mini/platformio.ini @@ -0,0 +1,12 @@ +; ESP32 C3 Super Mini Development Board +; https://www.espboards.dev/esp32/esp32-c3-super-mini/ +[env:esp32c3_super_mini] +extends = esp32c3_base +board = esp32-c3-devkitm-1 +build_flags = + ${esp32_base.build_flags} + -D PRIVATE_HW + -I variants/esp32c3/diy/esp32c3_super_mini + -D ARDUINO_USB_MODE=1 + -D ARDUINO_USB_CDC_ON_BOOT=1 +board_level = extra diff --git a/variants/diy/esp32c3_super_mini/variant.h b/variants/esp32c3/diy/esp32c3_super_mini/variant.h similarity index 100% rename from variants/diy/esp32c3_super_mini/variant.h rename to variants/esp32c3/diy/esp32c3_super_mini/variant.h diff --git a/variants/hackerboxes_esp32c3_oled/platformio.ini b/variants/esp32c3/hackerboxes_esp32c3_oled/platformio.ini similarity index 80% rename from variants/hackerboxes_esp32c3_oled/platformio.ini rename to variants/esp32c3/hackerboxes_esp32c3_oled/platformio.ini index 4fcbf2ade..5a72b9d74 100644 --- a/variants/hackerboxes_esp32c3_oled/platformio.ini +++ b/variants/esp32c3/hackerboxes_esp32c3_oled/platformio.ini @@ -7,8 +7,8 @@ build_flags = -D PRIVATE_HW -D ARDUINO_USB_MODE=1 -D ARDUINO_USB_CDC_ON_BOOT=1 - -I variants/hackerboxes_esp32c3_oled + -I variants/esp32c3/hackerboxes_esp32c3_oled monitor_speed = 115200 upload_protocol = esptool ;upload_port = /dev/ttyUSB0 -upload_speed = 921600 \ No newline at end of file +upload_speed = 921600 diff --git a/variants/hackerboxes_esp32c3_oled/variant.h b/variants/esp32c3/hackerboxes_esp32c3_oled/variant.h similarity index 100% rename from variants/hackerboxes_esp32c3_oled/variant.h rename to variants/esp32c3/hackerboxes_esp32c3_oled/variant.h diff --git a/variants/heltec_esp32c3/pins_arduino.h b/variants/esp32c3/heltec_esp32c3/pins_arduino.h similarity index 100% rename from variants/heltec_esp32c3/pins_arduino.h rename to variants/esp32c3/heltec_esp32c3/pins_arduino.h diff --git a/variants/heltec_esp32c3/platformio.ini b/variants/esp32c3/heltec_esp32c3/platformio.ini similarity index 78% rename from variants/heltec_esp32c3/platformio.ini rename to variants/esp32c3/heltec_esp32c3/platformio.ini index 6fe5c3c69..d21d64d2a 100644 --- a/variants/heltec_esp32c3/platformio.ini +++ b/variants/esp32c3/heltec_esp32c3/platformio.ini @@ -4,8 +4,8 @@ board = esp32-c3-devkitm-1 build_flags = ${esp32_base.build_flags} -D HELTEC_HT62 - -I variants/heltec_esp32c3 + -I variants/esp32c3/heltec_esp32c3 monitor_speed = 115200 upload_protocol = esptool ;upload_port = /dev/ttyUSB0 -upload_speed = 921600 \ No newline at end of file +upload_speed = 921600 diff --git a/variants/heltec_esp32c3/variant.h b/variants/esp32c3/heltec_esp32c3/variant.h similarity index 100% rename from variants/heltec_esp32c3/variant.h rename to variants/esp32c3/heltec_esp32c3/variant.h diff --git a/variants/heltec_hru_3601/pins_arduino.h b/variants/esp32c3/heltec_hru_3601/pins_arduino.h similarity index 100% rename from variants/heltec_hru_3601/pins_arduino.h rename to variants/esp32c3/heltec_hru_3601/pins_arduino.h diff --git a/variants/heltec_hru_3601/platformio.ini b/variants/esp32c3/heltec_hru_3601/platformio.ini similarity index 84% rename from variants/heltec_hru_3601/platformio.ini rename to variants/esp32c3/heltec_hru_3601/platformio.ini index 3668e72b7..b5ff63eae 100644 --- a/variants/heltec_hru_3601/platformio.ini +++ b/variants/esp32c3/heltec_hru_3601/platformio.ini @@ -4,6 +4,6 @@ board = adafruit_qtpy_esp32c3 build_flags = ${esp32_base.build_flags} -D HELTEC_HRU_3601 - -I variants/heltec_hru_3601 + -I variants/esp32c3/heltec_hru_3601 lib_deps = ${esp32c3_base.lib_deps} adafruit/Adafruit NeoPixel @ ^1.12.0 diff --git a/variants/heltec_hru_3601/variant.h b/variants/esp32c3/heltec_hru_3601/variant.h similarity index 100% rename from variants/heltec_hru_3601/variant.h rename to variants/esp32c3/heltec_hru_3601/variant.h diff --git a/variants/m5stack-stamp-c3/pins_arduino.h b/variants/esp32c3/m5stack-stamp-c3/pins_arduino.h similarity index 100% rename from variants/m5stack-stamp-c3/pins_arduino.h rename to variants/esp32c3/m5stack-stamp-c3/pins_arduino.h diff --git a/variants/m5stack-stamp-c3/platformio.ini b/variants/esp32c3/m5stack-stamp-c3/platformio.ini similarity index 86% rename from variants/m5stack-stamp-c3/platformio.ini rename to variants/esp32c3/m5stack-stamp-c3/platformio.ini index bab65b621..1072df664 100644 --- a/variants/m5stack-stamp-c3/platformio.ini +++ b/variants/esp32c3/m5stack-stamp-c3/platformio.ini @@ -5,7 +5,7 @@ board_level = extra build_flags = ${esp32_base.build_flags} -D PRIVATE_HW - -I variants/m5stack-stamp-c3 + -I variants/esp32c3/m5stack-stamp-c3 monitor_speed = 115200 upload_protocol = esptool ;upload_port = /dev/ttyACM2 diff --git a/variants/m5stack-stamp-c3/variant.h b/variants/esp32c3/m5stack-stamp-c3/variant.h similarity index 100% rename from variants/m5stack-stamp-c3/variant.h rename to variants/esp32c3/m5stack-stamp-c3/variant.h diff --git a/variants/nugget_s2_lora/platformio.ini b/variants/esp32s2/nugget_s2_lora/platformio.ini similarity index 54% rename from variants/nugget_s2_lora/platformio.ini rename to variants/esp32s2/nugget_s2_lora/platformio.ini index 2a7ff1013..a091a705f 100644 --- a/variants/nugget_s2_lora/platformio.ini +++ b/variants/esp32s2/nugget_s2_lora/platformio.ini @@ -3,4 +3,6 @@ extends = esp32s2_base board = lolin_s2_mini board_level = extra build_flags = - ${esp32s2_base.build_flags} -D PRIVATE_HW -I variants/nugget_s2_lora \ No newline at end of file + ${esp32s2_base.build_flags} + -D PRIVATE_HW + -I variants/esp32s2/nugget_s2_lora diff --git a/variants/nugget_s2_lora/variant.h b/variants/esp32s2/nugget_s2_lora/variant.h similarity index 100% rename from variants/nugget_s2_lora/variant.h rename to variants/esp32s2/nugget_s2_lora/variant.h From 91049d0db321f910bdf341a9e1c8b06d94adc269 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sun, 20 Jul 2025 06:19:45 -0500 Subject: [PATCH 026/180] Misc cppcheck fixes (#7370) --- src/buzz/BuzzerFeedbackThread.cpp | 5 +--- src/graphics/Screen.cpp | 2 +- src/graphics/draw/ClockRenderer.cpp | 6 +---- src/input/ButtonThread.h | 4 +-- src/mesh/MeshPacketQueue.cpp | 2 +- src/mesh/NodeDB.cpp | 2 +- src/mesh/NodeDB.h | 2 +- src/mesh/PacketHistory.cpp | 6 ++--- src/mesh/PacketHistory.h | 4 +-- src/modules/CannedMessageModule.cpp | 41 +++++++++++++++-------------- 10 files changed, 34 insertions(+), 40 deletions(-) diff --git a/src/buzz/BuzzerFeedbackThread.cpp b/src/buzz/BuzzerFeedbackThread.cpp index 2bd3158a3..b644ea8f4 100644 --- a/src/buzz/BuzzerFeedbackThread.cpp +++ b/src/buzz/BuzzerFeedbackThread.cpp @@ -69,10 +69,7 @@ int32_t BuzzerFeedbackThread::runOnce() // This thread is primarily event-driven, but we can use runOnce // for any periodic tasks if needed in the future - if (needsUpdate) { - needsUpdate = false; - // Could add any periodic processing here - } + needsUpdate = false; // Run every 100ms when active, less frequently when idle return needsUpdate ? 100 : 1000; diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index b9c9e2fbf..87d394d69 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -1001,7 +1001,7 @@ void Screen::setFrames(FrameFocus focus) // Insert favorite frames *after* collecting them all if (!favoriteFrames.empty()) { fsi.positions.firstFavorite = numframes; - for (auto &f : favoriteFrames) { + for (const auto &f : favoriteFrames) { normalFrames[numframes++] = f; indicatorIcons.push_back(icon_node); } diff --git a/src/graphics/draw/ClockRenderer.cpp b/src/graphics/draw/ClockRenderer.cpp index e3cb5fcb9..cc0b6f70b 100644 --- a/src/graphics/draw/ClockRenderer.cpp +++ b/src/graphics/draw/ClockRenderer.cpp @@ -218,7 +218,6 @@ void drawDigitalClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int1 hour %= 12; if (hour == 0) hour = 12; - bool isPM = hour >= 12; snprintf(timeString, sizeof(timeString), "%d:%02d", hour, minute); } else { snprintf(timeString, sizeof(timeString), "%02d:%02d", hour, minute); @@ -366,9 +365,6 @@ void drawAnalogClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 // hour hand radius and y coordinate int16_t hourHandRadius = radius * 0.35; - if (isHighResolution) { - int16_t hourHandRadius = radius * 0.55; - } int16_t hourHandNoonY = centerY - hourHandRadius; display->setColor(OLEDDISPLAY_COLOR::WHITE); @@ -386,7 +382,7 @@ void drawAnalogClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 bool isPM = hour >= 12; if (config.display.use_12h_clock) { - bool isPM = hour >= 12; + isPM = hour >= 12; display->setFont(FONT_SMALL); int yOffset = isHighResolution ? 1 : 0; #ifdef USE_EINK diff --git a/src/input/ButtonThread.h b/src/input/ButtonThread.h index 949048de1..2358e609d 100644 --- a/src/input/ButtonThread.h +++ b/src/input/ButtonThread.h @@ -24,7 +24,7 @@ struct ButtonConfig { bool touchQuirk = false; // Constructor to set required parameter - ButtonConfig(uint8_t pin = 0) : pinNumber(pin) {} + explicit ButtonConfig(uint8_t pin = 0) : pinNumber(pin) {} }; #ifndef BUTTON_CLICK_MS @@ -62,7 +62,7 @@ class ButtonThread : public Observable, public concurrency:: BUTTON_EVENT_COMBO_SHORT_LONG, }; - ButtonThread(const char *name); + explicit ButtonThread(const char *name); int32_t runOnce() override; OneButton userButton; void attachButtonInterrupts(); diff --git a/src/mesh/MeshPacketQueue.cpp b/src/mesh/MeshPacketQueue.cpp index f8af81321..a64678a7f 100644 --- a/src/mesh/MeshPacketQueue.cpp +++ b/src/mesh/MeshPacketQueue.cpp @@ -121,7 +121,7 @@ meshtastic_MeshPacket *MeshPacketQueue::remove(NodeNum from, PacketId id, bool t bool MeshPacketQueue::find(const NodeNum from, const PacketId id) { for (auto it = queue.begin(); it != queue.end(); it++) { - const auto p = (*it); + const auto *p = *it; if (getFrom(p) == from && p->id == id) { return true; } diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 185ea0744..3c19971e6 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -1868,7 +1868,7 @@ UserLicenseStatus NodeDB::getLicenseStatus(uint32_t nodeNum) return info->user.is_licensed ? UserLicenseStatus::Licensed : UserLicenseStatus::NotLicensed; } -bool NodeDB::checkLowEntropyPublicKey(const meshtastic_Config_SecurityConfig_public_key_t keyToTest) +bool NodeDB::checkLowEntropyPublicKey(const meshtastic_Config_SecurityConfig_public_key_t &keyToTest) { if (keyToTest.size == 32) { uint8_t keyHash[32] = {0}; diff --git a/src/mesh/NodeDB.h b/src/mesh/NodeDB.h index 845f42c76..19fb67b73 100644 --- a/src/mesh/NodeDB.h +++ b/src/mesh/NodeDB.h @@ -279,7 +279,7 @@ class NodeDB bool hasValidPosition(const meshtastic_NodeInfoLite *n); - bool checkLowEntropyPublicKey(const meshtastic_Config_SecurityConfig_public_key_t keyToTest); + bool checkLowEntropyPublicKey(const meshtastic_Config_SecurityConfig_public_key_t &keyToTest); bool backupPreferences(meshtastic_AdminMessage_BackupLocation location); bool restorePreferences(meshtastic_AdminMessage_BackupLocation location, diff --git a/src/mesh/PacketHistory.cpp b/src/mesh/PacketHistory.cpp index 8cac31a3e..3902c1057 100644 --- a/src/mesh/PacketHistory.cpp +++ b/src/mesh/PacketHistory.cpp @@ -181,7 +181,7 @@ PacketHistory::PacketRecord *PacketHistory::find(NodeNum sender, PacketId id) } /** Insert/Replace oldest PacketRecord in recentPackets. */ -void PacketHistory::insert(PacketRecord &r) +void PacketHistory::insert(const PacketRecord &r) { uint32_t now_millis = millis(); // Should not jump with time changes uint32_t OldtrxTimeMsec = 0; @@ -308,7 +308,7 @@ bool PacketHistory::wasRelayer(const uint8_t relayer, const uint32_t id, const N return false; } - PacketRecord *found = find(sender, id); + const PacketRecord *found = find(sender, id); if (found == NULL) { #if VERBOSE_PACKET_HISTORY @@ -327,7 +327,7 @@ bool PacketHistory::wasRelayer(const uint8_t relayer, const uint32_t id, const N /* Check if a certain node was a relayer of a packet in the history given iterator * @return true if node was indeed a relayer, false if not */ -bool PacketHistory::wasRelayer(const uint8_t relayer, PacketRecord &r) +bool PacketHistory::wasRelayer(const uint8_t relayer, const PacketRecord &r) { for (uint8_t i = 0; i < NUM_RELAYERS; i++) { if (r.relayed_by[i] == relayer) { diff --git a/src/mesh/PacketHistory.h b/src/mesh/PacketHistory.h index d06c9bd2f..9f14a4cf0 100644 --- a/src/mesh/PacketHistory.h +++ b/src/mesh/PacketHistory.h @@ -31,11 +31,11 @@ class PacketHistory /** Insert/Replace oldest PacketRecord in mx_recentPackets. * @param r PacketRecord to insert or replace */ - void insert(PacketRecord &r); // Insert or replace a packet record in the history + void insert(const PacketRecord &r); // Insert or replace a packet record in the history /* Check if a certain node was a relayer of a packet in the history given iterator * @return true if node was indeed a relayer, false if not */ - bool wasRelayer(const uint8_t relayer, PacketRecord &r); + bool wasRelayer(const uint8_t relayer, const PacketRecord &r); PacketHistory(const PacketHistory &); // non construction-copyable PacketHistory &operator=(const PacketHistory &); // non copyable diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index 2690c67f0..2a4f1cf4d 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -1447,7 +1447,7 @@ void CannedMessageModule::drawEmotePickerScreen(OLEDDisplay *display, OLEDDispla int headerY = y; int listTop = headerY + headerFontHeight + headerMargin; - int visibleRows = (display->getHeight() - listTop - 2) / rowHeight; + int _visibleRows = (display->getHeight() - listTop - 2) / rowHeight; int numEmotes = graphics::numEmotes; // Clamp highlight index @@ -1457,11 +1457,11 @@ void CannedMessageModule::drawEmotePickerScreen(OLEDDisplay *display, OLEDDispla emotePickerIndex = numEmotes - 1; // Determine which emote is at the top - int topIndex = emotePickerIndex - visibleRows / 2; + int topIndex = emotePickerIndex - _visibleRows / 2; if (topIndex < 0) topIndex = 0; - if (topIndex > numEmotes - visibleRows) - topIndex = std::max(0, numEmotes - visibleRows); + if (topIndex > numEmotes - _visibleRows) + topIndex = std::max(0, numEmotes - _visibleRows); // Draw header/title display->setFont(FONT_SMALL); @@ -1709,7 +1709,7 @@ void CannedMessageModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *st } else { // Text: split by words and wrap inside word if needed String text = token.second; - uint16_t pos = 0; + pos = 0; while (pos < text.length()) { // Find next space (or end) int spacePos = text.indexOf(' ', pos); @@ -1753,7 +1753,7 @@ void CannedMessageModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *st int yLine = inputY; for (auto &line : lines) { int nextX = x; - for (auto &token : line) { + for (const auto &token : line) { if (token.first) { const graphics::Emote *emote = nullptr; for (int j = 0; j < graphics::numEmotes; j++) { @@ -1789,19 +1789,20 @@ void CannedMessageModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *st int topMsg; std::vector rowHeights; - int visibleRows; + int _visibleRows; // Draw header (To: ...) drawHeader(display, x, y, buffer); // Shift message list upward by 3 pixels to reduce spacing between header and first message const int listYOffset = y + FONT_HEIGHT_SMALL - 3; - visibleRows = (display->getHeight() - listYOffset) / baseRowSpacing; + _visibleRows = (display->getHeight() - listYOffset) / baseRowSpacing; // Figure out which messages are visible and their needed heights - topMsg = - (messagesCount > visibleRows && currentMessageIndex >= visibleRows - 1) ? currentMessageIndex - visibleRows + 2 : 0; - int countRows = std::min(messagesCount, visibleRows); + topMsg = (messagesCount > _visibleRows && currentMessageIndex >= _visibleRows - 1) + ? currentMessageIndex - _visibleRows + 2 + : 0; + int countRows = std::min(messagesCount, _visibleRows); // --- Build per-row max height based on all emotes in line --- for (int i = 0; i < countRows; i++) { @@ -1828,7 +1829,7 @@ void CannedMessageModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *st int lineY = yCursor; const char *msg = getMessageByIndex(msgIdx); int rowHeight = rowHeights[vis]; - bool highlight = (msgIdx == currentMessageIndex); + bool _highlight = (msgIdx == currentMessageIndex); // --- Multi-emote tokenization --- std::vector> tokens; // (isEmote, token) @@ -1881,20 +1882,20 @@ void CannedMessageModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *st int textYOffset = (rowHeight - FONT_HEIGHT_SMALL) / 2; #ifdef USE_EINK - int nextX = x + (highlight ? 12 : 0); - if (highlight) + int nextX = x + (_highlight ? 12 : 0); + if (_highlight) display->drawString(x + 0, lineY + textYOffset, ">"); #else int scrollPadding = 8; - if (highlight) { + if (_highlight) { display->fillRect(x + 0, lineY, display->getWidth() - scrollPadding, rowHeight); display->setColor(BLACK); } - int nextX = x + (highlight ? 2 : 0); + int nextX = x + (_highlight ? 2 : 0); #endif // Draw all tokens left to right - for (auto &token : tokens) { + for (const auto &token : tokens) { if (token.first) { // Emote const graphics::Emote *emote = nullptr; @@ -1916,7 +1917,7 @@ void CannedMessageModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *st } } #ifndef USE_EINK - if (highlight) + if (_highlight) display->setColor(WHITE); #endif @@ -1924,11 +1925,11 @@ void CannedMessageModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *st } // Scrollbar - if (messagesCount > visibleRows) { + if (messagesCount > _visibleRows) { int scrollHeight = display->getHeight() - listYOffset; int scrollTrackX = display->getWidth() - 6; display->drawRect(scrollTrackX, listYOffset, 4, scrollHeight); - int barHeight = (scrollHeight * visibleRows) / messagesCount; + int barHeight = (scrollHeight * _visibleRows) / messagesCount; int scrollPos = listYOffset + (scrollHeight * topMsg) / messagesCount; display->fillRect(scrollTrackX, scrollPos, 4, barHeight); } From 44518fea14a17373b266ad7471440e96a708e565 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 20 Jul 2025 06:20:07 -0500 Subject: [PATCH 027/180] Upgrade trunk (#7349) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> --- .trunk/trunk.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 7d27efe58..e1abbcc88 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -8,15 +8,15 @@ plugins: uri: https://github.com/trunk-io/plugins lint: enabled: - - checkov@3.2.450 - - renovate@41.30.5 + - checkov@3.2.451 + - renovate@41.37.9 - prettier@3.6.2 - - trufflehog@3.89.2 + - trufflehog@3.90.0 - yamllint@1.37.1 - bandit@1.8.6 - trivy@0.64.1 - taplo@0.9.3 - - ruff@0.12.2 + - ruff@0.12.3 - isort@6.0.1 - markdownlint@0.45.0 - oxipng@9.1.5 From 9313d047260e183b1cacca89fc6000c21b8d6c09 Mon Sep 17 00:00:00 2001 From: Austin Date: Sun, 20 Jul 2025 07:20:57 -0400 Subject: [PATCH 028/180] RP2040/RP2350: Migrate variants to new structure (#7345) --- .../{ => rp2040}/ec_catsniffer/platformio.ini | 14 +++++++------- variants/{ => rp2040}/ec_catsniffer/variant.cpp | 0 variants/{ => rp2040}/ec_catsniffer/variant.h | 0 .../feather_rp2040_rfm95/platformio.ini | 14 +++++++------- .../{ => rp2040}/feather_rp2040_rfm95/variant.h | 0 .../{ => rp2040}/nibble_rp2040/platformio.ini | 14 +++++++------- variants/{ => rp2040}/nibble_rp2040/variant.h | 0 variants/{ => rp2040}/rak11310/pins_arduino.h | 0 variants/{ => rp2040}/rak11310/platformio.ini | 16 ++++++++-------- variants/{ => rp2040}/rak11310/variant.h | 0 variants/{ => rp2040}/rp2040-lora/platformio.ini | 14 +++++++------- variants/{ => rp2040}/rp2040-lora/variant.h | 0 .../rpipico-slowclock/platformio.ini | 8 ++++---- .../{ => rp2040}/rpipico-slowclock/variant.h | 0 variants/{ => rp2040}/rpipico/platformio.ini | 13 +++++++------ variants/{ => rp2040}/rpipico/variant.h | 0 variants/{ => rp2040}/rpipicow/platformio.ini | 12 ++++++------ variants/{ => rp2040}/rpipicow/variant.h | 0 .../{ => rp2040}/senselora_rp2040/pins_arduino.h | 0 .../{ => rp2040}/senselora_rp2040/platformio.ini | 8 ++++---- variants/{ => rp2040}/senselora_rp2040/variant.h | 1 + variants/{ => rp2350}/rpipico2/platformio.ini | 13 +++++++------ variants/{ => rp2350}/rpipico2/variant.h | 0 variants/{ => rp2350}/rpipico2w/platformio.ini | 5 +++-- variants/{ => rp2350}/rpipico2w/variant.h | 0 25 files changed, 68 insertions(+), 64 deletions(-) rename variants/{ => rp2040}/ec_catsniffer/platformio.ini (50%) rename variants/{ => rp2040}/ec_catsniffer/variant.cpp (100%) rename variants/{ => rp2040}/ec_catsniffer/variant.h (100%) rename variants/{ => rp2040}/feather_rp2040_rfm95/platformio.ini (53%) rename variants/{ => rp2040}/feather_rp2040_rfm95/variant.h (100%) rename variants/{ => rp2040}/nibble_rp2040/platformio.ini (56%) rename variants/{ => rp2040}/nibble_rp2040/variant.h (100%) rename variants/{ => rp2040}/rak11310/pins_arduino.h (100%) rename variants/{ => rp2040}/rak11310/platformio.ini (64%) rename variants/{ => rp2040}/rak11310/variant.h (100%) rename variants/{ => rp2040}/rp2040-lora/platformio.ini (54%) rename variants/{ => rp2040}/rp2040-lora/variant.h (100%) rename variants/{ => rp2040}/rpipico-slowclock/platformio.ini (85%) rename variants/{ => rp2040}/rpipico-slowclock/variant.h (100%) rename variants/{ => rp2040}/rpipico/platformio.ini (55%) rename variants/{ => rp2040}/rpipico/variant.h (100%) rename variants/{ => rp2040}/rpipicow/platformio.ini (75%) rename variants/{ => rp2040}/rpipicow/variant.h (100%) rename variants/{ => rp2040}/senselora_rp2040/pins_arduino.h (100%) rename variants/{ => rp2040}/senselora_rp2040/platformio.ini (60%) rename variants/{ => rp2040}/senselora_rp2040/variant.h (92%) rename variants/{ => rp2350}/rpipico2/platformio.ini (54%) rename variants/{ => rp2350}/rpipico2/variant.h (100%) rename variants/{ => rp2350}/rpipico2w/platformio.ini (91%) rename variants/{ => rp2350}/rpipico2w/variant.h (100%) diff --git a/variants/ec_catsniffer/platformio.ini b/variants/rp2040/ec_catsniffer/platformio.ini similarity index 50% rename from variants/ec_catsniffer/platformio.ini rename to variants/rp2040/ec_catsniffer/platformio.ini index 6db9abe90..acf19d757 100644 --- a/variants/ec_catsniffer/platformio.ini +++ b/variants/rp2040/ec_catsniffer/platformio.ini @@ -2,13 +2,13 @@ extends = rp2040_base board = rpipico upload_protocol = picotool - -build_flags = ${rp2040_base.build_flags} - -DRPI_PICO - -Ivariants/ec_catsniffer - -DDEBUG_RP2040_PORT=Serial - # -DHW_SPI1_DEVICE +build_flags = + ${rp2040_base.build_flags} + -D RPI_PICO + -I variants/rp2040/ec_catsniffer + -D DEBUG_RP2040_PORT=Serial + ; -D HW_SPI1_DEVICE lib_deps = ${rp2040_base.lib_deps} debug_build_flags = ${rp2040_base.build_flags}, -g -debug_tool = cmsis-dap \ No newline at end of file +debug_tool = cmsis-dap diff --git a/variants/ec_catsniffer/variant.cpp b/variants/rp2040/ec_catsniffer/variant.cpp similarity index 100% rename from variants/ec_catsniffer/variant.cpp rename to variants/rp2040/ec_catsniffer/variant.cpp diff --git a/variants/ec_catsniffer/variant.h b/variants/rp2040/ec_catsniffer/variant.h similarity index 100% rename from variants/ec_catsniffer/variant.h rename to variants/rp2040/ec_catsniffer/variant.h diff --git a/variants/feather_rp2040_rfm95/platformio.ini b/variants/rp2040/feather_rp2040_rfm95/platformio.ini similarity index 53% rename from variants/feather_rp2040_rfm95/platformio.ini rename to variants/rp2040/feather_rp2040_rfm95/platformio.ini index db1eb4f02..ef4118cb0 100644 --- a/variants/feather_rp2040_rfm95/platformio.ini +++ b/variants/rp2040/feather_rp2040_rfm95/platformio.ini @@ -2,14 +2,14 @@ extends = rp2040_base board = adafruit_feather upload_protocol = picotool - # add our variants files to the include and src paths -build_flags = ${rp2040_base.build_flags} - -DRP2040_FEATHER_RFM95 - -Ivariants/feather_rp2040_rfm95 - -DDEBUG_RP2040_PORT=Serial - -DHW_SPI1_DEVICE +build_flags = + ${rp2040_base.build_flags} + -D RP2040_FEATHER_RFM95 + -I variants/rp2040/feather_rp2040_rfm95 + -D DEBUG_RP2040_PORT=Serial + -D HW_SPI1_DEVICE lib_deps = ${rp2040_base.lib_deps} debug_build_flags = ${rp2040_base.build_flags} -debug_tool = cmsis-dap ; for e.g. Picotool \ No newline at end of file +debug_tool = cmsis-dap ; for e.g. Picotool diff --git a/variants/feather_rp2040_rfm95/variant.h b/variants/rp2040/feather_rp2040_rfm95/variant.h similarity index 100% rename from variants/feather_rp2040_rfm95/variant.h rename to variants/rp2040/feather_rp2040_rfm95/variant.h diff --git a/variants/nibble_rp2040/platformio.ini b/variants/rp2040/nibble_rp2040/platformio.ini similarity index 56% rename from variants/nibble_rp2040/platformio.ini rename to variants/rp2040/nibble_rp2040/platformio.ini index c3a1923c5..024a72206 100644 --- a/variants/nibble_rp2040/platformio.ini +++ b/variants/rp2040/nibble_rp2040/platformio.ini @@ -3,14 +3,14 @@ extends = rp2040_base board = rpipico board_level = extra upload_protocol = picotool - # add our variants files to the include and src paths -build_flags = ${rp2040_base.build_flags} - -DPRIVATE_HW - -Ivariants/nibble_rp2040 - -DDEBUG_RP2040_PORT=Serial - -DHW_SPI1_DEVICE +build_flags = + ${rp2040_base.build_flags} + -D PRIVATE_HW + -I variants/rp2040/nibble_rp2040 + -D DEBUG_RP2040_PORT=Serial + -D HW_SPI1_DEVICE lib_deps = ${rp2040_base.lib_deps} debug_build_flags = ${rp2040_base.build_flags}, -g -debug_tool = cmsis-dap ; for e.g. Picotool \ No newline at end of file +debug_tool = cmsis-dap ; for e.g. Picotool diff --git a/variants/nibble_rp2040/variant.h b/variants/rp2040/nibble_rp2040/variant.h similarity index 100% rename from variants/nibble_rp2040/variant.h rename to variants/rp2040/nibble_rp2040/variant.h diff --git a/variants/rak11310/pins_arduino.h b/variants/rp2040/rak11310/pins_arduino.h similarity index 100% rename from variants/rak11310/pins_arduino.h rename to variants/rp2040/rak11310/pins_arduino.h diff --git a/variants/rak11310/platformio.ini b/variants/rp2040/rak11310/platformio.ini similarity index 64% rename from variants/rak11310/platformio.ini rename to variants/rp2040/rak11310/platformio.ini index fd7e842cc..aca24656b 100644 --- a/variants/rak11310/platformio.ini +++ b/variants/rp2040/rak11310/platformio.ini @@ -2,18 +2,18 @@ extends = rp2040_base board = rakwireless_rak11300 upload_protocol = picotool - # add our variants files to the include and src paths -build_flags = ${rp2040_base.build_flags} - -DRAK11310 - -Ivariants/rak11310 - -DDEBUG_RP2040_PORT=Serial - -DRV3028_RTC=0x52 -build_src_filter = ${rp2040_base.build_src_filter} +<../variants/rak11310> + + + +build_flags = + ${rp2040_base.build_flags} + -D RAK11310 + -I variants/rp2040/rak11310 + -D DEBUG_RP2040_PORT=Serial + -D RV3028_RTC=0x52 +build_src_filter = ${rp2040_base.build_src_filter} +<../variants/rp2040/rak11310> + + + lib_deps = ${rp2040_base.lib_deps} ${networking_base.lib_deps} melopero/Melopero RV3028@^1.1.0 https://github.com/RAKWireless/RAK13800-W5100S/archive/1.0.2.zip debug_build_flags = ${rp2040_base.build_flags}, -g -debug_tool = cmsis-dap ; for e.g. Picotool \ No newline at end of file +debug_tool = cmsis-dap ; for e.g. Picotool diff --git a/variants/rak11310/variant.h b/variants/rp2040/rak11310/variant.h similarity index 100% rename from variants/rak11310/variant.h rename to variants/rp2040/rak11310/variant.h diff --git a/variants/rp2040-lora/platformio.ini b/variants/rp2040/rp2040-lora/platformio.ini similarity index 54% rename from variants/rp2040-lora/platformio.ini rename to variants/rp2040/rp2040-lora/platformio.ini index 7ac5b2cac..d59e74f20 100644 --- a/variants/rp2040-lora/platformio.ini +++ b/variants/rp2040/rp2040-lora/platformio.ini @@ -2,14 +2,14 @@ extends = rp2040_base board = rpipico upload_protocol = picotool - # add our variants files to the include and src paths -build_flags = ${rp2040_base.build_flags} - -DRP2040_LORA - -Ivariants/rp2040-lora - -DDEBUG_RP2040_PORT=Serial - -DHW_SPI1_DEVICE +build_flags = + ${rp2040_base.build_flags} + -D RP2040_LORA + -I variants/rp2040/rp2040-lora + -D DEBUG_RP2040_PORT=Serial + -D HW_SPI1_DEVICE lib_deps = ${rp2040_base.lib_deps} debug_build_flags = ${rp2040_base.build_flags}, -g -debug_tool = cmsis-dap ; for e.g. Picotool \ No newline at end of file +debug_tool = cmsis-dap ; for e.g. Picotool diff --git a/variants/rp2040-lora/variant.h b/variants/rp2040/rp2040-lora/variant.h similarity index 100% rename from variants/rp2040-lora/variant.h rename to variants/rp2040/rp2040-lora/variant.h diff --git a/variants/rpipico-slowclock/platformio.ini b/variants/rp2040/rpipico-slowclock/platformio.ini similarity index 85% rename from variants/rpipico-slowclock/platformio.ini rename to variants/rp2040/rpipico-slowclock/platformio.ini index c56f9e78c..30928aead 100644 --- a/variants/rpipico-slowclock/platformio.ini +++ b/variants/rp2040/rpipico-slowclock/platformio.ini @@ -12,11 +12,11 @@ debug_init_cmds = $LOAD_CMDS monitor init monitor reset halt - # add our variants files to the include and src paths -build_flags = ${rp2040_base.build_flags} +build_flags = + ${rp2040_base.build_flags} -DRPI_PICO - -Ivariants/rpipico-slowclock + -Ivariants/rp2040/rpipico-slowclock -DDEBUG_RP2040_PORT=Serial2 -DHW_SPI1_DEVICE -g @@ -25,4 +25,4 @@ lib_deps = ${rp2040_base.lib_deps} debug_build_flags = ${rp2040_base.build_flags} -g - -DNO_USB \ No newline at end of file + -DNO_USB diff --git a/variants/rpipico-slowclock/variant.h b/variants/rp2040/rpipico-slowclock/variant.h similarity index 100% rename from variants/rpipico-slowclock/variant.h rename to variants/rp2040/rpipico-slowclock/variant.h diff --git a/variants/rpipico/platformio.ini b/variants/rp2040/rpipico/platformio.ini similarity index 55% rename from variants/rpipico/platformio.ini rename to variants/rp2040/rpipico/platformio.ini index e34cfa43b..81db2a312 100644 --- a/variants/rpipico/platformio.ini +++ b/variants/rp2040/rpipico/platformio.ini @@ -4,12 +4,13 @@ board = rpipico upload_protocol = picotool # add our variants files to the include and src paths -build_flags = ${rp2040_base.build_flags} - -DRPI_PICO - -Ivariants/rpipico - -DDEBUG_RP2040_PORT=Serial - -DHW_SPI1_DEVICE +build_flags = + ${rp2040_base.build_flags} + -D RPI_PICO + -I variants/rp2040/rpipico + -D DEBUG_RP2040_PORT=Serial + -D HW_SPI1_DEVICE lib_deps = ${rp2040_base.lib_deps} debug_build_flags = ${rp2040_base.build_flags}, -g -debug_tool = cmsis-dap ; for e.g. Picotool \ No newline at end of file +debug_tool = cmsis-dap ; for e.g. Picotool diff --git a/variants/rpipico/variant.h b/variants/rp2040/rpipico/variant.h similarity index 100% rename from variants/rpipico/variant.h rename to variants/rp2040/rpipico/variant.h diff --git a/variants/rpipicow/platformio.ini b/variants/rp2040/rpipicow/platformio.ini similarity index 75% rename from variants/rpipicow/platformio.ini rename to variants/rp2040/rpipicow/platformio.ini index e59944b5d..f3fd07f8d 100644 --- a/variants/rpipicow/platformio.ini +++ b/variants/rp2040/rpipicow/platformio.ini @@ -2,14 +2,14 @@ extends = rp2040_base board = rpipicow upload_protocol = picotool - # add our variants files to the include and src paths -build_flags = ${rp2040_base.build_flags} - -DRPI_PICO - -Ivariants/rpipicow - -DHW_SPI1_DEVICE +build_flags = + ${rp2040_base.build_flags} + -D RPI_PICO + -I variants/rp2040/rpipicow + -D HW_SPI1_DEVICE + -D HAS_UDP_MULTICAST=1 -fexceptions # for exception handling in MQTT - -DHAS_UDP_MULTICAST=1 build_src_filter = ${rp2040_base.build_src_filter} + lib_deps = ${rp2040_base.lib_deps} diff --git a/variants/rpipicow/variant.h b/variants/rp2040/rpipicow/variant.h similarity index 100% rename from variants/rpipicow/variant.h rename to variants/rp2040/rpipicow/variant.h diff --git a/variants/senselora_rp2040/pins_arduino.h b/variants/rp2040/senselora_rp2040/pins_arduino.h similarity index 100% rename from variants/senselora_rp2040/pins_arduino.h rename to variants/rp2040/senselora_rp2040/pins_arduino.h diff --git a/variants/senselora_rp2040/platformio.ini b/variants/rp2040/senselora_rp2040/platformio.ini similarity index 60% rename from variants/senselora_rp2040/platformio.ini rename to variants/rp2040/senselora_rp2040/platformio.ini index b05fc1f8b..3a574d0f9 100644 --- a/variants/senselora_rp2040/platformio.ini +++ b/variants/rp2040/senselora_rp2040/platformio.ini @@ -5,9 +5,9 @@ board = rpipico upload_protocol = picotool # add our variants files to the include and src paths -build_flags = ${rp2040_base.build_flags} - -DSENSELORA_RP2040 - -Ivariants/senselora_rp2040 - -DDEBUG_RP2040_PORT=Serial +build_flags = ${rp2040_base.build_flags} + -D SENSELORA_RP2040 + -I variants/rp2040/senselora_rp2040 + -D DEBUG_RP2040_PORT=Serial lib_deps = ${rp2040_base.lib_deps} \ No newline at end of file diff --git a/variants/senselora_rp2040/variant.h b/variants/rp2040/senselora_rp2040/variant.h similarity index 92% rename from variants/senselora_rp2040/variant.h rename to variants/rp2040/senselora_rp2040/variant.h index 2f68cf034..cc90284b7 100644 --- a/variants/senselora_rp2040/variant.h +++ b/variants/rp2040/senselora_rp2040/variant.h @@ -6,6 +6,7 @@ #define BUTTON_NEED_PULLUP #define LED_PIN PIN_LED +#define ledOff(pin) pinMode(pin, INPUT) #undef BATTERY_PIN #define BATTERY_SENSE_RESOLUTION_BITS ADC_RESOLUTION diff --git a/variants/rpipico2/platformio.ini b/variants/rp2350/rpipico2/platformio.ini similarity index 54% rename from variants/rpipico2/platformio.ini rename to variants/rp2350/rpipico2/platformio.ini index 066809a91..485523eb0 100644 --- a/variants/rpipico2/platformio.ini +++ b/variants/rp2350/rpipico2/platformio.ini @@ -4,12 +4,13 @@ board = rpipico2 upload_protocol = picotool # add our variants files to the include and src paths -build_flags = ${rp2350_base.build_flags} - -DRPI_PICO2 - -Ivariants/rpipico2 - -DDEBUG_RP2040_PORT=Serial - -DHW_SPI1_DEVICE +build_flags = + ${rp2350_base.build_flags} + -D RPI_PICO2 + -I variants/rp2350/rpipico2 + -D DEBUG_RP2040_PORT=Serial + -D HW_SPI1_DEVICE lib_deps = ${rp2350_base.lib_deps} debug_build_flags = ${rp2350_base.build_flags}, -g -debug_tool = cmsis-dap ; for e.g. Picotool \ No newline at end of file +debug_tool = cmsis-dap ; for e.g. Picotool diff --git a/variants/rpipico2/variant.h b/variants/rp2350/rpipico2/variant.h similarity index 100% rename from variants/rpipico2/variant.h rename to variants/rp2350/rpipico2/variant.h diff --git a/variants/rpipico2w/platformio.ini b/variants/rp2350/rpipico2w/platformio.ini similarity index 91% rename from variants/rpipico2w/platformio.ini rename to variants/rp2350/rpipico2w/platformio.ini index 0fac1e9ce..3e5f2dbdd 100644 --- a/variants/rpipico2w/platformio.ini +++ b/variants/rp2350/rpipico2w/platformio.ini @@ -13,9 +13,10 @@ debug_init_cmds = monitor reset halt # add our variants files to the include and src paths -build_flags = ${rp2350_base.build_flags} +build_flags = + ${rp2350_base.build_flags} -DRPI_PICO2 - -Ivariants/rpipico2w + -Ivariants/rp2350/rpipico2w # -DDEBUG_RP2040_PORT=Serial -DHW_SPI1_DEVICE -DARDUINO_RASPBERRY_PI_PICO_2W diff --git a/variants/rpipico2w/variant.h b/variants/rp2350/rpipico2w/variant.h similarity index 100% rename from variants/rpipico2w/variant.h rename to variants/rp2350/rpipico2w/variant.h From 1c2a3c620fb233829460821c3a73f6c987e740d2 Mon Sep 17 00:00:00 2001 From: Austin Date: Sun, 20 Jul 2025 07:21:17 -0400 Subject: [PATCH 029/180] STM32: Migrate variants to new structure (#7389) --- variants/{ => stm32}/CDEBYTE_E77-MBL/platformio.ini | 2 +- variants/{ => stm32}/CDEBYTE_E77-MBL/variant.h | 0 variants/{ => stm32}/rak3172/platformio.ini | 2 +- variants/{ => stm32}/rak3172/variant.h | 0 variants/{ => stm32}/wio-e5/platformio.ini | 2 +- variants/{ => stm32}/wio-e5/variant.h | 0 6 files changed, 3 insertions(+), 3 deletions(-) rename variants/{ => stm32}/CDEBYTE_E77-MBL/platformio.ini (92%) rename variants/{ => stm32}/CDEBYTE_E77-MBL/variant.h (100%) rename variants/{ => stm32}/rak3172/platformio.ini (93%) rename variants/{ => stm32}/rak3172/variant.h (100%) rename variants/{ => stm32}/wio-e5/platformio.ini (95%) rename variants/{ => stm32}/wio-e5/variant.h (100%) diff --git a/variants/CDEBYTE_E77-MBL/platformio.ini b/variants/stm32/CDEBYTE_E77-MBL/platformio.ini similarity index 92% rename from variants/CDEBYTE_E77-MBL/platformio.ini rename to variants/stm32/CDEBYTE_E77-MBL/platformio.ini index 5c373875c..c011f62c9 100644 --- a/variants/CDEBYTE_E77-MBL/platformio.ini +++ b/variants/stm32/CDEBYTE_E77-MBL/platformio.ini @@ -5,7 +5,7 @@ board_upload.maximum_size = 233472 ; reserve the last 28KB for filesystem board_level = extra build_flags = ${stm32_base.build_flags} - -Ivariants/CDEBYTE_E77-MBL + -Ivariants/stm32/CDEBYTE_E77-MBL -DSERIAL_UART_INSTANCE=1 -DPIN_SERIAL_RX=PA3 -DPIN_SERIAL_TX=PA2 diff --git a/variants/CDEBYTE_E77-MBL/variant.h b/variants/stm32/CDEBYTE_E77-MBL/variant.h similarity index 100% rename from variants/CDEBYTE_E77-MBL/variant.h rename to variants/stm32/CDEBYTE_E77-MBL/variant.h diff --git a/variants/rak3172/platformio.ini b/variants/stm32/rak3172/platformio.ini similarity index 93% rename from variants/rak3172/platformio.ini rename to variants/stm32/rak3172/platformio.ini index df2500f31..9799fc879 100644 --- a/variants/rak3172/platformio.ini +++ b/variants/stm32/rak3172/platformio.ini @@ -4,7 +4,7 @@ board = wiscore_rak3172 board_upload.maximum_size = 233472 ; reserve the last 28KB for filesystem build_flags = ${stm32_base.build_flags} - -Ivariants/rak3172 + -Ivariants/stm32/rak3172 -DPIN_WIRE_SDA=PA11 -DPIN_WIRE_SCL=PA12 -DMESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1 diff --git a/variants/rak3172/variant.h b/variants/stm32/rak3172/variant.h similarity index 100% rename from variants/rak3172/variant.h rename to variants/stm32/rak3172/variant.h diff --git a/variants/wio-e5/platformio.ini b/variants/stm32/wio-e5/platformio.ini similarity index 95% rename from variants/wio-e5/platformio.ini rename to variants/stm32/wio-e5/platformio.ini index 5c9f433d4..c057946dd 100644 --- a/variants/wio-e5/platformio.ini +++ b/variants/stm32/wio-e5/platformio.ini @@ -4,7 +4,7 @@ board = lora_e5_dev_board board_upload.maximum_size = 233472 ; reserve the last 28KB for filesystem build_flags = ${stm32_base.build_flags} - -Ivariants/wio-e5 + -Ivariants/stm32/wio-e5 -DSERIAL_UART_INSTANCE=1 -DPIN_SERIAL_RX=PB7 -DPIN_SERIAL_TX=PB6 diff --git a/variants/wio-e5/variant.h b/variants/stm32/wio-e5/variant.h similarity index 100% rename from variants/wio-e5/variant.h rename to variants/stm32/wio-e5/variant.h From a9c9b96eb6003818d60f9845c19a84257c220cee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sun, 20 Jul 2025 13:22:00 +0200 Subject: [PATCH 030/180] UDP for RAK4631 Eth Gw and the t-eth-elite. Solves #7149 (#7385) * UDP for RAK4631 Eth Gw and the t-eth-elite. Also enable IP output on Portduino. Solves #7149 * Copilot suggestion Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix portduino build * initialize local port --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ben Meadors --- arch/portduino/portduino.ini | 2 +- src/mesh/eth/ethClient.cpp | 3 ++ src/mesh/eth/ethClient.h | 1 - src/mesh/udp/UdpMulticastHandler.h | 26 +++++++--- src/platform/nrf52/AsyncUDP.cpp | 69 ++++++++++++++++++++++++++ src/platform/nrf52/AsyncUDP.h | 57 +++++++++++++++++++++ variants/rak4631_eth_gw/platformio.ini | 1 + variants/t-eth-elite/platformio.ini | 1 + 8 files changed, 151 insertions(+), 9 deletions(-) create mode 100644 src/platform/nrf52/AsyncUDP.cpp create mode 100644 src/platform/nrf52/AsyncUDP.h diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini index 03a8a6583..693ab63b7 100644 --- a/arch/portduino/portduino.ini +++ b/arch/portduino/portduino.ini @@ -39,7 +39,7 @@ build_flags = -Isrc/platform/portduino -DRADIOLIB_EEPROM_UNSUPPORTED -DPORTDUINO_LINUX_HARDWARE - -DHAS_UDP_MULTICAST + -DHAS_UDP_MULTICAST=1 -lpthread -lstdc++fs -lbluetooth diff --git a/src/mesh/eth/ethClient.cpp b/src/mesh/eth/ethClient.cpp index 9c92a6c27..fdcc0f4f7 100644 --- a/src/mesh/eth/ethClient.cpp +++ b/src/mesh/eth/ethClient.cpp @@ -68,6 +68,9 @@ static int32_t reconnectETH() initApiServer(); } #endif + if (udpHandler && config.network.enabled_protocols & meshtastic_Config_NetworkConfig_ProtocolFlags_UDP_BROADCAST) { + udpHandler->start(); + } ethStartupComplete = true; } diff --git a/src/mesh/eth/ethClient.h b/src/mesh/eth/ethClient.h index 9e1745b9f..3adf481d2 100644 --- a/src/mesh/eth/ethClient.h +++ b/src/mesh/eth/ethClient.h @@ -2,7 +2,6 @@ #include "configuration.h" #include -#include bool initEthernet(); bool isEthernetAvailable(); diff --git a/src/mesh/udp/UdpMulticastHandler.h b/src/mesh/udp/UdpMulticastHandler.h index d1cc1065c..d4e0eaa8c 100644 --- a/src/mesh/udp/UdpMulticastHandler.h +++ b/src/mesh/udp/UdpMulticastHandler.h @@ -4,8 +4,13 @@ #include "main.h" #include "mesh/Router.h" -#include +#if HAS_ETHERNET && defined(ARCH_NRF52) +#include "mesh/eth/ethClient.h" +#else #include +#endif + +#include #if HAS_ETHERNET && defined(USE_WS5500) #include @@ -22,11 +27,11 @@ class UdpMulticastHandler final void start() { if (udp.listenMulticast(udpIpAddress, UDP_MULTICAST_DEFAUL_PORT, 64)) { -#ifndef ARCH_PORTDUINO - // FIXME(PORTDUINO): arduino lacks IPAddress::toString() - LOG_DEBUG("UDP Listening on IP: %s", WiFi.localIP().toString().c_str()); +#if defined(ARCH_NRF52) || defined(ARCH_PORTDUINO) + LOG_DEBUG("UDP Listening on IP: %u.%u.%u.%u:%u", udpIpAddress[0], udpIpAddress[1], udpIpAddress[2], udpIpAddress[3], + UDP_MULTICAST_DEFAUL_PORT); #else - LOG_DEBUG("UDP Listening"); + LOG_DEBUG("UDP Listening on IP: %s", WiFi.localIP().toString().c_str()); #endif udp.onPacket([this](AsyncUDPPacket packet) { onReceive(packet); }); } else { @@ -37,7 +42,10 @@ class UdpMulticastHandler final void onReceive(AsyncUDPPacket packet) { size_t packetLength = packet.length(); -#ifndef ARCH_PORTDUINO +#if defined(ARCH_NRF52) + IPAddress ip = packet.remoteIP(); + LOG_DEBUG("UDP broadcast from: %u.%u.%u.%u, len=%u", ip[0], ip[1], ip[2], ip[3], packetLength); +#elif !defined(ARCH_PORTDUINO) // FIXME(PORTDUINO): arduino lacks IPAddress::toString() LOG_DEBUG("UDP broadcast from: %s, len=%u", packet.remoteIP().toString().c_str(), packetLength); #endif @@ -61,7 +69,11 @@ class UdpMulticastHandler final if (!mp || !udp) { return false; } -#ifndef ARCH_PORTDUINO +#if defined(ARCH_NRF52) + if (!isEthernetAvailable()) { + return false; + } +#elif !defined(ARCH_PORTDUINO) if (WiFi.status() != WL_CONNECTED) { return false; } diff --git a/src/platform/nrf52/AsyncUDP.cpp b/src/platform/nrf52/AsyncUDP.cpp new file mode 100644 index 000000000..956105cdf --- /dev/null +++ b/src/platform/nrf52/AsyncUDP.cpp @@ -0,0 +1,69 @@ +#include "AsyncUDP.h" + +AsyncUDP::AsyncUDP() : OSThread("AsyncUDP"), localPort(0) {} + +bool AsyncUDP::listenMulticast(IPAddress multicastIP, uint16_t port, uint8_t ttl) +{ + if (!isMulticast(multicastIP)) + return false; + localPort = port; + udp.beginMulticast(multicastIP, port); + return true; +} + +size_t AsyncUDP::write(uint8_t b) +{ + return udp.write(&b, 1); +} + +size_t AsyncUDP::write(const uint8_t *data, size_t len) +{ + return udp.write(data, len); +} + +void AsyncUDP::onPacket(const std::function &callback) +{ + _onPacket = callback; +} + +bool AsyncUDP::writeTo(const uint8_t *data, size_t len, IPAddress ip, uint16_t port) +{ + if (!udp.beginPacket(ip, port)) + return false; + udp.write(data, len); + return udp.endPacket(); +} + +// AsyncUDPPacket +AsyncUDPPacket::AsyncUDPPacket(EthernetUDP &source) : _udp(source), _remoteIP(source.remoteIP()), _remotePort(source.remotePort()) +{ + if (_udp.available() > 0) { + _readLength = _udp.read(_buffer, sizeof(_buffer)); + } else { + _readLength = 0; + } +} + +IPAddress AsyncUDPPacket::remoteIP() +{ + return _remoteIP; +} + +uint16_t AsyncUDPPacket::length() +{ + return _readLength; +} + +const uint8_t *AsyncUDPPacket::data() +{ + return _buffer; +} + +int32_t AsyncUDP::runOnce() +{ + if (_onPacket && udp.parsePacket() > 0) { + AsyncUDPPacket packet(udp); + _onPacket(packet); + } + return 5; // check every 5ms +} diff --git a/src/platform/nrf52/AsyncUDP.h b/src/platform/nrf52/AsyncUDP.h new file mode 100644 index 000000000..c7df6d9dd --- /dev/null +++ b/src/platform/nrf52/AsyncUDP.h @@ -0,0 +1,57 @@ +#ifndef ASYNC_UDP_H +#define ASYNC_UDP_H + +#include "concurrency/OSThread.h" +#include +#include +#include +#include +#include + +class AsyncUDPPacket; + +class AsyncUDP : public Print, private concurrency::OSThread +{ + public: + AsyncUDP(); + explicit operator bool() const { return localPort != 0; } + + bool listenMulticast(IPAddress multicastIP, uint16_t port, uint8_t ttl = 64); + bool writeTo(const uint8_t *data, size_t len, IPAddress ip, uint16_t port); + + size_t write(uint8_t b) override; + size_t write(const uint8_t *data, size_t len) override; + void onPacket(const std::function &callback); + + private: + EthernetUDP udp; + uint16_t localPort; + std::function _onPacket; + virtual int32_t runOnce() override; +}; + +class AsyncUDPPacket +{ + public: + AsyncUDPPacket(EthernetUDP &source); + + IPAddress remoteIP(); + uint16_t length(); + const uint8_t *data(); + + private: + EthernetUDP &_udp; + IPAddress _remoteIP; + uint16_t _remotePort; + size_t _readLength = 0; + + static constexpr size_t BUF_SIZE = 512; + uint8_t _buffer[BUF_SIZE]; +}; + +inline bool isMulticast(const IPAddress &ip) +{ + return (ip[0] & 0xF0) == 0xE0; +} + +#endif // ASYNC_UDP_H diff --git a/variants/rak4631_eth_gw/platformio.ini b/variants/rak4631_eth_gw/platformio.ini index 492ca374b..7e7b0e019 100644 --- a/variants/rak4631_eth_gw/platformio.ini +++ b/variants/rak4631_eth_gw/platformio.ini @@ -5,6 +5,7 @@ board = wiscore_rak4631 board_check = true build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631_eth_gw -D RAK_4631 -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. + -DHAS_UDP_MULTICAST=1 -DEINK_DISPLAY_MODEL=GxEPD2_213_BN -DEINK_WIDTH=250 -DEINK_HEIGHT=122 diff --git a/variants/t-eth-elite/platformio.ini b/variants/t-eth-elite/platformio.ini index d6f415f3d..c2f183dd5 100644 --- a/variants/t-eth-elite/platformio.ini +++ b/variants/t-eth-elite/platformio.ini @@ -6,6 +6,7 @@ board_build.partitions = default_16MB.csv build_flags = ${esp32s3_base.build_flags} -D T_ETH_ELITE + -D HAS_UDP_MULTICAST=1 -I variants/t-eth-elite -D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. From bc9023399d348fd50e7f1fe778c915218d176ea2 Mon Sep 17 00:00:00 2001 From: Jason P Date: Sun, 20 Jul 2025 13:43:54 -0500 Subject: [PATCH 031/180] Restore High Resolution Hour Hand (#7392) * Restore High Resolution Hour Hand * Drop the int16_t --- src/graphics/draw/ClockRenderer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/graphics/draw/ClockRenderer.cpp b/src/graphics/draw/ClockRenderer.cpp index cc0b6f70b..08466662c 100644 --- a/src/graphics/draw/ClockRenderer.cpp +++ b/src/graphics/draw/ClockRenderer.cpp @@ -365,6 +365,9 @@ void drawAnalogClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 // hour hand radius and y coordinate int16_t hourHandRadius = radius * 0.35; + if (isHighResolution) { + hourHandRadius = radius * 0.55; + } int16_t hourHandNoonY = centerY - hourHandRadius; display->setColor(OLEDDISPLAY_COLOR::WHITE); From 73347c25423e37eece49024194e9e69430a35e2a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 20 Jul 2025 15:03:56 -0500 Subject: [PATCH 032/180] Update protobufs (#7395) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/config.pb.h | 3 +- src/mesh/generated/meshtastic/mesh.pb.h | 9 ++++-- src/mesh/generated/meshtastic/telemetry.pb.h | 33 +++++++++++++++----- 4 files changed, 35 insertions(+), 12 deletions(-) diff --git a/protobufs b/protobufs index f6448be77..15c1fbde8 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit f6448be7770a3521bf52407ff8f5fa5b9b06da7b +Subproject commit 15c1fbde882de953dec279160fa984d0e00569d0 diff --git a/src/mesh/generated/meshtastic/config.pb.h b/src/mesh/generated/meshtastic/config.pb.h index 20bce5b78..bd43472b5 100644 --- a/src/mesh/generated/meshtastic/config.pb.h +++ b/src/mesh/generated/meshtastic/config.pb.h @@ -480,7 +480,8 @@ typedef struct _meshtastic_Config_DisplayConfig { /* Number of seconds the screen stays on after pressing the user button or receiving a message 0 for default of one minute MAXUINT for always on */ uint32_t screen_on_secs; - /* How the GPS coordinates are formatted on the OLED screen. */ + /* Deprecated in 2.7.4: Unused + How the GPS coordinates are formatted on the OLED screen. */ meshtastic_Config_DisplayConfig_GpsCoordinateFormat gps_format; /* Automatically toggles to the next page on the screen like a carousel, based the specified interval in seconds. Potentially useful for devices without user buttons. */ diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index 584c3d647..d1a38b565 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -426,7 +426,10 @@ typedef enum _meshtastic_Routing_Error { /* Admin packet otherwise checks out, but uses a bogus or expired session key */ meshtastic_Routing_Error_ADMIN_BAD_SESSION_KEY = 36, /* Admin packet sent using PKC, but not from a public key on the admin key list */ - meshtastic_Routing_Error_ADMIN_PUBLIC_KEY_UNAUTHORIZED = 37 + meshtastic_Routing_Error_ADMIN_PUBLIC_KEY_UNAUTHORIZED = 37, + /* Airtime fairness rate limit exceeded for a packet + This typically enforced per portnum and is used to prevent a single node from monopolizing airtime */ + meshtastic_Routing_Error_RATE_LIMIT_EXCEEDED = 38 } meshtastic_Routing_Error; /* The priority of this message for sending. @@ -1222,8 +1225,8 @@ extern "C" { #define _meshtastic_Position_AltSource_ARRAYSIZE ((meshtastic_Position_AltSource)(meshtastic_Position_AltSource_ALT_BAROMETRIC+1)) #define _meshtastic_Routing_Error_MIN meshtastic_Routing_Error_NONE -#define _meshtastic_Routing_Error_MAX meshtastic_Routing_Error_ADMIN_PUBLIC_KEY_UNAUTHORIZED -#define _meshtastic_Routing_Error_ARRAYSIZE ((meshtastic_Routing_Error)(meshtastic_Routing_Error_ADMIN_PUBLIC_KEY_UNAUTHORIZED+1)) +#define _meshtastic_Routing_Error_MAX meshtastic_Routing_Error_RATE_LIMIT_EXCEEDED +#define _meshtastic_Routing_Error_ARRAYSIZE ((meshtastic_Routing_Error)(meshtastic_Routing_Error_RATE_LIMIT_EXCEEDED+1)) #define _meshtastic_MeshPacket_Priority_MIN meshtastic_MeshPacket_Priority_UNSET #define _meshtastic_MeshPacket_Priority_MAX meshtastic_MeshPacket_Priority_MAX diff --git a/src/mesh/generated/meshtastic/telemetry.pb.h b/src/mesh/generated/meshtastic/telemetry.pb.h index 072a99a24..cb47b9fda 100644 --- a/src/mesh/generated/meshtastic/telemetry.pb.h +++ b/src/mesh/generated/meshtastic/telemetry.pb.h @@ -93,7 +93,11 @@ typedef enum _meshtastic_TelemetrySensorType { /* PCT2075 Temperature Sensor */ meshtastic_TelemetrySensorType_PCT2075 = 39, /* ADS1X15 ADC */ - meshtastic_TelemetrySensorType_ADS1X15 = 40 + meshtastic_TelemetrySensorType_ADS1X15 = 40, + /* ADS1X15 ADC_ALT */ + meshtastic_TelemetrySensorType_ADS1X15_ALT = 41, + /* Sensirion SFA30 Formaldehyde sensor */ + meshtastic_TelemetrySensorType_SFA30 = 42 } meshtastic_TelemetrySensorType; /* Struct definitions */ @@ -287,6 +291,15 @@ typedef struct _meshtastic_AirQualityMetrics { /* CO2 sensor relative humidity in % */ bool has_co2_humidity; float co2_humidity; + /* Formaldehyde sensor formaldehyde concentration in ppb */ + bool has_form_formaldehyde; + float form_formaldehyde; + /* Formaldehyde sensor relative humidity in %RH */ + bool has_form_humidity; + float form_humidity; + /* Formaldehyde sensor temperature in degrees Celsius */ + bool has_form_temperature; + float form_temperature; } meshtastic_AirQualityMetrics; /* Local device mesh statistics */ @@ -398,8 +411,8 @@ extern "C" { /* Helper constants for enums */ #define _meshtastic_TelemetrySensorType_MIN meshtastic_TelemetrySensorType_SENSOR_UNSET -#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_ADS1X15 -#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_ADS1X15+1)) +#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_SFA30 +#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_SFA30+1)) @@ -415,7 +428,7 @@ extern "C" { #define meshtastic_DeviceMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_EnvironmentMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_PowerMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} -#define meshtastic_AirQualityMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} +#define meshtastic_AirQualityMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_LocalStats_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_HealthMetrics_init_default {false, 0, false, 0, false, 0} #define meshtastic_HostMetrics_init_default {0, 0, 0, false, 0, false, 0, 0, 0, 0, false, ""} @@ -424,7 +437,7 @@ extern "C" { #define meshtastic_DeviceMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_EnvironmentMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_PowerMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} -#define meshtastic_AirQualityMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} +#define meshtastic_AirQualityMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_LocalStats_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_HealthMetrics_init_zero {false, 0, false, 0, false, 0} #define meshtastic_HostMetrics_init_zero {0, 0, 0, false, 0, false, 0, 0, 0, 0, false, ""} @@ -490,6 +503,9 @@ extern "C" { #define meshtastic_AirQualityMetrics_co2_tag 13 #define meshtastic_AirQualityMetrics_co2_temperature_tag 14 #define meshtastic_AirQualityMetrics_co2_humidity_tag 15 +#define meshtastic_AirQualityMetrics_form_formaldehyde_tag 16 +#define meshtastic_AirQualityMetrics_form_humidity_tag 17 +#define meshtastic_AirQualityMetrics_form_temperature_tag 18 #define meshtastic_LocalStats_uptime_seconds_tag 1 #define meshtastic_LocalStats_channel_utilization_tag 2 #define meshtastic_LocalStats_air_util_tx_tag 3 @@ -597,7 +613,10 @@ X(a, STATIC, OPTIONAL, UINT32, particles_50um, 11) \ X(a, STATIC, OPTIONAL, UINT32, particles_100um, 12) \ X(a, STATIC, OPTIONAL, UINT32, co2, 13) \ X(a, STATIC, OPTIONAL, FLOAT, co2_temperature, 14) \ -X(a, STATIC, OPTIONAL, FLOAT, co2_humidity, 15) +X(a, STATIC, OPTIONAL, FLOAT, co2_humidity, 15) \ +X(a, STATIC, OPTIONAL, FLOAT, form_formaldehyde, 16) \ +X(a, STATIC, OPTIONAL, FLOAT, form_humidity, 17) \ +X(a, STATIC, OPTIONAL, FLOAT, form_temperature, 18) #define meshtastic_AirQualityMetrics_CALLBACK NULL #define meshtastic_AirQualityMetrics_DEFAULT NULL @@ -686,7 +705,7 @@ extern const pb_msgdesc_t meshtastic_Nau7802Config_msg; /* Maximum encoded size of messages (where known) */ #define MESHTASTIC_MESHTASTIC_TELEMETRY_PB_H_MAX_SIZE meshtastic_Telemetry_size -#define meshtastic_AirQualityMetrics_size 88 +#define meshtastic_AirQualityMetrics_size 106 #define meshtastic_DeviceMetrics_size 27 #define meshtastic_EnvironmentMetrics_size 113 #define meshtastic_HealthMetrics_size 11 From b851b15a73979917656fdc96a57742f1ce4847aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sun, 20 Jul 2025 23:13:50 +0200 Subject: [PATCH 033/180] fix UDP builds on nRF (#7394) * fix UDP builds on nRF * fix rp2040 too --- src/mesh/eth/ethClient.cpp | 2 ++ src/platform/nrf52/AsyncUDP.cpp | 4 ++++ src/platform/nrf52/AsyncUDP.h | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/src/mesh/eth/ethClient.cpp b/src/mesh/eth/ethClient.cpp index fdcc0f4f7..2b4f63512 100644 --- a/src/mesh/eth/ethClient.cpp +++ b/src/mesh/eth/ethClient.cpp @@ -68,9 +68,11 @@ static int32_t reconnectETH() initApiServer(); } #endif +#if HAS_UDP_MULTICAST if (udpHandler && config.network.enabled_protocols & meshtastic_Config_NetworkConfig_ProtocolFlags_UDP_BROADCAST) { udpHandler->start(); } +#endif ethStartupComplete = true; } diff --git a/src/platform/nrf52/AsyncUDP.cpp b/src/platform/nrf52/AsyncUDP.cpp index 956105cdf..836fb1307 100644 --- a/src/platform/nrf52/AsyncUDP.cpp +++ b/src/platform/nrf52/AsyncUDP.cpp @@ -1,5 +1,7 @@ #include "AsyncUDP.h" +#if HAS_ETHERNET + AsyncUDP::AsyncUDP() : OSThread("AsyncUDP"), localPort(0) {} bool AsyncUDP::listenMulticast(IPAddress multicastIP, uint16_t port, uint8_t ttl) @@ -67,3 +69,5 @@ int32_t AsyncUDP::runOnce() } return 5; // check every 5ms } + +#endif // HAS_ETHERNET \ No newline at end of file diff --git a/src/platform/nrf52/AsyncUDP.h b/src/platform/nrf52/AsyncUDP.h index c7df6d9dd..e2b406ba9 100644 --- a/src/platform/nrf52/AsyncUDP.h +++ b/src/platform/nrf52/AsyncUDP.h @@ -1,6 +1,10 @@ #ifndef ASYNC_UDP_H #define ASYNC_UDP_H +#include "configuration.h" + +#if HAS_ETHERNET + #include "concurrency/OSThread.h" #include #include @@ -54,4 +58,6 @@ inline bool isMulticast(const IPAddress &ip) return (ip[0] & 0xF0) == 0xE0; } +#endif // HAS_ETHERNET + #endif // ASYNC_UDP_H From 475cfe4af2817a54f2a3c9ac913bb35cc9574733 Mon Sep 17 00:00:00 2001 From: Austin Date: Sun, 20 Jul 2025 17:47:37 -0400 Subject: [PATCH 034/180] ESP32s3: Migrate variants to new structure (#7343) --- variants/diy/platformio.ini | 19 ------------------- .../CDEBYTE_EoRa-S3/pins_arduino.h | 0 .../CDEBYTE_EoRa-S3/platformio.ini | 4 ++-- .../{ => esp32s3}/CDEBYTE_EoRa-S3/variant.h | 0 .../EBYTE_ESP32-S3/pins_arduino.h | 0 .../EBYTE_ESP32-S3/platformio.ini | 2 +- .../{ => esp32s3}/EBYTE_ESP32-S3/variant.h | 0 .../ELECROW-ThinkNode-M2/pins_arduino.h | 0 .../ELECROW-ThinkNode-M2/platformio.ini | 2 +- .../ELECROW-ThinkNode-M2/variant.h | 0 .../bpi_picow_esp32_s3/pins_arduino.h | 0 .../bpi_picow_esp32_s3/platformio.ini | 4 +++- .../bpi_picow_esp32_s3/variant.h | 0 .../crowpanel-esp32s3-5-epaper/pins_arduino.h | 0 .../crowpanel-esp32s3-5-epaper/platformio.ini | 12 +++++++++--- .../crowpanel-esp32s3-5-epaper/variant.h | 0 .../diy}/my_esp32s3_diy_eink/pins_arduino.h | 0 .../diy}/my_esp32s3_diy_eink/platformio.ini | 9 ++++----- .../diy}/my_esp32s3_diy_eink/variant.h | 0 .../diy}/my_esp32s3_diy_oled/pins_arduino.h | 0 .../diy}/my_esp32s3_diy_oled/platformio.ini | 9 ++++----- .../diy}/my_esp32s3_diy_oled/variant.h | 0 .../diy/t-energy-s3_e22/platformio.ini | 18 ++++++++++++++++++ .../diy/t-energy-s3_e22/variant.h | 0 .../{ => esp32s3}/dreamcatcher/platformio.ini | 4 ++-- .../{ => esp32s3}/dreamcatcher/rfswitch.h | 0 variants/{ => esp32s3}/dreamcatcher/variant.h | 0 .../elecrow_panel/pins_arduino.h | 0 .../elecrow_panel/platformio.ini | 2 +- .../{ => esp32s3}/elecrow_panel/variant.h | 0 .../esp32-s3-pico/pins_arduino.h | 0 .../esp32-s3-pico/platformio.ini | 2 +- .../{ => esp32s3}/esp32-s3-pico/variant.h | 0 .../heltec_capsule_sensor_v3/platformio.ini | 4 ++-- .../heltec_capsule_sensor_v3/variant.h | 0 .../heltec_sensor_hub/platformio.ini | 3 ++- .../{ => esp32s3}/heltec_sensor_hub/variant.h | 0 .../{ => esp32s3}/heltec_v3/platformio.ini | 4 +++- variants/{ => esp32s3}/heltec_v3/variant.h | 0 .../heltec_vision_master_e213/einkDetect.h | 0 .../heltec_vision_master_e213/nicheGraphics.h | 0 .../heltec_vision_master_e213/pins_arduino.h | 0 .../heltec_vision_master_e213/platformio.ini | 6 +++--- .../heltec_vision_master_e213/variant.h | 0 .../heltec_vision_master_e290/nicheGraphics.h | 0 .../heltec_vision_master_e290/pins_arduino.h | 0 .../heltec_vision_master_e290/platformio.ini | 6 +++--- .../heltec_vision_master_e290/variant.h | 0 .../heltec_vision_master_t190/pins_arduino.h | 0 .../heltec_vision_master_t190/platformio.ini | 6 +++--- .../heltec_vision_master_t190/variant.h | 0 .../heltec_wireless_paper/einkDetect.h | 0 .../heltec_wireless_paper/nicheGraphics.h | 0 .../heltec_wireless_paper/pins_arduino.h | 0 .../heltec_wireless_paper/platformio.ini | 6 +++--- .../heltec_wireless_paper/variant.h | 0 .../heltec_wireless_paper_v1/pins_arduino.h | 0 .../heltec_wireless_paper_v1/platformio.ini | 4 ++-- .../heltec_wireless_paper_v1/variant.h | 0 .../heltec_wireless_tracker/pins_arduino.h | 0 .../heltec_wireless_tracker/platformio.ini | 3 ++- .../heltec_wireless_tracker/variant.h | 0 .../pins_arduino.h | 0 .../platformio.ini | 3 ++- .../heltec_wireless_tracker_V1_0/variant.h | 0 .../heltec_wsl_v3/platformio.ini | 4 +++- .../{ => esp32s3}/heltec_wsl_v3/variant.h | 0 variants/{ => esp32s3}/icarus/pins_arduino.h | 0 variants/{ => esp32s3}/icarus/platformio.ini | 6 ++++-- variants/{ => esp32s3}/icarus/variant.h | 0 .../{ => esp32s3}/link32_s3_v1/pins_arduino.h | 0 .../{ => esp32s3}/link32_s3_v1/platformio.ini | 4 +++- variants/{ => esp32s3}/link32_s3_v1/variant.h | 0 .../m5stack_cores3/pins_arduino.h | 0 .../m5stack_cores3/platformio.ini | 14 ++++++-------- .../{ => esp32s3}/m5stack_cores3/variant.h | 0 .../{ => esp32s3}/nibble_esp32/platformio.ini | 4 +++- variants/{ => esp32s3}/nibble_esp32/variant.h | 0 .../nugget_s3_lora/platformio.ini | 2 +- .../{ => esp32s3}/nugget_s3_lora/variant.h | 0 .../picomputer-s3/pins_arduino.h | 0 .../picomputer-s3/platformio.ini | 2 +- .../{ => esp32s3}/picomputer-s3/variant.h | 0 variants/{ => esp32s3}/rak3312/pins_arduino.h | 0 variants/{ => esp32s3}/rak3312/platformio.ini | 4 +++- variants/{ => esp32s3}/rak3312/variant.h | 0 .../seeed-sensecap-indicator/pins_arduino.h | 0 .../seeed-sensecap-indicator/platformio.ini | 2 +- .../seeed-sensecap-indicator/variant.h | 0 .../seeed_xiao_s3/pins_arduino.h | 0 .../seeed_xiao_s3/platformio.ini | 7 ++++--- .../{ => esp32s3}/seeed_xiao_s3/variant.h | 0 .../{ => esp32s3}/station-g2/pins_arduino.h | 0 .../{ => esp32s3}/station-g2/platformio.ini | 4 +++- variants/{ => esp32s3}/station-g2/variant.h | 0 variants/{ => esp32s3}/t-deck/pins_arduino.h | 0 variants/{ => esp32s3}/t-deck/platformio.ini | 9 ++++----- variants/{ => esp32s3}/t-deck/variant.h | 0 .../{ => esp32s3}/t-eth-elite/pins_arduino.h | 0 .../{ => esp32s3}/t-eth-elite/platformio.ini | 2 +- variants/{ => esp32s3}/t-eth-elite/rfswitch.h | 0 variants/{ => esp32s3}/t-eth-elite/variant.h | 0 .../{ => esp32s3}/t-watch-s3/pins_arduino.h | 0 .../{ => esp32s3}/t-watch-s3/platformio.ini | 2 +- variants/{ => esp32s3}/t-watch-s3/variant.h | 0 .../tbeam-s3-core/pins_arduino.h | 0 .../tbeam-s3-core/platformio.ini | 4 ++-- .../{ => esp32s3}/tbeam-s3-core/variant.h | 0 .../tlora_t3s3_epaper/nicheGraphics.h | 0 .../tlora_t3s3_epaper/pins_arduino.h | 0 .../tlora_t3s3_epaper/platformio.ini | 8 +++++--- .../{ => esp32s3}/tlora_t3s3_epaper/variant.h | 0 .../tlora_t3s3_v1/pins_arduino.h | 0 .../tlora_t3s3_v1/platformio.ini | 4 ++-- .../{ => esp32s3}/tlora_t3s3_v1/rfswitch.h | 0 .../{ => esp32s3}/tlora_t3s3_v1/variant.h | 0 .../tracksenger/internal/pins_arduino.h | 0 .../tracksenger/internal/variant.h | 0 .../tracksenger/lcd/pins_arduino.h | 0 .../{ => esp32s3}/tracksenger/lcd/variant.h | 0 .../tracksenger/oled/pins_arduino.h | 0 .../{ => esp32s3}/tracksenger/oled/variant.h | 0 .../{ => esp32s3}/tracksenger/platformio.ini | 9 ++++++--- variants/{ => esp32s3}/unphone/pins_arduino.h | 0 variants/{ => esp32s3}/unphone/platformio.ini | 4 ++-- variants/{ => esp32s3}/unphone/variant.cpp | 0 variants/{ => esp32s3}/unphone/variant.h | 0 127 files changed, 126 insertions(+), 101 deletions(-) rename variants/{ => esp32s3}/CDEBYTE_EoRa-S3/pins_arduino.h (100%) rename variants/{ => esp32s3}/CDEBYTE_EoRa-S3/platformio.ini (69%) rename variants/{ => esp32s3}/CDEBYTE_EoRa-S3/variant.h (100%) rename variants/{ => esp32s3}/EBYTE_ESP32-S3/pins_arduino.h (100%) rename variants/{ => esp32s3}/EBYTE_ESP32-S3/platformio.ini (86%) rename variants/{ => esp32s3}/EBYTE_ESP32-S3/variant.h (100%) rename variants/{ => esp32s3}/ELECROW-ThinkNode-M2/pins_arduino.h (100%) rename variants/{ => esp32s3}/ELECROW-ThinkNode-M2/platformio.ini (76%) rename variants/{ => esp32s3}/ELECROW-ThinkNode-M2/variant.h (100%) rename variants/{ => esp32s3}/bpi_picow_esp32_s3/pins_arduino.h (100%) rename variants/{ => esp32s3}/bpi_picow_esp32_s3/platformio.ini (77%) rename variants/{ => esp32s3}/bpi_picow_esp32_s3/variant.h (100%) rename variants/{ => esp32s3}/crowpanel-esp32s3-5-epaper/pins_arduino.h (100%) rename variants/{ => esp32s3}/crowpanel-esp32s3-5-epaper/platformio.ini (89%) rename variants/{ => esp32s3}/crowpanel-esp32s3-5-epaper/variant.h (100%) rename variants/{ => esp32s3/diy}/my_esp32s3_diy_eink/pins_arduino.h (100%) rename variants/{ => esp32s3/diy}/my_esp32s3_diy_eink/platformio.ini (71%) rename variants/{ => esp32s3/diy}/my_esp32s3_diy_eink/variant.h (100%) rename variants/{ => esp32s3/diy}/my_esp32s3_diy_oled/pins_arduino.h (100%) rename variants/{ => esp32s3/diy}/my_esp32s3_diy_oled/platformio.ini (67%) rename variants/{ => esp32s3/diy}/my_esp32s3_diy_oled/variant.h (100%) create mode 100644 variants/esp32s3/diy/t-energy-s3_e22/platformio.ini rename variants/{ => esp32s3}/diy/t-energy-s3_e22/variant.h (100%) rename variants/{ => esp32s3}/dreamcatcher/platformio.ini (89%) rename variants/{ => esp32s3}/dreamcatcher/rfswitch.h (100%) rename variants/{ => esp32s3}/dreamcatcher/variant.h (100%) rename variants/{ => esp32s3}/elecrow_panel/pins_arduino.h (100%) rename variants/{ => esp32s3}/elecrow_panel/platformio.ini (99%) rename variants/{ => esp32s3}/elecrow_panel/variant.h (100%) rename variants/{ => esp32s3}/esp32-s3-pico/pins_arduino.h (100%) rename variants/{ => esp32s3}/esp32-s3-pico/platformio.ini (94%) rename variants/{ => esp32s3}/esp32-s3-pico/variant.h (100%) rename variants/{ => esp32s3}/heltec_capsule_sensor_v3/platformio.ini (82%) rename variants/{ => esp32s3}/heltec_capsule_sensor_v3/variant.h (100%) rename variants/{ => esp32s3}/heltec_sensor_hub/platformio.ini (75%) rename variants/{ => esp32s3}/heltec_sensor_hub/variant.h (100%) rename variants/{ => esp32s3}/heltec_v3/platformio.ini (77%) rename variants/{ => esp32s3}/heltec_v3/variant.h (100%) rename variants/{ => esp32s3}/heltec_vision_master_e213/einkDetect.h (100%) rename variants/{ => esp32s3}/heltec_vision_master_e213/nicheGraphics.h (100%) rename variants/{ => esp32s3}/heltec_vision_master_e213/pins_arduino.h (100%) rename variants/{ => esp32s3}/heltec_vision_master_e213/platformio.ini (91%) rename variants/{ => esp32s3}/heltec_vision_master_e213/variant.h (100%) rename variants/{ => esp32s3}/heltec_vision_master_e290/nicheGraphics.h (100%) rename variants/{ => esp32s3}/heltec_vision_master_e290/pins_arduino.h (100%) rename variants/{ => esp32s3}/heltec_vision_master_e290/platformio.ini (91%) rename variants/{ => esp32s3}/heltec_vision_master_e290/variant.h (100%) rename variants/{ => esp32s3}/heltec_vision_master_t190/pins_arduino.h (100%) rename variants/{ => esp32s3}/heltec_vision_master_t190/platformio.ini (77%) rename variants/{ => esp32s3}/heltec_vision_master_t190/variant.h (100%) rename variants/{ => esp32s3}/heltec_wireless_paper/einkDetect.h (100%) rename variants/{ => esp32s3}/heltec_wireless_paper/nicheGraphics.h (100%) rename variants/{ => esp32s3}/heltec_wireless_paper/pins_arduino.h (100%) rename variants/{ => esp32s3}/heltec_wireless_paper/platformio.ini (92%) rename variants/{ => esp32s3}/heltec_wireless_paper/variant.h (100%) rename variants/{ => esp32s3}/heltec_wireless_paper_v1/pins_arduino.h (100%) rename variants/{ => esp32s3}/heltec_wireless_paper_v1/platformio.ini (91%) rename variants/{ => esp32s3}/heltec_wireless_paper_v1/variant.h (100%) rename variants/{ => esp32s3}/heltec_wireless_tracker/pins_arduino.h (100%) rename variants/{ => esp32s3}/heltec_wireless_tracker/platformio.ini (85%) rename variants/{ => esp32s3}/heltec_wireless_tracker/variant.h (100%) rename variants/{ => esp32s3}/heltec_wireless_tracker_V1_0/pins_arduino.h (100%) rename variants/{ => esp32s3}/heltec_wireless_tracker_V1_0/platformio.ini (85%) rename variants/{ => esp32s3}/heltec_wireless_tracker_V1_0/variant.h (100%) rename variants/{ => esp32s3}/heltec_wsl_v3/platformio.ini (78%) rename variants/{ => esp32s3}/heltec_wsl_v3/variant.h (100%) rename variants/{ => esp32s3}/icarus/pins_arduino.h (100%) rename variants/{ => esp32s3}/icarus/platformio.ini (84%) rename variants/{ => esp32s3}/icarus/variant.h (100%) rename variants/{ => esp32s3}/link32_s3_v1/pins_arduino.h (100%) rename variants/{ => esp32s3}/link32_s3_v1/platformio.ini (81%) rename variants/{ => esp32s3}/link32_s3_v1/variant.h (100%) rename variants/{ => esp32s3}/m5stack_cores3/pins_arduino.h (100%) rename variants/{ => esp32s3}/m5stack_cores3/platformio.ini (53%) rename variants/{ => esp32s3}/m5stack_cores3/variant.h (100%) rename variants/{ => esp32s3}/nibble_esp32/platformio.ini (55%) rename variants/{ => esp32s3}/nibble_esp32/variant.h (100%) rename variants/{ => esp32s3}/nugget_s3_lora/platformio.ini (78%) rename variants/{ => esp32s3}/nugget_s3_lora/variant.h (100%) rename variants/{ => esp32s3}/picomputer-s3/pins_arduino.h (100%) rename variants/{ => esp32s3}/picomputer-s3/platformio.ini (97%) rename variants/{ => esp32s3}/picomputer-s3/variant.h (100%) rename variants/{ => esp32s3}/rak3312/pins_arduino.h (100%) rename variants/{ => esp32s3}/rak3312/platformio.ini (63%) rename variants/{ => esp32s3}/rak3312/variant.h (100%) rename variants/{ => esp32s3}/seeed-sensecap-indicator/pins_arduino.h (100%) rename variants/{ => esp32s3}/seeed-sensecap-indicator/platformio.ini (97%) rename variants/{ => esp32s3}/seeed-sensecap-indicator/variant.h (100%) rename variants/{ => esp32s3}/seeed_xiao_s3/pins_arduino.h (100%) rename variants/{ => esp32s3}/seeed_xiao_s3/platformio.ini (74%) rename variants/{ => esp32s3}/seeed_xiao_s3/variant.h (100%) rename variants/{ => esp32s3}/station-g2/pins_arduino.h (100%) rename variants/{ => esp32s3}/station-g2/platformio.ini (83%) rename variants/{ => esp32s3}/station-g2/variant.h (100%) rename variants/{ => esp32s3}/t-deck/pins_arduino.h (100%) rename variants/{ => esp32s3}/t-deck/platformio.ini (95%) rename variants/{ => esp32s3}/t-deck/variant.h (100%) rename variants/{ => esp32s3}/t-eth-elite/pins_arduino.h (100%) rename variants/{ => esp32s3}/t-eth-elite/platformio.ini (93%) rename variants/{ => esp32s3}/t-eth-elite/rfswitch.h (100%) rename variants/{ => esp32s3}/t-eth-elite/variant.h (100%) rename variants/{ => esp32s3}/t-watch-s3/pins_arduino.h (100%) rename variants/{ => esp32s3}/t-watch-s3/platformio.ini (93%) rename variants/{ => esp32s3}/t-watch-s3/variant.h (100%) rename variants/{ => esp32s3}/tbeam-s3-core/pins_arduino.h (100%) rename variants/{ => esp32s3}/tbeam-s3-core/platformio.ini (71%) rename variants/{ => esp32s3}/tbeam-s3-core/variant.h (100%) rename variants/{ => esp32s3}/tlora_t3s3_epaper/nicheGraphics.h (100%) rename variants/{ => esp32s3}/tlora_t3s3_epaper/pins_arduino.h (100%) rename variants/{ => esp32s3}/tlora_t3s3_epaper/platformio.ini (85%) rename variants/{ => esp32s3}/tlora_t3s3_epaper/variant.h (100%) rename variants/{ => esp32s3}/tlora_t3s3_v1/pins_arduino.h (100%) rename variants/{ => esp32s3}/tlora_t3s3_v1/platformio.ini (58%) rename variants/{ => esp32s3}/tlora_t3s3_v1/rfswitch.h (100%) rename variants/{ => esp32s3}/tlora_t3s3_v1/variant.h (100%) rename variants/{ => esp32s3}/tracksenger/internal/pins_arduino.h (100%) rename variants/{ => esp32s3}/tracksenger/internal/variant.h (100%) rename variants/{ => esp32s3}/tracksenger/lcd/pins_arduino.h (100%) rename variants/{ => esp32s3}/tracksenger/lcd/variant.h (100%) rename variants/{ => esp32s3}/tracksenger/oled/pins_arduino.h (100%) rename variants/{ => esp32s3}/tracksenger/oled/variant.h (100%) rename variants/{ => esp32s3}/tracksenger/platformio.ini (85%) rename variants/{ => esp32s3}/unphone/pins_arduino.h (100%) rename variants/{ => esp32s3}/unphone/platformio.ini (96%) rename variants/{ => esp32s3}/unphone/variant.cpp (100%) rename variants/{ => esp32s3}/unphone/variant.h (100%) diff --git a/variants/diy/platformio.ini b/variants/diy/platformio.ini index 87451dfce..6b3a2ed99 100644 --- a/variants/diy/platformio.ini +++ b/variants/diy/platformio.ini @@ -78,22 +78,3 @@ build_src_filter = ${nrf52_base.build_src_filter} +<../variants/diy/seeed-xiao-n lib_deps = ${nrf52840_base.lib_deps} debug_tool = jlink - -; NanoVHF T-Energy-S3 + E22(0)-xxxM - DIY -[env:t-energy-s3_e22] -extends = esp32s3_base -board = esp32-s3-devkitc-1 -board_build.partitions = default_16MB.csv -board_level = extra -board_upload.flash_size = 16MB ;Specify the FLASH capacity as 16MB -board_build.arduino.memory_type = qio_opi ;Enable internal PSRAM -build_unflags = - ${esp32s3_base.build_unflags} - -D ARDUINO_USB_MODE=1 -build_flags = - ${esp32s3_base.build_flags} - -D EBYTE_ESP32_S3 - -D BOARD_HAS_PSRAM - -D ARDUINO_USB_MODE=0 - -D ARDUINO_USB_CDC_ON_BOOT=1 - -I variants/diy/t-energy-s3_e22 diff --git a/variants/CDEBYTE_EoRa-S3/pins_arduino.h b/variants/esp32s3/CDEBYTE_EoRa-S3/pins_arduino.h similarity index 100% rename from variants/CDEBYTE_EoRa-S3/pins_arduino.h rename to variants/esp32s3/CDEBYTE_EoRa-S3/pins_arduino.h diff --git a/variants/CDEBYTE_EoRa-S3/platformio.ini b/variants/esp32s3/CDEBYTE_EoRa-S3/platformio.ini similarity index 69% rename from variants/CDEBYTE_EoRa-S3/platformio.ini rename to variants/esp32s3/CDEBYTE_EoRa-S3/platformio.ini index a1642ff97..dbd420f04 100644 --- a/variants/CDEBYTE_EoRa-S3/platformio.ini +++ b/variants/esp32s3/CDEBYTE_EoRa-S3/platformio.ini @@ -4,5 +4,5 @@ board = CDEBYTE_EoRa-S3 build_flags = ${esp32s3_base.build_flags} -D CDEBYTE_EORA_S3 - -I variants/CDEBYTE_EoRa-S3 - -D GPS_POWER_TOGGLE \ No newline at end of file + -I variants/esp32s3/CDEBYTE_EoRa-S3 + -D GPS_POWER_TOGGLE diff --git a/variants/CDEBYTE_EoRa-S3/variant.h b/variants/esp32s3/CDEBYTE_EoRa-S3/variant.h similarity index 100% rename from variants/CDEBYTE_EoRa-S3/variant.h rename to variants/esp32s3/CDEBYTE_EoRa-S3/variant.h diff --git a/variants/EBYTE_ESP32-S3/pins_arduino.h b/variants/esp32s3/EBYTE_ESP32-S3/pins_arduino.h similarity index 100% rename from variants/EBYTE_ESP32-S3/pins_arduino.h rename to variants/esp32s3/EBYTE_ESP32-S3/pins_arduino.h diff --git a/variants/EBYTE_ESP32-S3/platformio.ini b/variants/esp32s3/EBYTE_ESP32-S3/platformio.ini similarity index 86% rename from variants/EBYTE_ESP32-S3/platformio.ini rename to variants/esp32s3/EBYTE_ESP32-S3/platformio.ini index 10de91386..507a19588 100644 --- a/variants/EBYTE_ESP32-S3/platformio.ini +++ b/variants/esp32s3/EBYTE_ESP32-S3/platformio.ini @@ -6,4 +6,4 @@ board_level = extra build_flags = ${esp32s3_base.build_flags} -D EBYTE_ESP32_S3 - -I variants/EBYTE_ESP32-S3 + -I variants/esp32s3/EBYTE_ESP32-S3 diff --git a/variants/EBYTE_ESP32-S3/variant.h b/variants/esp32s3/EBYTE_ESP32-S3/variant.h similarity index 100% rename from variants/EBYTE_ESP32-S3/variant.h rename to variants/esp32s3/EBYTE_ESP32-S3/variant.h diff --git a/variants/ELECROW-ThinkNode-M2/pins_arduino.h b/variants/esp32s3/ELECROW-ThinkNode-M2/pins_arduino.h similarity index 100% rename from variants/ELECROW-ThinkNode-M2/pins_arduino.h rename to variants/esp32s3/ELECROW-ThinkNode-M2/pins_arduino.h diff --git a/variants/ELECROW-ThinkNode-M2/platformio.ini b/variants/esp32s3/ELECROW-ThinkNode-M2/platformio.ini similarity index 76% rename from variants/ELECROW-ThinkNode-M2/platformio.ini rename to variants/esp32s3/ELECROW-ThinkNode-M2/platformio.ini index c08c94a71..01e82184b 100644 --- a/variants/ELECROW-ThinkNode-M2/platformio.ini +++ b/variants/esp32s3/ELECROW-ThinkNode-M2/platformio.ini @@ -4,4 +4,4 @@ board = ESP32-S3-WROOM-1-N4 build_flags = ${esp32s3_base.build_flags} -D ELECROW_ThinkNode_M2 - -I variants/ELECROW-ThinkNode-M2 + -I variants/esp32s3/ELECROW-ThinkNode-M2 diff --git a/variants/ELECROW-ThinkNode-M2/variant.h b/variants/esp32s3/ELECROW-ThinkNode-M2/variant.h similarity index 100% rename from variants/ELECROW-ThinkNode-M2/variant.h rename to variants/esp32s3/ELECROW-ThinkNode-M2/variant.h diff --git a/variants/bpi_picow_esp32_s3/pins_arduino.h b/variants/esp32s3/bpi_picow_esp32_s3/pins_arduino.h similarity index 100% rename from variants/bpi_picow_esp32_s3/pins_arduino.h rename to variants/esp32s3/bpi_picow_esp32_s3/pins_arduino.h diff --git a/variants/bpi_picow_esp32_s3/platformio.ini b/variants/esp32s3/bpi_picow_esp32_s3/platformio.ini similarity index 77% rename from variants/bpi_picow_esp32_s3/platformio.ini rename to variants/esp32s3/bpi_picow_esp32_s3/platformio.ini index 7e94cc97e..57af0da82 100644 --- a/variants/bpi_picow_esp32_s3/platformio.ini +++ b/variants/esp32s3/bpi_picow_esp32_s3/platformio.ini @@ -11,4 +11,6 @@ lib_deps = ${esp32_base.lib_deps} caveman99/ESP32 Codec2@^1.0.1 build_flags = - ${esp32_base.build_flags} -D PRIVATE_HW -I variants/bpi_picow_esp32_s3 \ No newline at end of file + ${esp32_base.build_flags} + -D PRIVATE_HW + -I variants/esp32s3/bpi_picow_esp32_s3 diff --git a/variants/bpi_picow_esp32_s3/variant.h b/variants/esp32s3/bpi_picow_esp32_s3/variant.h similarity index 100% rename from variants/bpi_picow_esp32_s3/variant.h rename to variants/esp32s3/bpi_picow_esp32_s3/variant.h diff --git a/variants/crowpanel-esp32s3-5-epaper/pins_arduino.h b/variants/esp32s3/crowpanel-esp32s3-5-epaper/pins_arduino.h similarity index 100% rename from variants/crowpanel-esp32s3-5-epaper/pins_arduino.h rename to variants/esp32s3/crowpanel-esp32s3-5-epaper/pins_arduino.h diff --git a/variants/crowpanel-esp32s3-5-epaper/platformio.ini b/variants/esp32s3/crowpanel-esp32s3-5-epaper/platformio.ini similarity index 89% rename from variants/crowpanel-esp32s3-5-epaper/platformio.ini rename to variants/esp32s3/crowpanel-esp32s3-5-epaper/platformio.ini index ebf013f64..49e84bf4f 100644 --- a/variants/crowpanel-esp32s3-5-epaper/platformio.ini +++ b/variants/esp32s3/crowpanel-esp32s3-5-epaper/platformio.ini @@ -11,7 +11,9 @@ board = esp32-s3-devkitc-1 board_level = extra upload_protocol = esptool build_flags = - ${esp32s3_base.build_flags} -D CROWPANEL_ESP32S3_5_EPAPER -I variants/crowpanel-esp32s3-5-epaper + ${esp32s3_base.build_flags} + -D CROWPANEL_ESP32S3_5_EPAPER + -I variants/esp32s3/crowpanel-esp32s3-5-epaper -D PRIVATE_HW -DBOARD_HAS_PSRAM -DGPS_POWER_TOGGLE @@ -39,7 +41,9 @@ board = esp32-s3-devkitc-1 board_level = extra upload_protocol = esptool build_flags = - ${esp32s3_base.build_flags} -D CROWPANEL_ESP32S3_4_EPAPER -I variants/crowpanel-esp32s3-5-epaper + ${esp32s3_base.build_flags} + -D CROWPANEL_ESP32S3_4_EPAPER + -I variants/esp32s3/crowpanel-esp32s3-5-epaper -D PRIVATE_HW -DBOARD_HAS_PSRAM -DGPS_POWER_TOGGLE @@ -67,7 +71,9 @@ board = esp32-s3-devkitc-1 board_level = extra upload_protocol = esptool build_flags = - ${esp32s3_base.build_flags} -D CROWPANEL_ESP32S3_2_EPAPER -I variants/crowpanel-esp32s3-5-epaper + ${esp32s3_base.build_flags} + -D CROWPANEL_ESP32S3_2_EPAPER + -I variants/esp32s3/crowpanel-esp32s3-5-epaper -D PRIVATE_HW -DBOARD_HAS_PSRAM -DGPS_POWER_TOGGLE diff --git a/variants/crowpanel-esp32s3-5-epaper/variant.h b/variants/esp32s3/crowpanel-esp32s3-5-epaper/variant.h similarity index 100% rename from variants/crowpanel-esp32s3-5-epaper/variant.h rename to variants/esp32s3/crowpanel-esp32s3-5-epaper/variant.h diff --git a/variants/my_esp32s3_diy_eink/pins_arduino.h b/variants/esp32s3/diy/my_esp32s3_diy_eink/pins_arduino.h similarity index 100% rename from variants/my_esp32s3_diy_eink/pins_arduino.h rename to variants/esp32s3/diy/my_esp32s3_diy_eink/pins_arduino.h diff --git a/variants/my_esp32s3_diy_eink/platformio.ini b/variants/esp32s3/diy/my_esp32s3_diy_eink/platformio.ini similarity index 71% rename from variants/my_esp32s3_diy_eink/platformio.ini rename to variants/esp32s3/diy/my_esp32s3_diy_eink/platformio.ini index 98613e4fb..267544c40 100644 --- a/variants/my_esp32s3_diy_eink/platformio.ini +++ b/variants/esp32s3/diy/my_esp32s3_diy_eink/platformio.ini @@ -8,8 +8,6 @@ board_build.f_cpu = 240000000L upload_protocol = esptool ;upload_port = /dev/ttyACM1 upload_speed = 921600 -platform_packages = - platformio/tool-esptoolpy@^1.40801.0 lib_deps = ${esp32_base.lib_deps} zinggjm/GxEPD2@^1.6.2 @@ -18,12 +16,13 @@ build_unflags = ${esp32s3_base.build_unflags} -DARDUINO_USB_MODE=1 build_flags = - ;${esp32_base.build_flags} -D MY_ESP32S3_DIY -I variants/my_esp32s3_diy_eink - ${esp32_base.build_flags} -D PRIVATE_HW -I variants/my_esp32s3_diy_eink + ${esp32_base.build_flags} + -D PRIVATE_HW + -I variants/esp32s3/diy/my_esp32s3_diy_eink -Dmy -DEINK_DISPLAY_MODEL=GxEPD2_290_T5D -DEINK_WIDTH=296 -DEINK_HEIGHT=128 -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue - -DARDUINO_USB_MODE=0 \ No newline at end of file + -DARDUINO_USB_MODE=0 diff --git a/variants/my_esp32s3_diy_eink/variant.h b/variants/esp32s3/diy/my_esp32s3_diy_eink/variant.h similarity index 100% rename from variants/my_esp32s3_diy_eink/variant.h rename to variants/esp32s3/diy/my_esp32s3_diy_eink/variant.h diff --git a/variants/my_esp32s3_diy_oled/pins_arduino.h b/variants/esp32s3/diy/my_esp32s3_diy_oled/pins_arduino.h similarity index 100% rename from variants/my_esp32s3_diy_oled/pins_arduino.h rename to variants/esp32s3/diy/my_esp32s3_diy_oled/pins_arduino.h diff --git a/variants/my_esp32s3_diy_oled/platformio.ini b/variants/esp32s3/diy/my_esp32s3_diy_oled/platformio.ini similarity index 67% rename from variants/my_esp32s3_diy_oled/platformio.ini rename to variants/esp32s3/diy/my_esp32s3_diy_oled/platformio.ini index 346cc9cac..aa3e6e482 100644 --- a/variants/my_esp32s3_diy_oled/platformio.ini +++ b/variants/esp32s3/diy/my_esp32s3_diy_oled/platformio.ini @@ -8,8 +8,6 @@ board_build.f_cpu = 240000000L upload_protocol = esptool ;upload_port = /dev/ttyACM0 upload_speed = 921600 -platform_packages = - platformio/tool-esptoolpy@^1.40801.0 lib_deps = ${esp32_base.lib_deps} adafruit/Adafruit NeoPixel @ ^1.12.0 @@ -17,8 +15,9 @@ build_unflags = ${esp32s3_base.build_unflags} -DARDUINO_USB_MODE=1 build_flags = - ;${esp32_base.build_flags} -D MY_ESP32S3_DIY -I variants/my_esp32s3_diy_oled - ${esp32_base.build_flags} -D PRIVATE_HW -I variants/my_esp32s3_diy_oled + ${esp32_base.build_flags} + -D PRIVATE_HW + -I variants/esp32s3/diy/my_esp32s3_diy_oled -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue - -DARDUINO_USB_MODE=0 \ No newline at end of file + -DARDUINO_USB_MODE=0 diff --git a/variants/my_esp32s3_diy_oled/variant.h b/variants/esp32s3/diy/my_esp32s3_diy_oled/variant.h similarity index 100% rename from variants/my_esp32s3_diy_oled/variant.h rename to variants/esp32s3/diy/my_esp32s3_diy_oled/variant.h diff --git a/variants/esp32s3/diy/t-energy-s3_e22/platformio.ini b/variants/esp32s3/diy/t-energy-s3_e22/platformio.ini new file mode 100644 index 000000000..681ee6c45 --- /dev/null +++ b/variants/esp32s3/diy/t-energy-s3_e22/platformio.ini @@ -0,0 +1,18 @@ +; NanoVHF T-Energy-S3 + E22(0)-xxxM - DIY +[env:t-energy-s3_e22] +extends = esp32s3_base +board = esp32-s3-devkitc-1 +board_build.partitions = default_16MB.csv +board_level = extra +board_upload.flash_size = 16MB ;Specify the FLASH capacity as 16MB +board_build.arduino.memory_type = qio_opi ;Enable internal PSRAM +build_unflags = + ${esp32s3_base.build_unflags} + -D ARDUINO_USB_MODE=1 +build_flags = + ${esp32s3_base.build_flags} + -D EBYTE_ESP32_S3 + -D BOARD_HAS_PSRAM + -D ARDUINO_USB_MODE=0 + -D ARDUINO_USB_CDC_ON_BOOT=1 + -I variants/esp32s3/diy/t-energy-s3_e22 diff --git a/variants/diy/t-energy-s3_e22/variant.h b/variants/esp32s3/diy/t-energy-s3_e22/variant.h similarity index 100% rename from variants/diy/t-energy-s3_e22/variant.h rename to variants/esp32s3/diy/t-energy-s3_e22/variant.h diff --git a/variants/dreamcatcher/platformio.ini b/variants/esp32s3/dreamcatcher/platformio.ini similarity index 89% rename from variants/dreamcatcher/platformio.ini rename to variants/esp32s3/dreamcatcher/platformio.ini index 6527d89be..d088f2dac 100644 --- a/variants/dreamcatcher/platformio.ini +++ b/variants/esp32s3/dreamcatcher/platformio.ini @@ -8,7 +8,7 @@ build_flags = ${esp32s3_base.build_flags} -D PRIVATE_HW -D OTHERNET_DC_REV=2301 - -I variants/dreamcatcher + -I variants/esp32s3/dreamcatcher -D ARDUINO_USB_CDC_ON_BOOT=1 lib_deps = ${esp32s3_base.lib_deps} @@ -25,5 +25,5 @@ build_flags = ${esp32s3_base.build_flags} -D PRIVATE_HW -D OTHERNET_DC_REV=2206 - -I variants/dreamcatcher + -I variants/esp32s3/dreamcatcher -D ARDUINO_USB_CDC_ON_BOOT=1 diff --git a/variants/dreamcatcher/rfswitch.h b/variants/esp32s3/dreamcatcher/rfswitch.h similarity index 100% rename from variants/dreamcatcher/rfswitch.h rename to variants/esp32s3/dreamcatcher/rfswitch.h diff --git a/variants/dreamcatcher/variant.h b/variants/esp32s3/dreamcatcher/variant.h similarity index 100% rename from variants/dreamcatcher/variant.h rename to variants/esp32s3/dreamcatcher/variant.h diff --git a/variants/elecrow_panel/pins_arduino.h b/variants/esp32s3/elecrow_panel/pins_arduino.h similarity index 100% rename from variants/elecrow_panel/pins_arduino.h rename to variants/esp32s3/elecrow_panel/pins_arduino.h diff --git a/variants/elecrow_panel/platformio.ini b/variants/esp32s3/elecrow_panel/platformio.ini similarity index 99% rename from variants/elecrow_panel/platformio.ini rename to variants/esp32s3/elecrow_panel/platformio.ini index de7f28a83..203a4c0d0 100644 --- a/variants/elecrow_panel/platformio.ini +++ b/variants/esp32s3/elecrow_panel/platformio.ini @@ -5,7 +5,7 @@ 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 + -I variants/esp32s3/elecrow_panel -D ELECROW_PANEL -D CONFIG_ARDUHAL_LOG_COLORS -D RADIOLIB_DEBUG_SPI=0 diff --git a/variants/elecrow_panel/variant.h b/variants/esp32s3/elecrow_panel/variant.h similarity index 100% rename from variants/elecrow_panel/variant.h rename to variants/esp32s3/elecrow_panel/variant.h diff --git a/variants/esp32-s3-pico/pins_arduino.h b/variants/esp32s3/esp32-s3-pico/pins_arduino.h similarity index 100% rename from variants/esp32-s3-pico/pins_arduino.h rename to variants/esp32s3/esp32-s3-pico/pins_arduino.h diff --git a/variants/esp32-s3-pico/platformio.ini b/variants/esp32s3/esp32-s3-pico/platformio.ini similarity index 94% rename from variants/esp32-s3-pico/platformio.ini rename to variants/esp32s3/esp32-s3-pico/platformio.ini index 69969c601..11bd4f5a3 100644 --- a/variants/esp32-s3-pico/platformio.ini +++ b/variants/esp32s3/esp32-s3-pico/platformio.ini @@ -15,7 +15,7 @@ board_upload.require_upload_port = yes build_flags = ${esp32s3_base.build_flags} -DESP32_S3_PICO ;-DPRIVATE_HW - -Ivariants/esp32-s3-pico + -Ivariants/esp32s3/esp32-s3-pico -DBOARD_HAS_PSRAM -DEINK_DISPLAY_MODEL=GxEPD2_290_T94_V2 -DEINK_WIDTH=296 diff --git a/variants/esp32-s3-pico/variant.h b/variants/esp32s3/esp32-s3-pico/variant.h similarity index 100% rename from variants/esp32-s3-pico/variant.h rename to variants/esp32s3/esp32-s3-pico/variant.h diff --git a/variants/heltec_capsule_sensor_v3/platformio.ini b/variants/esp32s3/heltec_capsule_sensor_v3/platformio.ini similarity index 82% rename from variants/heltec_capsule_sensor_v3/platformio.ini rename to variants/esp32s3/heltec_capsule_sensor_v3/platformio.ini index 8d1c039c1..d43ffd0df 100644 --- a/variants/heltec_capsule_sensor_v3/platformio.ini +++ b/variants/esp32s3/heltec_capsule_sensor_v3/platformio.ini @@ -4,7 +4,7 @@ board = heltec_wifi_lora_32_V3 board_check = true board_build.partitions = default_8MB.csv build_flags = - ${esp32s3_base.build_flags} -I variants/heltec_capsule_sensor_v3 + ${esp32s3_base.build_flags} -I variants/esp32s3/heltec_capsule_sensor_v3 -D HELTEC_CAPSULE_SENSOR_V3 -D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. - ;-D DEBUG_DISABLED ; uncomment this line to disable DEBUG output \ No newline at end of file + ;-D DEBUG_DISABLED ; uncomment this line to disable DEBUG output diff --git a/variants/heltec_capsule_sensor_v3/variant.h b/variants/esp32s3/heltec_capsule_sensor_v3/variant.h similarity index 100% rename from variants/heltec_capsule_sensor_v3/variant.h rename to variants/esp32s3/heltec_capsule_sensor_v3/variant.h diff --git a/variants/heltec_sensor_hub/platformio.ini b/variants/esp32s3/heltec_sensor_hub/platformio.ini similarity index 75% rename from variants/heltec_sensor_hub/platformio.ini rename to variants/esp32s3/heltec_sensor_hub/platformio.ini index 53f84fab4..92b90d9b9 100644 --- a/variants/heltec_sensor_hub/platformio.ini +++ b/variants/esp32s3/heltec_sensor_hub/platformio.ini @@ -4,7 +4,8 @@ board = heltec_wifi_lora_32_V3 board_check = true build_flags = - ${esp32s3_base.build_flags} -I variants/heltec_sensor_hub + ${esp32s3_base.build_flags} + -I variants/esp32s3/heltec_sensor_hub -D HELTEC_SENSOR_HUB lib_deps = ${esp32s3_base.lib_deps} diff --git a/variants/heltec_sensor_hub/variant.h b/variants/esp32s3/heltec_sensor_hub/variant.h similarity index 100% rename from variants/heltec_sensor_hub/variant.h rename to variants/esp32s3/heltec_sensor_hub/variant.h diff --git a/variants/heltec_v3/platformio.ini b/variants/esp32s3/heltec_v3/platformio.ini similarity index 77% rename from variants/heltec_v3/platformio.ini rename to variants/esp32s3/heltec_v3/platformio.ini index 4be96b019..8dda72ceb 100644 --- a/variants/heltec_v3/platformio.ini +++ b/variants/esp32s3/heltec_v3/platformio.ini @@ -4,5 +4,7 @@ board = heltec_wifi_lora_32_V3 board_check = true board_build.partitions = default_8MB.csv build_flags = - ${esp32s3_base.build_flags} -D HELTEC_V3 -I variants/heltec_v3 + ${esp32s3_base.build_flags} + -D HELTEC_V3 + -I variants/esp32s3/heltec_v3 -D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. diff --git a/variants/heltec_v3/variant.h b/variants/esp32s3/heltec_v3/variant.h similarity index 100% rename from variants/heltec_v3/variant.h rename to variants/esp32s3/heltec_v3/variant.h diff --git a/variants/heltec_vision_master_e213/einkDetect.h b/variants/esp32s3/heltec_vision_master_e213/einkDetect.h similarity index 100% rename from variants/heltec_vision_master_e213/einkDetect.h rename to variants/esp32s3/heltec_vision_master_e213/einkDetect.h diff --git a/variants/heltec_vision_master_e213/nicheGraphics.h b/variants/esp32s3/heltec_vision_master_e213/nicheGraphics.h similarity index 100% rename from variants/heltec_vision_master_e213/nicheGraphics.h rename to variants/esp32s3/heltec_vision_master_e213/nicheGraphics.h diff --git a/variants/heltec_vision_master_e213/pins_arduino.h b/variants/esp32s3/heltec_vision_master_e213/pins_arduino.h similarity index 100% rename from variants/heltec_vision_master_e213/pins_arduino.h rename to variants/esp32s3/heltec_vision_master_e213/pins_arduino.h diff --git a/variants/heltec_vision_master_e213/platformio.ini b/variants/esp32s3/heltec_vision_master_e213/platformio.ini similarity index 91% rename from variants/heltec_vision_master_e213/platformio.ini rename to variants/esp32s3/heltec_vision_master_e213/platformio.ini index 028caaeff..2b4eebe64 100644 --- a/variants/heltec_vision_master_e213/platformio.ini +++ b/variants/esp32s3/heltec_vision_master_e213/platformio.ini @@ -4,7 +4,7 @@ board = heltec_vision_master_e213 board_build.partitions = default_8MB.csv build_flags = ${esp32s3_base.build_flags} - -Ivariants/heltec_vision_master_e213 + -Ivariants/esp32s3/heltec_vision_master_e213 -DHELTEC_VISION_MASTER_E213 -DUSE_EINK -DGXEPD2_DRIVER_0=GxEPD2_213_FC1 @@ -31,9 +31,9 @@ build_src_filter = build_flags = ${esp32s3_base.build_flags} ${inkhud.build_flags} - -I variants/heltec_vision_master_e213 + -I variants/esp32s3/heltec_vision_master_e213 -D HELTEC_VISION_MASTER_E213 lib_deps = ${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX ${esp32s3_base.lib_deps} -upload_speed = 921600 \ No newline at end of file +upload_speed = 921600 diff --git a/variants/heltec_vision_master_e213/variant.h b/variants/esp32s3/heltec_vision_master_e213/variant.h similarity index 100% rename from variants/heltec_vision_master_e213/variant.h rename to variants/esp32s3/heltec_vision_master_e213/variant.h diff --git a/variants/heltec_vision_master_e290/nicheGraphics.h b/variants/esp32s3/heltec_vision_master_e290/nicheGraphics.h similarity index 100% rename from variants/heltec_vision_master_e290/nicheGraphics.h rename to variants/esp32s3/heltec_vision_master_e290/nicheGraphics.h diff --git a/variants/heltec_vision_master_e290/pins_arduino.h b/variants/esp32s3/heltec_vision_master_e290/pins_arduino.h similarity index 100% rename from variants/heltec_vision_master_e290/pins_arduino.h rename to variants/esp32s3/heltec_vision_master_e290/pins_arduino.h diff --git a/variants/heltec_vision_master_e290/platformio.ini b/variants/esp32s3/heltec_vision_master_e290/platformio.ini similarity index 91% rename from variants/heltec_vision_master_e290/platformio.ini rename to variants/esp32s3/heltec_vision_master_e290/platformio.ini index cda3fde00..08056b639 100644 --- a/variants/heltec_vision_master_e290/platformio.ini +++ b/variants/esp32s3/heltec_vision_master_e290/platformio.ini @@ -5,7 +5,7 @@ board = heltec_vision_master_e290 board_build.partitions = default_8MB.csv build_flags = ${esp32s3_base.build_flags} - -I variants/heltec_vision_master_e290 + -I variants/esp32s3/heltec_vision_master_e290 -D DISPLAY_FLIP_SCREEN ; Orient so the LoRa antenna faces up -D HELTEC_VISION_MASTER_E290 -D BUTTON_CLICK_MS=200 @@ -34,9 +34,9 @@ build_src_filter = build_flags = ${esp32s3_base.build_flags} ${inkhud.build_flags} - -I variants/heltec_vision_master_e290 + -I variants/esp32s3/heltec_vision_master_e290 -D HELTEC_VISION_MASTER_E290 lib_deps = ${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX ${esp32s3_base.lib_deps} -upload_speed = 921600 \ No newline at end of file +upload_speed = 921600 diff --git a/variants/heltec_vision_master_e290/variant.h b/variants/esp32s3/heltec_vision_master_e290/variant.h similarity index 100% rename from variants/heltec_vision_master_e290/variant.h rename to variants/esp32s3/heltec_vision_master_e290/variant.h diff --git a/variants/heltec_vision_master_t190/pins_arduino.h b/variants/esp32s3/heltec_vision_master_t190/pins_arduino.h similarity index 100% rename from variants/heltec_vision_master_t190/pins_arduino.h rename to variants/esp32s3/heltec_vision_master_t190/pins_arduino.h diff --git a/variants/heltec_vision_master_t190/platformio.ini b/variants/esp32s3/heltec_vision_master_t190/platformio.ini similarity index 77% rename from variants/heltec_vision_master_t190/platformio.ini rename to variants/esp32s3/heltec_vision_master_t190/platformio.ini index 7f55a1be7..e7e7ff4e4 100644 --- a/variants/heltec_vision_master_t190/platformio.ini +++ b/variants/esp32s3/heltec_vision_master_t190/platformio.ini @@ -4,10 +4,10 @@ board = heltec_vision_master_t190 board_build.partitions = default_8MB.csv build_flags = ${esp32s3_base.build_flags} - -Ivariants/heltec_vision_master_t190 - -DHELTEC_VISION_MASTER_T190 + -I variants/esp32s3/heltec_vision_master_t190 + -D HELTEC_VISION_MASTER_T190 lib_deps = ${esp32s3_base.lib_deps} lewisxhe/PCF8563_Library@^1.0.1 https://github.com/meshtastic/st7789/archive/bd33ea58ddfe4a5e4a66d53300ccbd38d66ac21f.zip -upload_speed = 921600 \ No newline at end of file +upload_speed = 921600 diff --git a/variants/heltec_vision_master_t190/variant.h b/variants/esp32s3/heltec_vision_master_t190/variant.h similarity index 100% rename from variants/heltec_vision_master_t190/variant.h rename to variants/esp32s3/heltec_vision_master_t190/variant.h diff --git a/variants/heltec_wireless_paper/einkDetect.h b/variants/esp32s3/heltec_wireless_paper/einkDetect.h similarity index 100% rename from variants/heltec_wireless_paper/einkDetect.h rename to variants/esp32s3/heltec_wireless_paper/einkDetect.h diff --git a/variants/heltec_wireless_paper/nicheGraphics.h b/variants/esp32s3/heltec_wireless_paper/nicheGraphics.h similarity index 100% rename from variants/heltec_wireless_paper/nicheGraphics.h rename to variants/esp32s3/heltec_wireless_paper/nicheGraphics.h diff --git a/variants/heltec_wireless_paper/pins_arduino.h b/variants/esp32s3/heltec_wireless_paper/pins_arduino.h similarity index 100% rename from variants/heltec_wireless_paper/pins_arduino.h rename to variants/esp32s3/heltec_wireless_paper/pins_arduino.h diff --git a/variants/heltec_wireless_paper/platformio.ini b/variants/esp32s3/heltec_wireless_paper/platformio.ini similarity index 92% rename from variants/heltec_wireless_paper/platformio.ini rename to variants/esp32s3/heltec_wireless_paper/platformio.ini index 790646056..f16dcd257 100644 --- a/variants/heltec_wireless_paper/platformio.ini +++ b/variants/esp32s3/heltec_wireless_paper/platformio.ini @@ -5,7 +5,7 @@ board = heltec_wifi_lora_32_V3 board_build.partitions = default_8MB.csv build_flags = ${esp32s3_base.build_flags} - -I variants/heltec_wireless_paper + -I variants/esp32s3/heltec_wireless_paper -D HELTEC_WIRELESS_PAPER -D GXEPD2_DRIVER_0=GxEPD2_213_FC1 -D GXEPD2_DRIVER_1=GxEPD2_213_E0213A367 @@ -32,9 +32,9 @@ build_src_filter = build_flags = ${esp32s3_base.build_flags} ${inkhud.build_flags} - -I variants/heltec_wireless_paper + -I variants/esp32s3/heltec_wireless_paper -D HELTEC_WIRELESS_PAPER lib_deps = ${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX ${esp32s3_base.lib_deps} -upload_speed = 921600 \ No newline at end of file +upload_speed = 921600 diff --git a/variants/heltec_wireless_paper/variant.h b/variants/esp32s3/heltec_wireless_paper/variant.h similarity index 100% rename from variants/heltec_wireless_paper/variant.h rename to variants/esp32s3/heltec_wireless_paper/variant.h diff --git a/variants/heltec_wireless_paper_v1/pins_arduino.h b/variants/esp32s3/heltec_wireless_paper_v1/pins_arduino.h similarity index 100% rename from variants/heltec_wireless_paper_v1/pins_arduino.h rename to variants/esp32s3/heltec_wireless_paper_v1/pins_arduino.h diff --git a/variants/heltec_wireless_paper_v1/platformio.ini b/variants/esp32s3/heltec_wireless_paper_v1/platformio.ini similarity index 91% rename from variants/heltec_wireless_paper_v1/platformio.ini rename to variants/esp32s3/heltec_wireless_paper_v1/platformio.ini index 44b0606af..99f2eddeb 100644 --- a/variants/heltec_wireless_paper_v1/platformio.ini +++ b/variants/esp32s3/heltec_wireless_paper_v1/platformio.ini @@ -5,7 +5,7 @@ board = heltec_wifi_lora_32_V3 board_build.partitions = default_8MB.csv build_flags = ${esp32s3_base.build_flags} - -I variants/heltec_wireless_paper_v1 + -I variants/esp32s3/heltec_wireless_paper_v1 -D HELTEC_WIRELESS_PAPER_V1_0 -D EINK_DISPLAY_MODEL=GxEPD2_213_BN -D EINK_WIDTH=250 @@ -17,4 +17,4 @@ lib_deps = ${esp32s3_base.lib_deps} https://github.com/meshtastic/GxEPD2/archive/55f618961db45a23eff0233546430f1e5a80f63a.zip lewisxhe/PCF8563_Library@^1.0.1 -upload_speed = 115200 \ No newline at end of file +upload_speed = 115200 diff --git a/variants/heltec_wireless_paper_v1/variant.h b/variants/esp32s3/heltec_wireless_paper_v1/variant.h similarity index 100% rename from variants/heltec_wireless_paper_v1/variant.h rename to variants/esp32s3/heltec_wireless_paper_v1/variant.h diff --git a/variants/heltec_wireless_tracker/pins_arduino.h b/variants/esp32s3/heltec_wireless_tracker/pins_arduino.h similarity index 100% rename from variants/heltec_wireless_tracker/pins_arduino.h rename to variants/esp32s3/heltec_wireless_tracker/pins_arduino.h diff --git a/variants/heltec_wireless_tracker/platformio.ini b/variants/esp32s3/heltec_wireless_tracker/platformio.ini similarity index 85% rename from variants/heltec_wireless_tracker/platformio.ini rename to variants/esp32s3/heltec_wireless_tracker/platformio.ini index 5c19c37e6..2faba45a8 100644 --- a/variants/heltec_wireless_tracker/platformio.ini +++ b/variants/esp32s3/heltec_wireless_tracker/platformio.ini @@ -5,7 +5,8 @@ board_build.partitions = default_8MB.csv upload_protocol = esptool build_flags = - ${esp32s3_base.build_flags} -I variants/heltec_wireless_tracker + ${esp32s3_base.build_flags} + -I variants/esp32s3/heltec_wireless_tracker -D HELTEC_TRACKER_V1_1 -D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. ;-D DEBUG_DISABLED ; uncomment this line to disable DEBUG output diff --git a/variants/heltec_wireless_tracker/variant.h b/variants/esp32s3/heltec_wireless_tracker/variant.h similarity index 100% rename from variants/heltec_wireless_tracker/variant.h rename to variants/esp32s3/heltec_wireless_tracker/variant.h diff --git a/variants/heltec_wireless_tracker_V1_0/pins_arduino.h b/variants/esp32s3/heltec_wireless_tracker_V1_0/pins_arduino.h similarity index 100% rename from variants/heltec_wireless_tracker_V1_0/pins_arduino.h rename to variants/esp32s3/heltec_wireless_tracker_V1_0/pins_arduino.h diff --git a/variants/heltec_wireless_tracker_V1_0/platformio.ini b/variants/esp32s3/heltec_wireless_tracker_V1_0/platformio.ini similarity index 85% rename from variants/heltec_wireless_tracker_V1_0/platformio.ini rename to variants/esp32s3/heltec_wireless_tracker_V1_0/platformio.ini index 08b0ae95c..89fe4b385 100644 --- a/variants/heltec_wireless_tracker_V1_0/platformio.ini +++ b/variants/esp32s3/heltec_wireless_tracker_V1_0/platformio.ini @@ -5,7 +5,8 @@ board = heltec_wireless_tracker board_build.partitions = default_8MB.csv upload_protocol = esptool build_flags = - ${esp32s3_base.build_flags} -I variants/heltec_wireless_tracker_V1_0 + ${esp32s3_base.build_flags} + -I variants/esp32s3/heltec_wireless_tracker_V1_0 -D HELTEC_TRACKER_V1_0 -D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. ;-D DEBUG_DISABLED ; uncomment this line to disable DEBUG output diff --git a/variants/heltec_wireless_tracker_V1_0/variant.h b/variants/esp32s3/heltec_wireless_tracker_V1_0/variant.h similarity index 100% rename from variants/heltec_wireless_tracker_V1_0/variant.h rename to variants/esp32s3/heltec_wireless_tracker_V1_0/variant.h diff --git a/variants/heltec_wsl_v3/platformio.ini b/variants/esp32s3/heltec_wsl_v3/platformio.ini similarity index 78% rename from variants/heltec_wsl_v3/platformio.ini rename to variants/esp32s3/heltec_wsl_v3/platformio.ini index bc3e6ada1..06cde2304 100644 --- a/variants/heltec_wsl_v3/platformio.ini +++ b/variants/esp32s3/heltec_wsl_v3/platformio.ini @@ -4,5 +4,7 @@ board = heltec_wifi_lora_32_V3 board_build.partitions = default_8MB.csv # Temporary until espressif creates a release with this new target build_flags = - ${esp32s3_base.build_flags} -D HELTEC_WSL_V3 -I variants/heltec_wsl_v3 + ${esp32s3_base.build_flags} + -D HELTEC_WSL_V3 + -I variants/esp32s3/heltec_wsl_v3 -D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. diff --git a/variants/heltec_wsl_v3/variant.h b/variants/esp32s3/heltec_wsl_v3/variant.h similarity index 100% rename from variants/heltec_wsl_v3/variant.h rename to variants/esp32s3/heltec_wsl_v3/variant.h diff --git a/variants/icarus/pins_arduino.h b/variants/esp32s3/icarus/pins_arduino.h similarity index 100% rename from variants/icarus/pins_arduino.h rename to variants/esp32s3/icarus/pins_arduino.h diff --git a/variants/icarus/platformio.ini b/variants/esp32s3/icarus/platformio.ini similarity index 84% rename from variants/icarus/platformio.ini rename to variants/esp32s3/icarus/platformio.ini index b4ea125cf..de450da93 100644 --- a/variants/icarus/platformio.ini +++ b/variants/esp32s3/icarus/platformio.ini @@ -14,6 +14,8 @@ build_unflags = ${esp32s3_base.build_unflags} -DARDUINO_USB_MODE=1 build_flags = - ${esp32s3_base.build_flags} -D PRIVATE_HW -I variants/icarus - -DBOARD_HAS_PSRAM + ${esp32s3_base.build_flags} + -D PRIVATE_HW + -I variants/esp32s3/icarus + -DBOARD_HAS_PSRAM -DARDUINO_USB_MODE=0 diff --git a/variants/icarus/variant.h b/variants/esp32s3/icarus/variant.h similarity index 100% rename from variants/icarus/variant.h rename to variants/esp32s3/icarus/variant.h diff --git a/variants/link32_s3_v1/pins_arduino.h b/variants/esp32s3/link32_s3_v1/pins_arduino.h similarity index 100% rename from variants/link32_s3_v1/pins_arduino.h rename to variants/esp32s3/link32_s3_v1/pins_arduino.h diff --git a/variants/link32_s3_v1/platformio.ini b/variants/esp32s3/link32_s3_v1/platformio.ini similarity index 81% rename from variants/link32_s3_v1/platformio.ini rename to variants/esp32s3/link32_s3_v1/platformio.ini index 5a614a7af..c1b71b3b5 100644 --- a/variants/link32_s3_v1/platformio.ini +++ b/variants/esp32s3/link32_s3_v1/platformio.ini @@ -2,7 +2,9 @@ extends = esp32s3_base board = esp32-s3-devkitc-1 build_flags = - ${esp32_base.build_flags} -D LINK_32 -I variants/link32_s3_v1 + ${esp32_base.build_flags} + -D LINK_32 + -I variants/esp32s3/link32_s3_v1 -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. -DARDUINO_USB_CDC_ON_BOOT -DARDUINO_USB_MODE=1 diff --git a/variants/link32_s3_v1/variant.h b/variants/esp32s3/link32_s3_v1/variant.h similarity index 100% rename from variants/link32_s3_v1/variant.h rename to variants/esp32s3/link32_s3_v1/variant.h diff --git a/variants/m5stack_cores3/pins_arduino.h b/variants/esp32s3/m5stack_cores3/pins_arduino.h similarity index 100% rename from variants/m5stack_cores3/pins_arduino.h rename to variants/esp32s3/m5stack_cores3/pins_arduino.h diff --git a/variants/m5stack_cores3/platformio.ini b/variants/esp32s3/m5stack_cores3/platformio.ini similarity index 53% rename from variants/m5stack_cores3/platformio.ini rename to variants/esp32s3/m5stack_cores3/platformio.ini index 2253e75e2..9973abfce 100644 --- a/variants/m5stack_cores3/platformio.ini +++ b/variants/esp32s3/m5stack_cores3/platformio.ini @@ -5,11 +5,9 @@ board = m5stack-cores3 board_check = true board_build.partitions = default_16MB.csv upload_protocol = esptool - -build_flags = ${esp32_base.build_flags} - -DPRIVATE_HW - -DM5STACK_CORES3 - -Ivariants/m5stack_cores3 - -lib_deps = - ${esp32_base.lib_deps} +build_flags = + ${esp32_base.build_flags} + -D PRIVATE_HW + -D M5STACK_CORES3 + -I variants/esp32s3/m5stack_cores3 +lib_deps = ${esp32_base.lib_deps} diff --git a/variants/m5stack_cores3/variant.h b/variants/esp32s3/m5stack_cores3/variant.h similarity index 100% rename from variants/m5stack_cores3/variant.h rename to variants/esp32s3/m5stack_cores3/variant.h diff --git a/variants/nibble_esp32/platformio.ini b/variants/esp32s3/nibble_esp32/platformio.ini similarity index 55% rename from variants/nibble_esp32/platformio.ini rename to variants/esp32s3/nibble_esp32/platformio.ini index 24d2ee2a5..2f6960d2e 100644 --- a/variants/nibble_esp32/platformio.ini +++ b/variants/esp32s3/nibble_esp32/platformio.ini @@ -3,4 +3,6 @@ extends = esp32s3_base board = esp32-s3-zero board_level = extra build_flags = - ${esp32_base.build_flags} -D PRIVATE_HW -I variants/nibble_esp32 \ No newline at end of file + ${esp32_base.build_flags} + -D PRIVATE_HW + -I variants/esp32s3/nibble_esp32 diff --git a/variants/nibble_esp32/variant.h b/variants/esp32s3/nibble_esp32/variant.h similarity index 100% rename from variants/nibble_esp32/variant.h rename to variants/esp32s3/nibble_esp32/variant.h diff --git a/variants/nugget_s3_lora/platformio.ini b/variants/esp32s3/nugget_s3_lora/platformio.ini similarity index 78% rename from variants/nugget_s3_lora/platformio.ini rename to variants/esp32s3/nugget_s3_lora/platformio.ini index 1085d633b..a0076a18b 100644 --- a/variants/nugget_s3_lora/platformio.ini +++ b/variants/esp32s3/nugget_s3_lora/platformio.ini @@ -3,4 +3,4 @@ extends = esp32s3_base board = lolin_s3_mini board_level = extra build_flags = - ${esp32s3_base.build_flags} -D ARDUINO_USB_CDC_ON_BOOT=1 -D PRIVATE_HW -I variants/nugget_s3_lora + ${esp32s3_base.build_flags} -D ARDUINO_USB_CDC_ON_BOOT=1 -D PRIVATE_HW -I variants/esp32s3/nugget_s3_lora diff --git a/variants/nugget_s3_lora/variant.h b/variants/esp32s3/nugget_s3_lora/variant.h similarity index 100% rename from variants/nugget_s3_lora/variant.h rename to variants/esp32s3/nugget_s3_lora/variant.h diff --git a/variants/picomputer-s3/pins_arduino.h b/variants/esp32s3/picomputer-s3/pins_arduino.h similarity index 100% rename from variants/picomputer-s3/pins_arduino.h rename to variants/esp32s3/picomputer-s3/pins_arduino.h diff --git a/variants/picomputer-s3/platformio.ini b/variants/esp32s3/picomputer-s3/platformio.ini similarity index 97% rename from variants/picomputer-s3/platformio.ini rename to variants/esp32s3/picomputer-s3/platformio.ini index cb5e829b4..d5847959b 100644 --- a/variants/picomputer-s3/platformio.ini +++ b/variants/esp32s3/picomputer-s3/platformio.ini @@ -11,7 +11,7 @@ upload_protocol = esptool build_flags = ${esp32s3_base.build_flags} -DPICOMPUTER_S3 - -I variants/picomputer-s3 + -I variants/esp32s3/picomputer-s3 lib_deps = ${esp32s3_base.lib_deps} diff --git a/variants/picomputer-s3/variant.h b/variants/esp32s3/picomputer-s3/variant.h similarity index 100% rename from variants/picomputer-s3/variant.h rename to variants/esp32s3/picomputer-s3/variant.h diff --git a/variants/rak3312/pins_arduino.h b/variants/esp32s3/rak3312/pins_arduino.h similarity index 100% rename from variants/rak3312/pins_arduino.h rename to variants/esp32s3/rak3312/pins_arduino.h diff --git a/variants/rak3312/platformio.ini b/variants/esp32s3/rak3312/platformio.ini similarity index 63% rename from variants/rak3312/platformio.ini rename to variants/esp32s3/rak3312/platformio.ini index d2877b3f7..50b0c5020 100644 --- a/variants/rak3312/platformio.ini +++ b/variants/esp32s3/rak3312/platformio.ini @@ -5,4 +5,6 @@ board_check = true upload_protocol = esptool build_flags = - ${esp32_base.build_flags} -D RAK3312 -I variants/rak3312 + ${esp32_base.build_flags} + -D RAK3312 + -I variants/esp32s3/rak3312 diff --git a/variants/rak3312/variant.h b/variants/esp32s3/rak3312/variant.h similarity index 100% rename from variants/rak3312/variant.h rename to variants/esp32s3/rak3312/variant.h diff --git a/variants/seeed-sensecap-indicator/pins_arduino.h b/variants/esp32s3/seeed-sensecap-indicator/pins_arduino.h similarity index 100% rename from variants/seeed-sensecap-indicator/pins_arduino.h rename to variants/esp32s3/seeed-sensecap-indicator/pins_arduino.h diff --git a/variants/seeed-sensecap-indicator/platformio.ini b/variants/esp32s3/seeed-sensecap-indicator/platformio.ini similarity index 97% rename from variants/seeed-sensecap-indicator/platformio.ini rename to variants/esp32s3/seeed-sensecap-indicator/platformio.ini index 63f814b57..1d55b31ca 100644 --- a/variants/seeed-sensecap-indicator/platformio.ini +++ b/variants/esp32s3/seeed-sensecap-indicator/platformio.ini @@ -10,7 +10,7 @@ board_build.partitions = default_8MB.csv upload_protocol = esptool build_flags = ${esp32_base.build_flags} - -Ivariants/seeed-sensecap-indicator + -Ivariants/esp32s3/seeed-sensecap-indicator -DSENSECAP_INDICATOR -DCONFIG_ARDUHAL_LOG_COLORS -DRADIOLIB_DEBUG_SPI=0 diff --git a/variants/seeed-sensecap-indicator/variant.h b/variants/esp32s3/seeed-sensecap-indicator/variant.h similarity index 100% rename from variants/seeed-sensecap-indicator/variant.h rename to variants/esp32s3/seeed-sensecap-indicator/variant.h diff --git a/variants/seeed_xiao_s3/pins_arduino.h b/variants/esp32s3/seeed_xiao_s3/pins_arduino.h similarity index 100% rename from variants/seeed_xiao_s3/pins_arduino.h rename to variants/esp32s3/seeed_xiao_s3/pins_arduino.h diff --git a/variants/seeed_xiao_s3/platformio.ini b/variants/esp32s3/seeed_xiao_s3/platformio.ini similarity index 74% rename from variants/seeed_xiao_s3/platformio.ini rename to variants/esp32s3/seeed_xiao_s3/platformio.ini index 9d935e2e0..ad09efabd 100644 --- a/variants/seeed_xiao_s3/platformio.ini +++ b/variants/esp32s3/seeed_xiao_s3/platformio.ini @@ -11,7 +11,8 @@ build_unflags = ${esp32s3_base.build_unflags} -DARDUINO_USB_MODE=1 build_flags = - ${esp32s3_base.build_flags} -DSEEED_XIAO_S3 -I variants/seeed_xiao_s3 + ${esp32s3_base.build_flags} + -D SEEED_XIAO_S3 + -I variants/esp32s3/seeed_xiao_s3 -DBOARD_HAS_PSRAM - - -DARDUINO_USB_MODE=0 \ No newline at end of file + -DARDUINO_USB_MODE=0 diff --git a/variants/seeed_xiao_s3/variant.h b/variants/esp32s3/seeed_xiao_s3/variant.h similarity index 100% rename from variants/seeed_xiao_s3/variant.h rename to variants/esp32s3/seeed_xiao_s3/variant.h diff --git a/variants/station-g2/pins_arduino.h b/variants/esp32s3/station-g2/pins_arduino.h similarity index 100% rename from variants/station-g2/pins_arduino.h rename to variants/esp32s3/station-g2/pins_arduino.h diff --git a/variants/station-g2/platformio.ini b/variants/esp32s3/station-g2/platformio.ini similarity index 83% rename from variants/station-g2/platformio.ini rename to variants/esp32s3/station-g2/platformio.ini index 4ddd28f1c..0aed5e7ce 100755 --- a/variants/station-g2/platformio.ini +++ b/variants/esp32s3/station-g2/platformio.ini @@ -13,7 +13,9 @@ build_unflags = ${esp32s3_base.build_unflags} -DARDUINO_USB_MODE=1 build_flags = - ${esp32s3_base.build_flags} -D STATION_G2 -I variants/station-g2 + ${esp32s3_base.build_flags} + -D STATION_G2 + -I variants/esp32s3/station-g2 -DBOARD_HAS_PSRAM -DSTATION_G2 -DARDUINO_USB_MODE=0 diff --git a/variants/station-g2/variant.h b/variants/esp32s3/station-g2/variant.h similarity index 100% rename from variants/station-g2/variant.h rename to variants/esp32s3/station-g2/variant.h diff --git a/variants/t-deck/pins_arduino.h b/variants/esp32s3/t-deck/pins_arduino.h similarity index 100% rename from variants/t-deck/pins_arduino.h rename to variants/esp32s3/t-deck/pins_arduino.h diff --git a/variants/t-deck/platformio.ini b/variants/esp32s3/t-deck/platformio.ini similarity index 95% rename from variants/t-deck/platformio.ini rename to variants/esp32s3/t-deck/platformio.ini index c9bd64bc3..9d55ee365 100644 --- a/variants/t-deck/platformio.ini +++ b/variants/esp32s3/t-deck/platformio.ini @@ -7,17 +7,16 @@ board_build.partitions = default_16MB.csv upload_protocol = esptool build_flags = ${esp32s3_base.build_flags} - -DT_DECK - -DBOARD_HAS_PSRAM - -DGPS_POWER_TOGGLE - -Ivariants/t-deck + -D T_DECK + -D BOARD_HAS_PSRAM + -D GPS_POWER_TOGGLE + -I variants/esp32s3/t-deck lib_deps = ${esp32s3_base.lib_deps} lovyan03/LovyanGFX@^1.2.0 earlephilhower/ESP8266Audio@^1.9.9 earlephilhower/ESP8266SAM@^1.0.1 - [env:t-deck-tft] extends = env:t-deck diff --git a/variants/t-deck/variant.h b/variants/esp32s3/t-deck/variant.h similarity index 100% rename from variants/t-deck/variant.h rename to variants/esp32s3/t-deck/variant.h diff --git a/variants/t-eth-elite/pins_arduino.h b/variants/esp32s3/t-eth-elite/pins_arduino.h similarity index 100% rename from variants/t-eth-elite/pins_arduino.h rename to variants/esp32s3/t-eth-elite/pins_arduino.h diff --git a/variants/t-eth-elite/platformio.ini b/variants/esp32s3/t-eth-elite/platformio.ini similarity index 93% rename from variants/t-eth-elite/platformio.ini rename to variants/esp32s3/t-eth-elite/platformio.ini index c2f183dd5..889270ceb 100644 --- a/variants/t-eth-elite/platformio.ini +++ b/variants/esp32s3/t-eth-elite/platformio.ini @@ -7,7 +7,7 @@ build_flags = ${esp32s3_base.build_flags} -D T_ETH_ELITE -D HAS_UDP_MULTICAST=1 - -I variants/t-eth-elite + -I variants/esp32s3/t-eth-elite -D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. lib_ignore = diff --git a/variants/t-eth-elite/rfswitch.h b/variants/esp32s3/t-eth-elite/rfswitch.h similarity index 100% rename from variants/t-eth-elite/rfswitch.h rename to variants/esp32s3/t-eth-elite/rfswitch.h diff --git a/variants/t-eth-elite/variant.h b/variants/esp32s3/t-eth-elite/variant.h similarity index 100% rename from variants/t-eth-elite/variant.h rename to variants/esp32s3/t-eth-elite/variant.h diff --git a/variants/t-watch-s3/pins_arduino.h b/variants/esp32s3/t-watch-s3/pins_arduino.h similarity index 100% rename from variants/t-watch-s3/pins_arduino.h rename to variants/esp32s3/t-watch-s3/pins_arduino.h diff --git a/variants/t-watch-s3/platformio.ini b/variants/esp32s3/t-watch-s3/platformio.ini similarity index 93% rename from variants/t-watch-s3/platformio.ini rename to variants/esp32s3/t-watch-s3/platformio.ini index f98237943..59ff8891d 100644 --- a/variants/t-watch-s3/platformio.ini +++ b/variants/esp32s3/t-watch-s3/platformio.ini @@ -8,7 +8,7 @@ upload_protocol = esptool build_flags = ${esp32_base.build_flags} -DT_WATCH_S3 - -Ivariants/t-watch-s3 + -Ivariants/esp32s3/t-watch-s3 -DPCF8563_RTC=0x51 -DHAS_BMA423=1 diff --git a/variants/t-watch-s3/variant.h b/variants/esp32s3/t-watch-s3/variant.h similarity index 100% rename from variants/t-watch-s3/variant.h rename to variants/esp32s3/t-watch-s3/variant.h diff --git a/variants/tbeam-s3-core/pins_arduino.h b/variants/esp32s3/tbeam-s3-core/pins_arduino.h similarity index 100% rename from variants/tbeam-s3-core/pins_arduino.h rename to variants/esp32s3/tbeam-s3-core/pins_arduino.h diff --git a/variants/tbeam-s3-core/platformio.ini b/variants/esp32s3/tbeam-s3-core/platformio.ini similarity index 71% rename from variants/tbeam-s3-core/platformio.ini rename to variants/esp32s3/tbeam-s3-core/platformio.ini index a7bdf963f..fba8e4003 100644 --- a/variants/tbeam-s3-core/platformio.ini +++ b/variants/esp32s3/tbeam-s3-core/platformio.ini @@ -11,5 +11,5 @@ lib_deps = build_flags = ${esp32s3_base.build_flags} - -Ivariants/tbeam-s3-core - -DPCF8563_RTC=0x51 ;Putting definitions in variant.h does not compile correctly + -I variants/esp32s3/tbeam-s3-core + -D PCF8563_RTC=0x51 ;Putting definitions in variant.h does not compile correctly diff --git a/variants/tbeam-s3-core/variant.h b/variants/esp32s3/tbeam-s3-core/variant.h similarity index 100% rename from variants/tbeam-s3-core/variant.h rename to variants/esp32s3/tbeam-s3-core/variant.h diff --git a/variants/tlora_t3s3_epaper/nicheGraphics.h b/variants/esp32s3/tlora_t3s3_epaper/nicheGraphics.h similarity index 100% rename from variants/tlora_t3s3_epaper/nicheGraphics.h rename to variants/esp32s3/tlora_t3s3_epaper/nicheGraphics.h diff --git a/variants/tlora_t3s3_epaper/pins_arduino.h b/variants/esp32s3/tlora_t3s3_epaper/pins_arduino.h similarity index 100% rename from variants/tlora_t3s3_epaper/pins_arduino.h rename to variants/esp32s3/tlora_t3s3_epaper/pins_arduino.h diff --git a/variants/tlora_t3s3_epaper/platformio.ini b/variants/esp32s3/tlora_t3s3_epaper/platformio.ini similarity index 85% rename from variants/tlora_t3s3_epaper/platformio.ini rename to variants/esp32s3/tlora_t3s3_epaper/platformio.ini index 0750b5bbb..71644ee77 100644 --- a/variants/tlora_t3s3_epaper/platformio.ini +++ b/variants/esp32s3/tlora_t3s3_epaper/platformio.ini @@ -5,7 +5,9 @@ board_check = true upload_protocol = esptool build_flags = - ${esp32_base.build_flags} -D TLORA_T3S3_EPAPER -I variants/tlora_t3s3_epaper + ${esp32_base.build_flags} + -D TLORA_T3S3_EPAPER + -I variants/esp32s3/tlora_t3s3_epaper -DGPS_POWER_TOGGLE -DUSE_EINK -DEINK_DISPLAY_MODEL=GxEPD2_213_BN @@ -29,8 +31,8 @@ build_src_filter = build_flags = ${esp32s3_base.build_flags} ${inkhud.build_flags} - -I variants/tlora_t3s3_epaper + -I variants/esp32s3/tlora_t3s3_epaper -D TLORA_T3S3_EPAPER lib_deps = ${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX - ${esp32s3_base.lib_deps} \ No newline at end of file + ${esp32s3_base.lib_deps} diff --git a/variants/tlora_t3s3_epaper/variant.h b/variants/esp32s3/tlora_t3s3_epaper/variant.h similarity index 100% rename from variants/tlora_t3s3_epaper/variant.h rename to variants/esp32s3/tlora_t3s3_epaper/variant.h diff --git a/variants/tlora_t3s3_v1/pins_arduino.h b/variants/esp32s3/tlora_t3s3_v1/pins_arduino.h similarity index 100% rename from variants/tlora_t3s3_v1/pins_arduino.h rename to variants/esp32s3/tlora_t3s3_v1/pins_arduino.h diff --git a/variants/tlora_t3s3_v1/platformio.ini b/variants/esp32s3/tlora_t3s3_v1/platformio.ini similarity index 58% rename from variants/tlora_t3s3_v1/platformio.ini rename to variants/esp32s3/tlora_t3s3_v1/platformio.ini index 0a5797280..d9624f043 100644 --- a/variants/tlora_t3s3_v1/platformio.ini +++ b/variants/esp32s3/tlora_t3s3_v1/platformio.ini @@ -5,5 +5,5 @@ board_check = true upload_protocol = esptool build_flags = - ${esp32_base.build_flags} -D TLORA_T3S3_V1 -I variants/tlora_t3s3_v1 - -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. \ No newline at end of file + ${esp32_base.build_flags} -D TLORA_T3S3_V1 -I variants/esp32s3/tlora_t3s3_v1 + -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. diff --git a/variants/tlora_t3s3_v1/rfswitch.h b/variants/esp32s3/tlora_t3s3_v1/rfswitch.h similarity index 100% rename from variants/tlora_t3s3_v1/rfswitch.h rename to variants/esp32s3/tlora_t3s3_v1/rfswitch.h diff --git a/variants/tlora_t3s3_v1/variant.h b/variants/esp32s3/tlora_t3s3_v1/variant.h similarity index 100% rename from variants/tlora_t3s3_v1/variant.h rename to variants/esp32s3/tlora_t3s3_v1/variant.h diff --git a/variants/tracksenger/internal/pins_arduino.h b/variants/esp32s3/tracksenger/internal/pins_arduino.h similarity index 100% rename from variants/tracksenger/internal/pins_arduino.h rename to variants/esp32s3/tracksenger/internal/pins_arduino.h diff --git a/variants/tracksenger/internal/variant.h b/variants/esp32s3/tracksenger/internal/variant.h similarity index 100% rename from variants/tracksenger/internal/variant.h rename to variants/esp32s3/tracksenger/internal/variant.h diff --git a/variants/tracksenger/lcd/pins_arduino.h b/variants/esp32s3/tracksenger/lcd/pins_arduino.h similarity index 100% rename from variants/tracksenger/lcd/pins_arduino.h rename to variants/esp32s3/tracksenger/lcd/pins_arduino.h diff --git a/variants/tracksenger/lcd/variant.h b/variants/esp32s3/tracksenger/lcd/variant.h similarity index 100% rename from variants/tracksenger/lcd/variant.h rename to variants/esp32s3/tracksenger/lcd/variant.h diff --git a/variants/tracksenger/oled/pins_arduino.h b/variants/esp32s3/tracksenger/oled/pins_arduino.h similarity index 100% rename from variants/tracksenger/oled/pins_arduino.h rename to variants/esp32s3/tracksenger/oled/pins_arduino.h diff --git a/variants/tracksenger/oled/variant.h b/variants/esp32s3/tracksenger/oled/variant.h similarity index 100% rename from variants/tracksenger/oled/variant.h rename to variants/esp32s3/tracksenger/oled/variant.h diff --git a/variants/tracksenger/platformio.ini b/variants/esp32s3/tracksenger/platformio.ini similarity index 85% rename from variants/tracksenger/platformio.ini rename to variants/esp32s3/tracksenger/platformio.ini index b36b9c45a..0e9f08541 100644 --- a/variants/tracksenger/platformio.ini +++ b/variants/esp32s3/tracksenger/platformio.ini @@ -5,7 +5,8 @@ board_build.partitions = default_8MB.csv upload_protocol = esp-builtin build_flags = - ${esp32s3_base.build_flags} -I variants/tracksenger/internal + ${esp32s3_base.build_flags} + -I variants/esp32s3/tracksenger/internal -D HELTEC_TRACKER_V1_1 -D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. ;-D DEBUG_DISABLED ; uncomment this line to disable DEBUG output @@ -21,7 +22,8 @@ board_build.partitions = default_8MB.csv upload_protocol = esp-builtin build_flags = - ${esp32s3_base.build_flags} -I variants/tracksenger/lcd + ${esp32s3_base.build_flags} + -I variants/esp32s3/tracksenger/lcd -D HELTEC_TRACKER_V1_1 -D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. ;-D DEBUG_DISABLED ; uncomment this line to disable DEBUG output @@ -37,7 +39,8 @@ board_build.partitions = default_8MB.csv upload_protocol = esp-builtin build_flags = - ${esp32s3_base.build_flags} -I variants/tracksenger/oled + ${esp32s3_base.build_flags} + -I variants/esp32s3/tracksenger/oled -D HELTEC_TRACKER_V1_1 -D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. ;-D DEBUG_DISABLED ; uncomment this line to disable DEBUG output diff --git a/variants/unphone/pins_arduino.h b/variants/esp32s3/unphone/pins_arduino.h similarity index 100% rename from variants/unphone/pins_arduino.h rename to variants/esp32s3/unphone/pins_arduino.h diff --git a/variants/unphone/platformio.ini b/variants/esp32s3/unphone/platformio.ini similarity index 96% rename from variants/unphone/platformio.ini rename to variants/esp32s3/unphone/platformio.ini index b9da6d0e5..ecb1cbd67 100644 --- a/variants/unphone/platformio.ini +++ b/variants/esp32s3/unphone/platformio.ini @@ -11,7 +11,7 @@ monitor_filters = esp32_exception_decoder build_flags = ${esp32s3_base.build_flags} -D UNPHONE - -I variants/unphone + -I variants/esp32s3/unphone -D ARDUINO_USB_MODE=0 -D UNPHONE_ACCEL=0 -D UNPHONE_TOUCHS=0 @@ -23,7 +23,7 @@ build_flags = build_src_filter = ${esp32s3_base.build_src_filter} - +<../variants/unphone> + +<../variants/esp32s3/unphone> lib_deps = ${esp32s3_base.lib_deps} lovyan03/LovyanGFX@ 1.2.0 diff --git a/variants/unphone/variant.cpp b/variants/esp32s3/unphone/variant.cpp similarity index 100% rename from variants/unphone/variant.cpp rename to variants/esp32s3/unphone/variant.cpp diff --git a/variants/unphone/variant.h b/variants/esp32s3/unphone/variant.h similarity index 100% rename from variants/unphone/variant.h rename to variants/esp32s3/unphone/variant.h From 36b94cf823faa82e1fb67767daa782e449fc8ddc Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sun, 20 Jul 2025 18:53:40 -0500 Subject: [PATCH 035/180] Unify the shutdown proceedure (#7393) * Unify the shutdown proceedure * Don't double save nodeDB on shutdown * Re-tool button shutdown to better correspond to tones * Beep then save --------- Co-authored-by: Ben Meadors --- src/Power.cpp | 15 ++++++++-- src/buzz/BuzzerFeedbackThread.cpp | 4 --- src/graphics/draw/MenuHandler.cpp | 5 ++-- src/input/ButtonThread.cpp | 44 +++++++++++++--------------- src/input/ButtonThread.h | 2 +- src/input/ExpressLRSFiveWay.cpp | 9 +----- src/main.cpp | 5 ++-- src/modules/SystemCommandsModule.cpp | 6 +--- src/shutdown.h | 15 +--------- 9 files changed, 43 insertions(+), 62 deletions(-) diff --git a/src/Power.cpp b/src/Power.cpp index 9c67977bd..385cc1a65 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -681,7 +681,14 @@ bool Power::setup() void Power::shutdown() { - LOG_INFO("Shutting Down"); + +#if HAS_SCREEN + if (screen) { + screen->showSimpleBanner("Shutting Down...", 0); // stays on screen + } +#endif + playShutdownMelody(); + nodeDB->saveToDisk(); #if defined(ARCH_NRF52) || defined(ARCH_ESP32) || defined(ARCH_RP2040) #ifdef PIN_LED1 @@ -693,7 +700,11 @@ void Power::shutdown() #ifdef PIN_LED3 ledOff(PIN_LED3); #endif - doDeepSleep(DELAY_FOREVER, false, false); + doDeepSleep(DELAY_FOREVER, false, true); +#elif defined(ARCH_PORTDUINO) + exit(EXIT_SUCCESS); +#else + LOG_WARN("FIXME implement shutdown for this platform"); #endif } diff --git a/src/buzz/BuzzerFeedbackThread.cpp b/src/buzz/BuzzerFeedbackThread.cpp index b644ea8f4..ce762c764 100644 --- a/src/buzz/BuzzerFeedbackThread.cpp +++ b/src/buzz/BuzzerFeedbackThread.cpp @@ -47,10 +47,6 @@ int BuzzerFeedbackThread::handleInputEvent(const InputEvent *event) playComboTune(); // Ping sent feedback break; - case INPUT_BROKER_SHUTDOWN: - playShutdownMelody(); // Shutdown feedback - break; - default: // For other events, check if it's a printable character if (event->kbchar >= 32 && event->kbchar <= 126) { diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index 7ed9c4ea1..83198a7c5 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -815,9 +815,8 @@ void menuHandler::shutdownMenu() bannerOptions.optionsCount = 2; bannerOptions.bannerCallback = [](int selected) -> void { if (selected == 1) { - IF_SCREEN(screen->showSimpleBanner("Shutting Down...", 0)); - nodeDB->saveToDisk(); - power->shutdown(); + InputEvent event = {.inputEvent = (input_broker_event)INPUT_BROKER_SHUTDOWN, .kbchar = 0, .touchX = 0, .touchY = 0}; + inputBroker->injectInputEvent(&event); } else { menuQueue = power_menu; screen->runNow(); diff --git a/src/input/ButtonThread.cpp b/src/input/ButtonThread.cpp index ad667f003..233bbefe0 100644 --- a/src/input/ButtonThread.cpp +++ b/src/input/ButtonThread.cpp @@ -53,23 +53,21 @@ bool ButtonThread::initButton(const ButtonConfig &config) }, this); - if (config.longPress != INPUT_BROKER_NONE) { - _longPress = config.longPress; - userButton.attachLongPressStart( - [](void *callerThread) -> void { - ButtonThread *thread = (ButtonThread *)callerThread; - // if (millis() > 30000) // hold off 30s after boot - thread->btnEvent = BUTTON_EVENT_LONG_PRESSED; - }, - this); - userButton.attachLongPressStop( - [](void *callerThread) -> void { - ButtonThread *thread = (ButtonThread *)callerThread; - // if (millis() > 30000) // hold off 30s after boot - thread->btnEvent = BUTTON_EVENT_LONG_RELEASED; - }, - this); - } + _longPress = config.longPress; + userButton.attachLongPressStart( + [](void *callerThread) -> void { + ButtonThread *thread = (ButtonThread *)callerThread; + // if (millis() > 30000) // hold off 30s after boot + thread->btnEvent = BUTTON_EVENT_LONG_PRESSED; + }, + this); + userButton.attachLongPressStop( + [](void *callerThread) -> void { + ButtonThread *thread = (ButtonThread *)callerThread; + // if (millis() > 30000) // hold off 30s after boot + thread->btnEvent = BUTTON_EVENT_LONG_RELEASED; + }, + this); if (config.doublePress != INPUT_BROKER_NONE) { _doublePress = config.doublePress; @@ -202,11 +200,11 @@ int32_t ButtonThread::runOnce() break; } - - // Forward long press to InputBroker (but NOT as DOWN/SELECT, just forward a "button long press" event) - evt.inputEvent = _longPress; - this->notifyObservers(&evt); - + if (_longPress != INPUT_BROKER_NONE) { + // Forward long press to InputBroker (but NOT as DOWN/SELECT, just forward a "button long press" event) + evt.inputEvent = _longPress; + this->notifyObservers(&evt); + } // Reset combination tracking waitingForLongPress = false; @@ -253,7 +251,7 @@ int32_t ButtonThread::runOnce() // may wake the board immediatedly. case BUTTON_EVENT_LONG_RELEASED: { - LOG_INFO("LONG PRESS RELEASE"); + LOG_INFO("LONG PRESS RELEASE AFTER %u MILLIS", millis() - buttonPressStartTime); if (millis() > 30000 && _longLongPress != INPUT_BROKER_NONE && (millis() - buttonPressStartTime) >= _longLongPressTime) { evt.inputEvent = _longLongPress; diff --git a/src/input/ButtonThread.h b/src/input/ButtonThread.h index 2358e609d..bbc8da2a7 100644 --- a/src/input/ButtonThread.h +++ b/src/input/ButtonThread.h @@ -18,7 +18,7 @@ struct ButtonConfig { uint16_t longPressTime = 500; input_broker_event doublePress = INPUT_BROKER_NONE; input_broker_event longLongPress = INPUT_BROKER_NONE; - uint16_t longLongPressTime = 5000; + uint16_t longLongPressTime = 3900; input_broker_event triplePress = INPUT_BROKER_NONE; input_broker_event shortLong = INPUT_BROKER_NONE; bool touchQuirk = false; diff --git a/src/input/ExpressLRSFiveWay.cpp b/src/input/ExpressLRSFiveWay.cpp index 53bcedc63..77f9e9993 100644 --- a/src/input/ExpressLRSFiveWay.cpp +++ b/src/input/ExpressLRSFiveWay.cpp @@ -233,14 +233,7 @@ void ExpressLRSFiveWay::sendAdhocPing() // Contained as one method for easier remapping of buttons by user void ExpressLRSFiveWay::shutdown() { - LOG_INFO("Shutdown from long press"); - powerFSM.trigger(EVENT_PRESS); - screen->startAlert("Shutting Down..."); - // Don't set alerting = true. We don't want to auto-dismiss this alert. - - playShutdownMelody(); // In case user adds a buzzer - - shutdownAtMsec = millis() + 3000; + sendKey(INPUT_BROKER_SHUTDOWN); } void ExpressLRSFiveWay::click() diff --git a/src/main.cpp b/src/main.cpp index c37001307..2e2adfd46 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1042,8 +1042,9 @@ void setup() mainDelay.interruptFromISR(&higherWake); }; userConfigNoScreen.singlePress = INPUT_BROKER_USER_PRESS; - userConfigNoScreen.longPress = INPUT_BROKER_SHUTDOWN; - userConfigNoScreen.longPressTime = 5000; + userConfigNoScreen.longPress = INPUT_BROKER_NONE; + userConfigNoScreen.longPressTime = 500; + userConfigNoScreen.longLongPress = INPUT_BROKER_SHUTDOWN; userConfigNoScreen.doublePress = INPUT_BROKER_SEND_PING; userConfigNoScreen.triplePress = INPUT_BROKER_GPS_TOGGLE; UserButtonThread->initButton(userConfigNoScreen); diff --git a/src/modules/SystemCommandsModule.cpp b/src/modules/SystemCommandsModule.cpp index ab9439b39..2d534bd67 100644 --- a/src/modules/SystemCommandsModule.cpp +++ b/src/modules/SystemCommandsModule.cpp @@ -107,11 +107,7 @@ int SystemCommandsModule::handleInputEvent(const InputEvent *event) return true; // Power control case INPUT_BROKER_SHUTDOWN: - LOG_ERROR("Shutting Down"); - IF_SCREEN(screen->showSimpleBanner("Shutting Down...")); - nodeDB->saveToDisk(); - shutdownAtMsec = millis() + DEFAULT_SHUTDOWN_SECONDS * 1000; - // runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; + shutdownAtMsec = millis(); return true; default: diff --git a/src/shutdown.h b/src/shutdown.h index 7e2120149..973e388b1 100644 --- a/src/shutdown.h +++ b/src/shutdown.h @@ -40,21 +40,8 @@ void powerCommandsCheck() #endif } -#if defined(ARCH_ESP32) || defined(ARCH_NRF52) - if (shutdownAtMsec && screen) { - screen->showSimpleBanner("Shutting Down...", 0); // stays on screen - } -#endif - if (shutdownAtMsec && millis() > shutdownAtMsec) { - LOG_INFO("Shut down from admin command"); -#if defined(ARCH_NRF52) || defined(ARCH_ESP32) || defined(ARCH_RP2040) - playShutdownMelody(); + shutdownAtMsec = 0; power->shutdown(); -#elif defined(ARCH_PORTDUINO) - exit(EXIT_SUCCESS); -#else - LOG_WARN("FIXME implement shutdown for this platform"); -#endif } } \ No newline at end of file From 8345c21effe958588ccca3906a24104fd4f476ac Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 20 Jul 2025 20:02:32 -0500 Subject: [PATCH 036/180] STM32 doesn't play --- src/Power.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Power.cpp b/src/Power.cpp index 385cc1a65..ee97eda6e 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -687,7 +687,9 @@ void Power::shutdown() screen->showSimpleBanner("Shutting Down...", 0); // stays on screen } #endif +#ifndef ARCH_STM32 playShutdownMelody(); +#endif nodeDB->saveToDisk(); #if defined(ARCH_NRF52) || defined(ARCH_ESP32) || defined(ARCH_RP2040) From 8aef3c44f4f060c2008d3c950981d85af3bb5e92 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 20 Jul 2025 20:12:10 -0500 Subject: [PATCH 037/180] Text message rate limiting should return routing error instead (#7365) * Text message rate limiting should return routing error instead * Proper rooting * Update PhoneAPI.cpp * Update PhoneAPI.cpp --- src/mesh/MeshService.cpp | 16 ++++++++++++++++ src/mesh/MeshService.h | 3 +++ src/mesh/PhoneAPI.cpp | 3 ++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/mesh/MeshService.cpp b/src/mesh/MeshService.cpp index 297c7b2ed..2cc4197c1 100644 --- a/src/mesh/MeshService.cpp +++ b/src/mesh/MeshService.cpp @@ -16,6 +16,7 @@ #include "meshUtils.h" #include "modules/NodeInfoModule.h" #include "modules/PositionModule.h" +#include "modules/RoutingModule.h" #include "power.h" #include #include @@ -333,6 +334,21 @@ void MeshService::sendMqttMessageToClientProxy(meshtastic_MqttClientProxyMessage fromNum++; } +void MeshService::sendRoutingErrorResponse(meshtastic_Routing_Error error, const meshtastic_MeshPacket *mp) +{ + if (!mp) { + LOG_WARN("Cannot send routing error response: null packet"); + return; + } + + // Use the routing module to send the error response + if (routingModule) { + routingModule->sendAckNak(error, mp->from, mp->id, mp->channel); + } else { + LOG_ERROR("Cannot send routing error response: no routing module"); + } +} + void MeshService::sendClientNotification(meshtastic_ClientNotification *n) { LOG_DEBUG("Send client notification to phone"); diff --git a/src/mesh/MeshService.h b/src/mesh/MeshService.h index e2e430c03..89d3b15d0 100644 --- a/src/mesh/MeshService.h +++ b/src/mesh/MeshService.h @@ -148,6 +148,9 @@ class MeshService /// Send a ClientNotification to the phone void sendClientNotification(meshtastic_ClientNotification *cn); + /// Send an error response to the phone + void sendRoutingErrorResponse(meshtastic_Routing_Error error, const meshtastic_MeshPacket *mp); + bool isToPhoneQueueEmpty(); ErrorCode sendQueueStatusToPhone(const meshtastic_QueueStatus &qs, ErrorCode res, uint32_t mesh_packet_id); diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index 287de38fa..e0b81bedd 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -686,7 +686,8 @@ bool PhoneAPI::handleToRadioPacket(meshtastic_MeshPacket &p) LOG_WARN("Rate limit portnum %d", p.decoded.portnum); meshtastic_QueueStatus qs = router->getQueueStatus(); service->sendQueueStatusToPhone(qs, 0, p.id); - sendNotification(meshtastic_LogRecord_Level_WARNING, p.id, "Text messages can only be sent once every 2 seconds"); + service->sendRoutingErrorResponse(meshtastic_Routing_Error_RATE_LIMIT_EXCEEDED, &p); + // sendNotification(meshtastic_LogRecord_Level_WARNING, p.id, "Text messages can only be sent once every 2 seconds"); return false; } lastPortNumToRadio[p.decoded.portnum] = millis(); From 25b8d9b0ca9de9633779b15954f29401f4c008e0 Mon Sep 17 00:00:00 2001 From: Austin Date: Sun, 20 Jul 2025 23:30:52 -0400 Subject: [PATCH 038/180] ARCH_STM32*WL* macro fix (#7397) --- src/Power.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Power.cpp b/src/Power.cpp index ee97eda6e..ed2d867d8 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -687,7 +687,7 @@ void Power::shutdown() screen->showSimpleBanner("Shutting Down...", 0); // stays on screen } #endif -#ifndef ARCH_STM32 +#if !defined(ARCH_STM32WL) playShutdownMelody(); #endif nodeDB->saveToDisk(); From 19dc2873c55884b7e6f3066448002cb1f543e974 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 20:07:45 +1000 Subject: [PATCH 039/180] Upgrade trunk (#7400) Co-authored-by: vidplace7 <1779290+vidplace7@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 e1abbcc88..d6a8cc8c1 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,14 +9,14 @@ plugins: lint: enabled: - checkov@3.2.451 - - renovate@41.37.9 + - renovate@41.38.1 - prettier@3.6.2 - trufflehog@3.90.0 - yamllint@1.37.1 - bandit@1.8.6 - trivy@0.64.1 - taplo@0.9.3 - - ruff@0.12.3 + - ruff@0.12.4 - isort@6.0.1 - markdownlint@0.45.0 - oxipng@9.1.5 From b3525c256908e61ae2c9e63491d8e5fc2cfd02ce Mon Sep 17 00:00:00 2001 From: Manuel <71137295+mverch67@users.noreply.github.com> Date: Mon, 21 Jul 2025 19:33:24 +0200 Subject: [PATCH 040/180] T-Deck Pro support (#6936) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * initial draft * fix touchscreen * fix touchscreen * optimize GPS * battery management * cleanup comments * enable vibration motor * refactored TCA8418Keyboard * update HW_VENDOR id * manual fixes after merge * fix keyboard/BQ27220 detection * add BQ27220 * modify charge voltage and current * update XpowerLib * design capacity * try-fix charge behavior * improve Vbus detection * moved variant into esp32s3 folder --------- Co-authored-by: Ben Meadors Co-authored-by: Thomas Göttgens --- arch/esp32/esp32.ini | 4 +- boards/t-deck-pro.json | 43 ++ src/Power.cpp | 152 ++++++ src/configuration.h | 10 +- src/detect/ScanI2C.h | 7 +- src/detect/ScanI2CTwoWire.cpp | 21 +- src/graphics/EInkDisplay2.cpp | 2 +- src/graphics/Screen.cpp | 2 +- src/input/TCA8418Keyboard.cpp | 485 ++---------------- src/input/TCA8418Keyboard.h | 85 +-- src/input/TCA8418KeyboardBase.cpp | 372 ++++++++++++++ src/input/TCA8418KeyboardBase.h | 170 ++++++ src/input/TDeckProKeyboard.cpp | 196 +++++++ src/input/TDeckProKeyboard.h | 27 + src/input/TLoraPagerKeyboard.h | 12 + src/input/kbI2cBase.cpp | 71 ++- src/input/kbI2cBase.h | 5 +- src/main.cpp | 9 + src/mesh/NodeDB.cpp | 8 +- src/platform/esp32/architecture.h | 2 + .../extra_variants/t_deck_pro/variant.cpp | 28 + src/power.h | 2 + variants/esp32s3/t-deck-pro/pins_arduino.h | 19 + variants/esp32s3/t-deck-pro/platformio.ini | 24 + variants/esp32s3/t-deck-pro/variant.h | 94 ++++ 25 files changed, 1298 insertions(+), 552 deletions(-) create mode 100644 boards/t-deck-pro.json create mode 100644 src/input/TCA8418KeyboardBase.cpp create mode 100644 src/input/TCA8418KeyboardBase.h create mode 100644 src/input/TDeckProKeyboard.cpp create mode 100644 src/input/TDeckProKeyboard.h create mode 100644 src/input/TLoraPagerKeyboard.h create mode 100644 src/platform/extra_variants/t_deck_pro/variant.cpp create mode 100644 variants/esp32s3/t-deck-pro/pins_arduino.h create mode 100644 variants/esp32s3/t-deck-pro/platformio.ini create mode 100644 variants/esp32s3/t-deck-pro/variant.h diff --git a/arch/esp32/esp32.ini b/arch/esp32/esp32.ini index 6b9ebcb24..9d21562a8 100644 --- a/arch/esp32/esp32.ini +++ b/arch/esp32/esp32.ini @@ -54,8 +54,8 @@ lib_deps = h2zero/NimBLE-Arduino@^1.4.3 # renovate: datasource=git-refs depName=libpax packageName=https://github.com/dbinfrago/libpax gitBranch=master https://github.com/dbinfrago/libpax/archive/3cdc0371c375676a97967547f4065607d4c53fd1.zip - # renovate: datasource=custom.pio depName=XPowersLib packageName=lewisxhe/library/XPowersLib - lewisxhe/XPowersLib@0.3.0 + # renovate: datasource=git-refs depName=XPowersLib packageName=https://github.com/lewisxhe/XPowersLib gitBranch=master + https://github.com/lewisxhe/XPowersLib/archive/refs/tags/v0.3.0.zip # renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto diff --git a/boards/t-deck-pro.json b/boards/t-deck-pro.json new file mode 100644 index 000000000..2f4bd594a --- /dev/null +++ b/boards/t-deck-pro.json @@ -0,0 +1,43 @@ +{ + "build": { + "arduino": { + "ldscript": "esp32s3_out.ld", + "memory_type": "qio_qspi", + "partitions": "default_16MB.csv" + }, + "core": "esp32", + "extra_flags": [ + "-DBOARD_HAS_PSRAM", + "-DARDUINO_USB_CDC_ON_BOOT=1", + "-DARDUINO_USB_MODE=1", + "-DARDUINO_RUNNING_CORE=1", + "-DARDUINO_EVENT_RUNNING_CORE=1" + ], + "f_cpu": "240000000L", + "f_flash": "80000000L", + "flash_mode": "qio", + "hwids": [["0x303A", "0x1001"]], + "mcu": "esp32s3", + "variant": "esp32s3" + }, + "connectivity": ["wifi", "bluetooth", "lora"], + "debug": { + "default_tool": "esp-builtin", + "onboard_tools": ["esp-builtin"], + "openocd_target": "esp32s3.cfg" + }, + "frameworks": ["arduino", "espidf"], + "name": "LilyGo T-Deck Pro S3 (16M Flash 8M QSPI PSRAM )", + "upload": { + "flash_size": "16MB", + "maximum_ram_size": 327680, + "maximum_size": 16777216, + "require_upload_port": true, + "speed": 921600 + }, + "monitor": { + "speed": 115200 + }, + "url": "https://lilygo.cc/products/t-deck-pro", + "vendor": "LilyGo" +} diff --git a/src/Power.cpp b/src/Power.cpp index ed2d867d8..298f08e0d 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -120,6 +120,15 @@ NullSensor max17048Sensor; RAK9154Sensor rak9154Sensor; #endif +#ifdef HAS_PPM +// note: XPOWERS_CHIP_XXX must be defined in variant.h +#include +#endif + +#ifdef HAS_BQ27220 +#include "bq27220.h" +#endif + #ifdef HAS_PMU XPowersLibInterface *PMU = NULL; #else @@ -665,6 +674,8 @@ bool Power::setup() found = true; } else if (lipoInit()) { found = true; + } else if (lipoChargerInit()) { + found = true; } else if (analogInit()) { found = true; } @@ -1250,3 +1261,144 @@ bool Power::lipoInit() return false; } #endif + +#if defined(HAS_PPM) && HAS_PPM + +/** + * Adapter class for BQ25896/BQ27220 Lipo battery charger. + */ +class LipoCharger : public HasBatteryLevel +{ + private: + XPowersPPM *ppm = nullptr; + BQ27220 *bq = nullptr; + + public: + /** + * Init the I2C BQ25896 Lipo battery charger + */ + bool runOnce() + { + if (ppm == nullptr) { + ppm = new XPowersPPM; + bool result = ppm->init(Wire, I2C_SDA, I2C_SCL, BQ25896_ADDR); + if (result) { + LOG_INFO("PPM BQ25896 init succeeded"); + // Set the minimum operating voltage. Below this voltage, the PPM will protect + // ppm->setSysPowerDownVoltage(3100); + + // Set input current limit, default is 500mA + // ppm->setInputCurrentLimit(800); + + // Disable current limit pin + // ppm->disableCurrentLimitPin(); + + // Set the charging target voltage, Range:3840 ~ 4608mV ,step:16 mV + ppm->setChargeTargetVoltage(4288); + + // Set the precharge current , Range: 64mA ~ 1024mA ,step:64mA + // ppm->setPrechargeCurr(64); + + // The premise is that limit pin is disabled, or it will + // only follow the maximum charging current set by limit pin. + // Set the charging current , Range:0~5056mA ,step:64mA + ppm->setChargerConstantCurr(1024); + + // To obtain voltage data, the ADC must be enabled first + ppm->enableMeasure(); + + // Turn on charging function + // If there is no battery connected, do not turn on the charging function + ppm->enableCharge(); + } else { + LOG_WARN("PPM BQ25896 init failed"); + delete ppm; + ppm = nullptr; + return false; + } + } + if (bq == nullptr) { + bq = new BQ27220; + bq->setDefaultCapacity(BQ27220_DESIGN_CAPACITY); + + bool result = bq->init(); + if (result) { + LOG_DEBUG("BQ27220 design capacity: %d", bq->getDesignCapacity()); + LOG_DEBUG("BQ27220 fullCharge capacity: %d", bq->getFullChargeCapacity()); + LOG_DEBUG("BQ27220 remaining capacity: %d", bq->getRemainingCapacity()); + return true; + } else { + LOG_WARN("BQ27220 init failed"); + delete bq; + bq = nullptr; + return false; + } + } + return false; + } + + /** + * Battery state of charge, from 0 to 100 or -1 for unknown + */ + virtual int getBatteryPercent() override + { + return -1; + // return bq->getChargePercent(); // don't use BQ27220 for battery percent, it is not calibrated + } + + /** + * The raw voltage of the battery in millivolts, or NAN if unknown + */ + virtual uint16_t getBattVoltage() override { return bq->getVoltage(); } + + /** + * return true if there is a battery installed in this unit + */ + virtual bool isBatteryConnect() override { return ppm->getBattVoltage() > 0; } + + /** + * return true if there is an external power source detected + */ + virtual bool isVbusIn() override { return ppm->getVbusVoltage() > 0; } + + /** + * return true if the battery is currently charging + */ + virtual bool isCharging() override + { + bool isCharging = ppm->isCharging(); + if (isCharging) { + LOG_DEBUG("BQ27220 time to full charge: %d min", bq->getTimeToFull()); + } else { + if (!ppm->isVbusIn()) { + LOG_DEBUG("BQ27220 time to empty: %d min (%d mAh)", bq->getTimeToEmpty(), bq->getRemainingCapacity()); + } + } + return isCharging; + } +}; + +LipoCharger lipoCharger; + +/** + * Init the Lipo battery charger + */ +bool Power::lipoChargerInit() +{ + bool result = lipoCharger.runOnce(); + LOG_DEBUG("Power::lipoChargerInit lipo sensor is %s", result ? "ready" : "not ready yet"); + if (!result) + return false; + batteryLevel = &lipoCharger; + return true; +} + +#else +/** + * The Lipo battery level sensor is unavailable - default to AnalogBatteryLevel + */ +bool Power::lipoChargerInit() +{ + return false; +} +#endif diff --git a/src/configuration.h b/src/configuration.h index cddc7ba7a..0e24990b5 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -150,11 +150,12 @@ along with this program. If not, see . // Define if screen should be mirrored left to right // #define SCREEN_MIRROR -// I2C Keyboards (M5Stack, RAK14004, T-Deck) +// I2C Keyboards (M5Stack, RAK14004, T-Deck, T-Deck Pro, T-Lora Pager, CardKB, BBQ10, MPR121, TCA8418) #define CARDKB_ADDR 0x5F #define TDECK_KB_ADDR 0x55 #define BBQ10_KB_ADDR 0x1F #define MPR121_KB_ADDR 0x5A +#define TCA8418_KB_ADDR 0x34 // ----------------------------------------------------------------------------- // SENSOR @@ -193,8 +194,11 @@ along with this program. If not, see . #define MLX90614_ADDR_DEF 0x5A #define CGRADSENS_ADDR 0x66 #define LTR390UV_ADDR 0x53 -#define XPOWERS_AXP192_AXP2101_ADDRESS 0x34 // same adress as TCA8418 +#define XPOWERS_AXP192_AXP2101_ADDRESS 0x34 // same adress as TCA8418_KB #define PCT2075_ADDR 0x37 +#define BQ27220_ADDR 0x55 // same address as TDECK_KB +#define BQ25896_ADDR 0x6B +#define LTR553ALS_ADDR 0x23 // ----------------------------------------------------------------------------- // ACCELEROMETER @@ -208,6 +212,7 @@ along with this program. If not, see . #define BMX160_ADDR 0x69 #define ICM20948_ADDR 0x69 #define ICM20948_ADDR_ALT 0x68 +#define BHI260AP_ADDR 0x28 #define BMM150_ADDR 0x13 // ----------------------------------------------------------------------------- @@ -230,6 +235,7 @@ along with this program. If not, see . // Touchscreen // ----------------------------------------------------------------------------- #define FT6336U_ADDR 0x48 +#define CST328_ADDR 0x1A // ----------------------------------------------------------------------------- // RAK12035VB Soil Monitor (using RAK12023 up to 3 RAK12035 monitors can be connected) diff --git a/src/detect/ScanI2C.h b/src/detect/ScanI2C.h index dd290db98..c1358861b 100644 --- a/src/detect/ScanI2C.h +++ b/src/detect/ScanI2C.h @@ -74,7 +74,12 @@ class ScanI2C RAK12035, TCA8418KB, PCT2075, - BMM150, + CST328, + BQ25896, + BQ27220, + LTR553ALS, + BHI260AP, + BMM150 } DeviceType; // typedef uint8_t DeviceAddress; diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index 9e9441123..652d50d51 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -206,7 +206,17 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) } break; - SCAN_SIMPLE_CASE(TDECK_KB_ADDR, TDECKKB, "T-Deck keyboard", (uint8_t)addr.address); + case TDECK_KB_ADDR: + // Do we have the T-Deck keyboard or the T-Deck Pro battery sensor? + registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x04), 1); + if (registerValue != 0) { + logFoundDevice("BQ27220", (uint8_t)addr.address); + type = BQ27220; + } else { + logFoundDevice("TDECKKB", (uint8_t)addr.address); + type = TDECKKB; + } + break; SCAN_SIMPLE_CASE(BBQ10_KB_ADDR, BBQ10KB, "BB Q10", (uint8_t)addr.address); SCAN_SIMPLE_CASE(ST7567_ADDRESS, SCREEN_ST7567, "ST7567", (uint8_t)addr.address); @@ -396,6 +406,12 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) logFoundDevice("BQ24295", (uint8_t)addr.address); break; } + registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x14), 1); // get ID + if ((registerValue & 0b00000011) == 0b00000010) { + type = BQ25896; + logFoundDevice("BQ25896", (uint8_t)addr.address); + break; + } registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0F), 1); // get ID if (registerValue == 0x6A) { type = LSM6DS3; @@ -447,6 +463,9 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) SCAN_SIMPLE_CASE(DFROBOT_RAIN_ADDR, DFROBOT_RAIN, "DFRobot Rain Gauge", (uint8_t)addr.address); SCAN_SIMPLE_CASE(LTR390UV_ADDR, LTR390UV, "LTR390UV", (uint8_t)addr.address); SCAN_SIMPLE_CASE(PCT2075_ADDR, PCT2075, "PCT2075", (uint8_t)addr.address); + SCAN_SIMPLE_CASE(CST328_ADDR, CST328, "CST328", (uint8_t)addr.address); + SCAN_SIMPLE_CASE(LTR553ALS_ADDR, LTR553ALS, "LTR553ALS", (uint8_t)addr.address); + SCAN_SIMPLE_CASE(BHI260AP_ADDR, BHI260AP, "BHI260AP", (uint8_t)addr.address); SCAN_SIMPLE_CASE(SCD4X_ADDR, SCD4X, "SCD4X", (uint8_t)addr.address); SCAN_SIMPLE_CASE(BMM150_ADDR, BMM150, "BMM150", (uint8_t)addr.address); #ifdef HAS_TPS65233 diff --git a/src/graphics/EInkDisplay2.cpp b/src/graphics/EInkDisplay2.cpp index 66c7938b5..3bd20feec 100644 --- a/src/graphics/EInkDisplay2.cpp +++ b/src/graphics/EInkDisplay2.cpp @@ -206,7 +206,7 @@ bool EInkDisplay::connect() adafruitDisplay->setRotation(0); adafruitDisplay->setPartialWindow(0, 0, EINK_WIDTH, EINK_HEIGHT); } -#elif defined(M5_COREINK) +#elif defined(M5_COREINK) || defined(T_DECK_PRO) auto lowLevel = new EINK_DISPLAY_MODEL(PIN_EINK_CS, PIN_EINK_DC, PIN_EINK_RES, PIN_EINK_BUSY); adafruitDisplay = new GxEPD2_BW(*lowLevel); adafruitDisplay->init(115200, true, 40, false, SPI, SPISettings(4000000, MSBFIRST, SPI_MODE0)); diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 87d394d69..f22a0d8a8 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -579,7 +579,7 @@ void Screen::setup() touchScreenImpl1->init(); } } -#elif HAS_TOUCHSCREEN +#elif HAS_TOUCHSCREEN && !defined(USE_EINK) touchScreenImpl1 = new TouchScreenImpl1(dispdev->getWidth(), dispdev->getHeight(), static_cast(dispdev)->getTouch); touchScreenImpl1->init(); diff --git a/src/input/TCA8418Keyboard.cpp b/src/input/TCA8418Keyboard.cpp index d99379b23..bd8338acf 100644 --- a/src/input/TCA8418Keyboard.cpp +++ b/src/input/TCA8418Keyboard.cpp @@ -1,116 +1,18 @@ -// Based on the MPR121 Keyboard and Adafruit TCA8418 library - #include "TCA8418Keyboard.h" -#include "configuration.h" - -#include - -// REGISTERS -// #define _TCA8418_REG_RESERVED 0x00 -#define _TCA8418_REG_CFG 0x01 // Configuration register -#define _TCA8418_REG_INT_STAT 0x02 // Interrupt status -#define _TCA8418_REG_KEY_LCK_EC 0x03 // Key lock and event counter -#define _TCA8418_REG_KEY_EVENT_A 0x04 // Key event register A -#define _TCA8418_REG_KEY_EVENT_B 0x05 // Key event register B -#define _TCA8418_REG_KEY_EVENT_C 0x06 // Key event register C -#define _TCA8418_REG_KEY_EVENT_D 0x07 // Key event register D -#define _TCA8418_REG_KEY_EVENT_E 0x08 // Key event register E -#define _TCA8418_REG_KEY_EVENT_F 0x09 // Key event register F -#define _TCA8418_REG_KEY_EVENT_G 0x0A // Key event register G -#define _TCA8418_REG_KEY_EVENT_H 0x0B // Key event register H -#define _TCA8418_REG_KEY_EVENT_I 0x0C // Key event register I -#define _TCA8418_REG_KEY_EVENT_J 0x0D // Key event register J -#define _TCA8418_REG_KP_LCK_TIMER 0x0E // Keypad lock1 to lock2 timer -#define _TCA8418_REG_UNLOCK_1 0x0F // Unlock register 1 -#define _TCA8418_REG_UNLOCK_2 0x10 // Unlock register 2 -#define _TCA8418_REG_GPIO_INT_STAT_1 0x11 // GPIO interrupt status 1 -#define _TCA8418_REG_GPIO_INT_STAT_2 0x12 // GPIO interrupt status 2 -#define _TCA8418_REG_GPIO_INT_STAT_3 0x13 // GPIO interrupt status 3 -#define _TCA8418_REG_GPIO_DAT_STAT_1 0x14 // GPIO data status 1 -#define _TCA8418_REG_GPIO_DAT_STAT_2 0x15 // GPIO data status 2 -#define _TCA8418_REG_GPIO_DAT_STAT_3 0x16 // GPIO data status 3 -#define _TCA8418_REG_GPIO_DAT_OUT_1 0x17 // GPIO data out 1 -#define _TCA8418_REG_GPIO_DAT_OUT_2 0x18 // GPIO data out 2 -#define _TCA8418_REG_GPIO_DAT_OUT_3 0x19 // GPIO data out 3 -#define _TCA8418_REG_GPIO_INT_EN_1 0x1A // GPIO interrupt enable 1 -#define _TCA8418_REG_GPIO_INT_EN_2 0x1B // GPIO interrupt enable 2 -#define _TCA8418_REG_GPIO_INT_EN_3 0x1C // GPIO interrupt enable 3 -#define _TCA8418_REG_KP_GPIO_1 0x1D // Keypad/GPIO select 1 -#define _TCA8418_REG_KP_GPIO_2 0x1E // Keypad/GPIO select 2 -#define _TCA8418_REG_KP_GPIO_3 0x1F // Keypad/GPIO select 3 -#define _TCA8418_REG_GPI_EM_1 0x20 // GPI event mode 1 -#define _TCA8418_REG_GPI_EM_2 0x21 // GPI event mode 2 -#define _TCA8418_REG_GPI_EM_3 0x22 // GPI event mode 3 -#define _TCA8418_REG_GPIO_DIR_1 0x23 // GPIO data direction 1 -#define _TCA8418_REG_GPIO_DIR_2 0x24 // GPIO data direction 2 -#define _TCA8418_REG_GPIO_DIR_3 0x25 // GPIO data direction 3 -#define _TCA8418_REG_GPIO_INT_LVL_1 0x26 // GPIO edge/level detect 1 -#define _TCA8418_REG_GPIO_INT_LVL_2 0x27 // GPIO edge/level detect 2 -#define _TCA8418_REG_GPIO_INT_LVL_3 0x28 // GPIO edge/level detect 3 -#define _TCA8418_REG_DEBOUNCE_DIS_1 0x29 // Debounce disable 1 -#define _TCA8418_REG_DEBOUNCE_DIS_2 0x2A // Debounce disable 2 -#define _TCA8418_REG_DEBOUNCE_DIS_3 0x2B // Debounce disable 3 -#define _TCA8418_REG_GPIO_PULL_1 0x2C // GPIO pull-up disable 1 -#define _TCA8418_REG_GPIO_PULL_2 0x2D // GPIO pull-up disable 2 -#define _TCA8418_REG_GPIO_PULL_3 0x2E // GPIO pull-up disable 3 -// #define _TCA8418_REG_RESERVED 0x2F - -// FIELDS CONFIG REGISTER 1 -#define _TCA8418_REG_CFG_AI 0x80 // Auto-increment for read/write -#define _TCA8418_REG_CFG_GPI_E_CGF 0x40 // Event mode config -#define _TCA8418_REG_CFG_OVR_FLOW_M 0x20 // Overflow mode enable -#define _TCA8418_REG_CFG_INT_CFG 0x10 // Interrupt config -#define _TCA8418_REG_CFG_OVR_FLOW_IEN 0x08 // Overflow interrupt enable -#define _TCA8418_REG_CFG_K_LCK_IEN 0x04 // Keypad lock interrupt enable -#define _TCA8418_REG_CFG_GPI_IEN 0x02 // GPI interrupt enable -#define _TCA8418_REG_CFG_KE_IEN 0x01 // Key events interrupt enable - -// FIELDS INT_STAT REGISTER 2 -#define _TCA8418_REG_STAT_CAD_INT 0x10 // Ctrl-alt-del seq status -#define _TCA8418_REG_STAT_OVR_FLOW_INT 0x08 // Overflow interrupt status -#define _TCA8418_REG_STAT_K_LCK_INT 0x04 // Key lock interrupt status -#define _TCA8418_REG_STAT_GPI_INT 0x02 // GPI interrupt status -#define _TCA8418_REG_STAT_K_INT 0x01 // Key events interrupt status - -// FIELDS KEY_LCK_EC REGISTER 3 -#define _TCA8418_REG_LCK_EC_K_LCK_EN 0x40 // Key lock enable -#define _TCA8418_REG_LCK_EC_LCK_2 0x20 // Keypad lock status 2 -#define _TCA8418_REG_LCK_EC_LCK_1 0x10 // Keypad lock status 1 -#define _TCA8418_REG_LCK_EC_KLEC_3 0x08 // Key event count bit 3 -#define _TCA8418_REG_LCK_EC_KLEC_2 0x04 // Key event count bit 2 -#define _TCA8418_REG_LCK_EC_KLEC_1 0x02 // Key event count bit 1 -#define _TCA8418_REG_LCK_EC_KLEC_0 0x01 // Key event count bit 0 - -// Pin IDs for matrix rows/columns -enum { - _TCA8418_ROW0, // Pin ID for row 0 - _TCA8418_ROW1, // Pin ID for row 1 - _TCA8418_ROW2, // Pin ID for row 2 - _TCA8418_ROW3, // Pin ID for row 3 - _TCA8418_ROW4, // Pin ID for row 4 - _TCA8418_ROW5, // Pin ID for row 5 - _TCA8418_ROW6, // Pin ID for row 6 - _TCA8418_ROW7, // Pin ID for row 7 - _TCA8418_COL0, // Pin ID for column 0 - _TCA8418_COL1, // Pin ID for column 1 - _TCA8418_COL2, // Pin ID for column 2 - _TCA8418_COL3, // Pin ID for column 3 - _TCA8418_COL4, // Pin ID for column 4 - _TCA8418_COL5, // Pin ID for column 5 - _TCA8418_COL6, // Pin ID for column 6 - _TCA8418_COL7, // Pin ID for column 7 - _TCA8418_COL8, // Pin ID for column 8 - _TCA8418_COL9 // Pin ID for column 9 -}; #define _TCA8418_COLS 3 #define _TCA8418_ROWS 4 #define _TCA8418_NUM_KEYS 12 -uint8_t TCA8418TapMod[_TCA8418_NUM_KEYS] = {13, 7, 7, 7, 7, 7, - 9, 7, 9, 2, 2, 2}; // Num chars per key, Modulus for rotating through characters +#define _TCA8418_LONG_PRESS_THRESHOLD 2000 +#define _TCA8418_MULTI_TAP_THRESHOLD 750 -unsigned char TCA8418TapMap[_TCA8418_NUM_KEYS][13] = { +using Key = TCA8418KeyboardBase::TCA8418Key; + +// Num chars per key, Modulus for rotating through characters +static uint8_t TCA8418TapMod[_TCA8418_NUM_KEYS] = {13, 7, 7, 7, 7, 7, 9, 7, 9, 2, 2, 2}; + +static unsigned char TCA8418TapMap[_TCA8418_NUM_KEYS][13] = { {'1', '.', ',', '?', '!', ':', ';', '-', '_', '\\', '/', '(', ')'}, // 1 {'2', 'a', 'b', 'c', 'A', 'B', 'C'}, // 2 {'3', 'd', 'e', 'f', 'D', 'E', 'F'}, // 3 @@ -125,176 +27,35 @@ unsigned char TCA8418TapMap[_TCA8418_NUM_KEYS][13] = { {'#', '@'}, // # }; -unsigned char TCA8418LongPressMap[_TCA8418_NUM_KEYS] = { - _TCA8418_ESC, // 1 - _TCA8418_UP, // 2 - _TCA8418_NONE, // 3 - _TCA8418_LEFT, // 4 - _TCA8418_NONE, // 5 - _TCA8418_RIGHT, // 6 - _TCA8418_NONE, // 7 - _TCA8418_DOWN, // 8 - _TCA8418_NONE, // 9 - _TCA8418_BSP, // * - _TCA8418_NONE, // 0 - _TCA8418_NONE, // # +static unsigned char TCA8418LongPressMap[_TCA8418_NUM_KEYS] = { + Key::ESC, // 1 + Key::UP, // 2 + Key::NONE, // 3 + Key::LEFT, // 4 + Key::NONE, // 5 + Key::RIGHT, // 6 + Key::NONE, // 7 + Key::DOWN, // 8 + Key::NONE, // 9 + Key::BSP, // * + Key::NONE, // 0 + Key::NONE, // # }; -#define _TCA8418_LONG_PRESS_THRESHOLD 2000 -#define _TCA8418_MULTI_TAP_THRESHOLD 750 - -TCA8418Keyboard::TCA8418Keyboard() : m_wire(nullptr), m_addr(0), readCallback(nullptr), writeCallback(nullptr) +TCA8418Keyboard::TCA8418Keyboard() + : TCA8418KeyboardBase(_TCA8418_ROWS, _TCA8418_COLS), last_key(-1), next_key(-1), last_tap(0L), char_idx(0), tap_interval(0), + should_backspace(false) { - state = Init; - last_key = -1; - should_backspace = false; - last_tap = 0L; - char_idx = 0; - tap_interval = 0; - backlight_on = true; - queue = ""; -} - -void TCA8418Keyboard::begin(uint8_t addr, TwoWire *wire) -{ - m_addr = addr; - m_wire = wire; - - m_wire->begin(); - - reset(); -} - -void TCA8418Keyboard::begin(i2c_com_fptr_t r, i2c_com_fptr_t w, uint8_t addr) -{ - m_addr = addr; - m_wire = nullptr; - writeCallback = w; - readCallback = r; - reset(); } void TCA8418Keyboard::reset() { - LOG_DEBUG("TCA8418 Reset"); - // GPIO - // set default all GIO pins to INPUT - writeRegister(_TCA8418_REG_GPIO_DIR_1, 0x00); - writeRegister(_TCA8418_REG_GPIO_DIR_2, 0x00); + TCA8418KeyboardBase::reset(); + // Set COL9 as GPIO output - writeRegister(_TCA8418_REG_GPIO_DIR_3, 0x02); + writeRegister(TCA8418_REG_GPIO_DIR_3, 0x02); // Switch off keyboard backlight (COL9 = LOW) - writeRegister(_TCA8418_REG_GPIO_DAT_OUT_3, 0x00); - - // add all pins to key events - writeRegister(_TCA8418_REG_GPI_EM_1, 0xFF); - writeRegister(_TCA8418_REG_GPI_EM_2, 0xFF); - writeRegister(_TCA8418_REG_GPI_EM_3, 0xFF); - - // set all pins to FALLING interrupts - writeRegister(_TCA8418_REG_GPIO_INT_LVL_1, 0x00); - writeRegister(_TCA8418_REG_GPIO_INT_LVL_2, 0x00); - writeRegister(_TCA8418_REG_GPIO_INT_LVL_3, 0x00); - - // add all pins to interrupts - writeRegister(_TCA8418_REG_GPIO_INT_EN_1, 0xFF); - writeRegister(_TCA8418_REG_GPIO_INT_EN_2, 0xFF); - writeRegister(_TCA8418_REG_GPIO_INT_EN_3, 0xFF); - - // Set keyboard matrix size - matrix(_TCA8418_ROWS, _TCA8418_COLS); - enableDebounce(); - flush(); - state = Idle; -} - -bool TCA8418Keyboard::matrix(uint8_t rows, uint8_t columns) -{ - if ((rows > 8) || (columns > 10)) - return false; - - // Skip zero size matrix - if ((rows != 0) && (columns != 0)) { - // Setup the keypad matrix. - uint8_t mask = 0x00; - for (int r = 0; r < rows; r++) { - mask <<= 1; - mask |= 1; - } - writeRegister(_TCA8418_REG_KP_GPIO_1, mask); - - mask = 0x00; - for (int c = 0; c < columns && c < 8; c++) { - mask <<= 1; - mask |= 1; - } - writeRegister(_TCA8418_REG_KP_GPIO_2, mask); - - if (columns > 8) { - if (columns == 9) - mask = 0x01; - else - mask = 0x03; - writeRegister(_TCA8418_REG_KP_GPIO_3, mask); - } - } - - return true; -} - -uint8_t TCA8418Keyboard::keyCount() const -{ - uint8_t eventCount = readRegister(_TCA8418_REG_KEY_LCK_EC); - eventCount &= 0x0F; // lower 4 bits only - return eventCount; -} - -bool TCA8418Keyboard::hasEvent() -{ - return queue.length() > 0; -} - -void TCA8418Keyboard::queueEvent(char next) -{ - if (next == _TCA8418_NONE) { - return; - } - queue.concat(next); -} - -char TCA8418Keyboard::dequeueEvent() -{ - if (queue.length() < 1) { - return _TCA8418_NONE; - } - char next = queue.charAt(0); - queue.remove(0, 1); - return next; -} - -void TCA8418Keyboard::trigger() -{ - if (keyCount() == 0) { - return; - } - if (state != Init) { - // Read the key register - uint8_t k = readRegister(_TCA8418_REG_KEY_EVENT_A); - uint8_t key = k & 0x7F; - if (k & 0x80) { - if (state == Idle) - pressed(key); - return; - } else { - if (state == Held) { - released(); - } - state = Idle; - return; - } - } else { - reset(); - } + writeRegister(TCA8418_REG_GPIO_DAT_OUT_3, 0x00); } void TCA8418Keyboard::pressed(uint8_t key) @@ -354,7 +115,7 @@ void TCA8418Keyboard::released() int32_t held_interval = now - last_tap; last_tap = now; if (tap_interval < _TCA8418_MULTI_TAP_THRESHOLD && should_backspace) { - queueEvent(_TCA8418_BSP); + queueEvent(BSP); } if (held_interval > _TCA8418_LONG_PRESS_THRESHOLD) { queueEvent(TCA8418LongPressMap[last_key]); @@ -366,195 +127,11 @@ void TCA8418Keyboard::released() } } -uint8_t TCA8418Keyboard::flush() -{ - // Flush key events - uint8_t count = 0; - while (readRegister(_TCA8418_REG_KEY_EVENT_A) != 0) - count++; - // Flush gpio events - readRegister(_TCA8418_REG_GPIO_INT_STAT_1); - readRegister(_TCA8418_REG_GPIO_INT_STAT_2); - readRegister(_TCA8418_REG_GPIO_INT_STAT_3); - // Clear INT_STAT register - writeRegister(_TCA8418_REG_INT_STAT, 3); - return count; -} - -uint8_t TCA8418Keyboard::digitalRead(uint8_t pinnum) const -{ - if (pinnum > _TCA8418_COL9) - return 0xFF; - - uint8_t reg = _TCA8418_REG_GPIO_DAT_STAT_1 + pinnum / 8; - uint8_t mask = (1 << (pinnum % 8)); - - // Level 0 = low other = high - uint8_t value = readRegister(reg); - if (value & mask) - return HIGH; - return LOW; -} - -bool TCA8418Keyboard::digitalWrite(uint8_t pinnum, uint8_t level) -{ - if (pinnum > _TCA8418_COL9) - return false; - - uint8_t reg = _TCA8418_REG_GPIO_DAT_OUT_1 + pinnum / 8; - uint8_t mask = (1 << (pinnum % 8)); - - // Level 0 = low other = high - uint8_t value = readRegister(reg); - if (level == LOW) - value &= ~mask; - else - value |= mask; - writeRegister(reg, value); - return true; -} - -bool TCA8418Keyboard::pinMode(uint8_t pinnum, uint8_t mode) -{ - if (pinnum > _TCA8418_COL9) - return false; - - uint8_t idx = pinnum / 8; - uint8_t reg = _TCA8418_REG_GPIO_DIR_1 + idx; - uint8_t mask = (1 << (pinnum % 8)); - - // Mode 0 = input 1 = output - uint8_t value = readRegister(reg); - if (mode == OUTPUT) - value |= mask; - else - value &= ~mask; - writeRegister(reg, value); - - // Pullup 0 = enabled 1 = disabled - reg = _TCA8418_REG_GPIO_PULL_1 + idx; - value = readRegister(reg); - if (mode == INPUT_PULLUP) - value &= ~mask; - else - value |= mask; - writeRegister(reg, value); - - return true; -} - -bool TCA8418Keyboard::pinIRQMode(uint8_t pinnum, uint8_t mode) -{ - if (pinnum > _TCA8418_COL9) - return false; - if ((mode != RISING) && (mode != FALLING)) - return false; - - // Mode 0 = falling 1 = rising - uint8_t idx = pinnum / 8; - uint8_t reg = _TCA8418_REG_GPIO_INT_LVL_1 + idx; - uint8_t mask = (1 << (pinnum % 8)); - - uint8_t value = readRegister(reg); - if (mode == RISING) - value |= mask; - else - value &= ~mask; - writeRegister(reg, value); - - // Enable interrupt - reg = _TCA8418_REG_GPIO_INT_EN_1 + idx; - value = readRegister(reg); - value |= mask; - writeRegister(reg, value); - - return true; -} - -void TCA8418Keyboard::enableInterrupts() -{ - uint8_t value = readRegister(_TCA8418_REG_CFG); - value |= (_TCA8418_REG_CFG_GPI_IEN | _TCA8418_REG_CFG_KE_IEN); - writeRegister(_TCA8418_REG_CFG, value); -}; - -void TCA8418Keyboard::disableInterrupts() -{ - uint8_t value = readRegister(_TCA8418_REG_CFG); - value &= ~(_TCA8418_REG_CFG_GPI_IEN | _TCA8418_REG_CFG_KE_IEN); - writeRegister(_TCA8418_REG_CFG, value); -}; - -void TCA8418Keyboard::enableMatrixOverflow() -{ - uint8_t value = readRegister(_TCA8418_REG_CFG); - value |= _TCA8418_REG_CFG_OVR_FLOW_M; - writeRegister(_TCA8418_REG_CFG, value); -}; - -void TCA8418Keyboard::disableMatrixOverflow() -{ - uint8_t value = readRegister(_TCA8418_REG_CFG); - value &= ~_TCA8418_REG_CFG_OVR_FLOW_M; - writeRegister(_TCA8418_REG_CFG, value); -}; - -void TCA8418Keyboard::enableDebounce() -{ - writeRegister(_TCA8418_REG_DEBOUNCE_DIS_1, 0x00); - writeRegister(_TCA8418_REG_DEBOUNCE_DIS_2, 0x00); - writeRegister(_TCA8418_REG_DEBOUNCE_DIS_3, 0x00); -} - -void TCA8418Keyboard::disableDebounce() -{ - writeRegister(_TCA8418_REG_DEBOUNCE_DIS_1, 0xFF); - writeRegister(_TCA8418_REG_DEBOUNCE_DIS_2, 0xFF); - writeRegister(_TCA8418_REG_DEBOUNCE_DIS_3, 0xFF); -} - void TCA8418Keyboard::setBacklight(bool on) { if (on) { - digitalWrite(_TCA8418_COL9, HIGH); + digitalWrite(TCA8418_COL9, HIGH); } else { - digitalWrite(_TCA8418_COL9, LOW); + digitalWrite(TCA8418_COL9, LOW); } } - -uint8_t TCA8418Keyboard::readRegister(uint8_t reg) const -{ - if (m_wire) { - m_wire->beginTransmission(m_addr); - m_wire->write(reg); - m_wire->endTransmission(); - - m_wire->requestFrom(m_addr, (uint8_t)1); - if (m_wire->available() < 1) - return 0; - - return m_wire->read(); - } - if (readCallback) { - uint8_t data; - readCallback(m_addr, reg, &data, 1); - return data; - } - return 0; -} - -void TCA8418Keyboard::writeRegister(uint8_t reg, uint8_t value) -{ - uint8_t data[2]; - data[0] = reg; - data[1] = value; - - if (m_wire) { - m_wire->beginTransmission(m_addr); - m_wire->write(data, sizeof(uint8_t) * 2); - m_wire->endTransmission(); - } - if (writeCallback) { - writeCallback(m_addr, data[0], &(data[1]), 1); - } -} \ No newline at end of file diff --git a/src/input/TCA8418Keyboard.h b/src/input/TCA8418Keyboard.h index 5c53452a4..b76916643 100644 --- a/src/input/TCA8418Keyboard.h +++ b/src/input/TCA8418Keyboard.h @@ -1,82 +1,23 @@ -// Based on the MPR121 Keyboard and Adafruit TCA8418 library -#include "configuration.h" -#include +#include "TCA8418KeyboardBase.h" -#define _TCA8418_NONE 0x00 -#define _TCA8418_REBOOT 0x90 -#define _TCA8418_LEFT 0xb4 -#define _TCA8418_UP 0xb5 -#define _TCA8418_DOWN 0xb6 -#define _TCA8418_RIGHT 0xb7 -#define _TCA8418_ESC 0x1b -#define _TCA8418_BSP 0x08 -#define _TCA8418_SELECT 0x0d - -class TCA8418Keyboard +/** + * @brief 3x4 keypad with 3 columns and 4 rows + */ +class TCA8418Keyboard : public TCA8418KeyboardBase { public: - typedef uint8_t (*i2c_com_fptr_t)(uint8_t dev_addr, uint8_t reg_addr, uint8_t *data, uint8_t len); + TCA8418Keyboard(); + void reset(void) override; + void setBacklight(bool on) override; - enum KeyState { Init = 0, Idle, Held, Busy }; + protected: + void pressed(uint8_t key) override; + void released(void) override; - KeyState state; int8_t last_key; - bool should_backspace; + int8_t next_key; uint32_t last_tap; uint8_t char_idx; int32_t tap_interval; - bool backlight_on; - - String queue; - - TCA8418Keyboard(); - - void begin(uint8_t addr = XPOWERS_AXP192_AXP2101_ADDRESS, TwoWire *wire = &Wire); - void begin(i2c_com_fptr_t r, i2c_com_fptr_t w, uint8_t addr = XPOWERS_AXP192_AXP2101_ADDRESS); - - void reset(void); - // Configure the size of the keypad. - // All other rows and columns are set as inputs. - bool matrix(uint8_t rows, uint8_t columns); - - // Flush all events in the FIFO buffer + GPIO events. - uint8_t flush(void); - - // Key events available in the internal FIFO buffer. - uint8_t keyCount(void) const; - - void trigger(void); - void pressed(uint8_t key); - void released(void); - bool hasEvent(void); - char dequeueEvent(void); - void queueEvent(char); - - uint8_t digitalRead(uint8_t pinnum) const; - bool digitalWrite(uint8_t pinnum, uint8_t level); - bool pinMode(uint8_t pinnum, uint8_t mode); - bool pinIRQMode(uint8_t pinnum, uint8_t mode); // MODE FALLING or RISING - - // enable / disable interrupts for matrix and GPI pins - void enableInterrupts(); - void disableInterrupts(); - - // ignore key events when FIFO buffer is full or not. - void enableMatrixOverflow(); - void disableMatrixOverflow(); - - // debounce keys. - void enableDebounce(); - void disableDebounce(); - - void setBacklight(bool on); - - uint8_t readRegister(uint8_t reg) const; - void writeRegister(uint8_t reg, uint8_t value); - - private: - TwoWire *m_wire; - uint8_t m_addr; - i2c_com_fptr_t readCallback; - i2c_com_fptr_t writeCallback; + bool should_backspace; }; diff --git a/src/input/TCA8418KeyboardBase.cpp b/src/input/TCA8418KeyboardBase.cpp new file mode 100644 index 000000000..aafc4c36c --- /dev/null +++ b/src/input/TCA8418KeyboardBase.cpp @@ -0,0 +1,372 @@ +// Based on the MPR121 Keyboard and Adafruit TCA8418 library + +#include "TCA8418KeyboardBase.h" +#include "configuration.h" + +#include + +// FIELDS CONFIG REGISTER 1 +#define _TCA8418_REG_CFG_AI 0x80 // Auto-increment for read/write +#define _TCA8418_REG_CFG_GPI_E_CGF 0x40 // Event mode config +#define _TCA8418_REG_CFG_OVR_FLOW_M 0x20 // Overflow mode enable +#define _TCA8418_REG_CFG_INT_CFG 0x10 // Interrupt config +#define _TCA8418_REG_CFG_OVR_FLOW_IEN 0x08 // Overflow interrupt enable +#define _TCA8418_REG_CFG_K_LCK_IEN 0x04 // Keypad lock interrupt enable +#define _TCA8418_REG_CFG_GPI_IEN 0x02 // GPI interrupt enable +#define _TCA8418_REG_CFG_KE_IEN 0x01 // Key events interrupt enable + +// FIELDS INT_STAT REGISTER 2 +#define _TCA8418_REG_STAT_CAD_INT 0x10 // Ctrl-alt-del seq status +#define _TCA8418_REG_STAT_OVR_FLOW_INT 0x08 // Overflow interrupt status +#define _TCA8418_REG_STAT_K_LCK_INT 0x04 // Key lock interrupt status +#define _TCA8418_REG_STAT_GPI_INT 0x02 // GPI interrupt status +#define _TCA8418_REG_STAT_K_INT 0x01 // Key events interrupt status + +// FIELDS KEY_LCK_EC REGISTER 3 +#define _TCA8418_REG_LCK_EC_K_LCK_EN 0x40 // Key lock enable +#define _TCA8418_REG_LCK_EC_LCK_2 0x20 // Keypad lock status 2 +#define _TCA8418_REG_LCK_EC_LCK_1 0x10 // Keypad lock status 1 +#define _TCA8418_REG_LCK_EC_KLEC_3 0x08 // Key event count bit 3 +#define _TCA8418_REG_LCK_EC_KLEC_2 0x04 // Key event count bit 2 +#define _TCA8418_REG_LCK_EC_KLEC_1 0x02 // Key event count bit 1 +#define _TCA8418_REG_LCK_EC_KLEC_0 0x01 // Key event count bit 0 + +TCA8418KeyboardBase::TCA8418KeyboardBase(uint8_t rows, uint8_t columns) + : rows(rows), columns(columns), state(Init), queue(""), m_wire(nullptr), m_addr(0), readCallback(nullptr), + writeCallback(nullptr) +{ +} + +void TCA8418KeyboardBase::begin(uint8_t addr, TwoWire *wire) +{ + m_addr = addr; + m_wire = wire; + m_wire->begin(); + reset(); +} + +void TCA8418KeyboardBase::begin(i2c_com_fptr_t r, i2c_com_fptr_t w, uint8_t addr) +{ + m_addr = addr; + m_wire = nullptr; + writeCallback = w; + readCallback = r; + reset(); +} + +void TCA8418KeyboardBase::reset() +{ + LOG_DEBUG("TCA8418 Reset"); + // GPIO + // set default all GIO pins to INPUT + writeRegister(TCA8418_REG_GPIO_DIR_1, 0x00); + writeRegister(TCA8418_REG_GPIO_DIR_2, 0x00); + writeRegister(TCA8418_REG_GPIO_DIR_3, 0x00); + + // add all pins to key events + writeRegister(TCA8418_REG_GPI_EM_1, 0xFF); + writeRegister(TCA8418_REG_GPI_EM_2, 0xFF); + writeRegister(TCA8418_REG_GPI_EM_3, 0xFF); + + // set all pins to FALLING interrupts + writeRegister(TCA8418_REG_GPIO_INT_LVL_1, 0x00); + writeRegister(TCA8418_REG_GPIO_INT_LVL_2, 0x00); + writeRegister(TCA8418_REG_GPIO_INT_LVL_3, 0x00); + + // add all pins to interrupts + writeRegister(TCA8418_REG_GPIO_INT_EN_1, 0xFF); + writeRegister(TCA8418_REG_GPIO_INT_EN_2, 0xFF); + writeRegister(TCA8418_REG_GPIO_INT_EN_3, 0xFF); + + // Set keyboard matrix size + matrix(rows, columns); + enableDebounce(); + flush(); + state = Idle; +} + +bool TCA8418KeyboardBase::matrix(uint8_t rows, uint8_t columns) +{ + if (rows < 1 || rows > 8 || columns < 1 || columns > 10) + return false; + + // Setup the keypad matrix. + uint8_t mask = 0x00; + for (int r = 0; r < rows; r++) { + mask <<= 1; + mask |= 1; + } + writeRegister(TCA8418_REG_KP_GPIO_1, mask); + + mask = 0x00; + for (int c = 0; c < columns && c < 8; c++) { + mask <<= 1; + mask |= 1; + } + writeRegister(TCA8418_REG_KP_GPIO_2, mask); + + if (columns > 8) { + if (columns == 9) + mask = 0x01; + else + mask = 0x03; + writeRegister(TCA8418_REG_KP_GPIO_3, mask); + } + + return true; +} + +uint8_t TCA8418KeyboardBase::keyCount() const +{ + uint8_t eventCount = readRegister(TCA8418_REG_KEY_LCK_EC); + eventCount &= 0x0F; // lower 4 bits only + return eventCount; +} + +bool TCA8418KeyboardBase::hasEvent() const +{ + return queue.length() > 0; +} + +void TCA8418KeyboardBase::queueEvent(char next) +{ + if (next == NONE) { + return; + } + queue.concat(next); +} + +char TCA8418KeyboardBase::dequeueEvent() +{ + if (queue.length() < 1) { + return NONE; + } + char next = queue.charAt(0); + queue.remove(0, 1); + return next; +} + +void TCA8418KeyboardBase::trigger() +{ + if (keyCount() == 0) { + return; + } + if (state != Init) { + // Read the key register + uint8_t k = readRegister(TCA8418_REG_KEY_EVENT_A); + uint8_t key = k & 0x7F; + if (k & 0x80) { + if (state == Idle) + pressed(key); + return; + } else { + if (state == Held) { + released(); + } + state = Idle; + return; + } + } else { + reset(); + } +} + +void TCA8418KeyboardBase::pressed(uint8_t key) +{ + // must be defined in derived class + LOG_ERROR("pressed() not implemented in derived class"); +} + +void TCA8418KeyboardBase::released() +{ + // must be defined in derived class + LOG_ERROR("released() not implemented in derived class"); +} + +uint8_t TCA8418KeyboardBase::flush() +{ + // Flush key events + uint8_t count = 0; + while (readRegister(TCA8418_REG_KEY_EVENT_A) != 0) + count++; + + // Flush gpio events + readRegister(TCA8418_REG_GPIO_INT_STAT_1); + readRegister(TCA8418_REG_GPIO_INT_STAT_2); + readRegister(TCA8418_REG_GPIO_INT_STAT_3); + + // Clear INT_STAT register + writeRegister(TCA8418_REG_INT_STAT, 3); + return count; +} + +uint8_t TCA8418KeyboardBase::digitalRead(uint8_t pinnum) const +{ + if (pinnum > TCA8418_COL9) + return 0xFF; + + uint8_t reg = TCA8418_REG_GPIO_DAT_STAT_1 + pinnum / 8; + uint8_t mask = (1 << (pinnum % 8)); + + // Level 0 = low other = high + uint8_t value = readRegister(reg); + if (value & mask) + return HIGH; + return LOW; +} + +bool TCA8418KeyboardBase::digitalWrite(uint8_t pinnum, uint8_t level) +{ + if (pinnum > TCA8418_COL9) + return false; + + uint8_t reg = TCA8418_REG_GPIO_DAT_OUT_1 + pinnum / 8; + uint8_t mask = (1 << (pinnum % 8)); + + // Level 0 = low other = high + uint8_t value = readRegister(reg); + if (level == LOW) + value &= ~mask; + else + value |= mask; + writeRegister(reg, value); + return true; +} + +bool TCA8418KeyboardBase::pinMode(uint8_t pinnum, uint8_t mode) +{ + if (pinnum > TCA8418_COL9) + return false; + + uint8_t idx = pinnum / 8; + uint8_t reg = TCA8418_REG_GPIO_DIR_1 + idx; + uint8_t mask = (1 << (pinnum % 8)); + + // Mode 0 = input 1 = output + uint8_t value = readRegister(reg); + if (mode == OUTPUT) + value |= mask; + else + value &= ~mask; + writeRegister(reg, value); + + // Pullup 0 = enabled 1 = disabled + reg = TCA8418_REG_GPIO_PULL_1 + idx; + value = readRegister(reg); + if (mode == INPUT_PULLUP) + value &= ~mask; + else + value |= mask; + writeRegister(reg, value); + + return true; +} + +bool TCA8418KeyboardBase::pinIRQMode(uint8_t pinnum, uint8_t mode) +{ + if (pinnum > TCA8418_COL9) + return false; + if ((mode != RISING) && (mode != FALLING)) + return false; + + // Mode 0 = falling 1 = rising + uint8_t idx = pinnum / 8; + uint8_t reg = TCA8418_REG_GPIO_INT_LVL_1 + idx; + uint8_t mask = (1 << (pinnum % 8)); + + uint8_t value = readRegister(reg); + if (mode == RISING) + value |= mask; + else + value &= ~mask; + writeRegister(reg, value); + + // Enable interrupt + reg = TCA8418_REG_GPIO_INT_EN_1 + idx; + value = readRegister(reg); + value |= mask; + writeRegister(reg, value); + + return true; +} + +void TCA8418KeyboardBase::enableInterrupts() +{ + uint8_t value = readRegister(TCA8418_REG_CFG); + value |= (_TCA8418_REG_CFG_GPI_IEN | _TCA8418_REG_CFG_KE_IEN); + writeRegister(TCA8418_REG_CFG, value); +}; + +void TCA8418KeyboardBase::disableInterrupts() +{ + uint8_t value = readRegister(TCA8418_REG_CFG); + value &= ~(_TCA8418_REG_CFG_GPI_IEN | _TCA8418_REG_CFG_KE_IEN); + writeRegister(TCA8418_REG_CFG, value); +}; + +void TCA8418KeyboardBase::enableMatrixOverflow() +{ + uint8_t value = readRegister(TCA8418_REG_CFG); + value |= _TCA8418_REG_CFG_OVR_FLOW_M; + writeRegister(TCA8418_REG_CFG, value); +}; + +void TCA8418KeyboardBase::disableMatrixOverflow() +{ + uint8_t value = readRegister(TCA8418_REG_CFG); + value &= ~_TCA8418_REG_CFG_OVR_FLOW_M; + writeRegister(TCA8418_REG_CFG, value); +}; + +void TCA8418KeyboardBase::enableDebounce() +{ + writeRegister(TCA8418_REG_DEBOUNCE_DIS_1, 0x00); + writeRegister(TCA8418_REG_DEBOUNCE_DIS_2, 0x00); + writeRegister(TCA8418_REG_DEBOUNCE_DIS_3, 0x00); +} + +void TCA8418KeyboardBase::disableDebounce() +{ + writeRegister(TCA8418_REG_DEBOUNCE_DIS_1, 0xFF); + writeRegister(TCA8418_REG_DEBOUNCE_DIS_2, 0xFF); + writeRegister(TCA8418_REG_DEBOUNCE_DIS_3, 0xFF); +} + +void TCA8418KeyboardBase::setBacklight(bool on) {} + +uint8_t TCA8418KeyboardBase::readRegister(uint8_t reg) const +{ + if (m_wire) { + m_wire->beginTransmission(m_addr); + m_wire->write(reg); + m_wire->endTransmission(); + + m_wire->requestFrom(m_addr, (uint8_t)1); + if (m_wire->available() < 1) + return 0; + + return m_wire->read(); + } + if (readCallback) { + uint8_t data; + readCallback(m_addr, reg, &data, 1); + return data; + } + return 0; +} + +void TCA8418KeyboardBase::writeRegister(uint8_t reg, uint8_t value) +{ + uint8_t data[2]; + data[0] = reg; + data[1] = value; + + if (m_wire) { + m_wire->beginTransmission(m_addr); + m_wire->write(data, sizeof(uint8_t) * 2); + m_wire->endTransmission(); + } + if (writeCallback) { + writeCallback(m_addr, data[0], &(data[1]), 1); + } +} \ No newline at end of file diff --git a/src/input/TCA8418KeyboardBase.h b/src/input/TCA8418KeyboardBase.h new file mode 100644 index 000000000..5d6c4f7e9 --- /dev/null +++ b/src/input/TCA8418KeyboardBase.h @@ -0,0 +1,170 @@ +// Based on the MPR121 Keyboard and Adafruit TCA8418 library +#include "configuration.h" +#include + +/** + * @brief TCA8418KeyboardBase is the base class for TCA8418 keyboard handling. + * It provides basic functionality for reading key events, managing the keyboard matrix, + * and handling key states. It is designed to be extended for specific keyboard implementations. + * It supports both I2C communication and function pointers for custom I2C operations. + */ +class TCA8418KeyboardBase +{ + public: + enum TCA8418Key : uint8_t { + NONE = 0x00, + BSP = 0x08, + TAB = 0x09, + SELECT = 0x0d, + ESC = 0x1b, + REBOOT = 0x90, + LEFT = 0xb4, + UP = 0xb5, + DOWN = 0xb6, + RIGHT = 0xb7, + BT_TOGGLE = 0xAA, + GPS_TOGGLE = 0x9E, + MUTE_TOGGLE = 0xAC, + SEND_PING = 0xAF, + BL_TOGGLE = 0xAB + }; + + typedef uint8_t (*i2c_com_fptr_t)(uint8_t dev_addr, uint8_t reg_addr, uint8_t *data, uint8_t len); + + TCA8418KeyboardBase(uint8_t rows, uint8_t columns); + + virtual void begin(uint8_t addr = TCA8418_KB_ADDR, TwoWire *wire = &Wire); + virtual void begin(i2c_com_fptr_t r, i2c_com_fptr_t w, uint8_t addr = TCA8418_KB_ADDR); + + virtual void reset(void); + virtual void trigger(void); + + virtual void setBacklight(bool on); + + // Key events available + virtual bool hasEvent(void) const; + virtual char dequeueEvent(void); + + protected: + enum KeyState { Init, Idle, Held, Busy }; + + enum TCA8418Register : uint8_t { + TCA8418_REG_RESERVED = 0x00, + TCA8418_REG_CFG = 0x01, + TCA8418_REG_INT_STAT = 0x02, + TCA8418_REG_KEY_LCK_EC = 0x03, + TCA8418_REG_KEY_EVENT_A = 0x04, + TCA8418_REG_KEY_EVENT_B = 0x05, + TCA8418_REG_KEY_EVENT_C = 0x06, + TCA8418_REG_KEY_EVENT_D = 0x07, + TCA8418_REG_KEY_EVENT_E = 0x08, + TCA8418_REG_KEY_EVENT_F = 0x09, + TCA8418_REG_KEY_EVENT_G = 0x0A, + TCA8418_REG_KEY_EVENT_H = 0x0B, + TCA8418_REG_KEY_EVENT_I = 0x0C, + TCA8418_REG_KEY_EVENT_J = 0x0D, + TCA8418_REG_KP_LCK_TIMER = 0x0E, + TCA8418_REG_UNLOCK_1 = 0x0F, + TCA8418_REG_UNLOCK_2 = 0x10, + TCA8418_REG_GPIO_INT_STAT_1 = 0x11, + TCA8418_REG_GPIO_INT_STAT_2 = 0x12, + TCA8418_REG_GPIO_INT_STAT_3 = 0x13, + TCA8418_REG_GPIO_DAT_STAT_1 = 0x14, + TCA8418_REG_GPIO_DAT_STAT_2 = 0x15, + TCA8418_REG_GPIO_DAT_STAT_3 = 0x16, + TCA8418_REG_GPIO_DAT_OUT_1 = 0x17, + TCA8418_REG_GPIO_DAT_OUT_2 = 0x18, + TCA8418_REG_GPIO_DAT_OUT_3 = 0x19, + TCA8418_REG_GPIO_INT_EN_1 = 0x1A, + TCA8418_REG_GPIO_INT_EN_2 = 0x1B, + TCA8418_REG_GPIO_INT_EN_3 = 0x1C, + TCA8418_REG_KP_GPIO_1 = 0x1D, + TCA8418_REG_KP_GPIO_2 = 0x1E, + TCA8418_REG_KP_GPIO_3 = 0x1F, + TCA8418_REG_GPI_EM_1 = 0x20, + TCA8418_REG_GPI_EM_2 = 0x21, + TCA8418_REG_GPI_EM_3 = 0x22, + TCA8418_REG_GPIO_DIR_1 = 0x23, + TCA8418_REG_GPIO_DIR_2 = 0x24, + TCA8418_REG_GPIO_DIR_3 = 0x25, + TCA8418_REG_GPIO_INT_LVL_1 = 0x26, + TCA8418_REG_GPIO_INT_LVL_2 = 0x27, + TCA8418_REG_GPIO_INT_LVL_3 = 0x28, + TCA8418_REG_DEBOUNCE_DIS_1 = 0x29, + TCA8418_REG_DEBOUNCE_DIS_2 = 0x2A, + TCA8418_REG_DEBOUNCE_DIS_3 = 0x2B, + TCA8418_REG_GPIO_PULL_1 = 0x2C, + TCA8418_REG_GPIO_PULL_2 = 0x2D, + TCA8418_REG_GPIO_PULL_3 = 0x2E + }; + + // Pin IDs for matrix rows/columns + enum TCA8418PinId : uint8_t { + TCA8418_ROW0, // Pin ID for row 0 + TCA8418_ROW1, // Pin ID for row 1 + TCA8418_ROW2, // Pin ID for row 2 + TCA8418_ROW3, // Pin ID for row 3 + TCA8418_ROW4, // Pin ID for row 4 + TCA8418_ROW5, // Pin ID for row 5 + TCA8418_ROW6, // Pin ID for row 6 + TCA8418_ROW7, // Pin ID for row 7 + TCA8418_COL0, // Pin ID for column 0 + TCA8418_COL1, // Pin ID for column 1 + TCA8418_COL2, // Pin ID for column 2 + TCA8418_COL3, // Pin ID for column 3 + TCA8418_COL4, // Pin ID for column 4 + TCA8418_COL5, // Pin ID for column 5 + TCA8418_COL6, // Pin ID for column 6 + TCA8418_COL7, // Pin ID for column 7 + TCA8418_COL8, // Pin ID for column 8 + TCA8418_COL9 // Pin ID for column 9 + }; + + virtual void pressed(uint8_t key); + virtual void released(void); + + virtual void queueEvent(char); + + virtual ~TCA8418KeyboardBase() {} + + protected: + // Set the size of the keypad matrix + // All other rows and columns are set as inputs. + bool matrix(uint8_t rows, uint8_t columns); + + uint8_t keyCount(void) const; + + // Flush all events in the FIFO buffer + GPIO events. + uint8_t flush(void); + + // debounce keys. + void enableDebounce(); + void disableDebounce(); + + // enable / disable interrupts for matrix and GPI pins + void enableInterrupts(); + void disableInterrupts(); + + // ignore key events when FIFO buffer is full or not. + void enableMatrixOverflow(); + void disableMatrixOverflow(); + + uint8_t digitalRead(uint8_t pinnum) const; + bool digitalWrite(uint8_t pinnum, uint8_t level); + bool pinMode(uint8_t pinnum, uint8_t mode); + bool pinIRQMode(uint8_t pinnum, uint8_t mode); // MODE FALLING or RISING + uint8_t readRegister(uint8_t reg) const; + void writeRegister(uint8_t reg, uint8_t value); + + protected: + uint8_t rows; + uint8_t columns; + KeyState state; + String queue; + + private: + TwoWire *m_wire; + uint8_t m_addr; + i2c_com_fptr_t readCallback; + i2c_com_fptr_t writeCallback; +}; diff --git a/src/input/TDeckProKeyboard.cpp b/src/input/TDeckProKeyboard.cpp new file mode 100644 index 000000000..098e0804a --- /dev/null +++ b/src/input/TDeckProKeyboard.cpp @@ -0,0 +1,196 @@ +#if defined(T_DECK_PRO) + +#include "TDeckProKeyboard.h" + +#define _TCA8418_COLS 10 +#define _TCA8418_ROWS 4 +#define _TCA8418_NUM_KEYS 35 + +#define _TCA8418_MULTI_TAP_THRESHOLD 1500 + +using Key = TCA8418KeyboardBase::TCA8418Key; + +constexpr uint8_t modifierRightShiftKey = 31 - 1; // keynum -1 +constexpr uint8_t modifierRightShift = 0b0001; +constexpr uint8_t modifierLeftShiftKey = 35 - 1; +constexpr uint8_t modifierLeftShift = 0b0001; +constexpr uint8_t modifierSymKey = 32 - 1; +constexpr uint8_t modifierSym = 0b0010; +constexpr uint8_t modifierAltKey = 30 - 1; +constexpr uint8_t modifierAlt = 0b0100; + +// Num chars per key, Modulus for rotating through characters +static uint8_t TDeckProTapMod[_TCA8418_NUM_KEYS] = {5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5}; + +static unsigned char TDeckProTapMap[_TCA8418_NUM_KEYS][5] = { + {'p', 'P', '@', 0x00, Key::SEND_PING}, + {'o', 'O', '+'}, + {'i', 'I', '-'}, + {'u', 'U', '_'}, + {'y', 'Y', ')'}, + {'t', 'T', '(', 0x00, Key::TAB}, + {'r', 'R', '3'}, + {'e', 'E', '2', 0x00, Key::UP}, + {'w', 'W', '1'}, + {'q', 'Q', '#', 0x00, Key::ESC}, // p, o, i, u, y, t, r, e, w, q + {Key::BSP, 0x00, 0x00}, + {'l', 'L', '"'}, + {'k', 'K', '\''}, + {'j', 'J', ';'}, + {'h', 'H', ':'}, + {'g', 'G', '/', 0x00, Key::GPS_TOGGLE}, + {'f', 'F', '6', 0x00, Key::RIGHT}, + {'d', 'D', '5'}, + {'s', 'S', '4', 0x00, Key::LEFT}, + {'a', 'A', '*'}, // bsp, l, k, j, h, g, f, d, s, a + {0x0d, 0x00, 0x00}, + {'$', 0x00, 0x00}, + {'m', 'M', '.', 0x00, Key::MUTE_TOGGLE}, + {'n', 'N', ','}, + {'b', 'B', '!', 0x00, Key::BL_TOGGLE}, + {'v', 'V', '?'}, + {'c', 'C', '9'}, + {'x', 'X', '8', 0x00, Key::DOWN}, + {'z', 'Z', '7'}, + {0x00, 0x00, 0x00}, // Ent, $, m, n, b, v, c, x, z, alt + {0x00, 0x00, 0x00}, + {0x00, 0x00, 0x00}, + {0x20, 0x00, 0x00}, + {0x00, 0x00, 0x00}, + {0x00, 0x00, 0x00} // R_Shift, sym, space, mic, L_Shift +}; + +TDeckProKeyboard::TDeckProKeyboard() + : TCA8418KeyboardBase(_TCA8418_ROWS, _TCA8418_COLS), modifierFlag(0), last_modifier_time(0), last_key(-1), next_key(-1), + last_tap(0L), char_idx(0), tap_interval(0) +{ +} + +void TDeckProKeyboard::reset() +{ + TCA8418KeyboardBase::reset(); + pinMode(KB_BL_PIN, OUTPUT); + setBacklight(false); +} + +// handle multi-key presses (shift and alt) +void TDeckProKeyboard::trigger() +{ + uint8_t count = keyCount(); + if (count == 0) + return; + for (uint8_t i = 0; i < count; ++i) { + uint8_t k = readRegister(TCA8418_REG_KEY_EVENT_A + i); + uint8_t key = k & 0x7F; + if (k & 0x80) { + pressed(key); + } else { + released(); + state = Idle; + } + } +} + +void TDeckProKeyboard::pressed(uint8_t key) +{ + if (state == Init || state == Busy) { + return; + } + if (modifierFlag && (millis() - last_modifier_time > _TCA8418_MULTI_TAP_THRESHOLD)) { + modifierFlag = 0; + } + + uint8_t next_key = 0; + int row = (key - 1) / 10; + int col = (key - 1) % 10; + + if (row >= _TCA8418_ROWS || col >= _TCA8418_COLS) { + return; // Invalid key + } + + next_key = row * _TCA8418_COLS + col; + state = Held; + + uint32_t now = millis(); + tap_interval = now - last_tap; + + updateModifierFlag(next_key); + if (isModifierKey(next_key)) { + last_modifier_time = now; + } + + if (tap_interval < 0) { + last_tap = 0; + state = Busy; + return; + } + + if (next_key != last_key || tap_interval > _TCA8418_MULTI_TAP_THRESHOLD) { + char_idx = 0; + } else { + char_idx += 1; + } + + last_key = next_key; + last_tap = now; +} + +void TDeckProKeyboard::released() +{ + if (state != Held) { + return; + } + + if (last_key < 0 || last_key >= _TCA8418_NUM_KEYS) { + last_key = -1; + state = Idle; + return; + } + + uint32_t now = millis(); + last_tap = now; + + if (TDeckProTapMap[last_key][modifierFlag % TDeckProTapMod[last_key]] == Key::BL_TOGGLE) { + toggleBacklight(); + return; + } + + queueEvent(TDeckProTapMap[last_key][modifierFlag % TDeckProTapMod[last_key]]); + if (isModifierKey(last_key) == false) + modifierFlag = 0; +} + +void TDeckProKeyboard::setBacklight(bool on) +{ + if (on) { + digitalWrite(KB_BL_PIN, HIGH); + } else { + digitalWrite(KB_BL_PIN, LOW); + } +} + +void TDeckProKeyboard::toggleBacklight(void) +{ + digitalWrite(KB_BL_PIN, !digitalRead(KB_BL_PIN)); +} + +void TDeckProKeyboard::updateModifierFlag(uint8_t key) +{ + if (key == modifierRightShiftKey) { + modifierFlag ^= modifierRightShift; + } else if (key == modifierLeftShiftKey) { + modifierFlag ^= modifierLeftShift; + } else if (key == modifierSymKey) { + modifierFlag ^= modifierSym; + } else if (key == modifierAltKey) { + modifierFlag ^= modifierAlt; + } +} + +bool TDeckProKeyboard::isModifierKey(uint8_t key) +{ + return (key == modifierRightShiftKey || key == modifierLeftShiftKey || key == modifierAltKey || key == modifierSymKey); +} + +#endif // T_DECK_PRO \ No newline at end of file diff --git a/src/input/TDeckProKeyboard.h b/src/input/TDeckProKeyboard.h new file mode 100644 index 000000000..617f3f20b --- /dev/null +++ b/src/input/TDeckProKeyboard.h @@ -0,0 +1,27 @@ +#include "TCA8418KeyboardBase.h" + +class TDeckProKeyboard : public TCA8418KeyboardBase +{ + public: + TDeckProKeyboard(); + void reset(void) override; + void trigger(void) override; + void setBacklight(bool on) override; + + protected: + void pressed(uint8_t key) override; + void released(void) override; + + void updateModifierFlag(uint8_t key); + bool isModifierKey(uint8_t key); + void toggleBacklight(void); + + private: + uint8_t modifierFlag; // Flag to indicate if a modifier key is pressed + uint32_t last_modifier_time; // Timestamp of the last modifier key press + int8_t last_key; + int8_t next_key; + uint32_t last_tap; + uint8_t char_idx; + int32_t tap_interval; +}; diff --git a/src/input/TLoraPagerKeyboard.h b/src/input/TLoraPagerKeyboard.h new file mode 100644 index 000000000..d31b05978 --- /dev/null +++ b/src/input/TLoraPagerKeyboard.h @@ -0,0 +1,12 @@ +#include "TCA8418KeyboardBase.h" + +class TLoraPagerKeyboard : public TCA8418KeyboardBase +{ + public: + TLoraPagerKeyboard(); + void setBacklight(bool on) override{}; + + protected: + void pressed(uint8_t key) override{}; + void released(void) override{}; +}; diff --git a/src/input/kbI2cBase.cpp b/src/input/kbI2cBase.cpp index 5cc069816..5db1e39a9 100644 --- a/src/input/kbI2cBase.cpp +++ b/src/input/kbI2cBase.cpp @@ -3,10 +3,26 @@ #include "detect/ScanI2C.h" #include "detect/ScanI2CTwoWire.h" +#if defined(T_DECK_PRO) +#include "TDeckProKeyboard.h" +#elif defined(T_LORA_PAGER) +#include "TLoraPagerKeyboard.h" +#else +#include "TCA8418Keyboard.h" +#endif + extern ScanI2C::DeviceAddress cardkb_found; extern uint8_t kb_model; -KbI2cBase::KbI2cBase(const char *name) : concurrency::OSThread(name) +KbI2cBase::KbI2cBase(const char *name) + : concurrency::OSThread(name), +#if defined(T_DECK_PRO) + TCAKeyboard(*(new TDeckProKeyboard())) +#elif defined(T_LORA_PAGER) + TCAKeyboard(*(new TLoraPagerKeyboard())) +#else + TCAKeyboard(*(new TCA8418Keyboard())) +#endif { this->_originName = name; } @@ -43,8 +59,8 @@ int32_t KbI2cBase::runOnce() if (cardkb_found.address == MPR121_KB_ADDR) { MPRkeyboard.begin(MPR121_KB_ADDR, &Wire1); } - if (cardkb_found.address == XPOWERS_AXP192_AXP2101_ADDRESS) { - TCAKeyboard.begin(XPOWERS_AXP192_AXP2101_ADDRESS, &Wire1); + if (cardkb_found.address == TCA8418_KB_ADDR) { + TCAKeyboard.begin(TCA8418_KB_ADDR, &Wire1); } break; #endif @@ -58,8 +74,8 @@ int32_t KbI2cBase::runOnce() if (cardkb_found.address == MPR121_KB_ADDR) { MPRkeyboard.begin(MPR121_KB_ADDR, &Wire); } - if (cardkb_found.address == XPOWERS_AXP192_AXP2101_ADDRESS) { - TCAKeyboard.begin(XPOWERS_AXP192_AXP2101_ADDRESS, &Wire); + if (cardkb_found.address == TCA8418_KB_ADDR) { + TCAKeyboard.begin(TCA8418_KB_ADDR, &Wire); } break; case ScanI2C::NO_I2C: @@ -241,41 +257,65 @@ int32_t KbI2cBase::runOnce() e.kbchar = 0x00; e.source = this->_originName; switch (nextEvent) { - case _TCA8418_NONE: + case TCA8418KeyboardBase::NONE: e.inputEvent = INPUT_BROKER_NONE; e.kbchar = 0x00; break; - case _TCA8418_REBOOT: + case TCA8418KeyboardBase::REBOOT: e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = INPUT_BROKER_MSG_REBOOT; break; - case _TCA8418_LEFT: + case TCA8418KeyboardBase::LEFT: e.inputEvent = INPUT_BROKER_LEFT; e.kbchar = 0x00; break; - case _TCA8418_UP: + case TCA8418KeyboardBase::UP: e.inputEvent = INPUT_BROKER_UP; e.kbchar = 0x00; break; - case _TCA8418_DOWN: + case TCA8418KeyboardBase::DOWN: e.inputEvent = INPUT_BROKER_DOWN; e.kbchar = 0x00; break; - case _TCA8418_RIGHT: + case TCA8418KeyboardBase::RIGHT: e.inputEvent = INPUT_BROKER_RIGHT; e.kbchar = 0x00; break; - case _TCA8418_BSP: + case TCA8418KeyboardBase::BSP: e.inputEvent = INPUT_BROKER_BACK; e.kbchar = 0x08; break; - case _TCA8418_SELECT: + case TCA8418KeyboardBase::SELECT: e.inputEvent = INPUT_BROKER_SELECT; e.kbchar = 0x00; break; - case _TCA8418_ESC: + case TCA8418KeyboardBase::ESC: e.inputEvent = INPUT_BROKER_CANCEL; - e.kbchar = 0; + e.kbchar = 0x00; + break; + case TCA8418KeyboardBase::GPS_TOGGLE: + e.inputEvent = INPUT_BROKER_ANYKEY; + e.kbchar = INPUT_BROKER_GPS_TOGGLE; + break; + case TCA8418KeyboardBase::SEND_PING: + e.inputEvent = INPUT_BROKER_ANYKEY; + e.kbchar = INPUT_BROKER_SEND_PING; + break; + case TCA8418KeyboardBase::MUTE_TOGGLE: + e.inputEvent = INPUT_BROKER_ANYKEY; + e.kbchar = INPUT_BROKER_MSG_MUTE_TOGGLE; + break; + case TCA8418KeyboardBase::BT_TOGGLE: + e.inputEvent = INPUT_BROKER_ANYKEY; + e.kbchar = INPUT_BROKER_MSG_BLUETOOTH_TOGGLE; + break; + case TCA8418KeyboardBase::BL_TOGGLE: + e.inputEvent = INPUT_BROKER_ANYKEY; + e.kbchar = INPUT_BROKER_MSG_BLUETOOTH_TOGGLE; + break; + case TCA8418KeyboardBase::TAB: + e.inputEvent = INPUT_BROKER_ANYKEY; + e.kbchar = INPUT_BROKER_MSG_TAB; break; default: if (nextEvent > 127) { @@ -291,6 +331,7 @@ int32_t KbI2cBase::runOnce() LOG_DEBUG("TCA8418 Notifying: %i Char: %c", e.inputEvent, e.kbchar); this->notifyObservers(&e); } + TCAKeyboard.trigger(); } break; } diff --git a/src/input/kbI2cBase.h b/src/input/kbI2cBase.h index 8193433fe..af7602979 100644 --- a/src/input/kbI2cBase.h +++ b/src/input/kbI2cBase.h @@ -3,10 +3,11 @@ #include "BBQ10Keyboard.h" #include "InputBroker.h" #include "MPR121Keyboard.h" -#include "TCA8418Keyboard.h" #include "Wire.h" #include "concurrency/OSThread.h" +class TCA8418KeyboardBase; + class KbI2cBase : public Observable, public concurrency::OSThread { public: @@ -22,6 +23,6 @@ class KbI2cBase : public Observable, public concurrency::OST BBQ10Keyboard Q10keyboard; MPR121Keyboard MPRkeyboard; - TCA8418Keyboard TCAKeyboard; + TCA8418KeyboardBase &TCAKeyboard; bool is_sym = false; }; \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 2e2adfd46..c3e7c2a33 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -335,6 +335,15 @@ void setup() pinMode(TFT_CS, OUTPUT); digitalWrite(TFT_CS, HIGH); delay(100); +#elif defined(T_DECK_PRO) + pinMode(LORA_EN, OUTPUT); + digitalWrite(LORA_EN, HIGH); + pinMode(LORA_CS, OUTPUT); + digitalWrite(LORA_CS, HIGH); + pinMode(SDCARD_CS, OUTPUT); + digitalWrite(SDCARD_CS, HIGH); + pinMode(PIN_EINK_CS, OUTPUT); + digitalWrite(PIN_EINK_CS, HIGH); #endif concurrency::hasBeenSetup = true; diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 3c19971e6..38e213167 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -735,7 +735,6 @@ void NodeDB::installDefaultConfig(bool preserveKey = false) config.display.screen_on_secs = 30; config.display.wake_on_tap_or_motion = true; #endif - #if defined(ARCH_ESP32) && !MESHTASTIC_EXCLUDE_WIFI if (WiFiOTA::isUpdated()) { WiFiOTA::recoverConfig(&config.network); @@ -796,6 +795,13 @@ void NodeDB::installDefaultModuleConfig() moduleConfig.external_notification.alert_message_buzzer = true; moduleConfig.external_notification.nag_timeout = default_ringtone_nag_secs; #endif +#if defined(PIN_VIBRATION) + moduleConfig.external_notification.enabled = true; + moduleConfig.external_notification.output_vibra = PIN_VIBRATION; + moduleConfig.external_notification.alert_message_vibra = true; + moduleConfig.external_notification.output_ms = 500; + moduleConfig.external_notification.nag_timeout = 2; +#endif #if defined(RAK4630) || defined(RAK11310) || defined(RAK3312) // Default to RAK led pin 2 (blue) moduleConfig.external_notification.enabled = true; diff --git a/src/platform/esp32/architecture.h b/src/platform/esp32/architecture.h index baefbc4eb..3168d9121 100644 --- a/src/platform/esp32/architecture.h +++ b/src/platform/esp32/architecture.h @@ -188,6 +188,8 @@ #define HW_VENDOR meshtastic_HardwareModel_RAK3312 #elif defined(LINK_32) #define HW_VENDOR meshtastic_HardwareModel_LINK_32 +#elif defined(T_DECK_PRO) +#define HW_VENDOR meshtastic_HardwareModel_T_DECK_PRO #endif // ----------------------------------------------------------------------------- diff --git a/src/platform/extra_variants/t_deck_pro/variant.cpp b/src/platform/extra_variants/t_deck_pro/variant.cpp new file mode 100644 index 000000000..eae9335ce --- /dev/null +++ b/src/platform/extra_variants/t_deck_pro/variant.cpp @@ -0,0 +1,28 @@ +#include "configuration.h" + +#ifdef T_DECK_PRO + +#include "input/TouchScreenImpl1.h" +#include +#include + +CSE_CST328 tsPanel = CSE_CST328(EINK_WIDTH, EINK_HEIGHT, &Wire, CST328_PIN_RST, CST328_PIN_INT); + +bool readTouch(int16_t *x, int16_t *y) +{ + if (tsPanel.getTouches()) { + *x = tsPanel.getPoint(0).x; + *y = tsPanel.getPoint(0).y; + return true; + } + return false; +} + +// T-Deck Pro specific init +void lateInitVariant() +{ + tsPanel.begin(); + touchScreenImpl1 = new TouchScreenImpl1(EINK_WIDTH, EINK_HEIGHT, readTouch); + touchScreenImpl1->init(); +} +#endif \ No newline at end of file diff --git a/src/power.h b/src/power.h index c71f96c10..046980bd6 100644 --- a/src/power.h +++ b/src/power.h @@ -126,6 +126,8 @@ class Power : private concurrency::OSThread bool analogInit(); /// Setup a Lipo battery level sensor bool lipoInit(); + /// Setup a Lipo charger + bool lipoChargerInit(); private: // open circuit voltage lookup table diff --git a/variants/esp32s3/t-deck-pro/pins_arduino.h b/variants/esp32s3/t-deck-pro/pins_arduino.h new file mode 100644 index 000000000..af0ba80b3 --- /dev/null +++ b/variants/esp32s3/t-deck-pro/pins_arduino.h @@ -0,0 +1,19 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +#define USB_VID 0x303a +#define USB_PID 0x1001 + +// used for keyboard, touch controller, beam sensor, and gyroscope +static const uint8_t SDA = 13; +static const uint8_t SCL = 14; + +// Default SPI will be mapped to Radio +static const uint8_t SS = 3; +static const uint8_t MOSI = 33; +static const uint8_t MISO = 47; +static const uint8_t SCK = 36; + +#endif /* Pins_Arduino_h */ diff --git a/variants/esp32s3/t-deck-pro/platformio.ini b/variants/esp32s3/t-deck-pro/platformio.ini new file mode 100644 index 000000000..45c3ae4ea --- /dev/null +++ b/variants/esp32s3/t-deck-pro/platformio.ini @@ -0,0 +1,24 @@ +[env:t-deck-pro] +extends = esp32s3_base +board = t-deck-pro +board_check = true +upload_protocol = esptool + +build_flags = + ${esp32_base.build_flags} -I variants/esp32s3/t-deck-pro + -D T_DECK_PRO + -D GPS_POWER_TOGGLE + -D USE_EINK + -D EINK_DISPLAY_MODEL=GxEPD2_310_GDEQ031T10 + -D EINK_WIDTH=240 + -D EINK_HEIGHT=320 + ;-D USE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk + -D EINK_LIMIT_FASTREFRESH=10 ; How many consecutive fast-refreshes are permitted + -D EINK_LIMIT_GHOSTING_PX=2000 ; (Optional) How much image ghosting is tolerated + +lib_deps = + ${esp32s3_base.lib_deps} + https://github.com/ZinggJM/GxEPD2/archive/refs/tags/1.6.4.zip + https://github.com/CIRCUITSTATE/CSE_Touch/archive/b44f23b6f870b848f1fbe453c190879bc6cfaafa.zip + https://github.com/CIRCUITSTATE/CSE_CST328/archive/refs/tags/v0.0.4.zip + https://github.com/mverch67/BQ27220/archive/07d92be846abd8a0258a50c23198dac0858b22ed.zip diff --git a/variants/esp32s3/t-deck-pro/variant.h b/variants/esp32s3/t-deck-pro/variant.h new file mode 100644 index 000000000..b08d3f65f --- /dev/null +++ b/variants/esp32s3/t-deck-pro/variant.h @@ -0,0 +1,94 @@ +// Display (E-Ink) +#define PIN_EINK_CS 34 +#define PIN_EINK_BUSY 37 +#define PIN_EINK_DC 35 +#define PIN_EINK_RES -1 +#define PIN_EINK_SCLK 36 +#define PIN_EINK_MOSI 47 + +#define I2C_SDA SDA +#define I2C_SCL SCL + +// CST328 touch screen (implementation in src/platform/extra_variants/t_deck_pro/variant.cpp) +#define HAS_TOUCHSCREEN 1 +#define CST328_PIN_INT 12 +#define CST328_PIN_RST 45 + +#define USE_POWERSAVE +#define SLEEP_TIME 120 + +// GNNS +#define HAS_GPS 1 +#define GPS_BAUDRATE 38400 +#define PIN_GPS_EN 15 +#define GPS_EN_ACTIVE 1 +#define GPS_RX_PIN 44 +#define GPS_TX_PIN 43 +#define PIN_GPS_PPS 1 + +#define BUTTON_PIN 0 + +// vibration motor +#define PIN_VIBRATION 2 + +// Have SPI interface SD card slot +#define HAS_SDCARD +#define SDCARD_USE_SPI1 +#define SPI_MOSI (33) +#define SPI_SCK (36) +#define SPI_MISO (47) +#define SPI_CS (48) +#define SDCARD_CS SPI_CS +#define SD_SPI_FREQUENCY 75000000U + +// TCA8418 keyboard +#define KB_BL_PIN 42 +#define CANNED_MESSAGE_MODULE_ENABLE 1 + +// microphone PCM5102A +#define PCM5102A_SCK 47 +#define PCM5102A_DIN 17 +#define PCM5102A_LRCK 18 + +// LTR_553ALS light sensor +#define HAS_LTR553ALS + +// gyroscope BHI260AP +#define BOARD_1V8_EN 38 +#define HAS_BHI260AP + +// battery charger BQ25896 +#define HAS_PPM 1 +#define XPOWERS_CHIP_BQ25896 + +// battery quality management BQ27220 +#define HAS_BQ27220 1 +#define BQ27220_I2C_SDA SDA +#define BQ27220_I2C_SCL SCL +#define BQ27220_DESIGN_CAPACITY 1400 + +// LoRa +#define USE_SX1262 +#define USE_SX1268 + +#define LORA_EN 46 // LoRa enable pin +#define LORA_SCK 36 +#define LORA_MISO 47 +#define LORA_MOSI 33 +#define LORA_CS 3 + +#define LORA_DIO0 -1 // a No connect on the SX1262 module +#define LORA_RESET 4 +#define LORA_DIO1 5 // SX1262 IRQ +#define LORA_DIO2 6 // SX1262 BUSY +#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262, if DIO3 is high the TXCO is enabled + +#define SX126X_CS LORA_CS // FIXME - we really should define LORA_CS instead +#define SX126X_DIO1 LORA_DIO1 +#define SX126X_BUSY LORA_DIO2 +#define SX126X_RESET LORA_RESET +// Not really an E22 but TTGO seems to be trying to clone that +#define SX126X_DIO2_AS_RF_SWITCH +#define SX126X_DIO3_TCXO_VOLTAGE 2.4 +// Internally the TTGO module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for the sx1262interface +// code) From 32418448de4de4243c729d192d91e6e1e22bd4cf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 20:32:55 +0200 Subject: [PATCH 041/180] Update protobufs (#7410) Co-authored-by: caveman99 <25002+caveman99@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/config.pb.h | 10 ++- src/mesh/generated/meshtastic/telemetry.pb.h | 75 +++++++++++++++----- 3 files changed, 64 insertions(+), 23 deletions(-) diff --git a/protobufs b/protobufs index 15c1fbde8..fa02e14d8 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 15c1fbde882de953dec279160fa984d0e00569d0 +Subproject commit fa02e14d8d01850336eaea0e9552aef4f08f0a40 diff --git a/src/mesh/generated/meshtastic/config.pb.h b/src/mesh/generated/meshtastic/config.pb.h index bd43472b5..8a68197f0 100644 --- a/src/mesh/generated/meshtastic/config.pb.h +++ b/src/mesh/generated/meshtastic/config.pb.h @@ -293,7 +293,11 @@ typedef enum _meshtastic_Config_LoRaConfig_RegionCode { /* Kazakhstan 433MHz */ meshtastic_Config_LoRaConfig_RegionCode_KZ_433 = 23, /* Kazakhstan 863MHz */ - meshtastic_Config_LoRaConfig_RegionCode_KZ_863 = 24 + meshtastic_Config_LoRaConfig_RegionCode_KZ_863 = 24, + /* Nepal 865MHz */ + meshtastic_Config_LoRaConfig_RegionCode_NP_865 = 25, + /* Brazil 902MHz */ + meshtastic_Config_LoRaConfig_RegionCode_BR_902 = 26 } meshtastic_Config_LoRaConfig_RegionCode; /* Standard predefined channel settings @@ -690,8 +694,8 @@ extern "C" { #define _meshtastic_Config_DisplayConfig_CompassOrientation_ARRAYSIZE ((meshtastic_Config_DisplayConfig_CompassOrientation)(meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_270_INVERTED+1)) #define _meshtastic_Config_LoRaConfig_RegionCode_MIN meshtastic_Config_LoRaConfig_RegionCode_UNSET -#define _meshtastic_Config_LoRaConfig_RegionCode_MAX meshtastic_Config_LoRaConfig_RegionCode_KZ_863 -#define _meshtastic_Config_LoRaConfig_RegionCode_ARRAYSIZE ((meshtastic_Config_LoRaConfig_RegionCode)(meshtastic_Config_LoRaConfig_RegionCode_KZ_863+1)) +#define _meshtastic_Config_LoRaConfig_RegionCode_MAX meshtastic_Config_LoRaConfig_RegionCode_BR_902 +#define _meshtastic_Config_LoRaConfig_RegionCode_ARRAYSIZE ((meshtastic_Config_LoRaConfig_RegionCode)(meshtastic_Config_LoRaConfig_RegionCode_BR_902+1)) #define _meshtastic_Config_LoRaConfig_ModemPreset_MIN meshtastic_Config_LoRaConfig_ModemPreset_LONG_FAST #define _meshtastic_Config_LoRaConfig_ModemPreset_MAX meshtastic_Config_LoRaConfig_ModemPreset_SHORT_TURBO diff --git a/src/mesh/generated/meshtastic/telemetry.pb.h b/src/mesh/generated/meshtastic/telemetry.pb.h index cb47b9fda..f758995c2 100644 --- a/src/mesh/generated/meshtastic/telemetry.pb.h +++ b/src/mesh/generated/meshtastic/telemetry.pb.h @@ -97,7 +97,9 @@ typedef enum _meshtastic_TelemetrySensorType { /* ADS1X15 ADC_ALT */ meshtastic_TelemetrySensorType_ADS1X15_ALT = 41, /* Sensirion SFA30 Formaldehyde sensor */ - meshtastic_TelemetrySensorType_SFA30 = 42 + meshtastic_TelemetrySensorType_SFA30 = 42, + /* SEN5X PM SENSORS */ + meshtastic_TelemetrySensorType_SEN5X = 43 } meshtastic_TelemetrySensorType; /* Struct definitions */ @@ -246,40 +248,40 @@ typedef struct _meshtastic_PowerMetrics { /* Air quality metrics */ typedef struct _meshtastic_AirQualityMetrics { - /* Concentration Units Standard PM1.0 */ + /* Concentration Units Standard PM1.0 in ug/m3 */ bool has_pm10_standard; uint32_t pm10_standard; - /* Concentration Units Standard PM2.5 */ + /* Concentration Units Standard PM2.5 in ug/m3 */ bool has_pm25_standard; uint32_t pm25_standard; - /* Concentration Units Standard PM10.0 */ + /* Concentration Units Standard PM10.0 in ug/m3 */ bool has_pm100_standard; uint32_t pm100_standard; - /* Concentration Units Environmental PM1.0 */ + /* Concentration Units Environmental PM1.0 in ug/m3 */ bool has_pm10_environmental; uint32_t pm10_environmental; - /* Concentration Units Environmental PM2.5 */ + /* Concentration Units Environmental PM2.5 in ug/m3 */ bool has_pm25_environmental; uint32_t pm25_environmental; - /* Concentration Units Environmental PM10.0 */ + /* Concentration Units Environmental PM10.0 in ug/m3 */ bool has_pm100_environmental; uint32_t pm100_environmental; - /* 0.3um Particle Count */ + /* 0.3um Particle Count in #/0.1l */ bool has_particles_03um; uint32_t particles_03um; - /* 0.5um Particle Count */ + /* 0.5um Particle Count in #/0.1l */ bool has_particles_05um; uint32_t particles_05um; - /* 1.0um Particle Count */ + /* 1.0um Particle Count in #/0.1l */ bool has_particles_10um; uint32_t particles_10um; - /* 2.5um Particle Count */ + /* 2.5um Particle Count in #/0.1l */ bool has_particles_25um; uint32_t particles_25um; - /* 5.0um Particle Count */ + /* 5.0um Particle Count in #/0.1l */ bool has_particles_50um; uint32_t particles_50um; - /* 10.0um Particle Count */ + /* 10.0um Particle Count in #/0.1l */ bool has_particles_100um; uint32_t particles_100um; /* CO2 concentration in ppm */ @@ -300,6 +302,27 @@ typedef struct _meshtastic_AirQualityMetrics { /* Formaldehyde sensor temperature in degrees Celsius */ bool has_form_temperature; float form_temperature; + /* Concentration Units Standard PM4.0 in ug/m3 */ + bool has_pm40_standard; + uint32_t pm40_standard; + /* 4.0um Particle Count in #/0.1l */ + bool has_particles_40um; + uint32_t particles_40um; + /* PM Sensor Temperature */ + bool has_pm_temperature; + float pm_temperature; + /* PM Sensor humidity */ + bool has_pm_humidity; + float pm_humidity; + /* PM Sensor VOC Index */ + bool has_pm_voc_idx; + float pm_voc_idx; + /* PM Sensor NOx Index */ + bool has_pm_nox_idx; + float pm_nox_idx; + /* Typical Particle Size in um */ + bool has_particles_tps; + float particles_tps; } meshtastic_AirQualityMetrics; /* Local device mesh statistics */ @@ -411,8 +434,8 @@ extern "C" { /* Helper constants for enums */ #define _meshtastic_TelemetrySensorType_MIN meshtastic_TelemetrySensorType_SENSOR_UNSET -#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_SFA30 -#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_SFA30+1)) +#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_SEN5X +#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_SEN5X+1)) @@ -428,7 +451,7 @@ extern "C" { #define meshtastic_DeviceMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_EnvironmentMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_PowerMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} -#define meshtastic_AirQualityMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} +#define meshtastic_AirQualityMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_LocalStats_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_HealthMetrics_init_default {false, 0, false, 0, false, 0} #define meshtastic_HostMetrics_init_default {0, 0, 0, false, 0, false, 0, 0, 0, 0, false, ""} @@ -437,7 +460,7 @@ extern "C" { #define meshtastic_DeviceMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_EnvironmentMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_PowerMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} -#define meshtastic_AirQualityMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} +#define meshtastic_AirQualityMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_LocalStats_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_HealthMetrics_init_zero {false, 0, false, 0, false, 0} #define meshtastic_HostMetrics_init_zero {0, 0, 0, false, 0, false, 0, 0, 0, 0, false, ""} @@ -506,6 +529,13 @@ extern "C" { #define meshtastic_AirQualityMetrics_form_formaldehyde_tag 16 #define meshtastic_AirQualityMetrics_form_humidity_tag 17 #define meshtastic_AirQualityMetrics_form_temperature_tag 18 +#define meshtastic_AirQualityMetrics_pm40_standard_tag 19 +#define meshtastic_AirQualityMetrics_particles_40um_tag 20 +#define meshtastic_AirQualityMetrics_pm_temperature_tag 21 +#define meshtastic_AirQualityMetrics_pm_humidity_tag 22 +#define meshtastic_AirQualityMetrics_pm_voc_idx_tag 23 +#define meshtastic_AirQualityMetrics_pm_nox_idx_tag 24 +#define meshtastic_AirQualityMetrics_particles_tps_tag 25 #define meshtastic_LocalStats_uptime_seconds_tag 1 #define meshtastic_LocalStats_channel_utilization_tag 2 #define meshtastic_LocalStats_air_util_tx_tag 3 @@ -616,7 +646,14 @@ X(a, STATIC, OPTIONAL, FLOAT, co2_temperature, 14) \ X(a, STATIC, OPTIONAL, FLOAT, co2_humidity, 15) \ X(a, STATIC, OPTIONAL, FLOAT, form_formaldehyde, 16) \ X(a, STATIC, OPTIONAL, FLOAT, form_humidity, 17) \ -X(a, STATIC, OPTIONAL, FLOAT, form_temperature, 18) +X(a, STATIC, OPTIONAL, FLOAT, form_temperature, 18) \ +X(a, STATIC, OPTIONAL, UINT32, pm40_standard, 19) \ +X(a, STATIC, OPTIONAL, UINT32, particles_40um, 20) \ +X(a, STATIC, OPTIONAL, FLOAT, pm_temperature, 21) \ +X(a, STATIC, OPTIONAL, FLOAT, pm_humidity, 22) \ +X(a, STATIC, OPTIONAL, FLOAT, pm_voc_idx, 23) \ +X(a, STATIC, OPTIONAL, FLOAT, pm_nox_idx, 24) \ +X(a, STATIC, OPTIONAL, FLOAT, particles_tps, 25) #define meshtastic_AirQualityMetrics_CALLBACK NULL #define meshtastic_AirQualityMetrics_DEFAULT NULL @@ -705,7 +742,7 @@ extern const pb_msgdesc_t meshtastic_Nau7802Config_msg; /* Maximum encoded size of messages (where known) */ #define MESHTASTIC_MESHTASTIC_TELEMETRY_PB_H_MAX_SIZE meshtastic_Telemetry_size -#define meshtastic_AirQualityMetrics_size 106 +#define meshtastic_AirQualityMetrics_size 150 #define meshtastic_DeviceMetrics_size 27 #define meshtastic_EnvironmentMetrics_size 113 #define meshtastic_HealthMetrics_size 11 From 920aeeeba59dba6b14a11c3882453e52edf4cab4 Mon Sep 17 00:00:00 2001 From: Austin Date: Mon, 21 Jul 2025 15:03:13 -0400 Subject: [PATCH 042/180] Actions: pull_request_target is fun (#7398) --- .github/workflows/build_esp32.yml | 14 ++-- .github/workflows/build_esp32_c3.yml | 14 ++-- .github/workflows/build_esp32_c6.yml | 14 ++-- .github/workflows/build_esp32_s3.yml | 14 ++-- .github/workflows/build_nrf52.yml | 14 ++-- .github/workflows/build_rpi2040.yml | 14 ++-- .github/workflows/build_stm32.yml | 14 ++-- .github/workflows/main_matrix.yml | 112 ++++++++++++++------------- 8 files changed, 113 insertions(+), 97 deletions(-) diff --git a/.github/workflows/build_esp32.yml b/.github/workflows/build_esp32.yml index 32cd45000..2c4622f43 100644 --- a/.github/workflows/build_esp32.yml +++ b/.github/workflows/build_esp32.yml @@ -3,6 +3,9 @@ name: Build ESP32 on: workflow_call: inputs: + version: + required: true + type: string board: required: true type: string @@ -14,11 +17,10 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - - name: Get release version string - shell: bash - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version + with: + submodules: recursive + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} - name: Build ESP32 id: build @@ -33,7 +35,7 @@ jobs: - name: Store binaries as an artifact uses: actions/upload-artifact@v4 with: - name: firmware-esp32-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + name: firmware-esp32-${{ inputs.board }}-${{ inputs.version }}.zip overwrite: true path: | release/*.bin diff --git a/.github/workflows/build_esp32_c3.yml b/.github/workflows/build_esp32_c3.yml index 161786f99..3e7746166 100644 --- a/.github/workflows/build_esp32_c3.yml +++ b/.github/workflows/build_esp32_c3.yml @@ -3,6 +3,9 @@ name: Build ESP32-C3 on: workflow_call: inputs: + version: + required: true + type: string board: required: true type: string @@ -14,11 +17,10 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - - name: Get release version string - shell: bash - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version + with: + submodules: recursive + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} - name: Build ESP32-C3 id: build @@ -33,7 +35,7 @@ jobs: - name: Store binaries as an artifact uses: actions/upload-artifact@v4 with: - name: firmware-esp32c3-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + name: firmware-esp32c3-${{ inputs.board }}-${{ inputs.version }}.zip overwrite: true path: | release/*.bin diff --git a/.github/workflows/build_esp32_c6.yml b/.github/workflows/build_esp32_c6.yml index 90cdcc78e..6f32eb3c6 100644 --- a/.github/workflows/build_esp32_c6.yml +++ b/.github/workflows/build_esp32_c6.yml @@ -3,6 +3,9 @@ name: Build ESP32-C6 on: workflow_call: inputs: + version: + required: true + type: string board: required: true type: string @@ -14,11 +17,10 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - - name: Get release version string - shell: bash - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version + with: + submodules: recursive + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} - name: Build ESP32-C6 id: build @@ -33,7 +35,7 @@ jobs: - name: Store binaries as an artifact uses: actions/upload-artifact@v4 with: - name: firmware-esp32c6-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + name: firmware-esp32c6-${{ inputs.board }}-${{ inputs.version }}.zip overwrite: true path: | release/*.bin diff --git a/.github/workflows/build_esp32_s3.yml b/.github/workflows/build_esp32_s3.yml index e5ed48e3e..6527d6d7c 100644 --- a/.github/workflows/build_esp32_s3.yml +++ b/.github/workflows/build_esp32_s3.yml @@ -3,6 +3,9 @@ name: Build ESP32-S3 on: workflow_call: inputs: + version: + required: true + type: string board: required: true type: string @@ -14,11 +17,10 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - - name: Get release version string - shell: bash - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version + with: + submodules: recursive + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} - name: Build ESP32-S3 id: build @@ -33,7 +35,7 @@ jobs: - name: Store binaries as an artifact uses: actions/upload-artifact@v4 with: - name: firmware-esp32s3-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + name: firmware-esp32s3-${{ inputs.board }}-${{ inputs.version }}.zip overwrite: true path: | release/*.bin diff --git a/.github/workflows/build_nrf52.yml b/.github/workflows/build_nrf52.yml index 312aeb372..89be40187 100644 --- a/.github/workflows/build_nrf52.yml +++ b/.github/workflows/build_nrf52.yml @@ -3,6 +3,9 @@ name: Build NRF52 on: workflow_call: inputs: + version: + required: true + type: string board: required: true type: string @@ -14,11 +17,10 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - - name: Get release version string - shell: bash - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version + with: + submodules: recursive + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} - name: Build NRF52 id: build @@ -31,7 +33,7 @@ jobs: - name: Store binaries as an artifact uses: actions/upload-artifact@v4 with: - name: firmware-nrf52840-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + name: firmware-nrf52840-${{ inputs.board }}-${{ inputs.version }}.zip overwrite: true path: | release/*.uf2 diff --git a/.github/workflows/build_rpi2040.yml b/.github/workflows/build_rpi2040.yml index 2abd7a839..fbaa21684 100644 --- a/.github/workflows/build_rpi2040.yml +++ b/.github/workflows/build_rpi2040.yml @@ -3,6 +3,9 @@ name: Build RPI2040 on: workflow_call: inputs: + version: + required: true + type: string board: required: true type: string @@ -14,11 +17,10 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - - name: Get release version string - shell: bash - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version + with: + submodules: recursive + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} - name: Build Raspberry Pi 2040 id: build @@ -31,7 +33,7 @@ jobs: - name: Store binaries as an artifact uses: actions/upload-artifact@v4 with: - name: firmware-rp2040-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + name: firmware-rp2040-${{ inputs.board }}-${{ inputs.version }}.zip overwrite: true path: | release/*.uf2 diff --git a/.github/workflows/build_stm32.yml b/.github/workflows/build_stm32.yml index 10680f422..f06e8f3b8 100644 --- a/.github/workflows/build_stm32.yml +++ b/.github/workflows/build_stm32.yml @@ -3,6 +3,9 @@ name: Build STM32 on: workflow_call: inputs: + version: + required: true + type: string board: required: true type: string @@ -14,11 +17,10 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - - name: Get release version string - shell: bash - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version + with: + submodules: recursive + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} - name: Build STM32WL id: build @@ -31,7 +33,7 @@ jobs: - name: Store binaries as an artifact uses: actions/upload-artifact@v4 with: - name: firmware-stm32-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + name: firmware-stm32-${{ inputs.board }}-${{ inputs.version }}.zip overwrite: true path: | release/*.hex diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index a676efa1e..9d5cb0981 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -33,9 +33,7 @@ jobs: arch: [esp32, esp32s3, esp32c3, esp32c6, nrf52840, rp2040, stm32, check] runs-on: ubuntu-latest steps: - - id: checkout - uses: actions/checkout@v4 - name: Checkout base + - uses: actions/checkout@v4 - id: jsonStep run: | if [[ "$GITHUB_HEAD_REF" == "" ]]; then @@ -55,6 +53,21 @@ jobs: stm32: ${{ steps.jsonStep.outputs.stm32 }} check: ${{ steps.jsonStep.outputs.check }} + version: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Get release version string + run: | + echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT + echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT + id: version + env: + BUILD_LOCATION: local + outputs: + long: ${{ steps.version.outputs.long }} + deb: ${{ steps.version.outputs.deb }} + check: needs: setup strategy: @@ -72,66 +85,73 @@ jobs: run: bin/check-all.sh ${{ matrix.board }} build-esp32: - needs: setup + needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.esp32) }} uses: ./.github/workflows/build_esp32.yml with: + version: ${{ needs.version.outputs.long }} board: ${{ matrix.board }} build-esp32-s3: - needs: setup + needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.esp32s3) }} uses: ./.github/workflows/build_esp32_s3.yml with: + version: ${{ needs.version.outputs.long }} board: ${{ matrix.board }} build-esp32-c3: - needs: setup + needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.esp32c3) }} uses: ./.github/workflows/build_esp32_c3.yml with: + version: ${{ needs.version.outputs.long }} board: ${{ matrix.board }} build-esp32-c6: - needs: setup + needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.esp32c6) }} uses: ./.github/workflows/build_esp32_c6.yml with: + version: ${{ needs.version.outputs.long }} board: ${{ matrix.board }} build-nrf52: - needs: setup + needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.nrf52840) }} uses: ./.github/workflows/build_nrf52.yml with: + version: ${{ needs.version.outputs.long }} board: ${{ matrix.board }} build-rpi2040: - needs: setup + needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.rp2040) }} uses: ./.github/workflows/build_rpi2040.yml with: + version: ${{ needs.version.outputs.long }} board: ${{ matrix.board }} build-stm32: - needs: setup + needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.stm32) }} uses: ./.github/workflows/build_stm32.yml with: + version: ${{ needs.version.outputs.long }} board: ${{ matrix.board }} build-debian-src: @@ -214,6 +234,7 @@ jobs: runs-on: ubuntu-latest needs: [ + version, build-esp32, build-esp32-s3, build-esp32-c3, @@ -238,17 +259,13 @@ jobs: - name: Display structure of downloaded files run: ls -R - - name: Get release version string - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version - - name: Move files up run: mv -b -t ./ ./bin/device-*.sh ./bin/device-*.bat - name: Repackage in single firmware zip uses: actions/upload-artifact@v4 with: - name: firmware-${{matrix.arch}}-${{ steps.version.outputs.long }} + name: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }} overwrite: true path: | ./firmware-*.bin @@ -264,7 +281,7 @@ jobs: - uses: actions/download-artifact@v4 with: - name: firmware-${{matrix.arch}}-${{ steps.version.outputs.long }} + name: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }} merge-multiple: true path: ./output @@ -278,12 +295,12 @@ jobs: chmod +x ./output/device-update.sh - name: Zip firmware - run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip ./output + run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip ./output - name: Repackage in single elfs zip uses: actions/upload-artifact@v4 with: - name: debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip + name: debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip overwrite: true path: ./*.elf retention-days: 30 @@ -291,8 +308,8 @@ jobs: - uses: scruplelesswizard/comment-artifact@main if: ${{ github.event_name == 'pull_request' }} with: - name: firmware-${{matrix.arch}}-${{ steps.version.outputs.long }} - description: "Download firmware-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip. This artifact will be available for 90 days from creation" + name: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }} + description: "Download firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip. This artifact will be available for 90 days from creation" github-token: ${{ secrets.GITHUB_TOKEN }} release-artifacts: @@ -301,6 +318,7 @@ jobs: outputs: upload_url: ${{ steps.create_release.outputs.upload_url }} needs: + - version - gather-artifacts - build-debian-src - package-pio-deps-native-tft @@ -313,44 +331,36 @@ jobs: with: python-version: 3.x - - name: Get release version string - run: | - echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT - id: version - env: - BUILD_LOCATION: local - - name: Create release uses: softprops/action-gh-release@v2 id: create_release with: draft: true prerelease: true - name: Meshtastic Firmware ${{ steps.version.outputs.long }} Alpha - tag_name: v${{ steps.version.outputs.long }} + name: Meshtastic Firmware ${{ needs.version.outputs.long }} Alpha + tag_name: v${{ needs.version.outputs.long }} body: | Autogenerated by github action, developer should edit as required before publishing... - name: Download source deb uses: actions/download-artifact@v4 with: - pattern: firmware-debian-${{ steps.version.outputs.deb }}~UNRELEASED-src + pattern: firmware-debian-${{ needs.version.outputs.deb }}~UNRELEASED-src merge-multiple: true path: ./output/debian-src - name: Download `native-tft` pio deps uses: actions/download-artifact@v4 with: - pattern: platformio-deps-native-tft-${{ steps.version.outputs.long }} + pattern: platformio-deps-native-tft-${{ needs.version.outputs.long }} merge-multiple: true path: ./output/pio-deps-native-tft - name: Zip Linux sources working-directory: output run: | - zip -j -9 -r ./meshtasticd-${{ steps.version.outputs.deb }}-src.zip ./debian-src - zip -9 -r ./platformio-deps-native-tft-${{ steps.version.outputs.long }}.zip ./pio-deps-native-tft + zip -j -9 -r ./meshtasticd-${{ needs.version.outputs.deb }}-src.zip ./debian-src + zip -9 -r ./platformio-deps-native-tft-${{ needs.version.outputs.long }}.zip ./pio-deps-native-tft # For diagnostics - name: Display structure of downloaded files @@ -360,8 +370,8 @@ jobs: # Only run when targeting master branch with workflow_dispatch if: ${{ github.ref_name == 'master' }} run: | - gh release upload v${{ steps.version.outputs.long }} ./output/meshtasticd-${{ steps.version.outputs.deb }}-src.zip - gh release upload v${{ steps.version.outputs.long }} ./output/platformio-deps-native-tft-${{ steps.version.outputs.long }}.zip + gh release upload v${{ needs.version.outputs.long }} ./output/meshtasticd-${{ needs.version.outputs.deb }}-src.zip + gh release upload v${{ needs.version.outputs.long }} ./output/platformio-deps-native-tft-${{ needs.version.outputs.long }}.zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -372,7 +382,7 @@ jobs: arch: [esp32, esp32s3, esp32c3, esp32c6, nrf52840, rp2040, stm32] runs-on: ubuntu-latest if: ${{ github.event_name == 'workflow_dispatch' }} - needs: [release-artifacts] + needs: [release-artifacts, version] steps: - name: Checkout uses: actions/checkout@v4 @@ -382,13 +392,9 @@ jobs: with: python-version: 3.x - - name: Get release version string - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version - - uses: actions/download-artifact@v4 with: - pattern: firmware-${{matrix.arch}}-${{ steps.version.outputs.long }} + pattern: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }} merge-multiple: true path: ./output @@ -401,16 +407,16 @@ jobs: chmod +x ./output/device-update.sh - name: Zip firmware - run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip ./output + run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip ./output - uses: actions/download-artifact@v4 with: - name: debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip + name: debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip merge-multiple: true path: ./elfs - name: Zip debug elfs - run: zip -j -9 -r ./debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip ./elfs + run: zip -j -9 -r ./debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip ./elfs # For diagnostics - name: Display structure of downloaded files @@ -420,15 +426,15 @@ jobs: # Only run when targeting master branch with workflow_dispatch if: ${{ github.ref_name == 'master' }} run: | - gh release upload v${{ steps.version.outputs.long }} ./firmware-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip - gh release upload v${{ steps.version.outputs.long }} ./debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip + gh release upload v${{ needs.version.outputs.long }} ./firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip + gh release upload v${{ needs.version.outputs.long }} ./debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} publish-firmware: runs-on: ubuntu-24.04 if: ${{ github.event_name == 'workflow_dispatch' }} - needs: [release-firmware] + needs: [release-firmware, version] env: targets: esp32,esp32s3,esp32c3,esp32c6,nrf52840,rp2040,stm32 steps: @@ -440,13 +446,9 @@ jobs: with: python-version: 3.x - - name: Get release version string - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version - - uses: actions/download-artifact@v4 with: - pattern: firmware-{${{ env.targets }}}-${{ steps.version.outputs.long }} + pattern: firmware-{${{ env.targets }}}-${{ needs.version.outputs.long }} merge-multiple: true path: ./publish @@ -460,9 +462,9 @@ jobs: external_repository: meshtastic/meshtastic.github.io publish_branch: master publish_dir: ./publish - destination_dir: ${{ env.DEST_PREFIX }}firmware-${{ steps.version.outputs.long }} + destination_dir: ${{ env.DEST_PREFIX }}firmware-${{ needs.version.outputs.long }} keep_files: true user_name: github-actions[bot] user_email: github-actions[bot]@users.noreply.github.com - commit_message: ${{ steps.version.outputs.long }} + commit_message: ${{ needs.version.outputs.long }} enable_jekyll: true From 806bfa54b5d52fb4819af0ff8a9f17d1564bd147 Mon Sep 17 00:00:00 2001 From: Austin Date: Mon, 21 Jul 2025 15:04:46 -0400 Subject: [PATCH 043/180] Renovate: Use github-tags for XPowersLib updates (#7411) --- arch/esp32/esp32.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/esp32/esp32.ini b/arch/esp32/esp32.ini index 9d21562a8..8990053eb 100644 --- a/arch/esp32/esp32.ini +++ b/arch/esp32/esp32.ini @@ -54,8 +54,8 @@ lib_deps = h2zero/NimBLE-Arduino@^1.4.3 # renovate: datasource=git-refs depName=libpax packageName=https://github.com/dbinfrago/libpax gitBranch=master https://github.com/dbinfrago/libpax/archive/3cdc0371c375676a97967547f4065607d4c53fd1.zip - # renovate: datasource=git-refs depName=XPowersLib packageName=https://github.com/lewisxhe/XPowersLib gitBranch=master - https://github.com/lewisxhe/XPowersLib/archive/refs/tags/v0.3.0.zip + # renovate: datasource=github-tags depName=XPowersLib packageName=lewisxhe/XPowersLib + https://github.com/lewisxhe/XPowersLib/archive/v0.3.0.zip # renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto From 9b983b6487e01916f90bb3a3eedc50b601153b6a Mon Sep 17 00:00:00 2001 From: Austin Date: Mon, 21 Jul 2025 15:13:02 -0400 Subject: [PATCH 044/180] nRF52840: Migrate variants to new structure (#7396) --- .../niche/InkHUD/PlatformioConfig.ini | 1 - variants/diy/platformio.ini | 80 ------------------ .../platformio.ini | 6 +- .../Dongle_nRF52840-pca10059-v1/variant.cpp | 0 .../Dongle_nRF52840-pca10059-v1/variant.h | 0 .../ELECROW-ThinkNode-M1/nicheGraphics.h | 0 .../ELECROW-ThinkNode-M1/platformio.ini | 8 +- .../ELECROW-ThinkNode-M1/variant.cpp | 0 .../ELECROW-ThinkNode-M1/variant.h | 0 .../ME25LS01-4Y10TD/platformio.ini | 8 +- .../{ => nrf52840}/ME25LS01-4Y10TD/rfswitch.h | 0 .../ME25LS01-4Y10TD/variant.cpp | 0 .../{ => nrf52840}/ME25LS01-4Y10TD/variant.h | 0 .../ME25LS01-4Y10TD_e-ink/platformio.ini | 8 +- .../ME25LS01-4Y10TD_e-ink/rfswitch.h | 0 .../ME25LS01-4Y10TD_e-ink/variant.cpp | 0 .../ME25LS01-4Y10TD_e-ink/variant.h | 0 .../{ => nrf52840}/MS24SF1/platformio.ini | 7 +- variants/{ => nrf52840}/MS24SF1/variant.cpp | 0 variants/{ => nrf52840}/MS24SF1/variant.h | 0 .../MakePython_nRF52840_eink/platformio.ini | 6 +- .../MakePython_nRF52840_eink/variant.cpp | 0 .../MakePython_nRF52840_eink/variant.h | 0 .../MakePython_nRF52840_oled/platformio.ini | 6 +- .../MakePython_nRF52840_oled/variant.cpp | 0 .../MakePython_nRF52840_oled/variant.h | 0 .../{ => nrf52840}/TWC_mesh_v4/platformio.ini | 6 +- .../{ => nrf52840}/TWC_mesh_v4/variant.cpp | 0 variants/{ => nrf52840}/TWC_mesh_v4/variant.h | 0 .../{ => nrf52840}/canaryone/platformio.ini | 6 +- variants/{ => nrf52840}/canaryone/variant.cpp | 0 variants/{ => nrf52840}/canaryone/variant.h | 0 .../E80_RSSI_per_case.webp | Bin ...Schematic_Pro-Micro_Pinouts 2024-12-14.pdf | 0 .../custom_build_tasks.py | 0 .../nrf52_promicro_diy_tcxo/nicheGraphics.h | 0 .../nrf52_promicro_diy_tcxo/platformio.ini | 32 +++++++ .../diy/nrf52_promicro_diy_tcxo/readme.md | 2 + .../diy/nrf52_promicro_diy_tcxo/rfswitch.h | 0 .../diy/nrf52_promicro_diy_tcxo/variant.cpp | 0 .../diy/nrf52_promicro_diy_tcxo/variant.h | 0 .../nrf52_promicro_diy_xtal/platformio.ini | 12 +++ .../diy/nrf52_promicro_diy_xtal/variant.cpp | 0 .../diy/nrf52_promicro_diy_xtal/variant.h | 0 .../seeed-xiao-nrf52840-wio-sx1262/README.md | 0 .../platformio.ini | 15 ++++ .../variant.cpp | 0 .../seeed-xiao-nrf52840-wio-sx1262/variant.h | 0 .../seeed_xiao_nrf52840_e22/platformio.ini | 19 +++++ .../{ => nrf52840}/diy/xiao_ble/README.md | 0 variants/nrf52840/diy/xiao_ble/platformio.ini | 10 +++ .../{ => nrf52840}/feather_diy/platformio.ini | 6 +- .../{ => nrf52840}/feather_diy/variant.cpp | 0 variants/{ => nrf52840}/feather_diy/variant.h | 0 .../gat562_mesh_trial_tracker/platformio.ini | 8 +- .../gat562_mesh_trial_tracker/variant.cpp | 0 .../gat562_mesh_trial_tracker/variant.h | 0 .../custom_build_tasks.py | 0 .../nicheGraphics.h | 0 .../platformio.ini | 5 +- .../heltec_mesh_node_t114-inkhud/variant.cpp | 0 .../heltec_mesh_node_t114-inkhud/variant.h | 0 .../heltec_mesh_node_t114/platformio.ini | 9 +- .../heltec_mesh_node_t114/variant.cpp | 0 .../heltec_mesh_node_t114/variant.h | 0 .../heltec_mesh_pocket/nicheGraphics.h | 0 .../heltec_mesh_pocket/platformio.ini | 18 ++-- .../heltec_mesh_pocket/variant.cpp | 0 .../heltec_mesh_pocket/variant.h | 0 .../{ => nrf52840}/meshlink/platformio.ini | 6 +- variants/{ => nrf52840}/meshlink/variant.cpp | 0 variants/{ => nrf52840}/meshlink/variant.h | 0 .../meshlink_eink/platformio.ini | 6 +- .../{ => nrf52840}/meshlink_eink/variant.cpp | 0 .../{ => nrf52840}/meshlink_eink/variant.h | 0 .../monteops_hw1/platformio.ini | 6 +- .../{ => nrf52840}/monteops_hw1/variant.cpp | 0 .../{ => nrf52840}/monteops_hw1/variant.h | 0 .../nano-g2-ultra/platformio.ini | 6 +- .../{ => nrf52840}/nano-g2-ultra/variant.cpp | 0 .../{ => nrf52840}/nano-g2-ultra/variant.h | 0 .../{ => nrf52840}/rak2560/platformio.ini | 6 +- variants/{ => nrf52840}/rak2560/variant.cpp | 0 variants/{ => nrf52840}/rak2560/variant.h | 0 .../{ => nrf52840}/rak4631/platformio.ini | 6 +- variants/{ => nrf52840}/rak4631/variant.cpp | 0 variants/{ => nrf52840}/rak4631/variant.h | 0 .../rak4631_epaper/platformio.ini | 6 +- .../{ => nrf52840}/rak4631_epaper/variant.cpp | 0 .../{ => nrf52840}/rak4631_epaper/variant.h | 0 .../rak4631_epaper_onrxtx/platformio.ini | 6 +- .../rak4631_epaper_onrxtx/variant.cpp | 0 .../rak4631_epaper_onrxtx/variant.h | 0 .../rak4631_eth_gw/platformio.ini | 6 +- .../{ => nrf52840}/rak4631_eth_gw/variant.cpp | 0 .../{ => nrf52840}/rak4631_eth_gw/variant.h | 0 .../platformio.ini | 9 +- .../rak4631_nomadstar_meteor_pro/variant.cpp | 0 .../rak4631_nomadstar_meteor_pro/variant.h | 0 .../rak_wismeshtag/platformio.ini | 10 ++- .../{ => nrf52840}/rak_wismeshtag/variant.cpp | 0 .../{ => nrf52840}/rak_wismeshtag/variant.h | 3 +- .../rak_wismeshtap/platformio.ini | 7 +- .../{ => nrf52840}/rak_wismeshtap/variant.cpp | 0 .../{ => nrf52840}/rak_wismeshtap/variant.h | 0 .../seeed_solar_node/platformio.ini | 7 +- .../seeed_solar_node/variant.cpp | 0 .../{ => nrf52840}/seeed_solar_node/variant.h | 0 .../seeed_wio_tracker_L1/platformio.ini | 10 +-- .../seeed_wio_tracker_L1/variant.cpp | 0 .../seeed_wio_tracker_L1/variant.h | 0 .../seeed_wio_tracker_L1_eink/nicheGraphics.h | 0 .../seeed_wio_tracker_L1_eink/platformio.ini | 10 ++- .../seeed_wio_tracker_L1_eink/variant.cpp | 0 .../seeed_wio_tracker_L1_eink/variant.h | 0 .../seeed_xiao_nrf52840_kit/platformio.ini | 9 +- .../seeed_xiao_nrf52840_kit/variant.cpp | 0 .../seeed_xiao_nrf52840_kit/variant.h | 0 .../{ => nrf52840}/t-echo/nicheGraphics.h | 0 variants/{ => nrf52840}/t-echo/platformio.ini | 9 +- variants/{ => nrf52840}/t-echo/variant.cpp | 0 variants/{ => nrf52840}/t-echo/variant.h | 0 .../tracker-t1000-e/platformio.ini | 8 +- .../{ => nrf52840}/tracker-t1000-e/rfswitch.h | 0 .../tracker-t1000-e/variant.cpp | 0 .../{ => nrf52840}/tracker-t1000-e/variant.h | 0 .../wio-sdk-wm1110/platformio.ini | 10 ++- .../{ => nrf52840}/wio-sdk-wm1110/rfswitch.h | 0 .../{ => nrf52840}/wio-sdk-wm1110/variant.cpp | 0 .../{ => nrf52840}/wio-sdk-wm1110/variant.h | 0 .../{ => nrf52840}/wio-t1000-s/platformio.ini | 8 +- .../{ => nrf52840}/wio-t1000-s/rfswitch.h | 0 .../{ => nrf52840}/wio-t1000-s/variant.cpp | 0 variants/{ => nrf52840}/wio-t1000-s/variant.h | 0 .../wio-tracker-wm1110/platformio.ini | 8 +- .../wio-tracker-wm1110/rfswitch.h | 0 .../wio-tracker-wm1110/variant.cpp | 0 .../wio-tracker-wm1110/variant.h | 0 138 files changed, 264 insertions(+), 176 deletions(-) delete mode 100644 variants/diy/platformio.ini rename variants/{ => nrf52840}/Dongle_nRF52840-pca10059-v1/platformio.ini (67%) rename variants/{ => nrf52840}/Dongle_nRF52840-pca10059-v1/variant.cpp (100%) rename variants/{ => nrf52840}/Dongle_nRF52840-pca10059-v1/variant.h (100%) rename variants/{ => nrf52840}/ELECROW-ThinkNode-M1/nicheGraphics.h (100%) rename variants/{ => nrf52840}/ELECROW-ThinkNode-M1/platformio.ini (88%) rename variants/{ => nrf52840}/ELECROW-ThinkNode-M1/variant.cpp (100%) rename variants/{ => nrf52840}/ELECROW-ThinkNode-M1/variant.h (100%) rename variants/{ => nrf52840}/ME25LS01-4Y10TD/platformio.ini (76%) rename variants/{ => nrf52840}/ME25LS01-4Y10TD/rfswitch.h (100%) rename variants/{ => nrf52840}/ME25LS01-4Y10TD/variant.cpp (100%) rename variants/{ => nrf52840}/ME25LS01-4Y10TD/variant.h (100%) rename variants/{ => nrf52840}/ME25LS01-4Y10TD_e-ink/platformio.ini (78%) rename variants/{ => nrf52840}/ME25LS01-4Y10TD_e-ink/rfswitch.h (100%) rename variants/{ => nrf52840}/ME25LS01-4Y10TD_e-ink/variant.cpp (100%) rename variants/{ => nrf52840}/ME25LS01-4Y10TD_e-ink/variant.h (100%) rename variants/{ => nrf52840}/MS24SF1/platformio.ini (79%) rename variants/{ => nrf52840}/MS24SF1/variant.cpp (100%) rename variants/{ => nrf52840}/MS24SF1/variant.h (100%) rename variants/{ => nrf52840}/MakePython_nRF52840_eink/platformio.ini (77%) rename variants/{ => nrf52840}/MakePython_nRF52840_eink/variant.cpp (100%) rename variants/{ => nrf52840}/MakePython_nRF52840_eink/variant.h (100%) rename variants/{ => nrf52840}/MakePython_nRF52840_oled/platformio.ini (69%) rename variants/{ => nrf52840}/MakePython_nRF52840_oled/variant.cpp (100%) rename variants/{ => nrf52840}/MakePython_nRF52840_oled/variant.h (100%) rename variants/{ => nrf52840}/TWC_mesh_v4/platformio.ini (59%) rename variants/{ => nrf52840}/TWC_mesh_v4/variant.cpp (100%) rename variants/{ => nrf52840}/TWC_mesh_v4/variant.h (100%) rename variants/{ => nrf52840}/canaryone/platformio.ini (78%) rename variants/{ => nrf52840}/canaryone/variant.cpp (100%) rename variants/{ => nrf52840}/canaryone/variant.h (100%) rename variants/{ => nrf52840}/diy/nrf52_promicro_diy_tcxo/E80_RSSI_per_case.webp (100%) rename variants/{ => nrf52840}/diy/nrf52_promicro_diy_tcxo/Schematic_Pro-Micro_Pinouts 2024-12-14.pdf (100%) rename variants/{ => nrf52840}/diy/nrf52_promicro_diy_tcxo/custom_build_tasks.py (100%) rename variants/{ => nrf52840}/diy/nrf52_promicro_diy_tcxo/nicheGraphics.h (100%) create mode 100644 variants/nrf52840/diy/nrf52_promicro_diy_tcxo/platformio.ini rename variants/{ => nrf52840}/diy/nrf52_promicro_diy_tcxo/readme.md (99%) rename variants/{ => nrf52840}/diy/nrf52_promicro_diy_tcxo/rfswitch.h (100%) rename variants/{ => nrf52840}/diy/nrf52_promicro_diy_tcxo/variant.cpp (100%) rename variants/{ => nrf52840}/diy/nrf52_promicro_diy_tcxo/variant.h (100%) create mode 100644 variants/nrf52840/diy/nrf52_promicro_diy_xtal/platformio.ini rename variants/{ => nrf52840}/diy/nrf52_promicro_diy_xtal/variant.cpp (100%) rename variants/{ => nrf52840}/diy/nrf52_promicro_diy_xtal/variant.h (100%) rename variants/{ => nrf52840}/diy/seeed-xiao-nrf52840-wio-sx1262/README.md (100%) create mode 100644 variants/nrf52840/diy/seeed-xiao-nrf52840-wio-sx1262/platformio.ini rename variants/{ => nrf52840}/diy/seeed-xiao-nrf52840-wio-sx1262/variant.cpp (100%) rename variants/{ => nrf52840}/diy/seeed-xiao-nrf52840-wio-sx1262/variant.h (100%) create mode 100644 variants/nrf52840/diy/seeed_xiao_nrf52840_e22/platformio.ini rename variants/{ => nrf52840}/diy/xiao_ble/README.md (100%) create mode 100644 variants/nrf52840/diy/xiao_ble/platformio.ini rename variants/{ => nrf52840}/feather_diy/platformio.ini (79%) rename variants/{ => nrf52840}/feather_diy/variant.cpp (100%) rename variants/{ => nrf52840}/feather_diy/variant.h (100%) rename variants/{ => nrf52840}/gat562_mesh_trial_tracker/platformio.ini (75%) rename variants/{ => nrf52840}/gat562_mesh_trial_tracker/variant.cpp (100%) rename variants/{ => nrf52840}/gat562_mesh_trial_tracker/variant.h (100%) rename variants/{ => nrf52840}/heltec_mesh_node_t114-inkhud/custom_build_tasks.py (100%) rename variants/{ => nrf52840}/heltec_mesh_node_t114-inkhud/nicheGraphics.h (100%) rename variants/{ => nrf52840}/heltec_mesh_node_t114-inkhud/platformio.ini (66%) rename variants/{ => nrf52840}/heltec_mesh_node_t114-inkhud/variant.cpp (100%) rename variants/{ => nrf52840}/heltec_mesh_node_t114-inkhud/variant.h (100%) rename variants/{ => nrf52840}/heltec_mesh_node_t114/platformio.ini (74%) rename variants/{ => nrf52840}/heltec_mesh_node_t114/variant.cpp (100%) rename variants/{ => nrf52840}/heltec_mesh_node_t114/variant.h (100%) rename variants/{ => nrf52840}/heltec_mesh_pocket/nicheGraphics.h (100%) rename variants/{ => nrf52840}/heltec_mesh_pocket/platformio.ini (89%) rename variants/{ => nrf52840}/heltec_mesh_pocket/variant.cpp (100%) rename variants/{ => nrf52840}/heltec_mesh_pocket/variant.h (100%) rename variants/{ => nrf52840}/meshlink/platformio.ini (94%) rename variants/{ => nrf52840}/meshlink/variant.cpp (100%) rename variants/{ => nrf52840}/meshlink/variant.h (100%) rename variants/{ => nrf52840}/meshlink_eink/platformio.ini (93%) rename variants/{ => nrf52840}/meshlink_eink/variant.cpp (100%) rename variants/{ => nrf52840}/meshlink_eink/variant.h (100%) rename variants/{ => nrf52840}/monteops_hw1/platformio.ini (77%) rename variants/{ => nrf52840}/monteops_hw1/variant.cpp (100%) rename variants/{ => nrf52840}/monteops_hw1/variant.h (100%) rename variants/{ => nrf52840}/nano-g2-ultra/platformio.ini (70%) rename variants/{ => nrf52840}/nano-g2-ultra/variant.cpp (100%) rename variants/{ => nrf52840}/nano-g2-ultra/variant.h (100%) rename variants/{ => nrf52840}/rak2560/platformio.ini (87%) rename variants/{ => nrf52840}/rak2560/variant.cpp (100%) rename variants/{ => nrf52840}/rak2560/variant.h (100%) rename variants/{ => nrf52840}/rak4631/platformio.ini (94%) rename variants/{ => nrf52840}/rak4631/variant.cpp (100%) rename variants/{ => nrf52840}/rak4631/variant.h (100%) rename variants/{ => nrf52840}/rak4631_epaper/platformio.ini (86%) rename variants/{ => nrf52840}/rak4631_epaper/variant.cpp (100%) rename variants/{ => nrf52840}/rak4631_epaper/variant.h (100%) rename variants/{ => nrf52840}/rak4631_epaper_onrxtx/platformio.ini (87%) rename variants/{ => nrf52840}/rak4631_epaper_onrxtx/variant.cpp (100%) rename variants/{ => nrf52840}/rak4631_epaper_onrxtx/variant.h (100%) rename variants/{ => nrf52840}/rak4631_eth_gw/platformio.ini (95%) rename variants/{ => nrf52840}/rak4631_eth_gw/variant.cpp (100%) rename variants/{ => nrf52840}/rak4631_eth_gw/variant.h (100%) rename variants/{ => nrf52840}/rak4631_nomadstar_meteor_pro/platformio.ini (89%) rename variants/{ => nrf52840}/rak4631_nomadstar_meteor_pro/variant.cpp (100%) rename variants/{ => nrf52840}/rak4631_nomadstar_meteor_pro/variant.h (100%) rename variants/{ => nrf52840}/rak_wismeshtag/platformio.ini (71%) rename variants/{ => nrf52840}/rak_wismeshtag/variant.cpp (100%) rename variants/{ => nrf52840}/rak_wismeshtag/variant.h (99%) rename variants/{ => nrf52840}/rak_wismeshtap/platformio.ini (87%) rename variants/{ => nrf52840}/rak_wismeshtap/variant.cpp (100%) rename variants/{ => nrf52840}/rak_wismeshtap/variant.h (100%) rename variants/{ => nrf52840}/seeed_solar_node/platformio.ini (70%) rename variants/{ => nrf52840}/seeed_solar_node/variant.cpp (100%) rename variants/{ => nrf52840}/seeed_solar_node/variant.h (100%) rename variants/{ => nrf52840}/seeed_wio_tracker_L1/platformio.ini (61%) rename variants/{ => nrf52840}/seeed_wio_tracker_L1/variant.cpp (100%) rename variants/{ => nrf52840}/seeed_wio_tracker_L1/variant.h (100%) rename variants/{ => nrf52840}/seeed_wio_tracker_L1_eink/nicheGraphics.h (100%) rename variants/{ => nrf52840}/seeed_wio_tracker_L1_eink/platformio.ini (59%) rename variants/{ => nrf52840}/seeed_wio_tracker_L1_eink/variant.cpp (100%) rename variants/{ => nrf52840}/seeed_wio_tracker_L1_eink/variant.h (100%) rename variants/{ => nrf52840}/seeed_xiao_nrf52840_kit/platformio.ini (66%) rename variants/{ => nrf52840}/seeed_xiao_nrf52840_kit/variant.cpp (100%) rename variants/{ => nrf52840}/seeed_xiao_nrf52840_kit/variant.h (100%) rename variants/{ => nrf52840}/t-echo/nicheGraphics.h (100%) rename variants/{ => nrf52840}/t-echo/platformio.ini (89%) rename variants/{ => nrf52840}/t-echo/variant.cpp (100%) rename variants/{ => nrf52840}/t-echo/variant.h (100%) rename variants/{ => nrf52840}/tracker-t1000-e/platformio.ini (78%) rename variants/{ => nrf52840}/tracker-t1000-e/rfswitch.h (100%) rename variants/{ => nrf52840}/tracker-t1000-e/variant.cpp (100%) rename variants/{ => nrf52840}/tracker-t1000-e/variant.h (100%) rename variants/{ => nrf52840}/wio-sdk-wm1110/platformio.ini (80%) rename variants/{ => nrf52840}/wio-sdk-wm1110/rfswitch.h (100%) rename variants/{ => nrf52840}/wio-sdk-wm1110/variant.cpp (100%) rename variants/{ => nrf52840}/wio-sdk-wm1110/variant.h (100%) rename variants/{ => nrf52840}/wio-t1000-s/platformio.ini (77%) rename variants/{ => nrf52840}/wio-t1000-s/rfswitch.h (100%) rename variants/{ => nrf52840}/wio-t1000-s/variant.cpp (100%) rename variants/{ => nrf52840}/wio-t1000-s/variant.h (100%) rename variants/{ => nrf52840}/wio-tracker-wm1110/platformio.ini (73%) rename variants/{ => nrf52840}/wio-tracker-wm1110/rfswitch.h (100%) rename variants/{ => nrf52840}/wio-tracker-wm1110/variant.cpp (100%) rename variants/{ => nrf52840}/wio-tracker-wm1110/variant.h (100%) diff --git a/src/graphics/niche/InkHUD/PlatformioConfig.ini b/src/graphics/niche/InkHUD/PlatformioConfig.ini index e5a0e67df..80984f399 100644 --- a/src/graphics/niche/InkHUD/PlatformioConfig.ini +++ b/src/graphics/niche/InkHUD/PlatformioConfig.ini @@ -1,7 +1,6 @@ [inkhud] build_src_filter = +; Include the nicheGraphics directory - +<../variants/$PIOENV>; Include nicheGraphics.h from our variant folder build_flags = -D MESHTASTIC_INCLUDE_NICHE_GRAPHICS ; Use NicheGraphics -D MESHTASTIC_INCLUDE_INKHUD ; Use InkHUD (a NicheGraphics UI) diff --git a/variants/diy/platformio.ini b/variants/diy/platformio.ini deleted file mode 100644 index 6b3a2ed99..000000000 --- a/variants/diy/platformio.ini +++ /dev/null @@ -1,80 +0,0 @@ -; Promicro + E22(0)-xxxMM / RA-01SH modules board variant - DIY - without TCXO -[env:nrf52_promicro_diy_xtal] -extends = nrf52840_base -board = promicro-nrf52840 -board_level = extra -build_flags = ${nrf52840_base.build_flags} - -I variants/diy/nrf52_promicro_diy_xtal - -D NRF52_PROMICRO_DIY -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/diy/nrf52_promicro_diy_xtal> -lib_deps = - ${nrf52840_base.lib_deps} -debug_tool = jlink - - -; Promicro + E22(0)-xxxM / HT-RA62 modules board variant - DIY - with TCXO -[env:nrf52_promicro_diy_tcxo] -extends = nrf52840_base -board = promicro-nrf52840 -build_flags = ${nrf52840_base.build_flags} - -I variants/diy/nrf52_promicro_diy_tcxo - -D NRF52_PROMICRO_DIY -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/diy/nrf52_promicro_diy_tcxo> -lib_deps = - ${nrf52840_base.lib_deps} -debug_tool = jlink - -; NRF52 ProMicro w/ E-Ink display -[env:nrf52_promicro_diy-inkhud] -board_level = extra -extends = nrf52840_base, inkhud -board = promicro-nrf52840 -build_flags = - ${nrf52840_base.build_flags} - ${inkhud.build_flags} - -I variants/diy/nrf52_promicro_diy_tcxo - -D NRF52_PROMICRO_DIY -build_src_filter = - ${nrf52_base.build_src_filter} - ${inkhud.build_src_filter} - +<../variants/diy/nrf52_promicro_diy_tcxo> -lib_deps = - ${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX - ${nrf52840_base.lib_deps} -extra_scripts = - ${env.extra_scripts} - variants/diy/nrf52_promicro_diy_tcxo/custom_build_tasks.py ; Add to PIO's Project Tasks pane: preset builds for common displays - -; Seeed Xiao BLE: https://www.digikey.com/en/products/detail/seeed-technology-co-ltd/102010448/16652893 -[env:xiao_ble] -extends = env:seeed_xiao_nrf52840_kit -board_level = extra -build_flags = ${env:seeed_xiao_nrf52840_kit.build_flags} -D PRIVATE_HW -DXIAO_BLE_LEGACY_PINOUT -DEBYTE_E22 -DEBYTE_E22_900M30S -build_unflags = -DGPS_L76K - -; Seeed XIAO nRF52840 + EBYTE E22-900M30S - Pinout matching Wio-SX1262 (SKU 113010003) -[env:seeed_xiao_nrf52840_e22_900m30s] -extends = env:seeed_xiao_nrf52840_kit -board_level = extra -build_flags = ${env:seeed_xiao_nrf52840_kit.build_flags} -D PRIVATE_HW -DEBYTE_E22 -DEBYTE_E22_900M30S -build_unflags = -DGPS_L76K - -; Seeed XIAO nRF52840 + EBYTE E22-900M33S - Pinout matching Wio-SX1262 (SKU 113010003) -[env:seeed_xiao_nrf52840_e22_900m33s] -extends = env:seeed_xiao_nrf52840_kit -board_level = extra -build_flags = ${env:seeed_xiao_nrf52840_kit.build_flags} -D PRIVATE_HW -DEBYTE_E22 -DEBYTE_E22_900M33S -build_unflags = -DGPS_L76K - -; Seeed XIAO nRF52840 + XIAO Wio SX1262 DIY -[env:seeed-xiao-nrf52840-wio-sx1262] -board = xiao_ble_sense -extends = nrf52840_base -board_level = extra -build_flags = ${nrf52840_base.build_flags} -Ivariants/diy/seeed-xiao-nrf52840-wio-sx1262 -D PRIVATE_HW - -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/diy/seeed-xiao-nrf52840-wio-sx1262> -lib_deps = - ${nrf52840_base.lib_deps} -debug_tool = jlink diff --git a/variants/Dongle_nRF52840-pca10059-v1/platformio.ini b/variants/nrf52840/Dongle_nRF52840-pca10059-v1/platformio.ini similarity index 67% rename from variants/Dongle_nRF52840-pca10059-v1/platformio.ini rename to variants/nrf52840/Dongle_nRF52840-pca10059-v1/platformio.ini index ad944779d..83044c206 100644 --- a/variants/Dongle_nRF52840-pca10059-v1/platformio.ini +++ b/variants/nrf52840/Dongle_nRF52840-pca10059-v1/platformio.ini @@ -2,11 +2,13 @@ board_level = extra extends = nrf52840_base board = nordic_pca10059 -build_flags = ${nrf52840_base.build_flags} -Ivariants/Dongle_nRF52840-pca10059-v1 -D NORDIC_PCA10059 +build_flags = ${nrf52840_base.build_flags} + -Ivariants/nrf52840/Dongle_nRF52840-pca10059-v1 + -D NORDIC_PCA10059 -DEINK_DISPLAY_MODEL=GxEPD2_420_M01 -DEINK_WIDTH=300 -DEINK_HEIGHT=400 -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/Dongle_nRF52840-pca10059-v1> +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/Dongle_nRF52840-pca10059-v1> lib_deps = ${nrf52840_base.lib_deps} zinggjm/GxEPD2@^1.6.2 diff --git a/variants/Dongle_nRF52840-pca10059-v1/variant.cpp b/variants/nrf52840/Dongle_nRF52840-pca10059-v1/variant.cpp similarity index 100% rename from variants/Dongle_nRF52840-pca10059-v1/variant.cpp rename to variants/nrf52840/Dongle_nRF52840-pca10059-v1/variant.cpp diff --git a/variants/Dongle_nRF52840-pca10059-v1/variant.h b/variants/nrf52840/Dongle_nRF52840-pca10059-v1/variant.h similarity index 100% rename from variants/Dongle_nRF52840-pca10059-v1/variant.h rename to variants/nrf52840/Dongle_nRF52840-pca10059-v1/variant.h diff --git a/variants/ELECROW-ThinkNode-M1/nicheGraphics.h b/variants/nrf52840/ELECROW-ThinkNode-M1/nicheGraphics.h similarity index 100% rename from variants/ELECROW-ThinkNode-M1/nicheGraphics.h rename to variants/nrf52840/ELECROW-ThinkNode-M1/nicheGraphics.h diff --git a/variants/ELECROW-ThinkNode-M1/platformio.ini b/variants/nrf52840/ELECROW-ThinkNode-M1/platformio.ini similarity index 88% rename from variants/ELECROW-ThinkNode-M1/platformio.ini rename to variants/nrf52840/ELECROW-ThinkNode-M1/platformio.ini index 2e9a20dfe..0578bcfe8 100644 --- a/variants/ELECROW-ThinkNode-M1/platformio.ini +++ b/variants/nrf52840/ELECROW-ThinkNode-M1/platformio.ini @@ -6,7 +6,8 @@ board_check = true debug_tool = jlink # add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling. -build_flags = ${nrf52840_base.build_flags} -Ivariants/ELECROW-ThinkNode-M1 +build_flags = ${nrf52840_base.build_flags} + -Ivariants/nrf52840/ELECROW-ThinkNode-M1 -DELECROW_ThinkNode_M1 -DGPS_POWER_TOGGLE -DUSE_EINK @@ -20,7 +21,7 @@ build_flags = ${nrf52840_base.build_flags} -Ivariants/ELECROW-ThinkNode-M1 ; -DEINK_LIMIT_GHOSTING_PX=2000 ; (Optional) How much image ghosting is tolerated -DEINK_BACKGROUND_USES_FAST ; (Optional) Use FAST refresh for both BACKGROUND and RESPONSIVE, until a limit is reached. -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/ELECROW-ThinkNode-M1> +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/ELECROW-ThinkNode-M1> lib_deps = ${nrf52840_base.lib_deps} https://github.com/meshtastic/GxEPD2/archive/33db3fa8ee6fc47d160bdb44f8f127c9a9203a10.zip @@ -36,11 +37,12 @@ debug_tool = jlink build_flags = ${nrf52840_base.build_flags} ${inkhud.build_flags} - -I variants/ELECROW-ThinkNode-M1 + -I variants/nrf52840/ELECROW-ThinkNode-M1 -D ELECROW_ThinkNode_M1 build_src_filter = ${nrf52_base.build_src_filter} ${inkhud.build_src_filter} + +<../variants/nrf52840/ELECROW-ThinkNode-M1> lib_deps = ${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX ${nrf52840_base.lib_deps} diff --git a/variants/ELECROW-ThinkNode-M1/variant.cpp b/variants/nrf52840/ELECROW-ThinkNode-M1/variant.cpp similarity index 100% rename from variants/ELECROW-ThinkNode-M1/variant.cpp rename to variants/nrf52840/ELECROW-ThinkNode-M1/variant.cpp diff --git a/variants/ELECROW-ThinkNode-M1/variant.h b/variants/nrf52840/ELECROW-ThinkNode-M1/variant.h similarity index 100% rename from variants/ELECROW-ThinkNode-M1/variant.h rename to variants/nrf52840/ELECROW-ThinkNode-M1/variant.h diff --git a/variants/ME25LS01-4Y10TD/platformio.ini b/variants/nrf52840/ME25LS01-4Y10TD/platformio.ini similarity index 76% rename from variants/ME25LS01-4Y10TD/platformio.ini rename to variants/nrf52840/ME25LS01-4Y10TD/platformio.ini index b452f0ad8..89a45694c 100644 --- a/variants/ME25LS01-4Y10TD/platformio.ini +++ b/variants/nrf52840/ME25LS01-4Y10TD/platformio.ini @@ -3,10 +3,14 @@ extends = nrf52840_base board = me25ls01-4y10td board_level = extra ; platform = https://github.com/maxgerhardt/platform-nordicnrf52#cac6fcf943a41accd2aeb4f3659ae297a73f422e -build_flags = ${nrf52840_base.build_flags} -Ivariants/ME25LS01-4Y10TD -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DME25LS01_4Y10TD +build_flags = ${nrf52840_base.build_flags} + -Ivariants/nrf52840/ME25LS01-4Y10TD + -Isrc/platform/nrf52/softdevice + -Isrc/platform/nrf52/softdevice/nrf52 + -DME25LS01_4Y10TD -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/ME25LS01-4Y10TD> +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/ME25LS01-4Y10TD> lib_deps = ${nrf52840_base.lib_deps} ; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm) diff --git a/variants/ME25LS01-4Y10TD/rfswitch.h b/variants/nrf52840/ME25LS01-4Y10TD/rfswitch.h similarity index 100% rename from variants/ME25LS01-4Y10TD/rfswitch.h rename to variants/nrf52840/ME25LS01-4Y10TD/rfswitch.h diff --git a/variants/ME25LS01-4Y10TD/variant.cpp b/variants/nrf52840/ME25LS01-4Y10TD/variant.cpp similarity index 100% rename from variants/ME25LS01-4Y10TD/variant.cpp rename to variants/nrf52840/ME25LS01-4Y10TD/variant.cpp diff --git a/variants/ME25LS01-4Y10TD/variant.h b/variants/nrf52840/ME25LS01-4Y10TD/variant.h similarity index 100% rename from variants/ME25LS01-4Y10TD/variant.h rename to variants/nrf52840/ME25LS01-4Y10TD/variant.h diff --git a/variants/ME25LS01-4Y10TD_e-ink/platformio.ini b/variants/nrf52840/ME25LS01-4Y10TD_e-ink/platformio.ini similarity index 78% rename from variants/ME25LS01-4Y10TD_e-ink/platformio.ini rename to variants/nrf52840/ME25LS01-4Y10TD_e-ink/platformio.ini index f9788a521..ad5867bd5 100644 --- a/variants/ME25LS01-4Y10TD_e-ink/platformio.ini +++ b/variants/nrf52840/ME25LS01-4Y10TD_e-ink/platformio.ini @@ -3,13 +3,17 @@ extends = nrf52840_base board = me25ls01-4y10td board_level = extra ; platform = https://github.com/maxgerhardt/platform-nordicnrf52#cac6fcf943a41accd2aeb4f3659ae297a73f422e -build_flags = ${nrf52840_base.build_flags} -Ivariants/ME25LS01-4Y10TD_e-ink -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DME25LS01_4Y10TD +build_flags = ${nrf52840_base.build_flags} + -Ivariants/nrf52840/ME25LS01-4Y10TD_e-ink + -Isrc/platform/nrf52/softdevice + -Isrc/platform/nrf52/softdevice/nrf52 + -DME25LS01_4Y10TD -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. -DEINK_DISPLAY_MODEL=GxEPD2_420_GDEY042T81 -DEINK_WIDTH=400 -DEINK_HEIGHT=300 board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/ME25LS01-4Y10TD_e-ink> +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/ME25LS01-4Y10TD_e-ink> lib_deps = ${nrf52840_base.lib_deps} zinggjm/GxEPD2@^1.6.2 diff --git a/variants/ME25LS01-4Y10TD_e-ink/rfswitch.h b/variants/nrf52840/ME25LS01-4Y10TD_e-ink/rfswitch.h similarity index 100% rename from variants/ME25LS01-4Y10TD_e-ink/rfswitch.h rename to variants/nrf52840/ME25LS01-4Y10TD_e-ink/rfswitch.h diff --git a/variants/ME25LS01-4Y10TD_e-ink/variant.cpp b/variants/nrf52840/ME25LS01-4Y10TD_e-ink/variant.cpp similarity index 100% rename from variants/ME25LS01-4Y10TD_e-ink/variant.cpp rename to variants/nrf52840/ME25LS01-4Y10TD_e-ink/variant.cpp diff --git a/variants/ME25LS01-4Y10TD_e-ink/variant.h b/variants/nrf52840/ME25LS01-4Y10TD_e-ink/variant.h similarity index 100% rename from variants/ME25LS01-4Y10TD_e-ink/variant.h rename to variants/nrf52840/ME25LS01-4Y10TD_e-ink/variant.h diff --git a/variants/MS24SF1/platformio.ini b/variants/nrf52840/MS24SF1/platformio.ini similarity index 79% rename from variants/MS24SF1/platformio.ini rename to variants/nrf52840/MS24SF1/platformio.ini index 10e8d2c95..f162cbd60 100644 --- a/variants/MS24SF1/platformio.ini +++ b/variants/nrf52840/MS24SF1/platformio.ini @@ -3,10 +3,13 @@ extends = nrf52840_base board = ms24sf1 board_level = extra ; platform = https://github.com/maxgerhardt/platform-nordicnrf52#cac6fcf943a41accd2aeb4f3659ae297a73f422e -build_flags = ${nrf52840_base.build_flags} -Ivariants/MS24SF1 -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 +build_flags = ${nrf52840_base.build_flags} + -Ivariants/nrf52840/MS24SF1 + -Isrc/platform/nrf52/softdevice + -Isrc/platform/nrf52/softdevice/nrf52 -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/MS24SF1> +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/MS24SF1> lib_deps = ${nrf52840_base.lib_deps} ; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm) diff --git a/variants/MS24SF1/variant.cpp b/variants/nrf52840/MS24SF1/variant.cpp similarity index 100% rename from variants/MS24SF1/variant.cpp rename to variants/nrf52840/MS24SF1/variant.cpp diff --git a/variants/MS24SF1/variant.h b/variants/nrf52840/MS24SF1/variant.h similarity index 100% rename from variants/MS24SF1/variant.h rename to variants/nrf52840/MS24SF1/variant.h diff --git a/variants/MakePython_nRF52840_eink/platformio.ini b/variants/nrf52840/MakePython_nRF52840_eink/platformio.ini similarity index 77% rename from variants/MakePython_nRF52840_eink/platformio.ini rename to variants/nrf52840/MakePython_nRF52840_eink/platformio.ini index ef97172e9..50e5495f0 100644 --- a/variants/MakePython_nRF52840_eink/platformio.ini +++ b/variants/nrf52840/MakePython_nRF52840_eink/platformio.ini @@ -2,12 +2,14 @@ board_level = extra extends = nrf52840_base board = nordic_pca10059 -build_flags = ${nrf52840_base.build_flags} -Ivariants/MakePython_nRF52840_eink -D PRIVATE_HW +build_flags = ${nrf52840_base.build_flags} + -Ivariants/nrf52840/MakePython_nRF52840_eink + -D PRIVATE_HW -D PIN_EINK_EN -DEINK_DISPLAY_MODEL=GxEPD2_290_T5D -DEINK_WIDTH=296 -DEINK_HEIGHT=128 -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/MakePython_nRF52840_eink> +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/MakePython_nRF52840_eink> lib_deps = ${nrf52840_base.lib_deps} https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip diff --git a/variants/MakePython_nRF52840_eink/variant.cpp b/variants/nrf52840/MakePython_nRF52840_eink/variant.cpp similarity index 100% rename from variants/MakePython_nRF52840_eink/variant.cpp rename to variants/nrf52840/MakePython_nRF52840_eink/variant.cpp diff --git a/variants/MakePython_nRF52840_eink/variant.h b/variants/nrf52840/MakePython_nRF52840_eink/variant.h similarity index 100% rename from variants/MakePython_nRF52840_eink/variant.h rename to variants/nrf52840/MakePython_nRF52840_eink/variant.h diff --git a/variants/MakePython_nRF52840_oled/platformio.ini b/variants/nrf52840/MakePython_nRF52840_oled/platformio.ini similarity index 69% rename from variants/MakePython_nRF52840_oled/platformio.ini rename to variants/nrf52840/MakePython_nRF52840_oled/platformio.ini index 57b9ecb79..c7418e53c 100644 --- a/variants/MakePython_nRF52840_oled/platformio.ini +++ b/variants/nrf52840/MakePython_nRF52840_oled/platformio.ini @@ -2,8 +2,10 @@ board_level = extra extends = nrf52840_base board = nordic_pca10059 -build_flags = ${nrf52840_base.build_flags} -Ivariants/MakePython_nRF52840_oled -D PRIVATE_HW -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/MakePython_nRF52840_oled> +build_flags = ${nrf52840_base.build_flags} + -I variants/nrf52840/MakePython_nRF52840_oled + -D PRIVATE_HW +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/MakePython_nRF52840_oled> lib_deps = ${nrf52840_base.lib_deps} https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip diff --git a/variants/MakePython_nRF52840_oled/variant.cpp b/variants/nrf52840/MakePython_nRF52840_oled/variant.cpp similarity index 100% rename from variants/MakePython_nRF52840_oled/variant.cpp rename to variants/nrf52840/MakePython_nRF52840_oled/variant.cpp diff --git a/variants/MakePython_nRF52840_oled/variant.h b/variants/nrf52840/MakePython_nRF52840_oled/variant.h similarity index 100% rename from variants/MakePython_nRF52840_oled/variant.h rename to variants/nrf52840/MakePython_nRF52840_oled/variant.h diff --git a/variants/TWC_mesh_v4/platformio.ini b/variants/nrf52840/TWC_mesh_v4/platformio.ini similarity index 59% rename from variants/TWC_mesh_v4/platformio.ini rename to variants/nrf52840/TWC_mesh_v4/platformio.ini index 2eb58bf9f..77aeee26e 100644 --- a/variants/TWC_mesh_v4/platformio.ini +++ b/variants/nrf52840/TWC_mesh_v4/platformio.ini @@ -2,8 +2,10 @@ extends = nrf52840_base board = nordic_pca10059 board_level = extra -build_flags = ${nrf52840_base.build_flags} -I variants/TWC_mesh_v4 -D TWC_mesh_v4 -L".pio\libdeps\TWC_mesh_v4\bsec2\src\cortex-m4\fpv4-sp-d16-hard" -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/TWC_mesh_v4> +build_flags = ${nrf52840_base.build_flags} + -I variants/nrf52840/TWC_mesh_v4 + -D TWC_mesh_v4 +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/TWC_mesh_v4> lib_deps = ${nrf52840_base.lib_deps} zinggjm/GxEPD2@^1.6.2 diff --git a/variants/TWC_mesh_v4/variant.cpp b/variants/nrf52840/TWC_mesh_v4/variant.cpp similarity index 100% rename from variants/TWC_mesh_v4/variant.cpp rename to variants/nrf52840/TWC_mesh_v4/variant.cpp diff --git a/variants/TWC_mesh_v4/variant.h b/variants/nrf52840/TWC_mesh_v4/variant.h similarity index 100% rename from variants/TWC_mesh_v4/variant.h rename to variants/nrf52840/TWC_mesh_v4/variant.h diff --git a/variants/canaryone/platformio.ini b/variants/nrf52840/canaryone/platformio.ini similarity index 78% rename from variants/canaryone/platformio.ini rename to variants/nrf52840/canaryone/platformio.ini index ad11305db..251937e9c 100644 --- a/variants/canaryone/platformio.ini +++ b/variants/nrf52840/canaryone/platformio.ini @@ -5,8 +5,10 @@ board = canaryone debug_tool = jlink # add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling. -build_flags = ${nrf52840_base.build_flags} -Ivariants/canaryone -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/canaryone> +build_flags = + ${nrf52840_base.build_flags} + -I variants/nrf52840/canaryone +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/canaryone> lib_deps = ${nrf52840_base.lib_deps} lewisxhe/PCF8563_Library@^1.0.1 diff --git a/variants/canaryone/variant.cpp b/variants/nrf52840/canaryone/variant.cpp similarity index 100% rename from variants/canaryone/variant.cpp rename to variants/nrf52840/canaryone/variant.cpp diff --git a/variants/canaryone/variant.h b/variants/nrf52840/canaryone/variant.h similarity index 100% rename from variants/canaryone/variant.h rename to variants/nrf52840/canaryone/variant.h diff --git a/variants/diy/nrf52_promicro_diy_tcxo/E80_RSSI_per_case.webp b/variants/nrf52840/diy/nrf52_promicro_diy_tcxo/E80_RSSI_per_case.webp similarity index 100% rename from variants/diy/nrf52_promicro_diy_tcxo/E80_RSSI_per_case.webp rename to variants/nrf52840/diy/nrf52_promicro_diy_tcxo/E80_RSSI_per_case.webp diff --git a/variants/diy/nrf52_promicro_diy_tcxo/Schematic_Pro-Micro_Pinouts 2024-12-14.pdf b/variants/nrf52840/diy/nrf52_promicro_diy_tcxo/Schematic_Pro-Micro_Pinouts 2024-12-14.pdf similarity index 100% rename from variants/diy/nrf52_promicro_diy_tcxo/Schematic_Pro-Micro_Pinouts 2024-12-14.pdf rename to variants/nrf52840/diy/nrf52_promicro_diy_tcxo/Schematic_Pro-Micro_Pinouts 2024-12-14.pdf diff --git a/variants/diy/nrf52_promicro_diy_tcxo/custom_build_tasks.py b/variants/nrf52840/diy/nrf52_promicro_diy_tcxo/custom_build_tasks.py similarity index 100% rename from variants/diy/nrf52_promicro_diy_tcxo/custom_build_tasks.py rename to variants/nrf52840/diy/nrf52_promicro_diy_tcxo/custom_build_tasks.py diff --git a/variants/diy/nrf52_promicro_diy_tcxo/nicheGraphics.h b/variants/nrf52840/diy/nrf52_promicro_diy_tcxo/nicheGraphics.h similarity index 100% rename from variants/diy/nrf52_promicro_diy_tcxo/nicheGraphics.h rename to variants/nrf52840/diy/nrf52_promicro_diy_tcxo/nicheGraphics.h diff --git a/variants/nrf52840/diy/nrf52_promicro_diy_tcxo/platformio.ini b/variants/nrf52840/diy/nrf52_promicro_diy_tcxo/platformio.ini new file mode 100644 index 000000000..61a6eda07 --- /dev/null +++ b/variants/nrf52840/diy/nrf52_promicro_diy_tcxo/platformio.ini @@ -0,0 +1,32 @@ +; Promicro + E22(0)-xxxM / HT-RA62 modules board variant - DIY - with TCXO +[env:nrf52_promicro_diy_tcxo] +extends = nrf52840_base +board = promicro-nrf52840 +build_flags = ${nrf52840_base.build_flags} + -I variants/nrf52840/diy/nrf52_promicro_diy_tcxo + -D NRF52_PROMICRO_DIY +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/diy/nrf52_promicro_diy_tcxo> +lib_deps = + ${nrf52840_base.lib_deps} +debug_tool = jlink + +; NRF52 ProMicro w/ E-Ink display +[env:nrf52_promicro_diy-inkhud] +board_level = extra +extends = nrf52840_base, inkhud +board = promicro-nrf52840 +build_flags = + ${nrf52840_base.build_flags} + ${inkhud.build_flags} + -I variants/nrf52840/diy/nrf52_promicro_diy_tcxo + -D NRF52_PROMICRO_DIY +build_src_filter = + ${nrf52_base.build_src_filter} + ${inkhud.build_src_filter} + +<../variants/nrf52840/diy/nrf52_promicro_diy_tcxo> +lib_deps = + ${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX + ${nrf52840_base.lib_deps} +extra_scripts = + ${env.extra_scripts} + variants/nrf52840/diy/nrf52_promicro_diy_tcxo/custom_build_tasks.py ; Add to PIO's Project Tasks pane: preset builds for common displays diff --git a/variants/diy/nrf52_promicro_diy_tcxo/readme.md b/variants/nrf52840/diy/nrf52_promicro_diy_tcxo/readme.md similarity index 99% rename from variants/diy/nrf52_promicro_diy_tcxo/readme.md rename to variants/nrf52840/diy/nrf52_promicro_diy_tcxo/readme.md index 585ac36de..5a78103ee 100644 --- a/variants/diy/nrf52_promicro_diy_tcxo/readme.md +++ b/variants/nrf52840/diy/nrf52_promicro_diy_tcxo/readme.md @@ -1,3 +1,5 @@ + + # Notes ## General diff --git a/variants/diy/nrf52_promicro_diy_tcxo/rfswitch.h b/variants/nrf52840/diy/nrf52_promicro_diy_tcxo/rfswitch.h similarity index 100% rename from variants/diy/nrf52_promicro_diy_tcxo/rfswitch.h rename to variants/nrf52840/diy/nrf52_promicro_diy_tcxo/rfswitch.h diff --git a/variants/diy/nrf52_promicro_diy_tcxo/variant.cpp b/variants/nrf52840/diy/nrf52_promicro_diy_tcxo/variant.cpp similarity index 100% rename from variants/diy/nrf52_promicro_diy_tcxo/variant.cpp rename to variants/nrf52840/diy/nrf52_promicro_diy_tcxo/variant.cpp diff --git a/variants/diy/nrf52_promicro_diy_tcxo/variant.h b/variants/nrf52840/diy/nrf52_promicro_diy_tcxo/variant.h similarity index 100% rename from variants/diy/nrf52_promicro_diy_tcxo/variant.h rename to variants/nrf52840/diy/nrf52_promicro_diy_tcxo/variant.h diff --git a/variants/nrf52840/diy/nrf52_promicro_diy_xtal/platformio.ini b/variants/nrf52840/diy/nrf52_promicro_diy_xtal/platformio.ini new file mode 100644 index 000000000..278f578c5 --- /dev/null +++ b/variants/nrf52840/diy/nrf52_promicro_diy_xtal/platformio.ini @@ -0,0 +1,12 @@ +; Promicro + E22(0)-xxxMM / RA-01SH modules board variant - DIY - without TCXO +[env:nrf52_promicro_diy_xtal] +extends = nrf52840_base +board = promicro-nrf52840 +board_level = extra +build_flags = ${nrf52840_base.build_flags} + -I variants/nrf52840/diy/nrf52_promicro_diy_xtal + -D NRF52_PROMICRO_DIY +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/diy/nrf52_promicro_diy_xtal> +lib_deps = + ${nrf52840_base.lib_deps} +debug_tool = jlink diff --git a/variants/diy/nrf52_promicro_diy_xtal/variant.cpp b/variants/nrf52840/diy/nrf52_promicro_diy_xtal/variant.cpp similarity index 100% rename from variants/diy/nrf52_promicro_diy_xtal/variant.cpp rename to variants/nrf52840/diy/nrf52_promicro_diy_xtal/variant.cpp diff --git a/variants/diy/nrf52_promicro_diy_xtal/variant.h b/variants/nrf52840/diy/nrf52_promicro_diy_xtal/variant.h similarity index 100% rename from variants/diy/nrf52_promicro_diy_xtal/variant.h rename to variants/nrf52840/diy/nrf52_promicro_diy_xtal/variant.h diff --git a/variants/diy/seeed-xiao-nrf52840-wio-sx1262/README.md b/variants/nrf52840/diy/seeed-xiao-nrf52840-wio-sx1262/README.md similarity index 100% rename from variants/diy/seeed-xiao-nrf52840-wio-sx1262/README.md rename to variants/nrf52840/diy/seeed-xiao-nrf52840-wio-sx1262/README.md diff --git a/variants/nrf52840/diy/seeed-xiao-nrf52840-wio-sx1262/platformio.ini b/variants/nrf52840/diy/seeed-xiao-nrf52840-wio-sx1262/platformio.ini new file mode 100644 index 000000000..2df31d23c --- /dev/null +++ b/variants/nrf52840/diy/seeed-xiao-nrf52840-wio-sx1262/platformio.ini @@ -0,0 +1,15 @@ +; Seeed XIAO nRF52840 + XIAO Wio SX1262 DIY +[env:seeed-xiao-nrf52840-wio-sx1262] +board = xiao_ble_sense +extends = nrf52840_base +board_level = extra +build_flags = ${nrf52840_base.build_flags} + -Ivariants/nrf52840/diy/seeed-xiao-nrf52840-wio-sx1262 + -D PRIVATE_HW + -Isrc/platform/nrf52/softdevice + -Isrc/platform/nrf52/softdevice/nrf52 +board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/diy/seeed-xiao-nrf52840-wio-sx1262> +lib_deps = + ${nrf52840_base.lib_deps} +debug_tool = jlink diff --git a/variants/diy/seeed-xiao-nrf52840-wio-sx1262/variant.cpp b/variants/nrf52840/diy/seeed-xiao-nrf52840-wio-sx1262/variant.cpp similarity index 100% rename from variants/diy/seeed-xiao-nrf52840-wio-sx1262/variant.cpp rename to variants/nrf52840/diy/seeed-xiao-nrf52840-wio-sx1262/variant.cpp diff --git a/variants/diy/seeed-xiao-nrf52840-wio-sx1262/variant.h b/variants/nrf52840/diy/seeed-xiao-nrf52840-wio-sx1262/variant.h similarity index 100% rename from variants/diy/seeed-xiao-nrf52840-wio-sx1262/variant.h rename to variants/nrf52840/diy/seeed-xiao-nrf52840-wio-sx1262/variant.h diff --git a/variants/nrf52840/diy/seeed_xiao_nrf52840_e22/platformio.ini b/variants/nrf52840/diy/seeed_xiao_nrf52840_e22/platformio.ini new file mode 100644 index 000000000..a5d0aaf8f --- /dev/null +++ b/variants/nrf52840/diy/seeed_xiao_nrf52840_e22/platformio.ini @@ -0,0 +1,19 @@ +; Seeed XIAO nRF52840 + EBYTE E22-900M30S - Pinout matching Wio-SX1262 (SKU 113010003) +[env:seeed_xiao_nrf52840_e22_900m30s] +extends = env:seeed_xiao_nrf52840_kit +board_level = extra +build_flags = ${env:seeed_xiao_nrf52840_kit.build_flags} + -D PRIVATE_HW + -DEBYTE_E22 + -DEBYTE_E22_900M30S +build_unflags = -DGPS_L76K + +; Seeed XIAO nRF52840 + EBYTE E22-900M33S - Pinout matching Wio-SX1262 (SKU 113010003) +[env:seeed_xiao_nrf52840_e22_900m33s] +extends = env:seeed_xiao_nrf52840_kit +board_level = extra +build_flags = ${env:seeed_xiao_nrf52840_kit.build_flags} + -D PRIVATE_HW + -DEBYTE_E22 + -DEBYTE_E22_900M33S +build_unflags = -DGPS_L76K diff --git a/variants/diy/xiao_ble/README.md b/variants/nrf52840/diy/xiao_ble/README.md similarity index 100% rename from variants/diy/xiao_ble/README.md rename to variants/nrf52840/diy/xiao_ble/README.md diff --git a/variants/nrf52840/diy/xiao_ble/platformio.ini b/variants/nrf52840/diy/xiao_ble/platformio.ini new file mode 100644 index 000000000..6c764ea78 --- /dev/null +++ b/variants/nrf52840/diy/xiao_ble/platformio.ini @@ -0,0 +1,10 @@ +; Seeed Xiao BLE: https://www.digikey.com/en/products/detail/seeed-technology-co-ltd/102010448/16652893 +[env:xiao_ble] +extends = env:seeed_xiao_nrf52840_kit +board_level = extra +build_flags = ${env:seeed_xiao_nrf52840_kit.build_flags} + -D PRIVATE_HW + -DXIAO_BLE_LEGACY_PINOUT + -DEBYTE_E22 + -DEBYTE_E22_900M30S +build_unflags = -DGPS_L76K diff --git a/variants/feather_diy/platformio.ini b/variants/nrf52840/feather_diy/platformio.ini similarity index 79% rename from variants/feather_diy/platformio.ini rename to variants/nrf52840/feather_diy/platformio.ini index 84c582ab0..a17e418a2 100644 --- a/variants/feather_diy/platformio.ini +++ b/variants/nrf52840/feather_diy/platformio.ini @@ -2,8 +2,10 @@ [env:feather_diy] extends = nrf52840_base board = adafruit_feather_nrf52840 -build_flags = ${nrf52840_base.build_flags} -Ivariants/feather_diy -Dfeather_diy -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/feather_diy> +build_flags = ${nrf52840_base.build_flags} + -Ivariants/nrf52840/feather_diy + -Dfeather_diy +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/feather_diy> lib_deps = ${nrf52840_base.lib_deps} debug_tool = jlink diff --git a/variants/feather_diy/variant.cpp b/variants/nrf52840/feather_diy/variant.cpp similarity index 100% rename from variants/feather_diy/variant.cpp rename to variants/nrf52840/feather_diy/variant.cpp diff --git a/variants/feather_diy/variant.h b/variants/nrf52840/feather_diy/variant.h similarity index 100% rename from variants/feather_diy/variant.h rename to variants/nrf52840/feather_diy/variant.h diff --git a/variants/gat562_mesh_trial_tracker/platformio.ini b/variants/nrf52840/gat562_mesh_trial_tracker/platformio.ini similarity index 75% rename from variants/gat562_mesh_trial_tracker/platformio.ini rename to variants/nrf52840/gat562_mesh_trial_tracker/platformio.ini index e67f3ec8d..72ac6320d 100644 --- a/variants/gat562_mesh_trial_tracker/platformio.ini +++ b/variants/nrf52840/gat562_mesh_trial_tracker/platformio.ini @@ -3,11 +3,13 @@ extends = nrf52840_base board = gat562_mesh_trial_tracker board_check = true -build_flags = ${nrf52840_base.build_flags} -Ivariants/gat562_mesh_trial_tracker -D GAT562_MESH_TRIAL_TRACKER +build_flags = ${nrf52840_base.build_flags} + -I variants/nrf52840/gat562_mesh_trial_tracker + -D GAT562_MESH_TRIAL_TRACKER -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. -DRADIOLIB_EXCLUDE_SX128X=1 -DRADIOLIB_EXCLUDE_SX127X=1 -DRADIOLIB_EXCLUDE_LR11X0=1 -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/gat562_mesh_trial_tracker> -lib_deps = +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/gat562_mesh_trial_tracker> +lib_deps = ${nrf52840_base.lib_deps} diff --git a/variants/gat562_mesh_trial_tracker/variant.cpp b/variants/nrf52840/gat562_mesh_trial_tracker/variant.cpp similarity index 100% rename from variants/gat562_mesh_trial_tracker/variant.cpp rename to variants/nrf52840/gat562_mesh_trial_tracker/variant.cpp diff --git a/variants/gat562_mesh_trial_tracker/variant.h b/variants/nrf52840/gat562_mesh_trial_tracker/variant.h similarity index 100% rename from variants/gat562_mesh_trial_tracker/variant.h rename to variants/nrf52840/gat562_mesh_trial_tracker/variant.h diff --git a/variants/heltec_mesh_node_t114-inkhud/custom_build_tasks.py b/variants/nrf52840/heltec_mesh_node_t114-inkhud/custom_build_tasks.py similarity index 100% rename from variants/heltec_mesh_node_t114-inkhud/custom_build_tasks.py rename to variants/nrf52840/heltec_mesh_node_t114-inkhud/custom_build_tasks.py diff --git a/variants/heltec_mesh_node_t114-inkhud/nicheGraphics.h b/variants/nrf52840/heltec_mesh_node_t114-inkhud/nicheGraphics.h similarity index 100% rename from variants/heltec_mesh_node_t114-inkhud/nicheGraphics.h rename to variants/nrf52840/heltec_mesh_node_t114-inkhud/nicheGraphics.h diff --git a/variants/heltec_mesh_node_t114-inkhud/platformio.ini b/variants/nrf52840/heltec_mesh_node_t114-inkhud/platformio.ini similarity index 66% rename from variants/heltec_mesh_node_t114-inkhud/platformio.ini rename to variants/nrf52840/heltec_mesh_node_t114-inkhud/platformio.ini index 9a5673040..2641a507d 100644 --- a/variants/heltec_mesh_node_t114-inkhud/platformio.ini +++ b/variants/nrf52840/heltec_mesh_node_t114-inkhud/platformio.ini @@ -6,14 +6,15 @@ board_check = true build_flags = ${nrf52840_base.build_flags} ${inkhud.build_flags} - -I variants/heltec_mesh_node_t114-inkhud + -I variants/nrf52840/heltec_mesh_node_t114-inkhud build_src_filter = ${nrf52_base.build_src_filter} ${inkhud.build_src_filter} + +<../variants/nrf52840/heltec_mesh_node_t114-inkhud> lib_deps = ${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX ${nrf52840_base.lib_deps} lewisxhe/PCF8563_Library@^1.0.1 extra_scripts = ${env.extra_scripts} - variants/diy/nrf52_promicro_diy_tcxo/custom_build_tasks.py ; Add to PIO's Project Tasks pane: preset builds for common displays \ No newline at end of file + variants/nrf52840/diy/nrf52_promicro_diy_tcxo/custom_build_tasks.py ; Add to PIO's Project Tasks pane: preset builds for common displays diff --git a/variants/heltec_mesh_node_t114-inkhud/variant.cpp b/variants/nrf52840/heltec_mesh_node_t114-inkhud/variant.cpp similarity index 100% rename from variants/heltec_mesh_node_t114-inkhud/variant.cpp rename to variants/nrf52840/heltec_mesh_node_t114-inkhud/variant.cpp diff --git a/variants/heltec_mesh_node_t114-inkhud/variant.h b/variants/nrf52840/heltec_mesh_node_t114-inkhud/variant.h similarity index 100% rename from variants/heltec_mesh_node_t114-inkhud/variant.h rename to variants/nrf52840/heltec_mesh_node_t114-inkhud/variant.h diff --git a/variants/heltec_mesh_node_t114/platformio.ini b/variants/nrf52840/heltec_mesh_node_t114/platformio.ini similarity index 74% rename from variants/heltec_mesh_node_t114/platformio.ini rename to variants/nrf52840/heltec_mesh_node_t114/platformio.ini index 3ba97bd04..ead787bb1 100644 --- a/variants/heltec_mesh_node_t114/platformio.ini +++ b/variants/nrf52840/heltec_mesh_node_t114/platformio.ini @@ -5,11 +5,12 @@ board = heltec_mesh_node_t114 debug_tool = jlink # add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling. -build_flags = ${nrf52840_base.build_flags} -Ivariants/heltec_mesh_node_t114 - -DGPS_POWER_TOGGLE - -DHELTEC_T114 +build_flags = ${nrf52840_base.build_flags} + -Ivariants/nrf52840/heltec_mesh_node_t114 + -DGPS_POWER_TOGGLE + -DHELTEC_T114 -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/heltec_mesh_node_t114> +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/heltec_mesh_node_t114> lib_deps = ${nrf52840_base.lib_deps} lewisxhe/PCF8563_Library@^1.0.1 diff --git a/variants/heltec_mesh_node_t114/variant.cpp b/variants/nrf52840/heltec_mesh_node_t114/variant.cpp similarity index 100% rename from variants/heltec_mesh_node_t114/variant.cpp rename to variants/nrf52840/heltec_mesh_node_t114/variant.cpp diff --git a/variants/heltec_mesh_node_t114/variant.h b/variants/nrf52840/heltec_mesh_node_t114/variant.h similarity index 100% rename from variants/heltec_mesh_node_t114/variant.h rename to variants/nrf52840/heltec_mesh_node_t114/variant.h diff --git a/variants/heltec_mesh_pocket/nicheGraphics.h b/variants/nrf52840/heltec_mesh_pocket/nicheGraphics.h similarity index 100% rename from variants/heltec_mesh_pocket/nicheGraphics.h rename to variants/nrf52840/heltec_mesh_pocket/nicheGraphics.h diff --git a/variants/heltec_mesh_pocket/platformio.ini b/variants/nrf52840/heltec_mesh_pocket/platformio.ini similarity index 89% rename from variants/heltec_mesh_pocket/platformio.ini rename to variants/nrf52840/heltec_mesh_pocket/platformio.ini index 2f3886887..2fb852226 100644 --- a/variants/heltec_mesh_pocket/platformio.ini +++ b/variants/nrf52840/heltec_mesh_pocket/platformio.ini @@ -5,7 +5,8 @@ board = heltec_mesh_pocket debug_tool = jlink # add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling. -build_flags = ${nrf52840_base.build_flags} -Ivariants/heltec_mesh_pocket +build_flags = ${nrf52840_base.build_flags} + -Ivariants/nrf52840/heltec_mesh_pocket -DHELTEC_MESH_POCKET -DHELTEC_MESH_POCKET_BATTERY_5000 -DUSE_EINK @@ -21,7 +22,7 @@ build_flags = ${nrf52840_base.build_flags} -Ivariants/heltec_mesh_pocket -DEINK_HASQUIRK_GHOSTING ; Display model is identified as "prone to ghosting" -DEINK_HASQUIRK_WEAKFASTREFRESH ; Pixels set with fast-refresh are easy to clear, disrupted by sunlight -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/heltec_mesh_pocket> +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/heltec_mesh_pocket> lib_deps = ${nrf52840_base.lib_deps} lewisxhe/PCF8563_Library@^1.0.1 @@ -31,11 +32,11 @@ lib_deps = [env:heltec-mesh-pocket-5000-inkhud] extends = nrf52840_base, inkhud board = heltec_mesh_pocket -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/heltec_mesh_pocket> ${inkhud.build_src_filter} +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/heltec_mesh_pocket> ${inkhud.build_src_filter} build_flags = ${inkhud.build_flags} ${nrf52840_base.build_flags} - -I variants/heltec_mesh_pocket + -I variants/nrf52840/heltec_mesh_pocket -D HELTEC_MESH_POCKET -D HELTEC_MESH_POCKET_BATTERY_5000 lib_deps = @@ -50,7 +51,8 @@ board = heltec_mesh_pocket debug_tool = jlink # add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling. -build_flags = ${nrf52840_base.build_flags} -Ivariants/heltec_mesh_pocket +build_flags = ${nrf52840_base.build_flags} + -Ivariants/nrf52840/heltec_mesh_pocket -DHELTEC_MESH_POCKET -DHELTEC_MESH_POCKET_BATTERY_10000 -DUSE_EINK @@ -66,7 +68,7 @@ build_flags = ${nrf52840_base.build_flags} -Ivariants/heltec_mesh_pocket -DEINK_HASQUIRK_GHOSTING ; Display model is identified as "prone to ghosting" -DEINK_HASQUIRK_WEAKFASTREFRESH ; Pixels set with fast-refresh are easy to clear, disrupted by sunlight -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/heltec_mesh_pocket> +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/heltec_mesh_pocket> lib_deps = ${nrf52840_base.lib_deps} lewisxhe/PCF8563_Library@^1.0.1 @@ -76,11 +78,11 @@ lib_deps = [env:heltec-mesh-pocket-10000-inkhud] extends = nrf52840_base, inkhud board = heltec_mesh_pocket -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/heltec_mesh_pocket> ${inkhud.build_src_filter} +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/heltec_mesh_pocket> ${inkhud.build_src_filter} build_flags = ${inkhud.build_flags} ${nrf52840_base.build_flags} - -I variants/heltec_mesh_pocket + -I variants/nrf52840/heltec_mesh_pocket -D HELTEC_MESH_POCKET -D HELTEC_MESH_POCKET_BATTERY_10000 lib_deps = diff --git a/variants/heltec_mesh_pocket/variant.cpp b/variants/nrf52840/heltec_mesh_pocket/variant.cpp similarity index 100% rename from variants/heltec_mesh_pocket/variant.cpp rename to variants/nrf52840/heltec_mesh_pocket/variant.cpp diff --git a/variants/heltec_mesh_pocket/variant.h b/variants/nrf52840/heltec_mesh_pocket/variant.h similarity index 100% rename from variants/heltec_mesh_pocket/variant.h rename to variants/nrf52840/heltec_mesh_pocket/variant.h diff --git a/variants/meshlink/platformio.ini b/variants/nrf52840/meshlink/platformio.ini similarity index 94% rename from variants/meshlink/platformio.ini rename to variants/nrf52840/meshlink/platformio.ini index 384858576..8216a704a 100644 --- a/variants/meshlink/platformio.ini +++ b/variants/nrf52840/meshlink/platformio.ini @@ -5,7 +5,9 @@ extends = nrf52840_base board = meshlink ;board_check = true -build_flags = ${nrf52840_base.build_flags} -I variants/meshlink -D MESHLINK +build_flags = ${nrf52840_base.build_flags} + -I variants/nrf52840/meshlink + -D MESHLINK -D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. -D EINK_DISPLAY_MODEL=GxEPD2_213_B74 -D EINK_WIDTH=250 @@ -19,7 +21,7 @@ build_flags = ${nrf52840_base.build_flags} -I variants/meshlink -D MESHLINK -D EINK_HASQUIRK_VICIOUSFASTREFRESH ; Identify that pixels drawn by fast-refresh are harder to clear -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/meshlink> +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/meshlink> lib_deps = ${nrf52840_base.lib_deps} https://github.com/meshtastic/GxEPD2/archive/55f618961db45a23eff0233546430f1e5a80f63a.zip diff --git a/variants/meshlink/variant.cpp b/variants/nrf52840/meshlink/variant.cpp similarity index 100% rename from variants/meshlink/variant.cpp rename to variants/nrf52840/meshlink/variant.cpp diff --git a/variants/meshlink/variant.h b/variants/nrf52840/meshlink/variant.h similarity index 100% rename from variants/meshlink/variant.h rename to variants/nrf52840/meshlink/variant.h diff --git a/variants/meshlink_eink/platformio.ini b/variants/nrf52840/meshlink_eink/platformio.ini similarity index 93% rename from variants/meshlink_eink/platformio.ini rename to variants/nrf52840/meshlink_eink/platformio.ini index 550b1e2fc..a48a9e695 100644 --- a/variants/meshlink_eink/platformio.ini +++ b/variants/nrf52840/meshlink_eink/platformio.ini @@ -5,7 +5,9 @@ extends = nrf52840_base board = meshlink ;board_check = true -build_flags = ${nrf52840_base.build_flags} -I variants/meshlink_eink -D MESHLINK +build_flags = ${nrf52840_base.build_flags} + -I variants/nrf52840/meshlink_eink + -D MESHLINK -D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. -D EINK_DISPLAY_MODEL=GxEPD2_213_B74 -D EINK_WIDTH=250 @@ -19,7 +21,7 @@ build_flags = ${nrf52840_base.build_flags} -I variants/meshlink_eink -D MESHLINK -D EINK_HASQUIRK_VICIOUSFASTREFRESH ; Identify that pixels drawn by fast-refresh are harder to clear -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/meshlink_eink> +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/meshlink_eink> lib_deps = ${nrf52840_base.lib_deps} https://github.com/meshtastic/GxEPD2/archive/55f618961db45a23eff0233546430f1e5a80f63a.zip diff --git a/variants/meshlink_eink/variant.cpp b/variants/nrf52840/meshlink_eink/variant.cpp similarity index 100% rename from variants/meshlink_eink/variant.cpp rename to variants/nrf52840/meshlink_eink/variant.cpp diff --git a/variants/meshlink_eink/variant.h b/variants/nrf52840/meshlink_eink/variant.h similarity index 100% rename from variants/meshlink_eink/variant.h rename to variants/nrf52840/meshlink_eink/variant.h diff --git a/variants/monteops_hw1/platformio.ini b/variants/nrf52840/monteops_hw1/platformio.ini similarity index 77% rename from variants/monteops_hw1/platformio.ini rename to variants/nrf52840/monteops_hw1/platformio.ini index 82567f614..5426aee7f 100644 --- a/variants/monteops_hw1/platformio.ini +++ b/variants/nrf52840/monteops_hw1/platformio.ini @@ -3,8 +3,10 @@ board_level = extra extends = nrf52840_base board = wiscore_rak4631 -build_flags = ${nrf52840_base.build_flags} -Ivariants/monteops_hw1 -D MONTEOPS_HW1 -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/monteops_hw1> + + + +build_flags = ${nrf52840_base.build_flags} + -I variants/nrf52840/monteops_hw1 + -D MONTEOPS_HW1 +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/monteops_hw1> + + + lib_deps = ${nrf52840_base.lib_deps} ${networking_base.lib_deps} diff --git a/variants/monteops_hw1/variant.cpp b/variants/nrf52840/monteops_hw1/variant.cpp similarity index 100% rename from variants/monteops_hw1/variant.cpp rename to variants/nrf52840/monteops_hw1/variant.cpp diff --git a/variants/monteops_hw1/variant.h b/variants/nrf52840/monteops_hw1/variant.h similarity index 100% rename from variants/monteops_hw1/variant.h rename to variants/nrf52840/monteops_hw1/variant.h diff --git a/variants/nano-g2-ultra/platformio.ini b/variants/nrf52840/nano-g2-ultra/platformio.ini similarity index 70% rename from variants/nano-g2-ultra/platformio.ini rename to variants/nrf52840/nano-g2-ultra/platformio.ini index 7da168b47..f697a90dd 100644 --- a/variants/nano-g2-ultra/platformio.ini +++ b/variants/nrf52840/nano-g2-ultra/platformio.ini @@ -4,8 +4,10 @@ extends = nrf52840_base board = nano-g2-ultra debug_tool = jlink -build_flags = ${nrf52840_base.build_flags} -Ivariants/nano-g2-ultra -D NANO_G2_ULTRA -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nano-g2-ultra> +build_flags = ${nrf52840_base.build_flags} + -I variants/nrf52840/nano-g2-ultra + -D NANO_G2_ULTRA +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/nano-g2-ultra> lib_deps = ${nrf52840_base.lib_deps} lewisxhe/PCF8563_Library@^1.0.1 diff --git a/variants/nano-g2-ultra/variant.cpp b/variants/nrf52840/nano-g2-ultra/variant.cpp similarity index 100% rename from variants/nano-g2-ultra/variant.cpp rename to variants/nrf52840/nano-g2-ultra/variant.cpp diff --git a/variants/nano-g2-ultra/variant.h b/variants/nrf52840/nano-g2-ultra/variant.h similarity index 100% rename from variants/nano-g2-ultra/variant.h rename to variants/nrf52840/nano-g2-ultra/variant.h diff --git a/variants/rak2560/platformio.ini b/variants/nrf52840/rak2560/platformio.ini similarity index 87% rename from variants/rak2560/platformio.ini rename to variants/nrf52840/rak2560/platformio.ini index 8a720ce5a..2b73aca03 100644 --- a/variants/rak2560/platformio.ini +++ b/variants/nrf52840/rak2560/platformio.ini @@ -3,13 +3,15 @@ extends = nrf52840_base board = wiscore_rak4631 board_check = true -build_flags = ${nrf52840_base.build_flags} -Ivariants/rak2560 -D RAK_4631 +build_flags = ${nrf52840_base.build_flags} + -I variants/nrf52840/rak2560 + -D RAK_4631 -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. -DRADIOLIB_EXCLUDE_SX128X=1 -DRADIOLIB_EXCLUDE_SX127X=1 -DRADIOLIB_EXCLUDE_LR11X0=1 -DHAS_RAKPROT=1 ; Define if RAk OneWireSerial is used (disables GPS) -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak2560> + + +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/rak2560> + + lib_deps = ${nrf52840_base.lib_deps} ${networking_base.lib_deps} diff --git a/variants/rak2560/variant.cpp b/variants/nrf52840/rak2560/variant.cpp similarity index 100% rename from variants/rak2560/variant.cpp rename to variants/nrf52840/rak2560/variant.cpp diff --git a/variants/rak2560/variant.h b/variants/nrf52840/rak2560/variant.h similarity index 100% rename from variants/rak2560/variant.h rename to variants/nrf52840/rak2560/variant.h diff --git a/variants/rak4631/platformio.ini b/variants/nrf52840/rak4631/platformio.ini similarity index 94% rename from variants/rak4631/platformio.ini rename to variants/nrf52840/rak4631/platformio.ini index ee134e87a..7b695779c 100644 --- a/variants/rak4631/platformio.ini +++ b/variants/nrf52840/rak4631/platformio.ini @@ -3,7 +3,9 @@ extends = nrf52840_base board = wiscore_rak4631 board_check = true -build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631 -D RAK_4631 +build_flags = ${nrf52840_base.build_flags} + -I variants/nrf52840/rak4631 + -D RAK_4631 -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. -DEINK_DISPLAY_MODEL=GxEPD2_213_BN -DEINK_WIDTH=250 @@ -11,7 +13,7 @@ build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631 -D RAK_4631 -DRADIOLIB_EXCLUDE_SX128X=1 -DRADIOLIB_EXCLUDE_SX127X=1 -DRADIOLIB_EXCLUDE_LR11X0=1 -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak4631> + + + +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/rak4631> + + + lib_deps = ${nrf52840_base.lib_deps} ${networking_base.lib_deps} diff --git a/variants/rak4631/variant.cpp b/variants/nrf52840/rak4631/variant.cpp similarity index 100% rename from variants/rak4631/variant.cpp rename to variants/nrf52840/rak4631/variant.cpp diff --git a/variants/rak4631/variant.h b/variants/nrf52840/rak4631/variant.h similarity index 100% rename from variants/rak4631/variant.h rename to variants/nrf52840/rak4631/variant.h diff --git a/variants/rak4631_epaper/platformio.ini b/variants/nrf52840/rak4631_epaper/platformio.ini similarity index 86% rename from variants/rak4631_epaper/platformio.ini rename to variants/nrf52840/rak4631_epaper/platformio.ini index 47e4451c7..704520f8d 100644 --- a/variants/rak4631_epaper/platformio.ini +++ b/variants/nrf52840/rak4631_epaper/platformio.ini @@ -2,14 +2,16 @@ [env:rak4631_eink] extends = nrf52840_base board = wiscore_rak4631 -build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631_epaper -D RAK_4631 +build_flags = ${nrf52840_base.build_flags} + -I variants/nrf52840/rak4631_epaper + -D RAK_4631 -DEINK_DISPLAY_MODEL=GxEPD2_213_BN -DEINK_WIDTH=250 -DEINK_HEIGHT=122 -DRADIOLIB_EXCLUDE_SX128X=1 -DRADIOLIB_EXCLUDE_SX127X=1 -DRADIOLIB_EXCLUDE_LR11X0=1 -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak4631_epaper> +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/rak4631_epaper> lib_deps = ${nrf52840_base.lib_deps} zinggjm/GxEPD2@^1.6.2 diff --git a/variants/rak4631_epaper/variant.cpp b/variants/nrf52840/rak4631_epaper/variant.cpp similarity index 100% rename from variants/rak4631_epaper/variant.cpp rename to variants/nrf52840/rak4631_epaper/variant.cpp diff --git a/variants/rak4631_epaper/variant.h b/variants/nrf52840/rak4631_epaper/variant.h similarity index 100% rename from variants/rak4631_epaper/variant.h rename to variants/nrf52840/rak4631_epaper/variant.h diff --git a/variants/rak4631_epaper_onrxtx/platformio.ini b/variants/nrf52840/rak4631_epaper_onrxtx/platformio.ini similarity index 87% rename from variants/rak4631_epaper_onrxtx/platformio.ini rename to variants/nrf52840/rak4631_epaper_onrxtx/platformio.ini index 52a13f2a7..e0156668b 100644 --- a/variants/rak4631_epaper_onrxtx/platformio.ini +++ b/variants/nrf52840/rak4631_epaper_onrxtx/platformio.ini @@ -3,7 +3,9 @@ board_level = extra extends = nrf52840_base board = wiscore_rak4631 -build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631_epaper -D RAK_4631 +build_flags = ${nrf52840_base.build_flags} + -I variants/nrf52840/rak4631_epaper + -D RAK_4631 -D PIN_EINK_EN=34 -D EINK_DISPLAY_MODEL=GxEPD2_213_BN -D EINK_WIDTH=250 @@ -11,7 +13,7 @@ build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631_epaper -D RAK_4631 -D RADIOLIB_EXCLUDE_SX128X=1 -D RADIOLIB_EXCLUDE_SX127X=1 -D RADIOLIB_EXCLUDE_LR11X0=1 -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak4631_epaper_onrxtx> +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/rak4631_epaper_onrxtx> lib_deps = ${nrf52840_base.lib_deps} zinggjm/GxEPD2@^1.6.2 diff --git a/variants/rak4631_epaper_onrxtx/variant.cpp b/variants/nrf52840/rak4631_epaper_onrxtx/variant.cpp similarity index 100% rename from variants/rak4631_epaper_onrxtx/variant.cpp rename to variants/nrf52840/rak4631_epaper_onrxtx/variant.cpp diff --git a/variants/rak4631_epaper_onrxtx/variant.h b/variants/nrf52840/rak4631_epaper_onrxtx/variant.h similarity index 100% rename from variants/rak4631_epaper_onrxtx/variant.h rename to variants/nrf52840/rak4631_epaper_onrxtx/variant.h diff --git a/variants/rak4631_eth_gw/platformio.ini b/variants/nrf52840/rak4631_eth_gw/platformio.ini similarity index 95% rename from variants/rak4631_eth_gw/platformio.ini rename to variants/nrf52840/rak4631_eth_gw/platformio.ini index 7e7b0e019..a1c1b4610 100644 --- a/variants/rak4631_eth_gw/platformio.ini +++ b/variants/nrf52840/rak4631_eth_gw/platformio.ini @@ -3,7 +3,9 @@ extends = nrf52840_base board = wiscore_rak4631 board_check = true -build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631_eth_gw -D RAK_4631 +build_flags = ${nrf52840_base.build_flags} + -I variants/nrf52840/rak4631_eth_gw + -D RAK_4631 -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. -DHAS_UDP_MULTICAST=1 -DEINK_DISPLAY_MODEL=GxEPD2_213_BN @@ -22,7 +24,7 @@ build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631_eth_gw -D RAK_4631 -DMESHTASTIC_EXCLUDE_STOREFORWARD=1 -DMESHTASTIC_EXCLUDE_CANNEDMESSAGES=1 -DMESHTASTIC_EXCLUDE_WAYPOINT=1 -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak4631_eth_gw> + + + +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/rak4631_eth_gw> + + + lib_deps = ${nrf52840_base.lib_deps} ${networking_base.lib_deps} diff --git a/variants/rak4631_eth_gw/variant.cpp b/variants/nrf52840/rak4631_eth_gw/variant.cpp similarity index 100% rename from variants/rak4631_eth_gw/variant.cpp rename to variants/nrf52840/rak4631_eth_gw/variant.cpp diff --git a/variants/rak4631_eth_gw/variant.h b/variants/nrf52840/rak4631_eth_gw/variant.h similarity index 100% rename from variants/rak4631_eth_gw/variant.h rename to variants/nrf52840/rak4631_eth_gw/variant.h diff --git a/variants/rak4631_nomadstar_meteor_pro/platformio.ini b/variants/nrf52840/rak4631_nomadstar_meteor_pro/platformio.ini similarity index 89% rename from variants/rak4631_nomadstar_meteor_pro/platformio.ini rename to variants/nrf52840/rak4631_nomadstar_meteor_pro/platformio.ini index d5fbe6a16..e94eef1ee 100644 --- a/variants/rak4631_nomadstar_meteor_pro/platformio.ini +++ b/variants/nrf52840/rak4631_nomadstar_meteor_pro/platformio.ini @@ -3,8 +3,9 @@ extends = nrf52840_base board = wiscore_rak4631 board_check = true -build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631_nomadstar_meteor_pro -D NOMADSTAR_METEOR_PRO - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" +build_flags = ${nrf52840_base.build_flags} + -I variants/nrf52840/rak4631_nomadstar_meteor_pro + -D NOMADSTAR_METEOR_PRO ;-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. -DEINK_DISPLAY_MODEL=GxEPD2_213_BN -DEINK_WIDTH=250 @@ -12,8 +13,8 @@ build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631_nomadstar_meteor_p -DRADIOLIB_EXCLUDE_SX128X=1 -DRADIOLIB_EXCLUDE_SX127X=1 -DRADIOLIB_EXCLUDE_LR11X0=1 -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak4631_nomadstar_meteor_pro> + + -lib_deps = +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/rak4631_nomadstar_meteor_pro> + + +lib_deps = ${nrf52840_base.lib_deps} https://github.com/NomadStar-outdoor/IOBoard-RGB-LP5562-Library.git#9c366c8 diff --git a/variants/rak4631_nomadstar_meteor_pro/variant.cpp b/variants/nrf52840/rak4631_nomadstar_meteor_pro/variant.cpp similarity index 100% rename from variants/rak4631_nomadstar_meteor_pro/variant.cpp rename to variants/nrf52840/rak4631_nomadstar_meteor_pro/variant.cpp diff --git a/variants/rak4631_nomadstar_meteor_pro/variant.h b/variants/nrf52840/rak4631_nomadstar_meteor_pro/variant.h similarity index 100% rename from variants/rak4631_nomadstar_meteor_pro/variant.h rename to variants/nrf52840/rak4631_nomadstar_meteor_pro/variant.h diff --git a/variants/rak_wismeshtag/platformio.ini b/variants/nrf52840/rak_wismeshtag/platformio.ini similarity index 71% rename from variants/rak_wismeshtag/platformio.ini rename to variants/nrf52840/rak_wismeshtag/platformio.ini index a066e5282..08e723302 100644 --- a/variants/rak_wismeshtag/platformio.ini +++ b/variants/nrf52840/rak_wismeshtag/platformio.ini @@ -3,13 +3,15 @@ extends = nrf52840_base board = wiscore_rak4631 board_check = true -build_flags = ${nrf52840_base.build_flags} -Ivariants/rak_wismeshtag -D WISMESH_TAG -D RAK_4631 - -L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" +build_flags = ${nrf52840_base.build_flags} + -I variants/nrf52840/rak_wismeshtag + -D WISMESH_TAG + -D RAK_4631 -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. -DRADIOLIB_EXCLUDE_SX128X=1 -DRADIOLIB_EXCLUDE_SX127X=1 -DRADIOLIB_EXCLUDE_LR11X0=1 -DMESHTASTIC_EXCLUDE_WIFI=1 -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak_wismeshtag> -lib_deps = +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/rak_wismeshtag> +lib_deps = ${nrf52840_base.lib_deps} \ No newline at end of file diff --git a/variants/rak_wismeshtag/variant.cpp b/variants/nrf52840/rak_wismeshtag/variant.cpp similarity index 100% rename from variants/rak_wismeshtag/variant.cpp rename to variants/nrf52840/rak_wismeshtag/variant.cpp diff --git a/variants/rak_wismeshtag/variant.h b/variants/nrf52840/rak_wismeshtag/variant.h similarity index 99% rename from variants/rak_wismeshtag/variant.h rename to variants/nrf52840/rak_wismeshtag/variant.h index dd82b76a1..eba910dc1 100644 --- a/variants/rak_wismeshtag/variant.h +++ b/variants/nrf52840/rak_wismeshtag/variant.h @@ -150,7 +150,6 @@ static const uint8_t SCK = PIN_SPI_SCK; #define PIN_QSPI_IO2 28 #define PIN_QSPI_IO3 2 - /* @note RAK5005-O GPIO mapping to RAK4631 GPIO ports RAK5005-O <-> nRF52840 IO1 <-> P0.17 (Arduino GPIO number 17) @@ -219,7 +218,7 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG #define GPS_TX_PIN PIN_SERIAL1_TX // RAK WISMESHTAG -#define PIN_BUZZER 21 +#define PIN_BUZZER 21 // Battery // The battery sense is hooked to pin A0 (5) diff --git a/variants/rak_wismeshtap/platformio.ini b/variants/nrf52840/rak_wismeshtap/platformio.ini similarity index 87% rename from variants/rak_wismeshtap/platformio.ini rename to variants/nrf52840/rak_wismeshtap/platformio.ini index bfb3ea927..f6ee8fd23 100644 --- a/variants/rak_wismeshtap/platformio.ini +++ b/variants/nrf52840/rak_wismeshtap/platformio.ini @@ -2,7 +2,10 @@ [env:rak_wismeshtap] extends = nrf52840_base board = wiscore_rak4631 -build_flags = ${nrf52840_base.build_flags} -Ivariants/rak_wismeshtap -DWISMESH_TAP -DRAK_4631 +build_flags = ${nrf52840_base.build_flags} + -Ivariants/nrf52840/rak_wismeshtap + -DWISMESH_TAP + -DRAK_4631 -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. -DEINK_DISPLAY_MODEL=GxEPD2_213_BN -DEINK_WIDTH=250 @@ -12,7 +15,7 @@ build_flags = ${nrf52840_base.build_flags} -Ivariants/rak_wismeshtap -DWISMESH_T -DMESHTASTIC_EXCLUDE_STOREFORWARD=1 -DMESHTASTIC_EXCLUDE_POWER_TELEMETRY=1 -DMESHTASTIC_EXCLUDE_ATAK=1 -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak_wismeshtap> + + + +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/rak_wismeshtap> + + + lib_deps = ${nrf52840_base.lib_deps} ${networking_base.lib_deps} diff --git a/variants/rak_wismeshtap/variant.cpp b/variants/nrf52840/rak_wismeshtap/variant.cpp similarity index 100% rename from variants/rak_wismeshtap/variant.cpp rename to variants/nrf52840/rak_wismeshtap/variant.cpp diff --git a/variants/rak_wismeshtap/variant.h b/variants/nrf52840/rak_wismeshtap/variant.h similarity index 100% rename from variants/rak_wismeshtap/variant.h rename to variants/nrf52840/rak_wismeshtap/variant.h diff --git a/variants/seeed_solar_node/platformio.ini b/variants/nrf52840/seeed_solar_node/platformio.ini similarity index 70% rename from variants/seeed_solar_node/platformio.ini rename to variants/nrf52840/seeed_solar_node/platformio.ini index eb91a435f..b2a128c57 100644 --- a/variants/seeed_solar_node/platformio.ini +++ b/variants/nrf52840/seeed_solar_node/platformio.ini @@ -3,11 +3,12 @@ board = seeed_solar_node extends = nrf52840_base ;board_level = extra build_flags = ${nrf52840_base.build_flags} - -I $PROJECT_DIR/variants/seeed_solar_node + -I variants/nrf52840/seeed_solar_node -D SEEED_SOLAR_NODE - -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 + -I src/platform/nrf52/softdevice + -I src/platform/nrf52/softdevice/nrf52 board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/seeed_solar_node> +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/seeed_solar_node> lib_deps = ${nrf52840_base.lib_deps} debug_tool = jlink diff --git a/variants/seeed_solar_node/variant.cpp b/variants/nrf52840/seeed_solar_node/variant.cpp similarity index 100% rename from variants/seeed_solar_node/variant.cpp rename to variants/nrf52840/seeed_solar_node/variant.cpp diff --git a/variants/seeed_solar_node/variant.h b/variants/nrf52840/seeed_solar_node/variant.h similarity index 100% rename from variants/seeed_solar_node/variant.h rename to variants/nrf52840/seeed_solar_node/variant.h diff --git a/variants/seeed_wio_tracker_L1/platformio.ini b/variants/nrf52840/seeed_wio_tracker_L1/platformio.ini similarity index 61% rename from variants/seeed_wio_tracker_L1/platformio.ini rename to variants/nrf52840/seeed_wio_tracker_L1/platformio.ini index 3c4653d7e..6c137384d 100644 --- a/variants/seeed_wio_tracker_L1/platformio.ini +++ b/variants/nrf52840/seeed_wio_tracker_L1/platformio.ini @@ -1,13 +1,13 @@ [env:seeed_wio_tracker_L1] board = seeed_wio_tracker_L1 extends = nrf52840_base -;board_level = extra build_flags = ${nrf52840_base.build_flags} - -I $PROJECT_DIR/variants/seeed_wio_tracker_L1 - -D SEEED_WIO_TRACKER_L1 - -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 + -I variants/nrf52840/seeed_wio_tracker_L1 + -D SEEED_WIO_TRACKER_L1 + -I src/platform/nrf52/softdevice + -I src/platform/nrf52/softdevice/nrf52 board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/seeed_wio_tracker_L1> +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/seeed_wio_tracker_L1> lib_deps = ${nrf52840_base.lib_deps} debug_tool = jlink diff --git a/variants/seeed_wio_tracker_L1/variant.cpp b/variants/nrf52840/seeed_wio_tracker_L1/variant.cpp similarity index 100% rename from variants/seeed_wio_tracker_L1/variant.cpp rename to variants/nrf52840/seeed_wio_tracker_L1/variant.cpp diff --git a/variants/seeed_wio_tracker_L1/variant.h b/variants/nrf52840/seeed_wio_tracker_L1/variant.h similarity index 100% rename from variants/seeed_wio_tracker_L1/variant.h rename to variants/nrf52840/seeed_wio_tracker_L1/variant.h diff --git a/variants/seeed_wio_tracker_L1_eink/nicheGraphics.h b/variants/nrf52840/seeed_wio_tracker_L1_eink/nicheGraphics.h similarity index 100% rename from variants/seeed_wio_tracker_L1_eink/nicheGraphics.h rename to variants/nrf52840/seeed_wio_tracker_L1_eink/nicheGraphics.h diff --git a/variants/seeed_wio_tracker_L1_eink/platformio.ini b/variants/nrf52840/seeed_wio_tracker_L1_eink/platformio.ini similarity index 59% rename from variants/seeed_wio_tracker_L1_eink/platformio.ini rename to variants/nrf52840/seeed_wio_tracker_L1_eink/platformio.ini index b310cce83..52ff39d49 100644 --- a/variants/seeed_wio_tracker_L1_eink/platformio.ini +++ b/variants/nrf52840/seeed_wio_tracker_L1_eink/platformio.ini @@ -2,13 +2,15 @@ board = seeed_wio_tracker_L1 extends = nrf52840_base, inkhud ;board_level = extra -build_flags = ${nrf52840_base.build_flags} ${inkhud.build_flags} - -I $PROJECT_DIR/variants/seeed_wio_tracker_L1_eink +build_flags = ${nrf52840_base.build_flags} + ${inkhud.build_flags} + -I variants/nrf52840/seeed_wio_tracker_L1_eink -D SEEED_WIO_TRACKER_L1_EINK -D SEEED_WIO_TRACKER_L1 - -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 + -I src/platform/nrf52/softdevice + -I src/platform/nrf52/softdevice/nrf52 board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/seeed_wio_tracker_L1_eink> ${inkhud.build_src_filter} +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/seeed_wio_tracker_L1_eink> ${inkhud.build_src_filter} lib_deps = ${inkhud.lib_deps} ${nrf52840_base.lib_deps} diff --git a/variants/seeed_wio_tracker_L1_eink/variant.cpp b/variants/nrf52840/seeed_wio_tracker_L1_eink/variant.cpp similarity index 100% rename from variants/seeed_wio_tracker_L1_eink/variant.cpp rename to variants/nrf52840/seeed_wio_tracker_L1_eink/variant.cpp diff --git a/variants/seeed_wio_tracker_L1_eink/variant.h b/variants/nrf52840/seeed_wio_tracker_L1_eink/variant.h similarity index 100% rename from variants/seeed_wio_tracker_L1_eink/variant.h rename to variants/nrf52840/seeed_wio_tracker_L1_eink/variant.h diff --git a/variants/seeed_xiao_nrf52840_kit/platformio.ini b/variants/nrf52840/seeed_xiao_nrf52840_kit/platformio.ini similarity index 66% rename from variants/seeed_xiao_nrf52840_kit/platformio.ini rename to variants/nrf52840/seeed_xiao_nrf52840_kit/platformio.ini index 0e1e94cd5..27352875d 100644 --- a/variants/seeed_xiao_nrf52840_kit/platformio.ini +++ b/variants/nrf52840/seeed_xiao_nrf52840_kit/platformio.ini @@ -2,9 +2,14 @@ [env:seeed_xiao_nrf52840_kit] extends = nrf52840_base board = xiao_ble_sense -build_flags = ${nrf52840_base.build_flags} -Ivariants/seeed_xiao_nrf52840_kit -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DSEEED_XIAO_NRF52840_KIT -DGPS_L76K +build_flags = ${nrf52840_base.build_flags} + -Ivariants/nrf52840/seeed_xiao_nrf52840_kit + -Isrc/platform/nrf52/softdevice + -Isrc/platform/nrf52/softdevice/nrf52 + -DSEEED_XIAO_NRF52840_KIT + -DGPS_L76K board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/seeed_xiao_nrf52840_kit> +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/seeed_xiao_nrf52840_kit> lib_deps = ${nrf52840_base.lib_deps} debug_tool = jlink diff --git a/variants/seeed_xiao_nrf52840_kit/variant.cpp b/variants/nrf52840/seeed_xiao_nrf52840_kit/variant.cpp similarity index 100% rename from variants/seeed_xiao_nrf52840_kit/variant.cpp rename to variants/nrf52840/seeed_xiao_nrf52840_kit/variant.cpp diff --git a/variants/seeed_xiao_nrf52840_kit/variant.h b/variants/nrf52840/seeed_xiao_nrf52840_kit/variant.h similarity index 100% rename from variants/seeed_xiao_nrf52840_kit/variant.h rename to variants/nrf52840/seeed_xiao_nrf52840_kit/variant.h diff --git a/variants/t-echo/nicheGraphics.h b/variants/nrf52840/t-echo/nicheGraphics.h similarity index 100% rename from variants/t-echo/nicheGraphics.h rename to variants/nrf52840/t-echo/nicheGraphics.h diff --git a/variants/t-echo/platformio.ini b/variants/nrf52840/t-echo/platformio.ini similarity index 89% rename from variants/t-echo/platformio.ini rename to variants/nrf52840/t-echo/platformio.ini index 85c3b5799..b80958d5d 100644 --- a/variants/t-echo/platformio.ini +++ b/variants/nrf52840/t-echo/platformio.ini @@ -6,7 +6,8 @@ board_check = true debug_tool = jlink # add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling. -build_flags = ${nrf52840_base.build_flags} -Ivariants/t-echo +build_flags = ${nrf52840_base.build_flags} + -Ivariants/nrf52840/t-echo -DGPS_POWER_TOGGLE -DEINK_DISPLAY_MODEL=GxEPD2_154_D67 -DEINK_WIDTH=200 @@ -16,7 +17,7 @@ build_flags = ${nrf52840_base.build_flags} -Ivariants/t-echo -DEINK_LIMIT_FASTREFRESH=20 ; How many consecutive fast-refreshes are permitted -DEINK_BACKGROUND_USES_FAST ; (Optional) Use FAST refresh for both BACKGROUND and RESPONSIVE, until a limit is reached. -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/t-echo> +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/t-echo> lib_deps = ${nrf52840_base.lib_deps} https://github.com/meshtastic/GxEPD2/archive/55f618961db45a23eff0233546430f1e5a80f63a.zip @@ -31,11 +32,11 @@ debug_tool = jlink build_flags = ${nrf52840_base.build_flags} ${inkhud.build_flags} - -I variants/t-echo + -I variants/nrf52840/t-echo build_src_filter = ${nrf52_base.build_src_filter} ${inkhud.build_src_filter} - +<../variants/t-echo> + +<../variants/nrf52840/t-echo> lib_deps = ${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX ${nrf52840_base.lib_deps} diff --git a/variants/t-echo/variant.cpp b/variants/nrf52840/t-echo/variant.cpp similarity index 100% rename from variants/t-echo/variant.cpp rename to variants/nrf52840/t-echo/variant.cpp diff --git a/variants/t-echo/variant.h b/variants/nrf52840/t-echo/variant.h similarity index 100% rename from variants/t-echo/variant.h rename to variants/nrf52840/t-echo/variant.h diff --git a/variants/tracker-t1000-e/platformio.ini b/variants/nrf52840/tracker-t1000-e/platformio.ini similarity index 78% rename from variants/tracker-t1000-e/platformio.ini rename to variants/nrf52840/tracker-t1000-e/platformio.ini index b1f11d524..45c8c5d00 100644 --- a/variants/tracker-t1000-e/platformio.ini +++ b/variants/nrf52840/tracker-t1000-e/platformio.ini @@ -1,7 +1,11 @@ [env:tracker-t1000-e] extends = nrf52840_base board = tracker-t1000-e -build_flags = ${nrf52840_base.build_flags} -Ivariants/tracker-t1000-e -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DTRACKER_T1000_E +build_flags = ${nrf52840_base.build_flags} + -Ivariants/nrf52840/tracker-t1000-e + -Isrc/platform/nrf52/softdevice + -Isrc/platform/nrf52/softdevice/nrf52 + -DTRACKER_T1000_E -DGPS_POWER_TOGGLE -DMESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR_EXTERNAL=1 -DMESHTASTIC_EXCLUDE_CANNEDMESSAGES=1 @@ -9,7 +13,7 @@ build_flags = ${nrf52840_base.build_flags} -Ivariants/tracker-t1000-e -Isrc/plat -DMESHTASTIC_EXCLUDE_DETECTIONSENSOR=1 -DMESHTASTIC_EXCLUDE_WIFI=1 board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/tracker-t1000-e> +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/tracker-t1000-e> lib_deps = ${nrf52840_base.lib_deps} https://github.com/meshtastic/QMA6100P_Arduino_Library/archive/14c900b8b2e4feaac5007a7e41e0c1b7f0841136.zip diff --git a/variants/tracker-t1000-e/rfswitch.h b/variants/nrf52840/tracker-t1000-e/rfswitch.h similarity index 100% rename from variants/tracker-t1000-e/rfswitch.h rename to variants/nrf52840/tracker-t1000-e/rfswitch.h diff --git a/variants/tracker-t1000-e/variant.cpp b/variants/nrf52840/tracker-t1000-e/variant.cpp similarity index 100% rename from variants/tracker-t1000-e/variant.cpp rename to variants/nrf52840/tracker-t1000-e/variant.cpp diff --git a/variants/tracker-t1000-e/variant.h b/variants/nrf52840/tracker-t1000-e/variant.h similarity index 100% rename from variants/tracker-t1000-e/variant.h rename to variants/nrf52840/tracker-t1000-e/variant.h diff --git a/variants/wio-sdk-wm1110/platformio.ini b/variants/nrf52840/wio-sdk-wm1110/platformio.ini similarity index 80% rename from variants/wio-sdk-wm1110/platformio.ini rename to variants/nrf52840/wio-sdk-wm1110/platformio.ini index 4e1415678..2c65246b8 100644 --- a/variants/wio-sdk-wm1110/platformio.ini +++ b/variants/nrf52840/wio-sdk-wm1110/platformio.ini @@ -4,16 +4,20 @@ extends = nrf52840_base board = wio-sdk-wm1110 extra_scripts = - bin/platformio-custom.py + ${env.extra_scripts} extra_scripts/disable_adafruit_usb.py # Remove adafruit USB serial from the build (it is incompatible with using the ch340 serial chip on this board) build_unflags = ${nrf52840_base:build_unflags} -DUSBCON -DUSE_TINYUSB -build_flags = ${nrf52840_base.build_flags} -Ivariants/wio-sdk-wm1110 -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DWIO_WM1110 +build_flags = ${nrf52840_base.build_flags} + -Ivariants/nrf52840/wio-sdk-wm1110 + -Isrc/platform/nrf52/softdevice + -Isrc/platform/nrf52/softdevice/nrf52 + -DWIO_WM1110 -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. -DCFG_TUD_CDC=0 board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/wio-sdk-wm1110> +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/wio-sdk-wm1110> ;debug_tool = jlink debug_tool = stlink diff --git a/variants/wio-sdk-wm1110/rfswitch.h b/variants/nrf52840/wio-sdk-wm1110/rfswitch.h similarity index 100% rename from variants/wio-sdk-wm1110/rfswitch.h rename to variants/nrf52840/wio-sdk-wm1110/rfswitch.h diff --git a/variants/wio-sdk-wm1110/variant.cpp b/variants/nrf52840/wio-sdk-wm1110/variant.cpp similarity index 100% rename from variants/wio-sdk-wm1110/variant.cpp rename to variants/nrf52840/wio-sdk-wm1110/variant.cpp diff --git a/variants/wio-sdk-wm1110/variant.h b/variants/nrf52840/wio-sdk-wm1110/variant.h similarity index 100% rename from variants/wio-sdk-wm1110/variant.h rename to variants/nrf52840/wio-sdk-wm1110/variant.h diff --git a/variants/wio-t1000-s/platformio.ini b/variants/nrf52840/wio-t1000-s/platformio.ini similarity index 77% rename from variants/wio-t1000-s/platformio.ini rename to variants/nrf52840/wio-t1000-s/platformio.ini index 2eab1e1c5..3594bcf07 100644 --- a/variants/wio-t1000-s/platformio.ini +++ b/variants/nrf52840/wio-t1000-s/platformio.ini @@ -3,10 +3,14 @@ extends = nrf52840_base board = wio-t1000-s board_level = extra -build_flags = ${nrf52840_base.build_flags} -Ivariants/wio-t1000-s -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DWIO_WM1110 +build_flags = ${nrf52840_base.build_flags} + -Ivariants/nrf52840/wio-t1000-s + -Isrc/platform/nrf52/softdevice + -Isrc/platform/nrf52/softdevice/nrf52 + -DWIO_WM1110 -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/wio-t1000-s> +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/wio-t1000-s> lib_deps = ${nrf52840_base.lib_deps} debug_tool = jlink diff --git a/variants/wio-t1000-s/rfswitch.h b/variants/nrf52840/wio-t1000-s/rfswitch.h similarity index 100% rename from variants/wio-t1000-s/rfswitch.h rename to variants/nrf52840/wio-t1000-s/rfswitch.h diff --git a/variants/wio-t1000-s/variant.cpp b/variants/nrf52840/wio-t1000-s/variant.cpp similarity index 100% rename from variants/wio-t1000-s/variant.cpp rename to variants/nrf52840/wio-t1000-s/variant.cpp diff --git a/variants/wio-t1000-s/variant.h b/variants/nrf52840/wio-t1000-s/variant.h similarity index 100% rename from variants/wio-t1000-s/variant.h rename to variants/nrf52840/wio-t1000-s/variant.h diff --git a/variants/wio-tracker-wm1110/platformio.ini b/variants/nrf52840/wio-tracker-wm1110/platformio.ini similarity index 73% rename from variants/wio-tracker-wm1110/platformio.ini rename to variants/nrf52840/wio-tracker-wm1110/platformio.ini index a6960b435..b383043bb 100644 --- a/variants/wio-tracker-wm1110/platformio.ini +++ b/variants/nrf52840/wio-tracker-wm1110/platformio.ini @@ -2,10 +2,14 @@ [env:wio-tracker-wm1110] extends = nrf52840_base board = wio-tracker-wm1110 -build_flags = ${nrf52840_base.build_flags} -Ivariants/wio-tracker-wm1110 -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DWIO_WM1110 +build_flags = ${nrf52840_base.build_flags} + -Ivariants/nrf52840/wio-tracker-wm1110 + -Isrc/platform/nrf52/softdevice + -Isrc/platform/nrf52/softdevice/nrf52 + -DWIO_WM1110 -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/wio-tracker-wm1110> +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/wio-tracker-wm1110> lib_deps = ${nrf52840_base.lib_deps} ; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm) diff --git a/variants/wio-tracker-wm1110/rfswitch.h b/variants/nrf52840/wio-tracker-wm1110/rfswitch.h similarity index 100% rename from variants/wio-tracker-wm1110/rfswitch.h rename to variants/nrf52840/wio-tracker-wm1110/rfswitch.h diff --git a/variants/wio-tracker-wm1110/variant.cpp b/variants/nrf52840/wio-tracker-wm1110/variant.cpp similarity index 100% rename from variants/wio-tracker-wm1110/variant.cpp rename to variants/nrf52840/wio-tracker-wm1110/variant.cpp diff --git a/variants/wio-tracker-wm1110/variant.h b/variants/nrf52840/wio-tracker-wm1110/variant.h similarity index 100% rename from variants/wio-tracker-wm1110/variant.h rename to variants/nrf52840/wio-tracker-wm1110/variant.h From 29449a71d46daf3430868689521d8b642a82c7b4 Mon Sep 17 00:00:00 2001 From: whywilson Date: Mon, 21 Jul 2025 06:49:08 +0800 Subject: [PATCH 045/180] When outputting RTTTL ringtones, you can still hear a periodic buzzing sound. This problem is fixed in this commit. --- src/modules/ExternalNotificationModule.cpp | 32 +++++++++++++++------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/src/modules/ExternalNotificationModule.cpp b/src/modules/ExternalNotificationModule.cpp index 5d7233279..1f871f87e 100644 --- a/src/modules/ExternalNotificationModule.cpp +++ b/src/modules/ExternalNotificationModule.cpp @@ -126,9 +126,11 @@ int32_t ExternalNotificationModule::runOnce() millis()) { setExternalState(1, !getExternal(1)); } - if (externalTurnedOn[2] + (moduleConfig.external_notification.output_ms ? moduleConfig.external_notification.output_ms + // Only toggle buzzer output if not using PWM mode (to avoid conflict with RTTTL) + if (!moduleConfig.external_notification.use_pwm && + externalTurnedOn[2] + (moduleConfig.external_notification.output_ms ? moduleConfig.external_notification.output_ms : EXT_NOTIFICATION_MODULE_OUTPUT_MS) < - millis()) { + millis()) { LOG_DEBUG("EXTERNAL 2 %d compared to %d", externalTurnedOn[2] + moduleConfig.external_notification.output_ms, millis()); setExternalState(2, !getExternal(2)); @@ -247,7 +249,8 @@ void ExternalNotificationModule::setExternalState(uint8_t index, bool on) digitalWrite(moduleConfig.external_notification.output_vibra, on); break; case 2: - if (moduleConfig.external_notification.output_buzzer) + // Only control buzzer pin digitally if not using PWM mode + if (moduleConfig.external_notification.output_buzzer && !moduleConfig.external_notification.use_pwm) digitalWrite(moduleConfig.external_notification.output_buzzer, on); break; default: @@ -320,6 +323,11 @@ void ExternalNotificationModule::stopNow() #endif nagCycleCutoff = 1; // small value isNagging = false; + // Turn off all outputs + for (int i = 0; i < 3; i++) { + setExternalState(i, false); + externalTurnedOn[i] = 0; + } setIntervalFromNow(0); #ifdef T_WATCH_S3 drv.stop(); @@ -478,14 +486,17 @@ ProcessMessage ExternalNotificationModule::handleReceived(const meshtastic_MeshP if (containsBell) { LOG_INFO("externalNotificationModule - Notification Bell (Buzzer)"); isNagging = true; - if (!moduleConfig.external_notification.use_pwm) { + if (!moduleConfig.external_notification.use_pwm && !moduleConfig.external_notification.use_i2s_as_buzzer) { setExternalState(2, true); } else { #ifdef HAS_I2S - audioThread->beginRttl(rtttlConfig.ringtone, strlen_P(rtttlConfig.ringtone)); -#else - rtttl::begin(config.device.buzzer_gpio, rtttlConfig.ringtone); + if (moduleConfig.external_notification.use_i2s_as_buzzer) { + audioThread->beginRttl(rtttlConfig.ringtone, strlen_P(rtttlConfig.ringtone)); + } else #endif + if (moduleConfig.external_notification.use_pwm) { + rtttl::begin(config.device.buzzer_gpio, rtttlConfig.ringtone); + } } if (moduleConfig.external_notification.nag_timeout) { nagCycleCutoff = millis() + moduleConfig.external_notification.nag_timeout * 1000; @@ -526,10 +537,11 @@ ProcessMessage ExternalNotificationModule::handleReceived(const meshtastic_MeshP #ifdef HAS_I2S if (moduleConfig.external_notification.use_i2s_as_buzzer) { audioThread->beginRttl(rtttlConfig.ringtone, strlen_P(rtttlConfig.ringtone)); - } -#else - rtttl::begin(config.device.buzzer_gpio, rtttlConfig.ringtone); + } else #endif + if (moduleConfig.external_notification.use_pwm) { + rtttl::begin(config.device.buzzer_gpio, rtttlConfig.ringtone); + } } if (moduleConfig.external_notification.nag_timeout) { nagCycleCutoff = millis() + moduleConfig.external_notification.nag_timeout * 1000; From 6c12baf4ed11fa42ee6ef997f55da63e39fd84db Mon Sep 17 00:00:00 2001 From: Austin Date: Mon, 21 Jul 2025 20:28:14 -0400 Subject: [PATCH 046/180] Migrate remaining variants to new dir structure (#7412) --- platformio.ini | 1 - variants/{ => esp32c6}/tlora_c6/platformio.ini | 2 +- variants/{ => esp32c6}/tlora_c6/variant.h | 0 variants/{ => esp32s3}/mesh-tab/pins_arduino.h | 0 variants/{ => esp32s3}/mesh-tab/platformio.ini | 2 +- variants/{ => esp32s3}/mesh-tab/variant.h | 0 variants/{ => native}/portduino-buildroot/platformio.ini | 2 +- variants/{ => native}/portduino-buildroot/variant.h | 0 variants/{ => native}/portduino/platformio.ini | 2 +- variants/{ => native}/portduino/variant.h | 0 10 files changed, 4 insertions(+), 5 deletions(-) rename variants/{ => esp32c6}/tlora_c6/platformio.ini (85%) rename variants/{ => esp32c6}/tlora_c6/variant.h (100%) rename variants/{ => esp32s3}/mesh-tab/pins_arduino.h (100%) rename variants/{ => esp32s3}/mesh-tab/platformio.ini (99%) rename variants/{ => esp32s3}/mesh-tab/variant.h (100%) rename variants/{ => native}/portduino-buildroot/platformio.ini (75%) rename variants/{ => native}/portduino-buildroot/variant.h (100%) rename variants/{ => native}/portduino/platformio.ini (97%) rename variants/{ => native}/portduino/variant.h (100%) diff --git a/platformio.ini b/platformio.ini index c0eb6fedb..ad7100efd 100644 --- a/platformio.ini +++ b/platformio.ini @@ -6,7 +6,6 @@ default_envs = tbeam extra_configs = arch/*/*.ini - variants/*/platformio.ini ; Remove when all variants migrated to new dir structure variants/*/*/platformio.ini variants/*/diy/*/platformio.ini src/graphics/niche/InkHUD/PlatformioConfig.ini diff --git a/variants/tlora_c6/platformio.ini b/variants/esp32c6/tlora_c6/platformio.ini similarity index 85% rename from variants/tlora_c6/platformio.ini rename to variants/esp32c6/tlora_c6/platformio.ini index 2da10138a..a06306add 100644 --- a/variants/tlora_c6/platformio.ini +++ b/variants/esp32c6/tlora_c6/platformio.ini @@ -4,6 +4,6 @@ board = esp32-c6-devkitm-1 build_flags = ${esp32c6_base.build_flags} -D TLORA_C6 - -I variants/tlora_c6 + -I variants/esp32c6/tlora_c6 -DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_USB_MODE=1 diff --git a/variants/tlora_c6/variant.h b/variants/esp32c6/tlora_c6/variant.h similarity index 100% rename from variants/tlora_c6/variant.h rename to variants/esp32c6/tlora_c6/variant.h diff --git a/variants/mesh-tab/pins_arduino.h b/variants/esp32s3/mesh-tab/pins_arduino.h similarity index 100% rename from variants/mesh-tab/pins_arduino.h rename to variants/esp32s3/mesh-tab/pins_arduino.h diff --git a/variants/mesh-tab/platformio.ini b/variants/esp32s3/mesh-tab/platformio.ini similarity index 99% rename from variants/mesh-tab/platformio.ini rename to variants/esp32s3/mesh-tab/platformio.ini index 52f9fc13c..e21bc38e1 100644 --- a/variants/mesh-tab/platformio.ini +++ b/variants/esp32s3/mesh-tab/platformio.ini @@ -45,7 +45,7 @@ build_flags = ${esp32s3_base.build_flags} -D LGFX_TOUCH_INT=41 -D VIEW_320x240 -D USE_PACKET_API - -I variants/mesh-tab + -I variants/esp32s3/mesh-tab build_src_filter = ${esp32_base.build_src_filter} lib_deps = ${esp32_base.lib_deps} diff --git a/variants/mesh-tab/variant.h b/variants/esp32s3/mesh-tab/variant.h similarity index 100% rename from variants/mesh-tab/variant.h rename to variants/esp32s3/mesh-tab/variant.h diff --git a/variants/portduino-buildroot/platformio.ini b/variants/native/portduino-buildroot/platformio.ini similarity index 75% rename from variants/portduino-buildroot/platformio.ini rename to variants/native/portduino-buildroot/platformio.ini index 3fbd26910..d1bd39e10 100644 --- a/variants/portduino-buildroot/platformio.ini +++ b/variants/native/portduino-buildroot/platformio.ini @@ -2,7 +2,7 @@ extends = portduino_base ; Optional libraries should be appended to `PLATFORMIO_BUILD_FLAGS` ; environment variable in the buildroot environment. -build_flags = ${portduino_base.build_flags} -O0 -I variants/portduino-buildroot +build_flags = ${portduino_base.build_flags} -O0 -I variants/native/portduino-buildroot board = buildroot lib_deps = ${portduino_base.lib_deps} build_src_filter = ${portduino_base.build_src_filter} \ No newline at end of file diff --git a/variants/portduino-buildroot/variant.h b/variants/native/portduino-buildroot/variant.h similarity index 100% rename from variants/portduino-buildroot/variant.h rename to variants/native/portduino-buildroot/variant.h diff --git a/variants/portduino/platformio.ini b/variants/native/portduino/platformio.ini similarity index 97% rename from variants/portduino/platformio.ini rename to variants/native/portduino/platformio.ini index 5293b12b9..732b2a1d4 100644 --- a/variants/portduino/platformio.ini +++ b/variants/native/portduino/platformio.ini @@ -1,6 +1,6 @@ [native_base] extends = portduino_base -build_flags = ${portduino_base.build_flags} -I variants/portduino +build_flags = ${portduino_base.build_flags} -I variants/native/portduino -D ARCH_PORTDUINO -I /usr/include board = cross_platform diff --git a/variants/portduino/variant.h b/variants/native/portduino/variant.h similarity index 100% rename from variants/portduino/variant.h rename to variants/native/portduino/variant.h From fff12979a2676441fcbd29299ba14cb00a2831c5 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Mon, 21 Jul 2025 19:31:07 -0500 Subject: [PATCH 047/180] Set canned_message.enabled to true when setting defaults (#7414) * Set canned_message.enabled to true when setting defaults * Re-split canned messages on update --- src/modules/CannedMessageModule.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index 2a4f1cf4d..ed930db41 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -56,6 +56,7 @@ CannedMessageModule::CannedMessageModule() disable(); } else { LOG_INFO("CannedMessageModule is enabled"); + moduleConfig.canned_message.enabled = true; this->inputObserver.observe(inputBroker); } } @@ -2075,6 +2076,9 @@ void CannedMessageModule::handleSetCannedMessageModuleMessages(const char *from_ if (changed) { this->saveProtoForModule(); + if (splitConfiguredMessages()) { + moduleConfig.canned_message.enabled = true; + } } } From 86960cdb1da072b7ac8bd4561296b3baaf78d414 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Tue, 22 Jul 2025 06:21:51 -0500 Subject: [PATCH 048/180] Moves the shutdown thread into the Power class, make shutdown and reboot private (#7415) --- src/Power.cpp | 46 ++++++++++++++++++++++++++++++++++++++++++++++ src/PowerFSM.cpp | 2 +- src/main.cpp | 3 +-- src/power.h | 4 +++- src/shutdown.h | 47 ----------------------------------------------- 5 files changed, 51 insertions(+), 51 deletions(-) delete mode 100644 src/shutdown.h diff --git a/src/Power.cpp b/src/Power.cpp index 298f08e0d..b489bc33c 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -20,6 +20,11 @@ #include "meshUtils.h" #include "sleep.h" +#if defined(ARCH_PORTDUINO) +#include "api/WiFiServerAPI.h" +#include "input/LinuxInputImpl.h" +#endif + // Working USB detection for powered/charging states on the RAK platform #ifdef NRF_APM #include "nrfx_power.h" @@ -690,6 +695,47 @@ bool Power::setup() return found; } +void Power::powerCommandsCheck() +{ + if (rebootAtMsec && millis() > rebootAtMsec) { + LOG_INFO("Rebooting"); + reboot(); + } + + if (shutdownAtMsec && millis() > shutdownAtMsec) { + shutdownAtMsec = 0; + shutdown(); + } +} + +void Power::reboot() +{ + notifyReboot.notifyObservers(NULL); +#if defined(ARCH_ESP32) + ESP.restart(); +#elif defined(ARCH_NRF52) + NVIC_SystemReset(); +#elif defined(ARCH_RP2040) + rp2040.reboot(); +#elif defined(ARCH_PORTDUINO) + deInitApiServer(); + if (aLinuxInputImpl) + aLinuxInputImpl->deInit(); + SPI.end(); + Wire.end(); + Serial1.end(); + if (screen) + delete screen; + LOG_DEBUG("final reboot!"); + reboot(); +#elif defined(ARCH_STM32WL) + HAL_NVIC_SystemReset(); +#else + rebootAtMsec = -1; + LOG_WARN("FIXME implement reboot for this platform. Note that some settings require a restart to be applied"); +#endif +} + void Power::shutdown() { diff --git a/src/PowerFSM.cpp b/src/PowerFSM.cpp index 3b3f8080d..322b877ff 100644 --- a/src/PowerFSM.cpp +++ b/src/PowerFSM.cpp @@ -72,7 +72,7 @@ extern Power *power; static void shutdownEnter() { LOG_DEBUG("State: SHUTDOWN"); - power->shutdown(); + shutdownAtMsec = millis(); } #include "error.h" diff --git a/src/main.cpp b/src/main.cpp index c3e7c2a33..1868d98c7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -33,7 +33,6 @@ #include "mesh/generated/meshtastic/config.pb.h" #include "meshUtils.h" #include "modules/Modules.h" -#include "shutdown.h" #include "sleep.h" #include "target_specific.h" #include @@ -1530,7 +1529,7 @@ void loop() #ifdef ARCH_NRF52 nrf52Loop(); #endif - powerCommandsCheck(); + power->powerCommandsCheck(); #ifdef DEBUG_STACK static uint32_t lastPrint = 0; diff --git a/src/power.h b/src/power.h index 046980bd6..1c078c06d 100644 --- a/src/power.h +++ b/src/power.h @@ -110,7 +110,7 @@ class Power : private concurrency::OSThread Power(); - void shutdown(); + void powerCommandsCheck(); void readPowerStatus(); virtual bool setup(); virtual int32_t runOnce() override; @@ -130,6 +130,8 @@ class Power : private concurrency::OSThread bool lipoChargerInit(); private: + void shutdown(); + void reboot(); // open circuit voltage lookup table uint8_t low_voltage_counter; #ifdef DEBUG_HEAP diff --git a/src/shutdown.h b/src/shutdown.h deleted file mode 100644 index 973e388b1..000000000 --- a/src/shutdown.h +++ /dev/null @@ -1,47 +0,0 @@ -#include "buzz.h" -#include "configuration.h" -#include "graphics/Screen.h" -#include "main.h" -#include "power.h" -#include "sleep.h" -#if defined(ARCH_PORTDUINO) -#include "api/WiFiServerAPI.h" -#include "input/LinuxInputImpl.h" - -#endif - -void powerCommandsCheck() -{ - if (rebootAtMsec && millis() > rebootAtMsec) { - LOG_INFO("Rebooting"); - notifyReboot.notifyObservers(NULL); -#if defined(ARCH_ESP32) - ESP.restart(); -#elif defined(ARCH_NRF52) - NVIC_SystemReset(); -#elif defined(ARCH_RP2040) - rp2040.reboot(); -#elif defined(ARCH_PORTDUINO) - deInitApiServer(); - if (aLinuxInputImpl) - aLinuxInputImpl->deInit(); - SPI.end(); - Wire.end(); - Serial1.end(); - if (screen) - delete screen; - LOG_DEBUG("final reboot!"); - reboot(); -#elif defined(ARCH_STM32WL) - HAL_NVIC_SystemReset(); -#else - rebootAtMsec = -1; - LOG_WARN("FIXME implement reboot for this platform. Note that some settings require a restart to be applied"); -#endif - } - - if (shutdownAtMsec && millis() > shutdownAtMsec) { - shutdownAtMsec = 0; - power->shutdown(); - } -} \ No newline at end of file From 878d68c5efac54f80b1a02bb0f31acae85edc0d4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 06:22:07 -0500 Subject: [PATCH 049/180] Upgrade trunk (#7420) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> --- .trunk/trunk.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index d6a8cc8c1..2d4d3fc16 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,9 +9,9 @@ plugins: lint: enabled: - checkov@3.2.451 - - renovate@41.38.1 + - renovate@41.40.0 - prettier@3.6.2 - - trufflehog@3.90.0 + - trufflehog@3.90.1 - yamllint@1.37.1 - bandit@1.8.6 - trivy@0.64.1 @@ -28,7 +28,7 @@ lint: - shellcheck@0.10.0 - black@25.1.0 - git-diff-check - - gitleaks@8.27.2 + - gitleaks@8.28.0 - clang-format@16.0.3 ignore: - linters: [ALL] From 2087629a474c4b0b2d7a60995ce3b9b599b72c91 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Tue, 22 Jul 2025 06:22:23 -0500 Subject: [PATCH 050/180] Add a verbose mode flag to meshtasticd (#7416) --- src/platform/portduino/PortduinoGlue.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index 685f0d077..5f99ec2c3 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -34,6 +34,7 @@ Ch341Hal *ch341Hal = nullptr; char *configPath = nullptr; char *optionMac = nullptr; bool forceSimulated = false; +bool verboseEnabled = false; const char *argp_program_version = optstr(APP_VERSION); @@ -70,7 +71,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) case 'h': optionMac = arg; break; - + case 'v': + verboseEnabled = true; + break; case ARGP_KEY_ARG: return 0; default: @@ -85,6 +88,7 @@ void portduinoCustomInit() {"config", 'c', "CONFIG_PATH", 0, "Full path of the .yaml config file to use."}, {"hwid", 'h', "HWID", 0, "The mac address to assign to this virtual machine"}, {"sim", 's', 0, 0, "Run in Simulated radio mode"}, + {"verbose", 'v', 0, 0, "Set log level to full debug"}, {0}}; static void *childArguments; static char doc[] = "Meshtastic native build."; @@ -417,6 +421,9 @@ void portduinoSetup() exit(EXIT_FAILURE); } } + if (verboseEnabled && settingsMap[logoutputlevel] != level_trace) { + settingsMap[logoutputlevel] = level_debug; + } return; } From d80dcd6afd1a94a99f934d92edfbcfc3b6f733c6 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Tue, 22 Jul 2025 08:49:33 -0500 Subject: [PATCH 051/180] Fix InkHUD shutdown code --- src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp b/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp index a1f79a28f..7876276a8 100644 --- a/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp +++ b/src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp @@ -223,7 +223,7 @@ void InkHUD::MenuApplet::execute(MenuItem item) case SHUTDOWN: LOG_INFO("Shutting down from menu"); - power->shutdown(); + shutdownAtMsec = millis(); // Menu is then sent to background via onShutdown break; From 96f63f3945236329ba90cb159c2538866b17b3e7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 13:49:53 -0500 Subject: [PATCH 052/180] Update protobufs (#7422) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/deviceonly.pb.h | 2 +- src/mesh/generated/meshtastic/mesh.pb.cpp | 2 ++ src/mesh/generated/meshtastic/mesh.pb.h | 36 ++++++++++++++++--- 4 files changed, 36 insertions(+), 6 deletions(-) diff --git a/protobufs b/protobufs index fa02e14d8..d31cd890d 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit fa02e14d8d01850336eaea0e9552aef4f08f0a40 +Subproject commit d31cd890d58ffa7e3524e0685a8617bbd181a1c6 diff --git a/src/mesh/generated/meshtastic/deviceonly.pb.h b/src/mesh/generated/meshtastic/deviceonly.pb.h index b02b2083d..e709db6c4 100644 --- a/src/mesh/generated/meshtastic/deviceonly.pb.h +++ b/src/mesh/generated/meshtastic/deviceonly.pb.h @@ -362,7 +362,7 @@ extern const pb_msgdesc_t meshtastic_BackupPreferences_msg; #define MESHTASTIC_MESHTASTIC_DEVICEONLY_PB_H_MAX_SIZE meshtastic_BackupPreferences_size #define meshtastic_BackupPreferences_size 2271 #define meshtastic_ChannelFile_size 718 -#define meshtastic_DeviceState_size 1722 +#define meshtastic_DeviceState_size 1724 #define meshtastic_NodeInfoLite_size 196 #define meshtastic_PositionLite_size 28 #define meshtastic_UserLite_size 98 diff --git a/src/mesh/generated/meshtastic/mesh.pb.cpp b/src/mesh/generated/meshtastic/mesh.pb.cpp index 361d01b9a..85735357a 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.cpp +++ b/src/mesh/generated/meshtastic/mesh.pb.cpp @@ -117,6 +117,8 @@ PB_BIND(meshtastic_ChunkedPayloadResponse, meshtastic_ChunkedPayloadResponse, AU + + diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index d1a38b565..abc06e635 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -325,6 +325,25 @@ typedef enum _meshtastic_CriticalErrorCode { meshtastic_CriticalErrorCode_FLASH_CORRUPTION_UNRECOVERABLE = 13 } meshtastic_CriticalErrorCode; +/* Enum to indicate to clients whether this firmware is a special firmware build, like an event. + The first 16 values are reserved for non-event special firmwares, like the Smart Citizen use case. */ +typedef enum _meshtastic_FirmwareEdition { + /* Vanilla firmware */ + meshtastic_FirmwareEdition_VANILLA = 0, + /* Firmware for use in the Smart Citizen environmental monitoring network */ + meshtastic_FirmwareEdition_SMART_CITIZEN = 1, + /* Open Sauce, the maker conference held yearly in CA */ + meshtastic_FirmwareEdition_OPEN_SAUCE = 16, + /* DEFCON, the yearly hacker conference */ + meshtastic_FirmwareEdition_DEFCON = 17, + /* Burning Man, the yearly hippie gathering in the desert */ + meshtastic_FirmwareEdition_BURNING_MAN = 18, + /* Hamvention, the Dayton amateur radio convention */ + meshtastic_FirmwareEdition_HAMVENTION = 19, + /* Placeholder for DIY and unofficial events */ + meshtastic_FirmwareEdition_DIY_EDITION = 127 +} meshtastic_FirmwareEdition; + /* Enum for modules excluded from a device's configuration. Each value represents a ModuleConfigType that can be toggled as excluded by setting its corresponding bit in the `excluded_modules` bitmask field. */ @@ -914,6 +933,8 @@ typedef struct _meshtastic_MyNodeInfo { meshtastic_MyNodeInfo_device_id_t device_id; /* The PlatformIO environment used to build this firmware */ char pio_env[40]; + /* The indicator for whether this device is running event firmware and which */ + meshtastic_FirmwareEdition firmware_edition; } meshtastic_MyNodeInfo; /* Debug output from the device. @@ -1212,6 +1233,10 @@ extern "C" { #define _meshtastic_CriticalErrorCode_MAX meshtastic_CriticalErrorCode_FLASH_CORRUPTION_UNRECOVERABLE #define _meshtastic_CriticalErrorCode_ARRAYSIZE ((meshtastic_CriticalErrorCode)(meshtastic_CriticalErrorCode_FLASH_CORRUPTION_UNRECOVERABLE+1)) +#define _meshtastic_FirmwareEdition_MIN meshtastic_FirmwareEdition_VANILLA +#define _meshtastic_FirmwareEdition_MAX meshtastic_FirmwareEdition_DIY_EDITION +#define _meshtastic_FirmwareEdition_ARRAYSIZE ((meshtastic_FirmwareEdition)(meshtastic_FirmwareEdition_DIY_EDITION+1)) + #define _meshtastic_ExcludedModules_MIN meshtastic_ExcludedModules_EXCLUDED_NONE #define _meshtastic_ExcludedModules_MAX meshtastic_ExcludedModules_NETWORK_CONFIG #define _meshtastic_ExcludedModules_ARRAYSIZE ((meshtastic_ExcludedModules)(meshtastic_ExcludedModules_NETWORK_CONFIG+1)) @@ -1258,6 +1283,7 @@ extern "C" { #define meshtastic_MeshPacket_delayed_ENUMTYPE meshtastic_MeshPacket_Delayed +#define meshtastic_MyNodeInfo_firmware_edition_ENUMTYPE meshtastic_FirmwareEdition #define meshtastic_LogRecord_level_ENUMTYPE meshtastic_LogRecord_Level @@ -1296,7 +1322,7 @@ extern "C" { #define meshtastic_MqttClientProxyMessage_init_default {"", 0, {{0, {0}}}, 0} #define meshtastic_MeshPacket_init_default {0, 0, 0, 0, {meshtastic_Data_init_default}, 0, 0, 0, 0, 0, _meshtastic_MeshPacket_Priority_MIN, 0, _meshtastic_MeshPacket_Delayed_MIN, 0, 0, {0, {0}}, 0, 0, 0, 0} #define meshtastic_NodeInfo_init_default {0, false, meshtastic_User_init_default, false, meshtastic_Position_init_default, 0, 0, false, meshtastic_DeviceMetrics_init_default, 0, 0, false, 0, 0, 0, 0} -#define meshtastic_MyNodeInfo_init_default {0, 0, 0, {0, {0}}, ""} +#define meshtastic_MyNodeInfo_init_default {0, 0, 0, {0, {0}}, "", _meshtastic_FirmwareEdition_MIN} #define meshtastic_LogRecord_init_default {"", 0, "", _meshtastic_LogRecord_Level_MIN} #define meshtastic_QueueStatus_init_default {0, 0, 0, 0} #define meshtastic_FromRadio_init_default {0, 0, {meshtastic_MeshPacket_init_default}} @@ -1327,7 +1353,7 @@ extern "C" { #define meshtastic_MqttClientProxyMessage_init_zero {"", 0, {{0, {0}}}, 0} #define meshtastic_MeshPacket_init_zero {0, 0, 0, 0, {meshtastic_Data_init_zero}, 0, 0, 0, 0, 0, _meshtastic_MeshPacket_Priority_MIN, 0, _meshtastic_MeshPacket_Delayed_MIN, 0, 0, {0, {0}}, 0, 0, 0, 0} #define meshtastic_NodeInfo_init_zero {0, false, meshtastic_User_init_zero, false, meshtastic_Position_init_zero, 0, 0, false, meshtastic_DeviceMetrics_init_zero, 0, 0, false, 0, 0, 0, 0} -#define meshtastic_MyNodeInfo_init_zero {0, 0, 0, {0, {0}}, ""} +#define meshtastic_MyNodeInfo_init_zero {0, 0, 0, {0, {0}}, "", _meshtastic_FirmwareEdition_MIN} #define meshtastic_LogRecord_init_zero {"", 0, "", _meshtastic_LogRecord_Level_MIN} #define meshtastic_QueueStatus_init_zero {0, 0, 0, 0} #define meshtastic_FromRadio_init_zero {0, 0, {meshtastic_MeshPacket_init_zero}} @@ -1450,6 +1476,7 @@ extern "C" { #define meshtastic_MyNodeInfo_min_app_version_tag 11 #define meshtastic_MyNodeInfo_device_id_tag 12 #define meshtastic_MyNodeInfo_pio_env_tag 13 +#define meshtastic_MyNodeInfo_firmware_edition_tag 14 #define meshtastic_LogRecord_message_tag 1 #define meshtastic_LogRecord_time_tag 2 #define meshtastic_LogRecord_source_tag 3 @@ -1682,7 +1709,8 @@ X(a, STATIC, SINGULAR, UINT32, my_node_num, 1) \ X(a, STATIC, SINGULAR, UINT32, reboot_count, 8) \ X(a, STATIC, SINGULAR, UINT32, min_app_version, 11) \ X(a, STATIC, SINGULAR, BYTES, device_id, 12) \ -X(a, STATIC, SINGULAR, STRING, pio_env, 13) +X(a, STATIC, SINGULAR, STRING, pio_env, 13) \ +X(a, STATIC, SINGULAR, UENUM, firmware_edition, 14) #define meshtastic_MyNodeInfo_CALLBACK NULL #define meshtastic_MyNodeInfo_DEFAULT NULL @@ -1965,7 +1993,7 @@ extern const pb_msgdesc_t meshtastic_ChunkedPayloadResponse_msg; #define meshtastic_LowEntropyKey_size 0 #define meshtastic_MeshPacket_size 378 #define meshtastic_MqttClientProxyMessage_size 501 -#define meshtastic_MyNodeInfo_size 77 +#define meshtastic_MyNodeInfo_size 79 #define meshtastic_NeighborInfo_size 258 #define meshtastic_Neighbor_size 22 #define meshtastic_NodeInfo_size 323 From 8836be0f47b2162f022633f2954d42dc5854e811 Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Wed, 23 Jul 2025 12:00:34 +1000 Subject: [PATCH 053/180] AG3335 GPS: Use NAVIC in India/Nepal, L1+L5 elsewhere. (#7413) As determined by @b8b8 , enabling NAVIC meant the more modern L5 GPS signal was not used (L1 GPS is always available). NAVIC, India's GNSS, probably provides the best coverage in India and the neighbouring region. However, outside of NAVIC's coverage area, L5 GPS is highly desirable. This patch amends the AG3335-family GPS configuration to enable L5 GPS coverage by default. If the Lora region is set to India or Nepal, NAVIC will be enabled instead. --- src/gps/GPS.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index 3a6b19f64..f3624c627 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -643,8 +643,16 @@ bool GPS::setup() delay(250); } else if (IS_ONE_OF(gnssModel, GNSS_MODEL_AG3335, GNSS_MODEL_AG3352)) { - _serial_gps->write("$PAIR066,1,0,1,0,0,1*3B\r\n"); // Enable GPS+GALILEO+NAVIC - + if (config.lora.region == meshtastic_Config_LoRaConfig_RegionCode_IN || + config.lora.region == meshtastic_Config_LoRaConfig_RegionCode_NP_865) { + _serial_gps->write("$PAIR066,1,0,1,0,0,1*3B\r\n"); // Enable GPS+GALILEO+NAVIC + // GPS GLONASS GALILEO BDS QZSS NAVIC + // 1 0 1 0 0 1 + } else { + _serial_gps->write("$PAIR066,1,1,1,1,0,0*3A\r\n"); // Enable GPS+GLONASS+GALILEO+BDS + // GPS GLONASS GALILEO BDS QZSS NAVIC + // 1 1 1 1 0 0 + } // Configure NMEA (sentences will output once per fix) _serial_gps->write("$PAIR062,0,1*3F\r\n"); // GGA ON _serial_gps->write("$PAIR062,1,0*3F\r\n"); // GLL OFF From ed0cdefb448b02b9c195bc6d5e41eca26904331f Mon Sep 17 00:00:00 2001 From: Austin Date: Tue, 22 Jul 2025 22:01:29 -0400 Subject: [PATCH 054/180] Use platformio-core to build the matrix (#7424) Co-authored-by: Ben Meadors --- .github/workflows/main_matrix.yml | 10 +++- bin/generate_ci_matrix.py | 87 ++++++++++++++++++------------- 2 files changed, 60 insertions(+), 37 deletions(-) diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 9d5cb0981..a3e8caf15 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -31,10 +31,16 @@ jobs: fail-fast: false matrix: arch: [esp32, esp32s3, esp32c3, esp32c6, nrf52840, rp2040, stm32, check] - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - id: jsonStep + - uses: actions/setup-python@v5 + with: + python-version: 3.x + cache: pip + - run: pip install -U platformio + - name: Generate matrix + id: jsonStep run: | if [[ "$GITHUB_HEAD_REF" == "" ]]; then TARGETS=$(./bin/generate_ci_matrix.py ${{matrix.arch}}) diff --git a/bin/generate_ci_matrix.py b/bin/generate_ci_matrix.py index 0ce6b0f6b..acc0a9fb7 100755 --- a/bin/generate_ci_matrix.py +++ b/bin/generate_ci_matrix.py @@ -2,50 +2,67 @@ """Generate the CI matrix.""" -import configparser import json -import os import sys import random - -rootdir = "variants/" +import re +from platformio.project.config import ProjectConfig options = sys.argv[1:] outlist = [] if len(options) < 1: - print(json.dumps(outlist)) - exit() + print(json.dumps(outlist)) + exit(1) -for subdir, dirs, files in os.walk(rootdir): - for file in files: - if file == "platformio.ini": - config = configparser.ConfigParser() - config.read(subdir + "/" + file) - for c in config.sections(): - if c.startswith("env:"): - section = config[c].name[4:] - if "extends" in config[config[c].name]: - if options[0] + "_base" in config[config[c].name]["extends"]: - if "board_level" in config[config[c].name]: - if ( - config[config[c].name]["board_level"] == "extra" - ) & ("extra" in options): - outlist.append(section) - else: - outlist.append(section) - # Add the TFT variants if the base variant is selected - elif section.replace("-tft", "") in outlist and config[config[c].name].get("board_level") != "extra": - outlist.append(section) - elif section.replace("-inkhud", "") in outlist and config[config[c].name].get("board_level") != "extra": - outlist.append(section) - if "board_check" in config[config[c].name]: - if (config[config[c].name]["board_check"] == "true") & ( - "check" in options - ): - outlist.append(section) -if ("quick" in options) & (len(outlist) > 3): +cfg = ProjectConfig.get_instance() +pio_envs = cfg.envs() + +# Gather all PlatformIO environments for filtering later +all_envs = [] +for pio_env in pio_envs: + env_build_flags = cfg.get(f"env:{pio_env}", 'build_flags') + env_platform = None + for flag in env_build_flags: + # Extract the platform from the build flags + # Example flag: -I variants/esp32s3/heltec-v3 + match = re.search(r"-I\s?variants/([^/]+)", flag) + if match: + env_platform = match.group(1) + break + # Intentionally fail if platform cannot be determined + if not env_platform: + print(f"Error: Could not determine platform for environment '{pio_env}'") + exit(1) + # Store env details as a dictionary, and add to 'all_envs' list + env = { + 'name': pio_env, + 'platform': env_platform, + 'board_level': cfg.get(f"env:{pio_env}", 'board_level', default=None), + 'board_check': bool(cfg.get(f"env:{pio_env}", 'board_check', default=False)) + } + all_envs.append(env) + +# Filter outputs based on options +# Check is currently mutually exclusive with other options +if "check" in options: + for env in all_envs: + if env['board_check']: + outlist.append(env['name']) +# Filter (non-check) builds by platform +else: + for env in all_envs: + if options[0] == env['platform']: + # If no board level is specified, always include it + if not env['board_level']: + outlist.append(env['name']) + # Include `extra` boards when requested + elif "extra" in options and env['board_level'] == "extra": + outlist.append(env['name']) + +# Return as a JSON list +if ("quick" in options) and (len(outlist) > 3): print(json.dumps(random.sample(outlist, 3))) else: - print(json.dumps(outlist)) \ No newline at end of file + print(json.dumps(outlist)) From 82ddf4732a60e70783dc40f5a6597df2d4f907ff Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Wed, 23 Jul 2025 05:57:17 -0500 Subject: [PATCH 055/180] Deprecate disable_triple_click config (#7425) --- src/input/ExpressLRSFiveWay.cpp | 2 +- src/mesh/NodeDB.cpp | 5 ----- src/modules/AdminModule.cpp | 1 - 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/input/ExpressLRSFiveWay.cpp b/src/input/ExpressLRSFiveWay.cpp index 77f9e9993..776b9001d 100644 --- a/src/input/ExpressLRSFiveWay.cpp +++ b/src/input/ExpressLRSFiveWay.cpp @@ -199,7 +199,7 @@ void ExpressLRSFiveWay::sendKey(input_broker_event key) void ExpressLRSFiveWay::toggleGPS() { #if HAS_GPS && !MESHTASTIC_EXCLUDE_GPS - if (!config.device.disable_triple_click && (gps != nullptr)) { + if (gps != nullptr) { gps->toggleGpsMode(); screen->startAlert("GPS Toggled"); alerting = true; diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 38e213167..b7120a064 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -628,11 +628,6 @@ void NodeDB::installDefaultConfig(bool preserveKey = false) #ifdef PIN_GPS_EN config.position.gps_en_gpio = PIN_GPS_EN; #endif -#ifdef GPS_POWER_TOGGLE - config.device.disable_triple_click = false; -#else - config.device.disable_triple_click = true; -#endif #if defined(USERPREFS_CONFIG_GPS_MODE) config.position.gps_mode = USERPREFS_CONFIG_GPS_MODE; #elif !HAS_GPS || GPS_DEFAULT_NOT_PRESENT diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 8d3e710df..33d5e1016 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -596,7 +596,6 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c) if (config.device.button_gpio == c.payload_variant.device.button_gpio && config.device.buzzer_gpio == c.payload_variant.device.buzzer_gpio && config.device.role == c.payload_variant.device.role && - config.device.disable_triple_click == c.payload_variant.device.disable_triple_click && config.device.rebroadcast_mode == c.payload_variant.device.rebroadcast_mode) { requiresReboot = false; } From 54c0cbeb66535b365fb8cb94122481d6f4504034 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 07:46:34 -0500 Subject: [PATCH 056/180] Update meshtastic/device-ui digest to c75d545 (#7435) 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 ad7100efd..8bf56cf5b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -110,7 +110,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/86a09a7360f92d10053fbbf8d74f67f85b0ceb09.zip + https://github.com/meshtastic/device-ui/archive/c75d545bf9e8d1fe20051c319f427f711113ff22.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 46e2ae88600a40849d6187687fbcb0983c616819 Mon Sep 17 00:00:00 2001 From: saiman pokhrel <70017194+WOD-MN@users.noreply.github.com> Date: Wed, 23 Jul 2025 18:39:43 +0545 Subject: [PATCH 057/180] =?UTF-8?q?Add=20Nepal=20865=E2=80=AFMHz=20to=2086?= =?UTF-8?q?8=E2=80=AFMHz=20(#7380)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Tom Fifield Co-authored-by: Austin --- src/mesh/RadioInterface.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index faa67a1c2..985cfdf7f 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -169,6 +169,14 @@ const RegionInfo regions[] = { */ RDEF(KZ_433, 433.075f, 434.775f, 100, 0, 10, true, false, false), RDEF(KZ_863, 863.0f, 868.0f, 100, 0, 30, true, false, true), + + /* + Nepal + 865 MHz to 868 MHz frequency band for IoT (Internet of Things), M2M (Machine-to-Machine), and smart metering use, specifically in non-cellular mode. + https://www.nta.gov.np/uploads/contents/Radio-Frequency-Policy-2080-English.pdf + */ + RDEF(NP_865, 865.0f, 868.0f, 100, 0, 30, true, false, false), + /* 2.4 GHZ WLAN Band equivalent. Only for SX128x chips. */ From 4eb6c9fb8ed694e3678761801ce7b254046b008a Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Wed, 23 Jul 2025 22:55:17 +1000 Subject: [PATCH 058/180] Add BR_902, Brazil 902MHz-907.5MHz (#7399) As reported by @barbabarros , the Brazilian government has specific support for LoRA[1] across multiple frequencies[2][3]. We currently support Brazil through the ANZ/AU915 band. However, Brazil also has another frequency available for use: 902 - 907.5 MHz , 1W power limit, no duty cycle restrictions [1] https://sistemas.anatel.gov.br/anexar-api/publico/anexos/download/a028ab5cc4e3f97442830bba0c8bd1dd [2] https://informacoes.anatel.gov.br/legislacao/resolucoes/2025/2001-resolucao-772 [3] https://informacoes.anatel.gov.br/legislacao/atos-de-certificacao-de-produtos/2017/1139-ato-14448#item10 Protobuf patch: https://github.com/meshtastic/protobufs/pull/737 Fixes https://github.com/meshtastic/firmware/issues/3741 Co-authored-by: Austin --- src/mesh/RadioInterface.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 985cfdf7f..7590ac34d 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -67,6 +67,7 @@ const RegionInfo regions[] = { /* https://www.iot.org.au/wp/wp-content/uploads/2016/12/IoTSpectrumFactSheet.pdf https://iotalliance.org.nz/wp-content/uploads/sites/4/2019/05/IoT-Spectrum-in-NZ-Briefing-Paper.pdf + Also used in Brazil. */ RDEF(ANZ, 915.0f, 928.0f, 100, 0, 30, true, false, false), @@ -177,6 +178,13 @@ const RegionInfo regions[] = { */ RDEF(NP_865, 865.0f, 868.0f, 100, 0, 30, true, false, false), + /* + Brazil + 902 - 907.5 MHz , 1W power limit, no duty cycle restrictions + https://github.com/meshtastic/firmware/issues/3741 + */ + RDEF(BR_902, 902.0f, 907.5f, 100, 0, 30, true, false, false), + /* 2.4 GHZ WLAN Band equivalent. Only for SX128x chips. */ From 516597a73e99c6023046ce153d3f214482ef7ed9 Mon Sep 17 00:00:00 2001 From: Pedro <40841971+barbabarros@users.noreply.github.com> Date: Wed, 23 Jul 2025 09:56:22 -0300 Subject: [PATCH 059/180] Add NP_865 and BR_902 to device menu (#7434) --- src/graphics/draw/MenuHandler.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index 83198a7c5..5eaa2c6bf 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -51,12 +51,14 @@ void menuHandler::LoraRegionPicker(uint32_t duration) "PH_915", "ANZ_433", "KZ_433", - "KZ_863"}; + "KZ_863", + "NP_865", + "BR_902"}; BannerOverlayOptions bannerOptions; bannerOptions.message = "Set the LoRa region"; bannerOptions.durationMs = duration; bannerOptions.optionsArrayPtr = optionsArray; - bannerOptions.optionsCount = 25; + bannerOptions.optionsCount = 27; bannerOptions.InitialSelected = 0; bannerOptions.bannerCallback = [](int selected) -> void { if (selected != 0 && config.lora.region != _meshtastic_Config_LoRaConfig_RegionCode(selected)) { From 66a831dfa802ed3164b73886ac5fc0d8f1d5d685 Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 23 Jul 2025 13:41:08 -0400 Subject: [PATCH 060/180] Actions: Combine embedded builds // split by variant subdir (#7417) --- .github/workflows/build_esp32.yml | 42 ------------------ .github/workflows/build_esp32_c3.yml | 42 ------------------ .github/workflows/build_esp32_c6.yml | 42 ------------------ .github/workflows/build_esp32_s3.yml | 42 ------------------ .github/workflows/build_firmware.yml | 66 ++++++++++++++++++++++++++++ .github/workflows/build_nrf52.yml | 42 ------------------ .github/workflows/build_rpi2040.yml | 40 ----------------- .github/workflows/build_stm32.yml | 41 ----------------- .github/workflows/main_matrix.yml | 51 +++++++++++---------- 9 files changed, 95 insertions(+), 313 deletions(-) delete mode 100644 .github/workflows/build_esp32.yml delete mode 100644 .github/workflows/build_esp32_c3.yml delete mode 100644 .github/workflows/build_esp32_c6.yml delete mode 100644 .github/workflows/build_esp32_s3.yml create mode 100644 .github/workflows/build_firmware.yml delete mode 100644 .github/workflows/build_nrf52.yml delete mode 100644 .github/workflows/build_rpi2040.yml delete mode 100644 .github/workflows/build_stm32.yml diff --git a/.github/workflows/build_esp32.yml b/.github/workflows/build_esp32.yml deleted file mode 100644 index 2c4622f43..000000000 --- a/.github/workflows/build_esp32.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Build ESP32 - -on: - workflow_call: - inputs: - version: - required: true - type: string - board: - required: true - type: string - -permissions: read-all - -jobs: - build-esp32: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - - - name: Build ESP32 - id: build - uses: meshtastic/gh-action-firmware@main - with: - pio_platform: esp32 - pio_env: ${{ inputs.board }} - pio_target: build - ota_firmware_source: firmware.bin - ota_firmware_target: release/bleota.bin - - - name: Store binaries as an artifact - uses: actions/upload-artifact@v4 - with: - name: firmware-esp32-${{ inputs.board }}-${{ inputs.version }}.zip - overwrite: true - path: | - release/*.bin - release/*.elf diff --git a/.github/workflows/build_esp32_c3.yml b/.github/workflows/build_esp32_c3.yml deleted file mode 100644 index 3e7746166..000000000 --- a/.github/workflows/build_esp32_c3.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Build ESP32-C3 - -on: - workflow_call: - inputs: - version: - required: true - type: string - board: - required: true - type: string - -permissions: read-all - -jobs: - build-esp32-c3: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - - - name: Build ESP32-C3 - id: build - uses: meshtastic/gh-action-firmware@main - with: - pio_platform: esp32 - pio_env: ${{ inputs.board }} - pio_target: build - ota_firmware_source: firmware-c3.bin - ota_firmware_target: release/bleota-c3.bin - - - name: Store binaries as an artifact - uses: actions/upload-artifact@v4 - with: - name: firmware-esp32c3-${{ inputs.board }}-${{ inputs.version }}.zip - overwrite: true - path: | - release/*.bin - release/*.elf diff --git a/.github/workflows/build_esp32_c6.yml b/.github/workflows/build_esp32_c6.yml deleted file mode 100644 index 6f32eb3c6..000000000 --- a/.github/workflows/build_esp32_c6.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Build ESP32-C6 - -on: - workflow_call: - inputs: - version: - required: true - type: string - board: - required: true - type: string - -permissions: read-all - -jobs: - build-esp32-c6: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - - - name: Build ESP32-C6 - id: build - uses: meshtastic/gh-action-firmware@main - with: - pio_platform: esp32 - pio_env: ${{ inputs.board }} - pio_target: build - ota_firmware_source: firmware-c3.bin - ota_firmware_target: release/bleota-c3.bin - - - name: Store binaries as an artifact - uses: actions/upload-artifact@v4 - with: - name: firmware-esp32c6-${{ inputs.board }}-${{ inputs.version }}.zip - overwrite: true - path: | - release/*.bin - release/*.elf diff --git a/.github/workflows/build_esp32_s3.yml b/.github/workflows/build_esp32_s3.yml deleted file mode 100644 index 6527d6d7c..000000000 --- a/.github/workflows/build_esp32_s3.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Build ESP32-S3 - -on: - workflow_call: - inputs: - version: - required: true - type: string - board: - required: true - type: string - -permissions: read-all - -jobs: - build-esp32-s3: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - - - name: Build ESP32-S3 - id: build - uses: meshtastic/gh-action-firmware@main - with: - pio_platform: esp32 - pio_env: ${{ inputs.board }} - pio_target: build - ota_firmware_source: firmware-s3.bin - ota_firmware_target: release/bleota-s3.bin - - - name: Store binaries as an artifact - uses: actions/upload-artifact@v4 - with: - name: firmware-esp32s3-${{ inputs.board }}-${{ inputs.version }}.zip - overwrite: true - path: | - release/*.bin - release/*.elf diff --git a/.github/workflows/build_firmware.yml b/.github/workflows/build_firmware.yml new file mode 100644 index 000000000..df1035e62 --- /dev/null +++ b/.github/workflows/build_firmware.yml @@ -0,0 +1,66 @@ +name: Build + +on: + workflow_call: + inputs: + version: + required: true + type: string + platform: + required: true + type: string + pio_env: + required: true + type: string + +permissions: read-all + +jobs: + pio-build: + name: build-${{ inputs.platform }} + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + + - name: Set OTA firmware source and target + if: startsWith(inputs.platform, 'esp32') + id: ota_dir + env: + PIO_PLATFORM: ${{ inputs.platform }} + run: | + if [ "$PIO_PLATFORM" = "esp32s3" ]; then + echo "src=firmware-s3.bin" >> $GITHUB_OUTPUT + echo "tgt=release/bleota-s3.bin" >> $GITHUB_OUTPUT + elif [ "$PIO_PLATFORM" = "esp32c3" ] || [ "$PIO_PLATFORM" = "esp32c6" ]; then + echo "src=firmware-c3.bin" >> $GITHUB_OUTPUT + echo "tgt=release/bleota-c3.bin" >> $GITHUB_OUTPUT + elif [ "$PIO_PLATFORM" = "esp32" ]; then + echo "src=firmware.bin" >> $GITHUB_OUTPUT + echo "tgt=release/bleota.bin" >> $GITHUB_OUTPUT + fi + + - name: Build ${{ inputs.platform }} + id: build + uses: meshtastic/gh-action-firmware@main + with: + pio_platform: ${{ inputs.platform }} + pio_env: ${{ inputs.pio_env }} + pio_target: build + ota_firmware_source: ${{ steps.ota_dir.outputs.src || '' }} + ota_firmware_target: ${{ steps.ota_dir.outputs.tgt || '' }} + + - name: Store binaries as an artifact + uses: actions/upload-artifact@v4 + with: + name: firmware-${{ inputs.platform }}-${{ inputs.pio_env }}-${{ inputs.version }}.zip + overwrite: true + path: | + release/*.bin + release/*.elf + release/*.uf2 + release/*.hex + release/*-ota.zip diff --git a/.github/workflows/build_nrf52.yml b/.github/workflows/build_nrf52.yml deleted file mode 100644 index 89be40187..000000000 --- a/.github/workflows/build_nrf52.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Build NRF52 - -on: - workflow_call: - inputs: - version: - required: true - type: string - board: - required: true - type: string - -permissions: read-all - -jobs: - build-nrf52: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - - - name: Build NRF52 - id: build - uses: meshtastic/gh-action-firmware@main - with: - pio_platform: nrf52 - pio_env: ${{ inputs.board }} - pio_target: build - - - name: Store binaries as an artifact - uses: actions/upload-artifact@v4 - with: - name: firmware-nrf52840-${{ inputs.board }}-${{ inputs.version }}.zip - overwrite: true - path: | - release/*.uf2 - release/*.elf - release/*.hex - release/*-ota.zip diff --git a/.github/workflows/build_rpi2040.yml b/.github/workflows/build_rpi2040.yml deleted file mode 100644 index fbaa21684..000000000 --- a/.github/workflows/build_rpi2040.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Build RPI2040 - -on: - workflow_call: - inputs: - version: - required: true - type: string - board: - required: true - type: string - -permissions: read-all - -jobs: - build-rpi2040: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - - - name: Build Raspberry Pi 2040 - id: build - uses: meshtastic/gh-action-firmware@main - with: - pio_platform: rp2xx0 - pio_env: ${{ inputs.board }} - pio_target: build - - - name: Store binaries as an artifact - uses: actions/upload-artifact@v4 - with: - name: firmware-rp2040-${{ inputs.board }}-${{ inputs.version }}.zip - overwrite: true - path: | - release/*.uf2 - release/*.elf diff --git a/.github/workflows/build_stm32.yml b/.github/workflows/build_stm32.yml deleted file mode 100644 index f06e8f3b8..000000000 --- a/.github/workflows/build_stm32.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Build STM32 - -on: - workflow_call: - inputs: - version: - required: true - type: string - board: - required: true - type: string - -permissions: read-all - -jobs: - build-stm32: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - - - name: Build STM32WL - id: build - uses: meshtastic/gh-action-firmware@main - with: - pio_platform: stm32wl - pio_env: ${{ inputs.board }} - pio_target: build - - - name: Store binaries as an artifact - uses: actions/upload-artifact@v4 - with: - name: firmware-stm32-${{ inputs.board }}-${{ inputs.version }}.zip - overwrite: true - path: | - release/*.hex - release/*.bin - release/*.elf diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index a3e8caf15..0760c0491 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -95,70 +95,77 @@ jobs: strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.esp32) }} - uses: ./.github/workflows/build_esp32.yml + uses: ./.github/workflows/build_firmware.yml with: version: ${{ needs.version.outputs.long }} - board: ${{ matrix.board }} + pio_env: ${{ matrix.board }} + platform: esp32 - build-esp32-s3: + build-esp32s3: needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.esp32s3) }} - uses: ./.github/workflows/build_esp32_s3.yml + uses: ./.github/workflows/build_firmware.yml with: version: ${{ needs.version.outputs.long }} - board: ${{ matrix.board }} + pio_env: ${{ matrix.board }} + platform: esp32s3 - build-esp32-c3: + build-esp32c3: needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.esp32c3) }} - uses: ./.github/workflows/build_esp32_c3.yml + uses: ./.github/workflows/build_firmware.yml with: version: ${{ needs.version.outputs.long }} - board: ${{ matrix.board }} + pio_env: ${{ matrix.board }} + platform: esp32c3 - build-esp32-c6: + build-esp32c6: needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.esp32c6) }} - uses: ./.github/workflows/build_esp32_c6.yml + uses: ./.github/workflows/build_firmware.yml with: version: ${{ needs.version.outputs.long }} - board: ${{ matrix.board }} + pio_env: ${{ matrix.board }} + platform: esp32c6 - build-nrf52: + build-nrf52840: needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.nrf52840) }} - uses: ./.github/workflows/build_nrf52.yml + uses: ./.github/workflows/build_firmware.yml with: version: ${{ needs.version.outputs.long }} - board: ${{ matrix.board }} + pio_env: ${{ matrix.board }} + platform: nrf52840 build-rpi2040: needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.rp2040) }} - uses: ./.github/workflows/build_rpi2040.yml + uses: ./.github/workflows/build_firmware.yml with: version: ${{ needs.version.outputs.long }} - board: ${{ matrix.board }} + pio_env: ${{ matrix.board }} + platform: rp2040 build-stm32: needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.stm32) }} - uses: ./.github/workflows/build_stm32.yml + uses: ./.github/workflows/build_firmware.yml with: version: ${{ needs.version.outputs.long }} - board: ${{ matrix.board }} + pio_env: ${{ matrix.board }} + platform: stm32 build-debian-src: if: github.repository == 'meshtastic/firmware' @@ -242,10 +249,10 @@ jobs: [ version, build-esp32, - build-esp32-s3, - build-esp32-c3, - build-esp32-c6, - build-nrf52, + build-esp32s3, + build-esp32c3, + build-esp32c6, + build-nrf52840, build-rpi2040, build-stm32, ] From 4f895f744b77c4c63d731f2247347e174c2d2fde Mon Sep 17 00:00:00 2001 From: Austin Date: Thu, 24 Jul 2025 07:13:23 -0400 Subject: [PATCH 061/180] Take control of our PRs! (#7445) --- .github/workflows/main_matrix.yml | 2 +- bin/generate_ci_matrix.py | 22 +++++++++++-------- variants/esp32/rak11200/platformio.ini | 1 + variants/esp32/tbeam/platformio.ini | 1 + .../esp32c3/heltec_esp32c3/platformio.ini | 1 + variants/esp32c6/tlora_c6/platformio.ini | 1 + variants/esp32s3/elecrow_panel/platformio.ini | 1 + variants/esp32s3/heltec_v3/platformio.ini | 1 + .../heltec_vision_master_e213/platformio.ini | 1 + variants/esp32s3/rak3312/platformio.ini | 1 + .../seeed-sensecap-indicator/platformio.ini | 2 +- variants/esp32s3/seeed_xiao_s3/platformio.ini | 1 + variants/esp32s3/station-g2/platformio.ini | 1 + variants/esp32s3/t-deck/platformio.ini | 1 + variants/esp32s3/t-eth-elite/platformio.ini | 1 + .../heltec_mesh_node_t114/platformio.ini | 1 + variants/nrf52840/rak4631/platformio.ini | 1 + .../seeed_xiao_nrf52840_kit/platformio.ini | 1 + variants/nrf52840/t-echo/platformio.ini | 2 ++ .../nrf52840/tracker-t1000-e/platformio.ini | 1 + variants/rp2040/rak11310/platformio.ini | 1 + variants/rp2040/rpipico/platformio.ini | 1 + variants/rp2040/rpipicow/platformio.ini | 1 + variants/rp2350/rpipico2/platformio.ini | 1 + variants/rp2350/rpipico2w/platformio.ini | 1 + variants/stm32/rak3172/platformio.ini | 1 + variants/stm32/wio-e5/platformio.ini | 1 + 27 files changed, 40 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 0760c0491..c62d80888 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -45,7 +45,7 @@ jobs: if [[ "$GITHUB_HEAD_REF" == "" ]]; then TARGETS=$(./bin/generate_ci_matrix.py ${{matrix.arch}}) else - TARGETS=$(./bin/generate_ci_matrix.py ${{matrix.arch}} quick) + TARGETS=$(./bin/generate_ci_matrix.py ${{matrix.arch}} pr) fi echo "Name: $GITHUB_REF_NAME Base: $GITHUB_BASE_REF Ref: $GITHUB_REF Targets: $TARGETS" echo "${{matrix.arch}}=$(jq -cn --argjson environments "$TARGETS" '{board: $environments}')" >> $GITHUB_OUTPUT diff --git a/bin/generate_ci_matrix.py b/bin/generate_ci_matrix.py index acc0a9fb7..aaa76aa45 100755 --- a/bin/generate_ci_matrix.py +++ b/bin/generate_ci_matrix.py @@ -45,24 +45,28 @@ for pio_env in pio_envs: all_envs.append(env) # Filter outputs based on options -# Check is currently mutually exclusive with other options +# Check is mutually exclusive with other options (except 'pr') if "check" in options: for env in all_envs: if env['board_check']: - outlist.append(env['name']) + if "pr" in options: + if env['board_level'] == 'pr': + outlist.append(env['name']) + else: + outlist.append(env['name']) # Filter (non-check) builds by platform else: for env in all_envs: if options[0] == env['platform']: - # If no board level is specified, always include it - if not env['board_level']: + # Always include board_level = 'pr' + if env['board_level'] == 'pr': outlist.append(env['name']) - # Include `extra` boards when requested + # Include board_level = 'extra' when requested elif "extra" in options and env['board_level'] == "extra": outlist.append(env['name']) + # If no board level is specified, include in release builds (not PR) + elif "pr" not in options and not env['board_level']: + outlist.append(env['name']) # Return as a JSON list -if ("quick" in options) and (len(outlist) > 3): - print(json.dumps(random.sample(outlist, 3))) -else: - print(json.dumps(outlist)) +print(json.dumps(outlist)) diff --git a/variants/esp32/rak11200/platformio.ini b/variants/esp32/rak11200/platformio.ini index 6149333f6..170e80b41 100644 --- a/variants/esp32/rak11200/platformio.ini +++ b/variants/esp32/rak11200/platformio.ini @@ -1,6 +1,7 @@ [env:rak11200] extends = esp32_base board = wiscore_rak11200 +board_level = pr board_check = true build_flags = ${esp32_base.build_flags} diff --git a/variants/esp32/tbeam/platformio.ini b/variants/esp32/tbeam/platformio.ini index 084a981da..ea17751c6 100644 --- a/variants/esp32/tbeam/platformio.ini +++ b/variants/esp32/tbeam/platformio.ini @@ -2,6 +2,7 @@ [env:tbeam] extends = esp32_base board = ttgo-t-beam +board_level = pr board_check = true lib_deps = ${esp32_base.lib_deps} diff --git a/variants/esp32c3/heltec_esp32c3/platformio.ini b/variants/esp32c3/heltec_esp32c3/platformio.ini index d21d64d2a..705e2e996 100644 --- a/variants/esp32c3/heltec_esp32c3/platformio.ini +++ b/variants/esp32c3/heltec_esp32c3/platformio.ini @@ -1,6 +1,7 @@ [env:heltec-ht62-esp32c3-sx1262] extends = esp32c3_base board = esp32-c3-devkitm-1 +board_level = pr build_flags = ${esp32_base.build_flags} -D HELTEC_HT62 diff --git a/variants/esp32c6/tlora_c6/platformio.ini b/variants/esp32c6/tlora_c6/platformio.ini index a06306add..6b402d7c5 100644 --- a/variants/esp32c6/tlora_c6/platformio.ini +++ b/variants/esp32c6/tlora_c6/platformio.ini @@ -1,6 +1,7 @@ [env:tlora-c6] extends = esp32c6_base board = esp32-c6-devkitm-1 +board_level = pr build_flags = ${esp32c6_base.build_flags} -D TLORA_C6 diff --git a/variants/esp32s3/elecrow_panel/platformio.ini b/variants/esp32s3/elecrow_panel/platformio.ini index 203a4c0d0..59bc26000 100644 --- a/variants/esp32s3/elecrow_panel/platformio.ini +++ b/variants/esp32s3/elecrow_panel/platformio.ini @@ -98,6 +98,7 @@ build_flags = [env:elecrow-adv-35-tft] extends = crowpanel_small_esp32s3_base +board_level = pr build_flags = ${crowpanel_small_esp32s3_base.build_flags} -D LV_CACHE_DEF_SIZE=2097152 diff --git a/variants/esp32s3/heltec_v3/platformio.ini b/variants/esp32s3/heltec_v3/platformio.ini index 8dda72ceb..b521e11ca 100644 --- a/variants/esp32s3/heltec_v3/platformio.ini +++ b/variants/esp32s3/heltec_v3/platformio.ini @@ -1,6 +1,7 @@ [env:heltec-v3] extends = esp32s3_base board = heltec_wifi_lora_32_V3 +board_level = pr board_check = true board_build.partitions = default_8MB.csv build_flags = diff --git a/variants/esp32s3/heltec_vision_master_e213/platformio.ini b/variants/esp32s3/heltec_vision_master_e213/platformio.ini index 2b4eebe64..43f6199af 100644 --- a/variants/esp32s3/heltec_vision_master_e213/platformio.ini +++ b/variants/esp32s3/heltec_vision_master_e213/platformio.ini @@ -24,6 +24,7 @@ upload_speed = 115200 [env:heltec-vision-master-e213-inkhud] extends = esp32s3_base, inkhud board = heltec_vision_master_e213 +board_level = pr board_build.partitions = default_8MB.csv build_src_filter = ${esp32_base.build_src_filter} diff --git a/variants/esp32s3/rak3312/platformio.ini b/variants/esp32s3/rak3312/platformio.ini index 50b0c5020..0de36498f 100644 --- a/variants/esp32s3/rak3312/platformio.ini +++ b/variants/esp32s3/rak3312/platformio.ini @@ -1,6 +1,7 @@ [env:rak3312] extends = esp32s3_base board = wiscore_rak3312 +board_level = pr board_check = true upload_protocol = esptool diff --git a/variants/esp32s3/seeed-sensecap-indicator/platformio.ini b/variants/esp32s3/seeed-sensecap-indicator/platformio.ini index 1d55b31ca..f408054cf 100644 --- a/variants/esp32s3/seeed-sensecap-indicator/platformio.ini +++ b/variants/esp32s3/seeed-sensecap-indicator/platformio.ini @@ -31,7 +31,7 @@ lib_deps = ${esp32s3_base.lib_deps} [env:seeed-sensecap-indicator-tft] extends = env:seeed-sensecap-indicator -board_level = main +board_level = pr upload_speed = 460800 build_flags = diff --git a/variants/esp32s3/seeed_xiao_s3/platformio.ini b/variants/esp32s3/seeed_xiao_s3/platformio.ini index ad09efabd..ffc6e9638 100644 --- a/variants/esp32s3/seeed_xiao_s3/platformio.ini +++ b/variants/esp32s3/seeed_xiao_s3/platformio.ini @@ -1,6 +1,7 @@ [env:seeed-xiao-s3] extends = esp32s3_base board = seeed-xiao-s3 +board_level = pr board_check = true board_build.partitions = default_8MB.csv upload_protocol = esptool diff --git a/variants/esp32s3/station-g2/platformio.ini b/variants/esp32s3/station-g2/platformio.ini index 0aed5e7ce..056d543d9 100755 --- a/variants/esp32s3/station-g2/platformio.ini +++ b/variants/esp32s3/station-g2/platformio.ini @@ -1,6 +1,7 @@ [env:station-g2] extends = esp32s3_base board = station-g2 +board_level = pr board_check = true board_build.partitions = default_16MB.csv board_build.mcu = esp32s3 diff --git a/variants/esp32s3/t-deck/platformio.ini b/variants/esp32s3/t-deck/platformio.ini index 9d55ee365..7c8070c3e 100644 --- a/variants/esp32s3/t-deck/platformio.ini +++ b/variants/esp32s3/t-deck/platformio.ini @@ -19,6 +19,7 @@ lib_deps = ${esp32s3_base.lib_deps} [env:t-deck-tft] extends = env:t-deck +board_level = pr build_flags = ${env:t-deck.build_flags} diff --git a/variants/esp32s3/t-eth-elite/platformio.ini b/variants/esp32s3/t-eth-elite/platformio.ini index 889270ceb..6107185ce 100644 --- a/variants/esp32s3/t-eth-elite/platformio.ini +++ b/variants/esp32s3/t-eth-elite/platformio.ini @@ -1,6 +1,7 @@ [env:t-eth-elite] extends = esp32s3_base board = esp32s3box +board_level = pr board_check = true board_build.partitions = default_16MB.csv build_flags = diff --git a/variants/nrf52840/heltec_mesh_node_t114/platformio.ini b/variants/nrf52840/heltec_mesh_node_t114/platformio.ini index ead787bb1..c7b30b339 100644 --- a/variants/nrf52840/heltec_mesh_node_t114/platformio.ini +++ b/variants/nrf52840/heltec_mesh_node_t114/platformio.ini @@ -2,6 +2,7 @@ [env:heltec-mesh-node-t114] extends = nrf52840_base board = heltec_mesh_node_t114 +board_level = pr debug_tool = jlink # add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling. diff --git a/variants/nrf52840/rak4631/platformio.ini b/variants/nrf52840/rak4631/platformio.ini index 7b695779c..199e17570 100644 --- a/variants/nrf52840/rak4631/platformio.ini +++ b/variants/nrf52840/rak4631/platformio.ini @@ -2,6 +2,7 @@ [env:rak4631] extends = nrf52840_base board = wiscore_rak4631 +board_level = pr board_check = true build_flags = ${nrf52840_base.build_flags} -I variants/nrf52840/rak4631 diff --git a/variants/nrf52840/seeed_xiao_nrf52840_kit/platformio.ini b/variants/nrf52840/seeed_xiao_nrf52840_kit/platformio.ini index 27352875d..623eace71 100644 --- a/variants/nrf52840/seeed_xiao_nrf52840_kit/platformio.ini +++ b/variants/nrf52840/seeed_xiao_nrf52840_kit/platformio.ini @@ -2,6 +2,7 @@ [env:seeed_xiao_nrf52840_kit] extends = nrf52840_base board = xiao_ble_sense +board_level = pr build_flags = ${nrf52840_base.build_flags} -Ivariants/nrf52840/seeed_xiao_nrf52840_kit -Isrc/platform/nrf52/softdevice diff --git a/variants/nrf52840/t-echo/platformio.ini b/variants/nrf52840/t-echo/platformio.ini index b80958d5d..6541c9796 100644 --- a/variants/nrf52840/t-echo/platformio.ini +++ b/variants/nrf52840/t-echo/platformio.ini @@ -2,6 +2,7 @@ [env:t-echo] extends = nrf52840_base board = t-echo +board_level = pr board_check = true debug_tool = jlink @@ -27,6 +28,7 @@ lib_deps = [env:t-echo-inkhud] extends = nrf52840_base, inkhud board = t-echo +board_level = pr board_check = true debug_tool = jlink build_flags = diff --git a/variants/nrf52840/tracker-t1000-e/platformio.ini b/variants/nrf52840/tracker-t1000-e/platformio.ini index 45c8c5d00..c6c3f269c 100644 --- a/variants/nrf52840/tracker-t1000-e/platformio.ini +++ b/variants/nrf52840/tracker-t1000-e/platformio.ini @@ -1,6 +1,7 @@ [env:tracker-t1000-e] extends = nrf52840_base board = tracker-t1000-e +board_level = pr build_flags = ${nrf52840_base.build_flags} -Ivariants/nrf52840/tracker-t1000-e -Isrc/platform/nrf52/softdevice diff --git a/variants/rp2040/rak11310/platformio.ini b/variants/rp2040/rak11310/platformio.ini index aca24656b..f3eaa176e 100644 --- a/variants/rp2040/rak11310/platformio.ini +++ b/variants/rp2040/rak11310/platformio.ini @@ -1,6 +1,7 @@ [env:rak11310] extends = rp2040_base board = rakwireless_rak11300 +board_level = pr upload_protocol = picotool # add our variants files to the include and src paths build_flags = diff --git a/variants/rp2040/rpipico/platformio.ini b/variants/rp2040/rpipico/platformio.ini index 81db2a312..a6171bbac 100644 --- a/variants/rp2040/rpipico/platformio.ini +++ b/variants/rp2040/rpipico/platformio.ini @@ -1,6 +1,7 @@ [env:pico] extends = rp2040_base board = rpipico +board_level = pr upload_protocol = picotool # add our variants files to the include and src paths diff --git a/variants/rp2040/rpipicow/platformio.ini b/variants/rp2040/rpipicow/platformio.ini index f3fd07f8d..658d113d7 100644 --- a/variants/rp2040/rpipicow/platformio.ini +++ b/variants/rp2040/rpipicow/platformio.ini @@ -1,6 +1,7 @@ [env:picow] extends = rp2040_base board = rpipicow +board_level = pr upload_protocol = picotool # add our variants files to the include and src paths build_flags = diff --git a/variants/rp2350/rpipico2/platformio.ini b/variants/rp2350/rpipico2/platformio.ini index 485523eb0..ad7a4ce51 100644 --- a/variants/rp2350/rpipico2/platformio.ini +++ b/variants/rp2350/rpipico2/platformio.ini @@ -1,6 +1,7 @@ [env:pico2] extends = rp2350_base board = rpipico2 +board_level = pr upload_protocol = picotool # add our variants files to the include and src paths diff --git a/variants/rp2350/rpipico2w/platformio.ini b/variants/rp2350/rpipico2w/platformio.ini index 3e5f2dbdd..59b1354b4 100644 --- a/variants/rp2350/rpipico2w/platformio.ini +++ b/variants/rp2350/rpipico2w/platformio.ini @@ -1,6 +1,7 @@ [env:pico2w] extends = rp2350_base board = rpipico2w +board_level = pr upload_protocol = jlink # debug settings for external openocd with RP2040 support (custom build) debug_tool = custom diff --git a/variants/stm32/rak3172/platformio.ini b/variants/stm32/rak3172/platformio.ini index 9799fc879..4f9edbb92 100644 --- a/variants/stm32/rak3172/platformio.ini +++ b/variants/stm32/rak3172/platformio.ini @@ -1,6 +1,7 @@ [env:rak3172] extends = stm32_base board = wiscore_rak3172 +board_level = pr board_upload.maximum_size = 233472 ; reserve the last 28KB for filesystem build_flags = ${stm32_base.build_flags} diff --git a/variants/stm32/wio-e5/platformio.ini b/variants/stm32/wio-e5/platformio.ini index c057946dd..a9fcf51d6 100644 --- a/variants/stm32/wio-e5/platformio.ini +++ b/variants/stm32/wio-e5/platformio.ini @@ -1,6 +1,7 @@ [env:wio-e5] extends = stm32_base board = lora_e5_dev_board +board_level = pr board_upload.maximum_size = 233472 ; reserve the last 28KB for filesystem build_flags = ${stm32_base.build_flags} From 7a4a91531288bf250d53b4313f36fd4d7802d2b1 Mon Sep 17 00:00:00 2001 From: Wilson Date: Fri, 25 Jul 2025 06:23:45 +0800 Subject: [PATCH 062/180] Add Trace Route on BaseUI (#7386) * Add TraceRoute function to menus and modules to support node path tracing * Adjust text spacing and line wrapping logic in trace route result result. * Add HAS_SCREEN for TraceRouteModule drawFrame. --------- Co-authored-by: Tom Fifield Co-authored-by: Ben Meadors --- src/graphics/draw/MenuHandler.cpp | 31 +- src/graphics/draw/MenuHandler.h | 4 +- src/modules/TraceRouteModule.cpp | 585 +++++++++++++++++++++++++++++- src/modules/TraceRouteModule.h | 39 +- 4 files changed, 652 insertions(+), 7 deletions(-) diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index 5eaa2c6bf..731cae3df 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -14,6 +14,7 @@ #include "modules/AdminModule.h" #include "modules/CannedMessageModule.h" #include "modules/KeyVerificationModule.h" +#include "modules/TraceRouteModule.h" extern uint16_t TFT_MESH; @@ -428,7 +429,7 @@ void menuHandler::systemBaseMenu() void menuHandler::favoriteBaseMenu() { - enum optionsNumbers { Back, Preset, Freetext, Remove, enumEnd }; + enum optionsNumbers { Back, Preset, Freetext, Remove, TraceRoute, enumEnd }; static const char *optionsArray[enumEnd] = {"Back", "New Preset Msg"}; static int optionsEnumArray[enumEnd] = {Back, Preset}; int options = 2; @@ -437,6 +438,8 @@ void menuHandler::favoriteBaseMenu() optionsArray[options] = "New Freetext Msg"; optionsEnumArray[options++] = Freetext; } + optionsArray[options] = "Trace Route"; + optionsEnumArray[options++] = TraceRoute; optionsArray[options] = "Remove Favorite"; optionsEnumArray[options++] = Remove; @@ -453,6 +456,10 @@ void menuHandler::favoriteBaseMenu() } else if (selected == Remove) { menuHandler::menuQueue = menuHandler::remove_favorite; screen->runNow(); + } else if (selected == TraceRoute) { + if (traceRouteModule) { + traceRouteModule->launch(graphics::UIRenderer::currentFavoriteNodeNum); + } } }; screen->showOverlayBanner(bannerOptions); @@ -491,12 +498,12 @@ void menuHandler::positionBaseMenu() void menuHandler::nodeListMenu() { - enum optionsNumbers { Back, Favorite, Verify, Reset }; - static const char *optionsArray[] = {"Back", "Add Favorite", "Key Verification", "Reset NodeDB"}; + enum optionsNumbers { Back, Favorite, TraceRoute, Verify, Reset, enumEnd }; + static const char *optionsArray[] = {"Back", "Add Favorite", "Trace Route", "Key Verification", "Reset NodeDB"}; BannerOverlayOptions bannerOptions; bannerOptions.message = "Node Action"; bannerOptions.optionsArrayPtr = optionsArray; - bannerOptions.optionsCount = 4; + bannerOptions.optionsCount = 5; bannerOptions.bannerCallback = [](int selected) -> void { if (selected == Favorite) { menuQueue = add_favorite; @@ -507,6 +514,9 @@ void menuHandler::nodeListMenu() } else if (selected == Reset) { menuQueue = reset_node_db_menu; screen->runNow(); + } else if (selected == TraceRoute) { + menuQueue = trace_route_menu; + screen->runNow(); } }; screen->showOverlayBanner(bannerOptions); @@ -859,6 +869,16 @@ void menuHandler::removeFavoriteMenu() screen->showOverlayBanner(bannerOptions); } +void menuHandler::traceRouteMenu() +{ + screen->showNodePicker("Node to Trace", 30000, [](uint32_t nodenum) -> void { + LOG_INFO("Menu: Node picker selected node 0x%08x, traceRouteModule=%p", nodenum, traceRouteModule); + if (traceRouteModule) { + traceRouteModule->startTraceRoute(nodenum); + } + }); +} + void menuHandler::testMenu() { @@ -1131,6 +1151,9 @@ void menuHandler::handleMenuSwitch(OLEDDisplay *display) case remove_favorite: removeFavoriteMenu(); break; + case trace_route_menu: + traceRouteMenu(); + break; case test_menu: testMenu(); break; diff --git a/src/graphics/draw/MenuHandler.h b/src/graphics/draw/MenuHandler.h index 1f989be79..2e4923241 100644 --- a/src/graphics/draw/MenuHandler.h +++ b/src/graphics/draw/MenuHandler.h @@ -36,7 +36,8 @@ class menuHandler system_base_menu, key_verification_init, key_verification_final_prompt, - throttle_message + trace_route_menu, + throttle_message, }; static screenMenus menuQueue; @@ -64,6 +65,7 @@ class menuHandler static void shutdownMenu(); static void addFavoriteMenu(); static void removeFavoriteMenu(); + static void traceRouteMenu(); static void testMenu(); static void numberTest(); static void wifiBaseMenu(); diff --git a/src/modules/TraceRouteModule.cpp b/src/modules/TraceRouteModule.cpp index 41cb35649..bd75c6983 100644 --- a/src/modules/TraceRouteModule.cpp +++ b/src/modules/TraceRouteModule.cpp @@ -1,6 +1,13 @@ #include "TraceRouteModule.h" #include "MeshService.h" +#include "graphics/Screen.h" +#include "graphics/ScreenFonts.h" +#include "graphics/SharedUIDisplay.h" +#include "mesh/Router.h" #include "meshUtils.h" +#include + +extern graphics::Screen *screen; TraceRouteModule *traceRouteModule; @@ -27,6 +34,123 @@ void TraceRouteModule::alterReceivedProtobuf(meshtastic_MeshPacket &p, meshtasti // Set updated route to the payload of the to be flooded packet p.decoded.payload.size = pb_encode_to_bytes(p.decoded.payload.bytes, sizeof(p.decoded.payload.bytes), &meshtastic_RouteDiscovery_msg, r); + + if (tracingNode != 0) { + // check isResponseFromTarget + bool isResponseFromTarget = (incoming.request_id != 0 && p.from == tracingNode); + bool isRequestToUs = (incoming.request_id == 0 && p.to == nodeDB->getNodeNum() && tracingNode != 0); + + // Check if this is a trace route response containing our target node + bool containsTargetNode = false; + for (uint8_t i = 0; i < r->route_count; i++) { + if (r->route[i] == tracingNode) { + containsTargetNode = true; + break; + } + } + for (uint8_t i = 0; i < r->route_back_count; i++) { + if (r->route_back[i] == tracingNode) { + containsTargetNode = true; + break; + } + } + + // Check if this response contains a complete route to our target + bool hasCompleteRoute = (r->route_count > 0 && r->route_back_count > 0) || + (containsTargetNode && (r->route_count > 0 || r->route_back_count > 0)); + + LOG_INFO("TracRoute packet analysis: tracingNode=0x%08x, p.from=0x%08x, p.to=0x%08x, request_id=0x%08x", tracingNode, + p.from, p.to, incoming.request_id); + LOG_INFO("TracRoute conditions: isResponseFromTarget=%d, isRequestToUs=%d, containsTargetNode=%d, hasCompleteRoute=%d", + isResponseFromTarget, isRequestToUs, containsTargetNode, hasCompleteRoute); + + if (isResponseFromTarget || isRequestToUs || (containsTargetNode && hasCompleteRoute)) { + LOG_INFO("TracRoute result detected: isResponseFromTarget=%d, isRequestToUs=%d", isResponseFromTarget, isRequestToUs); + + LOG_INFO("SNR arrays - towards_count=%d, back_count=%d", r->snr_towards_count, r->snr_back_count); + for (int i = 0; i < r->snr_towards_count; i++) { + LOG_INFO("SNR towards[%d] = %d (%.1fdB)", i, r->snr_towards[i], (float)r->snr_towards[i] / 4.0f); + } + for (int i = 0; i < r->snr_back_count; i++) { + LOG_INFO("SNR back[%d] = %d (%.1fdB)", i, r->snr_back[i], (float)r->snr_back[i] / 4.0f); + } + + String result = ""; + + // Show request path (from initiator to target) + if (r->route_count > 0) { + result += getNodeName(nodeDB->getNodeNum()); + for (uint8_t i = 0; i < r->route_count; i++) { + result += " > "; + const char *name = getNodeName(r->route[i]); + float snr = + (i < r->snr_towards_count && r->snr_towards[i] != INT8_MIN) ? ((float)r->snr_towards[i] / 4.0f) : 0.0f; + result += name; + if (snr != 0.0f) { + result += "("; + result += String(snr, 1); + result += "dB)"; + } + } + result += " > "; + result += getNodeName(tracingNode); + if (r->snr_towards_count > 0 && r->snr_towards[r->snr_towards_count - 1] != INT8_MIN) { + result += "("; + result += String((float)r->snr_towards[r->snr_towards_count - 1] / 4.0f, 1); + result += "dB)"; + } + result += "\n"; + } else { + // Direct connection (no intermediate hops) + result += getNodeName(nodeDB->getNodeNum()); + result += " > "; + result += getNodeName(tracingNode); + if (r->snr_towards_count > 0 && r->snr_towards[0] != INT8_MIN) { + result += "("; + result += String((float)r->snr_towards[0] / 4.0f, 1); + result += "dB)"; + } + result += "\n"; + } + + // Show response path (from target back to initiator) + if (r->route_back_count > 0) { + result += getNodeName(tracingNode); + for (int8_t i = r->route_back_count - 1; i >= 0; i--) { + result += " > "; + const char *name = getNodeName(r->route_back[i]); + float snr = (i < r->snr_back_count && r->snr_back[i] != INT8_MIN) ? ((float)r->snr_back[i] / 4.0f) : 0.0f; + result += name; + if (snr != 0.0f) { + result += "("; + result += String(snr, 1); + result += "dB)"; + } + } + // add initiator node + result += " > "; + result += getNodeName(nodeDB->getNodeNum()); + if (r->snr_back_count > 0 && r->snr_back[r->snr_back_count - 1] != INT8_MIN) { + result += "("; + result += String((float)r->snr_back[r->snr_back_count - 1] / 4.0f, 1); + result += "dB)"; + } + } else { + // Direct return path (no intermediate hops) + result += getNodeName(tracingNode); + result += " > "; + result += getNodeName(nodeDB->getNodeNum()); + if (r->snr_back_count > 0 && r->snr_back[0] != INT8_MIN) { + result += "("; + result += String((float)r->snr_back[0] / 4.0f, 1); + result += "dB)"; + } + } + + LOG_INFO("Trace route result: %s", result.c_str()); + handleTraceRouteResult(result); + } + } } void TraceRouteModule::insertUnknownHops(meshtastic_MeshPacket &p, meshtastic_RouteDiscovery *r, bool isTowardsDestination) @@ -173,8 +297,467 @@ meshtastic_MeshPacket *TraceRouteModule::allocReply() } TraceRouteModule::TraceRouteModule() - : ProtobufModule("traceroute", meshtastic_PortNum_TRACEROUTE_APP, &meshtastic_RouteDiscovery_msg) + : ProtobufModule("traceroute", meshtastic_PortNum_TRACEROUTE_APP, &meshtastic_RouteDiscovery_msg), OSThread("TraceRoute") { ourPortNum = meshtastic_PortNum_TRACEROUTE_APP; isPromiscuous = true; // We need to update the route even if it is not destined to us +} + +const char *TraceRouteModule::getNodeName(NodeNum node) +{ + meshtastic_NodeInfoLite *info = nodeDB->getMeshNode(node); + if (info && info->has_user) { + if (strlen(info->user.short_name) > 0) { + return info->user.short_name; + } + if (strlen(info->user.long_name) > 0) { + return info->user.long_name; + } + } + + static char fallback[12]; + snprintf(fallback, sizeof(fallback), "0x%08x", node); + return fallback; +} + +bool TraceRouteModule::startTraceRoute(NodeNum node) +{ + LOG_INFO("=== TraceRoute startTraceRoute CALLED: node=0x%08x ===", node); + unsigned long now = millis(); + + if (node == 0 || node == NODENUM_BROADCAST) { + LOG_ERROR("Invalid node number for trace route: 0x%08x", node); + runState = TRACEROUTE_STATE_RESULT; + resultText = "Invalid node"; + resultShowTime = millis(); + tracingNode = 0; + + requestFocus(); + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); + return false; + } + + if (node == nodeDB->getNodeNum()) { + LOG_ERROR("Cannot trace route to self: 0x%08x", node); + runState = TRACEROUTE_STATE_RESULT; + resultText = "Cannot trace self"; + resultShowTime = millis(); + tracingNode = 0; + + requestFocus(); + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); + return false; + } + + if (!initialized) { + lastTraceRouteTime = 0; + initialized = true; + LOG_INFO("TraceRoute initialized for first time"); + } + + if (runState == TRACEROUTE_STATE_TRACKING) { + LOG_INFO("TraceRoute already in progress"); + return false; + } + + if (initialized && lastTraceRouteTime > 0 && now - lastTraceRouteTime < cooldownMs) { + // Cooldown + unsigned long wait = (cooldownMs - (now - lastTraceRouteTime)) / 1000; + bannerText = String("Wait for ") + String(wait) + String("s"); + runState = TRACEROUTE_STATE_COOLDOWN; + + requestFocus(); + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); + LOG_INFO("Cooldown active, please wait %lu seconds before starting a new trace route.", wait); + return false; + } + + tracingNode = node; + lastTraceRouteTime = now; + runState = TRACEROUTE_STATE_TRACKING; + bannerText = String("Tracing ") + getNodeName(node); + + LOG_INFO("TraceRoute UI: Starting trace route to node 0x%08x, requesting focus", node); + + // 请求焦点,然后触发UI更新事件 + requestFocus(); + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); + + // 设置定时器来处理超时检查 + setIntervalFromNow(1000); // 每秒检查一次状态 + + meshtastic_RouteDiscovery req = meshtastic_RouteDiscovery_init_zero; + LOG_INFO("Creating RouteDiscovery protobuf..."); + + // Allocate a packet directly from router like the reference code + meshtastic_MeshPacket *p = router->allocForSending(); + if (p) { + // Set destination and port + p->to = node; + p->decoded.portnum = meshtastic_PortNum_TRACEROUTE_APP; + p->decoded.want_response = true; + + // Manually encode the RouteDiscovery payload + p->decoded.payload.size = + pb_encode_to_bytes(p->decoded.payload.bytes, sizeof(p->decoded.payload.bytes), &meshtastic_RouteDiscovery_msg, &req); + + LOG_INFO("Packet allocated successfully: to=0x%08x, portnum=%d, want_response=%d, payload_size=%d", p->to, + p->decoded.portnum, p->decoded.want_response, p->decoded.payload.size); + LOG_INFO("About to call service->sendToMesh..."); + + if (service) { + LOG_INFO("MeshService is available, sending packet..."); + service->sendToMesh(p, RX_SRC_USER); + LOG_INFO("sendToMesh called successfully for trace route to node 0x%08x", node); + } else { + LOG_ERROR("MeshService is NULL!"); + runState = TRACEROUTE_STATE_RESULT; + resultText = "Service unavailable"; + resultShowTime = millis(); + tracingNode = 0; + + requestFocus(); + UIFrameEvent e2; + e2.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e2); + return false; + } + } else { + LOG_ERROR("Failed to allocate TraceRoute packet from router"); + runState = TRACEROUTE_STATE_RESULT; + resultText = "Failed to send"; + resultShowTime = millis(); + tracingNode = 0; + + requestFocus(); + UIFrameEvent e2; + e2.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e2); + return false; + } + return true; +} + +void TraceRouteModule::launch(NodeNum node) +{ + if (node == 0 || node == NODENUM_BROADCAST) { + LOG_ERROR("Invalid node number for trace route: 0x%08x", node); + runState = TRACEROUTE_STATE_RESULT; + resultText = "Invalid node"; + resultShowTime = millis(); + tracingNode = 0; + + requestFocus(); + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); + return; + } + + if (node == nodeDB->getNodeNum()) { + LOG_ERROR("Cannot trace route to self: 0x%08x", node); + runState = TRACEROUTE_STATE_RESULT; + resultText = "Cannot trace self"; + resultShowTime = millis(); + tracingNode = 0; + + requestFocus(); + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); + return; + } + + if (!initialized) { + lastTraceRouteTime = 0; + initialized = true; + LOG_INFO("TraceRoute initialized for first time"); + } + + unsigned long now = millis(); + if (initialized && lastTraceRouteTime > 0 && now - lastTraceRouteTime < cooldownMs) { + unsigned long wait = (cooldownMs - (now - lastTraceRouteTime)) / 1000; + bannerText = String("Wait for ") + String(wait) + String("s"); + runState = TRACEROUTE_STATE_COOLDOWN; + + requestFocus(); + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); + LOG_INFO("Cooldown active, please wait %lu seconds before starting a new trace route.", wait); + return; + } + + runState = TRACEROUTE_STATE_TRACKING; + tracingNode = node; + lastTraceRouteTime = now; + bannerText = String("Tracing ") + getNodeName(node); + + requestFocus(); + + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); + + setIntervalFromNow(1000); + + meshtastic_RouteDiscovery req = meshtastic_RouteDiscovery_init_zero; + LOG_INFO("Creating RouteDiscovery protobuf..."); + + meshtastic_MeshPacket *p = router->allocForSending(); + if (p) { + p->to = node; + p->decoded.portnum = meshtastic_PortNum_TRACEROUTE_APP; + p->decoded.want_response = true; + + p->decoded.payload.size = + pb_encode_to_bytes(p->decoded.payload.bytes, sizeof(p->decoded.payload.bytes), &meshtastic_RouteDiscovery_msg, &req); + + LOG_INFO("Packet allocated successfully: to=0x%08x, portnum=%d, want_response=%d, payload_size=%d", p->to, + p->decoded.portnum, p->decoded.want_response, p->decoded.payload.size); + + if (service) { + service->sendToMesh(p, RX_SRC_USER); + LOG_INFO("sendToMesh called successfully for trace route to node 0x%08x", node); + } else { + LOG_ERROR("MeshService is NULL!"); + runState = TRACEROUTE_STATE_RESULT; + resultText = "Service unavailable"; + resultShowTime = millis(); + tracingNode = 0; + } + } else { + LOG_ERROR("Failed to allocate TraceRoute packet from router"); + runState = TRACEROUTE_STATE_RESULT; + resultText = "Failed to send"; + resultShowTime = millis(); + tracingNode = 0; + } +} + +void TraceRouteModule::handleTraceRouteResult(const String &result) +{ + resultText = result; + runState = TRACEROUTE_STATE_RESULT; + resultShowTime = millis(); + tracingNode = 0; + + LOG_INFO("TraceRoute result ready, requesting focus. Result: %s", result.c_str()); + + setIntervalFromNow(1000); + + requestFocus(); + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); + + LOG_INFO("=== TraceRoute handleTraceRouteResult END ==="); +} + +bool TraceRouteModule::shouldDraw() +{ + bool draw = (runState != TRACEROUTE_STATE_IDLE); + static TraceRouteRunState lastLoggedState = TRACEROUTE_STATE_IDLE; + if (runState != lastLoggedState) { + LOG_INFO("TraceRoute shouldDraw: runState=%d, draw=%d", runState, draw); + lastLoggedState = runState; + } + return draw; +} +#if HAS_SCREEN +void TraceRouteModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) +{ + LOG_DEBUG("TraceRoute drawFrame called: runState=%d", runState); + + display->setTextAlignment(TEXT_ALIGN_CENTER); + + if (runState == TRACEROUTE_STATE_TRACKING) { + display->setFont(FONT_MEDIUM); + int centerY = y + (display->getHeight() / 2) - (FONT_HEIGHT_MEDIUM / 2); + display->drawString(display->getWidth() / 2 + x, centerY, bannerText); + + } else if (runState == TRACEROUTE_STATE_RESULT) { + display->setFont(FONT_MEDIUM); + display->setTextAlignment(TEXT_ALIGN_LEFT); + + display->drawString(x, y, "Route Result"); + + int contentStartY = y + FONT_HEIGHT_MEDIUM + 2; // Add more spacing after title + display->setTextAlignment(TEXT_ALIGN_LEFT); + display->setFont(FONT_SMALL); + + if (resultText.length() > 0) { + std::vector lines; + String currentLine = ""; + int maxWidth = display->getWidth() - 4; + + int start = 0; + int newlinePos = resultText.indexOf('\n', start); + + while (newlinePos != -1 || start < resultText.length()) { + String segment; + if (newlinePos != -1) { + segment = resultText.substring(start, newlinePos); + start = newlinePos + 1; + newlinePos = resultText.indexOf('\n', start); + } else { + segment = resultText.substring(start); + start = resultText.length(); + } + + if (display->getStringWidth(segment) <= maxWidth) { + lines.push_back(segment); + } else { + // Try to break at better positions (space, >, <, -) + String remaining = segment; + + while (remaining.length() > 0) { + String tempLine = ""; + int lastGoodBreak = -1; + bool lineComplete = false; + + for (int i = 0; i < remaining.length(); i++) { + char ch = remaining.charAt(i); + String testLine = tempLine + ch; + + if (display->getStringWidth(testLine) > maxWidth) { + if (lastGoodBreak >= 0) { + // Break at the last good position + lines.push_back(remaining.substring(0, lastGoodBreak + 1)); + remaining = remaining.substring(lastGoodBreak + 1); + lineComplete = true; + break; + } else if (tempLine.length() > 0) { + lines.push_back(tempLine); + remaining = remaining.substring(i); + lineComplete = true; + break; + } else { + // Single character exceeds width + lines.push_back(String(ch)); + remaining = remaining.substring(i + 1); + lineComplete = true; + break; + } + } else { + tempLine = testLine; + // Mark good break positions + if (ch == ' ' || ch == '>' || ch == '<' || ch == '-' || ch == '(' || ch == ')') { + lastGoodBreak = i; + } + } + } + + if (!lineComplete) { + // Reached end of remaining text + if (tempLine.length() > 0) { + lines.push_back(tempLine); + } + break; + } + } + } + } + + int lineHeight = FONT_HEIGHT_SMALL + 1; // Use proper font height with 1px spacing + for (size_t i = 0; i < lines.size(); i++) { + int lineY = contentStartY + (i * lineHeight); + if (lineY + FONT_HEIGHT_SMALL <= display->getHeight()) { + display->drawString(x + 2, lineY, lines[i]); + } + } + } + + } else if (runState == TRACEROUTE_STATE_COOLDOWN) { + display->setFont(FONT_MEDIUM); + int centerY = y + (display->getHeight() / 2) - (FONT_HEIGHT_MEDIUM / 2); + display->drawString(display->getWidth() / 2 + x, centerY, bannerText); + } +} +#endif // HAS_SCREEN +int32_t TraceRouteModule::runOnce() +{ + unsigned long now = millis(); + + if (runState == TRACEROUTE_STATE_IDLE) { + return INT32_MAX; + } + + // Check for tracking timeout + if (runState == TRACEROUTE_STATE_TRACKING && now - lastTraceRouteTime > trackingTimeoutMs) { + LOG_INFO("TraceRoute timeout, no response received"); + runState = TRACEROUTE_STATE_RESULT; + resultText = "No response received"; + resultShowTime = now; + tracingNode = 0; + + requestFocus(); + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); + + setIntervalFromNow(resultDisplayMs); + return resultDisplayMs; + } + + // Update cooldown display every second + if (runState == TRACEROUTE_STATE_COOLDOWN) { + unsigned long wait = (cooldownMs - (now - lastTraceRouteTime)) / 1000; + if (wait > 0) { + String newBannerText = String("Wait for ") + String(wait) + String("s"); + bannerText = newBannerText; + LOG_INFO("TraceRoute cooldown: updating banner to %s", bannerText.c_str()); + + // Force flash UI + requestFocus(); + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); + + if (screen) { + screen->forceDisplay(); + } + + return 1000; + } else { + // Cooldown finished + LOG_INFO("TraceRoute cooldown finished, returning to IDLE"); + runState = TRACEROUTE_STATE_IDLE; + bannerText = ""; + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); + return INT32_MAX; + } + } + + if (runState == TRACEROUTE_STATE_RESULT) { + if (now - resultShowTime >= resultDisplayMs) { + LOG_INFO("TraceRoute result display timeout, returning to IDLE"); + runState = TRACEROUTE_STATE_IDLE; + resultText = ""; + bannerText = ""; + tracingNode = 0; + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); + return INT32_MAX; + } else { + return 1000; + } + } + + if (runState == TRACEROUTE_STATE_TRACKING) { + return 1000; + } + + return INT32_MAX; } \ No newline at end of file diff --git a/src/modules/TraceRouteModule.h b/src/modules/TraceRouteModule.h index afe2b3871..51d98826e 100644 --- a/src/modules/TraceRouteModule.h +++ b/src/modules/TraceRouteModule.h @@ -1,16 +1,40 @@ #pragma once #include "ProtobufModule.h" +#include "concurrency/OSThread.h" +#include "graphics/Screen.h" +#include "graphics/SharedUIDisplay.h" +#include "input/InputBroker.h" +#if HAS_SCREEN +#include "OLEDDisplayUi.h" +#endif #define ROUTE_SIZE sizeof(((meshtastic_RouteDiscovery *)0)->route) / sizeof(((meshtastic_RouteDiscovery *)0)->route[0]) /** * A module that traces the route to a certain destination node */ -class TraceRouteModule : public ProtobufModule +enum TraceRouteRunState { TRACEROUTE_STATE_IDLE, TRACEROUTE_STATE_TRACKING, TRACEROUTE_STATE_RESULT, TRACEROUTE_STATE_COOLDOWN }; + +class TraceRouteModule : public ProtobufModule, + public Observable, + private concurrency::OSThread { public: TraceRouteModule(); + bool startTraceRoute(NodeNum node); + void launch(NodeNum node); + void handleTraceRouteResult(const String &result); + bool shouldDraw(); +#if HAS_SCREEN + virtual void drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) override; +#endif + + const char *getNodeName(NodeNum node); + + virtual bool wantUIFrame() override { return shouldDraw(); } + virtual Observable *getUIFrameObservable() override { return this; } + protected: bool handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_RouteDiscovery *r) override; @@ -20,6 +44,8 @@ class TraceRouteModule : public ProtobufModule the route array containing the IDs of nodes this packet went through */ void alterReceivedProtobuf(meshtastic_MeshPacket &p, meshtastic_RouteDiscovery *r) override; + virtual int32_t runOnce() override; + private: // Call to add unknown hops (e.g. when a node couldn't decrypt it) to the route based on hopStart and current hopLimit void insertUnknownHops(meshtastic_MeshPacket &p, meshtastic_RouteDiscovery *r, bool isTowardsDestination); @@ -31,6 +57,17 @@ class TraceRouteModule : public ProtobufModule Set origin to where the request came from. Set dest to the ID of its destination, or NODENUM_BROADCAST if it has not yet arrived there. */ void printRoute(meshtastic_RouteDiscovery *r, uint32_t origin, uint32_t dest, bool isTowardsDestination); + + TraceRouteRunState runState = TRACEROUTE_STATE_IDLE; + unsigned long lastTraceRouteTime = 0; + unsigned long resultShowTime = 0; + unsigned long cooldownMs = 30000; + unsigned long resultDisplayMs = 10000; + unsigned long trackingTimeoutMs = 10000; + String bannerText; + String resultText; + NodeNum tracingNode = 0; + bool initialized = false; }; extern TraceRouteModule *traceRouteModule; \ No newline at end of file From d1fbf65c5d7db35e8ea52553d92aa6ba92596a61 Mon Sep 17 00:00:00 2001 From: Pedro <40841971+barbabarros@users.noreply.github.com> Date: Thu, 24 Jul 2025 23:57:40 -0300 Subject: [PATCH 063/180] Fix timezone definition for UTC in TZPicker function (#7442) --- src/graphics/draw/MenuHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index 731cae3df..dc6470565 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -188,7 +188,7 @@ void menuHandler::TZPicker() } else if (selected == 7) { // Eastern strncpy(config.device.tzdef, "EST5EDT,M3.2.0,M11.1.0", sizeof(config.device.tzdef)); } else if (selected == 8) { // UTC - strncpy(config.device.tzdef, "UTC", sizeof(config.device.tzdef)); + strncpy(config.device.tzdef, "UTC0", sizeof(config.device.tzdef)); } else if (selected == 9) { // EU/Western strncpy(config.device.tzdef, "GMT0BST,M3.5.0/1,M10.5.0", sizeof(config.device.tzdef)); } else if (selected == 10) { // EU/Central From bbe548bc980827145114b76260b1b2377dd633e5 Mon Sep 17 00:00:00 2001 From: Pedro <40841971+barbabarros@users.noreply.github.com> Date: Fri, 25 Jul 2025 00:42:42 -0300 Subject: [PATCH 064/180] Add BRT3 timezone option to TZPicker menu (#7438) --- src/graphics/draw/MenuHandler.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index dc6470565..cf19c4825 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -154,6 +154,7 @@ void menuHandler::TZPicker() "US/Mountain", "US/Central", "US/Eastern", + "BR/Brasilia", "UTC", "EU/Western", "EU/" @@ -168,7 +169,7 @@ void menuHandler::TZPicker() BannerOverlayOptions bannerOptions; bannerOptions.message = "Pick Timezone"; bannerOptions.optionsArrayPtr = optionsArray; - bannerOptions.optionsCount = 17; + bannerOptions.optionsCount = 19; bannerOptions.bannerCallback = [](int selected) -> void { if (selected == 0) { menuHandler::menuQueue = menuHandler::clock_menu; @@ -187,25 +188,27 @@ void menuHandler::TZPicker() strncpy(config.device.tzdef, "CST6CDT,M3.2.0,M11.1.0", sizeof(config.device.tzdef)); } else if (selected == 7) { // Eastern strncpy(config.device.tzdef, "EST5EDT,M3.2.0,M11.1.0", sizeof(config.device.tzdef)); - } else if (selected == 8) { // UTC + } else if (selected == 8) { // Brazil + strncpy(config.device.tzdef, "BRT3", sizeof(config.device.tzdef)); + } else if (selected == 9) { // UTC strncpy(config.device.tzdef, "UTC0", sizeof(config.device.tzdef)); - } else if (selected == 9) { // EU/Western + } else if (selected == 10) { // EU/Western strncpy(config.device.tzdef, "GMT0BST,M3.5.0/1,M10.5.0", sizeof(config.device.tzdef)); - } else if (selected == 10) { // EU/Central + } else if (selected == 11) { // EU/Central strncpy(config.device.tzdef, "CET-1CEST,M3.5.0,M10.5.0/3", sizeof(config.device.tzdef)); - } else if (selected == 11) { // EU/Eastern + } else if (selected == 12) { // EU/Eastern strncpy(config.device.tzdef, "EET-2EEST,M3.5.0/3,M10.5.0/4", sizeof(config.device.tzdef)); - } else if (selected == 12) { // Asia/Kolkata + } else if (selected == 13) { // Asia/Kolkata strncpy(config.device.tzdef, "IST-5:30", sizeof(config.device.tzdef)); - } else if (selected == 13) { // China + } else if (selected == 14) { // China strncpy(config.device.tzdef, "HKT-8", sizeof(config.device.tzdef)); - } else if (selected == 14) { // AU/AWST + } else if (selected == 15) { // AU/AWST strncpy(config.device.tzdef, "AWST-8", sizeof(config.device.tzdef)); - } else if (selected == 15) { // AU/ACST + } else if (selected == 16) { // AU/ACST strncpy(config.device.tzdef, "ACST-9:30ACDT,M10.1.0,M4.1.0/3", sizeof(config.device.tzdef)); - } else if (selected == 16) { // AU/AEST + } else if (selected == 17) { // AU/AEST strncpy(config.device.tzdef, "AEST-10AEDT,M10.1.0,M4.1.0/3", sizeof(config.device.tzdef)); - } else if (selected == 17) { // NZ + } else if (selected == 18) { // NZ strncpy(config.device.tzdef, "NZST-12NZDT,M9.5.0,M4.1.0/3", sizeof(config.device.tzdef)); } if (selected != 0) { From 4c6db2c5bdf04856e31e25668e28b8583e9e0925 Mon Sep 17 00:00:00 2001 From: Jason P Date: Fri, 25 Jul 2025 08:10:35 -0500 Subject: [PATCH 065/180] Fix MHz label (#7455) --- src/graphics/draw/DebugRenderer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/graphics/draw/DebugRenderer.cpp b/src/graphics/draw/DebugRenderer.cpp index 5420d1b4b..5d9b5a33b 100644 --- a/src/graphics/draw/DebugRenderer.cpp +++ b/src/graphics/draw/DebugRenderer.cpp @@ -412,9 +412,9 @@ void drawLoRaFocused(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, float freq = RadioLibInterface::instance->getFreq(); snprintf(freqStr, sizeof(freqStr), "%.3f", freq); if (config.lora.channel_num == 0) { - snprintf(frequencyslot, sizeof(frequencyslot), "Freq: %smhz", freqStr); + snprintf(frequencyslot, sizeof(frequencyslot), "Freq: %sMHz", freqStr); } else { - snprintf(frequencyslot, sizeof(frequencyslot), "Freq/Ch: %smhz (%d)", freqStr, config.lora.channel_num); + snprintf(frequencyslot, sizeof(frequencyslot), "Freq/Ch: %sMHz (%d)", freqStr, config.lora.channel_num); } size_t len = strlen(frequencyslot); if (len >= 4 && strcmp(frequencyslot + len - 4, " (0)") == 0) { From 4f57a2e2485778d92a98bc2e719a6314cc45539d Mon Sep 17 00:00:00 2001 From: Austin Date: Fri, 25 Jul 2025 16:25:50 -0400 Subject: [PATCH 066/180] Build RP2350 (Pi Pico 2) (#7441) --- .github/workflows/main_matrix.yml | 51 +++++++++++++++++++++--- bin/build-firmware.sh | 2 +- variants/rp2040/rpipicow/platformio.ini | 1 + variants/rp2350/rpipico2w/platformio.ini | 1 + 4 files changed, 48 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index c62d80888..a98bdc011 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -30,7 +30,16 @@ jobs: strategy: fail-fast: false matrix: - arch: [esp32, esp32s3, esp32c3, esp32c6, nrf52840, rp2040, stm32, check] + arch: + - esp32 + - esp32s3 + - esp32c3 + - esp32c6 + - nrf52840 + - rp2040 + - rp2350 + - stm32 + - check runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 @@ -56,6 +65,7 @@ jobs: esp32c6: ${{ steps.jsonStep.outputs.esp32c6 }} nrf52840: ${{ steps.jsonStep.outputs.nrf52840 }} rp2040: ${{ steps.jsonStep.outputs.rp2040 }} + rp2350: ${{ steps.jsonStep.outputs.rp2350 }} stm32: ${{ steps.jsonStep.outputs.stm32 }} check: ${{ steps.jsonStep.outputs.check }} @@ -145,7 +155,7 @@ jobs: pio_env: ${{ matrix.board }} platform: nrf52840 - build-rpi2040: + build-rp2040: needs: [setup, version] strategy: fail-fast: false @@ -156,6 +166,17 @@ jobs: pio_env: ${{ matrix.board }} platform: rp2040 + build-rp2350: + needs: [setup, version] + strategy: + fail-fast: false + matrix: ${{ fromJson(needs.setup.outputs.rp2350) }} + uses: ./.github/workflows/build_firmware.yml + with: + version: ${{ needs.version.outputs.long }} + pio_env: ${{ matrix.board }} + platform: rp2350 + build-stm32: needs: [setup, version] strategy: @@ -243,7 +264,15 @@ jobs: strategy: fail-fast: false matrix: - arch: [esp32, esp32s3, esp32c3, esp32c6, nrf52840, rp2040, stm32] + arch: + - esp32 + - esp32s3 + - esp32c3 + - esp32c6 + - nrf52840 + - rp2040 + - rp2350 + - stm32 runs-on: ubuntu-latest needs: [ @@ -253,7 +282,8 @@ jobs: build-esp32c3, build-esp32c6, build-nrf52840, - build-rpi2040, + build-rp2040, + build-rp2350, build-stm32, ] steps: @@ -392,7 +422,15 @@ jobs: strategy: fail-fast: false matrix: - arch: [esp32, esp32s3, esp32c3, esp32c6, nrf52840, rp2040, stm32] + arch: + - esp32 + - esp32s3 + - esp32c3 + - esp32c6 + - nrf52840 + - rp2040 + - rp2350 + - stm32 runs-on: ubuntu-latest if: ${{ github.event_name == 'workflow_dispatch' }} needs: [release-artifacts, version] @@ -449,7 +487,8 @@ jobs: if: ${{ github.event_name == 'workflow_dispatch' }} needs: [release-firmware, version] env: - targets: esp32,esp32s3,esp32c3,esp32c6,nrf52840,rp2040,stm32 + targets: |- + esp32,esp32s3,esp32c3,esp32c6,nrf52840,rp2040,rp2350,stm32 steps: - name: Checkout uses: actions/checkout@v4 diff --git a/bin/build-firmware.sh b/bin/build-firmware.sh index c53f1b660..fdd7caa11 100644 --- a/bin/build-firmware.sh +++ b/bin/build-firmware.sh @@ -11,7 +11,7 @@ elif (echo $2 | grep -q "nrf52"); then elif (echo $2 | grep -q "stm32"); then bin/build-stm32.sh $1 elif (echo $2 | grep -q "rpi2040"); then - bin/build-rpi2040.sh $1 + bin/build-rp2xx0.sh $1 else echo "Unknown target $2" exit 1 diff --git a/variants/rp2040/rpipicow/platformio.ini b/variants/rp2040/rpipicow/platformio.ini index 658d113d7..60845ba39 100644 --- a/variants/rp2040/rpipicow/platformio.ini +++ b/variants/rp2040/rpipicow/platformio.ini @@ -2,6 +2,7 @@ extends = rp2040_base board = rpipicow board_level = pr +board_check = true upload_protocol = picotool # add our variants files to the include and src paths build_flags = diff --git a/variants/rp2350/rpipico2w/platformio.ini b/variants/rp2350/rpipico2w/platformio.ini index 59b1354b4..5dbce533b 100644 --- a/variants/rp2350/rpipico2w/platformio.ini +++ b/variants/rp2350/rpipico2w/platformio.ini @@ -2,6 +2,7 @@ extends = rp2350_base board = rpipico2w board_level = pr +board_check = true upload_protocol = jlink # debug settings for external openocd with RP2040 support (custom build) debug_tool = custom From bbc638ab82b3834d11325067f38641c0112c2459 Mon Sep 17 00:00:00 2001 From: Iris Date: Fri, 25 Jul 2025 23:36:37 +0300 Subject: [PATCH 067/180] Create Platformio.ini (#7450) --- variants/nrf52840/diy/WashTastic/Platformio.ini | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 variants/nrf52840/diy/WashTastic/Platformio.ini diff --git a/variants/nrf52840/diy/WashTastic/Platformio.ini b/variants/nrf52840/diy/WashTastic/Platformio.ini new file mode 100644 index 000000000..e67c25910 --- /dev/null +++ b/variants/nrf52840/diy/WashTastic/Platformio.ini @@ -0,0 +1,13 @@ +; Promicro + E22900M30S +[env:WashTastic] +extends = nrf52840_base +board = promicro-nrf52840 +board_level = extra +build_flags = ${nrf52840_base.build_flags} + -I variants/nrf52840/diy/nrf52_promicro_diy_tcxo + -D PRIVATE_HW + -D EBYTE_E22_900M30S +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/diy/nrf52_promicro_diy_tcxo> +lib_deps = + ${nrf52840_base.lib_deps} +debug_tool = jlink \ No newline at end of file From fc1e6ccb8cd90463c9e2647e3fba9c10b7543ad3 Mon Sep 17 00:00:00 2001 From: Iris Date: Sat, 26 Jul 2025 13:13:02 +0300 Subject: [PATCH 068/180] Rename Platformio.ini to platformio.ini (#7468) --- .../nrf52840/diy/WashTastic/{Platformio.ini => platformio.ini} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename variants/nrf52840/diy/WashTastic/{Platformio.ini => platformio.ini} (95%) diff --git a/variants/nrf52840/diy/WashTastic/Platformio.ini b/variants/nrf52840/diy/WashTastic/platformio.ini similarity index 95% rename from variants/nrf52840/diy/WashTastic/Platformio.ini rename to variants/nrf52840/diy/WashTastic/platformio.ini index e67c25910..881b961e1 100644 --- a/variants/nrf52840/diy/WashTastic/Platformio.ini +++ b/variants/nrf52840/diy/WashTastic/platformio.ini @@ -10,4 +10,4 @@ build_flags = ${nrf52840_base.build_flags} build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/diy/nrf52_promicro_diy_tcxo> lib_deps = ${nrf52840_base.lib_deps} -debug_tool = jlink \ No newline at end of file +debug_tool = jlink From a506dc6b65d8d4dbf5b7106de598e89d8d25484f Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 26 Jul 2025 05:38:24 -0500 Subject: [PATCH 069/180] Fix MQTT config bugs (#7446) * Fix mqtt config bugs * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Add client notification * Verbiage * Update src/mqtt/MQTT.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/mqtt/MQTT.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/mqtt/MQTT.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/mqtt/MQTT.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Remove test that is no longer true * This test no longer exists * Fix client notification crap * Suppress false positive * Revert "Suppress false positive" This reverts commit bead96eaee31f11ed631c016eb0424055e923a29. * Try macro exclusion * Derp * Fix --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Jason P --- src/mesh/MeshService.h | 2 +- src/modules/AdminModule.cpp | 7 ++++++- src/mqtt/MQTT.cpp | 27 +++++++++++++++++++++------ test/test_mqtt/MQTT.cpp | 23 +++++++++++++---------- 4 files changed, 41 insertions(+), 18 deletions(-) diff --git a/src/mesh/MeshService.h b/src/mesh/MeshService.h index 89d3b15d0..f7d79366e 100644 --- a/src/mesh/MeshService.h +++ b/src/mesh/MeshService.h @@ -146,7 +146,7 @@ class MeshService virtual void sendMqttMessageToClientProxy(meshtastic_MqttClientProxyMessage *m); /// Send a ClientNotification to the phone - void sendClientNotification(meshtastic_ClientNotification *cn); + virtual void sendClientNotification(meshtastic_ClientNotification *cn); /// Send an error response to the phone void sendRoutingErrorResponse(meshtastic_Routing_Error error, const meshtastic_MeshPacket *mp); diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 33d5e1016..4b910a959 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -798,8 +798,11 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c) bool AdminModule::handleSetModuleConfig(const meshtastic_ModuleConfig &c) { - if (!hasOpenEditTransaction) + // If we are in an open transaction or configuring MQTT, defer disabling Bluetooth + // Otherwise, disable Bluetooth to prevent the phone from interfering with the config + if (!hasOpenEditTransaction && c.which_payload_variant != meshtastic_ModuleConfig_mqtt_tag) disableBluetooth(); + switch (c.which_payload_variant) { case meshtastic_ModuleConfig_mqtt_tag: #if MESHTASTIC_EXCLUDE_MQTT @@ -810,6 +813,8 @@ bool AdminModule::handleSetModuleConfig(const meshtastic_ModuleConfig &c) if (!MQTT::isValidConfig(c.payload_variant.mqtt)) { return false; } + // Disable Bluetooth to prevent interference during MQTT configuration + disableBluetooth(); moduleConfig.has_mqtt = true; moduleConfig.mqtt = c.payload_variant.mqtt; #endif diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index 091612827..21d4a8fa0 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -39,6 +39,7 @@ #include #define ntohl __ntohl #endif +#include MQTT *mqtt; @@ -624,18 +625,32 @@ bool MQTT::isValidConfig(const meshtastic_ModuleConfig_MQTTConfig &config, MQTTC return connectPubSub(parsed, *pubSub, (client != nullptr) ? *client : *clientConnection); } #else - LOG_ERROR("Invalid MQTT config: proxy_to_client_enabled must be enabled on nodes that do not have a network"); + const char *warning = "Invalid MQTT config: proxy_to_client_enabled must be enabled on nodes that do not have a network"; + LOG_ERROR(warning); +#if !IS_RUNNING_TESTS + meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); + cn->level = meshtastic_LogRecord_Level_ERROR; + cn->time = getValidTime(RTCQualityFromNet); + strncpy(cn->message, warning, sizeof(cn->message) - 1); + cn->message[sizeof(cn->message) - 1] = '\0'; // Ensure null termination + service->sendClientNotification(cn); +#endif return false; #endif } const bool defaultServer = isDefaultServer(parsed.serverAddr); - if (defaultServer && config.tls_enabled) { - LOG_ERROR("Invalid MQTT config: TLS was enabled, but the default server does not support TLS"); - return false; - } if (defaultServer && parsed.serverPort != PubSubConfig::defaultPort) { - LOG_ERROR("Invalid MQTT config: Unsupported port '%d' for the default MQTT server", parsed.serverPort); + const char *warning = "Invalid MQTT config: default server address must not have a port specified"; + LOG_ERROR(warning); +#if !IS_RUNNING_TESTS + meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); + cn->level = meshtastic_LogRecord_Level_ERROR; + cn->time = getValidTime(RTCQualityFromNet); + strncpy(cn->message, warning, sizeof(cn->message) - 1); + cn->message[sizeof(cn->message) - 1] = '\0'; // Ensure null termination + service->sendClientNotification(cn); +#endif return false; } return true; diff --git a/test/test_mqtt/MQTT.cpp b/test/test_mqtt/MQTT.cpp index 8047079ba..32d81f6b4 100644 --- a/test/test_mqtt/MQTT.cpp +++ b/test/test_mqtt/MQTT.cpp @@ -27,6 +27,12 @@ #include #include +#if defined(UNIT_TEST) +#define IS_RUNNING_TESTS 1 +#else +#define IS_RUNNING_TESTS 0 +#endif + namespace { // Minimal router needed to receive messages from MQTT. @@ -56,7 +62,13 @@ class MockMeshService : public MeshService messages_.emplace_back(*m); releaseMqttClientProxyMessageToPool(m); } - std::list messages_; // Messages received from the MeshService. + void sendClientNotification(meshtastic_ClientNotification *n) override + { + notifications_.emplace_back(*n); + releaseClientNotificationToPool(n); + } + std::list messages_; // Messages received from the MeshService. + std::list notifications_; // Notifications received from the MeshService. }; // Minimal NodeDB needed to return values from getMeshNode. @@ -823,14 +835,6 @@ void test_configWithDefaultServerAndInvalidPort(void) TEST_ASSERT_FALSE(MQTT::isValidConfig(config)); } -// Configuration with the default server and tls_enabled = true is invalid. -void test_configWithDefaultServerAndInvalidTLSEnabled(void) -{ - meshtastic_ModuleConfig_MQTTConfig config = {.tls_enabled = true}; - - TEST_ASSERT_FALSE(MQTT::isValidConfig(config)); -} - // isValidConfig connects to a custom host and port. void test_configCustomHostAndPort(void) { @@ -911,7 +915,6 @@ void setup() RUN_TEST(test_configEnabledEmptyIsValid); RUN_TEST(test_configWithDefaultServer); RUN_TEST(test_configWithDefaultServerAndInvalidPort); - RUN_TEST(test_configWithDefaultServerAndInvalidTLSEnabled); RUN_TEST(test_configCustomHostAndPort); RUN_TEST(test_configWithConnectionFailure); RUN_TEST(test_configWithTLSEnabled); From df8b629c2c4c43b5939e7153a427100c1b769a42 Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Sat, 26 Jul 2025 23:09:26 +1000 Subject: [PATCH 070/180] Clear position on GPS deactivation, unless using fixed position (#7464) * Clear position on GPS deactivation, unless using fixed position As reported by @dreimal8 , and confirmed by @tuxmobil , when using and then subsequently disabling GPS the last position retrieved from the GPS was stored and continued to be broadcast. This change introduces a check to see if we are transitioning from GPS Enabled to GPS Disabled or Not Present. If we are, and fixed position is not in use, then we clear the local position. This will prevent inaccurate and undesired position broadcasts for those who disable their GPS. Fixes https://github.com/meshtastic/firmware/issues/7228 * Update triple click to also clear position --------- Co-authored-by: Ben Meadors --- src/modules/AdminModule.cpp | 9 +++++++++ src/modules/SystemCommandsModule.cpp | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 4b910a959..87d423f21 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -638,7 +638,16 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c) case meshtastic_Config_position_tag: LOG_INFO("Set config: Position"); config.has_position = true; + // If we have turned off the GPS (disabled or not present) and we're not using fixed position, + // clear the stored position since it may not get updated + if (config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_ENABLED && + c.payload_variant.position.gps_mode != meshtastic_Config_PositionConfig_GpsMode_ENABLED && + config.position.fixed_position == false && c.payload_variant.position.fixed_position == false) { + nodeDB->clearLocalPosition(); + saveChanges(SEGMENT_NODEDATABASE | SEGMENT_CONFIG, false); + } config.position = c.payload_variant.position; + // Save nodedb as well in case we got a fixed position packet break; case meshtastic_Config_power_tag: diff --git a/src/modules/SystemCommandsModule.cpp b/src/modules/SystemCommandsModule.cpp index 2d534bd67..74b9678f4 100644 --- a/src/modules/SystemCommandsModule.cpp +++ b/src/modules/SystemCommandsModule.cpp @@ -89,6 +89,11 @@ int SystemCommandsModule::handleInputEvent(const InputEvent *event) #if !MESHTASTIC_EXCLUDE_GPS if (gps) { LOG_WARN("GPS Toggle2"); + if (config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_ENABLED && + config.position.fixed_position == false) { + nodeDB->clearLocalPosition(); + nodeDB->saveToDisk(); + } gps->toggleGpsMode(); const char *msg = (config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_ENABLED) ? "GPS Enabled" : "GPS Disabled"; From 7c5e2c539387b178661afa4279f6c5e92a4dec2f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 26 Jul 2025 16:21:49 -0500 Subject: [PATCH 071/180] Update protobufs (#7473) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/deviceonly.pb.h | 2 +- src/mesh/generated/meshtastic/mesh.pb.h | 13 +++++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/protobufs b/protobufs index d31cd890d..9bac2886f 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit d31cd890d58ffa7e3524e0685a8617bbd181a1c6 +Subproject commit 9bac2886f9344f25716921467a82e8b0326107cd diff --git a/src/mesh/generated/meshtastic/deviceonly.pb.h b/src/mesh/generated/meshtastic/deviceonly.pb.h index e709db6c4..ba1a52b27 100644 --- a/src/mesh/generated/meshtastic/deviceonly.pb.h +++ b/src/mesh/generated/meshtastic/deviceonly.pb.h @@ -362,7 +362,7 @@ extern const pb_msgdesc_t meshtastic_BackupPreferences_msg; #define MESHTASTIC_MESHTASTIC_DEVICEONLY_PB_H_MAX_SIZE meshtastic_BackupPreferences_size #define meshtastic_BackupPreferences_size 2271 #define meshtastic_ChannelFile_size 718 -#define meshtastic_DeviceState_size 1724 +#define meshtastic_DeviceState_size 1728 #define meshtastic_NodeInfoLite_size 196 #define meshtastic_PositionLite_size 28 #define meshtastic_UserLite_size 98 diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index abc06e635..8e6524042 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -935,6 +935,9 @@ typedef struct _meshtastic_MyNodeInfo { char pio_env[40]; /* The indicator for whether this device is running event firmware and which */ meshtastic_FirmwareEdition firmware_edition; + /* The number of nodes in the nodedb. + This is used by the phone to know how many NodeInfo packets to expect on want_config */ + uint16_t nodedb_count; } meshtastic_MyNodeInfo; /* Debug output from the device. @@ -1322,7 +1325,7 @@ extern "C" { #define meshtastic_MqttClientProxyMessage_init_default {"", 0, {{0, {0}}}, 0} #define meshtastic_MeshPacket_init_default {0, 0, 0, 0, {meshtastic_Data_init_default}, 0, 0, 0, 0, 0, _meshtastic_MeshPacket_Priority_MIN, 0, _meshtastic_MeshPacket_Delayed_MIN, 0, 0, {0, {0}}, 0, 0, 0, 0} #define meshtastic_NodeInfo_init_default {0, false, meshtastic_User_init_default, false, meshtastic_Position_init_default, 0, 0, false, meshtastic_DeviceMetrics_init_default, 0, 0, false, 0, 0, 0, 0} -#define meshtastic_MyNodeInfo_init_default {0, 0, 0, {0, {0}}, "", _meshtastic_FirmwareEdition_MIN} +#define meshtastic_MyNodeInfo_init_default {0, 0, 0, {0, {0}}, "", _meshtastic_FirmwareEdition_MIN, 0} #define meshtastic_LogRecord_init_default {"", 0, "", _meshtastic_LogRecord_Level_MIN} #define meshtastic_QueueStatus_init_default {0, 0, 0, 0} #define meshtastic_FromRadio_init_default {0, 0, {meshtastic_MeshPacket_init_default}} @@ -1353,7 +1356,7 @@ extern "C" { #define meshtastic_MqttClientProxyMessage_init_zero {"", 0, {{0, {0}}}, 0} #define meshtastic_MeshPacket_init_zero {0, 0, 0, 0, {meshtastic_Data_init_zero}, 0, 0, 0, 0, 0, _meshtastic_MeshPacket_Priority_MIN, 0, _meshtastic_MeshPacket_Delayed_MIN, 0, 0, {0, {0}}, 0, 0, 0, 0} #define meshtastic_NodeInfo_init_zero {0, false, meshtastic_User_init_zero, false, meshtastic_Position_init_zero, 0, 0, false, meshtastic_DeviceMetrics_init_zero, 0, 0, false, 0, 0, 0, 0} -#define meshtastic_MyNodeInfo_init_zero {0, 0, 0, {0, {0}}, "", _meshtastic_FirmwareEdition_MIN} +#define meshtastic_MyNodeInfo_init_zero {0, 0, 0, {0, {0}}, "", _meshtastic_FirmwareEdition_MIN, 0} #define meshtastic_LogRecord_init_zero {"", 0, "", _meshtastic_LogRecord_Level_MIN} #define meshtastic_QueueStatus_init_zero {0, 0, 0, 0} #define meshtastic_FromRadio_init_zero {0, 0, {meshtastic_MeshPacket_init_zero}} @@ -1477,6 +1480,7 @@ extern "C" { #define meshtastic_MyNodeInfo_device_id_tag 12 #define meshtastic_MyNodeInfo_pio_env_tag 13 #define meshtastic_MyNodeInfo_firmware_edition_tag 14 +#define meshtastic_MyNodeInfo_nodedb_count_tag 15 #define meshtastic_LogRecord_message_tag 1 #define meshtastic_LogRecord_time_tag 2 #define meshtastic_LogRecord_source_tag 3 @@ -1710,7 +1714,8 @@ X(a, STATIC, SINGULAR, UINT32, reboot_count, 8) \ X(a, STATIC, SINGULAR, UINT32, min_app_version, 11) \ X(a, STATIC, SINGULAR, BYTES, device_id, 12) \ X(a, STATIC, SINGULAR, STRING, pio_env, 13) \ -X(a, STATIC, SINGULAR, UENUM, firmware_edition, 14) +X(a, STATIC, SINGULAR, UENUM, firmware_edition, 14) \ +X(a, STATIC, SINGULAR, UINT32, nodedb_count, 15) #define meshtastic_MyNodeInfo_CALLBACK NULL #define meshtastic_MyNodeInfo_DEFAULT NULL @@ -1993,7 +1998,7 @@ extern const pb_msgdesc_t meshtastic_ChunkedPayloadResponse_msg; #define meshtastic_LowEntropyKey_size 0 #define meshtastic_MeshPacket_size 378 #define meshtastic_MqttClientProxyMessage_size 501 -#define meshtastic_MyNodeInfo_size 79 +#define meshtastic_MyNodeInfo_size 83 #define meshtastic_NeighborInfo_size 258 #define meshtastic_Neighbor_size 22 #define meshtastic_NodeInfo_size 323 From 28aeb0f09e9bb633d5ba8b6511050ac778e030c0 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 26 Jul 2025 19:55:54 -0500 Subject: [PATCH 072/180] Validate Serial config console override modes (#7470) * Validate serial config console override modes * Update src/modules/SerialModule.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Disable * Guard serial module * Guards --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/modules/AdminModule.cpp | 32 ++++-- src/modules/SerialModule.cpp | 20 ++++ src/modules/SerialModule.h | 2 + test/test_serial/SerialModule.cpp | 156 ++++++++++++++++++++++++++++++ 4 files changed, 202 insertions(+), 8 deletions(-) create mode 100644 test/test_serial/SerialModule.cpp diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 87d423f21..1a9c3a7a7 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -43,6 +43,10 @@ #if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C #include "motion/AccelerometerThread.h" #endif +#if (defined(ARCH_ESP32) || defined(ARCH_NRF52) || defined(ARCH_RP2040)) && !defined(CONFIG_IDF_TARGET_ESP32S2) && \ + !defined(CONFIG_IDF_TARGET_ESP32C3) +#include "SerialModule.h" +#endif AdminModule *adminModule; bool hasOpenEditTransaction; @@ -807,10 +811,12 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c) bool AdminModule::handleSetModuleConfig(const meshtastic_ModuleConfig &c) { - // If we are in an open transaction or configuring MQTT, defer disabling Bluetooth + // If we are in an open transaction or configuring MQTT or Serial (which have validation), defer disabling Bluetooth // Otherwise, disable Bluetooth to prevent the phone from interfering with the config - if (!hasOpenEditTransaction && c.which_payload_variant != meshtastic_ModuleConfig_mqtt_tag) + if (!hasOpenEditTransaction && + !IS_ONE_OF(c.which_payload_variant, meshtastic_ModuleConfig_mqtt_tag, meshtastic_ModuleConfig_serial_tag)) { disableBluetooth(); + } switch (c.which_payload_variant) { case meshtastic_ModuleConfig_mqtt_tag: @@ -830,6 +836,14 @@ bool AdminModule::handleSetModuleConfig(const meshtastic_ModuleConfig &c) break; case meshtastic_ModuleConfig_serial_tag: LOG_INFO("Set module config: Serial"); +#if (defined(ARCH_ESP32) || defined(ARCH_NRF52) || defined(ARCH_RP2040)) && !defined(CONFIG_IDF_TARGET_ESP32S2) && \ + !defined(CONFIG_IDF_TARGET_ESP32C3) + if (!SerialModule::isValidConfig(c.payload_variant.serial)) { + LOG_ERROR("Invalid serial config"); + return false; + } + disableBluetooth(); // Disable Bluetooth to prevent interference during Serial configuration +#endif moduleConfig.has_serial = true; moduleConfig.serial = c.payload_variant.serial; break; @@ -985,9 +999,10 @@ void AdminModule::handleGetConfig(const meshtastic_MeshPacket &req, const uint32 // So even if we internally use 0 to represent 'use default' we still need to send the value we are // using to the app (so that even old phone apps work with new device loads). // r.get_radio_response.preferences.ls_secs = getPref_ls_secs(); - // hideSecret(r.get_radio_response.preferences.wifi_ssid); // hmm - leave public for now, because only minimally private - // and useful for users to know current provisioning) hideSecret(r.get_radio_response.preferences.wifi_password); - // r.get_config_response.which_payloadVariant = Config_ModuleConfig_telemetry_tag; + // hideSecret(r.get_radio_response.preferences.wifi_ssid); // hmm - leave public for now, because only minimally + // private and useful for users to know current provisioning) + // hideSecret(r.get_radio_response.preferences.wifi_password); r.get_config_response.which_payloadVariant = + // Config_ModuleConfig_telemetry_tag; res.which_payload_variant = meshtastic_AdminMessage_get_config_response_tag; setPassKey(&res); myReply = allocDataProtobuf(res); @@ -1071,9 +1086,10 @@ void AdminModule::handleGetModuleConfig(const meshtastic_MeshPacket &req, const // So even if we internally use 0 to represent 'use default' we still need to send the value we are // using to the app (so that even old phone apps work with new device loads). // r.get_radio_response.preferences.ls_secs = getPref_ls_secs(); - // hideSecret(r.get_radio_response.preferences.wifi_ssid); // hmm - leave public for now, because only minimally private - // and useful for users to know current provisioning) hideSecret(r.get_radio_response.preferences.wifi_password); - // r.get_config_response.which_payloadVariant = Config_ModuleConfig_telemetry_tag; + // hideSecret(r.get_radio_response.preferences.wifi_ssid); // hmm - leave public for now, because only minimally + // private and useful for users to know current provisioning) + // hideSecret(r.get_radio_response.preferences.wifi_password); r.get_config_response.which_payloadVariant = + // Config_ModuleConfig_telemetry_tag; res.which_payload_variant = meshtastic_AdminMessage_get_module_config_response_tag; setPassKey(&res); myReply = allocDataProtobuf(res); diff --git a/src/modules/SerialModule.cpp b/src/modules/SerialModule.cpp index f3921ef19..f3091e5bf 100644 --- a/src/modules/SerialModule.cpp +++ b/src/modules/SerialModule.cpp @@ -74,6 +74,26 @@ static Print *serialPrint = &Serial2; char serialBytes[512]; size_t serialPayloadSize; +bool SerialModule::isValidConfig(const meshtastic_ModuleConfig_SerialConfig &config) +{ + if (config.override_console_serial_port && !IS_ONE_OF(config.mode, meshtastic_ModuleConfig_SerialConfig_Serial_Mode_NMEA, + meshtastic_ModuleConfig_SerialConfig_Serial_Mode_CALTOPO)) { + const char *warning = + "Invalid Serial config: override console serial port is only supported in NMEA and CalTopo output-only modes."; + LOG_ERROR(warning); +#if !IS_RUNNING_TESTS + meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); + cn->level = meshtastic_LogRecord_Level_ERROR; + cn->time = getValidTime(RTCQualityFromNet); + snprintf(cn->message, sizeof(cn->message), "%s", warning); + service->sendClientNotification(cn); +#endif + return false; + } + + return true; +} + SerialModuleRadio::SerialModuleRadio() : MeshModule("SerialModuleRadio") { switch (moduleConfig.serial.mode) { diff --git a/src/modules/SerialModule.h b/src/modules/SerialModule.h index fa86db28f..1c74c927c 100644 --- a/src/modules/SerialModule.h +++ b/src/modules/SerialModule.h @@ -20,6 +20,8 @@ class SerialModule : public StreamAPI, private concurrency::OSThread public: SerialModule(); + static bool isValidConfig(const meshtastic_ModuleConfig_SerialConfig &config); + protected: virtual int32_t runOnce() override; diff --git a/test/test_serial/SerialModule.cpp b/test/test_serial/SerialModule.cpp new file mode 100644 index 000000000..1bccf04a7 --- /dev/null +++ b/test/test_serial/SerialModule.cpp @@ -0,0 +1,156 @@ +#include "DebugConfiguration.h" +#include "TestUtil.h" +#include + +#ifdef ARCH_PORTDUINO +#include "configuration.h" + +#if defined(UNIT_TEST) +#define IS_RUNNING_TESTS 1 +#else +#define IS_RUNNING_TESTS 0 +#endif + +#if (defined(ARCH_ESP32) || defined(ARCH_NRF52) || defined(ARCH_RP2040)) && !defined(CONFIG_IDF_TARGET_ESP32S2) && \ + !defined(CONFIG_IDF_TARGET_ESP32C3) +#include "modules/SerialModule.h" +#endif + +#if (defined(ARCH_ESP32) || defined(ARCH_NRF52) || defined(ARCH_RP2040)) && !defined(CONFIG_IDF_TARGET_ESP32S2) && \ + !defined(CONFIG_IDF_TARGET_ESP32C3) + +// Test that empty configuration is valid. +void test_serialConfigEmptyIsValid(void) +{ + meshtastic_ModuleConfig_SerialConfig config = {}; + + TEST_ASSERT_TRUE(SerialModule::isValidConfig(config)); +} + +// Test that basic enabled configuration is valid. +void test_serialConfigEnabledIsValid(void) +{ + meshtastic_ModuleConfig_SerialConfig config = {.enabled = true}; + + TEST_ASSERT_TRUE(SerialModule::isValidConfig(config)); +} + +// Test that configuration with override_console_serial_port and NMEA mode is valid. +void test_serialConfigWithOverrideConsoleNmeaModeIsValid(void) +{ + meshtastic_ModuleConfig_SerialConfig config = { + .enabled = true, .override_console_serial_port = true, .mode = meshtastic_ModuleConfig_SerialConfig_Serial_Mode_NMEA}; + + TEST_ASSERT_TRUE(SerialModule::isValidConfig(config)); +} + +// Test that configuration with override_console_serial_port and CalTopo mode is valid. +void test_serialConfigWithOverrideConsoleCalTopoModeIsValid(void) +{ + meshtastic_ModuleConfig_SerialConfig config = { + .enabled = true, .override_console_serial_port = true, .mode = meshtastic_ModuleConfig_SerialConfig_Serial_Mode_CALTOPO}; + + TEST_ASSERT_TRUE(SerialModule::isValidConfig(config)); +} + +// Test that configuration with override_console_serial_port and DEFAULT mode is invalid. +void test_serialConfigWithOverrideConsoleDefaultModeIsInvalid(void) +{ + meshtastic_ModuleConfig_SerialConfig config = { + .enabled = true, .override_console_serial_port = true, .mode = meshtastic_ModuleConfig_SerialConfig_Serial_Mode_DEFAULT}; + + TEST_ASSERT_FALSE(SerialModule::isValidConfig(config)); +} + +// Test that configuration with override_console_serial_port and SIMPLE mode is invalid. +void test_serialConfigWithOverrideConsoleSimpleModeIsInvalid(void) +{ + meshtastic_ModuleConfig_SerialConfig config = { + .enabled = true, .override_console_serial_port = true, .mode = meshtastic_ModuleConfig_SerialConfig_Serial_Mode_SIMPLE}; + + TEST_ASSERT_FALSE(SerialModule::isValidConfig(config)); +} + +// Test that configuration with override_console_serial_port and TEXTMSG mode is invalid. +void test_serialConfigWithOverrideConsoleTextMsgModeIsInvalid(void) +{ + meshtastic_ModuleConfig_SerialConfig config = { + .enabled = true, .override_console_serial_port = true, .mode = meshtastic_ModuleConfig_SerialConfig_Serial_Mode_TEXTMSG}; + + TEST_ASSERT_FALSE(SerialModule::isValidConfig(config)); +} + +// Test that configuration with override_console_serial_port and PROTO mode is invalid. +void test_serialConfigWithOverrideConsoleProtoModeIsInvalid(void) +{ + meshtastic_ModuleConfig_SerialConfig config = { + .enabled = true, .override_console_serial_port = true, .mode = meshtastic_ModuleConfig_SerialConfig_Serial_Mode_PROTO}; + + TEST_ASSERT_FALSE(SerialModule::isValidConfig(config)); +} + +// Test that various modes work without override_console_serial_port. +void test_serialConfigVariousModesWithoutOverrideAreValid(void) +{ + meshtastic_ModuleConfig_SerialConfig config = {.enabled = true, .override_console_serial_port = false}; + + // Test DEFAULT mode + config.mode = meshtastic_ModuleConfig_SerialConfig_Serial_Mode_DEFAULT; + TEST_ASSERT_TRUE(SerialModule::isValidConfig(config)); + + // Test SIMPLE mode + config.mode = meshtastic_ModuleConfig_SerialConfig_Serial_Mode_SIMPLE; + TEST_ASSERT_TRUE(SerialModule::isValidConfig(config)); + + // Test TEXTMSG mode + config.mode = meshtastic_ModuleConfig_SerialConfig_Serial_Mode_TEXTMSG; + TEST_ASSERT_TRUE(SerialModule::isValidConfig(config)); + + // Test PROTO mode + config.mode = meshtastic_ModuleConfig_SerialConfig_Serial_Mode_PROTO; + TEST_ASSERT_TRUE(SerialModule::isValidConfig(config)); + + // Test NMEA mode + config.mode = meshtastic_ModuleConfig_SerialConfig_Serial_Mode_NMEA; + TEST_ASSERT_TRUE(SerialModule::isValidConfig(config)); + + // Test CALTOPO mode + config.mode = meshtastic_ModuleConfig_SerialConfig_Serial_Mode_CALTOPO; + TEST_ASSERT_TRUE(SerialModule::isValidConfig(config)); +} + +#endif // Architecture check + +void setup() +{ + initializeTestEnvironment(); + +#if (defined(ARCH_ESP32) || defined(ARCH_NRF52) || defined(ARCH_RP2040)) && !defined(CONFIG_IDF_TARGET_ESP32S2) && \ + !defined(CONFIG_IDF_TARGET_ESP32C3) + UNITY_BEGIN(); + RUN_TEST(test_serialConfigEmptyIsValid); + RUN_TEST(test_serialConfigEnabledIsValid); + RUN_TEST(test_serialConfigWithOverrideConsoleNmeaModeIsValid); + RUN_TEST(test_serialConfigWithOverrideConsoleCalTopoModeIsValid); + RUN_TEST(test_serialConfigWithOverrideConsoleDefaultModeIsInvalid); + RUN_TEST(test_serialConfigWithOverrideConsoleSimpleModeIsInvalid); + RUN_TEST(test_serialConfigWithOverrideConsoleTextMsgModeIsInvalid); + RUN_TEST(test_serialConfigWithOverrideConsoleProtoModeIsInvalid); + RUN_TEST(test_serialConfigVariousModesWithoutOverrideAreValid); + exit(UNITY_END()); +#else + LOG_WARN("This test requires ESP32, NRF52, or RP2040 architecture"); + UNITY_BEGIN(); + UNITY_END(); +#endif +} +#else +void setup() +{ + initializeTestEnvironment(); + LOG_WARN("This test requires the ARCH_PORTDUINO variant"); + UNITY_BEGIN(); + UNITY_END(); +} +#endif +void loop() {} From aa3b14ce720b2f52cdd553b1a39477673c2c3783 Mon Sep 17 00:00:00 2001 From: mikecarper <135079168+mikecarper@users.noreply.github.com> Date: Sun, 27 Jul 2025 18:03:01 -0700 Subject: [PATCH 073/180] bugfix Add rssi and snr to the store and forward code. (#7462) * Update StoreForwardModule.cpp * Update StoreForwardModule.h --------- Co-authored-by: Ben Meadors --- src/modules/StoreForwardModule.cpp | 6 +++++- src/modules/StoreForwardModule.h | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/modules/StoreForwardModule.cpp b/src/modules/StoreForwardModule.cpp index 0a6e1b4c4..72ac99118 100644 --- a/src/modules/StoreForwardModule.cpp +++ b/src/modules/StoreForwardModule.cpp @@ -202,6 +202,8 @@ void StoreForwardModule::historyAdd(const meshtastic_MeshPacket &mp) this->packetHistory[this->packetHistoryTotalCount].reply_id = p.reply_id; this->packetHistory[this->packetHistoryTotalCount].emoji = (bool)p.emoji; this->packetHistory[this->packetHistoryTotalCount].payload_size = p.payload.size; + this->packetHistory[this->packetHistoryTotalCount].rx_rssi = mp.rx_rssi; + this->packetHistory[this->packetHistoryTotalCount].rx_snr = mp.rx_snr; memcpy(this->packetHistory[this->packetHistoryTotalCount].payload, p.payload.bytes, meshtastic_Constants_DATA_PAYLOAD_LEN); this->packetHistoryTotalCount++; @@ -252,6 +254,8 @@ meshtastic_MeshPacket *StoreForwardModule::preparePayload(NodeNum dest, uint32_t p->decoded.reply_id = this->packetHistory[i].reply_id; p->rx_time = this->packetHistory[i].time; p->decoded.emoji = (uint32_t)this->packetHistory[i].emoji; + p->rx_rssi = this->packetHistory[i].rx_rssi; + p->rx_snr = this->packetHistory[i].rx_snr; // Let's assume that if the server received the S&F request that the client is in range. // TODO: Make this configurable. @@ -623,4 +627,4 @@ StoreForwardModule::StoreForwardModule() disable(); } #endif -} \ No newline at end of file +} diff --git a/src/modules/StoreForwardModule.h b/src/modules/StoreForwardModule.h index 30db1625c..25836eded 100644 --- a/src/modules/StoreForwardModule.h +++ b/src/modules/StoreForwardModule.h @@ -19,6 +19,8 @@ struct PacketHistoryStruct { bool emoji; uint8_t payload[meshtastic_Constants_DATA_PAYLOAD_LEN]; pb_size_t payload_size; + int32_t rx_rssi; + float rx_snr; }; class StoreForwardModule : private concurrency::OSThread, public ProtobufModule @@ -108,4 +110,4 @@ class StoreForwardModule : private concurrency::OSThread, public ProtobufModule< virtual bool handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_StoreAndForward *p); }; -extern StoreForwardModule *storeForwardModule; \ No newline at end of file +extern StoreForwardModule *storeForwardModule; From 3ecff48722d3a60e8c84f6d2573cd3688915a279 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Mon, 28 Jul 2025 07:31:33 -0500 Subject: [PATCH 074/180] Set firmware edition (for events) from userprefs (#7488) * Set firmware edition (for events) from userprefs * Spaces in the right places --- src/mesh/NodeDB.cpp | 3 +++ userPrefs.jsonc | 1 + 2 files changed, 4 insertions(+) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index b7120a064..881dc6ab7 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -406,6 +406,9 @@ NodeDB::NodeDB() config.position.gps_mode = meshtastic_Config_PositionConfig_GpsMode_ENABLED; config.position.gps_enabled = 0; } +#ifdef USERPREFS_FIRMWARE_EDITION + myNodeInfo.firmware_edition = USERPREFS_FIRMWARE_EDITION; +#endif #ifdef USERPREFS_FIXED_GPS if (myNodeInfo.reboot_count == 1) { // Check if First boot ever or after Factory Reset. meshtastic_Position fixedGPS = meshtastic_Position_init_default; diff --git a/userPrefs.jsonc b/userPrefs.jsonc index 3da8e7ba6..f6f3ef995 100644 --- a/userPrefs.jsonc +++ b/userPrefs.jsonc @@ -23,6 +23,7 @@ // "USERPREFS_CONFIG_OWNER_SHORT_NAME": "MLN", // "USERPREFS_CONFIG_DEVICE_ROLE": "meshtastic_Config_DeviceConfig_Role_CLIENT", // Defaults to CLIENT. ROUTER*, LOST AND FOUND, and REPEATER roles are restricted. // "USERPREFS_EVENT_MODE": "1", + // "USERPREFS_FIRMWARE_EDITION": "meshtastic_FirmwareEdition_BURNING_MAN", // "USERPREFS_FIXED_BLUETOOTH": "121212", // "USERPREFS_FIXED_GPS": "", // "USERPREFS_FIXED_GPS_ALT": "0", From 1d8638b47d8ec97f485b240a464de720f7f56310 Mon Sep 17 00:00:00 2001 From: rradillen Date: Mon, 28 Jul 2025 16:23:04 +0200 Subject: [PATCH 075/180] [7353] Add all telemetry fields to json output (#7363) * Serializer bugfix * Remove duplicate test * fix tests * fix float precision issues --------- Co-authored-by: Ben Meadors --- src/serialization/MeshPacketSerializer.cpp | 24 + .../ports/test_encrypted.cpp | 50 ++ .../ports/test_nodeinfo.cpp | 51 ++ .../ports/test_position.cpp | 57 ++ .../ports/test_telemetry.cpp | 528 ++++++++++++++++++ .../ports/test_text_message.cpp | 42 ++ .../ports/test_waypoint.cpp | 53 ++ .../test_meshpacket_serializer/test_helpers.h | 44 ++ .../test_serializer.cpp | 51 ++ 9 files changed, 900 insertions(+) create mode 100644 test/test_meshpacket_serializer/ports/test_encrypted.cpp create mode 100644 test/test_meshpacket_serializer/ports/test_nodeinfo.cpp create mode 100644 test/test_meshpacket_serializer/ports/test_position.cpp create mode 100644 test/test_meshpacket_serializer/ports/test_telemetry.cpp create mode 100644 test/test_meshpacket_serializer/ports/test_text_message.cpp create mode 100644 test/test_meshpacket_serializer/ports/test_waypoint.cpp create mode 100644 test/test_meshpacket_serializer/test_helpers.h create mode 100644 test/test_meshpacket_serializer/test_serializer.cpp diff --git a/src/serialization/MeshPacketSerializer.cpp b/src/serialization/MeshPacketSerializer.cpp index 29a9b6840..5a1f8ed7e 100644 --- a/src/serialization/MeshPacketSerializer.cpp +++ b/src/serialization/MeshPacketSerializer.cpp @@ -100,6 +100,9 @@ std::string MeshPacketSerializer::JsonSerialize(const meshtastic_MeshPacket *mp, if (decoded->variant.environment_metrics.has_iaq) { msgPayload["iaq"] = new JSONValue((uint)decoded->variant.environment_metrics.iaq); } + if (decoded->variant.environment_metrics.has_distance) { + msgPayload["distance"] = new JSONValue(decoded->variant.environment_metrics.distance); + } if (decoded->variant.environment_metrics.has_wind_speed) { msgPayload["wind_speed"] = new JSONValue(decoded->variant.environment_metrics.wind_speed); } @@ -115,6 +118,27 @@ std::string MeshPacketSerializer::JsonSerialize(const meshtastic_MeshPacket *mp, if (decoded->variant.environment_metrics.has_radiation) { msgPayload["radiation"] = new JSONValue(decoded->variant.environment_metrics.radiation); } + if (decoded->variant.environment_metrics.has_ir_lux) { + msgPayload["ir_lux"] = new JSONValue(decoded->variant.environment_metrics.ir_lux); + } + if (decoded->variant.environment_metrics.has_uv_lux) { + msgPayload["uv_lux"] = new JSONValue(decoded->variant.environment_metrics.uv_lux); + } + if (decoded->variant.environment_metrics.has_weight) { + msgPayload["weight"] = new JSONValue(decoded->variant.environment_metrics.weight); + } + if (decoded->variant.environment_metrics.has_rainfall_1h) { + msgPayload["rainfall_1h"] = new JSONValue(decoded->variant.environment_metrics.rainfall_1h); + } + if (decoded->variant.environment_metrics.has_rainfall_24h) { + msgPayload["rainfall_24h"] = new JSONValue(decoded->variant.environment_metrics.rainfall_24h); + } + if (decoded->variant.environment_metrics.has_soil_moisture) { + msgPayload["soil_moisture"] = new JSONValue((uint)decoded->variant.environment_metrics.soil_moisture); + } + if (decoded->variant.environment_metrics.has_soil_temperature) { + msgPayload["soil_temperature"] = new JSONValue(decoded->variant.environment_metrics.soil_temperature); + } } else if (decoded->which_variant == meshtastic_Telemetry_air_quality_metrics_tag) { if (decoded->variant.air_quality_metrics.has_pm10_standard) { msgPayload["pm10"] = new JSONValue((unsigned int)decoded->variant.air_quality_metrics.pm10_standard); diff --git a/test/test_meshpacket_serializer/ports/test_encrypted.cpp b/test/test_meshpacket_serializer/ports/test_encrypted.cpp new file mode 100644 index 000000000..557ee7a49 --- /dev/null +++ b/test/test_meshpacket_serializer/ports/test_encrypted.cpp @@ -0,0 +1,50 @@ +#include "../test_helpers.h" + +// Test encrypted packet serialization +void test_encrypted_packet_serialization() +{ + meshtastic_MeshPacket packet = meshtastic_MeshPacket_init_zero; + packet.from = 0x11223344; + packet.to = 0x55667788; + packet.id = 0x9999; + packet.which_payload_variant = meshtastic_MeshPacket_encrypted_tag; + + // Add some dummy encrypted data + const char *encrypted_data = "encrypted_payload_data"; + packet.encrypted.size = strlen(encrypted_data); + memcpy(packet.encrypted.bytes, encrypted_data, packet.encrypted.size); + + std::string json = MeshPacketSerializer::JsonSerializeEncrypted(&packet); + TEST_ASSERT_TRUE(json.length() > 0); + + JSONValue *root = JSON::Parse(json.c_str()); + TEST_ASSERT_NOT_NULL(root); + TEST_ASSERT_TRUE(root->IsObject()); + + JSONObject jsonObj = root->AsObject(); + + // Check basic packet fields + TEST_ASSERT_TRUE(jsonObj.find("from") != jsonObj.end()); + TEST_ASSERT_EQUAL(0x11223344, (uint32_t)jsonObj["from"]->AsNumber()); + + TEST_ASSERT_TRUE(jsonObj.find("to") != jsonObj.end()); + TEST_ASSERT_EQUAL(0x55667788, (uint32_t)jsonObj["to"]->AsNumber()); + + TEST_ASSERT_TRUE(jsonObj.find("id") != jsonObj.end()); + TEST_ASSERT_EQUAL(0x9999, (uint32_t)jsonObj["id"]->AsNumber()); + + // Check that it has encrypted data fields (not "payload" but "bytes" and "size") + TEST_ASSERT_TRUE(jsonObj.find("bytes") != jsonObj.end()); + TEST_ASSERT_TRUE(jsonObj["bytes"]->IsString()); + + TEST_ASSERT_TRUE(jsonObj.find("size") != jsonObj.end()); + TEST_ASSERT_EQUAL(22, (int)jsonObj["size"]->AsNumber()); // strlen("encrypted_payload_data") = 22 + + // The encrypted data should be hex-encoded + std::string encrypted_hex = jsonObj["bytes"]->AsString(); + TEST_ASSERT_TRUE(encrypted_hex.length() > 0); + // Should be twice the size of the original data (hex encoding) + TEST_ASSERT_EQUAL(44, encrypted_hex.length()); // 22 * 2 = 44 + + delete root; +} diff --git a/test/test_meshpacket_serializer/ports/test_nodeinfo.cpp b/test/test_meshpacket_serializer/ports/test_nodeinfo.cpp new file mode 100644 index 000000000..febda9950 --- /dev/null +++ b/test/test_meshpacket_serializer/ports/test_nodeinfo.cpp @@ -0,0 +1,51 @@ +#include "../test_helpers.h" + +static size_t encode_user_info(uint8_t *buffer, size_t buffer_size) +{ + meshtastic_User user = meshtastic_User_init_zero; + strcpy(user.short_name, "TEST"); + strcpy(user.long_name, "Test User"); + strcpy(user.id, "!12345678"); + user.hw_model = meshtastic_HardwareModel_HELTEC_V3; + + pb_ostream_t stream = pb_ostream_from_buffer(buffer, buffer_size); + pb_encode(&stream, &meshtastic_User_msg, &user); + return stream.bytes_written; +} + +// Test NODEINFO_APP port +void test_nodeinfo_serialization() +{ + uint8_t buffer[256]; + size_t payload_size = encode_user_info(buffer, sizeof(buffer)); + + meshtastic_MeshPacket packet = create_test_packet(meshtastic_PortNum_NODEINFO_APP, buffer, payload_size); + + std::string json = MeshPacketSerializer::JsonSerialize(&packet, false); + TEST_ASSERT_TRUE(json.length() > 0); + + JSONValue *root = JSON::Parse(json.c_str()); + TEST_ASSERT_NOT_NULL(root); + TEST_ASSERT_TRUE(root->IsObject()); + + JSONObject jsonObj = root->AsObject(); + + // Check message type + TEST_ASSERT_TRUE(jsonObj.find("type") != jsonObj.end()); + TEST_ASSERT_EQUAL_STRING("nodeinfo", jsonObj["type"]->AsString().c_str()); + + // Check payload + TEST_ASSERT_TRUE(jsonObj.find("payload") != jsonObj.end()); + TEST_ASSERT_TRUE(jsonObj["payload"]->IsObject()); + + JSONObject payload = jsonObj["payload"]->AsObject(); + + // Verify user data + TEST_ASSERT_TRUE(payload.find("shortname") != payload.end()); + TEST_ASSERT_EQUAL_STRING("TEST", payload["shortname"]->AsString().c_str()); + + TEST_ASSERT_TRUE(payload.find("longname") != payload.end()); + TEST_ASSERT_EQUAL_STRING("Test User", payload["longname"]->AsString().c_str()); + + delete root; +} diff --git a/test/test_meshpacket_serializer/ports/test_position.cpp b/test/test_meshpacket_serializer/ports/test_position.cpp new file mode 100644 index 000000000..f0dcc0709 --- /dev/null +++ b/test/test_meshpacket_serializer/ports/test_position.cpp @@ -0,0 +1,57 @@ +#include "../test_helpers.h" + +static size_t encode_position(uint8_t *buffer, size_t buffer_size) +{ + meshtastic_Position position = meshtastic_Position_init_zero; + position.latitude_i = 374208000; // 37.4208 degrees * 1e7 + position.longitude_i = -1221981000; // -122.1981 degrees * 1e7 + position.altitude = 123; + position.time = 1609459200; + position.has_altitude = true; + position.has_latitude_i = true; + position.has_longitude_i = true; + + pb_ostream_t stream = pb_ostream_from_buffer(buffer, buffer_size); + pb_encode(&stream, &meshtastic_Position_msg, &position); + return stream.bytes_written; +} + +// Test POSITION_APP port +void test_position_serialization() +{ + uint8_t buffer[256]; + size_t payload_size = encode_position(buffer, sizeof(buffer)); + + meshtastic_MeshPacket packet = create_test_packet(meshtastic_PortNum_POSITION_APP, buffer, payload_size); + + std::string json = MeshPacketSerializer::JsonSerialize(&packet, false); + TEST_ASSERT_TRUE(json.length() > 0); + + JSONValue *root = JSON::Parse(json.c_str()); + TEST_ASSERT_NOT_NULL(root); + TEST_ASSERT_TRUE(root->IsObject()); + + JSONObject jsonObj = root->AsObject(); + + // Check message type + TEST_ASSERT_TRUE(jsonObj.find("type") != jsonObj.end()); + TEST_ASSERT_EQUAL_STRING("position", jsonObj["type"]->AsString().c_str()); + + // Check payload + TEST_ASSERT_TRUE(jsonObj.find("payload") != jsonObj.end()); + TEST_ASSERT_TRUE(jsonObj["payload"]->IsObject()); + + JSONObject payload = jsonObj["payload"]->AsObject(); + + // Verify position data + TEST_ASSERT_TRUE(payload.find("latitude_i") != payload.end()); + TEST_ASSERT_EQUAL(374208000, (int)payload["latitude_i"]->AsNumber()); + + TEST_ASSERT_TRUE(payload.find("longitude_i") != payload.end()); + TEST_ASSERT_EQUAL(-1221981000, (int)payload["longitude_i"]->AsNumber()); + + TEST_ASSERT_TRUE(payload.find("altitude") != payload.end()); + TEST_ASSERT_EQUAL(123, (int)payload["altitude"]->AsNumber()); + + delete root; +} diff --git a/test/test_meshpacket_serializer/ports/test_telemetry.cpp b/test/test_meshpacket_serializer/ports/test_telemetry.cpp new file mode 100644 index 000000000..a813aaab5 --- /dev/null +++ b/test/test_meshpacket_serializer/ports/test_telemetry.cpp @@ -0,0 +1,528 @@ +#include "../test_helpers.h" + +// Helper function to create and encode device metrics +static size_t encode_telemetry_device_metrics(uint8_t *buffer, size_t buffer_size) +{ + meshtastic_Telemetry telemetry = meshtastic_Telemetry_init_zero; + telemetry.time = 1609459200; + telemetry.which_variant = meshtastic_Telemetry_device_metrics_tag; + telemetry.variant.device_metrics.battery_level = 85; + telemetry.variant.device_metrics.has_battery_level = true; + telemetry.variant.device_metrics.voltage = 3.72f; + telemetry.variant.device_metrics.has_voltage = true; + telemetry.variant.device_metrics.channel_utilization = 15.56f; + telemetry.variant.device_metrics.has_channel_utilization = true; + telemetry.variant.device_metrics.air_util_tx = 8.23f; + telemetry.variant.device_metrics.has_air_util_tx = true; + telemetry.variant.device_metrics.uptime_seconds = 12345; + telemetry.variant.device_metrics.has_uptime_seconds = true; + + pb_ostream_t stream = pb_ostream_from_buffer(buffer, buffer_size); + pb_encode(&stream, &meshtastic_Telemetry_msg, &telemetry); + return stream.bytes_written; +} + +// Helper function to create and encode empty environment metrics (no fields set) +static size_t encode_telemetry_environment_metrics_empty(uint8_t *buffer, size_t buffer_size) +{ + meshtastic_Telemetry telemetry = meshtastic_Telemetry_init_zero; + telemetry.time = 1609459200; + telemetry.which_variant = meshtastic_Telemetry_environment_metrics_tag; + + // NO fields are set - all has_* flags remain false + // This tests that empty environment metrics don't produce any JSON fields + + pb_ostream_t stream = pb_ostream_from_buffer(buffer, buffer_size); + pb_encode(&stream, &meshtastic_Telemetry_msg, &telemetry); + return stream.bytes_written; +} + +// Helper function to create environment metrics with ALL possible fields set +// This function should be updated whenever new fields are added to the protobuf +static size_t encode_telemetry_environment_metrics_all_fields(uint8_t *buffer, size_t buffer_size) +{ + meshtastic_Telemetry telemetry = meshtastic_Telemetry_init_zero; + telemetry.time = 1609459200; + telemetry.which_variant = meshtastic_Telemetry_environment_metrics_tag; + + // Basic environment metrics + telemetry.variant.environment_metrics.temperature = 23.56f; + telemetry.variant.environment_metrics.has_temperature = true; + telemetry.variant.environment_metrics.relative_humidity = 65.43f; + telemetry.variant.environment_metrics.has_relative_humidity = true; + telemetry.variant.environment_metrics.barometric_pressure = 1013.27f; + telemetry.variant.environment_metrics.has_barometric_pressure = true; + + // Gas and air quality + telemetry.variant.environment_metrics.gas_resistance = 50.58f; + telemetry.variant.environment_metrics.has_gas_resistance = true; + telemetry.variant.environment_metrics.iaq = 120; + telemetry.variant.environment_metrics.has_iaq = true; + + // Power measurements + telemetry.variant.environment_metrics.voltage = 3.34f; + telemetry.variant.environment_metrics.has_voltage = true; + telemetry.variant.environment_metrics.current = 0.53f; + telemetry.variant.environment_metrics.has_current = true; + + // Light measurements (ALL 4 types) + telemetry.variant.environment_metrics.lux = 450.12f; + telemetry.variant.environment_metrics.has_lux = true; + telemetry.variant.environment_metrics.white_lux = 380.95f; + telemetry.variant.environment_metrics.has_white_lux = true; + telemetry.variant.environment_metrics.ir_lux = 25.37f; + telemetry.variant.environment_metrics.has_ir_lux = true; + telemetry.variant.environment_metrics.uv_lux = 15.68f; + telemetry.variant.environment_metrics.has_uv_lux = true; + + // Distance measurement + telemetry.variant.environment_metrics.distance = 150.29f; + telemetry.variant.environment_metrics.has_distance = true; + + // Wind measurements (ALL 4 types) + telemetry.variant.environment_metrics.wind_direction = 180; + telemetry.variant.environment_metrics.has_wind_direction = true; + telemetry.variant.environment_metrics.wind_speed = 5.52f; + telemetry.variant.environment_metrics.has_wind_speed = true; + telemetry.variant.environment_metrics.wind_gust = 8.24f; + telemetry.variant.environment_metrics.has_wind_gust = true; + telemetry.variant.environment_metrics.wind_lull = 2.13f; + telemetry.variant.environment_metrics.has_wind_lull = true; + + // Weight measurement + telemetry.variant.environment_metrics.weight = 75.56f; + telemetry.variant.environment_metrics.has_weight = true; + + // Radiation measurement + telemetry.variant.environment_metrics.radiation = 0.13f; + telemetry.variant.environment_metrics.has_radiation = true; + + // Rainfall measurements (BOTH types) + telemetry.variant.environment_metrics.rainfall_1h = 2.57f; + telemetry.variant.environment_metrics.has_rainfall_1h = true; + telemetry.variant.environment_metrics.rainfall_24h = 15.89f; + telemetry.variant.environment_metrics.has_rainfall_24h = true; + + // Soil measurements (BOTH types) + telemetry.variant.environment_metrics.soil_moisture = 85; + telemetry.variant.environment_metrics.has_soil_moisture = true; + telemetry.variant.environment_metrics.soil_temperature = 18.54f; + telemetry.variant.environment_metrics.has_soil_temperature = true; + + // IMPORTANT: When new environment fields are added to the protobuf, + // they MUST be added here too, or the coverage test will fail! + + pb_ostream_t stream = pb_ostream_from_buffer(buffer, buffer_size); + pb_encode(&stream, &meshtastic_Telemetry_msg, &telemetry); + return stream.bytes_written; +} + +// Helper function to create and encode environment metrics with all current fields +static size_t encode_telemetry_environment_metrics(uint8_t *buffer, size_t buffer_size) +{ + meshtastic_Telemetry telemetry = meshtastic_Telemetry_init_zero; + telemetry.time = 1609459200; + telemetry.which_variant = meshtastic_Telemetry_environment_metrics_tag; + + // Basic environment metrics + telemetry.variant.environment_metrics.temperature = 23.56f; + telemetry.variant.environment_metrics.has_temperature = true; + telemetry.variant.environment_metrics.relative_humidity = 65.43f; + telemetry.variant.environment_metrics.has_relative_humidity = true; + telemetry.variant.environment_metrics.barometric_pressure = 1013.27f; + telemetry.variant.environment_metrics.has_barometric_pressure = true; + + // Gas and air quality + telemetry.variant.environment_metrics.gas_resistance = 50.58f; + telemetry.variant.environment_metrics.has_gas_resistance = true; + telemetry.variant.environment_metrics.iaq = 120; + telemetry.variant.environment_metrics.has_iaq = true; + + // Power measurements + telemetry.variant.environment_metrics.voltage = 3.34f; + telemetry.variant.environment_metrics.has_voltage = true; + telemetry.variant.environment_metrics.current = 0.53f; + telemetry.variant.environment_metrics.has_current = true; + + // Light measurements + telemetry.variant.environment_metrics.lux = 450.12f; + telemetry.variant.environment_metrics.has_lux = true; + telemetry.variant.environment_metrics.white_lux = 380.95f; + telemetry.variant.environment_metrics.has_white_lux = true; + telemetry.variant.environment_metrics.ir_lux = 25.37f; + telemetry.variant.environment_metrics.has_ir_lux = true; + telemetry.variant.environment_metrics.uv_lux = 15.68f; + telemetry.variant.environment_metrics.has_uv_lux = true; + + // Distance measurement + telemetry.variant.environment_metrics.distance = 150.29f; + telemetry.variant.environment_metrics.has_distance = true; + + // Wind measurements + telemetry.variant.environment_metrics.wind_direction = 180; + telemetry.variant.environment_metrics.has_wind_direction = true; + telemetry.variant.environment_metrics.wind_speed = 5.52f; + telemetry.variant.environment_metrics.has_wind_speed = true; + telemetry.variant.environment_metrics.wind_gust = 8.24f; + telemetry.variant.environment_metrics.has_wind_gust = true; + telemetry.variant.environment_metrics.wind_lull = 2.13f; + telemetry.variant.environment_metrics.has_wind_lull = true; + + // Weight measurement + telemetry.variant.environment_metrics.weight = 75.56f; + telemetry.variant.environment_metrics.has_weight = true; + + // Radiation measurement + telemetry.variant.environment_metrics.radiation = 0.13f; + telemetry.variant.environment_metrics.has_radiation = true; + + // Rainfall measurements + telemetry.variant.environment_metrics.rainfall_1h = 2.57f; + telemetry.variant.environment_metrics.has_rainfall_1h = true; + telemetry.variant.environment_metrics.rainfall_24h = 15.89f; + telemetry.variant.environment_metrics.has_rainfall_24h = true; + + // Soil measurements + telemetry.variant.environment_metrics.soil_moisture = 85; + telemetry.variant.environment_metrics.has_soil_moisture = true; + telemetry.variant.environment_metrics.soil_temperature = 18.54f; + telemetry.variant.environment_metrics.has_soil_temperature = true; + + pb_ostream_t stream = pb_ostream_from_buffer(buffer, buffer_size); + pb_encode(&stream, &meshtastic_Telemetry_msg, &telemetry); + return stream.bytes_written; +} + +// Test TELEMETRY_APP port with device metrics +void test_telemetry_device_metrics_serialization() +{ + uint8_t buffer[256]; + size_t payload_size = encode_telemetry_device_metrics(buffer, sizeof(buffer)); + + meshtastic_MeshPacket packet = create_test_packet(meshtastic_PortNum_TELEMETRY_APP, buffer, payload_size); + + std::string json = MeshPacketSerializer::JsonSerialize(&packet, false); + TEST_ASSERT_TRUE(json.length() > 0); + + JSONValue *root = JSON::Parse(json.c_str()); + TEST_ASSERT_NOT_NULL(root); + TEST_ASSERT_TRUE(root->IsObject()); + + JSONObject jsonObj = root->AsObject(); + + // Check message type + TEST_ASSERT_TRUE(jsonObj.find("type") != jsonObj.end()); + TEST_ASSERT_EQUAL_STRING("telemetry", jsonObj["type"]->AsString().c_str()); + + // Check payload + TEST_ASSERT_TRUE(jsonObj.find("payload") != jsonObj.end()); + TEST_ASSERT_TRUE(jsonObj["payload"]->IsObject()); + + JSONObject payload = jsonObj["payload"]->AsObject(); + + // Verify telemetry data + TEST_ASSERT_TRUE(payload.find("battery_level") != payload.end()); + TEST_ASSERT_EQUAL(85, (int)payload["battery_level"]->AsNumber()); + + TEST_ASSERT_TRUE(payload.find("voltage") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 3.72f, payload["voltage"]->AsNumber()); + + TEST_ASSERT_TRUE(payload.find("channel_utilization") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 15.56f, payload["channel_utilization"]->AsNumber()); + + TEST_ASSERT_TRUE(payload.find("uptime_seconds") != payload.end()); + TEST_ASSERT_EQUAL(12345, (int)payload["uptime_seconds"]->AsNumber()); + + // Note: JSON serialization may not preserve exact 2-decimal formatting due to float precision + // We verify the numeric values are correct within tolerance + + delete root; +} + +// Test that telemetry environment metrics are properly serialized +void test_telemetry_environment_metrics_serialization() +{ + uint8_t buffer[256]; + size_t payload_size = encode_telemetry_environment_metrics(buffer, sizeof(buffer)); + + meshtastic_MeshPacket packet = create_test_packet(meshtastic_PortNum_TELEMETRY_APP, buffer, payload_size); + + std::string json = MeshPacketSerializer::JsonSerialize(&packet, false); + TEST_ASSERT_TRUE(json.length() > 0); + + JSONValue *root = JSON::Parse(json.c_str()); + TEST_ASSERT_NOT_NULL(root); + TEST_ASSERT_TRUE(root->IsObject()); + + JSONObject jsonObj = root->AsObject(); + + // Check payload exists + TEST_ASSERT_TRUE(jsonObj.find("payload") != jsonObj.end()); + TEST_ASSERT_TRUE(jsonObj["payload"]->IsObject()); + + JSONObject payload = jsonObj["payload"]->AsObject(); + + // Test key fields that should be present in the serializer + TEST_ASSERT_TRUE(payload.find("temperature") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 23.56f, payload["temperature"]->AsNumber()); + + TEST_ASSERT_TRUE(payload.find("relative_humidity") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 65.43f, payload["relative_humidity"]->AsNumber()); + + TEST_ASSERT_TRUE(payload.find("distance") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 150.29f, payload["distance"]->AsNumber()); + + // Note: JSON serialization may have float precision limitations + // We focus on verifying numeric accuracy rather than exact string formatting + + delete root; +} + +// Test comprehensive environment metrics coverage +void test_telemetry_environment_metrics_comprehensive() +{ + uint8_t buffer[256]; + size_t payload_size = encode_telemetry_environment_metrics(buffer, sizeof(buffer)); + + meshtastic_MeshPacket packet = create_test_packet(meshtastic_PortNum_TELEMETRY_APP, buffer, payload_size); + + std::string json = MeshPacketSerializer::JsonSerialize(&packet, false); + TEST_ASSERT_TRUE(json.length() > 0); + + JSONValue *root = JSON::Parse(json.c_str()); + TEST_ASSERT_NOT_NULL(root); + TEST_ASSERT_TRUE(root->IsObject()); + + JSONObject jsonObj = root->AsObject(); + + // Check payload exists + TEST_ASSERT_TRUE(jsonObj.find("payload") != jsonObj.end()); + TEST_ASSERT_TRUE(jsonObj["payload"]->IsObject()); + + JSONObject payload = jsonObj["payload"]->AsObject(); + + // Check all 15 originally supported fields + TEST_ASSERT_TRUE(payload.find("temperature") != payload.end()); + TEST_ASSERT_TRUE(payload.find("relative_humidity") != payload.end()); + TEST_ASSERT_TRUE(payload.find("barometric_pressure") != payload.end()); + TEST_ASSERT_TRUE(payload.find("gas_resistance") != payload.end()); + TEST_ASSERT_TRUE(payload.find("voltage") != payload.end()); + TEST_ASSERT_TRUE(payload.find("current") != payload.end()); + TEST_ASSERT_TRUE(payload.find("iaq") != payload.end()); + TEST_ASSERT_TRUE(payload.find("distance") != payload.end()); + TEST_ASSERT_TRUE(payload.find("lux") != payload.end()); + TEST_ASSERT_TRUE(payload.find("white_lux") != payload.end()); + TEST_ASSERT_TRUE(payload.find("wind_direction") != payload.end()); + TEST_ASSERT_TRUE(payload.find("wind_speed") != payload.end()); + TEST_ASSERT_TRUE(payload.find("wind_gust") != payload.end()); + TEST_ASSERT_TRUE(payload.find("wind_lull") != payload.end()); + TEST_ASSERT_TRUE(payload.find("radiation") != payload.end()); + + delete root; +} + +// Test for the 7 environment fields that were added to complete coverage +void test_telemetry_environment_metrics_missing_fields() +{ + uint8_t buffer[256]; + size_t payload_size = encode_telemetry_environment_metrics(buffer, sizeof(buffer)); + + meshtastic_MeshPacket packet = create_test_packet(meshtastic_PortNum_TELEMETRY_APP, buffer, payload_size); + + std::string json = MeshPacketSerializer::JsonSerialize(&packet, false); + TEST_ASSERT_TRUE(json.length() > 0); + + JSONValue *root = JSON::Parse(json.c_str()); + TEST_ASSERT_NOT_NULL(root); + TEST_ASSERT_TRUE(root->IsObject()); + + JSONObject jsonObj = root->AsObject(); + + // Check payload exists + TEST_ASSERT_TRUE(jsonObj.find("payload") != jsonObj.end()); + TEST_ASSERT_TRUE(jsonObj["payload"]->IsObject()); + + JSONObject payload = jsonObj["payload"]->AsObject(); + + // Check the 7 fields that were previously missing + TEST_ASSERT_TRUE(payload.find("ir_lux") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 25.37f, payload["ir_lux"]->AsNumber()); + + TEST_ASSERT_TRUE(payload.find("uv_lux") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 15.68f, payload["uv_lux"]->AsNumber()); + + TEST_ASSERT_TRUE(payload.find("weight") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 75.56f, payload["weight"]->AsNumber()); + + TEST_ASSERT_TRUE(payload.find("rainfall_1h") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 2.57f, payload["rainfall_1h"]->AsNumber()); + + TEST_ASSERT_TRUE(payload.find("rainfall_24h") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 15.89f, payload["rainfall_24h"]->AsNumber()); + + TEST_ASSERT_TRUE(payload.find("soil_moisture") != payload.end()); + TEST_ASSERT_EQUAL(85, (int)payload["soil_moisture"]->AsNumber()); + + TEST_ASSERT_TRUE(payload.find("soil_temperature") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 18.54f, payload["soil_temperature"]->AsNumber()); + + // Note: JSON float serialization may not preserve exact decimal formatting + // We verify the values are numerically correct within tolerance + + delete root; +} + +// Test that ALL environment fields are serialized (canary test for forgotten fields) +// This test will FAIL if a new environment field is added to the protobuf but not to the serializer +void test_telemetry_environment_metrics_complete_coverage() +{ + uint8_t buffer[256]; + size_t payload_size = encode_telemetry_environment_metrics_all_fields(buffer, sizeof(buffer)); + + meshtastic_MeshPacket packet = create_test_packet(meshtastic_PortNum_TELEMETRY_APP, buffer, payload_size); + + std::string json = MeshPacketSerializer::JsonSerialize(&packet, false); + TEST_ASSERT_TRUE(json.length() > 0); + + JSONValue *root = JSON::Parse(json.c_str()); + TEST_ASSERT_NOT_NULL(root); + TEST_ASSERT_TRUE(root->IsObject()); + + JSONObject jsonObj = root->AsObject(); + + // Check payload exists + TEST_ASSERT_TRUE(jsonObj.find("payload") != jsonObj.end()); + TEST_ASSERT_TRUE(jsonObj["payload"]->IsObject()); + + JSONObject payload = jsonObj["payload"]->AsObject(); + + // ✅ ALL 22 environment fields MUST be present and correct + // If this test fails, it means either: + // 1. A new field was added to the protobuf but not to the serializer + // 2. The encode_telemetry_environment_metrics_all_fields() function wasn't updated + + // Basic environment (3 fields) + TEST_ASSERT_TRUE(payload.find("temperature") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 23.56f, payload["temperature"]->AsNumber()); + TEST_ASSERT_TRUE(payload.find("relative_humidity") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 65.43f, payload["relative_humidity"]->AsNumber()); + TEST_ASSERT_TRUE(payload.find("barometric_pressure") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 1013.27f, payload["barometric_pressure"]->AsNumber()); + + // Gas and air quality (2 fields) + TEST_ASSERT_TRUE(payload.find("gas_resistance") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 50.58f, payload["gas_resistance"]->AsNumber()); + TEST_ASSERT_TRUE(payload.find("iaq") != payload.end()); + TEST_ASSERT_EQUAL(120, (int)payload["iaq"]->AsNumber()); + + // Power measurements (2 fields) + TEST_ASSERT_TRUE(payload.find("voltage") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 3.34f, payload["voltage"]->AsNumber()); + TEST_ASSERT_TRUE(payload.find("current") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 0.53f, payload["current"]->AsNumber()); + + // Light measurements (4 fields) + TEST_ASSERT_TRUE(payload.find("lux") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 450.12f, payload["lux"]->AsNumber()); + TEST_ASSERT_TRUE(payload.find("white_lux") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 380.95f, payload["white_lux"]->AsNumber()); + TEST_ASSERT_TRUE(payload.find("ir_lux") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 25.37f, payload["ir_lux"]->AsNumber()); + TEST_ASSERT_TRUE(payload.find("uv_lux") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 15.68f, payload["uv_lux"]->AsNumber()); + + // Distance measurement (1 field) + TEST_ASSERT_TRUE(payload.find("distance") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 150.29f, payload["distance"]->AsNumber()); + + // Wind measurements (4 fields) + TEST_ASSERT_TRUE(payload.find("wind_direction") != payload.end()); + TEST_ASSERT_EQUAL(180, (int)payload["wind_direction"]->AsNumber()); + TEST_ASSERT_TRUE(payload.find("wind_speed") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 5.52f, payload["wind_speed"]->AsNumber()); + TEST_ASSERT_TRUE(payload.find("wind_gust") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 8.24f, payload["wind_gust"]->AsNumber()); + TEST_ASSERT_TRUE(payload.find("wind_lull") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 2.13f, payload["wind_lull"]->AsNumber()); + + // Weight measurement (1 field) + TEST_ASSERT_TRUE(payload.find("weight") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 75.56f, payload["weight"]->AsNumber()); + + // Radiation measurement (1 field) + TEST_ASSERT_TRUE(payload.find("radiation") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 0.13f, payload["radiation"]->AsNumber()); + + // Rainfall measurements (2 fields) + TEST_ASSERT_TRUE(payload.find("rainfall_1h") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 2.57f, payload["rainfall_1h"]->AsNumber()); + TEST_ASSERT_TRUE(payload.find("rainfall_24h") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 15.89f, payload["rainfall_24h"]->AsNumber()); + + // Soil measurements (2 fields) + TEST_ASSERT_TRUE(payload.find("soil_moisture") != payload.end()); + TEST_ASSERT_EQUAL(85, (int)payload["soil_moisture"]->AsNumber()); + TEST_ASSERT_TRUE(payload.find("soil_temperature") != payload.end()); + TEST_ASSERT_FLOAT_WITHIN(0.01f, 18.54f, payload["soil_temperature"]->AsNumber()); + + // Total: 22 environment fields + // This test ensures 100% coverage of environment metrics + + // Note: JSON float serialization precision may vary due to the underlying library + // The important aspect is that all values are numerically accurate within tolerance + + delete root; +} + +// Test that unset environment fields are not present in JSON +void test_telemetry_environment_metrics_unset_fields() +{ + uint8_t buffer[256]; + size_t payload_size = encode_telemetry_environment_metrics_empty(buffer, sizeof(buffer)); + + meshtastic_MeshPacket packet = create_test_packet(meshtastic_PortNum_TELEMETRY_APP, buffer, payload_size); + + std::string json = MeshPacketSerializer::JsonSerialize(&packet, false); + TEST_ASSERT_TRUE(json.length() > 0); + + JSONValue *root = JSON::Parse(json.c_str()); + TEST_ASSERT_NOT_NULL(root); + TEST_ASSERT_TRUE(root->IsObject()); + + JSONObject jsonObj = root->AsObject(); + + // Check payload exists + TEST_ASSERT_TRUE(jsonObj.find("payload") != jsonObj.end()); + TEST_ASSERT_TRUE(jsonObj["payload"]->IsObject()); + + JSONObject payload = jsonObj["payload"]->AsObject(); + + // With completely empty environment metrics, NO fields should be present + // Only basic telemetry fields like "time" might be present + + // All 22 environment fields should be absent (none were set) + TEST_ASSERT_TRUE(payload.find("temperature") == payload.end()); + TEST_ASSERT_TRUE(payload.find("relative_humidity") == payload.end()); + TEST_ASSERT_TRUE(payload.find("barometric_pressure") == payload.end()); + TEST_ASSERT_TRUE(payload.find("gas_resistance") == payload.end()); + TEST_ASSERT_TRUE(payload.find("iaq") == payload.end()); + TEST_ASSERT_TRUE(payload.find("voltage") == payload.end()); + TEST_ASSERT_TRUE(payload.find("current") == payload.end()); + TEST_ASSERT_TRUE(payload.find("lux") == payload.end()); + TEST_ASSERT_TRUE(payload.find("white_lux") == payload.end()); + TEST_ASSERT_TRUE(payload.find("ir_lux") == payload.end()); + TEST_ASSERT_TRUE(payload.find("uv_lux") == payload.end()); + TEST_ASSERT_TRUE(payload.find("distance") == payload.end()); + TEST_ASSERT_TRUE(payload.find("wind_direction") == payload.end()); + TEST_ASSERT_TRUE(payload.find("wind_speed") == payload.end()); + TEST_ASSERT_TRUE(payload.find("wind_gust") == payload.end()); + TEST_ASSERT_TRUE(payload.find("wind_lull") == payload.end()); + TEST_ASSERT_TRUE(payload.find("weight") == payload.end()); + TEST_ASSERT_TRUE(payload.find("radiation") == payload.end()); + TEST_ASSERT_TRUE(payload.find("rainfall_1h") == payload.end()); + TEST_ASSERT_TRUE(payload.find("rainfall_24h") == payload.end()); + TEST_ASSERT_TRUE(payload.find("soil_moisture") == payload.end()); + TEST_ASSERT_TRUE(payload.find("soil_temperature") == payload.end()); + + delete root; +} diff --git a/test/test_meshpacket_serializer/ports/test_text_message.cpp b/test/test_meshpacket_serializer/ports/test_text_message.cpp new file mode 100644 index 000000000..de3f34541 --- /dev/null +++ b/test/test_meshpacket_serializer/ports/test_text_message.cpp @@ -0,0 +1,42 @@ +#include "../test_helpers.h" + +// Test TEXT_MESSAGE_APP port +void test_text_message_serialization() +{ + const char *test_text = "Hello Meshtastic!"; + meshtastic_MeshPacket packet = + create_test_packet(meshtastic_PortNum_TEXT_MESSAGE_APP, (const uint8_t *)test_text, strlen(test_text)); + + std::string json = MeshPacketSerializer::JsonSerialize(&packet, false); + TEST_ASSERT_TRUE(json.length() > 0); + + JSONValue *root = JSON::Parse(json.c_str()); + TEST_ASSERT_NOT_NULL(root); + TEST_ASSERT_TRUE(root->IsObject()); + + JSONObject jsonObj = root->AsObject(); + + // Check basic packet fields + TEST_ASSERT_TRUE(jsonObj.find("from") != jsonObj.end()); + TEST_ASSERT_EQUAL(0x11223344, (uint32_t)jsonObj["from"]->AsNumber()); + + TEST_ASSERT_TRUE(jsonObj.find("to") != jsonObj.end()); + TEST_ASSERT_EQUAL(0x55667788, (uint32_t)jsonObj["to"]->AsNumber()); + + TEST_ASSERT_TRUE(jsonObj.find("id") != jsonObj.end()); + TEST_ASSERT_EQUAL(0x9999, (uint32_t)jsonObj["id"]->AsNumber()); + + // Check message type + TEST_ASSERT_TRUE(jsonObj.find("type") != jsonObj.end()); + TEST_ASSERT_EQUAL_STRING("text", jsonObj["type"]->AsString().c_str()); + + // Check payload + TEST_ASSERT_TRUE(jsonObj.find("payload") != jsonObj.end()); + TEST_ASSERT_TRUE(jsonObj["payload"]->IsObject()); + + JSONObject payload = jsonObj["payload"]->AsObject(); + TEST_ASSERT_TRUE(payload.find("text") != payload.end()); + TEST_ASSERT_EQUAL_STRING("Hello Meshtastic!", payload["text"]->AsString().c_str()); + + delete root; +} diff --git a/test/test_meshpacket_serializer/ports/test_waypoint.cpp b/test/test_meshpacket_serializer/ports/test_waypoint.cpp new file mode 100644 index 000000000..b7e811d70 --- /dev/null +++ b/test/test_meshpacket_serializer/ports/test_waypoint.cpp @@ -0,0 +1,53 @@ +#include "../test_helpers.h" + +static size_t encode_waypoint(uint8_t *buffer, size_t buffer_size) +{ + meshtastic_Waypoint waypoint = meshtastic_Waypoint_init_zero; + waypoint.id = 12345; + waypoint.latitude_i = 374208000; + waypoint.longitude_i = -1221981000; + waypoint.expire = 1609459200 + 3600; // 1 hour from now + strcpy(waypoint.name, "Test Point"); + strcpy(waypoint.description, "Test waypoint description"); + + pb_ostream_t stream = pb_ostream_from_buffer(buffer, buffer_size); + pb_encode(&stream, &meshtastic_Waypoint_msg, &waypoint); + return stream.bytes_written; +} + +// Test WAYPOINT_APP port +void test_waypoint_serialization() +{ + uint8_t buffer[256]; + size_t payload_size = encode_waypoint(buffer, sizeof(buffer)); + + meshtastic_MeshPacket packet = create_test_packet(meshtastic_PortNum_WAYPOINT_APP, buffer, payload_size); + + std::string json = MeshPacketSerializer::JsonSerialize(&packet, false); + TEST_ASSERT_TRUE(json.length() > 0); + + JSONValue *root = JSON::Parse(json.c_str()); + TEST_ASSERT_NOT_NULL(root); + TEST_ASSERT_TRUE(root->IsObject()); + + JSONObject jsonObj = root->AsObject(); + + // Check message type + TEST_ASSERT_TRUE(jsonObj.find("type") != jsonObj.end()); + TEST_ASSERT_EQUAL_STRING("waypoint", jsonObj["type"]->AsString().c_str()); + + // Check payload + TEST_ASSERT_TRUE(jsonObj.find("payload") != jsonObj.end()); + TEST_ASSERT_TRUE(jsonObj["payload"]->IsObject()); + + JSONObject payload = jsonObj["payload"]->AsObject(); + + // Verify waypoint data + TEST_ASSERT_TRUE(payload.find("id") != payload.end()); + TEST_ASSERT_EQUAL(12345, (int)payload["id"]->AsNumber()); + + TEST_ASSERT_TRUE(payload.find("name") != payload.end()); + TEST_ASSERT_EQUAL_STRING("Test Point", payload["name"]->AsString().c_str()); + + delete root; +} diff --git a/test/test_meshpacket_serializer/test_helpers.h b/test/test_meshpacket_serializer/test_helpers.h new file mode 100644 index 000000000..630e059bc --- /dev/null +++ b/test/test_meshpacket_serializer/test_helpers.h @@ -0,0 +1,44 @@ +#pragma once + +#include "serialization/JSON.h" +#include "serialization/MeshPacketSerializer.h" +#include +#include +#include +#include +#include +#include +#include + +// Helper function to create a test packet with the given port and payload +static meshtastic_MeshPacket create_test_packet(meshtastic_PortNum port, const uint8_t *payload, size_t payload_size) +{ + meshtastic_MeshPacket packet = meshtastic_MeshPacket_init_zero; + + packet.id = 0x9999; + packet.from = 0x11223344; + packet.to = 0x55667788; + packet.channel = 0; + packet.hop_limit = 3; + packet.want_ack = false; + packet.priority = meshtastic_MeshPacket_Priority_UNSET; + packet.rx_time = 1609459200; + packet.rx_snr = 10.5f; + packet.hop_start = 3; + packet.rx_rssi = -85; + packet.delayed = meshtastic_MeshPacket_Delayed_NO_DELAY; + + // Set decoded variant + packet.which_payload_variant = meshtastic_MeshPacket_decoded_tag; + packet.decoded.portnum = port; + memcpy(packet.decoded.payload.bytes, payload, payload_size); + packet.decoded.payload.size = payload_size; + packet.decoded.want_response = false; + packet.decoded.dest = 0x55667788; + packet.decoded.source = 0x11223344; + packet.decoded.request_id = 0; + packet.decoded.reply_id = 0; + packet.decoded.emoji = 0; + + return packet; +} diff --git a/test/test_meshpacket_serializer/test_serializer.cpp b/test/test_meshpacket_serializer/test_serializer.cpp new file mode 100644 index 000000000..d74031fa4 --- /dev/null +++ b/test/test_meshpacket_serializer/test_serializer.cpp @@ -0,0 +1,51 @@ +#include "test_helpers.h" +#include +#include + +// Forward declarations for test functions +void test_text_message_serialization(); +void test_position_serialization(); +void test_nodeinfo_serialization(); +void test_waypoint_serialization(); +void test_telemetry_device_metrics_serialization(); +void test_telemetry_environment_metrics_serialization(); +void test_telemetry_environment_metrics_comprehensive(); +void test_telemetry_environment_metrics_missing_fields(); +void test_telemetry_environment_metrics_complete_coverage(); +void test_telemetry_environment_metrics_unset_fields(); +void test_encrypted_packet_serialization(); + +void setup() +{ + UNITY_BEGIN(); + + // Text message tests + RUN_TEST(test_text_message_serialization); + + // Position tests + RUN_TEST(test_position_serialization); + + // Nodeinfo tests + RUN_TEST(test_nodeinfo_serialization); + + // Waypoint tests + RUN_TEST(test_waypoint_serialization); + + // Telemetry tests + RUN_TEST(test_telemetry_device_metrics_serialization); + RUN_TEST(test_telemetry_environment_metrics_serialization); + RUN_TEST(test_telemetry_environment_metrics_comprehensive); + RUN_TEST(test_telemetry_environment_metrics_missing_fields); + RUN_TEST(test_telemetry_environment_metrics_complete_coverage); + RUN_TEST(test_telemetry_environment_metrics_unset_fields); + + // Encrypted packet test + RUN_TEST(test_encrypted_packet_serialization); + + UNITY_END(); +} + +void loop() +{ + delay(1000); +} From 608fdc6f52d7e4d1588fad4b92712e5290b00ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Mon, 28 Jul 2025 16:47:46 +0200 Subject: [PATCH 076/180] Santa may be checking his list twice, but we only need this in the platformio.ini (#7490) --- variants/nrf52840/gat562_mesh_trial_tracker/variant.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/variants/nrf52840/gat562_mesh_trial_tracker/variant.h b/variants/nrf52840/gat562_mesh_trial_tracker/variant.h index 2af0bc76d..6337ac70c 100644 --- a/variants/nrf52840/gat562_mesh_trial_tracker/variant.h +++ b/variants/nrf52840/gat562_mesh_trial_tracker/variant.h @@ -19,8 +19,6 @@ #ifndef _VARIANT_GAT562_MESH_TRIAL_TRACKER_ #define _VARIANT_GAT562_MESH_TRIAL_TRACKER_ -#define GAT562_MESH_TRIAL_TRACKER - // led pin 2 (blue), see https://github.com/meshtastic/firmware/blob/master/src/mesh/NodeDB.cpp#L723 #define RAK4630 From 1a8ab2aadc6adac01bbf5f5b186e0ca3d3382975 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Mon, 28 Jul 2025 12:23:59 -0500 Subject: [PATCH 077/180] NodeDB count on MyNodeInfo for client progress reporting (#7489) --- src/mesh/PhoneAPI.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index e0b81bedd..83becb037 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -205,6 +205,7 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) // app not to send locations on our behalf. fromRadioScratch.which_payload_variant = meshtastic_FromRadio_my_info_tag; strncpy(myNodeInfo.pio_env, optstr(APP_ENV), sizeof(myNodeInfo.pio_env)); + myNodeInfo.nodedb_count = static_cast(nodeDB->getNumMeshNodes()); fromRadioScratch.my_info = myNodeInfo; state = STATE_SEND_UIDATA; From cc5d00e2116a458f84078c24c51a99b17f9f2774 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Mon, 28 Jul 2025 12:37:37 -0500 Subject: [PATCH 078/180] Core portnums rebroadcast mode whitelist instead of blacklist (#7487) --- src/mesh/Router.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index 02968513c..993c59dd6 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -651,11 +651,12 @@ void Router::handleReceived(meshtastic_MeshPacket *p, RxSource src) shouldIgnoreNonstandardPorts = true; #endif if (shouldIgnoreNonstandardPorts && p->which_payload_variant == meshtastic_MeshPacket_decoded_tag && - IS_ONE_OF(p->decoded.portnum, meshtastic_PortNum_ATAK_FORWARDER, meshtastic_PortNum_ATAK_PLUGIN, - meshtastic_PortNum_PAXCOUNTER_APP, meshtastic_PortNum_IP_TUNNEL_APP, meshtastic_PortNum_AUDIO_APP, - meshtastic_PortNum_PRIVATE_APP, meshtastic_PortNum_DETECTION_SENSOR_APP, meshtastic_PortNum_RANGE_TEST_APP, - meshtastic_PortNum_REMOTE_HARDWARE_APP)) { - LOG_DEBUG("Ignore packet on blacklisted portnum for CORE_PORTNUMS_ONLY"); + !IS_ONE_OF(p->decoded.portnum, meshtastic_PortNum_TEXT_MESSAGE_APP, meshtastic_PortNum_TEXT_MESSAGE_COMPRESSED_APP, + meshtastic_PortNum_POSITION_APP, meshtastic_PortNum_NODEINFO_APP, meshtastic_PortNum_ROUTING_APP, + meshtastic_PortNum_TELEMETRY_APP, meshtastic_PortNum_ADMIN_APP, meshtastic_PortNum_ALERT_APP, + meshtastic_PortNum_KEY_VERIFICATION_APP, meshtastic_PortNum_WAYPOINT_APP, + meshtastic_PortNum_STORE_FORWARD_APP, meshtastic_PortNum_TRACEROUTE_APP)) { + LOG_DEBUG("Ignore packet on non-standard portnum for CORE_PORTNUMS_ONLY"); cancelSending(p->from, p->id); skipHandle = true; } From b5a8e8f51ba87d873e4eb3e714267b4f4bf39719 Mon Sep 17 00:00:00 2001 From: Chloe Bethel Date: Mon, 28 Jul 2025 23:51:38 +0100 Subject: [PATCH 079/180] DEBUG_MUTE correctness (#7492) * treewide: make 'ifdef DEBUG_PORT' guards also take into account DEBUG_MUTE * stm32wl: Add a guard against having debug prints turned on without PIO_FRAMEWORK_ARDUINO_NANOLIB_FLOAT_PRINTF defined --------- Co-authored-by: Ben Meadors --- src/mesh/Router.cpp | 5 +++-- src/modules/ReplyModule.cpp | 2 +- src/modules/Telemetry/AirQualityTelemetry.cpp | 2 +- src/modules/Telemetry/DeviceTelemetry.cpp | 2 +- src/modules/Telemetry/EnvironmentTelemetry.cpp | 2 +- src/modules/Telemetry/HealthTelemetry.cpp | 2 +- src/modules/Telemetry/HostMetrics.cpp | 2 +- src/modules/Telemetry/PowerTelemetry.cpp | 2 +- src/modules/TextMessageModule.cpp | 2 +- src/modules/TraceRouteModule.cpp | 2 +- src/modules/WaypointModule.cpp | 2 +- src/platform/stm32wl/architecture.h | 5 +++++ src/sleep.cpp | 2 +- 13 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index 993c59dd6..a7508423a 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -224,9 +224,10 @@ ErrorCode Router::send(meshtastic_MeshPacket *p) if (!config.lora.override_duty_cycle && myRegion->dutyCycle < 100) { float hourlyTxPercent = airTime->utilizationTXPercent(); if (hourlyTxPercent > myRegion->dutyCycle) { -#ifdef DEBUG_PORT uint8_t silentMinutes = airTime->getSilentMinutes(hourlyTxPercent, myRegion->dutyCycle); + LOG_WARN("Duty cycle limit exceeded. Aborting send for now, you can send again in %d mins", silentMinutes); + meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); cn->has_reply_id = true; cn->reply_id = p->id; @@ -234,7 +235,7 @@ ErrorCode Router::send(meshtastic_MeshPacket *p) cn->time = getValidTime(RTCQualityFromNet); sprintf(cn->message, "Duty cycle limit exceeded. You can send again in %d mins", silentMinutes); service->sendClientNotification(cn); -#endif + meshtastic_Routing_Error err = meshtastic_Routing_Error_DUTY_CYCLE_LIMIT; if (isFromUs(p)) { // only send NAK to API, not to the mesh abortSendAndNak(err, p); diff --git a/src/modules/ReplyModule.cpp b/src/modules/ReplyModule.cpp index 8892aaa97..434441d49 100644 --- a/src/modules/ReplyModule.cpp +++ b/src/modules/ReplyModule.cpp @@ -8,7 +8,7 @@ meshtastic_MeshPacket *ReplyModule::allocReply() { assert(currentRequest); // should always be !NULL -#ifdef DEBUG_PORT +#if defined(DEBUG_PORT) && !defined(DEBUG_MUTE) auto req = *currentRequest; auto &p = req.decoded; // The incoming message is in p.payload diff --git a/src/modules/Telemetry/AirQualityTelemetry.cpp b/src/modules/Telemetry/AirQualityTelemetry.cpp index 2472b95b1..21a563b9d 100644 --- a/src/modules/Telemetry/AirQualityTelemetry.cpp +++ b/src/modules/Telemetry/AirQualityTelemetry.cpp @@ -121,7 +121,7 @@ int32_t AirQualityTelemetryModule::runOnce() bool AirQualityTelemetryModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_Telemetry *t) { if (t->which_variant == meshtastic_Telemetry_air_quality_metrics_tag) { -#ifdef DEBUG_PORT +#if defined(DEBUG_PORT) && !defined(DEBUG_MUTE) const char *sender = getSenderShortName(mp); LOG_INFO("(Received from %s): pm10_standard=%i, pm25_standard=%i, pm100_standard=%i", sender, diff --git a/src/modules/Telemetry/DeviceTelemetry.cpp b/src/modules/Telemetry/DeviceTelemetry.cpp index 43c2dd84c..08fd09db0 100644 --- a/src/modules/Telemetry/DeviceTelemetry.cpp +++ b/src/modules/Telemetry/DeviceTelemetry.cpp @@ -49,7 +49,7 @@ bool DeviceTelemetryModule::handleReceivedProtobuf(const meshtastic_MeshPacket & return false; if (t->which_variant == meshtastic_Telemetry_device_metrics_tag) { -#ifdef DEBUG_PORT +#if defined(DEBUG_PORT) && !defined(DEBUG_MUTE) const char *sender = getSenderShortName(mp); LOG_INFO("(Received from %s): air_util_tx=%f, channel_utilization=%f, battery_level=%i, voltage=%f", sender, diff --git a/src/modules/Telemetry/EnvironmentTelemetry.cpp b/src/modules/Telemetry/EnvironmentTelemetry.cpp index d1b10fa82..8926b171c 100644 --- a/src/modules/Telemetry/EnvironmentTelemetry.cpp +++ b/src/modules/Telemetry/EnvironmentTelemetry.cpp @@ -502,7 +502,7 @@ void EnvironmentTelemetryModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiSt bool EnvironmentTelemetryModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_Telemetry *t) { if (t->which_variant == meshtastic_Telemetry_environment_metrics_tag) { -#ifdef DEBUG_PORT +#if defined(DEBUG_PORT) && !defined(DEBUG_MUTE) const char *sender = getSenderShortName(mp); LOG_INFO("(Received from %s): barometric_pressure=%f, current=%f, gas_resistance=%f, relative_humidity=%f, " diff --git a/src/modules/Telemetry/HealthTelemetry.cpp b/src/modules/Telemetry/HealthTelemetry.cpp index 3a735b1fa..215e49c7a 100644 --- a/src/modules/Telemetry/HealthTelemetry.cpp +++ b/src/modules/Telemetry/HealthTelemetry.cpp @@ -149,7 +149,7 @@ void HealthTelemetryModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState * bool HealthTelemetryModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_Telemetry *t) { if (t->which_variant == meshtastic_Telemetry_health_metrics_tag) { -#ifdef DEBUG_PORT +#if defined(DEBUG_PORT) && !defined(DEBUG_MUTE) const char *sender = getSenderShortName(mp); LOG_INFO("(Received from %s): temperature=%f, heart_bpm=%d, spO2=%d,", sender, t->variant.health_metrics.temperature, diff --git a/src/modules/Telemetry/HostMetrics.cpp b/src/modules/Telemetry/HostMetrics.cpp index 6a92b15f8..8f10b9228 100644 --- a/src/modules/Telemetry/HostMetrics.cpp +++ b/src/modules/Telemetry/HostMetrics.cpp @@ -27,7 +27,7 @@ bool HostMetricsModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, return false; if (t->which_variant == meshtastic_Telemetry_host_metrics_tag) { -#ifdef DEBUG_PORT +#if defined(DEBUG_PORT) && !defined(DEBUG_MUTE) const char *sender = getSenderShortName(mp); if (t->variant.host_metrics.has_user_string) t->variant.host_metrics.user_string[sizeof(t->variant.host_metrics.user_string) - 1] = '\0'; diff --git a/src/modules/Telemetry/PowerTelemetry.cpp b/src/modules/Telemetry/PowerTelemetry.cpp index a92013d01..35409edef 100644 --- a/src/modules/Telemetry/PowerTelemetry.cpp +++ b/src/modules/Telemetry/PowerTelemetry.cpp @@ -168,7 +168,7 @@ void PowerTelemetryModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *s bool PowerTelemetryModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_Telemetry *t) { if (t->which_variant == meshtastic_Telemetry_power_metrics_tag) { -#ifdef DEBUG_PORT +#if defined(DEBUG_PORT) && !defined(DEBUG_MUTE) const char *sender = getSenderShortName(mp); LOG_INFO("(Received from %s): ch1_voltage=%.1f, ch1_current=%.1f, ch2_voltage=%.1f, ch2_current=%.1f, " diff --git a/src/modules/TextMessageModule.cpp b/src/modules/TextMessageModule.cpp index 970f4429c..72df330c5 100644 --- a/src/modules/TextMessageModule.cpp +++ b/src/modules/TextMessageModule.cpp @@ -9,7 +9,7 @@ TextMessageModule *textMessageModule; ProcessMessage TextMessageModule::handleReceived(const meshtastic_MeshPacket &mp) { -#ifdef DEBUG_PORT +#if defined(DEBUG_PORT) && !defined(DEBUG_MUTE) auto &p = mp.decoded; LOG_INFO("Received text msg from=0x%0x, id=0x%x, msg=%.*s", mp.from, mp.id, p.payload.size, p.payload.bytes); #endif diff --git a/src/modules/TraceRouteModule.cpp b/src/modules/TraceRouteModule.cpp index bd75c6983..f4eccd667 100644 --- a/src/modules/TraceRouteModule.cpp +++ b/src/modules/TraceRouteModule.cpp @@ -232,7 +232,7 @@ void TraceRouteModule::appendMyIDandSNR(meshtastic_RouteDiscovery *updated, floa void TraceRouteModule::printRoute(meshtastic_RouteDiscovery *r, uint32_t origin, uint32_t dest, bool isTowardsDestination) { -#ifdef DEBUG_PORT +#if defined(DEBUG_PORT) && !defined(DEBUG_MUTE) std::string route = "Route traced:\n"; route += vformat("0x%x --> ", origin); for (uint8_t i = 0; i < r->route_count; i++) { diff --git a/src/modules/WaypointModule.cpp b/src/modules/WaypointModule.cpp index aab3ed6bc..4b05d5fa1 100644 --- a/src/modules/WaypointModule.cpp +++ b/src/modules/WaypointModule.cpp @@ -16,7 +16,7 @@ WaypointModule *waypointModule; ProcessMessage WaypointModule::handleReceived(const meshtastic_MeshPacket &mp) { -#ifdef DEBUG_PORT +#if defined(DEBUG_PORT) && !defined(DEBUG_MUTE) auto &p = mp.decoded; LOG_INFO("Received waypoint msg from=0x%0x, id=0x%x, msg=%.*s", mp.from, mp.id, p.payload.size, p.payload.bytes); #endif diff --git a/src/platform/stm32wl/architecture.h b/src/platform/stm32wl/architecture.h index ac2bbe5d1..e131a0a32 100644 --- a/src/platform/stm32wl/architecture.h +++ b/src/platform/stm32wl/architecture.h @@ -32,3 +32,8 @@ #define SX126X_DIO1 1001 #define SX126X_RESET 1003 #define SX126X_BUSY 1004 + +#if !defined(DEBUG_MUTE) && !defined(PIO_FRAMEWORK_ARDUINO_NANOLIB_FLOAT_PRINTF) +#error \ + "You MUST enable PIO_FRAMEWORK_ARDUINO_NANOLIB_FLOAT_PRINTF if debug prints are enabled. printf will print uninitialized garbage instead of floats." +#endif \ No newline at end of file diff --git a/src/sleep.cpp b/src/sleep.cpp index 09484f46e..1a5f246c5 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -131,7 +131,7 @@ void initDeepSleep() support busted boards, assume button one was pressed wakeButtons = ((uint64_t)1) << buttons.gpios[0]; */ -#ifdef DEBUG_PORT +#if defined(DEBUG_PORT) && !defined(DEBUG_MUTE) // If we booted because our timer ran out or the user pressed reset, send those as fake events RESET_REASON hwReason = rtc_get_reset_reason(0); From 1b793d1f234a11d012273f23dda7b2a639bda300 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 30 Jul 2025 06:29:03 -0500 Subject: [PATCH 080/180] Update protobufs (#7508) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/mesh.pb.h | 3 +++ src/mesh/generated/meshtastic/module_config.pb.h | 9 ++++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/protobufs b/protobufs index 9bac2886f..1ecf94da9 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 9bac2886f9344f25716921467a82e8b0326107cd +Subproject commit 1ecf94da9898ea0b8f2745bfe6bda2a8f2ca4073 diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index 8e6524042..f915a1db3 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -267,6 +267,9 @@ typedef enum _meshtastic_HardwareModel { meshtastic_HardwareModel_RAK3312 = 106, /* Elecrow ThinkNode M5 https://www.elecrow.com/wiki/ThinkNode_M5_Meshtastic_LoRa_Signal_Transceiver_ESP32-S3.html */ meshtastic_HardwareModel_THINKNODE_M5 = 107, + /* MeshSolar is an integrated power management and communication solution designed for outdoor low-power devices. + https://heltec.org/project/meshsolar/ */ + meshtastic_HardwareModel_HELTEC_MESH_SOLAR = 108, /* ------------------------------------------------------------------------------------------------------------------------------------------ Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. ------------------------------------------------------------------------------------------------------------------------------------------ */ diff --git a/src/mesh/generated/meshtastic/module_config.pb.h b/src/mesh/generated/meshtastic/module_config.pb.h index e8ae48072..b27f5f515 100644 --- a/src/mesh/generated/meshtastic/module_config.pb.h +++ b/src/mesh/generated/meshtastic/module_config.pb.h @@ -82,7 +82,10 @@ typedef enum _meshtastic_ModuleConfig_SerialConfig_Serial_Mode { meshtastic_ModuleConfig_SerialConfig_Serial_Mode_WS85 = 6, /* VE.Direct is a serial protocol used by Victron Energy products https://beta.ivc.no/wiki/index.php/Victron_VE_Direct_DIY_Cable */ - meshtastic_ModuleConfig_SerialConfig_Serial_Mode_VE_DIRECT = 7 + meshtastic_ModuleConfig_SerialConfig_Serial_Mode_VE_DIRECT = 7, + /* Used to configure and view some parameters of MeshSolar. +https://heltec.org/project/meshsolar/ */ + meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MS_CONFIG = 8 } meshtastic_ModuleConfig_SerialConfig_Serial_Mode; /* TODO: REPLACE */ @@ -472,8 +475,8 @@ extern "C" { #define _meshtastic_ModuleConfig_SerialConfig_Serial_Baud_ARRAYSIZE ((meshtastic_ModuleConfig_SerialConfig_Serial_Baud)(meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_921600+1)) #define _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MIN meshtastic_ModuleConfig_SerialConfig_Serial_Mode_DEFAULT -#define _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MAX meshtastic_ModuleConfig_SerialConfig_Serial_Mode_VE_DIRECT -#define _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_ARRAYSIZE ((meshtastic_ModuleConfig_SerialConfig_Serial_Mode)(meshtastic_ModuleConfig_SerialConfig_Serial_Mode_VE_DIRECT+1)) +#define _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MAX meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MS_CONFIG +#define _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_ARRAYSIZE ((meshtastic_ModuleConfig_SerialConfig_Serial_Mode)(meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MS_CONFIG+1)) #define _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE #define _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MAX meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_BACK From 7d926da98c6e3699d9fe8c20f193977ccbbccebf Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 30 Jul 2025 07:40:27 -0500 Subject: [PATCH 081/180] Heartbeat response (#7506) * Heartbeat response * Move it * Add debug log for visibility --- src/mesh/PhoneAPI.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index 83becb037..305689fff 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -31,6 +31,9 @@ #include "Throttle.h" #include +// Flag to indicate a heartbeat was received and we should send queue status +bool heartbeatReceived = false; + PhoneAPI::PhoneAPI() { lastContactMsec = millis(); @@ -155,6 +158,7 @@ bool PhoneAPI::handleToRadio(const uint8_t *buf, size_t bufLength) #endif case meshtastic_ToRadio_heartbeat_tag: LOG_DEBUG("Got client heartbeat"); + heartbeatReceived = true; break; default: // Ignore nop messages @@ -194,6 +198,17 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) // In case we send a FromRadio packet memset(&fromRadioScratch, 0, sizeof(fromRadioScratch)); + // Respond to heartbeat by sending queue status + if (heartbeatReceived) { + memset(&fromRadioScratch, 0, sizeof(fromRadioScratch)); + fromRadioScratch.which_payload_variant = meshtastic_FromRadio_queueStatus_tag; + fromRadioScratch.queueStatus = router->getQueueStatus(); + heartbeatReceived = false; + size_t numbytes = pb_encode_to_bytes(buf, meshtastic_FromRadio_size, &meshtastic_FromRadio_msg, &fromRadioScratch); + LOG_DEBUG("FromRadio=STATE_SEND_QUEUE_STATUS, numbytes=%u", numbytes); + return numbytes; + } + // Advance states as needed switch (state) { case STATE_SEND_NOTHING: From 4c901033b2bc4e67e330cf8927b90760014aedde Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Wed, 30 Jul 2025 22:47:00 +1000 Subject: [PATCH 082/180] Workaround Webserver needing to stay up while Wifi is turned off (#7484) Expertly triaged by @philon- , turning off wifi using the HTTP API did not work. That was because we only served the HTTP API if Wifi was deemed to be available, but mid-way through turning it off Wifi was still available, but the configuration we were checking said it wasn't. This patch introduces an additional way the system can determine if Wifi is available, by referring to the WiFi.status(). This means that in that limbo state where Wifi has been set to be turned off, but the configuration has not been saved and it is still up, the HTTP API will stay up long enough to save the configuration. Fixes https://github.com/meshtastic/firmware/issues/6965 --- src/mesh/wifi/WiFiAPClient.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mesh/wifi/WiFiAPClient.cpp b/src/mesh/wifi/WiFiAPClient.cpp index 7a56c258b..1133ad424 100644 --- a/src/mesh/wifi/WiFiAPClient.cpp +++ b/src/mesh/wifi/WiFiAPClient.cpp @@ -235,6 +235,11 @@ bool isWifiAvailable() #ifdef USE_WS5500 } else if (config.network.eth_enabled) { return true; +#endif +#ifndef ARCH_PORTDUINO + } else if (WiFi.status() == WL_CONNECTED) { + // it's likely we have wifi now, but user intends to turn it off in config! + return true; #endif } else { return false; From bdedd0e1fec17da0953a93637425e2f6a75da328 Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Thu, 31 Jul 2025 12:21:10 +1000 Subject: [PATCH 083/180] Airoha GPS - ignore estimated fixes (#7429) TinyGPS Fix Quality has this information: 0 - fix not available, 1 - GPS fix, 2 - Differential GPS fix (values above 2 are 2.3 features) 3 = PPS fix 4 = Real Time Kinematic 5 = Float RTK 6 = estimated (dead reckoning) 7 = Manual input mode 8 = Simulation mode the previous Airoha code would allow quality >0 , which includes estimated positions. These wouldn't be passed through to the mesh due to other checks, but would affect the Airoha GPS_FIX_HOLD_TIME calculations. Changes the calculation to 1 >= quality <=5 . --- src/gps/GPS.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index f3624c627..ae74f0fe2 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -1511,7 +1511,7 @@ bool GPS::lookForTime() #ifdef GNSS_AIROHA uint8_t fix = reader.fixQuality(); - if (fix > 0) { + if (fix >= 1 && fix <= 5) { if (lastFixStartMsec > 0) { if (Throttle::isWithinTimespanMs(lastFixStartMsec, GPS_FIX_HOLD_TIME)) { return false; @@ -1566,7 +1566,7 @@ bool GPS::lookForLocation() #ifdef GNSS_AIROHA if ((config.position.gps_update_interval * 1000) >= (GPS_FIX_HOLD_TIME * 2)) { uint8_t fix = reader.fixQuality(); - if (fix > 0) { + if (fix >= 1 && fix <= 5) { if (lastFixStartMsec > 0) { if (Throttle::isWithinTimespanMs(lastFixStartMsec, GPS_FIX_HOLD_TIME)) { return false; From 956a0f102b054e081238853ddc6465826489f3a5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 06:00:58 -0500 Subject: [PATCH 084/180] Update platformio/ststm32 to v19.3.0 (#7512) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- arch/stm32/stm32.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/stm32/stm32.ini b/arch/stm32/stm32.ini index 153ca9f3e..d91607a7d 100644 --- a/arch/stm32/stm32.ini +++ b/arch/stm32/stm32.ini @@ -2,7 +2,7 @@ extends = arduino_base platform = # renovate: datasource=custom.pio depName=platformio/ststm32 packageName=platformio/platform/ststm32 - platformio/ststm32@19.2.0 + platformio/ststm32@19.3.0 platform_packages = # TODO renovate platformio/framework-arduinoststm32@https://github.com/stm32duino/Arduino_Core_STM32/archive/2.10.1.zip From 10bd10b9d1c4b8c2cb73e7a97bb5740b62e0e4a5 Mon Sep 17 00:00:00 2001 From: mikecarper <135079168+mikecarper@users.noreply.github.com> Date: Thu, 31 Jul 2025 04:02:09 -0700 Subject: [PATCH 085/180] bugfix Syntax error: "(" unexpected in device-update.sh (#7514) * Update device-update.sh to use /bin/bash * Update meshtasticd.postinst to use /bin/bash * Update meshtasticd.postrm to use /bin/bash --- bin/device-update.sh | 2 +- debian/meshtasticd.postinst | 2 +- debian/meshtasticd.postrm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/device-update.sh b/bin/device-update.sh index ce0b5e434..2196d3af9 100755 --- a/bin/device-update.sh +++ b/bin/device-update.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash PYTHON=${PYTHON:-$(which python3 python|head -n 1)} CHANGE_MODE=false diff --git a/debian/meshtasticd.postinst b/debian/meshtasticd.postinst index fe0dbc332..d569cb43e 100755 --- a/debian/meshtasticd.postinst +++ b/debian/meshtasticd.postinst @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # postinst script for meshtasticd # # see: dh_installdeb(1) diff --git a/debian/meshtasticd.postrm b/debian/meshtasticd.postrm index bb2c32a5b..dc25680a8 100755 --- a/debian/meshtasticd.postrm +++ b/debian/meshtasticd.postrm @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # postrm script for meshtasticd # # see: dh_installdeb(1) From 88655ffc4432b8a63c3acdef6e1af22fd09bfb2b Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 31 Jul 2025 07:34:41 -0500 Subject: [PATCH 086/180] Move BLE toggle menu option and add confirmation for canned messages in L1 (#7516) * Move bluetooth to system menu and add confirmation for canned messages * Cruft * Handle else * Warn * Fixed screen reset --- src/graphics/draw/MenuHandler.cpp | 33 +++++++++++++++---- src/graphics/draw/MenuHandler.h | 1 + src/modules/CannedMessageModule.cpp | 21 +++++++++++- .../nrf52840/seeed_wio_tracker_L1/variant.h | 2 ++ 4 files changed, 49 insertions(+), 8 deletions(-) diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index cf19c4825..b7bd068c4 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -14,7 +14,9 @@ #include "modules/AdminModule.h" #include "modules/CannedMessageModule.h" #include "modules/KeyVerificationModule.h" + #include "modules/TraceRouteModule.h" +#include extern uint16_t TFT_MESH; @@ -118,6 +120,22 @@ void menuHandler::TwelveHourPicker() screen->showOverlayBanner(bannerOptions); } +// Reusable confirmation prompt function +void menuHandler::showConfirmationBanner(const char *message, std::function onConfirm) +{ + static const char *confirmOptions[] = {"No", "Yes"}; + BannerOverlayOptions confirmBanner; + confirmBanner.message = message; + confirmBanner.optionsArrayPtr = confirmOptions; + confirmBanner.optionsCount = 2; + confirmBanner.bannerCallback = [onConfirm](int confirmSelected) -> void { + if (confirmSelected == 1) { + onConfirm(); + } + }; + screen->showOverlayBanner(confirmBanner); +} + void menuHandler::ClockFacePicker() { static const char *optionsArray[] = {"Back", "Digital", "Analog"}; @@ -294,7 +312,7 @@ void menuHandler::messageResponseMenu() void menuHandler::homeBaseMenu() { - enum optionsNumbers { Back, Backlight, Position, Preset, Freetext, Bluetooth, Sleep, enumEnd }; + enum optionsNumbers { Back, Backlight, Position, Preset, Freetext, Sleep, enumEnd }; static const char *optionsArray[enumEnd] = {"Back"}; static int optionsEnumArray[enumEnd] = {Back}; @@ -316,8 +334,6 @@ void menuHandler::homeBaseMenu() optionsArray[options] = "New Freetext Msg"; optionsEnumArray[options++] = Freetext; } - optionsArray[options] = "Bluetooth Toggle"; - optionsEnumArray[options++] = Bluetooth; BannerOverlayOptions bannerOptions; bannerOptions.message = "Home Action"; @@ -342,9 +358,6 @@ void menuHandler::homeBaseMenu() cannedMessageModule->LaunchWithDestination(NODENUM_BROADCAST); } else if (selected == Freetext) { cannedMessageModule->LaunchFreetextWithDestination(NODENUM_BROADCAST); - } else if (selected == Bluetooth) { - menuQueue = bluetooth_toggle_menu; - screen->runNow(); } }; screen->showOverlayBanner(bannerOptions); @@ -381,7 +394,7 @@ void menuHandler::textMessageBaseMenu() void menuHandler::systemBaseMenu() { - enum optionsNumbers { Back, Notifications, ScreenOptions, PowerMenu, Test, enumEnd }; + enum optionsNumbers { Back, Notifications, ScreenOptions, Bluetooth, PowerMenu, Test, enumEnd }; static const char *optionsArray[enumEnd] = {"Back"}; static int optionsEnumArray[enumEnd] = {Back}; int options = 1; @@ -394,6 +407,9 @@ void menuHandler::systemBaseMenu() optionsEnumArray[options++] = ScreenOptions; #endif + optionsArray[options] = "Bluetooth Toggle"; + optionsEnumArray[options++] = Bluetooth; + optionsArray[options] = "Reboot/Shutdown"; optionsEnumArray[options++] = PowerMenu; @@ -420,6 +436,9 @@ void menuHandler::systemBaseMenu() } else if (selected == Test) { menuHandler::menuQueue = menuHandler::test_menu; screen->runNow(); + } else if (selected == Bluetooth) { + menuQueue = bluetooth_toggle_menu; + screen->runNow(); } else if (selected == Back && !test_enabled) { test_count++; if (test_count > 4) { diff --git a/src/graphics/draw/MenuHandler.h b/src/graphics/draw/MenuHandler.h index 2e4923241..87a0b055e 100644 --- a/src/graphics/draw/MenuHandler.h +++ b/src/graphics/draw/MenuHandler.h @@ -43,6 +43,7 @@ class menuHandler static void LoraRegionPicker(uint32_t duration = 30000); static void handleMenuSwitch(OLEDDisplay *display); + static void showConfirmationBanner(const char *message, std::function onConfirm); static void clockMenu(); static void TZPicker(); static void TwelveHourPicker(); diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index ed930db41..f7846ebbf 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -595,8 +595,27 @@ bool CannedMessageModule::handleMessageSelectorInput(const InputEvent *event, bo // Normal canned message selection if (runState == CANNED_MESSAGE_RUN_STATE_INACTIVE || runState == CANNED_MESSAGE_RUN_STATE_DISABLED) { } else { + // Show confirmation dialog before sending canned message + NodeNum destNode = dest; + ChannelIndex chan = channel; +#if CANNED_MESSAGE_ADD_CONFIRMATION + graphics::menuHandler::showConfirmationBanner("Send message?", [this, destNode, chan, current]() { + this->sendText(destNode, chan, current, false); + payload = runState; + runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; + currentMessageIndex = -1; + + // Notify UI to regenerate frame set and redraw + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); + screen->forceDisplay(); + }); +#else payload = runState; runState = CANNED_MESSAGE_RUN_STATE_ACTION_SELECT; +#endif + // Do not immediately set runState; wait for confirmation handled = true; } } @@ -1711,7 +1730,7 @@ void CannedMessageModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *st // Text: split by words and wrap inside word if needed String text = token.second; pos = 0; - while (pos < text.length()) { + while (pos < static_cast(text.length())) { // Find next space (or end) int spacePos = text.indexOf(' ', pos); int endPos = (spacePos == -1) ? text.length() : spacePos + 1; // Include space diff --git a/variants/nrf52840/seeed_wio_tracker_L1/variant.h b/variants/nrf52840/seeed_wio_tracker_L1/variant.h index 0c5964c5a..c5647caa8 100644 --- a/variants/nrf52840/seeed_wio_tracker_L1/variant.h +++ b/variants/nrf52840/seeed_wio_tracker_L1/variant.h @@ -162,6 +162,8 @@ static const uint8_t SCL = PIN_WIRE_SCL; #define CANNED_MESSAGE_MODULE_ENABLE 1 +#define CANNED_MESSAGE_ADD_CONFIRMATION 1 + // trackball #define HAS_TRACKBALL 1 #define TB_UP 25 From 5107531425675421bb893496c0227fad3e2dd77c Mon Sep 17 00:00:00 2001 From: HarukiToreda <116696711+HarukiToreda@users.noreply.github.com> Date: Thu, 31 Jul 2025 08:36:03 -0400 Subject: [PATCH 087/180] Remember destination fix (#7427) * T-watch screen misalignment fix * Trunk fix * Rember Last Receipient Node or channel When a new freetext or preset message is sent and a destination is selected, the next message would forget the previously selected destination and would need to be selected again. With this fix it will remember the last destination selected until changed again. * Fix for reply function to remember last messaged * trunk check --------- Co-authored-by: Jonathan Bennett Co-authored-by: Jason P Co-authored-by: Ben Meadors --- src/modules/CannedMessageModule.cpp | 41 +++++++++++++++++++++++++++++ src/modules/CannedMessageModule.h | 1 + 2 files changed, 42 insertions(+) diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index f7846ebbf..b6cb1b0e3 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -40,6 +40,9 @@ extern ScanI2C::DeviceAddress cardkb_found; extern bool graphics::isMuted; static const char *cannedMessagesConfigFile = "/prefs/cannedConf.proto"; +static NodeNum lastDest = NODENUM_BROADCAST; +static uint8_t lastChannel = 0; +static bool lastDestSet = false; meshtastic_CannedMessageModuleConfig cannedMessageModuleConfig; @@ -63,8 +66,18 @@ CannedMessageModule::CannedMessageModule() void CannedMessageModule::LaunchWithDestination(NodeNum newDest, uint8_t newChannel) { + // Use the requested destination, unless it's "broadcast" and we have a previous node/channel + if (newDest == NODENUM_BROADCAST && lastDestSet) { + newDest = lastDest; + newChannel = lastChannel; + } dest = newDest; channel = newChannel; + lastDest = dest; + lastChannel = channel; + lastDestSet = true; + + // Rest of function unchanged... // Always select the first real canned message on activation int firstRealMsgIdx = 0; for (int i = 0; i < messagesCount; ++i) { @@ -84,10 +97,28 @@ void CannedMessageModule::LaunchWithDestination(NodeNum newDest, uint8_t newChan notifyObservers(&e); } +void CannedMessageModule::LaunchRepeatDestination() +{ + if (!lastDestSet) { + LaunchWithDestination(NODENUM_BROADCAST, 0); + } else { + LaunchWithDestination(lastDest, lastChannel); + } +} + void CannedMessageModule::LaunchFreetextWithDestination(NodeNum newDest, uint8_t newChannel) { + // Use the requested destination, unless it's "broadcast" and we have a previous node/channel + if (newDest == NODENUM_BROADCAST && lastDestSet) { + newDest = lastDest; + newChannel = lastChannel; + } dest = newDest; channel = newChannel; + lastDest = dest; + lastChannel = channel; + lastDestSet = true; + runState = CANNED_MESSAGE_RUN_STATE_FREETEXT; requestFocus(); UIFrameEvent e; @@ -479,6 +510,9 @@ int CannedMessageModule::handleDestinationSelectionInput(const InputEvent *event if (destIndex < static_cast(activeChannelIndices.size())) { dest = NODENUM_BROADCAST; channel = activeChannelIndices[destIndex]; + lastDest = dest; + lastChannel = channel; + lastDestSet = true; } else { int nodeIndex = destIndex - static_cast(activeChannelIndices.size()); if (nodeIndex >= 0 && nodeIndex < static_cast(filteredNodes.size())) { @@ -486,6 +520,10 @@ int CannedMessageModule::handleDestinationSelectionInput(const InputEvent *event if (selectedNode) { dest = selectedNode->num; channel = selectedNode->channel; + // Already saves here, but for clarity, also: + lastDest = dest; + lastChannel = channel; + lastDestSet = true; } } } @@ -846,6 +884,9 @@ int CannedMessageModule::handleEmotePickerInput(const InputEvent *event) void CannedMessageModule::sendText(NodeNum dest, ChannelIndex channel, const char *message, bool wantReplies) { + lastDest = dest; + lastChannel = channel; + lastDestSet = true; // === Prepare packet === meshtastic_MeshPacket *p = allocDataPacket(); p->to = dest; diff --git a/src/modules/CannedMessageModule.h b/src/modules/CannedMessageModule.h index 55a0a1185..5b0481ac7 100644 --- a/src/modules/CannedMessageModule.h +++ b/src/modules/CannedMessageModule.h @@ -59,6 +59,7 @@ class CannedMessageModule : public SinglePortModule, public Observable Date: Thu, 31 Jul 2025 20:45:34 -0600 Subject: [PATCH 088/180] feat: event mode - limit smart position updates to at most every 5m (#7505) * feat: event mode - limit smart position updates to at most every 5m * fix: convert 600 to 600000ms for 5min threshold * fix: correct 5min threshold to 300000ms --------- Co-authored-by: Ben Meadors --- src/modules/PositionModule.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/PositionModule.h b/src/modules/PositionModule.h index b9fd527c9..4a2415058 100644 --- a/src/modules/PositionModule.h +++ b/src/modules/PositionModule.h @@ -65,8 +65,15 @@ class PositionModule : public ProtobufModule, private concu bool hasGPS(); uint32_t lastSentReply = 0; // Last time we sent a position reply (used for reply throttling only) +#if USERPREFS_EVENT_MODE + // In event mode we want to prevent excessive position broadcasts + // we set the minimum interval to 5m + const uint32_t minimumTimeThreshold = + max(300000, Default::getConfiguredOrDefaultMs(config.position.broadcast_smart_minimum_interval_secs, 30)); +#else const uint32_t minimumTimeThreshold = Default::getConfiguredOrDefaultMs(config.position.broadcast_smart_minimum_interval_secs, 30); +#endif }; struct SmartPosition { From d1f3c3c9821bd6f6d2a1c1e0a64929d7458a703b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Mon, 4 Aug 2025 17:25:31 +0200 Subject: [PATCH 089/180] 128row display (#7511) * Fix 128 row monochrome display * trunk fmt * fix assignment --- src/main.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 1868d98c7..f022c95d7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -761,8 +761,17 @@ void setup() #if defined(USE_SH1107_128_64) screen_model = meshtastic_Config_DisplayConfig_OledType_OLED_SH1107; // keep dimension of 128x64 + screen_geometry = GEOMETRY_128_64; #endif + // if we have one of the fixed overrides in the settings, adjust display type accordingly. + if (screen_model == meshtastic_Config_DisplayConfig_OledType_OLED_SH1107) { + screen_geometry = GEOMETRY_128_128; + } else if (screen_model == meshtastic_Config_DisplayConfig_OledType_OLED_SH1107_128_64) { + screen_model = meshtastic_Config_DisplayConfig_OledType_OLED_SH1107; + screen_geometry = GEOMETRY_128_64; + } + #if !MESHTASTIC_EXCLUDE_I2C #if !defined(ARCH_STM32WL) if (acc_info.type != ScanI2C::DeviceType::NONE) { @@ -808,7 +817,7 @@ void setup() #elif !defined(ARCH_ESP32) // ARCH_RP2040 SPI.begin(); #else - // ESP32 + // ESP32 #if defined(HW_SPI1_DEVICE) SPI1.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS); LOG_DEBUG("SPI1.begin(SCK=%d, MISO=%d, MOSI=%d, NSS=%d)", LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS); From 0130899b3b76b48cfc0d396dcddc9bfc463c692f Mon Sep 17 00:00:00 2001 From: tg-mw <81423559+tg-mw@users.noreply.github.com> Date: Mon, 4 Aug 2025 18:42:39 +0200 Subject: [PATCH 090/180] Fix Melopero RV3028 RTC Settings (#7524) --- src/detect/ScanI2CTwoWire.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index 652d50d51..8b3670cd9 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -184,8 +184,13 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) type = RTC_RV3028; logFoundDevice("RV3028", (uint8_t)addr.address); rtc.initI2C(*i2cBus); - rtc.writeToRegister(0x35, 0x07); // no Clkout - rtc.writeToRegister(0x37, 0xB4); + // Update RTC EEPROM settings, if necessary + if (rtc.readEEPROMRegister(0x35) != 0x07) { + rtc.writeEEPROMRegister(0x35, 0x07); // no Clkout + } + if (rtc.readEEPROMRegister(0x37) != 0xB4) { + rtc.writeEEPROMRegister(0x37, 0xB4); + } break; #endif From 079286da048c295e3d46eb12eeaf31af80fb6fef Mon Sep 17 00:00:00 2001 From: Jason P Date: Mon, 4 Aug 2025 12:33:45 -0500 Subject: [PATCH 091/180] Only toggle screen wake, don't break banners (#7545) * Only toggle screen wake, don't break banners * Fix code - only needed a small line change --- src/graphics/Screen.cpp | 65 ++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index f22a0d8a8..33dc7efcc 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -1264,40 +1264,39 @@ int Screen::handleTextMessage(const meshtastic_MeshPacket *packet) if (shouldWakeOnReceivedMessage()) { setOn(true); // Wake up the screen first forceDisplay(); // Forces screen redraw - - // === Prepare banner content === - const meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(packet->from); - const char *longName = (node && node->has_user) ? node->user.long_name : nullptr; - - const char *msgRaw = reinterpret_cast(packet->decoded.payload.bytes); - - char banner[256]; - - // Check for bell character in message to determine alert type - bool isAlert = false; - for (size_t i = 0; i < packet->decoded.payload.size && i < 100; i++) { - if (msgRaw[i] == '\x07') { - isAlert = true; - break; - } - } - - if (isAlert) { - if (longName && longName[0]) { - snprintf(banner, sizeof(banner), "Alert Received from\n%s", longName); - } else { - strcpy(banner, "Alert Received"); - } - } else { - if (longName && longName[0]) { - snprintf(banner, sizeof(banner), "New Message from\n%s", longName); - } else { - strcpy(banner, "New Message"); - } - } - - screen->showSimpleBanner(banner, 3000); } + // === Prepare banner content === + const meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(packet->from); + const char *longName = (node && node->has_user) ? node->user.long_name : nullptr; + + const char *msgRaw = reinterpret_cast(packet->decoded.payload.bytes); + + char banner[256]; + + // Check for bell character in message to determine alert type + bool isAlert = false; + for (size_t i = 0; i < packet->decoded.payload.size && i < 100; i++) { + if (msgRaw[i] == '\x07') { + isAlert = true; + break; + } + } + + if (isAlert) { + if (longName && longName[0]) { + snprintf(banner, sizeof(banner), "Alert Received from\n%s", longName); + } else { + strcpy(banner, "Alert Received"); + } + } else { + if (longName && longName[0]) { + snprintf(banner, sizeof(banner), "New Message from\n%s", longName); + } else { + strcpy(banner, "New Message"); + } + } + + screen->showSimpleBanner(banner, 3000); } } From eb30aae486fe231e5da3e8bfe2a8a592c9629b9d Mon Sep 17 00:00:00 2001 From: Jason P Date: Mon, 4 Aug 2025 16:32:27 -0500 Subject: [PATCH 092/180] Create better log message for users (#7548) --- src/graphics/draw/MessageRenderer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graphics/draw/MessageRenderer.cpp b/src/graphics/draw/MessageRenderer.cpp index 3df8a003c..524f88f9b 100644 --- a/src/graphics/draw/MessageRenderer.cpp +++ b/src/graphics/draw/MessageRenderer.cpp @@ -273,7 +273,7 @@ void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 currentKey ^= ((size_t)mp.id << 24); if (cachedKey != currentKey) { - LOG_INFO("Message cache key is misssed cachedKey=0x%0x, currentKey=0x%x", cachedKey, currentKey); + LOG_INFO("Onscreen message scroll cache key needs updating: cachedKey=0x%0x, currentKey=0x%x", cachedKey, currentKey); // Cache miss - regenerate lines and heights cachedLines = generateLines(display, headerStr, messageBuf, textWidth); From 384436e937455dcefdd8b59a6ed91c101c658fa8 Mon Sep 17 00:00:00 2001 From: mrab Date: Tue, 5 Aug 2025 13:34:52 +0200 Subject: [PATCH 093/180] fix: ina226 was not calibrated during init (#7547) Co-authored-by: Ben Meadors --- src/modules/Telemetry/Sensor/INA226Sensor.cpp | 28 ++++++++++++++++++- src/modules/Telemetry/Sensor/INA226Sensor.h | 3 ++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/modules/Telemetry/Sensor/INA226Sensor.cpp b/src/modules/Telemetry/Sensor/INA226Sensor.cpp index 4b313ba81..6fa35598f 100644 --- a/src/modules/Telemetry/Sensor/INA226Sensor.cpp +++ b/src/modules/Telemetry/Sensor/INA226Sensor.cpp @@ -32,16 +32,42 @@ void INA226Sensor::begin(TwoWire *wire, uint8_t addr) _addr = addr; ina226 = INA226(_addr, _wire); _wire->begin(); + ina226.setMaxCurrentShunt(0.8, 0.100); } bool INA226Sensor::getMetrics(meshtastic_Telemetry *measurement) +{ + switch (measurement->which_variant) { + case meshtastic_Telemetry_environment_metrics_tag: + return getEnvironmentMetrics(measurement); + + case meshtastic_Telemetry_power_metrics_tag: + return getPowerMetrics(measurement); + } + + // unsupported metric + return false; +} + +bool INA226Sensor::getEnvironmentMetrics(meshtastic_Telemetry *measurement) { measurement->variant.environment_metrics.has_voltage = true; measurement->variant.environment_metrics.has_current = true; - // mV conversion to V measurement->variant.environment_metrics.voltage = ina226.getBusVoltage(); measurement->variant.environment_metrics.current = ina226.getCurrent_mA(); + + return true; +} + +bool INA226Sensor::getPowerMetrics(meshtastic_Telemetry *measurement) +{ + measurement->variant.power_metrics.has_ch1_voltage = true; + measurement->variant.power_metrics.has_ch1_current = true; + + measurement->variant.power_metrics.ch1_voltage = ina226.getBusVoltage(); + measurement->variant.power_metrics.ch1_current = ina226.getCurrent_mA(); + return true; } diff --git a/src/modules/Telemetry/Sensor/INA226Sensor.h b/src/modules/Telemetry/Sensor/INA226Sensor.h index 2f71c5b86..51435550e 100644 --- a/src/modules/Telemetry/Sensor/INA226Sensor.h +++ b/src/modules/Telemetry/Sensor/INA226Sensor.h @@ -15,6 +15,9 @@ class INA226Sensor : public TelemetrySensor, VoltageSensor, CurrentSensor TwoWire *_wire = &Wire; INA226 ina226 = INA226(_addr, _wire); + bool getEnvironmentMetrics(meshtastic_Telemetry *measurement); + bool getPowerMetrics(meshtastic_Telemetry *measurement); + protected: virtual void setup() override; void begin(TwoWire *wire = &Wire, uint8_t addr = INA_ADDR); From 27c6b24e3a63270999b9d7ddb957fce4e1e76cba Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Tue, 5 Aug 2025 19:53:25 -0500 Subject: [PATCH 094/180] Rather than mysteriously rebooting, regenerate the keys and infrom the user. (#7558) --- src/main.cpp | 16 +++-- src/mesh/NodeDB.cpp | 41 ++----------- src/mesh/NodeDB.h | 113 ++++++++++++++++-------------------- src/mesh/Router.cpp | 14 ----- src/modules/AdminModule.cpp | 5 +- 5 files changed, 70 insertions(+), 119 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index f022c95d7..605fbe50a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -911,14 +911,20 @@ void setup() service = new MeshService(); service->init(); - if (nodeDB->keyIsLowEntropy) { - service->reloadConfig(SEGMENT_CONFIG); - rebootAtMsec = (millis() + DEFAULT_REBOOT_SECONDS * 1000); - } - // Now that the mesh service is created, create any modules setupModules(); + // warn the user about a low entropy key + if (nodeDB->keyIsLowEntropy && !nodeDB->hasWarned) { + LOG_WARN(LOW_ENTROPY_WARNING); + meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); + cn->level = meshtastic_LogRecord_Level_WARNING; + cn->time = getValidTime(RTCQualityFromNet); + sprintf(cn->message, LOW_ENTROPY_WARNING); + service->sendClientNotification(cn); + nodeDB->hasWarned = true; + } + // buttons are now inputBroker, so have to come after setupModules #if HAS_BUTTON int pullup_sense = 0; diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 881dc6ab7..b54cdae86 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -264,12 +264,12 @@ NodeDB::NodeDB() if (!owner.is_licensed && config.lora.region != meshtastic_Config_LoRaConfig_RegionCode_UNSET) { bool keygenSuccess = false; - if (config.security.private_key.size == 32) { + keyIsLowEntropy = checkLowEntropyPublicKey(config.security.public_key); + if (config.security.private_key.size == 32 && !keyIsLowEntropy) { if (crypto->regeneratePublicKey(config.security.public_key.bytes, config.security.private_key.bytes)) { keygenSuccess = true; } } else { - LOG_INFO("Generate new PKI keys"); crypto->generateKeyPair(config.security.public_key.bytes, config.security.private_key.bytes); keygenSuccess = true; } @@ -288,16 +288,6 @@ NodeDB::NodeDB() crypto->setDHPrivateKey(config.security.private_key.bytes); } #endif - keyIsLowEntropy = checkLowEntropyPublicKey(config.security.public_key); - if (keyIsLowEntropy) { - LOG_WARN("Erasing low entropy keys"); - config.security.private_key.size = 0; - memfll(config.security.private_key.bytes, '\0', sizeof(config.security.private_key.bytes)); - config.security.public_key.size = 0; - memfll(config.security.public_key.bytes, '\0', sizeof(config.security.public_key.bytes)); - owner.public_key.size = 0; - memfll(owner.public_key.bytes, '\0', sizeof(owner.public_key.bytes)); - } // Include our owner in the node db under our nodenum meshtastic_NodeInfoLite *info = getOrCreateMeshNode(getNodeNum()); info->user = TypeConversions::ConvertToUserLite(owner); @@ -1647,7 +1637,6 @@ bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelInde "to regenerate your public keys."; LOG_WARN(warning, p.long_name); meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); - cn->which_payload_variant = meshtastic_ClientNotification_duplicated_public_key_tag; cn->level = meshtastic_LogRecord_Level_WARNING; cn->time = getValidTime(RTCQualityFromNet); sprintf(cn->message, warning, p.long_name); @@ -1878,28 +1867,10 @@ bool NodeDB::checkLowEntropyPublicKey(const meshtastic_Config_SecurityConfig_pub uint8_t keyHash[32] = {0}; memcpy(keyHash, keyToTest.bytes, keyToTest.size); crypto->hash(keyHash, 32); - if (memcmp(keyHash, LOW_ENTROPY_HASH1, sizeof(LOW_ENTROPY_HASH1)) == - 0 || // should become an array that gets looped through rather than this abomination - memcmp(keyHash, LOW_ENTROPY_HASH2, sizeof(LOW_ENTROPY_HASH2)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH3, sizeof(LOW_ENTROPY_HASH3)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH4, sizeof(LOW_ENTROPY_HASH4)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH5, sizeof(LOW_ENTROPY_HASH5)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH6, sizeof(LOW_ENTROPY_HASH6)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH7, sizeof(LOW_ENTROPY_HASH7)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH8, sizeof(LOW_ENTROPY_HASH8)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH9, sizeof(LOW_ENTROPY_HASH9)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH10, sizeof(LOW_ENTROPY_HASH10)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH11, sizeof(LOW_ENTROPY_HASH11)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH12, sizeof(LOW_ENTROPY_HASH12)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH13, sizeof(LOW_ENTROPY_HASH13)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH14, sizeof(LOW_ENTROPY_HASH14)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH15, sizeof(LOW_ENTROPY_HASH15)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH16, sizeof(LOW_ENTROPY_HASH16)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH17, sizeof(LOW_ENTROPY_HASH17)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH18, sizeof(LOW_ENTROPY_HASH18)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH19, sizeof(LOW_ENTROPY_HASH19)) == 0 || - memcmp(keyHash, LOW_ENTROPY_HASH20, sizeof(LOW_ENTROPY_HASH20)) == 0) { - return true; + for (int i = 0; i < sizeof(LOW_ENTROPY_HASHES) / sizeof(LOW_ENTROPY_HASHES[0]); i++) { + if (memcmp(keyHash, LOW_ENTROPY_HASHES[i], sizeof(LOW_ENTROPY_HASHES[0])) == 0) { + return true; + } } } return false; diff --git a/src/mesh/NodeDB.h b/src/mesh/NodeDB.h index 19fb67b73..167dc1337 100644 --- a/src/mesh/NodeDB.h +++ b/src/mesh/NodeDB.h @@ -18,68 +18,57 @@ #endif #if !defined(MESHTASTIC_EXCLUDE_PKI) - -static const uint8_t LOW_ENTROPY_HASH1[] = {0xf4, 0x7e, 0xcc, 0x17, 0xe6, 0xb4, 0xa3, 0x22, 0xec, 0xee, 0xd9, - 0x08, 0x4f, 0x39, 0x63, 0xea, 0x80, 0x75, 0xe1, 0x24, 0xce, 0x05, - 0x36, 0x69, 0x63, 0xb2, 0xcb, 0xc0, 0x28, 0xd3, 0x34, 0x8b}; -static const uint8_t LOW_ENTROPY_HASH2[] = {0x5a, 0x9e, 0xa2, 0xa6, 0x8a, 0xa6, 0x66, 0xc1, 0x5f, 0x55, 0x00, - 0x64, 0xa3, 0xa6, 0xfe, 0x71, 0xc0, 0xbb, 0x82, 0xc3, 0x32, 0x3d, - 0x7a, 0x7a, 0xe3, 0x6e, 0xfd, 0xdd, 0xad, 0x3a, 0x66, 0xb9}; -static const uint8_t LOW_ENTROPY_HASH3[] = {0xb3, 0xdf, 0x3b, 0x2e, 0x67, 0xb6, 0xd5, 0xf8, 0xdf, 0x76, 0x2c, - 0x45, 0x5e, 0x2e, 0xbd, 0x16, 0xc5, 0xf8, 0x67, 0xaa, 0x15, 0xf8, - 0x92, 0x0b, 0xdf, 0x5a, 0x66, 0x50, 0xac, 0x0d, 0xbb, 0x2f}; -static const uint8_t LOW_ENTROPY_HASH4[] = {0x3b, 0x8f, 0x86, 0x3a, 0x38, 0x1f, 0x77, 0x39, 0xa9, 0x4e, 0xef, - 0x91, 0x18, 0x5a, 0x62, 0xe1, 0xaa, 0x9d, 0x36, 0xea, 0xce, 0x60, - 0x35, 0x8d, 0x9d, 0x1f, 0xf4, 0xb8, 0xc9, 0x13, 0x6a, 0x5d}; -static const uint8_t LOW_ENTROPY_HASH5[] = {0x36, 0x7e, 0x2d, 0xe1, 0x84, 0x5f, 0x42, 0x52, 0x29, 0x11, 0x0a, - 0x25, 0x64, 0x54, 0x6a, 0x6b, 0xfd, 0xb6, 0x65, 0xff, 0x15, 0x1a, - 0x51, 0x71, 0x22, 0x40, 0x57, 0xf6, 0x91, 0x9b, 0x64, 0x58}; -static const uint8_t LOW_ENTROPY_HASH6[] = {0x16, 0x77, 0xeb, 0xa4, 0x52, 0x91, 0xfb, 0x26, 0xcf, 0x8f, 0xd7, - 0xd9, 0xd1, 0x5d, 0xc4, 0x68, 0x73, 0x75, 0xed, 0xc5, 0x95, 0x58, - 0xee, 0x90, 0x56, 0xd4, 0x2f, 0x31, 0x29, 0xf7, 0x8c, 0x1f}; -static const uint8_t LOW_ENTROPY_HASH7[] = {0x31, 0x8c, 0xa9, 0x5e, 0xed, 0x3c, 0x12, 0xbf, 0x97, 0x9c, 0x47, - 0x8e, 0x98, 0x9d, 0xc2, 0x3e, 0x86, 0x23, 0x90, 0x29, 0xc8, 0xb0, - 0x20, 0xf8, 0xb1, 0xb0, 0xaa, 0x19, 0x2a, 0xcf, 0x0a, 0x54}; -static const uint8_t LOW_ENTROPY_HASH8[] = {0xa4, 0x8a, 0x99, 0x0e, 0x51, 0xdc, 0x12, 0x20, 0xf3, 0x13, 0xf5, - 0x2b, 0x3a, 0xe2, 0x43, 0x42, 0xc6, 0x52, 0x98, 0xcd, 0xbb, 0xca, - 0xb1, 0x31, 0xa0, 0xd4, 0xd6, 0x30, 0xf3, 0x27, 0xfb, 0x49}; -static const uint8_t LOW_ENTROPY_HASH9[] = {0xd2, 0x3f, 0x13, 0x8d, 0x22, 0x04, 0x8d, 0x07, 0x59, 0x58, 0xa0, - 0xf9, 0x55, 0xcf, 0x30, 0xa0, 0x2e, 0x2f, 0xca, 0x80, 0x20, 0xe4, - 0xde, 0xa1, 0xad, 0xd9, 0x58, 0xb3, 0x43, 0x2b, 0x22, 0x70}; -static const uint8_t LOW_ENTROPY_HASH10[] = {0x40, 0x41, 0xec, 0x6a, 0xd2, 0xd6, 0x03, 0xe4, 0x9a, 0x9e, 0xbd, - 0x6c, 0x0a, 0x9b, 0x75, 0xa4, 0xbc, 0xab, 0x6f, 0xa7, 0x95, 0xff, - 0x2d, 0xf6, 0xe9, 0xb9, 0xab, 0x4c, 0x0c, 0x1c, 0xd0, 0x3b}; -static const uint8_t LOW_ENTROPY_HASH11[] = {0x22, 0x49, 0x32, 0x2b, 0x00, 0xf9, 0x22, 0xfa, 0x17, 0x02, 0xe9, - 0x64, 0x82, 0xf0, 0x4d, 0x1b, 0xc7, 0x04, 0xfc, 0xdc, 0x8c, 0x5e, - 0xb6, 0xd9, 0x16, 0xd6, 0x37, 0xce, 0x59, 0xaa, 0x09, 0x49}; -static const uint8_t LOW_ENTROPY_HASH12[] = {0x48, 0x6f, 0x1e, 0x48, 0x97, 0x88, 0x64, 0xac, 0xe8, 0xeb, 0x30, - 0xa3, 0xc3, 0xe1, 0xcf, 0x97, 0x39, 0xa6, 0x55, 0x5b, 0x5f, 0xbf, - 0x18, 0xb7, 0x3a, 0xdf, 0xa8, 0x75, 0xe7, 0x9d, 0xe0, 0x1e}; -static const uint8_t LOW_ENTROPY_HASH13[] = {0x09, 0xb4, 0xe2, 0x6d, 0x28, 0x98, 0xc9, 0x47, 0x66, 0x46, 0xbf, - 0xff, 0x58, 0x17, 0x91, 0xaa, 0xc3, 0xbf, 0x4a, 0x9d, 0x0b, 0x88, - 0xb1, 0xf1, 0x03, 0xdd, 0x61, 0xd7, 0xba, 0x9e, 0x64, 0x98}; -static const uint8_t LOW_ENTROPY_HASH14[] = {0x39, 0x39, 0x84, 0xe0, 0x22, 0x2f, 0x7d, 0x78, 0x45, 0x18, 0x72, - 0xb4, 0x13, 0xd2, 0x01, 0x2f, 0x3c, 0xa1, 0xb0, 0xfe, 0x39, 0xd0, - 0xf1, 0x3c, 0x72, 0xd6, 0xef, 0x54, 0xd5, 0x77, 0x22, 0xa0}; -static const uint8_t LOW_ENTROPY_HASH15[] = {0x0a, 0xda, 0x5f, 0xec, 0xff, 0x5c, 0xc0, 0x2e, 0x5f, 0xc4, 0x8d, - 0x03, 0xe5, 0x80, 0x59, 0xd3, 0x5d, 0x49, 0x86, 0xe9, 0x8d, 0xf6, - 0xf6, 0x16, 0x35, 0x3d, 0xf9, 0x9b, 0x29, 0x55, 0x9e, 0x64}; -static const uint8_t LOW_ENTROPY_HASH16[] = {0x08, 0x56, 0xF0, 0xD7, 0xEF, 0x77, 0xD6, 0x11, 0x1C, 0x8F, 0x95, - 0x2D, 0x3C, 0xDF, 0xB1, 0x22, 0xBF, 0x60, 0x9B, 0xE5, 0xA9, 0xC0, - 0x6E, 0x4B, 0x01, 0xDC, 0xD1, 0x57, 0x44, 0xB2, 0xA5, 0xCF}; -static const uint8_t LOW_ENTROPY_HASH17[] = {0x2C, 0xB2, 0x77, 0x85, 0xD6, 0xB7, 0x48, 0x9C, 0xFE, 0xBC, 0x80, - 0x26, 0x60, 0xF4, 0x6D, 0xCE, 0x11, 0x31, 0xA2, 0x1E, 0x33, 0x0A, - 0x6D, 0x2B, 0x00, 0xFA, 0x0C, 0x90, 0x95, 0x8F, 0x5C, 0x6B}; -static const uint8_t LOW_ENTROPY_HASH18[] = {0xFA, 0x59, 0xC8, 0x6E, 0x94, 0xEE, 0x75, 0xC9, 0x9A, 0xB0, 0xFE, - 0x89, 0x36, 0x40, 0xC9, 0x99, 0x4A, 0x3B, 0xF4, 0xAA, 0x12, 0x24, - 0xA2, 0x0F, 0xF9, 0xD1, 0x08, 0xCB, 0x78, 0x19, 0xAA, 0xE5}; -static const uint8_t LOW_ENTROPY_HASH19[] = {0x6E, 0x42, 0x7A, 0x4A, 0x8C, 0x61, 0x62, 0x22, 0xA1, 0x89, 0xD3, - 0xA4, 0xC2, 0x19, 0xA3, 0x83, 0x53, 0xA7, 0x7A, 0x0A, 0x89, 0xE2, - 0x54, 0x52, 0x62, 0x3D, 0xE7, 0xCA, 0x8C, 0xF6, 0x6A, 0x60}; -static const uint8_t LOW_ENTROPY_HASH20[] = {0x20, 0x27, 0x2F, 0xBA, 0x0C, 0x99, 0xD7, 0x29, 0xF3, 0x11, 0x35, - 0x89, 0x9D, 0x0E, 0x24, 0xA1, 0xC3, 0xCB, 0xDF, 0x8A, 0xF1, 0xC6, - 0xFE, 0xD0, 0xD7, 0x9F, 0x92, 0xD6, 0x8F, 0x59, 0xBF, 0xE4}; -static const char LOW_ENTROPY_WARNING[] = "Compromised keys detected, please regenerate."; +// E3B0C442 is the blank hash +static const uint8_t LOW_ENTROPY_HASHES[][32] = { + {0xf4, 0x7e, 0xcc, 0x17, 0xe6, 0xb4, 0xa3, 0x22, 0xec, 0xee, 0xd9, 0x08, 0x4f, 0x39, 0x63, 0xea, + 0x80, 0x75, 0xe1, 0x24, 0xce, 0x05, 0x36, 0x69, 0x63, 0xb2, 0xcb, 0xc0, 0x28, 0xd3, 0x34, 0x8b}, + {0x5a, 0x9e, 0xa2, 0xa6, 0x8a, 0xa6, 0x66, 0xc1, 0x5f, 0x55, 0x00, 0x64, 0xa3, 0xa6, 0xfe, 0x71, + 0xc0, 0xbb, 0x82, 0xc3, 0x32, 0x3d, 0x7a, 0x7a, 0xe3, 0x6e, 0xfd, 0xdd, 0xad, 0x3a, 0x66, 0xb9}, + {0xb3, 0xdf, 0x3b, 0x2e, 0x67, 0xb6, 0xd5, 0xf8, 0xdf, 0x76, 0x2c, 0x45, 0x5e, 0x2e, 0xbd, 0x16, + 0xc5, 0xf8, 0x67, 0xaa, 0x15, 0xf8, 0x92, 0x0b, 0xdf, 0x5a, 0x66, 0x50, 0xac, 0x0d, 0xbb, 0x2f}, + {0x3b, 0x8f, 0x86, 0x3a, 0x38, 0x1f, 0x77, 0x39, 0xa9, 0x4e, 0xef, 0x91, 0x18, 0x5a, 0x62, 0xe1, + 0xaa, 0x9d, 0x36, 0xea, 0xce, 0x60, 0x35, 0x8d, 0x9d, 0x1f, 0xf4, 0xb8, 0xc9, 0x13, 0x6a, 0x5d}, + {0x36, 0x7e, 0x2d, 0xe1, 0x84, 0x5f, 0x42, 0x52, 0x29, 0x11, 0x0a, 0x25, 0x64, 0x54, 0x6a, 0x6b, + 0xfd, 0xb6, 0x65, 0xff, 0x15, 0x1a, 0x51, 0x71, 0x22, 0x40, 0x57, 0xf6, 0x91, 0x9b, 0x64, 0x58}, + {0x16, 0x77, 0xeb, 0xa4, 0x52, 0x91, 0xfb, 0x26, 0xcf, 0x8f, 0xd7, 0xd9, 0xd1, 0x5d, 0xc4, 0x68, + 0x73, 0x75, 0xed, 0xc5, 0x95, 0x58, 0xee, 0x90, 0x56, 0xd4, 0x2f, 0x31, 0x29, 0xf7, 0x8c, 0x1f}, + {0x31, 0x8c, 0xa9, 0x5e, 0xed, 0x3c, 0x12, 0xbf, 0x97, 0x9c, 0x47, 0x8e, 0x98, 0x9d, 0xc2, 0x3e, + 0x86, 0x23, 0x90, 0x29, 0xc8, 0xb0, 0x20, 0xf8, 0xb1, 0xb0, 0xaa, 0x19, 0x2a, 0xcf, 0x0a, 0x54}, + {0xa4, 0x8a, 0x99, 0x0e, 0x51, 0xdc, 0x12, 0x20, 0xf3, 0x13, 0xf5, 0x2b, 0x3a, 0xe2, 0x43, 0x42, + 0xc6, 0x52, 0x98, 0xcd, 0xbb, 0xca, 0xb1, 0x31, 0xa0, 0xd4, 0xd6, 0x30, 0xf3, 0x27, 0xfb, 0x49}, + {0xd2, 0x3f, 0x13, 0x8d, 0x22, 0x04, 0x8d, 0x07, 0x59, 0x58, 0xa0, 0xf9, 0x55, 0xcf, 0x30, 0xa0, + 0x2e, 0x2f, 0xca, 0x80, 0x20, 0xe4, 0xde, 0xa1, 0xad, 0xd9, 0x58, 0xb3, 0x43, 0x2b, 0x22, 0x70}, + {0x40, 0x41, 0xec, 0x6a, 0xd2, 0xd6, 0x03, 0xe4, 0x9a, 0x9e, 0xbd, 0x6c, 0x0a, 0x9b, 0x75, 0xa4, + 0xbc, 0xab, 0x6f, 0xa7, 0x95, 0xff, 0x2d, 0xf6, 0xe9, 0xb9, 0xab, 0x4c, 0x0c, 0x1c, 0xd0, 0x3b}, + {0x22, 0x49, 0x32, 0x2b, 0x00, 0xf9, 0x22, 0xfa, 0x17, 0x02, 0xe9, 0x64, 0x82, 0xf0, 0x4d, 0x1b, + 0xc7, 0x04, 0xfc, 0xdc, 0x8c, 0x5e, 0xb6, 0xd9, 0x16, 0xd6, 0x37, 0xce, 0x59, 0xaa, 0x09, 0x49}, + {0x48, 0x6f, 0x1e, 0x48, 0x97, 0x88, 0x64, 0xac, 0xe8, 0xeb, 0x30, 0xa3, 0xc3, 0xe1, 0xcf, 0x97, + 0x39, 0xa6, 0x55, 0x5b, 0x5f, 0xbf, 0x18, 0xb7, 0x3a, 0xdf, 0xa8, 0x75, 0xe7, 0x9d, 0xe0, 0x1e}, + {0x09, 0xb4, 0xe2, 0x6d, 0x28, 0x98, 0xc9, 0x47, 0x66, 0x46, 0xbf, 0xff, 0x58, 0x17, 0x91, 0xaa, + 0xc3, 0xbf, 0x4a, 0x9d, 0x0b, 0x88, 0xb1, 0xf1, 0x03, 0xdd, 0x61, 0xd7, 0xba, 0x9e, 0x64, 0x98}, + {0x39, 0x39, 0x84, 0xe0, 0x22, 0x2f, 0x7d, 0x78, 0x45, 0x18, 0x72, 0xb4, 0x13, 0xd2, 0x01, 0x2f, + 0x3c, 0xa1, 0xb0, 0xfe, 0x39, 0xd0, 0xf1, 0x3c, 0x72, 0xd6, 0xef, 0x54, 0xd5, 0x77, 0x22, 0xa0}, + {0x0a, 0xda, 0x5f, 0xec, 0xff, 0x5c, 0xc0, 0x2e, 0x5f, 0xc4, 0x8d, 0x03, 0xe5, 0x80, 0x59, 0xd3, + 0x5d, 0x49, 0x86, 0xe9, 0x8d, 0xf6, 0xf6, 0x16, 0x35, 0x3d, 0xf9, 0x9b, 0x29, 0x55, 0x9e, 0x64}, + {0x08, 0x56, 0xF0, 0xD7, 0xEF, 0x77, 0xD6, 0x11, 0x1C, 0x8F, 0x95, 0x2D, 0x3C, 0xDF, 0xB1, 0x22, + 0xBF, 0x60, 0x9B, 0xE5, 0xA9, 0xC0, 0x6E, 0x4B, 0x01, 0xDC, 0xD1, 0x57, 0x44, 0xB2, 0xA5, 0xCF}, + {0x2C, 0xB2, 0x77, 0x85, 0xD6, 0xB7, 0x48, 0x9C, 0xFE, 0xBC, 0x80, 0x26, 0x60, 0xF4, 0x6D, 0xCE, + 0x11, 0x31, 0xA2, 0x1E, 0x33, 0x0A, 0x6D, 0x2B, 0x00, 0xFA, 0x0C, 0x90, 0x95, 0x8F, 0x5C, 0x6B}, + {0xFA, 0x59, 0xC8, 0x6E, 0x94, 0xEE, 0x75, 0xC9, 0x9A, 0xB0, 0xFE, 0x89, 0x36, 0x40, 0xC9, 0x99, + 0x4A, 0x3B, 0xF4, 0xAA, 0x12, 0x24, 0xA2, 0x0F, 0xF9, 0xD1, 0x08, 0xCB, 0x78, 0x19, 0xAA, 0xE5}, + {0x6E, 0x42, 0x7A, 0x4A, 0x8C, 0x61, 0x62, 0x22, 0xA1, 0x89, 0xD3, 0xA4, 0xC2, 0x19, 0xA3, 0x83, + 0x53, 0xA7, 0x7A, 0x0A, 0x89, 0xE2, 0x54, 0x52, 0x62, 0x3D, 0xE7, 0xCA, 0x8C, 0xF6, 0x6A, 0x60}, + {0x20, 0x27, 0x2F, 0xBA, 0x0C, 0x99, 0xD7, 0x29, 0xF3, 0x11, 0x35, 0x89, 0x9D, 0x0E, 0x24, 0xA1, + 0xC3, 0xCB, 0xDF, 0x8A, 0xF1, 0xC6, 0xFE, 0xD0, 0xD7, 0x9F, 0x92, 0xD6, 0x8F, 0x59, 0xBF, 0xE4}, + {0x91, 0x70, 0xb4, 0x7c, 0xfb, 0xff, 0xa0, 0x59, 0x6a, 0x25, 0x1c, 0xa9, 0x9e, 0xe9, 0x43, 0x81, + 0x5d, 0x74, 0xb1, 0xb1, 0x09, 0x28, 0x00, 0x4a, 0xaf, 0xe3, 0xfc, 0xa9, 0x4e, 0x27, 0x76, 0x4c}, + {0x85, 0xfe, 0x7c, 0xec, 0xb6, 0x78, 0x74, 0xc3, 0xec, 0xe1, 0x32, 0x7f, 0xb0, 0xb7, 0x02, 0x74, + 0xf9, 0x23, 0xd8, 0xe7, 0xfa, 0x14, 0xe6, 0xee, 0x66, 0x44, 0xb1, 0x8c, 0xa5, 0x2f, 0x7e, 0xd2}, + {0x8e, 0x66, 0x65, 0x7b, 0x3b, 0x6f, 0x7e, 0xcc, 0x57, 0xb4, 0x57, 0xea, 0xcc, 0x83, 0xf5, 0xaa, + 0xf7, 0x65, 0xa3, 0xce, 0x93, 0x72, 0x13, 0xc1, 0xb6, 0x46, 0x7b, 0x29, 0x45, 0xb5, 0xc8, 0x93}, + {0xcc, 0x11, 0xfb, 0x1a, 0xab, 0xa1, 0x31, 0x87, 0x6a, 0xc6, 0xde, 0x88, 0x87, 0xa9, 0xb9, 0x59, + 0x37, 0x82, 0x8d, 0xb2, 0xcc, 0xd8, 0x97, 0x40, 0x9a, 0x5c, 0x8f, 0x40, 0x55, 0xcb, 0x4c, 0x3e}}; +static const char LOW_ENTROPY_WARNING[] = "Compromised keys were detected and regenerated."; #endif /* DeviceState versions used to be defined in the .proto file but really only this function cares. So changed to a diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index a7508423a..48205cc0f 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -549,20 +549,6 @@ meshtastic_Routing_Error perhapsEncode(meshtastic_MeshPacket *p) numbytes += MESHTASTIC_PKC_OVERHEAD; p->channel = 0; p->pki_encrypted = true; - - // warn the user about a low entropy key - if (nodeDB->keyIsLowEntropy) { - LOG_WARN(LOW_ENTROPY_WARNING); - if (!nodeDB->hasWarned) { - meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); - cn->which_payload_variant = meshtastic_ClientNotification_low_entropy_key_tag; - cn->level = meshtastic_LogRecord_Level_WARNING; - cn->time = getValidTime(RTCQualityFromNet); - sprintf(cn->message, LOW_ENTROPY_WARNING); - service->sendClientNotification(cn); - nodeDB->hasWarned = true; - } - } } else { if (p->pki_encrypted == true) { // Client specifically requested PKI encryption diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 1a9c3a7a7..4014e1c36 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -727,7 +727,7 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c) } #endif config.lora = c.payload_variant.lora; - // If we're setting region for the first time, init the region + // If we're setting region for the first time, init the region and regenerate the keys if (isRegionUnset && config.lora.region > meshtastic_Config_LoRaConfig_RegionCode_UNSET) { if (!owner.is_licensed) { bool keygenSuccess = false; @@ -772,8 +772,7 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c) if (config.security.private_key.size != 32) { crypto->generateKeyPair(config.security.public_key.bytes, config.security.private_key.bytes); - } else if (config.security.public_key.size != 32) { - // We check for a potentially valid private key, and a blank public key, and regen the public key if needed. + } else { if (crypto->regeneratePublicKey(config.security.public_key.bytes, config.security.private_key.bytes)) { config.security.public_key.size = 32; } From a23c58c10a7a71994be8f5c07aa8ab752d869403 Mon Sep 17 00:00:00 2001 From: oscgonfer Date: Wed, 6 Aug 2025 13:38:36 +0200 Subject: [PATCH 095/180] Avoid acquiring lock twice (#7555) Co-authored-by: Ben Meadors --- src/modules/Telemetry/Sensor/NAU7802Sensor.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/modules/Telemetry/Sensor/NAU7802Sensor.cpp b/src/modules/Telemetry/Sensor/NAU7802Sensor.cpp index ef1756b36..b6b5d89f7 100644 --- a/src/modules/Telemetry/Sensor/NAU7802Sensor.cpp +++ b/src/modules/Telemetry/Sensor/NAU7802Sensor.cpp @@ -112,9 +112,8 @@ bool NAU7802Sensor::saveCalibrationData() } else { okay = true; } - spiLock->lock(); + // Note: SafeFile::close() already acquires the lock and releases it internally okay &= file.close(); - spiLock->unlock(); return okay; } From 691327b2db474e2cf30e3dc099f2ee1ddd08cceb Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 7 Aug 2025 06:28:15 -0500 Subject: [PATCH 096/180] Initial support for the ThinkNode M5 (#7502) * Initial support for the ThinkNode M5 * Update variants/esp32s3/ELECROW-ThinkNode-M5/platformio.ini Co-authored-by: Austin * Cleanup variant.h for Elecrow Thinknode M5 * Properly detect battery voltage * Turn backlight off when screen sleeps --------- Co-authored-by: Ben Meadors Co-authored-by: Austin --- src/graphics/EInkDisplay2.cpp | 15 ++++ src/graphics/EInkDisplay2.h | 2 +- src/graphics/Screen.cpp | 9 ++ src/main.cpp | 13 +++ src/main.h | 5 ++ src/modules/SerialModule.cpp | 11 ++- src/platform/esp32/architecture.h | 2 + .../ELECROW-ThinkNode-M5/pins_arduino.h | 28 +++++++ .../ELECROW-ThinkNode-M5/platformio.ini | 21 +++++ .../esp32s3/ELECROW-ThinkNode-M5/variant.h | 83 +++++++++++++++++++ 10 files changed, 184 insertions(+), 5 deletions(-) create mode 100644 variants/esp32s3/ELECROW-ThinkNode-M5/pins_arduino.h create mode 100644 variants/esp32s3/ELECROW-ThinkNode-M5/platformio.ini create mode 100644 variants/esp32s3/ELECROW-ThinkNode-M5/variant.h diff --git a/src/graphics/EInkDisplay2.cpp b/src/graphics/EInkDisplay2.cpp index 3bd20feec..a627a42cc 100644 --- a/src/graphics/EInkDisplay2.cpp +++ b/src/graphics/EInkDisplay2.cpp @@ -151,6 +151,21 @@ bool EInkDisplay::connect() #else adafruitDisplay->setRotation(3); #endif + adafruitDisplay->setPartialWindow(0, 0, displayWidth, displayHeight); + } +#elif defined(ELECROW_ThinkNode_M5) + { + // Start HSPI + hspi = new SPIClass(HSPI); + hspi->begin(PIN_EINK_SCLK, -1, PIN_EINK_MOSI, PIN_EINK_CS); // SCLK, MISO, MOSI, SS + + auto lowLevel = new EINK_DISPLAY_MODEL(PIN_EINK_CS, PIN_EINK_DC, PIN_EINK_RES, PIN_EINK_BUSY, *hspi); + + adafruitDisplay = new GxEPD2_BW(*lowLevel); + adafruitDisplay->init(); + + adafruitDisplay->setRotation(4); + adafruitDisplay->setPartialWindow(0, 0, displayWidth, displayHeight); } #elif defined(MESHLINK) diff --git a/src/graphics/EInkDisplay2.h b/src/graphics/EInkDisplay2.h index 284337627..b840ce9ba 100644 --- a/src/graphics/EInkDisplay2.h +++ b/src/graphics/EInkDisplay2.h @@ -80,7 +80,7 @@ class EInkDisplay : public OLEDDisplay // If display uses HSPI #if defined(HELTEC_WIRELESS_PAPER) || defined(HELTEC_WIRELESS_PAPER_V1_0) || defined(HELTEC_VISION_MASTER_E213) || \ defined(HELTEC_VISION_MASTER_E290) || defined(TLORA_T3S3_EPAPER) || defined(CROWPANEL_ESP32S3_5_EPAPER) || \ - defined(CROWPANEL_ESP32S3_4_EPAPER) || defined(CROWPANEL_ESP32S3_2_EPAPER) + defined(CROWPANEL_ESP32S3_4_EPAPER) || defined(CROWPANEL_ESP32S3_2_EPAPER) || defined(ELECROW_ThinkNode_M5) SPIClass *hspi = NULL; #endif diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 33dc7efcc..8d5635f89 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -391,6 +391,10 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver) dispdev->displayOn(); #endif +#ifdef ELECROW_ThinkNode_M5 + io.digitalWrite(PCA_PIN_EINK_EN, HIGH); +#endif + #if defined(ST7789_CS) && \ !defined(M5STACK) // set display brightness when turning on screens. Just moved function from TFTDisplay to here. static_cast(dispdev)->setDisplayBrightness(brightness); @@ -425,6 +429,11 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver) digitalWrite(PIN_EINK_EN, LOW); } #endif + +#ifdef ELECROW_ThinkNode_M5 + io.digitalWrite(PCA_PIN_EINK_EN, LOW); +#endif + dispdev->displayOff(); #ifdef USE_ST7789 SPI1.end(); diff --git a/src/main.cpp b/src/main.cpp index 605fbe50a..7fc1d2cf2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -38,6 +38,10 @@ #include #include +#ifdef ELECROW_ThinkNode_M5 +PCA9557 io(0x18, &Wire); +#endif + #ifdef ARCH_ESP32 #include "freertosinc.h" #if !MESHTASTIC_EXCLUDE_WEBSERVER @@ -296,6 +300,15 @@ void setup() digitalWrite(PIN_POWER_EN, HIGH); #endif +#if defined(ELECROW_ThinkNode_M5) + Wire.begin(48, 47); + io.pinMode(PCA_PIN_EINK_EN, OUTPUT); + io.pinMode(PCA_PIN_POWER_EN, OUTPUT); + io.digitalWrite(PCA_PIN_EINK_EN, HIGH); + io.digitalWrite(PCA_PIN_POWER_EN, HIGH); + // io.pinMode(C2_PIN, OUTPUT); +#endif + #ifdef LED_POWER pinMode(LED_POWER, OUTPUT); digitalWrite(LED_POWER, LED_STATE_ON); diff --git a/src/main.h b/src/main.h index 7105bd62b..3568daad2 100644 --- a/src/main.h +++ b/src/main.h @@ -51,6 +51,11 @@ extern Adafruit_DRV2605 drv; extern AudioThread *audioThread; #endif +#ifdef ELECROW_ThinkNode_M5 +#include +extern PCA9557 io; +#endif + #ifdef HAS_UDP_MULTICAST #include "mesh/udp/UdpMulticastHandler.h" extern UdpMulticastHandler *udpHandler; diff --git a/src/modules/SerialModule.cpp b/src/modules/SerialModule.cpp index f3091e5bf..39b297965 100644 --- a/src/modules/SerialModule.cpp +++ b/src/modules/SerialModule.cpp @@ -60,7 +60,8 @@ SerialModule *serialModule; SerialModuleRadio *serialModuleRadio; -#if defined(TTGO_T_ECHO) || defined(CANARYONE) || defined(MESHLINK) || defined(ELECROW_ThinkNode_M1) +#if defined(TTGO_T_ECHO) || defined(CANARYONE) || defined(MESHLINK) || defined(ELECROW_ThinkNode_M1) || \ + defined(ELECROW_ThinkNode_M5) SerialModule::SerialModule() : StreamAPI(&Serial), concurrency::OSThread("Serial") {} static Print *serialPrint = &Serial; #elif defined(CONFIG_IDF_TARGET_ESP32C6) @@ -178,7 +179,8 @@ int32_t SerialModule::runOnce() Serial.begin(baud); Serial.setTimeout(moduleConfig.serial.timeout > 0 ? moduleConfig.serial.timeout : TIMEOUT); } -#elif !defined(TTGO_T_ECHO) && !defined(CANARYONE) && !defined(MESHLINK) && !defined(ELECROW_ThinkNode_M1) +#elif !defined(TTGO_T_ECHO) && !defined(CANARYONE) && !defined(MESHLINK) && !defined(ELECROW_ThinkNode_M1) && \ + !defined(ELECROW_ThinkNode_M5) if (moduleConfig.serial.rxd && moduleConfig.serial.txd) { #ifdef ARCH_RP2040 Serial2.setFIFOSize(RX_BUFFER); @@ -234,7 +236,8 @@ int32_t SerialModule::runOnce() } } -#if !defined(TTGO_T_ECHO) && !defined(CANARYONE) && !defined(MESHLINK) && !defined(ELECROW_ThinkNode_M1) +#if !defined(TTGO_T_ECHO) && !defined(CANARYONE) && !defined(MESHLINK) && !defined(ELECROW_ThinkNode_M1) && \ + !defined(ELECROW_ThinkNode_M5) else if ((moduleConfig.serial.mode == meshtastic_ModuleConfig_SerialConfig_Serial_Mode_WS85)) { processWXSerial(); @@ -494,7 +497,7 @@ ParsedLine parseLine(const char *line) void SerialModule::processWXSerial() { #if !defined(TTGO_T_ECHO) && !defined(CANARYONE) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(MESHLINK) && \ - !defined(ELECROW_ThinkNode_M1) + !defined(ELECROW_ThinkNode_M1) && !defined(ELECROW_ThinkNode_M5) static unsigned int lastAveraged = 0; static unsigned int averageIntervalMillis = 300000; // 5 minutes hard coded. static double dir_sum_sin = 0; diff --git a/src/platform/esp32/architecture.h b/src/platform/esp32/architecture.h index 3168d9121..522e862ac 100644 --- a/src/platform/esp32/architecture.h +++ b/src/platform/esp32/architecture.h @@ -146,6 +146,8 @@ #define HW_VENDOR meshtastic_HardwareModel_EBYTE_ESP32_S3 #elif defined(ELECROW_ThinkNode_M2) #define HW_VENDOR meshtastic_HardwareModel_THINKNODE_M2 +#elif defined(ELECROW_ThinkNode_M5) +#define HW_VENDOR meshtastic_HardwareModel_THINKNODE_M5 #elif defined(ESP32_S3_PICO) #define HW_VENDOR meshtastic_HardwareModel_ESP32_S3_PICO #elif defined(SENSELORA_S3) diff --git a/variants/esp32s3/ELECROW-ThinkNode-M5/pins_arduino.h b/variants/esp32s3/ELECROW-ThinkNode-M5/pins_arduino.h new file mode 100644 index 000000000..46415d30f --- /dev/null +++ b/variants/esp32s3/ELECROW-ThinkNode-M5/pins_arduino.h @@ -0,0 +1,28 @@ +// Need this file for ESP32-S3 +// No need to modify this file, changes to pins imported from variant.h +// Most is similar to https://github.com/espressif/arduino-esp32/blob/master/variants/esp32s3/pins_arduino.h + +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include +#include + +#define USB_VID 0x303a +#define USB_PID 0x1001 + +// Serial +static const uint8_t TX = UART_TX; +static const uint8_t RX = UART_RX; + +// Default SPI will be mapped to Radio +static const uint8_t SS = LORA_CS; +static const uint8_t SCK = LORA_SCK; +static const uint8_t MOSI = LORA_MOSI; +static const uint8_t MISO = LORA_MISO; + +// The default Wire will be mapped to PMU and RTC +static const uint8_t SCL = I2C_SCL; +static const uint8_t SDA = I2C_SDA; + +#endif /* Pins_Arduino_h */ diff --git a/variants/esp32s3/ELECROW-ThinkNode-M5/platformio.ini b/variants/esp32s3/ELECROW-ThinkNode-M5/platformio.ini new file mode 100644 index 000000000..7dac6e66e --- /dev/null +++ b/variants/esp32s3/ELECROW-ThinkNode-M5/platformio.ini @@ -0,0 +1,21 @@ +[env:thinknode_m5] +extends = esp32s3_base +board = ESP32-S3-WROOM-1-N4 +build_flags = + ${esp32s3_base.build_flags} + -D ELECROW_ThinkNode_M5 + -I variants/esp32s3/ELECROW-ThinkNode-M5 + -DEINK_DISPLAY_MODEL=GxEPD2_154_D67 + -DEINK_WIDTH=200 + -DEINK_HEIGHT=200 + -DUSE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk + -DEINK_LIMIT_FASTREFRESH=10 ; How many consecutive fast-refreshes are permitted //20 + -DEINK_LIMIT_RATE_BACKGROUND_SEC=10 ; Minimum interval between BACKGROUND updates //30 + -DEINK_LIMIT_RATE_RESPONSIVE_SEC=1 ; Minimum interval between RESPONSIVE updates +; -DEINK_LIMIT_GHOSTING_PX=2000 ; (Optional) How much image ghosting is tolerated + -DEINK_BACKGROUND_USES_FAST ; (Optional) Use FAST refresh for both BACKGROUND and RESPONSIVE, until a limit is reached. + +lib_deps = ${esp32s3_base.lib_deps} + https://github.com/meshtastic/GxEPD2/archive/1655054ba298e0e29fc2044741940f927f9c2a43.zip + lewisxhe/PCF8563_Library@^1.0.1 + maxpromer/PCA9557-arduino @ ^1.0.0 \ No newline at end of file diff --git a/variants/esp32s3/ELECROW-ThinkNode-M5/variant.h b/variants/esp32s3/ELECROW-ThinkNode-M5/variant.h new file mode 100644 index 000000000..61d6149d2 --- /dev/null +++ b/variants/esp32s3/ELECROW-ThinkNode-M5/variant.h @@ -0,0 +1,83 @@ +#ifndef ELECROW_ThinkNode_M5_VAR +#define ELECROW_ThinkNode_M5_VAR + +#define UART_TX 43 +#define UART_RX 44 + +// LED +// Both of these are on the GPIO expander +#define PCA_LED_USER 1 // the Blue LED +#define PCA_LED_POWER 3 // the Red LED? Seems to have hardware logic to blink when USB is plugged in. + +// USB_CHECK +#define EXT_PWR_DETECT 12 +#define BATTERY_PIN 8 +#define ADC_CHANNEL ADC1_GPIO8_CHANNEL + +#define PIN_BUZZER 9 + +// Buttons + +#define PIN_BUTTON2 14 +#define PIN_BUTTON1 21 + +// Wire Interfaces + +#define I2C_SCL 1 +#define I2C_SDA 2 + +// GPS pins +#define GPS_SWITH 10 +#define HAS_GPS 1 +#define GPS_L76K +#define PIN_GPS_REINIT 13 // An output to reset L76K GPS. As per datasheet, low for > 100ms will reset the L76K + +#define PIN_GPS_STANDBY 11 // An output to wake GPS, low means allow sleep, high means force wake + +#define GPS_TX_PIN 20 // This is for bits going TOWARDS the CPU +#define GPS_RX_PIN 19 // This is for bits going TOWARDS the GPS + +#define GPS_THREAD_INTERVAL 50 + +#define PIN_SERIAL1_RX GPS_TX_PIN +#define PIN_SERIAL1_TX GPS_RX_PIN + +// PCF8563 RTC Module +#define PCF8563_RTC 0x51 + +#define SX126X_CS 17 +#define LORA_SCK 16 +#define LORA_MOSI 15 +#define LORA_MISO 7 +#define SX126X_RESET 6 +#define SX126X_BUSY 5 +#define SX126X_DIO1 4 +#define SX126X_DIO2_AS_RF_SWITCH +#define SX126X_DIO3_TCXO_VOLTAGE 3.3 +#define SX126X_POWER_EN 46 +#define SX126X_MAX_POWER 22 // SX126xInterface.cpp defaults to 22 if not defined, but here we define it for good practice +#define USE_SX1262 +#define LORA_CS SX126X_CS // FIXME: for some reason both are used in /src +#define LORA_DIO1 SX126X_DIO1 + +#define USE_EINK +#define PIN_EINK_EN -1 // Note: this is really just backlight power +#define PCA_PIN_EINK_EN 5 // This is the pin number on the GPIO expander +#define PIN_EINK_CS 39 +#define PIN_EINK_BUSY 42 +#define PIN_EINK_DC 40 +#define PIN_EINK_RES 41 +#define PIN_EINK_SCLK 38 +#define PIN_EINK_MOSI 45 // also called SDI + +// Controls power for all peripherals (eink + GPS + LoRa + Sensor) +#define PIN_POWER_EN -1 +#define PCA_PIN_POWER_EN 4 // This is the pin number on the GPIO expander + +#define PIN_SPI_MISO 7 +#define PIN_SPI_MOSI 15 +#define PIN_SPI_SCK 16 + +#define BUTTON_PIN PIN_BUTTON1 +#define BUTTON_PIN_ALT PIN_BUTTON2 +#endif From f2a880f81361d252427632d1c77ddb967382e2a1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 13:56:17 +0200 Subject: [PATCH 097/180] chore(deps): update adafruit shtc3 to v1.0.2 (#7557) 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 8bf56cf5b..6330f3908 100644 --- a/platformio.ini +++ b/platformio.ini @@ -178,7 +178,7 @@ lib_deps = # renovate: datasource=custom.pio depName=Adafruit MAX1704X packageName=adafruit/library/Adafruit MAX1704X adafruit/Adafruit MAX1704X@1.0.3 # renovate: datasource=custom.pio depName=Adafruit SHTC3 packageName=adafruit/library/Adafruit SHTC3 Library - adafruit/Adafruit SHTC3 Library@1.0.1 + adafruit/Adafruit SHTC3 Library@1.0.2 # renovate: datasource=custom.pio depName=Adafruit LPS2X packageName=adafruit/library/Adafruit LPS2X adafruit/Adafruit LPS2X@2.0.6 # renovate: datasource=custom.pio depName=Adafruit SHT31 packageName=adafruit/library/Adafruit SHT31 Library From 8568b56ac6cdcc39efdc19b3c0fd6cad27d51ac0 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 7 Aug 2025 12:28:01 -0500 Subject: [PATCH 098/180] Fix a crash on Native reboot (#7570) --- src/Power.cpp | 6 ++++-- src/mesh/api/WiFiServerAPI.cpp | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Power.cpp b/src/Power.cpp index b489bc33c..8a16132f1 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -724,10 +724,12 @@ void Power::reboot() SPI.end(); Wire.end(); Serial1.end(); - if (screen) + if (screen) { delete screen; + screen = nullptr; + } LOG_DEBUG("final reboot!"); - reboot(); + ::reboot(); #elif defined(ARCH_STM32WL) HAL_NVIC_SystemReset(); #else diff --git a/src/mesh/api/WiFiServerAPI.cpp b/src/mesh/api/WiFiServerAPI.cpp index 5b63bc165..b19194f78 100644 --- a/src/mesh/api/WiFiServerAPI.cpp +++ b/src/mesh/api/WiFiServerAPI.cpp @@ -17,7 +17,10 @@ void initApiServer(int port) } void deInitApiServer() { - delete apiPort; + if (apiPort) { + delete apiPort; + apiPort = nullptr; + } } WiFiServerAPI::WiFiServerAPI(WiFiClient &_client) : ServerAPI(_client) From 7b874cf597e1a68dd9adafe903e87ce0c02943fd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 11:31:49 -0500 Subject: [PATCH 099/180] chore(deps): update meshtastic/device-ui digest to d044c01 (#7578) 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 6330f3908..a5a23e56f 100644 --- a/platformio.ini +++ b/platformio.ini @@ -110,7 +110,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/c75d545bf9e8d1fe20051c319f427f711113ff22.zip + https://github.com/meshtastic/device-ui/archive/d044c01e87583867011991a96f926e4e929d8a93.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From c1f4f79d4a35ec6fc3e7b89e515b9ef5ee40e4a4 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 9 Aug 2025 06:11:56 -0500 Subject: [PATCH 100/180] Revert "128row display (#7511)" This reverts commit d1f3c3c9821bd6f6d2a1c1e0a64929d7458a703b. --- src/main.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 7fc1d2cf2..9e46021c9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -774,17 +774,8 @@ void setup() #if defined(USE_SH1107_128_64) screen_model = meshtastic_Config_DisplayConfig_OledType_OLED_SH1107; // keep dimension of 128x64 - screen_geometry = GEOMETRY_128_64; #endif - // if we have one of the fixed overrides in the settings, adjust display type accordingly. - if (screen_model == meshtastic_Config_DisplayConfig_OledType_OLED_SH1107) { - screen_geometry = GEOMETRY_128_128; - } else if (screen_model == meshtastic_Config_DisplayConfig_OledType_OLED_SH1107_128_64) { - screen_model = meshtastic_Config_DisplayConfig_OledType_OLED_SH1107; - screen_geometry = GEOMETRY_128_64; - } - #if !MESHTASTIC_EXCLUDE_I2C #if !defined(ARCH_STM32WL) if (acc_info.type != ScanI2C::DeviceType::NONE) { @@ -830,7 +821,7 @@ void setup() #elif !defined(ARCH_ESP32) // ARCH_RP2040 SPI.begin(); #else - // ESP32 + // ESP32 #if defined(HW_SPI1_DEVICE) SPI1.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS); LOG_DEBUG("SPI1.begin(SCK=%d, MISO=%d, MOSI=%d, NSS=%d)", LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS); From 2de9f015b1df8d2e2e72a4d3be48d3910168e7b7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 9 Aug 2025 08:12:24 -0500 Subject: [PATCH 101/180] Automated version bumps (#7586) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- bin/org.meshtastic.meshtasticd.metainfo.xml | 3 +++ debian/changelog | 7 +++++-- version.properties | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/org.meshtastic.meshtasticd.metainfo.xml b/bin/org.meshtastic.meshtasticd.metainfo.xml index 116155807..d52b804ee 100644 --- a/bin/org.meshtastic.meshtasticd.metainfo.xml +++ b/bin/org.meshtastic.meshtasticd.metainfo.xml @@ -87,6 +87,9 @@ + + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.5 + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.4 diff --git a/debian/changelog b/debian/changelog index 02a32f2f1..9421e9925 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -meshtasticd (2.7.4.0) UNRELEASED; urgency=medium +meshtasticd (2.7.5.0) UNRELEASED; urgency=medium [ Austin Lane ] * Initial packaging @@ -34,4 +34,7 @@ meshtasticd (2.7.4.0) UNRELEASED; urgency=medium [ ] * GitHub Actions Automatic version bump - -- Sat, 19 Jul 2025 11:36:55 +0000 + [ ] + * GitHub Actions Automatic version bump + + -- Sat, 09 Aug 2025 12:46:53 +0000 diff --git a/version.properties b/version.properties index aa959bcac..7764a56c9 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 7 -build = 4 +build = 5 From be60f9612eec02a9598c807bf3582f851736655b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 9 Aug 2025 08:14:04 -0500 Subject: [PATCH 102/180] Update protobufs (#7587) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/mesh.pb.h | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/protobufs b/protobufs index 1ecf94da9..13d8946c6 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 1ecf94da9898ea0b8f2745bfe6bda2a8f2ca4073 +Subproject commit 13d8946c6d2119864cc167ebe4b53ef6dd57000c diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index f915a1db3..bd0b72937 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -1149,7 +1149,8 @@ typedef struct _meshtastic_FromRadio { /* A heartbeat message is sent to the node from the client to keep the connection alive. This is currently only needed to keep serial connections alive, but can be used by any PhoneAPI. */ typedef struct _meshtastic_Heartbeat { - char dummy_field; + /* The nonce of the heartbeat message */ + uint32_t nonce; } meshtastic_Heartbeat; /* Packets/commands to the radio will be written (reliably) to the toRadio characteristic. @@ -1551,6 +1552,7 @@ extern "C" { #define meshtastic_FromRadio_fileInfo_tag 15 #define meshtastic_FromRadio_clientNotification_tag 16 #define meshtastic_FromRadio_deviceuiConfig_tag 17 +#define meshtastic_Heartbeat_nonce_tag 1 #define meshtastic_ToRadio_packet_tag 1 #define meshtastic_ToRadio_want_config_id_tag 3 #define meshtastic_ToRadio_disconnect_tag 4 @@ -1882,7 +1884,7 @@ X(a, STATIC, SINGULAR, UINT32, excluded_modules, 12) #define meshtastic_DeviceMetadata_DEFAULT NULL #define meshtastic_Heartbeat_FIELDLIST(X, a) \ - +X(a, STATIC, SINGULAR, UINT32, nonce, 1) #define meshtastic_Heartbeat_CALLBACK NULL #define meshtastic_Heartbeat_DEFAULT NULL @@ -1992,7 +1994,7 @@ extern const pb_msgdesc_t meshtastic_ChunkedPayloadResponse_msg; #define meshtastic_DuplicatedPublicKey_size 0 #define meshtastic_FileInfo_size 236 #define meshtastic_FromRadio_size 510 -#define meshtastic_Heartbeat_size 0 +#define meshtastic_Heartbeat_size 6 #define meshtastic_KeyVerificationFinal_size 65 #define meshtastic_KeyVerificationNumberInform_size 58 #define meshtastic_KeyVerificationNumberRequest_size 52 From 7fe2c741398a6740799747066e9cd0c54744c3ba Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 9 Aug 2025 09:14:22 -0500 Subject: [PATCH 103/180] Update protobufs (#7588) Co-authored-by: jp-bennett <5630967+jp-bennett@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/deviceonly.pb.h | 2 +- src/mesh/generated/meshtastic/mesh.pb.cpp | 2 + src/mesh/generated/meshtastic/mesh.pb.h | 37 +++++++++++++++++-- 4 files changed, 37 insertions(+), 6 deletions(-) diff --git a/protobufs b/protobufs index 13d8946c6..e2c0831aa 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 13d8946c6d2119864cc167ebe4b53ef6dd57000c +Subproject commit e2c0831aa3d34a58a36c2b9fdcb828e58961cbc5 diff --git a/src/mesh/generated/meshtastic/deviceonly.pb.h b/src/mesh/generated/meshtastic/deviceonly.pb.h index ba1a52b27..f47091384 100644 --- a/src/mesh/generated/meshtastic/deviceonly.pb.h +++ b/src/mesh/generated/meshtastic/deviceonly.pb.h @@ -362,7 +362,7 @@ extern const pb_msgdesc_t meshtastic_BackupPreferences_msg; #define MESHTASTIC_MESHTASTIC_DEVICEONLY_PB_H_MAX_SIZE meshtastic_BackupPreferences_size #define meshtastic_BackupPreferences_size 2271 #define meshtastic_ChannelFile_size 718 -#define meshtastic_DeviceState_size 1728 +#define meshtastic_DeviceState_size 1737 #define meshtastic_NodeInfoLite_size 196 #define meshtastic_PositionLite_size 28 #define meshtastic_UserLite_size 98 diff --git a/src/mesh/generated/meshtastic/mesh.pb.cpp b/src/mesh/generated/meshtastic/mesh.pb.cpp index 85735357a..9966e52f8 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.cpp +++ b/src/mesh/generated/meshtastic/mesh.pb.cpp @@ -119,6 +119,8 @@ PB_BIND(meshtastic_ChunkedPayloadResponse, meshtastic_ChunkedPayloadResponse, AU + + diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index bd0b72937..1d1ff47e0 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -509,6 +509,26 @@ typedef enum _meshtastic_MeshPacket_Delayed { meshtastic_MeshPacket_Delayed_DELAYED_DIRECT = 2 } meshtastic_MeshPacket_Delayed; +/* Enum to identify which transport mechanism this packet arrived over */ +typedef enum _meshtastic_MeshPacket_TransportMechanism { + /* The default case is that the node generated a packet itself */ + meshtastic_MeshPacket_TransportMechanism_TRANSPORT_INTERNAL = 0, + /* Arrived via the primary LoRa radio */ + meshtastic_MeshPacket_TransportMechanism_TRANSPORT_LORA = 1, + /* Arrived via a secondary LoRa radio */ + meshtastic_MeshPacket_TransportMechanism_TRANSPORT_LORA_ALT1 = 2, + /* Arrived via a tertiary LoRa radio */ + meshtastic_MeshPacket_TransportMechanism_TRANSPORT_LORA_ALT2 = 3, + /* Arrived via a quaternary LoRa radio */ + meshtastic_MeshPacket_TransportMechanism_TRANSPORT_LORA_ALT3 = 4, + /* Arrived via an MQTT connection */ + meshtastic_MeshPacket_TransportMechanism_TRANSPORT_MQTT = 5, + /* Arrived via Multicast UDP */ + meshtastic_MeshPacket_TransportMechanism_TRANSPORT_MULTICAST_UDP = 6, + /* Arrived via API connection */ + meshtastic_MeshPacket_TransportMechanism_TRANSPORT_API = 7 +} meshtastic_MeshPacket_TransportMechanism; + /* Log levels, chosen to match python logging conventions. */ typedef enum _meshtastic_LogRecord_Level { /* Log levels, chosen to match python logging conventions. */ @@ -863,6 +883,8 @@ typedef struct _meshtastic_MeshPacket { Timestamp after which this packet may be sent. Set by the firmware internally, clients are not supposed to set this. */ uint32_t tx_after; + /* Indicates which transport mechanism this packet arrived over */ + meshtastic_MeshPacket_TransportMechanism transport_mechanism; } meshtastic_MeshPacket; /* The bluetooth to device link: @@ -1268,6 +1290,10 @@ extern "C" { #define _meshtastic_MeshPacket_Delayed_MAX meshtastic_MeshPacket_Delayed_DELAYED_DIRECT #define _meshtastic_MeshPacket_Delayed_ARRAYSIZE ((meshtastic_MeshPacket_Delayed)(meshtastic_MeshPacket_Delayed_DELAYED_DIRECT+1)) +#define _meshtastic_MeshPacket_TransportMechanism_MIN meshtastic_MeshPacket_TransportMechanism_TRANSPORT_INTERNAL +#define _meshtastic_MeshPacket_TransportMechanism_MAX meshtastic_MeshPacket_TransportMechanism_TRANSPORT_API +#define _meshtastic_MeshPacket_TransportMechanism_ARRAYSIZE ((meshtastic_MeshPacket_TransportMechanism)(meshtastic_MeshPacket_TransportMechanism_TRANSPORT_API+1)) + #define _meshtastic_LogRecord_Level_MIN meshtastic_LogRecord_Level_UNSET #define _meshtastic_LogRecord_Level_MAX meshtastic_LogRecord_Level_CRITICAL #define _meshtastic_LogRecord_Level_ARRAYSIZE ((meshtastic_LogRecord_Level)(meshtastic_LogRecord_Level_CRITICAL+1)) @@ -1288,6 +1314,7 @@ extern "C" { #define meshtastic_MeshPacket_priority_ENUMTYPE meshtastic_MeshPacket_Priority #define meshtastic_MeshPacket_delayed_ENUMTYPE meshtastic_MeshPacket_Delayed +#define meshtastic_MeshPacket_transport_mechanism_ENUMTYPE meshtastic_MeshPacket_TransportMechanism #define meshtastic_MyNodeInfo_firmware_edition_ENUMTYPE meshtastic_FirmwareEdition @@ -1327,7 +1354,7 @@ extern "C" { #define meshtastic_KeyVerification_init_default {0, {0, {0}}, {0, {0}}} #define meshtastic_Waypoint_init_default {0, false, 0, false, 0, 0, 0, "", "", 0} #define meshtastic_MqttClientProxyMessage_init_default {"", 0, {{0, {0}}}, 0} -#define meshtastic_MeshPacket_init_default {0, 0, 0, 0, {meshtastic_Data_init_default}, 0, 0, 0, 0, 0, _meshtastic_MeshPacket_Priority_MIN, 0, _meshtastic_MeshPacket_Delayed_MIN, 0, 0, {0, {0}}, 0, 0, 0, 0} +#define meshtastic_MeshPacket_init_default {0, 0, 0, 0, {meshtastic_Data_init_default}, 0, 0, 0, 0, 0, _meshtastic_MeshPacket_Priority_MIN, 0, _meshtastic_MeshPacket_Delayed_MIN, 0, 0, {0, {0}}, 0, 0, 0, 0, _meshtastic_MeshPacket_TransportMechanism_MIN} #define meshtastic_NodeInfo_init_default {0, false, meshtastic_User_init_default, false, meshtastic_Position_init_default, 0, 0, false, meshtastic_DeviceMetrics_init_default, 0, 0, false, 0, 0, 0, 0} #define meshtastic_MyNodeInfo_init_default {0, 0, 0, {0, {0}}, "", _meshtastic_FirmwareEdition_MIN, 0} #define meshtastic_LogRecord_init_default {"", 0, "", _meshtastic_LogRecord_Level_MIN} @@ -1358,7 +1385,7 @@ extern "C" { #define meshtastic_KeyVerification_init_zero {0, {0, {0}}, {0, {0}}} #define meshtastic_Waypoint_init_zero {0, false, 0, false, 0, 0, 0, "", "", 0} #define meshtastic_MqttClientProxyMessage_init_zero {"", 0, {{0, {0}}}, 0} -#define meshtastic_MeshPacket_init_zero {0, 0, 0, 0, {meshtastic_Data_init_zero}, 0, 0, 0, 0, 0, _meshtastic_MeshPacket_Priority_MIN, 0, _meshtastic_MeshPacket_Delayed_MIN, 0, 0, {0, {0}}, 0, 0, 0, 0} +#define meshtastic_MeshPacket_init_zero {0, 0, 0, 0, {meshtastic_Data_init_zero}, 0, 0, 0, 0, 0, _meshtastic_MeshPacket_Priority_MIN, 0, _meshtastic_MeshPacket_Delayed_MIN, 0, 0, {0, {0}}, 0, 0, 0, 0, _meshtastic_MeshPacket_TransportMechanism_MIN} #define meshtastic_NodeInfo_init_zero {0, false, meshtastic_User_init_zero, false, meshtastic_Position_init_zero, 0, 0, false, meshtastic_DeviceMetrics_init_zero, 0, 0, false, 0, 0, 0, 0} #define meshtastic_MyNodeInfo_init_zero {0, 0, 0, {0, {0}}, "", _meshtastic_FirmwareEdition_MIN, 0} #define meshtastic_LogRecord_init_zero {"", 0, "", _meshtastic_LogRecord_Level_MIN} @@ -1466,6 +1493,7 @@ extern "C" { #define meshtastic_MeshPacket_next_hop_tag 18 #define meshtastic_MeshPacket_relay_node_tag 19 #define meshtastic_MeshPacket_tx_after_tag 20 +#define meshtastic_MeshPacket_transport_mechanism_tag 21 #define meshtastic_NodeInfo_num_tag 1 #define meshtastic_NodeInfo_user_tag 2 #define meshtastic_NodeInfo_position_tag 3 @@ -1689,7 +1717,8 @@ X(a, STATIC, SINGULAR, BYTES, public_key, 16) \ X(a, STATIC, SINGULAR, BOOL, pki_encrypted, 17) \ X(a, STATIC, SINGULAR, UINT32, next_hop, 18) \ X(a, STATIC, SINGULAR, UINT32, relay_node, 19) \ -X(a, STATIC, SINGULAR, UINT32, tx_after, 20) +X(a, STATIC, SINGULAR, UINT32, tx_after, 20) \ +X(a, STATIC, SINGULAR, UENUM, transport_mechanism, 21) #define meshtastic_MeshPacket_CALLBACK NULL #define meshtastic_MeshPacket_DEFAULT NULL #define meshtastic_MeshPacket_payload_variant_decoded_MSGTYPE meshtastic_Data @@ -2001,7 +2030,7 @@ extern const pb_msgdesc_t meshtastic_ChunkedPayloadResponse_msg; #define meshtastic_KeyVerification_size 79 #define meshtastic_LogRecord_size 426 #define meshtastic_LowEntropyKey_size 0 -#define meshtastic_MeshPacket_size 378 +#define meshtastic_MeshPacket_size 381 #define meshtastic_MqttClientProxyMessage_size 501 #define meshtastic_MyNodeInfo_size 83 #define meshtastic_NeighborInfo_size 258 From f6857f1bcbb481bb53da17d9be3bc00fcc5f7a14 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 9 Aug 2025 10:17:08 -0500 Subject: [PATCH 104/180] Heartbeat has a nonce now --- src/mesh/api/PacketAPI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/api/PacketAPI.cpp b/src/mesh/api/PacketAPI.cpp index 4f0fbaf97..1d6df855f 100644 --- a/src/mesh/api/PacketAPI.cpp +++ b/src/mesh/api/PacketAPI.cpp @@ -70,7 +70,7 @@ bool PacketAPI::receivePacket(void) break; } case meshtastic_ToRadio_heartbeat_tag: - if (mr->heartbeat.dummy_field == 1) { + if (mr->heartbeat.nonce == 1) { if (nodeInfoModule) { LOG_INFO("Broadcasting nodeinfo ping"); nodeInfoModule->sendOurNodeInfo(NODENUM_BROADCAST, true, 0, true); From 7505fe7a7cc4009109f0cb2e0f575de3a1b7649b Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 9 Aug 2025 10:38:09 -0500 Subject: [PATCH 105/180] Update device-ui deps --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index a5a23e56f..62bbf8a24 100644 --- a/platformio.ini +++ b/platformio.ini @@ -110,7 +110,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/d044c01e87583867011991a96f926e4e929d8a93.zip + https://github.com/meshtastic/device-ui/archive/0cd108ff783539e41ef38258ba2784ab3b1bdc97.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From e69da71d4e17ba5258a693500969a92c7bc817ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Mon, 11 Aug 2025 11:53:01 +0200 Subject: [PATCH 106/180] reorder for correct recognition (#7604) --- src/platform/nrf52/architecture.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/platform/nrf52/architecture.h b/src/platform/nrf52/architecture.h index 1bbdd77e0..ce42bf849 100644 --- a/src/platform/nrf52/architecture.h +++ b/src/platform/nrf52/architecture.h @@ -53,6 +53,9 @@ #define HW_VENDOR meshtastic_HardwareModel_WISMESH_TAG #elif defined(GAT562_MESH_TRIAL_TRACKER) #define HW_VENDOR meshtastic_HardwareModel_GAT562_MESH_TRIAL_TRACKER +#elif defined(NOMADSTAR_METEOR_PRO) +#define HW_VENDOR meshtastic_HardwareModel_NOMADSTAR_METEOR_PRO +// MAke sure all custom RAK4630 boards are defined before the generic RAK4630 #elif defined(RAK4630) #define HW_VENDOR meshtastic_HardwareModel_RAK4631 #elif defined(TTGO_T_ECHO) @@ -89,8 +92,6 @@ #define HW_VENDOR meshtastic_HardwareModel_SEEED_SOLAR_NODE #elif defined(HELTEC_MESH_POCKET) #define HW_VENDOR meshtastic_HardwareModel_HELTEC_MESH_POCKET -#elif defined(NOMADSTAR_METEOR_PRO) -#define HW_VENDOR meshtastic_HardwareModel_NOMADSTAR_METEOR_PRO #elif defined(SEEED_WIO_TRACKER_L1_EINK) #define HW_VENDOR meshtastic_HardwareModel_SEEED_WIO_TRACKER_L1_EINK #elif defined(SEEED_WIO_TRACKER_L1) From f2b935f48f9412a1e3bebe8d37a757311655a85e Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Mon, 11 Aug 2025 15:52:28 -0500 Subject: [PATCH 107/180] Stop the bleeding with malicious NodeDB overwrites (#7596) --- src/modules/NodeInfoModule.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/NodeInfoModule.cpp b/src/modules/NodeInfoModule.cpp index b6fee7703..10ab67730 100644 --- a/src/modules/NodeInfoModule.cpp +++ b/src/modules/NodeInfoModule.cpp @@ -14,6 +14,9 @@ bool NodeInfoModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, mes { auto p = *pptr; + if (mp.from == nodeDB->getNodeNum()) { + return false; + } if (p.is_licensed != owner.is_licensed) { LOG_WARN("Invalid nodeInfo detected, is_licensed mismatch!"); return true; From db238ef524974666182d6990020ee91f4cbdc16d Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Mon, 11 Aug 2025 19:49:35 -0500 Subject: [PATCH 108/180] Log when this happened --- src/modules/NodeInfoModule.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/NodeInfoModule.cpp b/src/modules/NodeInfoModule.cpp index 10ab67730..0060e99fa 100644 --- a/src/modules/NodeInfoModule.cpp +++ b/src/modules/NodeInfoModule.cpp @@ -15,6 +15,7 @@ bool NodeInfoModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, mes auto p = *pptr; if (mp.from == nodeDB->getNodeNum()) { + LOG_WARN("Ignoring packet supposed to be from our own node: %08x", mp.from); return false; } if (p.is_licensed != owner.is_licensed) { From a2df80e83310cafd4fbe00f341032616971b41b6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 20:58:54 -0500 Subject: [PATCH 109/180] chore(deps): update actions/checkout action to v5 (#7605) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/actions/setup-base/action.yml | 2 +- .github/workflows/build_debian_src.yml | 2 +- .github/workflows/build_firmware.yml | 2 +- .github/workflows/docker_build.yml | 2 +- .github/workflows/docker_manifest.yml | 2 +- .github/workflows/hook_copr.yml | 2 +- .github/workflows/main_matrix.yml | 14 +++++++------- .github/workflows/nightly.yml | 4 ++-- .github/workflows/package_obs.yml | 2 +- .github/workflows/package_pio_deps.yml | 2 +- .github/workflows/package_ppa.yml | 2 +- .github/workflows/release_channels.yml | 2 +- .github/workflows/sec_sast_semgrep_cron.yml | 2 +- .github/workflows/sec_sast_semgrep_pull.yml | 2 +- .github/workflows/test_native.yml | 6 +++--- .github/workflows/tests.yml | 2 +- .github/workflows/trunk_annotate_pr.yml | 2 +- .github/workflows/trunk_check.yml | 2 +- .github/workflows/trunk_format_pr.yml | 2 +- .github/workflows/update_protobufs.yml | 2 +- 20 files changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/actions/setup-base/action.yml b/.github/actions/setup-base/action.yml index 7cd0dfcac..5c1c453dd 100644 --- a/.github/actions/setup-base/action.yml +++ b/.github/actions/setup-base/action.yml @@ -5,7 +5,7 @@ runs: using: composite steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: submodules: recursive ref: ${{github.event.pull_request.head.ref}} diff --git a/.github/workflows/build_debian_src.yml b/.github/workflows/build_debian_src.yml index 5c441f085..7f3f8b672 100644 --- a/.github/workflows/build_debian_src.yml +++ b/.github/workflows/build_debian_src.yml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: submodules: recursive path: meshtasticd diff --git a/.github/workflows/build_firmware.yml b/.github/workflows/build_firmware.yml index df1035e62..2ef67405a 100644 --- a/.github/workflows/build_firmware.yml +++ b/.github/workflows/build_firmware.yml @@ -20,7 +20,7 @@ jobs: name: build-${{ inputs.platform }} runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: submodules: recursive ref: ${{github.event.pull_request.head.ref}} diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index cde7fd274..26a9cff18 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -47,7 +47,7 @@ jobs: runs-on: ${{ inputs.runs-on }} steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: submodules: recursive ref: ${{github.event.pull_request.head.ref}} diff --git a/.github/workflows/docker_manifest.yml b/.github/workflows/docker_manifest.yml index d1d1a5634..20b9ceee6 100644 --- a/.github/workflows/docker_manifest.yml +++ b/.github/workflows/docker_manifest.yml @@ -83,7 +83,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: submodules: recursive ref: ${{github.event.pull_request.head.ref}} diff --git a/.github/workflows/hook_copr.yml b/.github/workflows/hook_copr.yml index 94aaca49c..2204cc02c 100644 --- a/.github/workflows/hook_copr.yml +++ b/.github/workflows/hook_copr.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: submodules: recursive ref: ${{ github.ref }} diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index a98bdc011..371b71fbe 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -42,7 +42,7 @@ jobs: - check runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: actions/setup-python@v5 with: python-version: 3.x @@ -72,7 +72,7 @@ jobs: version: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Get release version string run: | echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT @@ -93,7 +93,7 @@ jobs: runs-on: ubuntu-latest if: ${{ github.event_name != 'workflow_dispatch' }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Build base id: base uses: ./.github/actions/setup-base @@ -288,7 +288,7 @@ jobs: ] steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: ref: ${{github.event.pull_request.head.ref}} repository: ${{github.event.pull_request.head.repo.full_name}} @@ -367,7 +367,7 @@ jobs: - package-pio-deps-native-tft steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Setup Python uses: actions/setup-python@v5 @@ -436,7 +436,7 @@ jobs: needs: [release-artifacts, version] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Setup Python uses: actions/setup-python@v5 @@ -491,7 +491,7 @@ jobs: esp32,esp32s3,esp32c3,esp32c6,nrf52840,rp2040,rp2350,stm32 steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Setup Python uses: actions/setup-python@v5 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 309772b12..f26073ec4 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Trunk Check uses: trunk-io/trunk-action@v1 @@ -31,7 +31,7 @@ jobs: pull-requests: write # For trunk to create PRs steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Trunk Upgrade uses: trunk-io/trunk-action/upgrade@v1 diff --git a/.github/workflows/package_obs.yml b/.github/workflows/package_obs.yml index 275ffce0e..60170fba2 100644 --- a/.github/workflows/package_obs.yml +++ b/.github/workflows/package_obs.yml @@ -34,7 +34,7 @@ jobs: needs: build-debian-src steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: submodules: recursive path: meshtasticd diff --git a/.github/workflows/package_pio_deps.yml b/.github/workflows/package_pio_deps.yml index 9f535b7b1..13d3d1b4e 100644 --- a/.github/workflows/package_pio_deps.yml +++ b/.github/workflows/package_pio_deps.yml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: submodules: recursive ref: ${{github.event.pull_request.head.ref}} diff --git a/.github/workflows/package_ppa.yml b/.github/workflows/package_ppa.yml index a54b0bd36..69a22cba4 100644 --- a/.github/workflows/package_ppa.yml +++ b/.github/workflows/package_ppa.yml @@ -32,7 +32,7 @@ jobs: needs: build-debian-src steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: submodules: recursive path: meshtasticd diff --git a/.github/workflows/release_channels.yml b/.github/workflows/release_channels.yml index e52e67227..ccd99e792 100644 --- a/.github/workflows/release_channels.yml +++ b/.github/workflows/release_channels.yml @@ -60,7 +60,7 @@ jobs: shell: bash steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Setup Python uses: actions/setup-python@v5 diff --git a/.github/workflows/sec_sast_semgrep_cron.yml b/.github/workflows/sec_sast_semgrep_cron.yml index e391aa07b..96c993cba 100644 --- a/.github/workflows/sec_sast_semgrep_cron.yml +++ b/.github/workflows/sec_sast_semgrep_cron.yml @@ -21,7 +21,7 @@ jobs: steps: # step 1 - name: clone application source code - uses: actions/checkout@v4 + uses: actions/checkout@v5 # step 2 - name: full scan diff --git a/.github/workflows/sec_sast_semgrep_pull.yml b/.github/workflows/sec_sast_semgrep_pull.yml index 3707c91b8..e93b2ae8b 100644 --- a/.github/workflows/sec_sast_semgrep_pull.yml +++ b/.github/workflows/sec_sast_semgrep_pull.yml @@ -13,7 +13,7 @@ jobs: steps: # step 1 - name: clone application source code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 diff --git a/.github/workflows/test_native.yml b/.github/workflows/test_native.yml index dc05959fd..11eff00ea 100644 --- a/.github/workflows/test_native.yml +++ b/.github/workflows/test_native.yml @@ -14,7 +14,7 @@ jobs: name: Native Simulator Tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: ref: ${{github.event.pull_request.head.ref}} repository: ${{github.event.pull_request.head.repo.full_name}} @@ -70,7 +70,7 @@ jobs: name: Native PlatformIO Tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: ref: ${{github.event.pull_request.head.ref}} repository: ${{github.event.pull_request.head.repo.full_name}} @@ -127,7 +127,7 @@ jobs: - platformio-tests if: always() steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: ref: ${{github.event.pull_request.head.ref}} repository: ${{github.event.pull_request.head.repo.full_name}} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 34b28b39c..52f180aa2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,7 +20,7 @@ jobs: runs-on: test-runner steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 # - uses: actions/setup-python@v5 # with: diff --git a/.github/workflows/trunk_annotate_pr.yml b/.github/workflows/trunk_annotate_pr.yml index 62c1c01b7..23dcf8d09 100644 --- a/.github/workflows/trunk_annotate_pr.yml +++ b/.github/workflows/trunk_annotate_pr.yml @@ -18,7 +18,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Trunk Check uses: trunk-io/trunk-action@v1 diff --git a/.github/workflows/trunk_check.yml b/.github/workflows/trunk_check.yml index 55656bf48..41731d491 100644 --- a/.github/workflows/trunk_check.yml +++ b/.github/workflows/trunk_check.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Trunk Check uses: trunk-io/trunk-action@v1 diff --git a/.github/workflows/trunk_format_pr.yml b/.github/workflows/trunk_format_pr.yml index 33f4182eb..2d191fc44 100644 --- a/.github/workflows/trunk_format_pr.yml +++ b/.github/workflows/trunk_format_pr.yml @@ -15,7 +15,7 @@ jobs: pull-requests: write steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: ref: ${{github.event.pull_request.head.ref}} repository: ${{github.event.pull_request.head.repo.full_name}} diff --git a/.github/workflows/update_protobufs.yml b/.github/workflows/update_protobufs.yml index 3952d9d02..c06e06b0a 100644 --- a/.github/workflows/update_protobufs.yml +++ b/.github/workflows/update_protobufs.yml @@ -11,7 +11,7 @@ jobs: pull-requests: write steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: submodules: true From e26de85b5f3281bb03123d382bbab7410d705d4d Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Mon, 11 Aug 2025 21:47:04 -0500 Subject: [PATCH 110/180] Mark meshPackets based on which interface received. (#7589) --- src/mesh/FloodingRouter.cpp | 4 +++- src/mesh/RadioInterface.cpp | 10 +++++----- src/mesh/Router.cpp | 1 + src/mesh/api/PacketAPI.cpp | 1 + src/mesh/udp/UdpMulticastHandler.h | 4 ++++ src/mqtt/MQTT.cpp | 1 + 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/mesh/FloodingRouter.cpp b/src/mesh/FloodingRouter.cpp index 142ada806..dbd458b61 100644 --- a/src/mesh/FloodingRouter.cpp +++ b/src/mesh/FloodingRouter.cpp @@ -47,8 +47,10 @@ void FloodingRouter::perhapsCancelDupe(const meshtastic_MeshPacket *p) { if (config.device.role != meshtastic_Config_DeviceConfig_Role_ROUTER && config.device.role != meshtastic_Config_DeviceConfig_Role_REPEATER && - config.device.role != meshtastic_Config_DeviceConfig_Role_ROUTER_LATE) { + config.device.role != meshtastic_Config_DeviceConfig_Role_ROUTER_LATE && + p->transport_mechanism == meshtastic_MeshPacket_TransportMechanism_TRANSPORT_LORA) { // cancel rebroadcast of this message *if* there was already one, unless we're a router/repeater! + // But only LoRa packets should be able to trigger this. if (Router::cancelSending(p->from, p->id)) txRelayCanceled++; } diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 7590ac34d..99e99922b 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -170,11 +170,10 @@ const RegionInfo regions[] = { */ RDEF(KZ_433, 433.075f, 434.775f, 100, 0, 10, true, false, false), RDEF(KZ_863, 863.0f, 868.0f, 100, 0, 30, true, false, true), - /* Nepal - 865 MHz to 868 MHz frequency band for IoT (Internet of Things), M2M (Machine-to-Machine), and smart metering use, specifically in non-cellular mode. - https://www.nta.gov.np/uploads/contents/Radio-Frequency-Policy-2080-English.pdf + 865 MHz to 868 MHz frequency band for IoT (Internet of Things), M2M (Machine-to-Machine), and smart metering use, + specifically in non-cellular mode. https://www.nta.gov.np/uploads/contents/Radio-Frequency-Policy-2080-English.pdf */ RDEF(NP_865, 865.0f, 868.0f, 100, 0, 30, true, false, false), @@ -336,8 +335,9 @@ uint32_t RadioInterface::getTxDelayMsecWeighted(float snr) void printPacket(const char *prefix, const meshtastic_MeshPacket *p) { #if defined(DEBUG_PORT) && !defined(DEBUG_MUTE) - std::string out = DEBUG_PORT.mt_sprintf("%s (id=0x%08x fr=0x%08x to=0x%08x, WantAck=%d, HopLim=%d Ch=0x%x", prefix, p->id, - p->from, p->to, p->want_ack, p->hop_limit, p->channel); + std::string out = + DEBUG_PORT.mt_sprintf("%s (id=0x%08x fr=0x%08x to=0x%08x, transport = %u, WantAck=%d, HopLim=%d Ch=0x%x", prefix, p->id, + p->from, p->to, p->transport_mechanism, p->want_ack, p->hop_limit, p->channel); if (p->which_payload_variant == meshtastic_MeshPacket_decoded_tag) { auto &s = p->decoded; diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index 48205cc0f..e090bd539 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -66,6 +66,7 @@ int32_t Router::runOnce() { meshtastic_MeshPacket *mp; while ((mp = fromRadioQueue.dequeuePtr(0)) != NULL) { + mp->transport_mechanism = meshtastic_MeshPacket_TransportMechanism_TRANSPORT_LORA; // printPacket("handle fromRadioQ", mp); perhapsHandleReceived(mp); } diff --git a/src/mesh/api/PacketAPI.cpp b/src/mesh/api/PacketAPI.cpp index 1d6df855f..ab380d696 100644 --- a/src/mesh/api/PacketAPI.cpp +++ b/src/mesh/api/PacketAPI.cpp @@ -59,6 +59,7 @@ bool PacketAPI::receivePacket(void) switch (mr->which_payload_variant) { case meshtastic_ToRadio_packet_tag: { meshtastic_MeshPacket *mp = &mr->packet; + mp->transport_mechanism = meshtastic_MeshPacket_TransportMechanism_TRANSPORT_API; printPacket("PACKET FROM QUEUE", mp); service->handleToRadio(*mp); break; diff --git a/src/mesh/udp/UdpMulticastHandler.h b/src/mesh/udp/UdpMulticastHandler.h index d4e0eaa8c..9650668a8 100644 --- a/src/mesh/udp/UdpMulticastHandler.h +++ b/src/mesh/udp/UdpMulticastHandler.h @@ -50,6 +50,7 @@ class UdpMulticastHandler final LOG_DEBUG("UDP broadcast from: %s, len=%u", packet.remoteIP().toString().c_str(), packetLength); #endif meshtastic_MeshPacket mp; + mp.transport_mechanism = meshtastic_MeshPacket_TransportMechanism_TRANSPORT_MULTICAST_UDP; LOG_DEBUG("Decoding MeshPacket from UDP len=%u", packetLength); bool isPacketDecoded = pb_decode_from_bytes(packet.data(), packetLength, &meshtastic_MeshPacket_msg, &mp); if (isPacketDecoded && router && mp.which_payload_variant == meshtastic_MeshPacket_encrypted_tag) { @@ -78,6 +79,9 @@ class UdpMulticastHandler final return false; } #endif + if (mp->transport_mechanism == meshtastic_MeshPacket_TransportMechanism_TRANSPORT_MULTICAST_UDP) { + LOG_ERROR("Attempt to send UDP sourced packet over UDP"); + } LOG_DEBUG("Broadcasting packet over UDP (id=%u)", mp->id); uint8_t buffer[meshtastic_MeshPacket_size]; size_t encodedLength = pb_encode_to_bytes(buffer, sizeof(buffer), &meshtastic_MeshPacket_msg, mp); diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index 21d4a8fa0..d94aeff95 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -95,6 +95,7 @@ inline void onReceiveProto(char *topic, byte *payload, size_t length) p->hop_start = e.packet->hop_start; p->want_ack = e.packet->want_ack; p->via_mqtt = true; // Mark that the packet was received via MQTT + p->transport_mechanism = meshtastic_MeshPacket_TransportMechanism_TRANSPORT_MQTT; p->which_payload_variant = e.packet->which_payload_variant; memcpy(&p->decoded, &e.packet->decoded, std::max(sizeof(p->decoded), sizeof(p->encrypted))); From 05f15189513df6355a86d7fa9b80dea6446b5bcc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 21:47:21 -0500 Subject: [PATCH 111/180] chore(deps): update actions/download-artifact action to v5 (#7559) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/main_matrix.yml | 14 +++++++------- .github/workflows/package_obs.yml | 2 +- .github/workflows/package_ppa.yml | 2 +- .github/workflows/test_native.yml | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 371b71fbe..ed14907dc 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -293,7 +293,7 @@ jobs: ref: ${{github.event.pull_request.head.ref}} repository: ${{github.event.pull_request.head.repo.full_name}} - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v5 with: path: ./ pattern: firmware-${{matrix.arch}}-* @@ -322,7 +322,7 @@ jobs: ./Meshtastic_nRF52_factory_erase*.uf2 retention-days: 30 - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v5 with: name: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }} merge-multiple: true @@ -386,14 +386,14 @@ jobs: Autogenerated by github action, developer should edit as required before publishing... - name: Download source deb - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: pattern: firmware-debian-${{ needs.version.outputs.deb }}~UNRELEASED-src merge-multiple: true path: ./output/debian-src - name: Download `native-tft` pio deps - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: pattern: platformio-deps-native-tft-${{ needs.version.outputs.long }} merge-multiple: true @@ -443,7 +443,7 @@ jobs: with: python-version: 3.x - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v5 with: pattern: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }} merge-multiple: true @@ -460,7 +460,7 @@ jobs: - name: Zip firmware run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip ./output - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v5 with: name: debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip merge-multiple: true @@ -498,7 +498,7 @@ jobs: with: python-version: 3.x - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v5 with: pattern: firmware-{${{ env.targets }}}-${{ needs.version.outputs.long }} merge-multiple: true diff --git a/.github/workflows/package_obs.yml b/.github/workflows/package_obs.yml index 60170fba2..4c547eadc 100644 --- a/.github/workflows/package_obs.yml +++ b/.github/workflows/package_obs.yml @@ -58,7 +58,7 @@ jobs: id: version - name: Download artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: name: firmware-debian-${{ steps.version.outputs.deb }}~${{ inputs.series }}-src merge-multiple: true diff --git a/.github/workflows/package_ppa.yml b/.github/workflows/package_ppa.yml index 69a22cba4..aece730a0 100644 --- a/.github/workflows/package_ppa.yml +++ b/.github/workflows/package_ppa.yml @@ -60,7 +60,7 @@ jobs: id: version - name: Download artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: name: firmware-debian-${{ steps.version.outputs.deb }}~${{ inputs.series }}-src merge-multiple: true diff --git a/.github/workflows/test_native.yml b/.github/workflows/test_native.yml index 11eff00ea..6b788f4c7 100644 --- a/.github/workflows/test_native.yml +++ b/.github/workflows/test_native.yml @@ -137,7 +137,7 @@ jobs: id: version - name: Download test artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: name: platformio-test-report-${{ steps.version.outputs.long }}.zip merge-multiple: true @@ -150,7 +150,7 @@ jobs: reporter: java-junit - name: Download coverage artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: pattern: lcov-coverage-info-native-*-${{ steps.version.outputs.long }}.zip path: code-coverage-report From 9b8149f14e58c6eac2b2cea6bf1bd838cba4d437 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 12 Aug 2025 15:22:37 +0300 Subject: [PATCH 112/180] Adding medium and large RU fonts. Fixing RU string width calculation (#7498) * Adding medium and large RU fonts. Fixing string width calculation for RU font * Update src/graphics/draw/MessageRenderer.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Ben Meadors Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/graphics/ScreenFonts.h | 8 + src/graphics/draw/MessageRenderer.cpp | 23 +- src/graphics/fonts/OLEDDisplayFontsRU.cpp | 1339 +++++++++++++++++++++ src/graphics/fonts/OLEDDisplayFontsRU.h | 2 + 4 files changed, 1368 insertions(+), 4 deletions(-) diff --git a/src/graphics/ScreenFonts.h b/src/graphics/ScreenFonts.h index 3373a47a7..92bdb7641 100644 --- a/src/graphics/ScreenFonts.h +++ b/src/graphics/ScreenFonts.h @@ -40,6 +40,9 @@ #ifdef OLED_PL #define FONT_MEDIUM_LOCAL ArialMT_Plain_16_PL // Height: 19 #else +#ifdef OLED_RU +#define FONT_MEDIUM_LOCAL ArialMT_Plain_16_RU // Height: 19 +#else #ifdef OLED_UA #define FONT_MEDIUM_LOCAL ArialMT_Plain_16_UA // Height: 19 #else @@ -50,9 +53,13 @@ #endif #endif #endif +#endif #ifdef OLED_PL #define FONT_LARGE_LOCAL ArialMT_Plain_24_PL // Height: 28 #else +#ifdef OLED_RU +#define FONT_LARGE_LOCAL ArialMT_Plain_24_RU // Height: 28 +#else #ifdef OLED_UA #define FONT_LARGE_LOCAL ArialMT_Plain_24_UA // Height: 28 #else @@ -63,6 +70,7 @@ #endif #endif #endif +#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)) && \ diff --git a/src/graphics/draw/MessageRenderer.cpp b/src/graphics/draw/MessageRenderer.cpp index 524f88f9b..117829167 100644 --- a/src/graphics/draw/MessageRenderer.cpp +++ b/src/graphics/draw/MessageRenderer.cpp @@ -137,7 +137,11 @@ void drawStringWithEmotes(OLEDDisplay *display, int x, int y, const std::string display->drawString(cursorX + 1, fontY, textChunk.c_str()); } display->drawString(cursorX, fontY, textChunk.c_str()); +#if defined(OLED_UA) || defined(OLED_RU) + cursorX += display->getStringWidth(textChunk.c_str(), textChunk.length(), true); +#else cursorX += display->getStringWidth(textChunk.c_str()); +#endif i = nextControl; continue; } @@ -155,7 +159,12 @@ void drawStringWithEmotes(OLEDDisplay *display, int x, int y, const std::string display->drawString(cursorX + 1, fontY, remaining.c_str()); } display->drawString(cursorX, fontY, remaining.c_str()); +#if defined(OLED_UA) || defined(OLED_RU) + cursorX += display->getStringWidth(remaining.c_str(), remaining.length(), true); +#else cursorX += display->getStringWidth(remaining.c_str()); +#endif + break; } } @@ -374,10 +383,16 @@ std::vector generateLines(OLEDDisplay *display, const char *headerS } else { word += ch; std::string test = line + word; - // Keep these lines for diagnostics - // LOG_INFO("Char: '%c' (0x%02X)", ch, (unsigned char)ch); - // LOG_INFO("Current String: %s", test.c_str()); - if (display->getStringWidth(test.c_str()) > textWidth) { +// Keep these lines for diagnostics +// LOG_INFO("Char: '%c' (0x%02X)", ch, (unsigned char)ch); +// LOG_INFO("Current String: %s", test.c_str()); +// Note: there are boolean comparison uint16 (getStringWidth) with int (textWidth), hope textWidth is always positive :) +#if defined(OLED_UA) || defined(OLED_RU) + uint16_t strWidth = display->getStringWidth(test.c_str(), test.length(), true); +#else + uint16_t strWidth = display->getStringWidth(test.c_str()); +#endif + if (strWidth > textWidth) { if (!line.empty()) lines.push_back(line); line = word; diff --git a/src/graphics/fonts/OLEDDisplayFontsRU.cpp b/src/graphics/fonts/OLEDDisplayFontsRU.cpp index fa055d8b5..2b85727c2 100644 --- a/src/graphics/fonts/OLEDDisplayFontsRU.cpp +++ b/src/graphics/fonts/OLEDDisplayFontsRU.cpp @@ -423,4 +423,1343 @@ const uint8_t ArialMT_Plain_10_RU[] PROGMEM = { 0x00, 0x00, 0x40, 0x01, 0x20, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0xC0, 0x01, // 253 0x00, 0x00, 0xE0, 0x03, 0x80, 0x00, 0xC0, 0x01, 0x20, 0x02, 0xC0, 0x01, // 254 0x00, 0x00, 0x40, 0x02, 0xA0, 0x01, 0xA0, 0x00, 0xA0, 0x00, 0xE0, 0x03, // 255 +}; + +// Font generated or edited with the glyphEditor (@mrekin) +const uint8_t ArialMT_Plain_16_RU[] PROGMEM = { + 0x10, // Width: 16 + 0x13, // Height: 19 + 0x20, // First char: 32 + 0xE0, // Number of chars: 224 + // Jump Table: + 0xFF, 0xFF, 0x00, 0x04, // 32 + 0x00, 0x00, 0x08, 0x05, // 33 + 0x00, 0x08, 0x0D, 0x06, // 34 + 0x00, 0x15, 0x1A, 0x09, // 35 + 0x00, 0x2F, 0x17, 0x09, // 36 + 0x00, 0x46, 0x26, 0x0E, // 37 + 0x00, 0x6C, 0x1D, 0x0B, // 38 + 0x00, 0x89, 0x04, 0x03, // 39 + 0x00, 0x8D, 0x0C, 0x05, // 40 + 0x00, 0x99, 0x0B, 0x05, // 41 + 0x00, 0xA4, 0x0D, 0x06, // 42 + 0x00, 0xB1, 0x17, 0x09, // 43 + 0x00, 0xC8, 0x09, 0x04, // 44 + 0x00, 0xD1, 0x0B, 0x05, // 45 + 0x00, 0xDC, 0x08, 0x04, // 46 + 0x00, 0xE4, 0x0A, 0x04, // 47 + 0x00, 0xEE, 0x17, 0x09, // 48 + 0x01, 0x05, 0x11, 0x09, // 49 + 0x01, 0x16, 0x17, 0x09, // 50 + 0x01, 0x2D, 0x17, 0x09, // 51 + 0x01, 0x44, 0x17, 0x09, // 52 + 0x01, 0x5B, 0x17, 0x09, // 53 + 0x01, 0x72, 0x17, 0x09, // 54 + 0x01, 0x89, 0x16, 0x09, // 55 + 0x01, 0x9F, 0x17, 0x09, // 56 + 0x01, 0xB6, 0x17, 0x09, // 57 + 0x01, 0xCD, 0x05, 0x04, // 58 + 0x01, 0xD2, 0x06, 0x04, // 59 + 0x01, 0xD8, 0x17, 0x09, // 60 + 0x01, 0xEF, 0x17, 0x09, // 61 + 0x02, 0x06, 0x17, 0x09, // 62 + 0x02, 0x1D, 0x16, 0x09, // 63 + 0x02, 0x33, 0x2F, 0x10, // 64 + 0x02, 0x62, 0x1D, 0x0B, // 65 + 0x02, 0x7F, 0x1D, 0x0B, // 66 + 0x02, 0x9C, 0x20, 0x0C, // 67 + 0x02, 0xBC, 0x20, 0x0C, // 68 + 0x02, 0xDC, 0x1D, 0x0B, // 69 + 0x02, 0xF9, 0x19, 0x0A, // 70 + 0x03, 0x12, 0x20, 0x0C, // 71 + 0x03, 0x32, 0x1D, 0x0B, // 72 + 0x03, 0x4F, 0x05, 0x03, // 73 + 0x03, 0x54, 0x14, 0x08, // 74 + 0x03, 0x68, 0x1D, 0x0B, // 75 + 0x03, 0x85, 0x17, 0x09, // 76 + 0x03, 0x9C, 0x23, 0x0D, // 77 + 0x03, 0xBF, 0x1D, 0x0B, // 78 + 0x03, 0xDC, 0x20, 0x0C, // 79 + 0x03, 0xFC, 0x1C, 0x0B, // 80 + 0x04, 0x18, 0x20, 0x0C, // 81 + 0x04, 0x38, 0x1D, 0x0B, // 82 + 0x04, 0x55, 0x1D, 0x0B, // 83 + 0x04, 0x72, 0x19, 0x09, // 84 + 0x04, 0x8B, 0x1D, 0x0B, // 85 + 0x04, 0xA8, 0x1C, 0x0B, // 86 + 0x04, 0xC4, 0x2B, 0x0F, // 87 + 0x04, 0xEF, 0x20, 0x0B, // 88 + 0x05, 0x0F, 0x19, 0x09, // 89 + 0x05, 0x28, 0x1A, 0x09, // 90 + 0x05, 0x42, 0x0C, 0x04, // 91 + 0x05, 0x4E, 0x0B, 0x04, // 92 + 0x05, 0x59, 0x09, 0x04, // 93 + 0x05, 0x62, 0x14, 0x07, // 94 + 0x05, 0x76, 0x1B, 0x09, // 95 + 0x05, 0x91, 0x07, 0x05, // 96 + 0x05, 0x98, 0x17, 0x09, // 97 + 0x05, 0xAF, 0x17, 0x09, // 98 + 0x05, 0xC6, 0x14, 0x08, // 99 + 0x05, 0xDA, 0x17, 0x09, // 100 + 0x05, 0xF1, 0x17, 0x09, // 101 + 0x06, 0x08, 0x0A, 0x04, // 102 + 0x06, 0x12, 0x17, 0x09, // 103 + 0x06, 0x29, 0x14, 0x08, // 104 + 0x06, 0x3D, 0x05, 0x04, // 105 + 0x06, 0x42, 0x06, 0x03, // 106 + 0x06, 0x48, 0x17, 0x08, // 107 + 0x06, 0x5F, 0x05, 0x03, // 108 + 0x06, 0x64, 0x23, 0x0D, // 109 + 0x06, 0x87, 0x14, 0x08, // 110 + 0x06, 0x9B, 0x17, 0x09, // 111 + 0x06, 0xB2, 0x17, 0x09, // 112 + 0x06, 0xC9, 0x18, 0x09, // 113 + 0x06, 0xE1, 0x0D, 0x05, // 114 + 0x06, 0xEE, 0x14, 0x08, // 115 + 0x07, 0x02, 0x0B, 0x04, // 116 + 0x07, 0x0D, 0x14, 0x08, // 117 + 0x07, 0x21, 0x13, 0x07, // 118 + 0x07, 0x34, 0x1F, 0x0B, // 119 + 0x07, 0x53, 0x14, 0x07, // 120 + 0x07, 0x67, 0x13, 0x07, // 121 + 0x07, 0x7A, 0x14, 0x07, // 122 + 0x07, 0x8E, 0x0F, 0x05, // 123 + 0x07, 0x9D, 0x06, 0x03, // 124 + 0x07, 0xA3, 0x0E, 0x05, // 125 + 0x07, 0xB1, 0x17, 0x09, // 126 + 0xFF, 0xFF, 0x00, 0x10, // 127 + 0xFF, 0xFF, 0x00, 0x10, // 128 + 0xFF, 0xFF, 0x00, 0x10, // 129 + 0xFF, 0xFF, 0x00, 0x10, // 130 + 0xFF, 0xFF, 0x00, 0x10, // 131 + 0xFF, 0xFF, 0x00, 0x10, // 132 + 0xFF, 0xFF, 0x00, 0x10, // 133 + 0xFF, 0xFF, 0x00, 0x10, // 134 + 0xFF, 0xFF, 0x00, 0x10, // 135 + 0xFF, 0xFF, 0x00, 0x10, // 136 + 0xFF, 0xFF, 0x00, 0x10, // 137 + 0xFF, 0xFF, 0x00, 0x10, // 138 + 0xFF, 0xFF, 0x00, 0x10, // 139 + 0xFF, 0xFF, 0x00, 0x10, // 140 + 0xFF, 0xFF, 0x00, 0x10, // 141 + 0xFF, 0xFF, 0x00, 0x10, // 142 + 0xFF, 0xFF, 0x00, 0x10, // 143 + 0xFF, 0xFF, 0x00, 0x10, // 144 + 0xFF, 0xFF, 0x00, 0x10, // 145 + 0xFF, 0xFF, 0x00, 0x10, // 146 + 0xFF, 0xFF, 0x00, 0x10, // 147 + 0xFF, 0xFF, 0x00, 0x10, // 148 + 0xFF, 0xFF, 0x00, 0x10, // 149 + 0xFF, 0xFF, 0x00, 0x10, // 150 + 0xFF, 0xFF, 0x00, 0x10, // 151 + 0xFF, 0xFF, 0x00, 0x10, // 152 + 0xFF, 0xFF, 0x00, 0x10, // 153 + 0xFF, 0xFF, 0x00, 0x10, // 154 + 0xFF, 0xFF, 0x00, 0x10, // 155 + 0xFF, 0xFF, 0x00, 0x10, // 156 + 0xFF, 0xFF, 0x00, 0x10, // 157 + 0xFF, 0xFF, 0x00, 0x10, // 158 + 0xFF, 0xFF, 0x00, 0x10, // 159 + 0xFF, 0xFF, 0x00, 0x10, // 160 + 0x07, 0xC8, 0x09, 0x05, // 161 + 0x07, 0xD1, 0x17, 0x09, // 162 + 0x07, 0xE8, 0x17, 0x09, // 163 + 0x07, 0xFF, 0x14, 0x09, // 164 + 0x08, 0x13, 0x1A, 0x09, // 165 + 0x08, 0x2D, 0x06, 0x03, // 166 + 0x08, 0x33, 0x17, 0x09, // 167 + 0x08, 0x4A, 0x1D, 0x0B, // 168 + 0x08, 0x67, 0x23, 0x0C, // 169 + 0x08, 0x8A, 0x0E, 0x05, // 170 + 0x08, 0x98, 0x14, 0x09, // 171 + 0x08, 0xAC, 0x17, 0x09, // 172 + 0x08, 0xC3, 0x0B, 0x05, // 173 + 0x08, 0xCE, 0x23, 0x0C, // 174 + 0x08, 0xF1, 0x19, 0x09, // 175 + 0x09, 0x0A, 0x0D, 0x06, // 176 + 0x09, 0x17, 0x17, 0x09, // 177 + 0x09, 0x2E, 0x0E, 0x05, // 178 + 0x09, 0x3C, 0x0D, 0x05, // 179 + 0x09, 0x49, 0x0A, 0x05, // 180 + 0x09, 0x53, 0x17, 0x09, // 181 + 0x09, 0x6A, 0x19, 0x09, // 182 + 0x09, 0x83, 0x08, 0x05, // 183 + 0x09, 0x8B, 0x17, 0x09, // 184 + 0x09, 0xA2, 0x0B, 0x05, // 185 + 0x09, 0xAD, 0x0D, 0x05, // 186 + 0x09, 0xBA, 0x17, 0x09, // 187 + 0x09, 0xD1, 0x26, 0x0D, // 188 + 0x09, 0xF7, 0x26, 0x0D, // 189 + 0x0A, 0x1D, 0x26, 0x0D, // 190 + 0x0A, 0x43, 0x1B, 0x0C, // 191 + 0x0A, 0x5E, 0x1D, 0x0B, // 192 + 0x0A, 0x7B, 0x1A, 0x0B, // 193 + 0x0A, 0x95, 0x1D, 0x0B, // 194 + 0x0A, 0xB2, 0x19, 0x09, // 195 + 0x0A, 0xCB, 0x1E, 0x0B, // 196 + 0x0A, 0xE9, 0x1D, 0x0B, // 197 + 0x0B, 0x06, 0x2C, 0x0F, // 198 + 0x0B, 0x32, 0x1A, 0x0A, // 199 + 0x0B, 0x4C, 0x20, 0x0C, // 200 + 0x0B, 0x6C, 0x20, 0x0C, // 201 + 0x0B, 0x8C, 0x1A, 0x09, // 202 + 0x0B, 0xA6, 0x1A, 0x0B, // 203 + 0x0B, 0xC0, 0x23, 0x0D, // 204 + 0x0B, 0xE3, 0x1D, 0x0B, // 205 + 0x0C, 0x00, 0x20, 0x0C, // 206 + 0x0C, 0x20, 0x1D, 0x0C, // 207 + 0x0C, 0x3D, 0x1C, 0x0B, // 208 + 0x0C, 0x59, 0x20, 0x0C, // 209 + 0x0C, 0x79, 0x19, 0x09, // 210 + 0x0C, 0x92, 0x1C, 0x0A, // 211 + 0x0C, 0xAE, 0x23, 0x0D, // 212 + 0x0C, 0xD1, 0x20, 0x0B, // 213 + 0x0C, 0xF1, 0x21, 0x0C, // 214 + 0x0D, 0x12, 0x1A, 0x0B, // 215 + 0x0D, 0x2C, 0x26, 0x0F, // 216 + 0x0D, 0x52, 0x2A, 0x0F, // 217 + 0x0D, 0x7C, 0x23, 0x0D, // 218 + 0x0D, 0x9F, 0x23, 0x0E, // 219 + 0x0D, 0xC2, 0x1A, 0x0A, // 220 + 0x0D, 0xDC, 0x1D, 0x0C, // 221 + 0x0D, 0xF9, 0x2C, 0x10, // 222 + 0x0E, 0x25, 0x20, 0x0C, // 223 + 0x0E, 0x45, 0x17, 0x09, // 224 + 0x0E, 0x5C, 0x1A, 0x09, // 225 + 0x0E, 0x76, 0x14, 0x09, // 226 + 0x0E, 0x8A, 0x10, 0x06, // 227 + 0x0E, 0x9A, 0x1B, 0x09, // 228 + 0x0E, 0xB5, 0x17, 0x09, // 229 + 0x0E, 0xCC, 0x20, 0x0B, // 230 + 0x0E, 0xEC, 0x11, 0x07, // 231 + 0x0E, 0xFD, 0x17, 0x09, // 232 + 0x0F, 0x14, 0x17, 0x09, // 233 + 0x0F, 0x2B, 0x14, 0x07, // 234 + 0x0F, 0x3F, 0x17, 0x09, // 235 + 0x0F, 0x56, 0x1D, 0x0B, // 236 + 0x0F, 0x73, 0x17, 0x09, // 237 + 0x0F, 0x8A, 0x17, 0x09, // 238 + 0x0F, 0xA1, 0x17, 0x09, // 239 + 0x0F, 0xB8, 0x17, 0x09, // 240 + 0x0F, 0xCF, 0x14, 0x08, // 241 + 0x0F, 0xE3, 0x13, 0x07, // 242 + 0x0F, 0xF6, 0x13, 0x07, // 243 + 0x10, 0x09, 0x23, 0x0D, // 244 + 0x10, 0x2C, 0x17, 0x09, // 245 + 0x10, 0x43, 0x1A, 0x0A, // 246 + 0x10, 0x5D, 0x14, 0x08, // 247 + 0x10, 0x71, 0x23, 0x0D, // 248 + 0x10, 0x94, 0x23, 0x0D, // 249 + 0x10, 0xB7, 0x1A, 0x0A, // 250 + 0x10, 0xD1, 0x1D, 0x0C, // 251 + 0x10, 0xEE, 0x17, 0x09, // 252 + 0x11, 0x05, 0x14, 0x08, // 253 + 0x11, 0x19, 0x20, 0x0C, // 254 + 0x11, 0x39, 0x17, 0x09, // 255 + // Font Data: + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x5F, // 33 + 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, // 34 + 0x80, 0x08, 0x00, 0x80, 0x78, 0x00, 0xC0, 0x0F, 0x00, 0xB8, 0x08, 0x00, 0x80, 0x08, 0x00, 0x80, 0x78, 0x00, 0xC0, 0x0F, 0x00, + 0xB8, 0x08, 0x00, 0x80, 0x08, // 35 + 0x00, 0x00, 0x00, 0xE0, 0x10, 0x00, 0x10, 0x21, 0x00, 0x08, 0x41, 0x00, 0xFC, 0xFF, 0x00, 0x08, 0x42, 0x00, 0x08, 0x22, 0x00, + 0x30, 0x1C, // 36 + 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x08, 0x01, 0x00, 0x08, 0x01, 0x00, 0x08, 0x61, 0x00, 0xF0, 0x18, 0x00, 0x00, 0x06, 0x00, + 0xC0, 0x01, 0x00, 0x30, 0x3C, 0x00, 0x08, 0x42, 0x00, 0x00, 0x42, 0x00, 0x00, 0x42, 0x00, 0x00, 0x3C, // 37 + 0x00, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x70, 0x22, 0x00, 0x88, 0x41, 0x00, 0x08, 0x43, 0x00, 0x88, 0x44, 0x00, 0x70, 0x28, 0x00, + 0x00, 0x10, 0x00, 0x00, 0x28, 0x00, 0x00, 0x44, // 38 + 0x00, 0x00, 0x00, 0x78, // 39 + 0x00, 0x00, 0x00, 0x80, 0x3F, 0x00, 0x70, 0xC0, 0x01, 0x08, 0x00, 0x02, // 40 + 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x70, 0xC0, 0x01, 0x80, 0x3F, // 41 + 0x10, 0x00, 0x00, 0xD0, 0x00, 0x00, 0x38, 0x00, 0x00, 0xD0, 0x00, 0x00, 0x10, // 42 + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0xC0, 0x1F, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x02, // 43 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x01, // 44 + 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, // 45 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, // 46 + 0x00, 0x60, 0x00, 0x00, 0x1E, 0x00, 0xE0, 0x01, 0x00, 0x18, // 47 + 0x00, 0x00, 0x00, 0xE0, 0x1F, 0x00, 0x10, 0x20, 0x00, 0x08, 0x40, 0x00, 0x08, 0x40, 0x00, 0x08, 0x40, 0x00, 0x10, 0x20, 0x00, + 0xE0, 0x1F, // 48 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x20, 0x00, 0x00, 0x10, 0x00, 0x00, 0xF8, 0x7F, // 49 + 0x00, 0x00, 0x00, 0x20, 0x40, 0x00, 0x10, 0x60, 0x00, 0x08, 0x50, 0x00, 0x08, 0x48, 0x00, 0x08, 0x44, 0x00, 0x18, 0x43, 0x00, + 0xE0, 0x40, // 50 + 0x00, 0x00, 0x00, 0x20, 0x30, 0x00, 0x10, 0x20, 0x00, 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, 0x88, 0x41, 0x00, 0xF0, 0x22, 0x00, + 0x00, 0x1C, // 51 + 0x00, 0x0C, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x09, 0x00, 0xC0, 0x08, 0x00, 0x20, 0x08, 0x00, 0x10, 0x08, 0x00, 0xF8, 0x7F, 0x00, + 0x00, 0x08, // 52 + 0x00, 0x00, 0x00, 0xC0, 0x11, 0x00, 0xB8, 0x20, 0x00, 0x88, 0x40, 0x00, 0x88, 0x40, 0x00, 0x88, 0x40, 0x00, 0x08, 0x21, 0x00, + 0x08, 0x1E, // 53 + 0x00, 0x00, 0x00, 0xE0, 0x1F, 0x00, 0x10, 0x21, 0x00, 0x88, 0x40, 0x00, 0x88, 0x40, 0x00, 0x88, 0x40, 0x00, 0x10, 0x21, 0x00, + 0x20, 0x1E, // 54 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x78, 0x00, 0x88, 0x07, 0x00, 0x68, 0x00, 0x00, + 0x18, // 55 + 0x00, 0x00, 0x00, 0x60, 0x1C, 0x00, 0x90, 0x22, 0x00, 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, 0x90, 0x22, 0x00, + 0x60, 0x1C, // 56 + 0x00, 0x00, 0x00, 0xE0, 0x11, 0x00, 0x10, 0x22, 0x00, 0x08, 0x44, 0x00, 0x08, 0x44, 0x00, 0x08, 0x44, 0x00, 0x10, 0x22, 0x00, + 0xE0, 0x1F, // 57 + 0x00, 0x00, 0x00, 0x40, 0x40, // 58 + 0x00, 0x00, 0x00, 0x40, 0xC0, 0x01, // 59 + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x05, 0x00, 0x00, 0x05, 0x00, 0x80, 0x08, 0x00, 0x80, 0x08, 0x00, 0x80, 0x08, 0x00, + 0x40, 0x10, // 60 + 0x00, 0x00, 0x00, 0x80, 0x08, 0x00, 0x80, 0x08, 0x00, 0x80, 0x08, 0x00, 0x80, 0x08, 0x00, 0x80, 0x08, 0x00, 0x80, 0x08, 0x00, + 0x80, 0x08, // 61 + 0x00, 0x00, 0x00, 0x40, 0x10, 0x00, 0x80, 0x08, 0x00, 0x80, 0x08, 0x00, 0x80, 0x08, 0x00, 0x00, 0x05, 0x00, 0x00, 0x05, 0x00, + 0x00, 0x02, // 62 + 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x10, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x5C, 0x00, 0x08, 0x02, 0x00, 0x10, 0x01, 0x00, + 0xE0, // 63 + 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0xC0, 0x40, 0x00, 0x20, 0x80, 0x00, 0x10, 0x1E, 0x01, 0x10, 0x21, 0x01, 0x88, 0x40, 0x02, + 0x48, 0x40, 0x02, 0x48, 0x40, 0x02, 0x48, 0x20, 0x02, 0x88, 0x7C, 0x02, 0xC8, 0x43, 0x02, 0x10, 0x40, 0x02, 0x10, 0x20, 0x01, + 0x60, 0x10, 0x01, 0x80, 0x8F, // 64 + 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x1C, 0x00, 0x80, 0x07, 0x00, 0x70, 0x04, 0x00, 0x08, 0x04, 0x00, 0x70, 0x04, 0x00, + 0x80, 0x07, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x60, // 65 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, + 0x08, 0x41, 0x00, 0x90, 0x22, 0x00, 0x60, 0x1C, // 66 + 0x00, 0x00, 0x00, 0xC0, 0x0F, 0x00, 0x20, 0x10, 0x00, 0x10, 0x20, 0x00, 0x08, 0x40, 0x00, 0x08, 0x40, 0x00, 0x08, 0x40, 0x00, + 0x08, 0x40, 0x00, 0x08, 0x40, 0x00, 0x10, 0x20, 0x00, 0x20, 0x10, // 67 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x08, 0x40, 0x00, 0x08, 0x40, 0x00, 0x08, 0x40, 0x00, 0x08, 0x40, 0x00, 0x08, 0x40, 0x00, + 0x08, 0x40, 0x00, 0x10, 0x20, 0x00, 0x20, 0x10, 0x00, 0xC0, 0x0F, // 68 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, + 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, 0x08, 0x40, // 69 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x08, 0x02, 0x00, 0x08, 0x02, 0x00, 0x08, 0x02, 0x00, 0x08, 0x02, 0x00, 0x08, 0x02, 0x00, + 0x08, 0x02, 0x00, 0x08, // 70 + 0x00, 0x00, 0x00, 0xC0, 0x0F, 0x00, 0x20, 0x10, 0x00, 0x10, 0x20, 0x00, 0x08, 0x40, 0x00, 0x08, 0x40, 0x00, 0x08, 0x42, 0x00, + 0x08, 0x42, 0x00, 0x10, 0x22, 0x00, 0x20, 0x12, 0x00, 0x00, 0x0E, // 71 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0xF8, 0x7F, // 72 + 0x00, 0x00, 0x00, 0xF8, 0x7F, // 73 + 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0xF8, 0x3F, // 74 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x00, 0x80, 0x03, 0x00, 0x40, 0x04, 0x00, + 0x20, 0x18, 0x00, 0x10, 0x20, 0x00, 0x08, 0x40, // 75 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, + 0x00, 0x40, // 76 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x30, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x60, 0x00, + 0x00, 0x1C, 0x00, 0x00, 0x03, 0x00, 0xC0, 0x00, 0x00, 0x30, 0x00, 0x00, 0xF8, 0x7F, // 77 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x10, 0x00, 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x00, + 0x00, 0x18, 0x00, 0x00, 0x20, 0x00, 0xF8, 0x7F, // 78 + 0x00, 0x00, 0x00, 0xC0, 0x0F, 0x00, 0x20, 0x10, 0x00, 0x10, 0x20, 0x00, 0x08, 0x40, 0x00, 0x08, 0x40, 0x00, 0x08, 0x40, 0x00, + 0x08, 0x40, 0x00, 0x10, 0x20, 0x00, 0x20, 0x10, 0x00, 0xC0, 0x0F, // 79 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x08, 0x02, 0x00, 0x08, 0x02, 0x00, 0x08, 0x02, 0x00, 0x08, 0x02, 0x00, 0x08, 0x02, 0x00, + 0x08, 0x02, 0x00, 0x10, 0x01, 0x00, 0xE0, // 80 + 0x00, 0x00, 0x00, 0xC0, 0x0F, 0x00, 0x20, 0x10, 0x00, 0x10, 0x20, 0x00, 0x08, 0x40, 0x00, 0x08, 0x40, 0x00, 0x08, 0x50, 0x00, + 0x08, 0x50, 0x00, 0x10, 0x20, 0x00, 0x20, 0x70, 0x00, 0xC0, 0x5F, // 81 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x08, 0x02, 0x00, 0x08, 0x02, 0x00, 0x08, 0x02, 0x00, 0x08, 0x02, 0x00, 0x08, 0x06, 0x00, + 0x08, 0x1A, 0x00, 0x10, 0x21, 0x00, 0xE0, 0x40, // 82 + 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x90, 0x20, 0x00, 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, 0x08, 0x42, 0x00, + 0x08, 0x42, 0x00, 0x10, 0x22, 0x00, 0x20, 0x1C, // 83 + 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x08, // 84 + 0x00, 0x00, 0x00, 0xF8, 0x1F, 0x00, 0x00, 0x20, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, + 0x00, 0x40, 0x00, 0x00, 0x20, 0x00, 0xF8, 0x1F, // 85 + 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x18, 0x00, 0x00, 0x60, 0x00, 0x00, 0x18, 0x00, + 0x00, 0x07, 0x00, 0xE0, 0x00, 0x00, 0x18, // 86 + 0x18, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x60, 0x00, 0x00, 0x1C, 0x00, 0x80, 0x03, 0x00, 0x70, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x70, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x60, 0x00, 0x00, 0x1E, 0x00, 0xE0, 0x01, 0x00, + 0x18, // 87 + 0x00, 0x40, 0x00, 0x08, 0x20, 0x00, 0x10, 0x10, 0x00, 0x60, 0x0C, 0x00, 0x80, 0x02, 0x00, 0x00, 0x01, 0x00, 0x80, 0x02, 0x00, + 0x60, 0x0C, 0x00, 0x10, 0x10, 0x00, 0x08, 0x20, 0x00, 0x00, 0x40, // 88 + 0x08, 0x00, 0x00, 0x30, 0x00, 0x00, 0x40, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x7E, 0x00, 0x80, 0x01, 0x00, 0x40, 0x00, 0x00, + 0x30, 0x00, 0x00, 0x08, // 89 + 0x00, 0x40, 0x00, 0x08, 0x60, 0x00, 0x08, 0x58, 0x00, 0x08, 0x44, 0x00, 0x08, 0x43, 0x00, 0x88, 0x40, 0x00, 0x68, 0x40, 0x00, + 0x18, 0x40, 0x00, 0x08, 0x40, // 90 + 0x00, 0x00, 0x00, 0xF8, 0xFF, 0x03, 0x08, 0x00, 0x02, 0x08, 0x00, 0x02, // 91 + 0x18, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x60, // 92 + 0x08, 0x00, 0x02, 0x08, 0x00, 0x02, 0xF8, 0xFF, 0x03, // 93 + 0x00, 0x01, 0x00, 0xC0, 0x00, 0x00, 0x30, 0x00, 0x00, 0x08, 0x00, 0x00, 0x30, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x01, // 94 + 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, // 95 + 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x10, // 96 + 0x00, 0x00, 0x00, 0x00, 0x39, 0x00, 0x80, 0x44, 0x00, 0x40, 0x44, 0x00, 0x40, 0x44, 0x00, 0x40, 0x42, 0x00, 0x40, 0x22, 0x00, + 0x80, 0x7F, // 97 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x80, 0x20, 0x00, 0x40, 0x40, 0x00, 0x40, 0x40, 0x00, 0x40, 0x40, 0x00, 0x80, 0x20, 0x00, + 0x00, 0x1F, // 98 + 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x80, 0x20, 0x00, 0x40, 0x40, 0x00, 0x40, 0x40, 0x00, 0x40, 0x40, 0x00, 0x80, 0x20, // 99 + 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x80, 0x20, 0x00, 0x40, 0x40, 0x00, 0x40, 0x40, 0x00, 0x40, 0x40, 0x00, 0x80, 0x20, 0x00, + 0xF8, 0x7F, // 100 + 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x80, 0x24, 0x00, 0x40, 0x44, 0x00, 0x40, 0x44, 0x00, 0x40, 0x44, 0x00, 0x80, 0x24, 0x00, + 0x00, 0x17, // 101 + 0x40, 0x00, 0x00, 0xF0, 0x7F, 0x00, 0x48, 0x00, 0x00, 0x48, // 102 + 0x00, 0x00, 0x00, 0x00, 0x1F, 0x01, 0x80, 0x20, 0x02, 0x40, 0x40, 0x02, 0x40, 0x40, 0x02, 0x40, 0x40, 0x02, 0x80, 0x20, 0x01, + 0xC0, 0xFF, // 103 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x80, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x80, 0x7F, // 104 + 0x00, 0x00, 0x00, 0xC8, 0x7F, // 105 + 0x00, 0x00, 0x02, 0xC8, 0xFF, 0x01, // 106 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x00, 0x08, 0x00, 0x00, 0x04, 0x00, 0x00, 0x06, 0x00, 0x00, 0x19, 0x00, 0x80, 0x20, 0x00, + 0x40, 0x40, // 107 + 0x00, 0x00, 0x00, 0xF8, 0x7F, // 108 + 0x00, 0x00, 0x00, 0xC0, 0x7F, 0x00, 0x80, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x80, 0x7F, 0x00, + 0x80, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x80, 0x7F, // 109 + 0x00, 0x00, 0x00, 0xC0, 0x7F, 0x00, 0x80, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x80, 0x7F, // 110 + 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x80, 0x20, 0x00, 0x40, 0x40, 0x00, 0x40, 0x40, 0x00, 0x40, 0x40, 0x00, 0x80, 0x20, 0x00, + 0x00, 0x1F, // 111 + 0x00, 0x00, 0x00, 0xC0, 0xFF, 0x03, 0x80, 0x60, 0x00, 0x40, 0x40, 0x00, 0x40, 0x40, 0x00, 0x40, 0x40, 0x00, 0x80, 0x20, 0x00, + 0x00, 0x1F, // 112 + 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x80, 0x20, 0x00, 0x40, 0x40, 0x00, 0x40, 0x40, 0x00, 0x40, 0x40, 0x00, 0x80, 0x20, 0x00, + 0xC0, 0xFF, 0x03, // 113 + 0x00, 0x00, 0x00, 0xC0, 0x7F, 0x00, 0x80, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, // 114 + 0x00, 0x00, 0x00, 0x80, 0x23, 0x00, 0x40, 0x44, 0x00, 0x40, 0x44, 0x00, 0x40, 0x44, 0x00, 0x40, 0x44, 0x00, 0x80, 0x38, // 115 + 0x40, 0x00, 0x00, 0xF0, 0x7F, 0x00, 0x40, 0x40, 0x00, 0x40, 0x40, // 116 + 0x00, 0x00, 0x00, 0xC0, 0x3F, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x20, 0x00, 0xC0, 0x7F, // 117 + 0xC0, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x60, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x03, 0x00, 0xC0, // 118 + 0xC0, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x60, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x03, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x03, 0x00, + 0x00, 0x1C, 0x00, 0x00, 0x60, 0x00, 0x00, 0x1F, 0x00, 0xC0, // 119 + 0x40, 0x40, 0x00, 0x80, 0x20, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x04, 0x00, 0x00, 0x1B, 0x00, 0x80, 0x20, 0x00, 0x40, 0x40, // 120 + 0xC0, 0x01, 0x00, 0x00, 0x06, 0x02, 0x00, 0x38, 0x02, 0x00, 0xC0, 0x01, 0x00, 0x78, 0x00, 0x00, 0x07, 0x00, 0xC0, // 121 + 0x40, 0x40, 0x00, 0x40, 0x60, 0x00, 0x40, 0x58, 0x00, 0x40, 0x44, 0x00, 0x40, 0x43, 0x00, 0xC0, 0x40, 0x00, 0x40, 0x40, // 122 + 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0xF0, 0xFB, 0x01, 0x08, 0x00, 0x02, 0x08, 0x00, 0x02, // 123 + 0x00, 0x00, 0x00, 0xF8, 0xFF, 0x03, // 124 + 0x08, 0x00, 0x02, 0x08, 0x00, 0x02, 0xF0, 0xFB, 0x01, 0x00, 0x04, 0x00, 0x00, 0x04, // 125 + 0x00, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x01, // 126 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xFF, 0x03, // 161 + 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x80, 0x20, 0x03, 0x40, 0xF0, 0x00, 0x40, 0x4E, 0x00, 0xC0, 0x41, 0x00, 0xB8, 0x20, 0x00, + 0x00, 0x11, // 162 + 0x00, 0x41, 0x00, 0xF0, 0x31, 0x00, 0x18, 0x2F, 0x00, 0x08, 0x21, 0x00, 0x08, 0x61, 0x00, 0x08, 0x40, 0x00, 0x10, 0x40, 0x00, + 0x20, 0x20, // 163 + 0x00, 0x00, 0x00, 0x40, 0x0B, 0x00, 0x80, 0x04, 0x00, 0x40, 0x08, 0x00, 0x40, 0x08, 0x00, 0x80, 0x04, 0x00, 0x40, 0x0B, // 164 + 0x08, 0x0A, 0x00, 0x10, 0x0A, 0x00, 0x60, 0x0A, 0x00, 0x80, 0x0B, 0x00, 0x00, 0x7E, 0x00, 0x80, 0x0B, 0x00, 0x60, 0x0A, 0x00, + 0x10, 0x0A, 0x00, 0x08, 0x0A, // 165 + 0x00, 0x00, 0x00, 0xF8, 0xF1, 0x03, // 166 + 0x00, 0x86, 0x00, 0x70, 0x09, 0x01, 0xC8, 0x10, 0x02, 0x88, 0x10, 0x02, 0x08, 0x21, 0x02, 0x08, 0x61, 0x02, 0x30, 0xD2, 0x01, + 0x00, 0x0C, // 167 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x08, 0x41, 0x00, 0x09, 0x41, 0x00, 0x0A, 0x41, 0x00, 0x08, 0x41, 0x00, 0x09, 0x41, 0x00, + 0x0A, 0x41, 0x00, 0x08, 0x41, 0x00, 0x08, 0x40, // 168 + 0xC0, 0x0F, 0x00, 0x20, 0x10, 0x00, 0x10, 0x20, 0x00, 0xC8, 0x47, 0x00, 0x28, 0x48, 0x00, 0x28, 0x48, 0x00, 0x28, 0x48, 0x00, + 0x28, 0x48, 0x00, 0x48, 0x44, 0x00, 0x10, 0x20, 0x00, 0x20, 0x10, 0x00, 0xC0, 0x0F, // 169 + 0xD0, 0x00, 0x00, 0x48, 0x01, 0x00, 0x28, 0x01, 0x00, 0x28, 0x01, 0x00, 0xF0, 0x01, // 170 + 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x1B, 0x00, 0x80, 0x20, 0x00, 0x00, 0x04, 0x00, 0x00, 0x1B, 0x00, 0x80, 0x20, // 171 + 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, + 0x80, 0x0F, // 172 + 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, // 173 + 0xC0, 0x0F, 0x00, 0x20, 0x10, 0x00, 0x10, 0x20, 0x00, 0xE8, 0x4F, 0x00, 0x28, 0x41, 0x00, 0x28, 0x41, 0x00, 0x28, 0x43, 0x00, + 0x28, 0x45, 0x00, 0xC8, 0x48, 0x00, 0x10, 0x20, 0x00, 0x20, 0x10, 0x00, 0xC0, 0x0F, // 174 + 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x04, // 175 + 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x48, 0x00, 0x00, 0x48, 0x00, 0x00, 0x30, // 176 + 0x00, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x41, 0x00, 0x00, 0x41, 0x00, 0xE0, 0x4F, 0x00, 0x00, 0x41, 0x00, 0x00, 0x41, 0x00, + 0x00, 0x41, // 177 + 0x10, 0x01, 0x00, 0x88, 0x01, 0x00, 0x48, 0x01, 0x00, 0x48, 0x01, 0x00, 0x30, 0x01, // 178 + 0x90, 0x00, 0x00, 0x08, 0x01, 0x00, 0x08, 0x01, 0x00, 0x28, 0x01, 0x00, 0xD8, // 179 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x08, // 180 + 0x00, 0x00, 0x00, 0xC0, 0xFF, 0x03, 0x00, 0x20, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x20, 0x00, + 0xC0, 0x7F, // 181 + 0xF0, 0x00, 0x00, 0xF8, 0x00, 0x00, 0xF8, 0x01, 0x00, 0xF8, 0x01, 0x00, 0xF8, 0xFF, 0x03, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, + 0xF8, 0xFF, 0x03, 0x08, // 182 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // 183 + 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x90, 0x24, 0x00, 0x40, 0x44, 0x00, 0x40, 0x44, 0x00, 0x40, 0x44, 0x00, 0x90, 0x24, 0x00, + 0x00, 0x17, // 184 + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x08, 0x00, 0x00, 0xF8, 0x01, // 185 + 0xF0, 0x00, 0x00, 0x08, 0x01, 0x00, 0x08, 0x01, 0x00, 0x08, 0x01, 0x00, 0xF0, // 186 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x20, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x04, 0x00, 0x80, 0x20, 0x00, 0x00, 0x1B, 0x00, + 0x00, 0x04, // 187 + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x08, 0x40, 0x00, 0xF8, 0x21, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x02, 0x00, + 0x80, 0x01, 0x00, 0x40, 0x30, 0x00, 0x30, 0x28, 0x00, 0x08, 0x24, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x20, // 188 + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x08, 0x40, 0x00, 0xF8, 0x31, 0x00, 0x00, 0x08, 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, + 0x80, 0x00, 0x00, 0x60, 0x44, 0x00, 0x10, 0x62, 0x00, 0x08, 0x52, 0x00, 0x00, 0x52, 0x00, 0x00, 0x4C, // 189 + 0x90, 0x00, 0x00, 0x08, 0x01, 0x00, 0x08, 0x41, 0x00, 0x28, 0x21, 0x00, 0xD8, 0x18, 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, + 0x80, 0x00, 0x00, 0x40, 0x30, 0x00, 0x30, 0x28, 0x00, 0x08, 0x24, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x20, // 190 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x01, 0x00, 0x60, 0x03, 0x00, 0x3B, 0x02, 0x00, 0x3B, 0x02, + 0x00, 0x00, 0x03, 0x00, 0x80, 0x01, // 191 + 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x1C, 0x00, 0x80, 0x07, 0x00, 0x70, 0x04, 0x00, 0x08, 0x04, 0x00, 0x70, 0x04, 0x00, + 0x80, 0x07, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x60, // 192 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x08, 0x42, 0x00, 0x08, 0x42, 0x00, 0x08, 0x42, 0x00, 0x08, 0x42, 0x00, 0x08, 0x42, 0x00, + 0x08, 0x66, 0x00, 0x08, 0x3C, // 193 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, + 0x08, 0x41, 0x00, 0x90, 0x22, 0x00, 0x60, 0x1C, // 194 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x18, // 195 + 0x00, 0xC0, 0x01, 0x00, 0x60, 0x00, 0xF0, 0x5F, 0x00, 0x18, 0x40, 0x00, 0x08, 0x40, 0x00, 0x08, 0x40, 0x00, 0x08, 0x40, 0x00, + 0x08, 0x40, 0x00, 0xF8, 0x7F, 0x00, 0x00, 0xC0, 0x01, // 196 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, + 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, 0x08, 0x40, // 197 + 0x08, 0x40, 0x00, 0x08, 0x60, 0x00, 0x38, 0x38, 0x00, 0xE0, 0x0C, 0x00, 0x80, 0x07, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x00, + 0xF8, 0x7F, 0x00, 0x00, 0x02, 0x00, 0x00, 0x03, 0x00, 0x80, 0x07, 0x00, 0xE0, 0x0C, 0x00, 0x38, 0x38, 0x00, 0x08, 0x60, 0x00, + 0x08, 0x40, // 198 + 0x00, 0x00, 0x00, 0x20, 0x10, 0x00, 0x10, 0x20, 0x00, 0x08, 0x40, 0x00, 0x08, 0x42, 0x00, 0x08, 0x42, 0x00, 0x08, 0x42, 0x00, + 0x10, 0x22, 0x00, 0xE0, 0x1D, // 199 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x00, 0x20, 0x00, 0x00, 0x10, 0x00, 0x00, 0x08, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x01, 0x00, 0x80, 0x00, 0x00, 0x40, 0x00, 0x00, 0xF8, 0x7F, // 200 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x00, 0x20, 0x00, 0x01, 0x10, 0x00, 0x02, 0x08, 0x00, 0x02, 0x04, 0x00, 0x02, 0x02, 0x00, + 0x01, 0x01, 0x00, 0x80, 0x00, 0x00, 0x40, 0x00, 0x00, 0xF8, 0x7F, // 201 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x00, 0x01, 0x00, 0x80, 0x02, 0x00, 0x40, 0x04, 0x00, 0x20, 0x08, 0x00, 0x10, 0x10, 0x00, + 0x08, 0x20, 0x00, 0x08, 0x40, // 202 + 0x00, 0x40, 0x00, 0x00, 0x60, 0x00, 0xF0, 0x3F, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, + 0x08, 0x00, 0x00, 0xF8, 0x7F, // 203 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x30, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x10, 0x00, + 0x00, 0x0C, 0x00, 0x00, 0x03, 0x00, 0xC0, 0x00, 0x00, 0x30, 0x00, 0x00, 0xF8, 0x7F, // 204 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0xF8, 0x7F, // 205 + 0x00, 0x00, 0x00, 0xC0, 0x0F, 0x00, 0x20, 0x10, 0x00, 0x10, 0x20, 0x00, 0x08, 0x40, 0x00, 0x08, 0x40, 0x00, 0x08, 0x40, 0x00, + 0x08, 0x40, 0x00, 0x10, 0x20, 0x00, 0x20, 0x10, 0x00, 0xC0, 0x0F, // 206 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0xF8, 0x7F, // 207 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x08, 0x02, 0x00, 0x08, 0x02, 0x00, 0x08, 0x02, 0x00, 0x08, 0x02, 0x00, 0x08, 0x02, 0x00, + 0x08, 0x02, 0x00, 0x10, 0x01, 0x00, 0xE0, // 208 + 0x00, 0x00, 0x00, 0xC0, 0x0F, 0x00, 0x20, 0x10, 0x00, 0x10, 0x20, 0x00, 0x08, 0x40, 0x00, 0x08, 0x40, 0x00, 0x08, 0x40, 0x00, + 0x08, 0x40, 0x00, 0x08, 0x40, 0x00, 0x10, 0x20, 0x00, 0x20, 0x10, // 209 + 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x08, // 210 + 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0xE0, 0x80, 0x00, 0x80, 0x83, 0x00, 0x00, 0xE6, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x07, 0x00, + 0xC0, 0x01, 0x00, 0x60, 0x00, 0x00, 0x18, // 211 + 0x00, 0x00, 0x00, 0xC0, 0x0F, 0x00, 0x60, 0x18, 0x00, 0x20, 0x10, 0x00, 0x20, 0x10, 0x00, 0x20, 0x10, 0x00, 0xF8, 0x7F, 0x00, + 0x20, 0x10, 0x00, 0x20, 0x10, 0x00, 0x20, 0x10, 0x00, 0x60, 0x18, 0x00, 0xC0, 0x0F, // 212 + 0x08, 0x40, 0x00, 0x08, 0x20, 0x00, 0x10, 0x10, 0x00, 0x60, 0x0C, 0x00, 0x80, 0x02, 0x00, 0x00, 0x01, 0x00, 0x80, 0x02, 0x00, + 0x60, 0x0C, 0x00, 0x10, 0x10, 0x00, 0x08, 0x20, 0x00, 0x08, 0x40, // 213 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, + 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0xF8, 0x7F, 0x00, 0x00, 0xC0, 0x01, // 214 + 0x00, 0x00, 0x00, 0xF8, 0x03, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, + 0x00, 0x04, 0x00, 0xF8, 0x7F, // 215 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, + 0xF8, 0x7F, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0xF8, 0x7F, // 216 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, + 0xF8, 0x7F, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0xF8, 0x7F, 0x00, 0x00, 0xC0, + 0x01, // 217 + 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x00, 0x41, 0x00, 0x00, 0x41, 0x00, + 0x00, 0x41, 0x00, 0x00, 0x41, 0x00, 0x00, 0x41, 0x00, 0x00, 0x63, 0x00, 0x00, 0x3E, // 218 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x00, 0x41, 0x00, 0x00, 0x41, 0x00, 0x00, 0x41, 0x00, 0x00, 0x41, 0x00, 0x00, 0x41, 0x00, + 0x00, 0x63, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x7F, // 219 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x00, 0x41, 0x00, 0x00, 0x41, 0x00, 0x00, 0x41, 0x00, 0x00, 0x41, 0x00, 0x00, 0x41, 0x00, + 0x00, 0x63, 0x00, 0x00, 0x3E, // 220 + 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x10, 0x20, 0x00, 0x08, 0x40, 0x00, 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, 0x08, 0x41, 0x00, + 0x10, 0x61, 0x00, 0x10, 0x31, 0x00, 0xE0, 0x1F, // 221 + 0x00, 0x00, 0x00, 0xF8, 0x7F, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x80, 0x0F, 0x00, 0xE0, 0x18, 0x00, + 0x30, 0x30, 0x00, 0x18, 0x60, 0x00, 0x08, 0x40, 0x00, 0x08, 0x40, 0x00, 0x18, 0x60, 0x00, 0x30, 0x30, 0x00, 0xE0, 0x18, 0x00, + 0x80, 0x0F, // 222 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x61, 0x00, 0x18, 0x13, 0x00, 0x08, 0x0A, 0x00, 0x08, 0x06, 0x00, 0x08, 0x02, 0x00, + 0x08, 0x02, 0x00, 0x08, 0x02, 0x00, 0x08, 0x02, 0x00, 0xF8, 0x7F, // 223 + 0x00, 0x00, 0x00, 0x00, 0x39, 0x00, 0x80, 0x44, 0x00, 0x40, 0x44, 0x00, 0x40, 0x44, 0x00, 0x40, 0x42, 0x00, 0x40, 0x22, 0x00, + 0x80, 0x7F, // 224 + 0x00, 0x00, 0x00, 0xE0, 0x1F, 0x00, 0x30, 0x73, 0x00, 0x90, 0x40, 0x00, 0x90, 0x40, 0x00, 0x90, 0x40, 0x00, 0x98, 0x61, 0x00, + 0x18, 0x3F, 0x00, 0x00, 0x0C, // 225 + 0x00, 0x00, 0x00, 0xC0, 0x7F, 0x00, 0x40, 0x44, 0x00, 0x40, 0x44, 0x00, 0x40, 0x44, 0x00, 0xC0, 0x6E, 0x00, 0x80, 0x3B, // 226 + 0x00, 0x00, 0x00, 0xC0, 0x7F, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, // 227 + 0x00, 0xC0, 0x01, 0x00, 0x70, 0x00, 0x80, 0x5F, 0x00, 0xC0, 0x40, 0x00, 0x40, 0x40, 0x00, 0x40, 0x40, 0x00, 0x40, 0x40, 0x00, + 0xC0, 0x7F, 0x00, 0x00, 0xC0, 0x01, // 228 + 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x80, 0x24, 0x00, 0x40, 0x44, 0x00, 0x40, 0x44, 0x00, 0x40, 0x44, 0x00, 0x80, 0x24, 0x00, + 0x00, 0x17, // 229 + 0x40, 0x40, 0x00, 0xC0, 0x70, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x04, 0x00, 0xC0, 0x7F, 0x00, 0x00, 0x04, 0x00, + 0x00, 0x0E, 0x00, 0x00, 0x3B, 0x00, 0xC0, 0x60, 0x00, 0x40, 0x40, // 230 + 0x00, 0x00, 0x00, 0x80, 0x20, 0x00, 0x40, 0x40, 0x00, 0x40, 0x44, 0x00, 0x40, 0x44, 0x00, 0x80, 0x3B, // 231 + 0x00, 0x00, 0x00, 0xC0, 0x7F, 0x00, 0x00, 0x20, 0x00, 0x00, 0x10, 0x00, 0x00, 0x08, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, 0x00, + 0xC0, 0x7F, // 232 + 0x00, 0x00, 0x00, 0xC0, 0x7F, 0x00, 0x10, 0x20, 0x00, 0x20, 0x10, 0x00, 0x20, 0x08, 0x00, 0x20, 0x04, 0x00, 0x10, 0x02, 0x00, + 0xC0, 0x7F, // 233 + 0x00, 0x00, 0x00, 0xC0, 0x7F, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x1B, 0x00, 0xC0, 0x70, 0x00, 0x40, 0x40, // 234 + 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x80, 0x7F, 0x00, 0xC0, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, + 0xC0, 0x7F, // 235 + 0x00, 0x00, 0x00, 0xC0, 0x7F, 0x00, 0x40, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x60, 0x00, 0x00, 0x38, 0x00, + 0xC0, 0x07, 0x00, 0x40, 0x00, 0x00, 0xC0, 0x7F, // 236 + 0x00, 0x00, 0x00, 0xC0, 0x7F, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, + 0xC0, 0x7F, // 237 + 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x80, 0x20, 0x00, 0x40, 0x40, 0x00, 0x40, 0x40, 0x00, 0x40, 0x40, 0x00, 0x80, 0x20, 0x00, + 0x00, 0x1F, // 238 + 0x00, 0x00, 0x00, 0xC0, 0x7F, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, + 0xC0, 0x7F, // 239 + 0x00, 0x00, 0x00, 0xC0, 0xFF, 0x03, 0x80, 0x60, 0x00, 0x40, 0x40, 0x00, 0x40, 0x40, 0x00, 0x40, 0x40, 0x00, 0x80, 0x20, 0x00, + 0x00, 0x1F, // 240 + 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x80, 0x20, 0x00, 0x40, 0x40, 0x00, 0x40, 0x40, 0x00, 0x40, 0x40, 0x00, 0x80, 0x20, // 241 + 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0xC0, 0x7F, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, // 242 + 0xC0, 0x01, 0x00, 0x00, 0x06, 0x02, 0x00, 0x38, 0x02, 0x00, 0xC0, 0x01, 0x00, 0x78, 0x00, 0x00, 0x07, 0x00, 0xC0, // 243 + 0x00, 0x00, 0x00, 0x80, 0x3F, 0x00, 0xC0, 0x60, 0x00, 0x40, 0x40, 0x00, 0x40, 0x40, 0x00, 0xC0, 0x60, 0x00, 0xE0, 0xFF, 0x03, + 0xC0, 0x60, 0x00, 0x40, 0x40, 0x00, 0x40, 0x40, 0x00, 0xC0, 0x60, 0x00, 0x80, 0x3F, // 244 + 0x00, 0x00, 0x00, 0x40, 0x40, 0x00, 0x80, 0x20, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x04, 0x00, 0x00, 0x1B, 0x00, 0x80, 0x20, 0x00, + 0x40, 0x40, // 245 + 0x00, 0x00, 0x00, 0xC0, 0x7F, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, + 0xC0, 0x7F, 0x00, 0x00, 0xC0, // 246 + 0x00, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0xC0, 0x7F, // 247 + 0x00, 0x00, 0x00, 0xC0, 0x7F, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0xC0, 0x7F, 0x00, + 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0xC0, 0x7F, // 248 + 0x00, 0x00, 0x00, 0xC0, 0x7F, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0xC0, 0x7F, 0x00, + 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0xC0, 0x7F, 0x00, 0x00, 0xC0, // 249 + 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0xC0, 0x7F, 0x00, 0x00, 0x44, 0x00, 0x00, 0x44, 0x00, 0x00, 0x44, 0x00, + 0x00, 0x64, 0x00, 0x00, 0x38, // 250 + 0x00, 0x00, 0x00, 0xC0, 0x7F, 0x00, 0x00, 0x44, 0x00, 0x00, 0x44, 0x00, 0x00, 0x44, 0x00, 0x00, 0x44, 0x00, 0x00, 0x6C, 0x00, + 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x7F, // 251 + 0x00, 0x00, 0x00, 0xC0, 0x7F, 0x00, 0x00, 0x44, 0x00, 0x00, 0x44, 0x00, 0x00, 0x44, 0x00, 0x00, 0x44, 0x00, 0x00, 0x6C, 0x00, + 0x00, 0x38, // 252 + 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x80, 0x20, 0x00, 0x40, 0x44, 0x00, 0x40, 0x44, 0x00, 0xC0, 0x24, 0x00, 0x80, 0x1F, // 253 + 0x00, 0x00, 0x00, 0xC0, 0x7F, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x1E, 0x00, 0x80, 0x33, 0x00, 0xC0, 0x60, 0x00, + 0x40, 0x40, 0x00, 0xC0, 0x60, 0x00, 0x80, 0x31, 0x00, 0x00, 0x1F, // 254 + 0x00, 0x00, 0x00, 0x80, 0x43, 0x00, 0xC0, 0x7A, 0x00, 0x40, 0x0C, 0x00, 0x40, 0x04, 0x00, 0x40, 0x04, 0x00, 0xC0, 0x06, 0x00, + 0xC0, 0x7F, // 255 +}; + +// Font generated or edited with the glyphEditor (@mrekin) +const uint8_t ArialMT_Plain_24_RU[] PROGMEM = { + 0x18, // Width: 24 + 0x1C, // Height: 28 + 0x20, // First char: 32 + 0xE0, // Number of chars: 224 + // Jump Table: + 0xFF, 0xFF, 0x00, 0x07, // 32 + 0x00, 0x00, 0x13, 0x08, // 33 + 0x00, 0x13, 0x1A, 0x09, // 34 + 0x00, 0x2D, 0x33, 0x0D, // 35 + 0x00, 0x60, 0x2F, 0x0D, // 36 + 0x00, 0x8F, 0x4F, 0x15, // 37 + 0x00, 0xDE, 0x3B, 0x10, // 38 + 0x01, 0x19, 0x0A, 0x05, // 39 + 0x01, 0x23, 0x1C, 0x08, // 40 + 0x01, 0x3F, 0x1B, 0x08, // 41 + 0x01, 0x5A, 0x21, 0x09, // 42 + 0x01, 0x7B, 0x32, 0x0E, // 43 + 0x01, 0xAD, 0x10, 0x07, // 44 + 0x01, 0xBD, 0x1B, 0x08, // 45 + 0x01, 0xD8, 0x0F, 0x07, // 46 + 0x01, 0xE7, 0x19, 0x07, // 47 + 0x02, 0x00, 0x2F, 0x0D, // 48 + 0x02, 0x2F, 0x23, 0x0D, // 49 + 0x02, 0x52, 0x2F, 0x0D, // 50 + 0x02, 0x81, 0x2F, 0x0D, // 51 + 0x02, 0xB0, 0x2F, 0x0D, // 52 + 0x02, 0xDF, 0x2F, 0x0D, // 53 + 0x03, 0x0E, 0x2F, 0x0D, // 54 + 0x03, 0x3D, 0x2D, 0x0D, // 55 + 0x03, 0x6A, 0x2F, 0x0D, // 56 + 0x03, 0x99, 0x2F, 0x0D, // 57 + 0x03, 0xC8, 0x0F, 0x07, // 58 + 0x03, 0xD7, 0x10, 0x07, // 59 + 0x03, 0xE7, 0x2F, 0x0E, // 60 + 0x04, 0x16, 0x2F, 0x0E, // 61 + 0x04, 0x45, 0x2E, 0x0E, // 62 + 0x04, 0x73, 0x2E, 0x0D, // 63 + 0x04, 0xA1, 0x5B, 0x18, // 64 + 0x04, 0xFC, 0x3B, 0x0F, // 65 + 0x05, 0x37, 0x3B, 0x10, // 66 + 0x05, 0x72, 0x3F, 0x11, // 67 + 0x05, 0xB1, 0x3F, 0x11, // 68 + 0x05, 0xF0, 0x3B, 0x10, // 69 + 0x06, 0x2B, 0x35, 0x0F, // 70 + 0x06, 0x60, 0x43, 0x13, // 71 + 0x06, 0xA3, 0x3B, 0x11, // 72 + 0x06, 0xDE, 0x0F, 0x06, // 73 + 0x06, 0xED, 0x27, 0x0C, // 74 + 0x07, 0x14, 0x3F, 0x10, // 75 + 0x07, 0x53, 0x2F, 0x0D, // 76 + 0x07, 0x82, 0x43, 0x13, // 77 + 0x07, 0xC5, 0x3B, 0x11, // 78 + 0x08, 0x00, 0x47, 0x13, // 79 + 0x08, 0x47, 0x3A, 0x10, // 80 + 0x08, 0x81, 0x47, 0x13, // 81 + 0x08, 0xC8, 0x3F, 0x11, // 82 + 0x09, 0x07, 0x3B, 0x10, // 83 + 0x09, 0x42, 0x35, 0x0E, // 84 + 0x09, 0x77, 0x3B, 0x11, // 85 + 0x09, 0xB2, 0x39, 0x0F, // 86 + 0x09, 0xEB, 0x59, 0x17, // 87 + 0x0A, 0x44, 0x3B, 0x0F, // 88 + 0x0A, 0x7F, 0x3D, 0x10, // 89 + 0x0A, 0xBC, 0x37, 0x0F, // 90 + 0x0A, 0xF3, 0x14, 0x07, // 91 + 0x0B, 0x07, 0x1B, 0x07, // 92 + 0x0B, 0x22, 0x18, 0x07, // 93 + 0x0B, 0x3A, 0x2A, 0x0C, // 94 + 0x0B, 0x64, 0x34, 0x0D, // 95 + 0x0B, 0x98, 0x11, 0x08, // 96 + 0x0B, 0xA9, 0x2F, 0x0D, // 97 + 0x0B, 0xD8, 0x33, 0x0E, // 98 + 0x0C, 0x0B, 0x2B, 0x0C, // 99 + 0x0C, 0x36, 0x2F, 0x0E, // 100 + 0x0C, 0x65, 0x2F, 0x0D, // 101 + 0x0C, 0x94, 0x1A, 0x07, // 102 + 0x0C, 0xAE, 0x2F, 0x0E, // 103 + 0x0C, 0xDD, 0x2F, 0x0E, // 104 + 0x0D, 0x0C, 0x0F, 0x05, // 105 + 0x0D, 0x1B, 0x10, 0x06, // 106 + 0x0D, 0x2B, 0x2F, 0x0C, // 107 + 0x0D, 0x5A, 0x0F, 0x06, // 108 + 0x0D, 0x69, 0x47, 0x14, // 109 + 0x0D, 0xB0, 0x2F, 0x0E, // 110 + 0x0D, 0xDF, 0x2F, 0x0D, // 111 + 0x0E, 0x0E, 0x33, 0x0E, // 112 + 0x0E, 0x41, 0x30, 0x0E, // 113 + 0x0E, 0x71, 0x1E, 0x08, // 114 + 0x0E, 0x8F, 0x2B, 0x0C, // 115 + 0x0E, 0xBA, 0x1B, 0x07, // 116 + 0x0E, 0xD5, 0x2F, 0x0E, // 117 + 0x0F, 0x04, 0x2A, 0x0B, // 118 + 0x0F, 0x2E, 0x42, 0x11, // 119 + 0x0F, 0x70, 0x2B, 0x0B, // 120 + 0x0F, 0x9B, 0x2A, 0x0C, // 121 + 0x0F, 0xC5, 0x2B, 0x0C, // 122 + 0x0F, 0xF0, 0x1C, 0x08, // 123 + 0x10, 0x0C, 0x10, 0x06, // 124 + 0x10, 0x1C, 0x1B, 0x08, // 125 + 0x10, 0x37, 0x32, 0x0E, // 126 + 0xFF, 0xFF, 0x00, 0x18, // 127 + 0xFF, 0xFF, 0x00, 0x18, // 128 + 0xFF, 0xFF, 0x00, 0x18, // 129 + 0xFF, 0xFF, 0x00, 0x18, // 130 + 0xFF, 0xFF, 0x00, 0x18, // 131 + 0xFF, 0xFF, 0x00, 0x18, // 132 + 0xFF, 0xFF, 0x00, 0x18, // 133 + 0xFF, 0xFF, 0x00, 0x18, // 134 + 0xFF, 0xFF, 0x00, 0x18, // 135 + 0xFF, 0xFF, 0x00, 0x18, // 136 + 0xFF, 0xFF, 0x00, 0x18, // 137 + 0xFF, 0xFF, 0x00, 0x18, // 138 + 0xFF, 0xFF, 0x00, 0x18, // 139 + 0xFF, 0xFF, 0x00, 0x18, // 140 + 0xFF, 0xFF, 0x00, 0x18, // 141 + 0xFF, 0xFF, 0x00, 0x18, // 142 + 0xFF, 0xFF, 0x00, 0x18, // 143 + 0xFF, 0xFF, 0x00, 0x18, // 144 + 0xFF, 0xFF, 0x00, 0x18, // 145 + 0xFF, 0xFF, 0x00, 0x18, // 146 + 0xFF, 0xFF, 0x00, 0x18, // 147 + 0xFF, 0xFF, 0x00, 0x18, // 148 + 0xFF, 0xFF, 0x00, 0x18, // 149 + 0xFF, 0xFF, 0x00, 0x18, // 150 + 0xFF, 0xFF, 0x00, 0x18, // 151 + 0xFF, 0xFF, 0x00, 0x18, // 152 + 0xFF, 0xFF, 0x00, 0x18, // 153 + 0xFF, 0xFF, 0x00, 0x18, // 154 + 0xFF, 0xFF, 0x00, 0x18, // 155 + 0xFF, 0xFF, 0x00, 0x18, // 156 + 0xFF, 0xFF, 0x00, 0x18, // 157 + 0xFF, 0xFF, 0x00, 0x18, // 158 + 0xFF, 0xFF, 0x00, 0x18, // 159 + 0xFF, 0xFF, 0x00, 0x07, // 160 + 0x10, 0x69, 0x14, 0x08, // 161 + 0x10, 0x7D, 0x2B, 0x0D, // 162 + 0x10, 0xA8, 0x2F, 0x0D, // 163 + 0x10, 0xD7, 0x33, 0x0D, // 164 + 0x11, 0x0A, 0x31, 0x0D, // 165 + 0x11, 0x3B, 0x10, 0x06, // 166 + 0x11, 0x4B, 0x2F, 0x0D, // 167 + 0x11, 0x7A, 0x3B, 0x10, // 168 + 0x11, 0xB5, 0x46, 0x12, // 169 + 0x11, 0xFB, 0x1A, 0x09, // 170 + 0x12, 0x15, 0x27, 0x0D, // 171 + 0x12, 0x3C, 0x2F, 0x0E, // 172 + 0x12, 0x6B, 0x1B, 0x08, // 173 + 0x12, 0x86, 0x46, 0x12, // 174 + 0x12, 0xCC, 0x31, 0x0D, // 175 + 0x12, 0xFD, 0x1E, 0x0A, // 176 + 0x13, 0x1B, 0x33, 0x0D, // 177 + 0x13, 0x4E, 0x1A, 0x08, // 178 + 0x13, 0x68, 0x1A, 0x08, // 179 + 0x13, 0x82, 0x19, 0x08, // 180 + 0x13, 0x9B, 0x2F, 0x0E, // 181 + 0x13, 0xCA, 0x31, 0x0D, // 182 + 0x13, 0xFB, 0x12, 0x08, // 183 + 0x14, 0x0D, 0x2F, 0x0D, // 184 + 0x14, 0x3C, 0x16, 0x08, // 185 + 0x14, 0x52, 0x1E, 0x09, // 186 + 0x14, 0x70, 0x2E, 0x0D, // 187 + 0x14, 0x9E, 0x4F, 0x14, // 188 + 0x14, 0xED, 0x4B, 0x14, // 189 + 0x15, 0x38, 0x4B, 0x14, // 190 + 0x15, 0x83, 0x3B, 0x12, // 191 + 0x15, 0xBE, 0x3B, 0x0F, // 192 + 0x15, 0xF9, 0x3B, 0x10, // 193 + 0x16, 0x34, 0x3B, 0x10, // 194 + 0x16, 0x6F, 0x31, 0x0D, // 195 + 0x16, 0xA0, 0x3C, 0x10, // 196 + 0x16, 0xDC, 0x3B, 0x10, // 197 + 0x17, 0x17, 0x57, 0x16, // 198 + 0x17, 0x6E, 0x33, 0x0F, // 199 + 0x17, 0xA1, 0x3B, 0x11, // 200 + 0x17, 0xDC, 0x3B, 0x11, // 201 + 0x18, 0x17, 0x37, 0x0E, // 202 + 0x18, 0x4E, 0x37, 0x10, // 203 + 0x18, 0x85, 0x43, 0x13, // 204 + 0x18, 0xC8, 0x3B, 0x11, // 205 + 0x19, 0x03, 0x47, 0x13, // 206 + 0x19, 0x4A, 0x3B, 0x11, // 207 + 0x19, 0x85, 0x3A, 0x10, // 208 + 0x19, 0xBF, 0x3F, 0x11, // 209 + 0x19, 0xFE, 0x35, 0x0E, // 210 + 0x1A, 0x33, 0x39, 0x0F, // 211 + 0x1A, 0x6C, 0x42, 0x12, // 212 + 0x1A, 0xAE, 0x3B, 0x0F, // 213 + 0x1A, 0xE9, 0x43, 0x12, // 214 + 0x1B, 0x2C, 0x37, 0x10, // 215 + 0x1B, 0x63, 0x4F, 0x16, // 216 + 0x1B, 0xB2, 0x58, 0x17, // 217 + 0x1C, 0x0A, 0x47, 0x13, // 218 + 0x1C, 0x51, 0x4B, 0x15, // 219 + 0x1C, 0x9C, 0x3B, 0x10, // 220 + 0x1C, 0xD7, 0x3F, 0x11, // 221 + 0x1D, 0x16, 0x5B, 0x18, // 222 + 0x1D, 0x71, 0x3B, 0x11, // 223 + 0x1D, 0xAC, 0x2F, 0x0D, // 224 + 0x1D, 0xDB, 0x33, 0x0E, // 225 + 0x1E, 0x0E, 0x2F, 0x0D, // 226 + 0x1E, 0x3D, 0x22, 0x09, // 227 + 0x1E, 0x5F, 0x33, 0x0E, // 228 + 0x1E, 0x92, 0x2F, 0x0D, // 229 + 0x1E, 0xC1, 0x3F, 0x10, // 230 + 0x1F, 0x00, 0x27, 0x0B, // 231 + 0x1F, 0x27, 0x2F, 0x0D, // 232 + 0x1F, 0x56, 0x2F, 0x0D, // 233 + 0x1F, 0x85, 0x27, 0x0B, // 234 + 0x1F, 0xAC, 0x2F, 0x0E, // 235 + 0x1F, 0xDB, 0x3B, 0x11, // 236 + 0x20, 0x16, 0x2F, 0x0D, // 237 + 0x20, 0x45, 0x2F, 0x0D, // 238 + 0x20, 0x74, 0x2B, 0x0D, // 239 + 0x20, 0x9F, 0x33, 0x0E, // 240 + 0x20, 0xD2, 0x2B, 0x0C, // 241 + 0x20, 0xFD, 0x2A, 0x0B, // 242 + 0x21, 0x27, 0x2A, 0x0C, // 243 + 0x21, 0x51, 0x4B, 0x14, // 244 + 0x21, 0x9C, 0x2B, 0x0B, // 245 + 0x21, 0xC7, 0x33, 0x0E, // 246 + 0x21, 0xFA, 0x2B, 0x0D, // 247 + 0x22, 0x25, 0x47, 0x13, // 248 + 0x22, 0x6C, 0x4B, 0x14, // 249 + 0x22, 0xB7, 0x37, 0x0F, // 250 + 0x22, 0xEE, 0x3B, 0x11, // 251 + 0x23, 0x29, 0x2F, 0x0D, // 252 + 0x23, 0x58, 0x2B, 0x0C, // 253 + 0x23, 0x83, 0x43, 0x12, // 254 + 0x23, 0xC6, 0x2B, 0x0D, // 255 + // Font Data: + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x33, 0x00, 0xE0, 0xFF, 0x33, // 33 + 0x00, 0x00, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, + 0x07, 0x00, 0x00, 0xE0, 0x07, // 34 + 0x00, 0x0C, 0x03, 0x00, 0x00, 0x0C, 0x33, 0x00, 0x00, 0x0C, 0x3F, 0x00, 0x00, 0xFC, 0x0F, 0x00, 0x80, 0xFF, 0x03, 0x00, 0xE0, + 0x0F, 0x03, 0x00, 0x60, 0x0C, 0x33, 0x00, 0x00, 0x0C, 0x3F, 0x00, 0x00, 0xFC, 0x0F, 0x00, 0x80, 0xFF, 0x03, 0x00, 0xE0, 0x0F, + 0x03, 0x00, 0x60, 0x0C, 0x03, 0x00, 0x00, 0x0C, 0x03, // 35 + 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x06, 0x00, 0xC0, 0x0F, 0x1E, 0x00, 0xC0, 0x18, 0x1C, 0x00, 0x60, 0x18, 0x38, 0x00, 0x60, + 0x30, 0x30, 0x00, 0xF0, 0xFF, 0xFF, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x60, 0x30, 0x00, 0xC0, 0x60, 0x18, 0x00, 0xC0, 0xC1, + 0x1F, 0x00, 0x80, 0x81, 0x07, // 36 + 0x00, 0x00, 0x00, 0x00, 0x80, 0x0F, 0x00, 0x00, 0xC0, 0x1F, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, 0x20, + 0x20, 0x20, 0x00, 0x60, 0x30, 0x38, 0x00, 0xC0, 0x1F, 0x1E, 0x00, 0x80, 0x8F, 0x0F, 0x00, 0x00, 0xC0, 0x03, 0x00, 0x00, 0xF0, + 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x8F, 0x0F, 0x00, 0xC0, 0xC3, 0x1F, 0x00, 0xE0, 0x60, 0x30, 0x00, 0x60, 0x20, 0x20, + 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0xC0, 0x1F, 0x00, 0x00, 0x80, 0x0F, // 37 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0xC0, 0x1F, 0x00, 0x80, 0xE3, 0x1C, 0x00, 0xC0, 0x7F, 0x30, 0x00, 0xE0, + 0x3C, 0x30, 0x00, 0x60, 0x38, 0x30, 0x00, 0x60, 0x78, 0x30, 0x00, 0xE0, 0xEC, 0x38, 0x00, 0xC0, 0x8F, 0x1B, 0x00, 0x80, 0x03, + 0x1F, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x3F, 0x00, 0x00, 0x80, 0x38, 0x00, 0x00, 0x00, 0x10, // 38 + 0x00, 0x00, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0xE0, 0x07, // 39 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x0F, 0x00, 0x00, 0xFE, 0x7F, 0x00, 0x80, 0x0F, 0xF0, 0x01, 0xC0, 0x01, 0x80, 0x03, 0x60, + 0x00, 0x00, 0x06, 0x20, 0x00, 0x00, 0x04, // 40 + 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x04, 0x60, 0x00, 0x00, 0x06, 0xC0, 0x01, 0x80, 0x03, 0x80, 0x0F, 0xF0, 0x01, 0x00, + 0xFE, 0x7F, 0x00, 0x00, 0xF0, 0x0F, // 41 + 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x80, 0x0F, 0x00, 0x00, 0xE0, 0x03, 0x00, 0x00, 0xE0, + 0x03, 0x00, 0x00, 0x80, 0x0F, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x80, // 42 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, + 0x60, 0x00, 0x00, 0x00, 0xFF, 0x0F, 0x00, 0x00, 0xFF, 0x0F, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, // 43 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x03, 0x00, 0x00, 0xF0, 0x01, // 44 + 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, + 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, // 45 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, // 46 + 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0xE0, 0x0F, 0x00, 0x00, 0xFC, 0x01, 0x00, 0x80, 0x3F, 0x00, 0x00, 0xE0, + 0x03, 0x00, 0x00, 0x60, // 47 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x03, 0x00, 0x80, 0xFF, 0x1F, 0x00, 0xC0, 0x01, 0x1C, 0x00, 0xE0, 0x00, 0x38, 0x00, 0x60, + 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0xE0, 0x00, 0x38, 0x00, 0xC0, 0x01, 0x1C, 0x00, 0x80, 0xFF, + 0x0F, 0x00, 0x00, 0xFE, 0x03, // 48 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, // 49 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x30, 0x00, 0xC0, 0x03, 0x38, 0x00, 0xC0, 0x00, 0x3C, 0x00, 0x60, 0x00, 0x36, 0x00, 0x60, + 0x00, 0x33, 0x00, 0x60, 0x80, 0x33, 0x00, 0x60, 0xC0, 0x31, 0x00, 0x60, 0x60, 0x30, 0x00, 0xC0, 0x30, 0x30, 0x00, 0xC0, 0x1F, + 0x30, 0x00, 0x00, 0x0F, 0x30, // 50 + 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x06, 0x00, 0xC0, 0x01, 0x0E, 0x00, 0xC0, 0x00, 0x1C, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, + 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0xC0, 0x38, 0x30, 0x00, 0xC0, 0x6F, 0x18, 0x00, 0x80, 0xC7, + 0x0F, 0x00, 0x00, 0x80, 0x07, // 51 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0xC0, 0x03, 0x00, 0x00, 0xF0, 0x03, 0x00, 0x00, 0x3C, 0x03, 0x00, 0x00, + 0x0E, 0x03, 0x00, 0x80, 0x07, 0x03, 0x00, 0xC0, 0x01, 0x03, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x03, // 52 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x06, 0x00, 0x80, 0x3F, 0x1E, 0x00, 0xE0, 0x1F, 0x18, 0x00, 0x60, 0x08, 0x30, 0x00, 0x60, + 0x0C, 0x30, 0x00, 0x60, 0x0C, 0x30, 0x00, 0x60, 0x0C, 0x30, 0x00, 0x60, 0x0C, 0x30, 0x00, 0x60, 0x18, 0x1C, 0x00, 0x60, 0xF0, + 0x0F, 0x00, 0x00, 0xE0, 0x03, // 53 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x03, 0x00, 0x80, 0xFF, 0x0F, 0x00, 0xC0, 0x63, 0x1C, 0x00, 0xC0, 0x30, 0x38, 0x00, 0x60, + 0x18, 0x30, 0x00, 0x60, 0x18, 0x30, 0x00, 0x60, 0x18, 0x30, 0x00, 0x60, 0x18, 0x30, 0x00, 0xE0, 0x30, 0x18, 0x00, 0xC0, 0xF1, + 0x0F, 0x00, 0x80, 0xC1, 0x07, // 54 + 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x3C, 0x00, 0x60, + 0x80, 0x3F, 0x00, 0x60, 0xF0, 0x03, 0x00, 0x60, 0x78, 0x00, 0x00, 0x60, 0x0E, 0x00, 0x00, 0x60, 0x03, 0x00, 0x00, 0xE0, 0x01, + 0x00, 0x00, 0x60, // 55 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x80, 0xC7, 0x1F, 0x00, 0xC0, 0x6F, 0x18, 0x00, 0xE0, 0x38, 0x30, 0x00, 0x60, + 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0xE0, 0x38, 0x30, 0x00, 0xC0, 0x7F, 0x18, 0x00, 0x80, 0xC7, + 0x1F, 0x00, 0x00, 0x80, 0x07, // 56 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x0C, 0x00, 0x80, 0x7F, 0x1C, 0x00, 0xC0, 0x61, 0x38, 0x00, 0x60, 0xC0, 0x30, 0x00, 0x60, + 0xC0, 0x30, 0x00, 0x60, 0xC0, 0x30, 0x00, 0x60, 0xC0, 0x30, 0x00, 0x60, 0x60, 0x18, 0x00, 0xC0, 0x31, 0x1E, 0x00, 0x80, 0xFF, + 0x0F, 0x00, 0x00, 0xFE, 0x01, // 57 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x06, 0x30, // 58 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x30, 0x03, 0x00, 0x06, 0xF0, 0x01, // 59 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0xD8, 0x00, 0x00, 0x00, + 0xD8, 0x00, 0x00, 0x00, 0x8C, 0x01, 0x00, 0x00, 0x8C, 0x01, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x06, + 0x03, 0x00, 0x00, 0x03, 0x06, // 60 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x8C, 0x01, 0x00, 0x00, 0x8C, 0x01, 0x00, 0x00, 0x8C, 0x01, 0x00, 0x00, 0x8C, 0x01, 0x00, 0x00, + 0x8C, 0x01, 0x00, 0x00, 0x8C, 0x01, 0x00, 0x00, 0x8C, 0x01, 0x00, 0x00, 0x8C, 0x01, 0x00, 0x00, 0x8C, 0x01, 0x00, 0x00, 0x8C, + 0x01, 0x00, 0x00, 0x8C, 0x01, // 61 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x06, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, + 0x8C, 0x01, 0x00, 0x00, 0x8C, 0x01, 0x00, 0x00, 0xD8, 0x00, 0x00, 0x00, 0xD8, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x70, + 0x00, 0x00, 0x00, 0x20, // 62 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0xC0, 0x01, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x60, + 0x80, 0x33, 0x00, 0x60, 0xC0, 0x33, 0x00, 0x60, 0xE0, 0x00, 0x00, 0xE0, 0x30, 0x00, 0x00, 0xC0, 0x38, 0x00, 0x00, 0xC0, 0x1F, + 0x00, 0x00, 0x00, 0x07, // 63 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x0F, 0x00, 0x00, 0xF8, 0x3F, 0x00, 0x00, 0x1E, 0xF0, 0x00, 0x00, 0x07, 0xC0, 0x01, 0x80, + 0xC3, 0x87, 0x01, 0xC0, 0xF1, 0x9F, 0x03, 0xC0, 0x38, 0x18, 0x03, 0xC0, 0x0C, 0x30, 0x03, 0x60, 0x0E, 0x30, 0x06, 0x60, 0x06, + 0x30, 0x06, 0x60, 0x06, 0x18, 0x06, 0x60, 0x06, 0x1C, 0x06, 0x60, 0x0C, 0x1E, 0x06, 0x60, 0xF8, 0x3F, 0x06, 0xE0, 0xFE, 0x31, + 0x06, 0xC0, 0x0E, 0x30, 0x06, 0xC0, 0x01, 0x18, 0x03, 0x80, 0x03, 0x1C, 0x03, 0x00, 0x07, 0x8F, 0x01, 0x00, 0xFE, 0x87, 0x01, + 0x00, 0xF8, 0xC1, 0x00, 0x00, 0x00, 0x40, // 64 + 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x80, 0x0F, 0x00, 0x00, 0xF0, 0x03, 0x00, 0x00, 0xFE, 0x01, 0x00, 0x80, + 0x8F, 0x01, 0x00, 0xE0, 0x83, 0x01, 0x00, 0x60, 0x80, 0x01, 0x00, 0xE0, 0x83, 0x01, 0x00, 0x80, 0x8F, 0x01, 0x00, 0x00, 0xFE, + 0x01, 0x00, 0x00, 0xF0, 0x03, 0x00, 0x00, 0x80, 0x0F, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x30, // 65 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, + 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, + 0x30, 0x00, 0xC0, 0x78, 0x30, 0x00, 0xC0, 0xFF, 0x18, 0x00, 0x80, 0xC7, 0x1F, 0x00, 0x00, 0x80, 0x07, // 66 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x01, 0x00, 0x00, 0xFF, 0x07, 0x00, 0x80, 0x07, 0x0E, 0x00, 0xC0, 0x01, 0x1C, 0x00, 0xC0, + 0x00, 0x18, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, + 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0xC0, 0x00, 0x18, 0x00, 0xC0, 0x01, 0x1C, 0x00, 0x80, 0x03, 0x0F, 0x00, 0x00, 0x02, + 0x03, // 67 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, + 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, + 0x30, 0x00, 0xE0, 0x00, 0x18, 0x00, 0xC0, 0x01, 0x1C, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x00, 0xFF, 0x07, 0x00, 0x00, 0xFC, + 0x01, // 68 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, + 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, + 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x00, 0x30, // 69 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x60, 0x30, 0x00, 0x00, 0x60, + 0x30, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x60, 0x30, + 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x60, // 70 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x01, 0x00, 0x00, 0xFF, 0x07, 0x00, 0x80, 0x07, 0x0F, 0x00, 0xC0, 0x01, 0x1C, 0x00, 0xC0, + 0x00, 0x18, 0x00, 0xE0, 0x00, 0x18, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x60, + 0x30, 0x00, 0x60, 0x60, 0x30, 0x00, 0xE0, 0x60, 0x38, 0x00, 0xC0, 0x60, 0x18, 0x00, 0xC0, 0x61, 0x18, 0x00, 0x80, 0xE3, 0x0F, + 0x00, 0x00, 0xE2, 0x0F, // 71 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, + 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, + 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, // 72 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, // 73 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, + 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x38, 0x00, 0xE0, 0xFF, 0x1F, 0x00, 0xE0, 0xFF, 0x0F, // 74 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, + 0x70, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0xE7, 0x01, 0x00, 0x80, 0x83, + 0x07, 0x00, 0xC0, 0x01, 0x0F, 0x00, 0xE0, 0x00, 0x1E, 0x00, 0x60, 0x00, 0x38, 0x00, 0x20, 0x00, 0x30, 0x00, 0x00, 0x00, + 0x20, // 75 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, + 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, + 0x30, 0x00, 0x00, 0x00, 0x30, // 76 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0x01, 0x00, 0x00, 0xC0, + 0x0F, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, + 0x3F, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0xFE, 0x00, 0x00, 0xC0, 0x0F, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0xE0, 0xFF, 0x3F, + 0x00, 0xE0, 0xFF, 0x3F, // 77 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xC0, 0x01, 0x00, 0x00, 0x80, + 0x07, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0x80, + 0x03, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x1C, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, // 78 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x01, 0x00, 0x00, 0xFF, 0x07, 0x00, 0x80, 0x07, 0x0F, 0x00, 0xC0, 0x01, 0x1C, 0x00, 0xC0, + 0x00, 0x18, 0x00, 0xE0, 0x00, 0x38, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, + 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0xE0, 0x00, 0x38, 0x00, 0xC0, 0x00, 0x18, 0x00, 0xC0, 0x01, 0x1C, 0x00, 0x80, 0x07, 0x0F, + 0x00, 0x00, 0xFF, 0x07, 0x00, 0x00, 0xFC, 0x01, // 79 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x60, 0x60, 0x00, 0x00, 0x60, + 0x60, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x60, 0x60, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0xC0, 0x30, 0x00, 0x00, 0xC0, 0x3F, 0x00, 0x00, 0x00, 0x0F, // 80 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x01, 0x00, 0x00, 0xFF, 0x07, 0x00, 0x80, 0x07, 0x0F, 0x00, 0xC0, 0x01, 0x1C, 0x00, 0xC0, + 0x00, 0x18, 0x00, 0xE0, 0x00, 0x18, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, + 0x36, 0x00, 0x60, 0x00, 0x36, 0x00, 0xE0, 0x00, 0x3C, 0x00, 0xC0, 0x00, 0x1C, 0x00, 0xC0, 0x01, 0x3C, 0x00, 0x80, 0x07, 0x3F, + 0x00, 0x00, 0xFF, 0x77, 0x00, 0x00, 0xFC, 0x61, // 81 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x60, 0x30, 0x00, 0x00, 0x60, + 0x30, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x60, 0x70, 0x00, 0x00, 0x60, 0xF0, 0x00, 0x00, 0x60, 0xF0, + 0x03, 0x00, 0x60, 0xB0, 0x07, 0x00, 0xE0, 0x18, 0x1F, 0x00, 0xC0, 0x1F, 0x3C, 0x00, 0x80, 0x0F, 0x30, 0x00, 0x00, 0x00, + 0x20, // 82 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x0F, 0x00, 0xC0, 0x1F, 0x1C, 0x00, 0xC0, 0x18, 0x18, 0x00, 0x60, + 0x38, 0x38, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x70, 0x30, 0x00, 0x60, 0x70, + 0x30, 0x00, 0xC0, 0x60, 0x18, 0x00, 0xC0, 0xE1, 0x1C, 0x00, 0x80, 0xC3, 0x0F, 0x00, 0x00, 0x83, 0x07, // 83 + 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, // 84 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x07, 0x00, 0xE0, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, + 0x00, 0x38, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, + 0x30, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x1C, 0x00, 0xE0, 0xFF, 0x0F, 0x00, 0xE0, 0xFF, 0x07, // 85 + 0x20, 0x00, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0xC0, 0x0F, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0xF8, 0x01, 0x00, 0x00, + 0xC0, 0x0F, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0xC0, 0x0F, 0x00, 0x00, 0xF8, + 0x01, 0x00, 0x00, 0x3E, 0x00, 0x00, 0xC0, 0x0F, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0x20, // 86 + 0x60, 0x00, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0x80, 0xFF, 0x00, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0x80, 0x3F, 0x00, 0x00, + 0x00, 0x30, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0xE0, 0x0F, 0x00, 0x00, 0xFC, 0x01, 0x00, 0x80, 0x3F, 0x00, 0x00, 0xE0, 0x03, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xE0, 0x03, 0x00, 0x00, 0x80, 0x1F, 0x00, 0x00, 0x00, 0xFC, 0x01, 0x00, 0x00, 0xE0, 0x0F, + 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x80, 0x3F, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x80, 0xFF, 0x00, 0x00, + 0xE0, 0x07, 0x00, 0x00, 0x60, // 87 + 0x00, 0x00, 0x20, 0x00, 0x20, 0x00, 0x30, 0x00, 0x60, 0x00, 0x3C, 0x00, 0xE0, 0x01, 0x1E, 0x00, 0xC0, 0x83, 0x0F, 0x00, 0x00, + 0xCF, 0x03, 0x00, 0x00, 0xFE, 0x01, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0xFE, 0x01, 0x00, 0x80, 0xCF, 0x03, 0x00, 0xC0, 0x83, + 0x07, 0x00, 0xE0, 0x01, 0x1E, 0x00, 0x60, 0x00, 0x3C, 0x00, 0x20, 0x00, 0x30, 0x00, 0x00, 0x00, 0x20, // 88 + 0x20, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x1E, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0xF0, 0x3F, 0x00, 0x00, 0xF0, 0x3F, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x1E, + 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0xC0, 0x03, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x20, // 89 + 0x00, 0x00, 0x30, 0x00, 0x60, 0x00, 0x38, 0x00, 0x60, 0x00, 0x3C, 0x00, 0x60, 0x00, 0x37, 0x00, 0x60, 0x80, 0x33, 0x00, 0x60, + 0xC0, 0x31, 0x00, 0x60, 0xE0, 0x30, 0x00, 0x60, 0x38, 0x30, 0x00, 0x60, 0x1C, 0x30, 0x00, 0x60, 0x0E, 0x30, 0x00, 0x60, 0x07, + 0x30, 0x00, 0xE0, 0x01, 0x30, 0x00, 0xE0, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, // 90 + 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0xE0, 0xFF, 0xFF, 0x07, 0x60, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0x06, // 91 + 0x60, 0x00, 0x00, 0x00, 0xE0, 0x03, 0x00, 0x00, 0x80, 0x3F, 0x00, 0x00, 0x00, 0xFC, 0x01, 0x00, 0x00, 0xE0, 0x0F, 0x00, 0x00, + 0x00, 0x3E, 0x00, 0x00, 0x00, 0x30, // 92 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0x06, 0xE0, 0xFF, 0xFF, 0x07, 0xE0, + 0xFF, 0xFF, 0x07, // 93 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0xE0, + 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, + 0x20, // 94 + 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, + 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, + 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, // 95 + 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x80, // 96 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0E, 0x00, 0x00, 0x1C, 0x1F, 0x00, 0x00, 0x8C, 0x39, 0x00, 0x00, 0x86, 0x31, 0x00, 0x00, + 0x86, 0x31, 0x00, 0x00, 0xC6, 0x30, 0x00, 0x00, 0xC6, 0x18, 0x00, 0x00, 0xCE, 0x1C, 0x00, 0x00, 0xFC, 0x1F, 0x00, 0x00, 0xF8, + 0x3F, 0x00, 0x00, 0x00, 0x20, // 97 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x18, 0x0C, 0x00, 0x00, + 0x0C, 0x18, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x0E, 0x38, 0x00, 0x00, 0x1C, + 0x1C, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xF0, 0x03, // 98 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x07, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0x1C, 0x1C, 0x00, 0x00, 0x0E, 0x38, 0x00, 0x00, + 0x06, 0x30, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x0E, 0x18, 0x00, 0x00, 0x1C, 0x1C, 0x00, 0x00, 0x18, + 0x0C, // 99 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x03, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0x1C, 0x1C, 0x00, 0x00, 0x0E, 0x38, 0x00, 0x00, + 0x06, 0x30, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x0C, 0x18, 0x00, 0x00, 0x18, 0x0C, 0x00, 0xE0, 0xFF, + 0x3F, 0x00, 0xE0, 0xFF, 0x3F, // 100 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x07, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xCC, 0x1C, 0x00, 0x00, 0xCE, 0x38, 0x00, 0x00, + 0xC6, 0x30, 0x00, 0x00, 0xC6, 0x30, 0x00, 0x00, 0xC6, 0x30, 0x00, 0x00, 0xCE, 0x38, 0x00, 0x00, 0xDC, 0x18, 0x00, 0x00, 0xF8, + 0x0C, 0x00, 0x00, 0xF0, 0x04, // 101 + 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0xC0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x60, 0x06, 0x00, 0x00, 0x60, + 0x06, 0x00, 0x00, 0x60, 0x06, // 102 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x83, 0x01, 0x00, 0xF8, 0x8F, 0x03, 0x00, 0x1C, 0x1C, 0x07, 0x00, 0x0E, 0x38, 0x06, 0x00, + 0x06, 0x30, 0x06, 0x00, 0x06, 0x30, 0x06, 0x00, 0x06, 0x30, 0x06, 0x00, 0x0C, 0x18, 0x07, 0x00, 0x18, 0x8C, 0x03, 0x00, 0xFE, + 0xFF, 0x03, 0x00, 0xFE, 0xFF, // 103 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x0C, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0xFC, + 0x3F, 0x00, 0x00, 0xF8, 0x3F, // 104 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xFE, 0x3F, 0x00, 0x60, 0xFE, 0x3F, // 105 + 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x60, 0xFE, 0xFF, 0x07, 0x60, 0xFE, 0xFF, 0x03, // 106 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, + 0xE0, 0x00, 0x00, 0x00, 0xF0, 0x01, 0x00, 0x00, 0x98, 0x07, 0x00, 0x00, 0x0C, 0x0F, 0x00, 0x00, 0x06, 0x3C, 0x00, 0x00, 0x02, + 0x30, 0x00, 0x00, 0x00, 0x20, // 107 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, // 108 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x3F, 0x00, 0x00, 0xFE, 0x3F, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xF8, + 0x3F, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0E, 0x00, + 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xF8, 0x3F, // 109 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x3F, 0x00, 0x00, 0xFE, 0x3F, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x0C, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0xFC, + 0x3F, 0x00, 0x00, 0xF8, 0x3F, // 110 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x07, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0x1C, 0x1C, 0x00, 0x00, 0x0E, 0x38, 0x00, 0x00, + 0x06, 0x30, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x0E, 0x38, 0x00, 0x00, 0x1C, 0x1C, 0x00, 0x00, 0xF8, + 0x0F, 0x00, 0x00, 0xF0, 0x07, // 111 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0x07, 0x00, 0xFE, 0xFF, 0x07, 0x00, 0x18, 0x0C, 0x00, 0x00, + 0x0C, 0x18, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x0E, 0x38, 0x00, 0x00, 0x1C, + 0x1C, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xF0, 0x03, // 112 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x03, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0x1C, 0x1C, 0x00, 0x00, 0x0E, 0x38, 0x00, 0x00, + 0x06, 0x30, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x0C, 0x18, 0x00, 0x00, 0x18, 0x0C, 0x00, 0x00, 0xFE, + 0xFF, 0x07, 0x00, 0xFE, 0xFF, 0x07, // 113 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x3F, 0x00, 0x00, 0xFE, 0x3F, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, // 114 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x0C, 0x00, 0x00, 0x7C, 0x1C, 0x00, 0x00, 0xEE, 0x38, 0x00, 0x00, 0xC6, 0x30, 0x00, 0x00, + 0xC6, 0x30, 0x00, 0x00, 0xC6, 0x31, 0x00, 0x00, 0xC6, 0x31, 0x00, 0x00, 0x8E, 0x39, 0x00, 0x00, 0x9C, 0x1F, 0x00, 0x00, 0x18, + 0x0F, // 115 + 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0xC0, 0xFF, 0x1F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, + 0x06, 0x30, 0x00, 0x00, 0x06, 0x30, // 116 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x0F, 0x00, 0x00, 0xFE, 0x1F, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, + 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0xFE, + 0x3F, 0x00, 0x00, 0xFE, 0x3F, // 117 + 0x00, 0x06, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, + 0x00, 0x38, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, + 0x06, // 118 + 0x00, 0x0E, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0xF0, 0x03, 0x00, 0x00, 0x80, 0x1F, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, + 0x80, 0x1F, 0x00, 0x00, 0xE0, 0x03, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0xE0, + 0x03, 0x00, 0x00, 0x80, 0x1F, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x80, 0x1F, 0x00, 0x00, 0xF0, 0x03, 0x00, 0x00, 0x7E, 0x00, + 0x00, 0x00, 0x0E, // 119 + 0x00, 0x02, 0x20, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x1E, 0x3C, 0x00, 0x00, 0x38, 0x0E, 0x00, 0x00, 0xF0, 0x07, 0x00, 0x00, + 0xC0, 0x01, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0x38, 0x0E, 0x00, 0x00, 0x1C, 0x3C, 0x00, 0x00, 0x0E, 0x30, 0x00, 0x00, 0x02, + 0x20, // 120 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x06, 0x00, 0xF0, 0x01, 0x06, 0x00, 0x80, 0x0F, 0x07, 0x00, + 0x00, 0xFE, 0x03, 0x00, 0x00, 0xFC, 0x00, 0x00, 0xC0, 0x1F, 0x00, 0x00, 0xF8, 0x03, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, + 0x06, // 121 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x06, 0x3C, 0x00, 0x00, 0x06, 0x3E, 0x00, 0x00, 0x06, 0x37, 0x00, 0x00, + 0xC6, 0x33, 0x00, 0x00, 0xE6, 0x30, 0x00, 0x00, 0x76, 0x30, 0x00, 0x00, 0x3E, 0x30, 0x00, 0x00, 0x1E, 0x30, 0x00, 0x00, 0x06, + 0x30, // 122 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0xC0, 0x03, 0x00, 0xC0, 0xFF, 0xFF, 0x03, 0xE0, 0x3F, 0xFC, 0x07, 0x60, + 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0x06, // 123 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x0F, 0xE0, 0xFF, 0xFF, 0x0F, // 124 + 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0x06, 0xE0, 0x3F, 0xFC, 0x07, 0xC0, 0xFF, 0xFF, 0x03, 0x00, + 0xC0, 0x03, 0x00, 0x00, 0x80, 0x01, // 125 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, + 0x30, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0xC0, + 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x60, // 126 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE6, 0xFF, 0x07, 0x00, 0xE6, 0xFF, 0x07, // 161 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x07, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0x1C, 0x9C, 0x07, 0x00, 0x0E, 0x78, 0x00, 0x00, + 0x06, 0x3F, 0x00, 0x00, 0xE6, 0x30, 0x00, 0x00, 0x1E, 0x30, 0x00, 0xE0, 0x0D, 0x18, 0x00, 0x00, 0x1C, 0x0E, 0x00, 0x00, 0x10, + 0x06, // 162 + 0x00, 0x60, 0x10, 0x00, 0x00, 0x60, 0x38, 0x00, 0x80, 0x7F, 0x1C, 0x00, 0xC0, 0xFF, 0x1F, 0x00, 0xE0, 0xE0, 0x19, 0x00, 0x60, + 0x60, 0x18, 0x00, 0x60, 0x60, 0x18, 0x00, 0x60, 0x60, 0x30, 0x00, 0xE0, 0x00, 0x30, 0x00, 0xC0, 0x01, 0x30, 0x00, 0x80, 0x01, + 0x38, 0x00, 0x00, 0x00, 0x10, // 163 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0xF7, 0x0E, 0x00, 0x00, 0xFE, 0x07, 0x00, 0x00, 0x0C, 0x03, 0x00, 0x00, + 0x06, 0x06, 0x00, 0x00, 0x06, 0x06, 0x00, 0x00, 0x06, 0x06, 0x00, 0x00, 0x06, 0x06, 0x00, 0x00, 0x0C, 0x03, 0x00, 0x00, 0xFE, + 0x07, 0x00, 0x00, 0xF7, 0x0E, 0x00, 0x00, 0x02, 0x04, // 164 + 0xE0, 0x60, 0x06, 0x00, 0xC0, 0x61, 0x06, 0x00, 0x80, 0x67, 0x06, 0x00, 0x00, 0x6E, 0x06, 0x00, 0x00, 0x7C, 0x06, 0x00, 0x00, + 0xF0, 0x3F, 0x00, 0x00, 0xF0, 0x3F, 0x00, 0x00, 0x7C, 0x06, 0x00, 0x00, 0x7E, 0x06, 0x00, 0x80, 0x67, 0x06, 0x00, 0xC0, 0x61, + 0x06, 0x00, 0xE0, 0x60, 0x06, 0x00, 0x20, // 165 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x7F, 0xF8, 0x0F, 0xE0, 0x7F, 0xF8, 0x0F, // 166 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x80, 0xF3, 0xC1, 0x00, 0xC0, 0x1F, 0xC3, 0x03, 0xE0, 0x0C, 0x07, 0x03, 0x60, + 0x1C, 0x06, 0x06, 0x60, 0x18, 0x0C, 0x06, 0x60, 0x30, 0x1C, 0x06, 0xE0, 0x70, 0x38, 0x07, 0xC0, 0xE1, 0xF4, 0x03, 0x80, 0xC1, + 0xE7, 0x01, 0x00, 0x80, 0x03, // 167 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x60, 0x30, 0x30, 0x00, 0x6C, + 0x30, 0x30, 0x00, 0x6C, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x6C, 0x30, + 0x30, 0x00, 0x6C, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x00, 0x30, // 168 + 0x00, 0xF8, 0x00, 0x00, 0x00, 0xFE, 0x03, 0x00, 0x00, 0x07, 0x07, 0x00, 0x80, 0x01, 0x0C, 0x00, 0xC0, 0x78, 0x1C, 0x00, 0xC0, + 0xFE, 0x19, 0x00, 0x60, 0x86, 0x31, 0x00, 0x60, 0x03, 0x33, 0x00, 0x60, 0x03, 0x33, 0x00, 0x60, 0x03, 0x33, 0x00, 0x60, 0x03, + 0x33, 0x00, 0x60, 0x87, 0x33, 0x00, 0xC0, 0x86, 0x19, 0x00, 0xC0, 0x85, 0x1C, 0x00, 0x80, 0x01, 0x0C, 0x00, 0x00, 0x07, 0x07, + 0x00, 0x00, 0xFE, 0x03, 0x00, 0x00, 0xF8, // 169 + 0x00, 0x00, 0x00, 0x00, 0xC0, 0x1C, 0x00, 0x00, 0xE0, 0x3E, 0x00, 0x00, 0x60, 0x32, 0x00, 0x00, 0x60, 0x32, 0x00, 0x00, 0xE0, + 0x3F, 0x00, 0x00, 0xC0, 0x3F, // 170 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xE0, 0x03, 0x00, 0x00, 0x78, 0x0F, 0x00, 0x00, 0x1C, 0x1C, 0x00, 0x00, + 0x84, 0x10, 0x00, 0x00, 0xE0, 0x03, 0x00, 0x00, 0x78, 0x0F, 0x00, 0x00, 0x1C, 0x1C, 0x00, 0x00, 0x04, 0x10, // 171 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, + 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0xFC, + 0x01, 0x00, 0x00, 0xFC, 0x01, // 172 + 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, + 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, // 173 + 0x00, 0xF8, 0x00, 0x00, 0x00, 0xFE, 0x03, 0x00, 0x00, 0x07, 0x07, 0x00, 0x80, 0x01, 0x0C, 0x00, 0xC0, 0x00, 0x1C, 0x00, 0xC0, + 0xFE, 0x1B, 0x00, 0x60, 0xFE, 0x33, 0x00, 0x60, 0x66, 0x30, 0x00, 0x60, 0x66, 0x30, 0x00, 0x60, 0xE6, 0x30, 0x00, 0x60, 0xFE, + 0x31, 0x00, 0x60, 0x3C, 0x33, 0x00, 0xC0, 0x00, 0x1A, 0x00, 0xC0, 0x01, 0x1C, 0x00, 0x80, 0x01, 0x0C, 0x00, 0x00, 0x07, 0x07, + 0x00, 0x00, 0xFE, 0x03, 0x00, 0x00, 0xF8, // 174 + 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, + 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, + 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, // 175 + 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x40, 0x04, 0x00, 0x00, 0x20, 0x08, 0x00, 0x00, 0x20, 0x08, 0x00, 0x00, 0x20, + 0x08, 0x00, 0x00, 0x40, 0x04, 0x00, 0x00, 0x80, 0x03, // 176 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, + 0x60, 0x30, 0x00, 0x00, 0xFF, 0x3F, 0x00, 0x00, 0xFF, 0x3F, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x60, + 0x30, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x60, 0x30, // 177 + 0x40, 0x20, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x20, 0x38, 0x00, 0x00, 0x20, 0x2C, 0x00, 0x00, 0x20, 0x26, 0x00, 0x00, 0xE0, + 0x23, 0x00, 0x00, 0xC0, 0x21, // 178 + 0x40, 0x10, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, 0x20, 0x22, 0x00, 0x00, 0x20, 0x22, 0x00, 0x00, 0xE0, + 0x3D, 0x00, 0x00, 0xC0, 0x1D, // 179 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x20, // 180 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0x07, 0x00, 0xFE, 0xFF, 0x07, 0x00, 0x00, 0x1C, 0x00, 0x00, + 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0xFE, + 0x3F, 0x00, 0x00, 0xFE, 0x3F, // 181 + 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x3F, 0x00, 0x00, 0xC0, 0x3F, 0x00, 0x00, 0xE0, 0x7F, 0x00, 0x00, 0xE0, 0x7F, 0x00, 0x00, 0xE0, + 0xFF, 0xFF, 0x07, 0xE0, 0xFF, 0xFF, 0x07, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0xE0, 0xFF, + 0xFF, 0x07, 0x60, 0x00, 0x00, 0x00, 0x60, // 182 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, // 183 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x07, 0x00, 0x00, 0xF8, 0x1F, 0x00, 0x80, 0x9C, 0x1C, 0x00, 0x00, 0x8C, 0x30, 0x00, 0x00, + 0x86, 0x30, 0x00, 0x00, 0x86, 0x30, 0x00, 0x00, 0x86, 0x30, 0x00, 0x00, 0x8C, 0x30, 0x00, 0x80, 0x9C, 0x18, 0x00, 0x00, 0xF8, + 0x1C, 0x00, 0x00, 0xF0, 0x0C, // 184 + 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0xE0, 0x3F, 0x00, 0x00, 0xE0, + 0x3F, // 185 + 0x00, 0x00, 0x00, 0x00, 0x80, 0x0F, 0x00, 0x00, 0xC0, 0x1F, 0x00, 0x00, 0xE0, 0x38, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0xE0, + 0x38, 0x00, 0x00, 0xC0, 0x1F, 0x00, 0x00, 0x80, 0x0F, // 186 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x10, 0x00, 0x00, 0x1C, 0x1C, 0x00, 0x00, + 0x78, 0x0F, 0x00, 0x00, 0xE0, 0x03, 0x00, 0x00, 0x84, 0x10, 0x00, 0x00, 0x1C, 0x1C, 0x00, 0x00, 0x78, 0x0F, 0x00, 0x00, 0xE0, + 0x03, 0x00, 0x00, 0x80, // 187 + 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x20, 0x00, 0xE0, 0x3F, 0x38, 0x00, 0xE0, + 0x3F, 0x1C, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0xC0, 0x01, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x78, + 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x80, 0x07, 0x0C, 0x00, 0xC0, 0x01, 0x0E, 0x00, 0xE0, 0x80, 0x0B, + 0x00, 0x60, 0xC0, 0x08, 0x00, 0x00, 0xE0, 0x3F, 0x00, 0x00, 0xE0, 0x3F, 0x00, 0x00, 0x00, 0x08, // 188 + 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x20, 0x00, 0xE0, 0x3F, 0x30, 0x00, 0xE0, + 0x3F, 0x1C, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0xC0, 0x01, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x70, + 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x4E, 0x20, 0x00, 0x00, 0x67, 0x30, 0x00, 0xC0, 0x21, 0x38, 0x00, 0xE0, 0x20, 0x2C, + 0x00, 0x60, 0x20, 0x26, 0x00, 0x00, 0xE0, 0x27, 0x00, 0x00, 0xC0, 0x21, // 189 + 0x40, 0x10, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, 0x20, 0x22, 0x20, 0x00, 0x20, 0x22, 0x30, 0x00, 0xE0, + 0x3D, 0x38, 0x00, 0xC0, 0x1D, 0x0E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x70, + 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x0E, 0x0C, 0x00, 0x00, 0x07, 0x0E, 0x00, 0x80, 0x83, 0x0B, 0x00, 0xE0, 0xC0, 0x09, + 0x00, 0x60, 0xE0, 0x3F, 0x00, 0x20, 0xE0, 0x3F, 0x00, 0x00, 0x00, 0x08, // 190 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xF0, 0x01, 0x00, 0x00, 0xF8, 0x03, 0x00, 0x00, 0x0C, 0x03, 0x00, 0xF6, 0x07, 0x03, 0x00, 0xF6, 0x07, 0x03, 0x00, 0x00, + 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x90, 0x03, 0x00, 0x00, 0xF0, 0x01, 0x00, 0x00, 0xE0, // 191 + 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x80, 0x0F, 0x00, 0x00, 0xF0, 0x03, 0x00, 0x00, 0xFE, 0x01, 0x00, 0x80, + 0x8F, 0x01, 0x00, 0xE0, 0x83, 0x01, 0x00, 0x60, 0x80, 0x01, 0x00, 0xE0, 0x83, 0x01, 0x00, 0x80, 0x8F, 0x01, 0x00, 0x00, 0xFE, + 0x01, 0x00, 0x00, 0xF0, 0x03, 0x00, 0x00, 0x80, 0x0F, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x30, // 192 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, + 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, + 0x30, 0x00, 0x60, 0x60, 0x38, 0x00, 0x60, 0xE0, 0x1F, 0x00, 0x00, 0xC0, 0x1F, 0x00, 0x00, 0x80, 0x07, // 193 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, + 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, + 0x30, 0x00, 0xC0, 0x78, 0x30, 0x00, 0xC0, 0xFF, 0x18, 0x00, 0x80, 0xC7, 0x1F, 0x00, 0x00, 0x80, 0x07, // 194 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, // 195 + 0x00, 0x00, 0xF0, 0x01, 0x00, 0x00, 0xF0, 0x01, 0x00, 0x00, 0x3E, 0x00, 0x80, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x33, 0x00, 0xE0, + 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, + 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0xF0, 0x01, // 196 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, + 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, + 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x00, 0x30, // 197 + 0x60, 0x00, 0x20, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x3C, 0x00, 0xE0, 0x00, 0x1F, 0x00, 0xC0, 0x87, 0x07, 0x00, 0x00, + 0xCF, 0x03, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0xE0, 0xFF, + 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0xFC, 0x00, + 0x00, 0x00, 0xCF, 0x03, 0x00, 0xC0, 0x87, 0x07, 0x00, 0xE0, 0x01, 0x1F, 0x00, 0x60, 0x00, 0x3C, 0x00, 0x60, 0x00, 0x38, 0x00, + 0x60, 0x00, 0x20, // 198 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x00, 0x80, 0x03, 0x0E, 0x00, 0xC0, 0x03, 0x1C, 0x00, 0xE0, 0x00, 0x38, 0x00, 0x60, + 0x00, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x78, 0x30, 0x00, 0xE0, 0x7C, + 0x38, 0x00, 0xC0, 0xEF, 0x1F, 0x00, 0x00, 0xC7, 0x0F, // 199 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, + 0x00, 0x0F, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x1E, + 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0xC0, 0x03, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, // 200 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x06, + 0x00, 0x0F, 0x00, 0x0C, 0x80, 0x03, 0x00, 0x08, 0xE0, 0x01, 0x00, 0x08, 0x70, 0x00, 0x00, 0x08, 0x3C, 0x00, 0x00, 0x0C, 0x0E, + 0x00, 0x00, 0x86, 0x07, 0x00, 0x00, 0xC0, 0x01, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, // 201 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, + 0x30, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0xCF, 0x03, 0x00, 0xC0, 0x87, 0x07, 0x00, 0xE0, 0x00, + 0x1F, 0x00, 0x60, 0x00, 0x3C, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x20, // 202 + 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0xC0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x1F, 0x00, 0xE0, + 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, // 203 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0x00, 0x00, 0x00, 0xC0, + 0x0F, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x0F, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0xFE, 0x00, 0x00, 0xC0, 0x0F, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, + 0x00, 0xE0, 0xFF, 0x3F, // 204 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, + 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, + 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, // 205 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x01, 0x00, 0x00, 0xFF, 0x07, 0x00, 0x80, 0x07, 0x0F, 0x00, 0xC0, 0x01, 0x1C, 0x00, 0xC0, + 0x00, 0x18, 0x00, 0xE0, 0x00, 0x38, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, + 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0xE0, 0x00, 0x38, 0x00, 0xC0, 0x00, 0x18, 0x00, 0xC0, 0x01, 0x1C, 0x00, 0x80, 0x07, 0x0F, + 0x00, 0x00, 0xFF, 0x07, 0x00, 0x00, 0xFC, 0x01, // 206 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, // 207 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x60, 0x60, 0x00, 0x00, 0x60, + 0x60, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x60, 0x60, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0xC0, 0x30, 0x00, 0x00, 0xC0, 0x3F, 0x00, 0x00, 0x00, 0x0F, // 208 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x01, 0x00, 0x00, 0xFF, 0x07, 0x00, 0x80, 0x07, 0x0E, 0x00, 0xC0, 0x01, 0x1C, 0x00, 0xC0, + 0x00, 0x18, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, + 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0xC0, 0x00, 0x18, 0x00, 0xC0, 0x01, 0x1C, 0x00, 0x80, 0x03, 0x0F, 0x00, 0x00, 0x02, + 0x03, // 209 + 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, // 210 + 0x20, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xE0, 0x01, 0x30, 0x00, 0x80, 0x07, 0x30, 0x00, 0x00, 0x1E, 0x30, 0x00, 0x00, + 0x78, 0x30, 0x00, 0x00, 0xE0, 0x38, 0x00, 0x00, 0xC0, 0x0F, 0x00, 0x00, 0xC0, 0x07, 0x00, 0x00, 0xF0, 0x01, 0x00, 0x00, 0x7C, + 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x03, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x20, // 211 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0xFE, 0x01, 0x00, 0x00, 0x8F, 0x03, 0x00, 0x00, 0x03, 0x07, 0x00, 0x80, + 0x01, 0x06, 0x00, 0x80, 0x01, 0x0C, 0x00, 0x80, 0x01, 0x0C, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x80, 0x01, + 0x0C, 0x00, 0x80, 0x01, 0x0C, 0x00, 0x80, 0x01, 0x06, 0x00, 0x00, 0x03, 0x07, 0x00, 0x00, 0x87, 0x03, 0x00, 0x00, 0xFE, 0x01, + 0x00, 0x00, 0xF8, // 212 + 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x30, 0x00, 0x60, 0x00, 0x38, 0x00, 0xE0, 0x01, 0x1E, 0x00, 0xC0, 0x83, 0x07, 0x00, 0x00, + 0xCF, 0x03, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x80, 0xCF, 0x03, 0x00, 0xC0, 0x83, + 0x07, 0x00, 0xE0, 0x01, 0x1E, 0x00, 0x60, 0x00, 0x38, 0x00, 0x20, 0x00, 0x30, 0x00, 0x20, 0x00, 0x20, // 213 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, + 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, + 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0xF0, + 0x00, 0x00, 0x00, 0xF0, // 214 + 0x00, 0x00, 0x00, 0x00, 0xE0, 0x1F, 0x00, 0x00, 0xE0, 0x3F, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, + 0xC0, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0xC0, + 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, // 215 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, + 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0xE0, 0xFF, + 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, + 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, // 216 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, + 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0xE0, 0xFF, + 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, + 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0xF0, 0x01, + 0x00, 0x00, 0xF0, 0x01, // 217 + 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xE0, + 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, + 0x30, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x70, 0x38, 0x00, 0x00, 0xE0, 0x1C, + 0x00, 0x00, 0xC0, 0x0F, 0x00, 0x00, 0x80, 0x07, // 218 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, + 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, + 0x30, 0x00, 0x00, 0x70, 0x38, 0x00, 0x00, 0xE0, 0x1C, 0x00, 0x00, 0xC0, 0x0F, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, // 219 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, + 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, + 0x30, 0x00, 0x00, 0x70, 0x38, 0x00, 0x00, 0xE0, 0x1C, 0x00, 0x00, 0xC0, 0x0F, 0x00, 0x00, 0x80, 0x07, // 220 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x02, 0x00, 0x80, 0x03, 0x0E, 0x00, 0xC0, 0x01, 0x1C, 0x00, 0xC0, 0x00, 0x18, 0x00, 0x60, + 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, 0x30, 0x00, 0x60, 0x30, + 0x30, 0x00, 0xC0, 0x30, 0x18, 0x00, 0xC0, 0x30, 0x1C, 0x00, 0x80, 0x33, 0x0E, 0x00, 0x00, 0xFF, 0x07, 0x00, 0x00, 0xFC, + 0x03, // 221 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, + 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xFE, 0x03, 0x00, 0x80, 0xFF, 0x0F, 0x00, 0xC0, 0x03, + 0x1E, 0x00, 0xE0, 0x00, 0x18, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, + 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0x30, 0x00, 0xE0, 0x00, 0x38, 0x00, 0xC0, 0x01, 0x1C, 0x00, 0x80, 0x07, 0x0F, 0x00, + 0x00, 0xFF, 0x07, 0x00, 0x00, 0xFC, 0x01, // 222 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x30, 0x00, 0x80, 0x0F, 0x38, 0x00, 0xC0, 0x1D, 0x1E, 0x00, 0xE0, + 0xB8, 0x0F, 0x00, 0x60, 0xF0, 0x03, 0x00, 0x60, 0xF0, 0x01, 0x00, 0x60, 0x70, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x60, 0x30, + 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x3F, // 223 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0E, 0x00, 0x00, 0x1C, 0x1F, 0x00, 0x00, 0x8C, 0x39, 0x00, 0x00, 0x86, 0x31, 0x00, 0x00, + 0x86, 0x31, 0x00, 0x00, 0xC6, 0x30, 0x00, 0x00, 0xC6, 0x10, 0x00, 0x00, 0xCE, 0x18, 0x00, 0x00, 0xFC, 0x1F, 0x00, 0x00, 0xF8, + 0x3F, 0x00, 0x00, 0x00, 0x20, // 224 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x03, 0x00, 0x80, 0xFF, 0x0F, 0x00, 0xC0, 0x19, 0x1E, 0x00, 0xE0, 0x0C, 0x38, 0x00, 0x60, + 0x0C, 0x30, 0x00, 0x60, 0x04, 0x30, 0x00, 0x60, 0x04, 0x30, 0x00, 0x60, 0x0C, 0x30, 0x00, 0x60, 0x0C, 0x38, 0x00, 0x60, 0x78, + 0x1E, 0x00, 0x70, 0xF0, 0x0F, 0x00, 0x10, 0xC0, 0x03, // 225 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0x84, 0x31, 0x00, 0x00, + 0x84, 0x31, 0x00, 0x00, 0x84, 0x31, 0x00, 0x00, 0x84, 0x31, 0x00, 0x00, 0xCC, 0x31, 0x00, 0x00, 0xFC, 0x31, 0x00, 0x00, 0x78, + 0x1B, 0x00, 0x00, 0x00, 0x0E, // 226 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, // 227 + 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, 0x30, 0x00, 0x00, + 0x04, 0x30, 0x00, 0x00, 0x04, 0x30, 0x00, 0x00, 0x04, 0x30, 0x00, 0x00, 0x04, 0x30, 0x00, 0x00, 0x04, 0x30, 0x00, 0x00, 0xFC, + 0x3F, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0x00, 0xF0, // 228 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x07, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xCC, 0x1C, 0x00, 0x00, 0xCE, 0x38, 0x00, 0x00, + 0xC6, 0x30, 0x00, 0x00, 0xC6, 0x30, 0x00, 0x00, 0xC6, 0x30, 0x00, 0x00, 0xCE, 0x38, 0x00, 0x00, 0xDC, 0x18, 0x00, 0x00, 0xF8, + 0x0C, 0x00, 0x00, 0xF0, 0x04, // 229 + 0x00, 0x04, 0x20, 0x00, 0x00, 0x04, 0x38, 0x00, 0x00, 0x0C, 0x3C, 0x00, 0x00, 0x38, 0x0F, 0x00, 0x00, 0x60, 0x03, 0x00, 0x00, + 0xC0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xC0, + 0x01, 0x00, 0x00, 0x60, 0x03, 0x00, 0x00, 0x38, 0x0F, 0x00, 0x00, 0x0C, 0x1C, 0x00, 0x00, 0x04, 0x38, 0x00, 0x00, 0x04, + 0x20, // 230 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1C, 0x00, 0x00, 0x1C, 0x3C, 0x00, 0x00, 0x0C, 0x30, 0x00, 0x00, 0x86, 0x20, 0x00, 0x00, + 0x86, 0x20, 0x00, 0x00, 0xC6, 0x30, 0x00, 0x00, 0xFC, 0x31, 0x00, 0x00, 0x7C, 0x3F, 0x00, 0x00, 0x30, 0x1F, // 231 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0xFC, + 0x3F, 0x00, 0x00, 0xFC, 0x3F, // 232 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x60, 0xFC, 0x3F, 0x00, 0xC0, 0x00, 0x3C, 0x00, 0x80, + 0x00, 0x0F, 0x00, 0x80, 0xC0, 0x03, 0x00, 0x80, 0xE0, 0x01, 0x00, 0xC0, 0x70, 0x00, 0x00, 0x60, 0x18, 0x00, 0x00, 0x00, 0xFC, + 0x3F, 0x00, 0x00, 0xFC, 0x3F, // 233 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, + 0xC0, 0x01, 0x00, 0x00, 0x70, 0x07, 0x00, 0x00, 0x3C, 0x1E, 0x00, 0x00, 0x0C, 0x3C, 0x00, 0x00, 0x04, 0x30, // 234 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0xF8, 0x3F, 0x00, 0x00, 0xFC, 0x1F, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xFC, + 0x3F, 0x00, 0x00, 0xFC, 0x3F, // 235 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, + 0x78, 0x00, 0x00, 0x00, 0xE0, 0x03, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xE0, + 0x03, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, 0x3F, // 236 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xFC, + 0x3F, 0x00, 0x00, 0xFC, 0x3F, // 237 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x07, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0x1C, 0x1C, 0x00, 0x00, 0x0E, 0x38, 0x00, 0x00, + 0x06, 0x30, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x0E, 0x38, 0x00, 0x00, 0x1C, 0x1C, 0x00, 0x00, 0xF8, + 0x0F, 0x00, 0x00, 0xF0, 0x07, // 238 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, + 0x3F, // 239 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0x07, 0x00, 0xFE, 0xFF, 0x07, 0x00, 0x18, 0x0C, 0x00, 0x00, + 0x0C, 0x18, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x0E, 0x38, 0x00, 0x00, 0x1C, + 0x1C, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xF0, 0x03, // 240 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x07, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0x1C, 0x1C, 0x00, 0x00, 0x0E, 0x38, 0x00, 0x00, + 0x06, 0x30, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x0E, 0x18, 0x00, 0x00, 0x1C, 0x1C, 0x00, 0x00, 0x18, + 0x0C, // 241 + 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, + 0xFC, 0x3F, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x04, // 242 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x06, 0x00, 0xF0, 0x01, 0x06, 0x00, 0x80, 0x0F, 0x07, 0x00, + 0x00, 0xFE, 0x03, 0x00, 0x00, 0xFC, 0x00, 0x00, 0xC0, 0x1F, 0x00, 0x00, 0xF8, 0x03, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, + 0x06, // 243 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x07, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0x1C, 0x18, 0x00, 0x00, 0x0C, 0x30, 0x00, 0x00, + 0x06, 0x30, 0x00, 0x00, 0x06, 0x20, 0x00, 0x00, 0x04, 0x30, 0x00, 0x00, 0x0C, 0x18, 0x00, 0x80, 0xFF, 0xFF, 0x01, 0x80, 0xFF, + 0xFF, 0x01, 0x00, 0x0C, 0x18, 0x00, 0x00, 0x04, 0x30, 0x00, 0x00, 0x06, 0x20, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x0C, 0x30, + 0x00, 0x00, 0x1C, 0x18, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xF0, 0x07, // 244 + 0x00, 0x02, 0x20, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x1E, 0x3C, 0x00, 0x00, 0x38, 0x0E, 0x00, 0x00, 0xF0, 0x07, 0x00, 0x00, + 0xC0, 0x01, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0x38, 0x0E, 0x00, 0x00, 0x1C, 0x3C, 0x00, 0x00, 0x0E, 0x30, 0x00, 0x00, 0x02, + 0x20, // 245 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, + 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0xFC, + 0x3F, 0x00, 0x00, 0xFC, 0xFF, 0x00, 0x00, 0x00, 0xF0, // 246 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0xFC, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, + 0x3F, // 247 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, + 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, + 0x3F, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, + 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, 0x3F, // 248 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, + 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, + 0x3F, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, + 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, 0xFF, 0x00, 0x00, 0x00, 0xF0, // 249 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, + 0xFC, 0x3F, 0x00, 0x00, 0xC0, 0x30, 0x00, 0x00, 0xC0, 0x30, 0x00, 0x00, 0xC0, 0x30, 0x00, 0x00, 0xC0, 0x30, 0x00, 0x00, 0xC0, + 0x30, 0x00, 0x00, 0x80, 0x39, 0x00, 0x00, 0x80, 0x1F, 0x00, 0x00, 0x00, 0x0F, // 250 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xC0, 0x30, 0x00, 0x00, + 0xC0, 0x30, 0x00, 0x00, 0xC0, 0x30, 0x00, 0x00, 0xC0, 0x30, 0x00, 0x00, 0xC0, 0x31, 0x00, 0x00, 0x80, 0x39, 0x00, 0x00, 0x80, + 0x1F, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, 0x3F, // 251 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xC0, 0x30, 0x00, 0x00, + 0xC0, 0x30, 0x00, 0x00, 0xC0, 0x30, 0x00, 0x00, 0xC0, 0x30, 0x00, 0x00, 0x80, 0x31, 0x00, 0x00, 0x80, 0x3B, 0x00, 0x00, 0x00, + 0x1F, 0x00, 0x00, 0x00, 0x0E, // 252 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x1C, 0x0E, 0x00, 0x00, 0x0C, 0x1C, 0x00, 0x00, 0x06, 0x38, 0x00, 0x00, + 0xC6, 0x30, 0x00, 0x00, 0xC6, 0x30, 0x00, 0x00, 0xC6, 0x30, 0x00, 0x00, 0xCC, 0x38, 0x00, 0x00, 0xFC, 0x1F, 0x00, 0x00, 0xF0, + 0x07, // 253 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0xE0, 0x03, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0x3C, 0x1E, 0x00, 0x00, 0x0C, 0x30, 0x00, 0x00, 0x06, + 0x30, 0x00, 0x00, 0x06, 0x20, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x0C, 0x30, 0x00, 0x00, 0x1C, 0x3C, 0x00, 0x00, 0xF8, 0x1F, + 0x00, 0x00, 0xE0, 0x07, // 254 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x30, 0x00, 0x00, 0xFC, 0x38, 0x00, 0x00, 0xCC, 0x1D, 0x00, 0x00, 0x8C, 0x0F, 0x00, 0x00, + 0x84, 0x03, 0x00, 0x00, 0x84, 0x01, 0x00, 0x00, 0x84, 0x01, 0x00, 0x00, 0x84, 0x01, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, + 0x3F, // 255 }; \ No newline at end of file diff --git a/src/graphics/fonts/OLEDDisplayFontsRU.h b/src/graphics/fonts/OLEDDisplayFontsRU.h index 7510dcdfc..0437517dd 100644 --- a/src/graphics/fonts/OLEDDisplayFontsRU.h +++ b/src/graphics/fonts/OLEDDisplayFontsRU.h @@ -8,4 +8,6 @@ #endif extern const uint8_t ArialMT_Plain_10_RU[] PROGMEM; +extern const uint8_t ArialMT_Plain_16_RU[] PROGMEM; +extern const uint8_t ArialMT_Plain_24_RU[] PROGMEM; #endif \ No newline at end of file From e3dd8164a423a12d88232475a529233144d775b0 Mon Sep 17 00:00:00 2001 From: Constantine Date: Tue, 12 Aug 2025 19:23:34 +0300 Subject: [PATCH 113/180] nRF52840 promicro deepsleep fix with some additions (#7407) * Pro-Micro DeepSleep Quick Fix It is noticed that some nRF52840 boards (pro-micro in particular) stopped waking up from the deep sleep state (shutdown state) with a press of a button. The problem is in a Serial1.end() call. * Clear GPREGRET before setting There are some troubles with that register: it is recommended to clear it with 0xFF mask and only after that perform a setting. * Pro-Micro button SENSE signal Added SENSE signal on the user button. It is explicitly enabled now for this platform. * nRF52 pre-sleep main serial check Added another usage check for the main Serial. It could save some nerves in case the port is not in use by any means. Applied trunk fmt to the file. --------- Co-authored-by: Ben Meadors --- src/platform/nrf52/main-nrf52.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/platform/nrf52/main-nrf52.cpp b/src/platform/nrf52/main-nrf52.cpp index 1bf9a39fd..590d2f0ae 100644 --- a/src/platform/nrf52/main-nrf52.cpp +++ b/src/platform/nrf52/main-nrf52.cpp @@ -282,10 +282,14 @@ void cpuDeepSleep(uint32_t msecToWake) #if SPI_INTERFACES_COUNT > 1 SPI1.end(); #endif - // This may cause crashes as debug messages continue to flow. - Serial.end(); + if (Serial) // Another check in case of disabled default serial, does nothing bad + Serial.end(); // This may cause crashes as debug messages continue to flow. + + // This causes troubles with waking up on nrf52 (on pro-micro in particular): + // we have no Serial1 in use on nrf52, check Serial and GPS modules. #ifdef PIN_SERIAL1_RX - Serial1.end(); + if (Serial1) // A straightforward solution to the wake from deepsleep problem + Serial1.end(); #endif setBluetoothEnable(false); @@ -362,6 +366,7 @@ void cpuDeepSleep(uint32_t msecToWake) // Resume on user button press // https://github.com/lyusupov/SoftRF/blob/81c519ca75693b696752235d559e881f2e0511ee/software/firmware/source/SoftRF/src/platform/nRF52.cpp#L1738 constexpr uint32_t DFU_MAGIC_SKIP = 0x6d; + sd_power_gpregret_clr(0, 0xFF); // Clear the register before setting a new values in it for stability reasons sd_power_gpregret_set(0, DFU_MAGIC_SKIP); // Equivalent NRF_POWER->GPREGRET = DFU_MAGIC_SKIP // FIXME, use system off mode with ram retention for key state? @@ -378,6 +383,12 @@ void cpuDeepSleep(uint32_t msecToWake) nrf_gpio_cfg_sense_set(PIN_BUTTON2, sense1); #endif +#ifdef PROMICRO_DIY_TCXO + nrf_gpio_cfg_input(BUTTON_PIN, NRF_GPIO_PIN_PULLUP); // Enable internal pull-up on the button pin + nrf_gpio_pin_sense_t sense = NRF_GPIO_PIN_SENSE_LOW; // Configure SENSE signal on low edge + nrf_gpio_cfg_sense_set(BUTTON_PIN, sense); // Apply SENSE to wake up the device from the deep sleep +#endif + auto ok = sd_power_system_off(); if (ok != NRF_SUCCESS) { LOG_ERROR("FIXME: Ignoring soft device (EasyDMA pending?) and forcing system-off!"); From ddd149945ab5886c95d7d59d3c1c30df6855db66 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Tue, 12 Aug 2025 16:08:03 -0500 Subject: [PATCH 114/180] More spoof remediation (#7612) * More spoof remediation * Fix signed comparison error * Only fire self-bound messages into the routing module * Update src/mesh/MeshModule.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * String const --------- Co-authored-by: Ben Meadors Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/mesh/MeshModule.cpp | 10 +++++++++- src/mesh/MeshModule.h | 2 +- src/mesh/NodeDB.cpp | 2 +- src/mesh/Router.cpp | 5 ++++- src/modules/RoutingModule.cpp | 2 +- src/modules/RoutingModule.h | 2 ++ 6 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/mesh/MeshModule.cpp b/src/mesh/MeshModule.cpp index c5748a560..409c52179 100644 --- a/src/mesh/MeshModule.cpp +++ b/src/mesh/MeshModule.cpp @@ -85,8 +85,11 @@ meshtastic_MeshPacket *MeshModule::allocErrorResponse(meshtastic_Routing_Error e return r; } -void MeshModule::callModules(meshtastic_MeshPacket &mp, RxSource src) +void MeshModule::callModules(meshtastic_MeshPacket &mp, RxSource src, const char *specificModule) { + if (specificModule) { + LOG_DEBUG("Calling specific module: %s", specificModule); + } // LOG_DEBUG("In call modules"); bool moduleFound = false; @@ -104,6 +107,11 @@ void MeshModule::callModules(meshtastic_MeshPacket &mp, RxSource src) for (auto i = modules->begin(); i != modules->end(); ++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 = ∓ /// We only call modules that are interested in the packet (and the message is destined to us or we are promiscious) diff --git a/src/mesh/MeshModule.h b/src/mesh/MeshModule.h index eda3f8881..bf735439f 100644 --- a/src/mesh/MeshModule.h +++ b/src/mesh/MeshModule.h @@ -73,7 +73,7 @@ class MeshModule /** For use only by MeshService */ - static void callModules(meshtastic_MeshPacket &mp, RxSource src = RX_SRC_RADIO); + static void callModules(meshtastic_MeshPacket &mp, RxSource src = RX_SRC_RADIO, const char *specificModule = nullptr); static std::vector GetMeshModulesWithUIFrames(int startIndex); static void observeUIEvents(Observer *observer); diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index b54cdae86..79361bb46 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -1867,7 +1867,7 @@ bool NodeDB::checkLowEntropyPublicKey(const meshtastic_Config_SecurityConfig_pub uint8_t keyHash[32] = {0}; memcpy(keyHash, keyToTest.bytes, keyToTest.size); crypto->hash(keyHash, 32); - for (int i = 0; i < sizeof(LOW_ENTROPY_HASHES) / sizeof(LOW_ENTROPY_HASHES[0]); i++) { + for (uint16_t i = 0; i < sizeof(LOW_ENTROPY_HASHES) / sizeof(LOW_ENTROPY_HASHES[0]); i++) { if (memcmp(keyHash, LOW_ENTROPY_HASHES[i], sizeof(LOW_ENTROPY_HASHES[0])) == 0) { return true; } diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index e090bd539..065d627e9 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -653,7 +653,8 @@ void Router::handleReceived(meshtastic_MeshPacket *p, RxSource src) } // call modules here - if (!skipHandle) { + // If this could be a spoofed packet, don't let the modules see it. + if (!skipHandle && p->from != nodeDB->getNodeNum()) { MeshModule::callModules(*p, src); #if !MESHTASTIC_EXCLUDE_MQTT @@ -667,6 +668,8 @@ void Router::handleReceived(meshtastic_MeshPacket *p, RxSource src) !isFromUs(p) && mqtt) mqtt->onSend(*p_encrypted, *p, p->channel); #endif + } else if (p->from == nodeDB->getNodeNum() && !skipHandle) { + MeshModule::callModules(*p, src, ROUTING_MODULE); } packetPool.release(p_encrypted); // Release the encrypted packet diff --git a/src/modules/RoutingModule.cpp b/src/modules/RoutingModule.cpp index e7e92c79a..b10413cc8 100644 --- a/src/modules/RoutingModule.cpp +++ b/src/modules/RoutingModule.cpp @@ -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 } -RoutingModule::RoutingModule() : ProtobufModule("routing", meshtastic_PortNum_ROUTING_APP, &meshtastic_Routing_msg) +RoutingModule::RoutingModule() : ProtobufModule(ROUTING_MODULE, meshtastic_PortNum_ROUTING_APP, &meshtastic_Routing_msg) { isPromiscuous = true; diff --git a/src/modules/RoutingModule.h b/src/modules/RoutingModule.h index c047f6e29..7b43a6e98 100644 --- a/src/modules/RoutingModule.h +++ b/src/modules/RoutingModule.h @@ -2,6 +2,8 @@ #include "Channels.h" #include "ProtobufModule.h" +static const char *ROUTING_MODULE = "routing"; + /** * Routing module for router control messages */ From 1bfa429c381717155fc17d275014f85728226793 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 12 Aug 2025 19:40:35 -0500 Subject: [PATCH 115/180] Automated version bumps (#7614) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- bin/org.meshtastic.meshtasticd.metainfo.xml | 3 +++ debian/changelog | 7 +++++-- version.properties | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/org.meshtastic.meshtasticd.metainfo.xml b/bin/org.meshtastic.meshtasticd.metainfo.xml index d52b804ee..f3b3bb14d 100644 --- a/bin/org.meshtastic.meshtasticd.metainfo.xml +++ b/bin/org.meshtastic.meshtasticd.metainfo.xml @@ -87,6 +87,9 @@ + + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.6 + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.5 diff --git a/debian/changelog b/debian/changelog index 9421e9925..b36a22168 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -meshtasticd (2.7.5.0) UNRELEASED; urgency=medium +meshtasticd (2.7.6.0) UNRELEASED; urgency=medium [ Austin Lane ] * Initial packaging @@ -37,4 +37,7 @@ meshtasticd (2.7.5.0) UNRELEASED; urgency=medium [ ] * GitHub Actions Automatic version bump - -- Sat, 09 Aug 2025 12:46:53 +0000 + [ ] + * GitHub Actions Automatic version bump + + -- Tue, 12 Aug 2025 23:48:48 +0000 diff --git a/version.properties b/version.properties index 7764a56c9..f9e2cb279 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 7 -build = 5 +build = 6 From ac8c372349659e15a0b3dbf17444a35e7f35fab4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 13 Aug 2025 06:26:08 -0500 Subject: [PATCH 116/180] Upgrade trunk to 1.25.0 (#7432) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> --- .trunk/trunk.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 2d4d3fc16..f62255aea 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -1,6 +1,6 @@ version: 0.1 cli: - version: 1.24.0 + version: 1.25.0 plugins: sources: - id: trunk @@ -8,15 +8,15 @@ plugins: uri: https://github.com/trunk-io/plugins lint: enabled: - - checkov@3.2.451 - - renovate@41.40.0 + - checkov@3.2.461 + - renovate@41.63.0 - prettier@3.6.2 - - trufflehog@3.90.1 + - trufflehog@3.90.3 - yamllint@1.37.1 - bandit@1.8.6 - trivy@0.64.1 - taplo@0.9.3 - - ruff@0.12.4 + - ruff@0.12.7 - isort@6.0.1 - markdownlint@0.45.0 - oxipng@9.1.5 From 52f0e5a3db06a7a3c77dade181c26c508faa2e11 Mon Sep 17 00:00:00 2001 From: Austin Date: Thu, 14 Aug 2025 13:31:25 -0400 Subject: [PATCH 117/180] Fix 'buildroot' target (OpenWRT) (#7620) --- arch/portduino/portduino.ini | 2 +- variants/native/portduino/platformio.ini | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini index 693ab63b7..ae68159eb 100644 --- a/arch/portduino/portduino.ini +++ b/arch/portduino/portduino.ini @@ -17,7 +17,6 @@ build_src_filter = + - - - +<../variants/portduino> lib_deps = ${env.lib_deps} @@ -35,6 +34,7 @@ lib_deps = build_flags = ${arduino_base.build_flags} + -D ARCH_PORTDUINO -fPIC -Isrc/platform/portduino -DRADIOLIB_EEPROM_UNSUPPORTED diff --git a/variants/native/portduino/platformio.ini b/variants/native/portduino/platformio.ini index 732b2a1d4..b8452bb48 100644 --- a/variants/native/portduino/platformio.ini +++ b/variants/native/portduino/platformio.ini @@ -1,7 +1,6 @@ [native_base] extends = portduino_base build_flags = ${portduino_base.build_flags} -I variants/native/portduino - -D ARCH_PORTDUINO -I /usr/include board = cross_platform lib_deps = ${portduino_base.lib_deps} From 1877a2c5311c2892d032bff5a9cee3d3a99f23f0 Mon Sep 17 00:00:00 2001 From: Ford Jones <107664313+ford-jones@users.noreply.github.com> Date: Fri, 15 Aug 2025 22:31:11 +1200 Subject: [PATCH 118/180] Prompt user to select destination upon launch of canned message module (#7624) Co-authored-by: Jason P --- src/modules/CannedMessageModule.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index b6cb1b0e3..d40dcd24f 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -78,16 +78,15 @@ void CannedMessageModule::LaunchWithDestination(NodeNum newDest, uint8_t newChan lastDestSet = true; // Rest of function unchanged... - // Always select the first real canned message on activation - int firstRealMsgIdx = 0; + // Upon activation, highlight "[Select Destination]" + int selectDestination = 0; for (int i = 0; i < messagesCount; ++i) { - if (strcmp(messages[i], "[Select Destination]") != 0 && strcmp(messages[i], "[Exit]") != 0 && - strcmp(messages[i], "[---- Free Text ----]") != 0) { - firstRealMsgIdx = i; + if (strcmp(messages[i], "[Select Destination]") == 0) { + selectDestination = i; break; } } - currentMessageIndex = firstRealMsgIdx; + currentMessageIndex = selectDestination; // This triggers the canned message list runState = CANNED_MESSAGE_RUN_STATE_ACTIVE; @@ -999,17 +998,16 @@ int32_t CannedMessageModule::runOnce() this->notifyObservers(&e); return 2000; } - // Always highlight the first real canned message when entering the message list + // Highlight [Select Destination] initially when entering the message list else if ((this->runState != CANNED_MESSAGE_RUN_STATE_FREETEXT) && (this->currentMessageIndex == -1)) { - int firstRealMsgIdx = 0; + int selectDestination = 0; for (int i = 0; i < this->messagesCount; ++i) { - if (strcmp(this->messages[i], "[Select Destination]") != 0 && strcmp(this->messages[i], "[Exit]") != 0 && - strcmp(this->messages[i], "[---- Free Text ----]") != 0) { - firstRealMsgIdx = i; + if (strcmp(this->messages[i], "[Select Destination]") == 0) { + selectDestination = i; break; } } - this->currentMessageIndex = firstRealMsgIdx; + this->currentMessageIndex = selectDestination; e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; this->runState = CANNED_MESSAGE_RUN_STATE_ACTIVE; } else if (this->runState == CANNED_MESSAGE_RUN_STATE_ACTION_UP) { From 062168cd4245d7a12859dbed09b696a01bbe6ea0 Mon Sep 17 00:00:00 2001 From: Austin Date: Fri, 15 Aug 2025 07:19:49 -0400 Subject: [PATCH 119/180] Docker: Update Debian images to trixie (#7621) --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index e033b1bba..6a2ddeece 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ # trunk-ignore-all(hadolint/DL3008): Do not pin apt package versions # trunk-ignore-all(hadolint/DL3013): Do not pin pip package versions -FROM python:3.13-bookworm AS builder +FROM python:3.13-slim-trixie AS builder ARG PIO_ENV=native ENV DEBIAN_FRONTEND=noninteractive ENV TZ=Etc/UTC @@ -36,7 +36,7 @@ RUN curl -L "https://github.com/meshtastic/web/releases/download/v$(cat /tmp/fir ##### PRODUCTION BUILD ############# -FROM debian:bookworm-slim +FROM debian:trixie-slim LABEL org.opencontainers.image.title="Meshtastic" \ org.opencontainers.image.description="Debian Meshtastic daemon and web interface" \ org.opencontainers.image.url="https://meshtastic.org" \ @@ -51,8 +51,8 @@ ENV TZ=Etc/UTC USER root RUN apt-get update && apt-get --no-install-recommends -y install \ - libc-bin libc6 libgpiod2 libyaml-cpp0.7 libi2c0 libuv1 libusb-1.0-0-dev \ - liborcania2.3 libulfius2.7 libssl3 \ + libc-bin libc6 libgpiod3 libyaml-cpp0.8 libi2c0 libuv1t64 libusb-1.0-0-dev \ + liborcania2.3 libulfius2.7t64 libssl3t64 \ libx11-6 libinput10 libxkbcommon-x11-0 \ && apt-get clean && rm -rf /var/lib/apt/lists/* \ && mkdir -p /var/lib/meshtasticd \ From c8694f9f2d6a6bd7b38afd421b753f5faaeb644d Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 15 Aug 2025 07:03:14 -0500 Subject: [PATCH 120/180] Fix Tracerouter warnings (#7637) * Static cast to avoid signed comparison * Another one --- src/modules/TraceRouteModule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/TraceRouteModule.cpp b/src/modules/TraceRouteModule.cpp index f4eccd667..d7df90bb5 100644 --- a/src/modules/TraceRouteModule.cpp +++ b/src/modules/TraceRouteModule.cpp @@ -602,7 +602,7 @@ void TraceRouteModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state int start = 0; int newlinePos = resultText.indexOf('\n', start); - while (newlinePos != -1 || start < resultText.length()) { + while (newlinePos != -1 || start < static_cast(resultText.length())) { String segment; if (newlinePos != -1) { segment = resultText.substring(start, newlinePos); @@ -624,7 +624,7 @@ void TraceRouteModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state int lastGoodBreak = -1; bool lineComplete = false; - for (int i = 0; i < remaining.length(); i++) { + for (int i = 0; i < static_cast(remaining.length()); i++) { char ch = remaining.charAt(i); String testLine = tempLine + ch; From a7be93449eb989b8018bd89277ddfa9ff0ec45ec Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 15 Aug 2025 09:00:09 -0500 Subject: [PATCH 121/180] Spacing --- src/graphics/fonts/OLEDDisplayFontsCS.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/graphics/fonts/OLEDDisplayFontsCS.cpp b/src/graphics/fonts/OLEDDisplayFontsCS.cpp index 67208b4d9..8d506e009 100644 --- a/src/graphics/fonts/OLEDDisplayFontsCS.cpp +++ b/src/graphics/fonts/OLEDDisplayFontsCS.cpp @@ -1,3 +1,5 @@ +#ifdef OLED_CS + #include "OLEDDisplayFontsCS.h" // Font generated or edited with the glyphEditor From e1e89a5e620390e1b7b26dfd3457bf1b278f8474 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 15 Aug 2025 09:03:21 -0500 Subject: [PATCH 122/180] Don't include OLED fonts for international character sets by default (#7639) --- src/graphics/ScreenFonts.h | 4 ++-- src/graphics/fonts/EinkDisplayFonts.cpp | 4 ++++ src/graphics/fonts/EinkDisplayFonts.h | 5 +++++ src/graphics/fonts/OLEDDisplayFontsCS.cpp | 4 +++- src/graphics/fonts/OLEDDisplayFontsPL.cpp | 5 ++++- src/graphics/fonts/OLEDDisplayFontsRU.cpp | 6 +++++- src/graphics/fonts/OLEDDisplayFontsUA.cpp | 6 +++++- 7 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/graphics/ScreenFonts.h b/src/graphics/ScreenFonts.h index 92bdb7641..84ec45977 100644 --- a/src/graphics/ScreenFonts.h +++ b/src/graphics/ScreenFonts.h @@ -16,7 +16,7 @@ #include "graphics/fonts/OLEDDisplayFontsCS.h" #endif -#ifdef CROWPANEL_ESP32S3_5_EPAPER +#if defined(CROWPANEL_ESP32S3_5_EPAPER) && defined(USE_EINK) #include "graphics/fonts/EinkDisplayFonts.h" #endif @@ -85,7 +85,7 @@ #define FONT_LARGE FONT_LARGE_LOCAL // Height: 28 #endif -#if defined(CROWPANEL_ESP32S3_5_EPAPER) +#if defined(CROWPANEL_ESP32S3_5_EPAPER) && defined(USE_EINK) #undef FONT_SMALL #undef FONT_MEDIUM #undef FONT_LARGE diff --git a/src/graphics/fonts/EinkDisplayFonts.cpp b/src/graphics/fonts/EinkDisplayFonts.cpp index cfe2c931f..497b3b389 100644 --- a/src/graphics/fonts/EinkDisplayFonts.cpp +++ b/src/graphics/fonts/EinkDisplayFonts.cpp @@ -1,3 +1,5 @@ +#ifdef USE_EINK + #include "EinkDisplayFonts.h" // Created by https://oleddisplay.squix.ch/ Consider a donation @@ -1182,3 +1184,5 @@ const uint8_t Monospaced_plain_30[] PROGMEM = { 0xF0, 0xFF, 0x01, 0x00, 0x00, 0xC0, 0x7F, 0x00, 0x00, 0x00, 0xF0, 0x0F, 0x00, 0xE0, 0x00, 0xFE, 0x03, 0x00, 0xE0, 0x80, 0x7F, 0x00, 0x00, 0xE0, 0xE0, 0x1F, 0x00, 0x00, 0x00, 0xF0, 0x03, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x10 // 255 }; + +#endif // USE_EINK diff --git a/src/graphics/fonts/EinkDisplayFonts.h b/src/graphics/fonts/EinkDisplayFonts.h index 342525a19..a4a44ba47 100644 --- a/src/graphics/fonts/EinkDisplayFonts.h +++ b/src/graphics/fonts/EinkDisplayFonts.h @@ -1,6 +1,8 @@ #ifndef EINKDISPLAYFONTS_h #define EINKDISPLAYFONTS_h +#ifdef USE_EINK + #ifdef ARDUINO #include #elif __MBED__ @@ -11,4 +13,7 @@ * Monospaced Plain 30 */ extern const uint8_t Monospaced_plain_30[] PROGMEM; + +#endif // USE_EINK + #endif diff --git a/src/graphics/fonts/OLEDDisplayFontsCS.cpp b/src/graphics/fonts/OLEDDisplayFontsCS.cpp index 8d506e009..c8045285e 100644 --- a/src/graphics/fonts/OLEDDisplayFontsCS.cpp +++ b/src/graphics/fonts/OLEDDisplayFontsCS.cpp @@ -1862,4 +1862,6 @@ const uint8_t ArialMT_Plain_24_CS[] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x06, 0xC0, 0xF0, 0x01, 0x06, 0xC0, 0x80, 0x0F, 0x07, 0x00, 0x00, 0xFE, 0x03, 0x00, 0x00, 0xFC, 0x00, 0xC0, 0xC0, 0x1F, 0x00, 0xC0, 0xF8, 0x03, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x06, // 255 -}; \ No newline at end of file +}; + +#endif // OLED_CS \ No newline at end of file diff --git a/src/graphics/fonts/OLEDDisplayFontsPL.cpp b/src/graphics/fonts/OLEDDisplayFontsPL.cpp index 0767e24e7..00f0913fe 100644 --- a/src/graphics/fonts/OLEDDisplayFontsPL.cpp +++ b/src/graphics/fonts/OLEDDisplayFontsPL.cpp @@ -1,4 +1,5 @@ // trunk-ignore-all(clang-format): Preserve long lines +#ifdef OLED_PL #include "OLEDDisplayFontsPL.h" const uint8_t ArialMT_Plain_10_PL[] PROGMEM = { @@ -1310,4 +1311,6 @@ const uint8_t ArialMT_Plain_24_PL[] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x06, 0x00, 0xF0, 0x01, 0x06, 0x00, 0x80, 0x0F, 0x07, 0x80, 0x00, 0xFE, 0x03, 0xE0, 0x00, 0xFC, 0x00, 0x60, 0xC0, 0x1F, 0x00, 0x20, 0xF8, 0x03, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x06, // 253 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x1C, 0x18, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x0E, 0x38, 0x00, 0x00, 0x1C, 0x1C, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xF0, 0x03, // 254 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x06, 0xC0, 0xF0, 0x01, 0x06, 0xC0, 0x80, 0x0F, 0x07, 0x00, 0x00, 0xFE, 0x03, 0x00, 0x00, 0xFC, 0x00, 0xC0, 0xC0, 0x1F, 0x00, 0xC0, 0xF8, 0x03, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x06, // 255 -}; \ No newline at end of file +}; + +#endif // OLED_PL \ No newline at end of file diff --git a/src/graphics/fonts/OLEDDisplayFontsRU.cpp b/src/graphics/fonts/OLEDDisplayFontsRU.cpp index 2b85727c2..3a1159511 100644 --- a/src/graphics/fonts/OLEDDisplayFontsRU.cpp +++ b/src/graphics/fonts/OLEDDisplayFontsRU.cpp @@ -1,3 +1,5 @@ +#ifdef OLED_RU + #include "OLEDDisplayFontsRU.h" // Font generated or edited with the glyphEditor @@ -1762,4 +1764,6 @@ const uint8_t ArialMT_Plain_24_RU[] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x30, 0x00, 0x00, 0xFC, 0x38, 0x00, 0x00, 0xCC, 0x1D, 0x00, 0x00, 0x8C, 0x0F, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, 0x84, 0x01, 0x00, 0x00, 0x84, 0x01, 0x00, 0x00, 0x84, 0x01, 0x00, 0x00, 0xFC, 0x3F, 0x00, 0x00, 0xFC, 0x3F, // 255 -}; \ No newline at end of file +}; + +#endif // OLED_RU \ No newline at end of file diff --git a/src/graphics/fonts/OLEDDisplayFontsUA.cpp b/src/graphics/fonts/OLEDDisplayFontsUA.cpp index 2a97526ef..8bc56ea94 100644 --- a/src/graphics/fonts/OLEDDisplayFontsUA.cpp +++ b/src/graphics/fonts/OLEDDisplayFontsUA.cpp @@ -1,3 +1,5 @@ +#ifdef OLED_UA + #include "OLEDDisplayFontsUA.h" // Font generated or edited with the glyphEditor @@ -1920,4 +1922,6 @@ const uint8_t ArialMT_Plain_24_UA[] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xC1, 0x00, 0x00, 0xF0, 0xE3, 0x00, 0x00, 0x38, 0x7B, 0x00, 0x00, 0x18, 0x1A, 0x00, 0x00, 0x18, 0x0E, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0xF8, 0xFF, 0x00, 0x00, 0xF8, 0xFF, // 1103 -}; \ No newline at end of file +}; + +#endif // OLED_UA \ No newline at end of file From 8d5ae1d5d26debc5b33f7a260cff029d56078189 Mon Sep 17 00:00:00 2001 From: GUVWAF <78759985+GUVWAF@users.noreply.github.com> Date: Fri, 15 Aug 2025 19:09:25 +0200 Subject: [PATCH 123/180] Fix marking LoRa transport mechanism (#7634) --- src/mesh/RadioInterface.cpp | 4 +++- src/mesh/Router.cpp | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 99e99922b..c210d5d48 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -666,8 +666,10 @@ void RadioInterface::limitPower(int8_t loraMaxPower) void RadioInterface::deliverToReceiver(meshtastic_MeshPacket *p) { - if (router) + if (router) { + p->transport_mechanism = meshtastic_MeshPacket_TransportMechanism_TRANSPORT_LORA; router->enqueueReceivedMessage(p); + } } /*** diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index 065d627e9..a54dcb976 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -66,7 +66,6 @@ int32_t Router::runOnce() { meshtastic_MeshPacket *mp; while ((mp = fromRadioQueue.dequeuePtr(0)) != NULL) { - mp->transport_mechanism = meshtastic_MeshPacket_TransportMechanism_TRANSPORT_LORA; // printPacket("handle fromRadioQ", mp); perhapsHandleReceived(mp); } From 4a241deb968470e9b953a16071b8d045aeef6ed9 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Fri, 15 Aug 2025 14:41:21 -0500 Subject: [PATCH 124/180] Thinknode button and backlight fixes (#7641) * Thinknode button and backlight fixes * Save backlight value between reboots --- platformio.ini | 4 ++-- src/graphics/Screen.cpp | 20 +++++++++---------- src/graphics/draw/MenuHandler.cpp | 18 ++++++++++++++--- src/input/ButtonThread.cpp | 5 ++++- src/main.cpp | 1 - .../esp32s3/ELECROW-ThinkNode-M5/variant.h | 2 +- 6 files changed, 31 insertions(+), 19 deletions(-) diff --git a/platformio.ini b/platformio.ini index 62bbf8a24..520ec740e 100644 --- a/platformio.ini +++ b/platformio.ini @@ -61,8 +61,8 @@ monitor_filters = direct lib_deps = # renovate: datasource=git-refs depName=meshtastic-esp8266-oled-ssd1306 packageName=https://github.com/meshtastic/esp8266-oled-ssd1306 gitBranch=master https://github.com/meshtastic/esp8266-oled-ssd1306/archive/0119501e9983bd894830b02f545c377ee08d66fe.zip - # renovate: datasource=custom.pio depName=OneButton packageName=mathertel/library/OneButton - mathertel/OneButton@2.6.1 + # renovate: datasource=git-refs depName=meshtastic-OneButton packageName=https://github.com/meshtastic/OneButton gitBranch=master + https://github.com/meshtastic/OneButton/archive/fa352d668c53f290cfa480a5f79ad422cd828c70.zip # renovate: datasource=git-refs depName=meshtastic-arduino-fsm packageName=https://github.com/meshtastic/arduino-fsm gitBranch=master https://github.com/meshtastic/arduino-fsm/archive/7db3702bf0cfe97b783d6c72595e3f38e0b19159.zip # renovate: datasource=git-refs depName=meshtastic-TinyGPSPlus packageName=https://github.com/meshtastic/TinyGPSPlus gitBranch=master diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 8d5635f89..88955145a 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -365,9 +365,6 @@ void Screen::doDeepSleep() { #ifdef USE_EINK setOn(false, graphics::UIRenderer::drawDeepSleepFrame); -#ifdef PIN_EINK_EN - digitalWrite(PIN_EINK_EN, LOW); // power off backlight -#endif #else // Without E-Ink display: setOn(false); @@ -391,8 +388,12 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver) dispdev->displayOn(); #endif -#ifdef ELECROW_ThinkNode_M5 - io.digitalWrite(PCA_PIN_EINK_EN, HIGH); +#ifdef PIN_EINK_EN + if (uiconfig.screen_brightness == 1) + digitalWrite(PIN_EINK_EN, HIGH); +#elif defined(PCA_PIN_EINK_EN) + if (uiconfig.screen_brightness == 1) + io.digitalWrite(PCA_PIN_EINK_EN, HIGH); #endif #if defined(ST7789_CS) && \ @@ -424,13 +425,10 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver) // eInkScreensaver parameter is usually NULL (default argument), default frame used instead setScreensaverFrames(einkScreensaver); #endif -#ifdef ELECROW_ThinkNode_M1 - if (digitalRead(PIN_EINK_EN) == HIGH) { - digitalWrite(PIN_EINK_EN, LOW); - } -#endif -#ifdef ELECROW_ThinkNode_M5 +#ifdef PIN_EINK_EN + digitalWrite(PIN_EINK_EN, LOW); +#elif defined(PCA_PIN_EINK_EN) io.digitalWrite(PCA_PIN_EINK_EN, LOW); #endif diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index b7bd068c4..fa738309a 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -318,7 +318,7 @@ void menuHandler::homeBaseMenu() static int optionsEnumArray[enumEnd] = {Back}; int options = 1; -#ifdef PIN_EINK_EN +#if defined(PIN_EINK_EN) || defined(PCA_PIN_EINK_EN) optionsArray[options] = "Toggle Backlight"; optionsEnumArray[options++] = Backlight; #else @@ -342,12 +342,24 @@ void menuHandler::homeBaseMenu() bannerOptions.optionsCount = options; bannerOptions.bannerCallback = [](int selected) -> void { if (selected == Backlight) { -#ifdef PIN_EINK_EN - if (digitalRead(PIN_EINK_EN) == HIGH) { +#if defined(PIN_EINK_EN) + if (uiconfig.screen_brightness == 1) { + uiconfig.screen_brightness = 0; digitalWrite(PIN_EINK_EN, LOW); } else { + uiconfig.screen_brightness = 1; digitalWrite(PIN_EINK_EN, HIGH); } + saveUIConfig(); +#elif defined(PCA_PIN_EINK_EN) + if (uiconfig.screen_brightness == 1) { + uiconfig.screen_brightness = 0; + io.digitalWrite(PCA_PIN_EINK_EN, LOW); + } else { + uiconfig.screen_brightness = 1; + io.digitalWrite(PCA_PIN_EINK_EN, HIGH); + } + saveUIConfig(); #endif } else if (selected == Sleep) { screen->setOn(false); diff --git a/src/input/ButtonThread.cpp b/src/input/ButtonThread.cpp index 233bbefe0..f26b3c970 100644 --- a/src/input/ButtonThread.cpp +++ b/src/input/ButtonThread.cpp @@ -92,8 +92,11 @@ bool ButtonThread::initButton(const ButtonConfig &config) if (config.shortLong != INPUT_BROKER_NONE) { _shortLong = config.shortLong; } - +#ifdef USE_EINK + userButton.setDebounceMs(0); +#else userButton.setDebounceMs(1); +#endif userButton.setPressMs(_longPressTime); if (screen) { diff --git a/src/main.cpp b/src/main.cpp index 9e46021c9..c5be175c4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -304,7 +304,6 @@ void setup() Wire.begin(48, 47); io.pinMode(PCA_PIN_EINK_EN, OUTPUT); io.pinMode(PCA_PIN_POWER_EN, OUTPUT); - io.digitalWrite(PCA_PIN_EINK_EN, HIGH); io.digitalWrite(PCA_PIN_POWER_EN, HIGH); // io.pinMode(C2_PIN, OUTPUT); #endif diff --git a/variants/esp32s3/ELECROW-ThinkNode-M5/variant.h b/variants/esp32s3/ELECROW-ThinkNode-M5/variant.h index 61d6149d2..a55808170 100644 --- a/variants/esp32s3/ELECROW-ThinkNode-M5/variant.h +++ b/variants/esp32s3/ELECROW-ThinkNode-M5/variant.h @@ -61,7 +61,7 @@ #define LORA_DIO1 SX126X_DIO1 #define USE_EINK -#define PIN_EINK_EN -1 // Note: this is really just backlight power +// Note: this is really just backlight power #define PCA_PIN_EINK_EN 5 // This is the pin number on the GPIO expander #define PIN_EINK_CS 39 #define PIN_EINK_BUSY 42 From 0046d957f1ead3cd4da5632d91c6a2a1fafefc6c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 15 Aug 2025 21:42:51 +0200 Subject: [PATCH 125/180] Update protobufs (#7647) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/mesh.pb.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/protobufs b/protobufs index e2c0831aa..5dd723fe6 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit e2c0831aa3d34a58a36c2b9fdcb828e58961cbc5 +Subproject commit 5dd723fe6f33a8613ec81acf5e15be26365c7cce diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index 1d1ff47e0..ce3722aa7 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -270,6 +270,8 @@ typedef enum _meshtastic_HardwareModel { /* MeshSolar is an integrated power management and communication solution designed for outdoor low-power devices. https://heltec.org/project/meshsolar/ */ meshtastic_HardwareModel_HELTEC_MESH_SOLAR = 108, + /* Lilygo T-Echo Lite */ + meshtastic_HardwareModel_T_ECHO_LITE = 109, /* ------------------------------------------------------------------------------------------------------------------------------------------ Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. ------------------------------------------------------------------------------------------------------------------------------------------ */ From a02017a5c8e2f5506e7222babff855e886ee3c1e Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 15 Aug 2025 19:45:41 -0500 Subject: [PATCH 126/180] Remove JSON serialization from most NRF52 targets (#7640) * Remove JSON serialization from most NRF52 targets * Slin networking base down for NRF52 by removing syslog * Update platformio.ini --- arch/nrf52/nrf52.ini | 2 +- platformio.ini | 8 ++++++++ variants/nrf52840/rak2560/platformio.ini | 4 ++-- variants/nrf52840/rak4631/platformio.ini | 2 +- variants/nrf52840/rak4631_eth_gw/platformio.ini | 2 +- variants/nrf52840/rak_wismeshtap/platformio.ini | 2 +- 6 files changed, 14 insertions(+), 6 deletions(-) diff --git a/arch/nrf52/nrf52.ini b/arch/nrf52/nrf52.ini index 4a77ec4b2..36effe017 100644 --- a/arch/nrf52/nrf52.ini +++ b/arch/nrf52/nrf52.ini @@ -23,7 +23,7 @@ build_flags = -DMESHTASTIC_EXCLUDE_PAXCOUNTER=1 build_src_filter = - ${arduino_base.build_src_filter} - - - - - - - - - - + ${arduino_base.build_src_filter} - - - - - - - - - - - lib_deps= ${arduino_base.lib_deps} diff --git a/platformio.ini b/platformio.ini index 520ec740e..528563def 100644 --- a/platformio.ini +++ b/platformio.ini @@ -102,6 +102,14 @@ lib_deps = # renovate: datasource=custom.pio depName=Syslog packageName=arcao/library/Syslog arcao/Syslog@2.0.0 +; Minimal networking libs for nrf52 (excludes Syslog to save flash) +[nrf52_networking_base] +lib_deps = + # renovate: datasource=custom.pio depName=TBPubSubClient packageName=thingsboard/library/TBPubSubClient + thingsboard/TBPubSubClient@2.12.1 + # renovate: datasource=custom.pio depName=NTPClient packageName=arduino-libraries/library/NTPClient + arduino-libraries/NTPClient@3.2.1 + [radiolib_base] lib_deps = # renovate: datasource=custom.pio depName=RadioLib packageName=jgromes/library/RadioLib diff --git a/variants/nrf52840/rak2560/platformio.ini b/variants/nrf52840/rak2560/platformio.ini index 2b73aca03..edc648b9b 100644 --- a/variants/nrf52840/rak2560/platformio.ini +++ b/variants/nrf52840/rak2560/platformio.ini @@ -11,10 +11,10 @@ build_flags = ${nrf52840_base.build_flags} -DRADIOLIB_EXCLUDE_SX127X=1 -DRADIOLIB_EXCLUDE_LR11X0=1 -DHAS_RAKPROT=1 ; Define if RAk OneWireSerial is used (disables GPS) -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/rak2560> + + +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/rak2560> + + + lib_deps = ${nrf52840_base.lib_deps} - ${networking_base.lib_deps} + ${nrf52_networking_base.lib_deps} melopero/Melopero RV3028@^1.1.0 https://github.com/beegee-tokyo/RAK-OneWireSerial/archive/0.0.2.zip debug_tool = jlink diff --git a/variants/nrf52840/rak4631/platformio.ini b/variants/nrf52840/rak4631/platformio.ini index 199e17570..83feaa06c 100644 --- a/variants/nrf52840/rak4631/platformio.ini +++ b/variants/nrf52840/rak4631/platformio.ini @@ -17,7 +17,7 @@ build_flags = ${nrf52840_base.build_flags} build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/rak4631> + + + lib_deps = ${nrf52840_base.lib_deps} - ${networking_base.lib_deps} + ${nrf52_networking_base.lib_deps} melopero/Melopero RV3028@^1.1.0 https://github.com/RAKWireless/RAK13800-W5100S/archive/1.0.2.zip rakwireless/RAKwireless NCP5623 RGB LED library@^1.0.2 diff --git a/variants/nrf52840/rak4631_eth_gw/platformio.ini b/variants/nrf52840/rak4631_eth_gw/platformio.ini index a1c1b4610..79cdb28c7 100644 --- a/variants/nrf52840/rak4631_eth_gw/platformio.ini +++ b/variants/nrf52840/rak4631_eth_gw/platformio.ini @@ -24,7 +24,7 @@ build_flags = ${nrf52840_base.build_flags} -DMESHTASTIC_EXCLUDE_STOREFORWARD=1 -DMESHTASTIC_EXCLUDE_CANNEDMESSAGES=1 -DMESHTASTIC_EXCLUDE_WAYPOINT=1 -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/rak4631_eth_gw> + + + +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/rak4631_eth_gw> + + + + lib_deps = ${nrf52840_base.lib_deps} ${networking_base.lib_deps} diff --git a/variants/nrf52840/rak_wismeshtap/platformio.ini b/variants/nrf52840/rak_wismeshtap/platformio.ini index f6ee8fd23..adf301537 100644 --- a/variants/nrf52840/rak_wismeshtap/platformio.ini +++ b/variants/nrf52840/rak_wismeshtap/platformio.ini @@ -18,7 +18,7 @@ build_flags = ${nrf52840_base.build_flags} build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/rak_wismeshtap> + + + lib_deps = ${nrf52840_base.lib_deps} - ${networking_base.lib_deps} + ${nrf52_networking_base.lib_deps} melopero/Melopero RV3028@^1.1.0 https://github.com/RAKWireless/RAK13800-W5100S/archive/1.0.2.zip rakwireless/RAKwireless NCP5623 RGB LED library@^1.0.2 From 8e552a9f0c0a67b920062123b120b6034c0dfaa4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 16 Aug 2025 05:57:20 -0500 Subject: [PATCH 127/180] Upgrade trunk (#7626) Co-authored-by: vidplace7 <1779290+vidplace7@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 f62255aea..10bb1bd00 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,9 +9,9 @@ plugins: lint: enabled: - checkov@3.2.461 - - renovate@41.63.0 + - renovate@41.71.1 - prettier@3.6.2 - - trufflehog@3.90.3 + - trufflehog@3.90.4 - yamllint@1.37.1 - bandit@1.8.6 - trivy@0.64.1 From c64c196778038c0888a8e31651cd1957c6134586 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sat, 16 Aug 2025 06:10:44 -0500 Subject: [PATCH 128/180] Wait for lead up before enable longlong action (#7648) --- src/buzz/buzz.cpp | 4 ++++ src/input/ButtonThread.cpp | 9 +++++---- src/input/ButtonThread.h | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/buzz/buzz.cpp b/src/buzz/buzz.cpp index b09d7a82c..b0d162a44 100644 --- a/src/buzz/buzz.cpp +++ b/src/buzz/buzz.cpp @@ -140,6 +140,10 @@ bool playNextLeadUpNote() playTones(¬e, 1); // Play single note using existing playTones function leadUpNoteIndex++; + + if (leadUpNoteIndex >= leadUpNotesCount) { + return false; // this was the final note + } return true; // Note was played (playTones handles buzzer availability internally) } diff --git a/src/input/ButtonThread.cpp b/src/input/ButtonThread.cpp index f26b3c970..32882f7ae 100644 --- a/src/input/ButtonThread.cpp +++ b/src/input/ButtonThread.cpp @@ -140,8 +140,7 @@ int32_t ButtonThread::runOnce() } // Progressive lead-up sound system - if (buttonCurrentlyPressed && (millis() - buttonPressStartTime) >= BUTTON_LEADUP_MS && - (millis() - buttonPressStartTime) < _longLongPressTime) { + if (buttonCurrentlyPressed && (millis() - buttonPressStartTime) >= BUTTON_LEADUP_MS) { // Start the progressive sequence if not already active if (!leadUpSequenceActive) { @@ -153,13 +152,14 @@ int32_t ButtonThread::runOnce() else if ((millis() - lastLeadUpNoteTime) >= 400) { // 400ms interval between notes if (playNextLeadUpNote()) { lastLeadUpNoteTime = millis(); + } else { + leadUpPlayed = true; } } } // Reset when button is released if (!buttonCurrentlyPressed && buttonWasPressed) { - leadUpPlayed = false; leadUpSequenceActive = false; resetLeadUpSequence(); } @@ -256,12 +256,13 @@ int32_t ButtonThread::runOnce() LOG_INFO("LONG PRESS RELEASE AFTER %u MILLIS", millis() - buttonPressStartTime); if (millis() > 30000 && _longLongPress != INPUT_BROKER_NONE && - (millis() - buttonPressStartTime) >= _longLongPressTime) { + (millis() - buttonPressStartTime) >= _longLongPressTime && leadUpPlayed) { evt.inputEvent = _longLongPress; this->notifyObservers(&evt); } // Reset combination tracking waitingForLongPress = false; + leadUpPlayed = false; break; } diff --git a/src/input/ButtonThread.h b/src/input/ButtonThread.h index bbc8da2a7..c6d6557e2 100644 --- a/src/input/ButtonThread.h +++ b/src/input/ButtonThread.h @@ -92,7 +92,7 @@ class ButtonThread : public Observable, public concurrency:: voidFuncPtr _intRoutine = nullptr; uint16_t _longPressTime = 500; - uint16_t _longLongPressTime = 5000; + uint16_t _longLongPressTime = 3900; int _pinNum = 0; bool _activeLow = true; bool _touchQuirk = false; From d538ad170ce1fc3c7203d7c340d1c307ee873f59 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sun, 17 Aug 2025 05:55:00 -0500 Subject: [PATCH 129/180] Add onboard message for devices with screens (#7655) * Add onboard message for devices with screens * Add message for TFT --- src/graphics/Screen.cpp | 2 +- src/graphics/draw/MenuHandler.cpp | 24 ++++++++++++++++++++++ src/graphics/draw/MenuHandler.h | 2 ++ src/graphics/draw/NotificationRenderer.cpp | 7 ++++++- 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 88955145a..fa71e17d8 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -692,7 +692,7 @@ int32_t Screen::runOnce() #ifndef DISABLE_WELCOME_UNSET if (!NotificationRenderer::isOverlayBannerShowing() && config.lora.region == meshtastic_Config_LoRaConfig_RegionCode_UNSET) { - menuHandler::LoraRegionPicker(0); + menuHandler::OnboardMessage(); } #endif if (!NotificationRenderer::isOverlayBannerShowing() && rebootAtMsec != 0) { diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index fa738309a..512f650ec 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -26,6 +26,27 @@ menuHandler::screenMenus menuHandler::menuQueue = menu_none; bool test_enabled = false; uint8_t test_count = 0; +void menuHandler::OnboardMessage() +{ + static const char *optionsArray[] = {"OK", "Got it!"}; + enum optionsNumbers { OK, got }; + BannerOverlayOptions bannerOptions; +#if HAS_TFT + bannerOptions.message = "Welcome to Meshtastic!\nSwipe to navigate and\nlong press to select\nor open a menu."; +#elif defined(BUTTON_PIN) + bannerOptions.message = "Welcome to Meshtastic!\nClick to navigate and\nlong press to select\nor open a menu."; +#else + bannerOptions.message = "Welcome to Meshtastic!\nUse the Select button\nto open menus\nand make selections."; +#endif + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = 2; + bannerOptions.bannerCallback = [](int selected) -> void { + menuHandler::menuQueue = menuHandler::no_timeout_lora_picker; + screen->runNow(); + }; + screen->showOverlayBanner(bannerOptions); +} + void menuHandler::LoraRegionPicker(uint32_t duration) { static const char *optionsArray[] = {"Back", @@ -1132,6 +1153,9 @@ void menuHandler::handleMenuSwitch(OLEDDisplay *display) case lora_picker: LoraRegionPicker(); break; + case no_timeout_lora_picker: + LoraRegionPicker(0); + break; case TZ_picker: TZPicker(); break; diff --git a/src/graphics/draw/MenuHandler.h b/src/graphics/draw/MenuHandler.h index 87a0b055e..b15cf237d 100644 --- a/src/graphics/draw/MenuHandler.h +++ b/src/graphics/draw/MenuHandler.h @@ -10,6 +10,7 @@ class menuHandler enum screenMenus { menu_none, lora_picker, + no_timeout_lora_picker, TZ_picker, twelve_hour_picker, clock_face_picker, @@ -41,6 +42,7 @@ class menuHandler }; static screenMenus menuQueue; + static void OnboardMessage(); static void LoraRegionPicker(uint32_t duration = 30000); static void handleMenuSwitch(OLEDDisplay *display); static void showConfirmationBanner(const char *message, std::function onConfirm); diff --git a/src/graphics/draw/NotificationRenderer.cpp b/src/graphics/draw/NotificationRenderer.cpp index d9cf280ac..3d635e588 100644 --- a/src/graphics/draw/NotificationRenderer.cpp +++ b/src/graphics/draw/NotificationRenderer.cpp @@ -383,7 +383,9 @@ void NotificationRenderer::drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisp uint8_t firstOptionToShow = 0; if (alertBannerOptions > 0) { - if (curSelected > 1 && alertBannerOptions > visibleTotalLines - lineCount) { + if (visibleTotalLines - lineCount == 1) { + firstOptionToShow = curSelected; + } else if (curSelected > 1 && alertBannerOptions > visibleTotalLines - lineCount) { if (curSelected > alertBannerOptions - visibleTotalLines + lineCount) firstOptionToShow = alertBannerOptions - visibleTotalLines + lineCount; else @@ -392,6 +394,9 @@ void NotificationRenderer::drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisp firstOptionToShow = 0; } } + // Useful log line for troubleshooting: + /* LOG_WARN("alertBannerOptions: %u, curSelected: %u, visibleTotalLines: %u, lineCount: %u, firstOptionToShow: %u", + alertBannerOptions, curSelected, visibleTotalLines, lineCount, firstOptionToShow); */ for (int i = firstOptionToShow; i < alertBannerOptions && linesShown < visibleTotalLines; i++, linesShown++) { if (i == curSelected) { From e5e8683cdba133e726033101586c3235a8678893 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sun, 17 Aug 2025 05:56:06 -0500 Subject: [PATCH 130/180] Don't update the NodeDB if the nodeinfo has a mismatching public key (#7652) --- src/mesh/NodeDB.cpp | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 79361bb46..97a1e463c 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -1631,24 +1631,33 @@ bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelInde printBytes("Incoming Pubkey: ", p.public_key.bytes, 32); // Alert the user if a remote node is advertising public key that matches our own - if (owner.public_key.size == 32 && memcmp(p.public_key.bytes, owner.public_key.bytes, 32) == 0 && !duplicateWarned) { - duplicateWarned = true; - char warning[] = "Remote device %s has advertised your public key. This may indicate a compromised key. You may need " - "to regenerate your public keys."; - LOG_WARN(warning, p.long_name); - meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); - cn->level = meshtastic_LogRecord_Level_WARNING; - cn->time = getValidTime(RTCQualityFromNet); - sprintf(cn->message, warning, p.long_name); - service->sendClientNotification(cn); + if (owner.public_key.size == 32 && memcmp(p.public_key.bytes, owner.public_key.bytes, 32) == 0) { + if (!duplicateWarned) { + duplicateWarned = true; + char warning[] = + "Remote device %s has advertised your public key. This may indicate a compromised key. You may need " + "to regenerate your public keys."; + LOG_WARN(warning, p.long_name); + meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); + cn->level = meshtastic_LogRecord_Level_WARNING; + cn->time = getValidTime(RTCQualityFromNet); + sprintf(cn->message, warning, p.long_name); + service->sendClientNotification(cn); + } + return false; } } - if (info->user.public_key.size > 0) { // if we have a key for this user already, don't overwrite with a new one + if (info->user.public_key.size == 32) { // if we have a key for this user already, don't overwrite with a new one + // if the key doesn't match, don't update nodeDB at all. + if (p.public_key.size != 32 || (memcmp(p.public_key.bytes, info->user.public_key.bytes, 32) != 0)) { + LOG_WARN("Public Key mismatch, dropping NodeInfo"); + return false; + } LOG_INFO("Public Key set for node, not updating!"); // we copy the key into the incoming packet, to prevent overwrite p.public_key.size = 32; memcpy(p.public_key.bytes, info->user.public_key.bytes, 32); - } else if (p.public_key.size > 0) { + } else if (p.public_key.size == 32) { LOG_INFO("Update Node Pubkey!"); } #endif From 9feb1d378edb2847cc12755beac9aa57a10c571f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sun, 17 Aug 2025 13:37:12 +0200 Subject: [PATCH 131/180] Support for T-Echo Lite, credits to @Szetya for doing all the heavy lifting! (#7636) * Support for T-Echo Lite, credts to @Szetya for doing all the heavy lifting! * move define to ini file --- src/BluetoothStatus.h | 8 + src/graphics/EInkDisplay2.cpp | 4 +- src/main.cpp | 4 + src/modules/SerialModule.cpp | 14 +- src/nimble/NimbleBluetooth.cpp | 5 +- src/platform/nrf52/architecture.h | 2 + variants/nrf52840/t-echo-lite/platformio.ini | 25 +++ variants/nrf52840/t-echo-lite/variant.cpp | 44 ++++ variants/nrf52840/t-echo-lite/variant.h | 207 +++++++++++++++++++ 9 files changed, 303 insertions(+), 10 deletions(-) create mode 100644 variants/nrf52840/t-echo-lite/platformio.ini create mode 100644 variants/nrf52840/t-echo-lite/variant.cpp create mode 100644 variants/nrf52840/t-echo-lite/variant.h diff --git a/src/BluetoothStatus.h b/src/BluetoothStatus.h index f6bb43cc2..680aec929 100644 --- a/src/BluetoothStatus.h +++ b/src/BluetoothStatus.h @@ -89,14 +89,22 @@ class BluetoothStatus : public Status case ConnectionState::CONNECTED: LOG_DEBUG("BluetoothStatus CONNECTED"); #ifdef BLE_LED +#ifdef BLE_LED_INVERTED + digitalWrite(BLE_LED, LOW); +#else digitalWrite(BLE_LED, HIGH); +#endif #endif break; case ConnectionState::DISCONNECTED: LOG_DEBUG("BluetoothStatus DISCONNECTED"); #ifdef BLE_LED +#ifdef BLE_LED_INVERTED + digitalWrite(BLE_LED, HIGH); +#else digitalWrite(BLE_LED, LOW); +#endif #endif break; } diff --git a/src/graphics/EInkDisplay2.cpp b/src/graphics/EInkDisplay2.cpp index a627a42cc..1c9f290b6 100644 --- a/src/graphics/EInkDisplay2.cpp +++ b/src/graphics/EInkDisplay2.cpp @@ -140,13 +140,13 @@ bool EInkDisplay::connect() #endif #endif -#if defined(TTGO_T_ECHO) || defined(ELECROW_ThinkNode_M1) +#if defined(TTGO_T_ECHO) || defined(ELECROW_ThinkNode_M1) || defined(T_ECHO_LITE) { auto lowLevel = new EINK_DISPLAY_MODEL(PIN_EINK_CS, PIN_EINK_DC, PIN_EINK_RES, PIN_EINK_BUSY, SPI1); adafruitDisplay = new GxEPD2_BW(*lowLevel); adafruitDisplay->init(); -#ifdef ELECROW_ThinkNode_M1 +#if defined(ELECROW_ThinkNode_M1) || defined(T_ECHO_LITE) adafruitDisplay->setRotation(4); #else adafruitDisplay->setRotation(3); diff --git a/src/main.cpp b/src/main.cpp index c5be175c4..c53877e37 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -325,8 +325,12 @@ void setup() #ifdef BLE_LED pinMode(BLE_LED, OUTPUT); +#ifdef BLE_LED_INVERTED + digitalWrite(BLE_LED, HIGH); +#else digitalWrite(BLE_LED, LOW); #endif +#endif #if defined(T_DECK) // GPIO10 manages all peripheral power supplies diff --git a/src/modules/SerialModule.cpp b/src/modules/SerialModule.cpp index 39b297965..866497ecc 100644 --- a/src/modules/SerialModule.cpp +++ b/src/modules/SerialModule.cpp @@ -60,7 +60,7 @@ SerialModule *serialModule; SerialModuleRadio *serialModuleRadio; -#if defined(TTGO_T_ECHO) || defined(CANARYONE) || defined(MESHLINK) || defined(ELECROW_ThinkNode_M1) || \ +#if defined(TTGO_T_ECHO) || defined(T_ECHO_LITE) || defined(CANARYONE) || defined(MESHLINK) || defined(ELECROW_ThinkNode_M1) || \ defined(ELECROW_ThinkNode_M5) SerialModule::SerialModule() : StreamAPI(&Serial), concurrency::OSThread("Serial") {} static Print *serialPrint = &Serial; @@ -179,8 +179,8 @@ int32_t SerialModule::runOnce() Serial.begin(baud); Serial.setTimeout(moduleConfig.serial.timeout > 0 ? moduleConfig.serial.timeout : TIMEOUT); } -#elif !defined(TTGO_T_ECHO) && !defined(CANARYONE) && !defined(MESHLINK) && !defined(ELECROW_ThinkNode_M1) && \ - !defined(ELECROW_ThinkNode_M5) +#elif !defined(TTGO_T_ECHO) && !defined(T_ECHO_LITE) && !defined(CANARYONE) && !defined(MESHLINK) && \ + !defined(ELECROW_ThinkNode_M1) && !defined(ELECROW_ThinkNode_M5) if (moduleConfig.serial.rxd && moduleConfig.serial.txd) { #ifdef ARCH_RP2040 Serial2.setFIFOSize(RX_BUFFER); @@ -236,8 +236,8 @@ int32_t SerialModule::runOnce() } } -#if !defined(TTGO_T_ECHO) && !defined(CANARYONE) && !defined(MESHLINK) && !defined(ELECROW_ThinkNode_M1) && \ - !defined(ELECROW_ThinkNode_M5) +#if !defined(TTGO_T_ECHO) && !defined(T_ECHO_LITE) && !defined(CANARYONE) && !defined(MESHLINK) && \ + !defined(ELECROW_ThinkNode_M1) && !defined(ELECROW_ThinkNode_M5) else if ((moduleConfig.serial.mode == meshtastic_ModuleConfig_SerialConfig_Serial_Mode_WS85)) { processWXSerial(); @@ -496,8 +496,8 @@ ParsedLine parseLine(const char *line) */ void SerialModule::processWXSerial() { -#if !defined(TTGO_T_ECHO) && !defined(CANARYONE) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(MESHLINK) && \ - !defined(ELECROW_ThinkNode_M1) && !defined(ELECROW_ThinkNode_M5) +#if !defined(TTGO_T_ECHO) && !defined(T_ECHO_LITE) && !defined(CANARYONE) && !defined(CONFIG_IDF_TARGET_ESP32C6) && \ + !defined(MESHLINK) && !defined(ELECROW_ThinkNode_M1) && !defined(ELECROW_ThinkNode_M5) static unsigned int lastAveraged = 0; static unsigned int averageIntervalMillis = 300000; // 5 minutes hard coded. static double dir_sum_sin = 0; diff --git a/src/nimble/NimbleBluetooth.cpp b/src/nimble/NimbleBluetooth.cpp index 834184292..95e191c8e 100644 --- a/src/nimble/NimbleBluetooth.cpp +++ b/src/nimble/NimbleBluetooth.cpp @@ -223,9 +223,12 @@ void NimbleBluetooth::deinit() LOG_INFO("Disable bluetooth until reboot"); #ifdef BLE_LED +#ifdef BLE_LED_INVERTED + digitalWrite(BLE_LED, HIGH); +#else digitalWrite(BLE_LED, LOW); #endif - +#endif NimBLEDevice::deinit(); #endif } diff --git a/src/platform/nrf52/architecture.h b/src/platform/nrf52/architecture.h index ce42bf849..064bd8ef0 100644 --- a/src/platform/nrf52/architecture.h +++ b/src/platform/nrf52/architecture.h @@ -60,6 +60,8 @@ #define HW_VENDOR meshtastic_HardwareModel_RAK4631 #elif defined(TTGO_T_ECHO) #define HW_VENDOR meshtastic_HardwareModel_T_ECHO +#elif defined(T_ECHO_LITE) +#define HW_VENDOR meshtastic_HardwareModel_T_ECHO_LITE #elif defined(ELECROW_ThinkNode_M1) #define HW_VENDOR meshtastic_HardwareModel_THINKNODE_M1 #elif defined(NANO_G2_ULTRA) diff --git a/variants/nrf52840/t-echo-lite/platformio.ini b/variants/nrf52840/t-echo-lite/platformio.ini new file mode 100644 index 000000000..68ae59dcb --- /dev/null +++ b/variants/nrf52840/t-echo-lite/platformio.ini @@ -0,0 +1,25 @@ +; Using original screen class +[env:t-echo-lite] +extends = nrf52840_base +board = t-echo +board_check = true +debug_tool = jlink + +# add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling. +build_flags = ${nrf52840_base.build_flags} + -Ivariants/nrf52840/t-echo-lite + -D T_ECHO_LITE + -D GPS_POWER_TOGGLE + -D EINK_DISPLAY_MODEL=GxEPD2_122_T61 + -D EINK_WIDTH=192 + -D EINK_HEIGHT=176 + -D USE_EINK + -D USE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk + -D EINK_LIMIT_FASTREFRESH=20 ; How many consecutive fast-refreshes are permitted + -D EINK_BACKGROUND_USES_FAST ; (Optional) Use FAST refresh for both BACKGROUND and RESPONSIVE, until a limit is reached. + +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/t-echo-lite> +lib_deps = + ${nrf52840_base.lib_deps} + https://github.com/meshtastic/GxEPD2/archive/a05c11c02862624266b61599b0d6ba93e33c6f24.zip +;upload_protocol = fs diff --git a/variants/nrf52840/t-echo-lite/variant.cpp b/variants/nrf52840/t-echo-lite/variant.cpp new file mode 100644 index 000000000..cae079b74 --- /dev/null +++ b/variants/nrf52840/t-echo-lite/variant.cpp @@ -0,0 +1,44 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + Copyright (c) 2016 Sandeep Mistry All right reserved. + Copyright (c) 2018, Adafruit Industries (adafruit.com) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "variant.h" +#include "nrf.h" +#include "wiring_constants.h" +#include "wiring_digital.h" + +const uint32_t g_ADigitalPinMap[] = { + // P0 - pins 0 and 1 are hardwired for xtal and should never be enabled + 0xff, 0xff, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + + // P1 + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}; + +void initVariant() +{ + // LED1 & LED2 + pinMode(PIN_LED1, OUTPUT); + ledOff(PIN_LED1); + + pinMode(PIN_LED2, OUTPUT); + ledOff(PIN_LED2); + + pinMode(PIN_LED3, OUTPUT); + ledOff(PIN_LED3); +} diff --git a/variants/nrf52840/t-echo-lite/variant.h b/variants/nrf52840/t-echo-lite/variant.h new file mode 100644 index 000000000..2e2cdce72 --- /dev/null +++ b/variants/nrf52840/t-echo-lite/variant.h @@ -0,0 +1,207 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + Copyright (c) 2016 Sandeep Mistry All right reserved. + Copyright (c) 2018, Adafruit Industries (adafruit.com) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _VARIANT_TTGO_EINK_V1_0_ +#define _VARIANT_TTGO_EINK_V1_0_ + +/** Master clock frequency */ +#define VARIANT_MCK (64000000ul) + +#define USE_LFXO // Board uses 32khz crystal for LF + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "WVariant.h" + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +// Number of pins defined in PinDescription array +#define PINS_COUNT (48) +#define NUM_DIGITAL_PINS (48) +#define NUM_ANALOG_INPUTS (1) +#define NUM_ANALOG_OUTPUTS (0) + +// LEDs +#define PIN_LED1 (32 + 7) // Green LED +#define PIN_LED2 (32 + 5) // Blue LED +// Unused(by firmware) LEDs: +#define PIN_LED3 (32 + 14) // Red LED inside, under the display. + +#define LED_RED PIN_LED3 +#define LED_BLUE PIN_LED2 +#define LED_GREEN PIN_LED1 + +#define BLE_LED LED_BLUE +#define BLE_LED_INVERTED 1 +#define LED_BUILTIN LED_GREEN +#define LED_CONN LED_GREEN +#define LED_STATE_ON 0 // State when LED is lit + +// Buttons +#define PIN_BUTTON1 (0 + 24) +#define PIN_BUTTON2 (0 + 18) // 0.18 is labeled on the board as RESET but we configure it in the bootloader as a regular GPIO + +#define BUTTON_CLICK_MS 400 + +// Analog pins +#define PIN_A0 (0 + 2) // Battery ADC + +#define BATTERY_PIN PIN_A0 + +static const uint8_t A0 = PIN_A0; + +#define ADC_RESOLUTION 14 + +#define ADC_CTRL (0 + 31) +#define ADC_CTRL_ENABLED HIGH + +// NFC +#define PIN_NFC1 (9) +#define PIN_NFC2 (10) + +// Wire Interfaces +#define WIRE_INTERFACES_COUNT 1 + +#define PIN_WIRE_SDA (32 + 4) +#define PIN_WIRE_SCL (32 + 2) + +/* + Internal, PCB PAD interrupt PIN. Currently not used. (Not built in my device) +*/ +// #define PIN_IMU_INT (0 + 16) // Interrupt from the IMU, macro name correct?! + +// External serial flash ZD25WQ32CEIGR +// QSPI Pins +#define PIN_QSPI_SCK (0 + 4) +#define PIN_QSPI_CS (0 + 12) +#define PIN_QSPI_IO0 (0 + 6) // MOSI if using two bit interface +#define PIN_QSPI_IO1 (0 + 8) // MISO if using two bit interface +#define PIN_QSPI_IO2 (32 + 9) // WP if using two bit interface (i.e. not used) +#define PIN_QSPI_IO3 (0 + 26) // HOLD if using two bit interface (i.e. not used) + +// On-board QSPI Flash +#define EXTERNAL_FLASH_DEVICES ZD25WQ32CEIGR +#define EXTERNAL_FLASH_USE_QSPI + +// Lora radio + +#define USE_SX1262 +// #define USE_SX1268 // currently only available with XS1262. +#define SX126X_CS (0 + 11) +#define SX126X_DIO1 (32 + 8) +#define SX126X_DIO2 (0 + 5) +#define SX126X_BUSY (0 + 14) +#define SX126X_RESET (0 + 7) +#define SX126X_RXEN (32 + 1) +#define SX126X_TXEN (0 + 27) +// #define TCXO_OPTIONAL +#define SX126X_DIO3_TCXO_VOLTAGE 1.8 + +// eink display pins +#define VEXT_ENABLE (32 + 12) +#define VEXT_ON_VALUE LOW +#define PIN_EINK_CS (0 + 22) +#define PIN_EINK_BUSY (0 + 3) +#define PIN_EINK_DC (0 + 21) +#define PIN_EINK_RES (0 + 28) +#define PIN_EINK_SCLK (0 + 19) +#define PIN_EINK_MOSI (0 + 20) + +// Controls power 3V3 for all peripherals (eink + GPS + LoRa + Sensor) +#define PIN_POWER_EN (0 + 30) // 3V3 POWER Enable + +#define PIN_SPI1_MISO (-1) // The display does not use MISO. +#define PIN_SPI1_MOSI PIN_EINK_MOSI +#define PIN_SPI1_SCK PIN_EINK_SCLK + +// GPS pins +// #define GPS_DEBUG +#define GPS_L76K +#define GPS_BAUDRATE 9600 +#define HAS_GPS 1 +// #define PIN_GPS_REINIT (32 + 5) // An output to reset L76K GPS. As per datasheet, low for > 100ms will reset the L76K + +#define PIN_GPS_STANDBY (32 + 10) // An output to wake GPS, low means allow sleep, high means force wake +// Seems to be missing on this new board +#define PIN_GPS_PPS (0 + 29) // Pulse per second input from the GPS +#define GPS_TX_PIN (32 + 15) // This is for bits going TOWARDS the CPU +#define GPS_RX_PIN (32 + 13) // This is for bits going TOWARDS the GPS + +#define GPS_THREAD_INTERVAL 50 + +#define PIN_SERIAL1_RX GPS_TX_PIN +#define PIN_SERIAL1_TX GPS_RX_PIN + +// SPI Interfaces +#define SPI_INTERFACES_COUNT 2 + +// For LORA, SPI 0 +#define PIN_SPI_MISO (0 + 17) +#define PIN_SPI_MOSI (0 + 15) +#define PIN_SPI_SCK (0 + 13) + +// Battery +// The battery sense is hooked to pin A0 (2) +// it is defined in the analogue pin section of this file +// and has 12 bit resolution +#define BATTERY_SENSE_RESOLUTION_BITS 12 +#define BATTERY_SENSE_RESOLUTION 4096.0 +#undef AREF_VOLTAGE +#define AREF_VOLTAGE 3.0 +#define VBAT_AR_INTERNAL AR_INTERNAL_3_0 +#define ADC_MULTIPLIER (2.0F) + +// #define NO_EXT_GPIO 1 +// PINs back side +// Batt & solar connector left up corner +/* +------------------------------- +| VDDH, VBAT, 0.23, SCL , 1.06 | +| GND , SDA , 0.09, 0.10, 0.25 | +------------------------------- + -------- + | VDDH | + | GND | + | 1.13 | - Wake Up/standby + | 1.15 | - PPS + | 0.29 | - TX + | 1.10 | - RX + | 1.11 | - EN + -------- +------------------------------- +| 3V3 , GND , 0.16, 1.03, G_WU | 0.16 internal solder pad interrupt PIN, +| G_EN, G_RX, G_TX, GND , PPS | +------------------------------- +*/ + +// To debug via the segger JLINK console rather than the CDC-ACM serial device +// #define USE_SEGGER + +#ifdef __cplusplus +} +#endif + +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#endif \ No newline at end of file From 78c5309e9a1195b8b93d49c67c45f65b7e04abab Mon Sep 17 00:00:00 2001 From: Manuel <71137295+mverch67@users.noreply.github.com> Date: Sun, 17 Aug 2025 21:48:24 +0200 Subject: [PATCH 132/180] apply 180 degree hw roration Indicator BaseUI (#7660) --- src/graphics/TFTDisplay.cpp | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/graphics/TFTDisplay.cpp b/src/graphics/TFTDisplay.cpp index 3e9bafc6c..24ea6c47a 100644 --- a/src/graphics/TFTDisplay.cpp +++ b/src/graphics/TFTDisplay.cpp @@ -849,9 +849,29 @@ static LGFX *tft = nullptr; #include #include +class PanelInit_ST7701 : public lgfx::Panel_ST7701 +{ + public: + const uint8_t *getInitCommands(uint8_t listno) const override + { + // 180 degree hw rotation: vertical flip, horizontal flip + static constexpr const uint8_t list1[] = {0x36, 1, 0x10, // MADCTL for vertical flip + 0xFF, 5, 0x77, 0x01, 0x00, 0x00, 0x10, // Command2 BK0 SEL + 0xC7, 1, 0x04, // SDIR: X-direction Control (Horizontal Flip) + 0xFF, 5, 0x77, 0x01, 0x00, 0x00, 0x00, // Command2 BK0 DIS + 0xFF, 0xFF}; + switch (listno) { + case 1: + return list1; + default: + return lgfx::Panel_ST7701::getInitCommands(listno); + } + } +}; + class LGFX : public lgfx::LGFX_Device { - lgfx::Panel_ST7701 _panel_instance; + PanelInit_ST7701 _panel_instance; lgfx::Bus_RGB _bus_instance; lgfx::Light_PWM _light_instance; lgfx::Touch_FT5x06 _touch_instance; @@ -1184,9 +1204,9 @@ bool TFTDisplay::connect() attachInterrupt(digitalPinToInterrupt(SCREEN_TOUCH_INT), rak14014_tpIntHandle, FALLING); #elif defined(T_DECK) || defined(PICOMPUTER_S3) || defined(CHATTER_2) tft->setRotation(1); // T-Deck has the TFT in landscape -#elif defined(T_WATCH_S3) || defined(SENSECAP_INDICATOR) +#elif defined(T_WATCH_S3) tft->setRotation(2); // T-Watch S3 left-handed orientation -#elif ARCH_PORTDUINO +#elif ARCH_PORTDUINO || defined(SENSECAP_INDICATOR) tft->setRotation(0); // use config.yaml to set rotation #else tft->setRotation(3); // Orient horizontal and wide underneath the silkscreen name label From 36e8dc74f45c6da09e9d4c44bd22320867f6f7ed Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 05:52:02 -0500 Subject: [PATCH 133/180] Upgrade trunk (#7665) Co-authored-by: vidplace7 <1779290+vidplace7@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 10bb1bd00..de38e3ec0 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,9 +9,9 @@ plugins: lint: enabled: - checkov@3.2.461 - - renovate@41.71.1 + - renovate@41.74.0 - prettier@3.6.2 - - trufflehog@3.90.4 + - trufflehog@3.90.5 - yamllint@1.37.1 - bandit@1.8.6 - trivy@0.64.1 From 95200e8f6b532d4498cd8e7738109d7996db54b3 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Mon, 18 Aug 2025 16:33:52 -0500 Subject: [PATCH 134/180] Adds rfswitch on Portduino (#7663) * Initial attempt to get rfswitch working on Portduino * Make portduino_config global --- src/mesh/LR11x0Interface.cpp | 15 ++++----- src/platform/portduino/PortduinoGlue.cpp | 43 ++++++++++++++++++++++++ src/platform/portduino/PortduinoGlue.h | 10 +++++- 3 files changed, 58 insertions(+), 10 deletions(-) diff --git a/src/mesh/LR11x0Interface.cpp b/src/mesh/LR11x0Interface.cpp index a20db808e..a0d992c42 100644 --- a/src/mesh/LR11x0Interface.cpp +++ b/src/mesh/LR11x0Interface.cpp @@ -6,6 +6,10 @@ #include "mesh/NodeDB.h" #ifdef LR11X0_DIO_AS_RF_SWITCH #include "rfswitch.h" +#elif ARCH_PORTDUINO +#include "PortduinoGlue.h" +#define rfswitch_dio_pins portduino_config.rfswitch_dio_pins +#define rfswitch_table portduino_config.rfswitch_table #else static const uint32_t rfswitch_dio_pins[] = {RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC}; static const Module::RfSwitchMode_t rfswitch_table[] = { @@ -14,10 +18,6 @@ static const Module::RfSwitchMode_t rfswitch_table[] = { }; #endif -#ifdef ARCH_PORTDUINO -#include "PortduinoGlue.h" -#endif - // Particular boards might define a different max power based on what their hardware can do, default to max power output if not // specified (may be dangerous if using external PA and LR11x0 power config forgotten) #if ARCH_PORTDUINO @@ -117,17 +117,14 @@ template bool LR11x0Interface::init() #ifdef LR11X0_DIO_AS_RF_SWITCH bool dioAsRfSwitch = true; #elif defined(ARCH_PORTDUINO) - bool dioAsRfSwitch = false; - if (settingsMap[dio2_as_rf_switch]) { - dioAsRfSwitch = true; - } + bool dioAsRfSwitch = portduino_config.has_rfswitch_table; #else bool dioAsRfSwitch = false; #endif if (dioAsRfSwitch) { lora.setRfSwitchTable(rfswitch_dio_pins, rfswitch_table); - LOG_DEBUG("Set DIO RF switch", res); + LOG_DEBUG("Set DIO RF switch"); } if (res == RADIOLIB_ERR_NONE) { diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index 5f99ec2c3..ac4e79af1 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -29,6 +29,7 @@ std::map settingsMap; std::map settingsStrings; +portduino_config_struct portduino_config; std::ofstream traceFile; Ch341Hal *ch341Hal = nullptr; char *configPath = nullptr; @@ -553,6 +554,48 @@ bool loadConfig(const char *configPath) } } } + if (yamlConfig["Lora"]["rfswitch_table"]) { + portduino_config.has_rfswitch_table = true; + portduino_config.rfswitch_table[0].mode = LR11x0::MODE_STBY; + portduino_config.rfswitch_table[1].mode = LR11x0::MODE_RX; + portduino_config.rfswitch_table[2].mode = LR11x0::MODE_TX; + portduino_config.rfswitch_table[3].mode = LR11x0::MODE_TX_HP; + portduino_config.rfswitch_table[4].mode = LR11x0::MODE_TX_HF; + portduino_config.rfswitch_table[5].mode = LR11x0::MODE_GNSS; + portduino_config.rfswitch_table[6].mode = LR11x0::MODE_WIFI; + portduino_config.rfswitch_table[7] = END_OF_MODE_TABLE; + + for (int i = 0; i < 5; i++) { + + // set up the pin array first + if (yamlConfig["Lora"]["rfswitch_table"]["pins"][i].as("") == "DIO5") + portduino_config.rfswitch_dio_pins[i] = RADIOLIB_LR11X0_DIO5; + if (yamlConfig["Lora"]["rfswitch_table"]["pins"][i].as("") == "DIO6") + portduino_config.rfswitch_dio_pins[i] = RADIOLIB_LR11X0_DIO6; + if (yamlConfig["Lora"]["rfswitch_table"]["pins"][i].as("") == "DIO7") + portduino_config.rfswitch_dio_pins[i] = RADIOLIB_LR11X0_DIO7; + if (yamlConfig["Lora"]["rfswitch_table"]["pins"][i].as("") == "DIO8") + portduino_config.rfswitch_dio_pins[i] = RADIOLIB_LR11X0_DIO8; + if (yamlConfig["Lora"]["rfswitch_table"]["pins"][i].as("") == "DIO10") + portduino_config.rfswitch_dio_pins[i] = RADIOLIB_LR11X0_DIO10; + + // now fill in the table + if (yamlConfig["Lora"]["rfswitch_table"]["MODE_STBY"][i].as("") == "HIGH") + portduino_config.rfswitch_table[0].values[i] = HIGH; + if (yamlConfig["Lora"]["rfswitch_table"]["MODE_RX"][i].as("") == "HIGH") + portduino_config.rfswitch_table[1].values[i] = HIGH; + if (yamlConfig["Lora"]["rfswitch_table"]["MODE_TX"][i].as("") == "HIGH") + portduino_config.rfswitch_table[2].values[i] = HIGH; + if (yamlConfig["Lora"]["rfswitch_table"]["MODE_TX_HP"][i].as("") == "HIGH") + portduino_config.rfswitch_table[3].values[i] = HIGH; + if (yamlConfig["Lora"]["rfswitch_table"]["MODE_TX_HF"][i].as("") == "HIGH") + portduino_config.rfswitch_table[4].values[i] = HIGH; + if (yamlConfig["Lora"]["rfswitch_table"]["MODE_GNSS"][i].as("") == "HIGH") + portduino_config.rfswitch_table[5].values[i] = HIGH; + if (yamlConfig["Lora"]["rfswitch_table"]["MODE_WIFI"][i].as("") == "HIGH") + portduino_config.rfswitch_table[6].values[i] = HIGH; + } + } } if (yamlConfig["GPIO"]) { settingsMap[userButtonPin] = yamlConfig["GPIO"]["User"].as(RADIOLIB_NC); diff --git a/src/platform/portduino/PortduinoGlue.h b/src/platform/portduino/PortduinoGlue.h index 288870eef..64277322a 100644 --- a/src/platform/portduino/PortduinoGlue.h +++ b/src/platform/portduino/PortduinoGlue.h @@ -3,6 +3,8 @@ #include #include +#include "LR11x0Interface.h" +#include "Module.h" #include "platform/portduino/USBHal.h" // Product strings for auto-configuration @@ -126,4 +128,10 @@ bool loadConfig(const char *configPath); static bool ends_with(std::string_view str, std::string_view suffix); void getMacAddr(uint8_t *dmac); bool MAC_from_string(std::string mac_str, uint8_t *dmac); -std::string exec(const char *cmd); \ No newline at end of file +std::string exec(const char *cmd); + +extern struct portduino_config_struct { + bool has_rfswitch_table = false; + uint32_t rfswitch_dio_pins[5] = {RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC}; + Module::RfSwitchMode_t rfswitch_table[8]; +} portduino_config; \ No newline at end of file From f65e2c639ea87acd2d5d871508932e6d1cde76b5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 05:35:25 -0500 Subject: [PATCH 135/180] Update protobufs (#7679) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/telemetry.pb.h | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/protobufs b/protobufs index 5dd723fe6..be5137698 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 5dd723fe6f33a8613ec81acf5e15be26365c7cce +Subproject commit be5137698027f9e9fe6e68d5d5d638049f61ba8f diff --git a/src/mesh/generated/meshtastic/telemetry.pb.h b/src/mesh/generated/meshtastic/telemetry.pb.h index f758995c2..9af095e78 100644 --- a/src/mesh/generated/meshtastic/telemetry.pb.h +++ b/src/mesh/generated/meshtastic/telemetry.pb.h @@ -99,7 +99,9 @@ typedef enum _meshtastic_TelemetrySensorType { /* Sensirion SFA30 Formaldehyde sensor */ meshtastic_TelemetrySensorType_SFA30 = 42, /* SEN5X PM SENSORS */ - meshtastic_TelemetrySensorType_SEN5X = 43 + meshtastic_TelemetrySensorType_SEN5X = 43, + /* TSL2561 light sensor */ + meshtastic_TelemetrySensorType_TSL2561 = 44 } meshtastic_TelemetrySensorType; /* Struct definitions */ @@ -434,8 +436,8 @@ extern "C" { /* Helper constants for enums */ #define _meshtastic_TelemetrySensorType_MIN meshtastic_TelemetrySensorType_SENSOR_UNSET -#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_SEN5X -#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_SEN5X+1)) +#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_TSL2561 +#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_TSL2561+1)) From 2d7818797db11663eaa4428ba8806977f87ccbd1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 05:43:10 -0500 Subject: [PATCH 136/180] Update platform-native digest to cd32f4e (#7662) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- arch/portduino/portduino.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini index ae68159eb..33a4c4d05 100644 --- a/arch/portduino/portduino.ini +++ b/arch/portduino/portduino.ini @@ -2,7 +2,7 @@ [portduino_base] platform = # renovate: datasource=git-refs depName=platform-native packageName=https://github.com/meshtastic/platform-native gitBranch=develop - https://github.com/meshtastic/platform-native/archive/6cb7a455b440dd0738e8ed74a18136ed5cf7ea63.zip + https://github.com/meshtastic/platform-native/archive/cd32f4ed20812d1fe9c8f74c0b6e80dc93dfce54.zip framework = arduino build_src_filter = From 1691e885f21d69382c9f4e8381e38b8af84e1a40 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 19 Aug 2025 06:00:29 -0500 Subject: [PATCH 137/180] Display test results --- .github/workflows/pr_tests.yml | 244 +++++++++++++++++++++++++++++++++ 1 file changed, 244 insertions(+) create mode 100644 .github/workflows/pr_tests.yml diff --git a/.github/workflows/pr_tests.yml b/.github/workflows/pr_tests.yml new file mode 100644 index 000000000..f6a678a45 --- /dev/null +++ b/.github/workflows/pr_tests.yml @@ -0,0 +1,244 @@ +name: Tests + +on: + pull_request: + branches: [master, develop] + paths-ignore: + - "**.md" + - "docs/**" + - "images/**" + pull_request_target: + branches: [master, develop] + paths-ignore: + - "**.md" + - "docs/**" + - "images/**" + +concurrency: + group: tests-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read + actions: read + checks: write + pull-requests: write + +jobs: + native-tests: + name: "🧪 Native Tests" + if: github.repository == 'meshtastic/firmware' + uses: ./.github/workflows/test_native.yml + permissions: + contents: read + actions: read + checks: write + + test-summary: + name: "📊 Test Results" + runs-on: ubuntu-latest + needs: [native-tests] + if: always() + permissions: + contents: read + actions: read + checks: write + pull-requests: write + steps: + - uses: actions/checkout@v5 + with: + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + + - name: Get release version string + run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT + id: version + + - name: Download test artifacts + if: needs.native-tests.result != 'skipped' + uses: actions/download-artifact@v5 + with: + name: platformio-test-report-${{ steps.version.outputs.long }}.zip + merge-multiple: true + + - name: Parse test results and create detailed summary + id: test-results + run: | + echo "## 🧪 Test Results Summary" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + + # Check overall job status first + if [[ "${{ needs.native-tests.result }}" == "success" ]]; then + echo "✅ **Overall Status**: PASSED" >> $GITHUB_STEP_SUMMARY + elif [[ "${{ needs.native-tests.result }}" == "failure" ]]; then + echo "❌ **Overall Status**: FAILED" >> $GITHUB_STEP_SUMMARY + elif [[ "${{ needs.native-tests.result }}" == "cancelled" ]]; then + echo "⏸️ **Overall Status**: CANCELLED" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "Tests were cancelled before completion." >> $GITHUB_STEP_SUMMARY + exit 0 + else + echo "⚠️ **Overall Status**: SKIPPED" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "Tests were skipped." >> $GITHUB_STEP_SUMMARY + exit 0 + fi + + echo "" >> $GITHUB_STEP_SUMMARY + + # Parse detailed test results if available + if [ -f "testreport.xml" ]; then + echo "### 🔍 Individual Test Results" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + + python3 << 'EOF' + import xml.etree.ElementTree as ET + import os + + try: + tree = ET.parse('testreport.xml') + root = tree.getroot() + + total_tests = 0 + passed_tests = 0 + failed_tests = 0 + skipped_tests = 0 + + # Parse testsuite elements + for testsuite in root.findall('.//testsuite'): + suite_name = testsuite.get('name', 'Unknown') + suite_tests = int(testsuite.get('tests', '0')) + suite_failures = int(testsuite.get('failures', '0')) + suite_errors = int(testsuite.get('errors', '0')) + suite_skipped = int(testsuite.get('skipped', '0')) + + total_tests += suite_tests + failed_tests += suite_failures + suite_errors + skipped_tests += suite_skipped + passed_tests += suite_tests - suite_failures - suite_errors - suite_skipped + + if suite_tests > 0: + status = "✅" if (suite_failures + suite_errors) == 0 else "❌" + print(f"**{status} Test Suite: {suite_name}**") + print(f"- Total: {suite_tests}") + print(f"- Passed: ✅ {suite_tests - suite_failures - suite_errors - suite_skipped}") + print(f"- Failed: ❌ {suite_failures + suite_errors}") + if suite_skipped > 0: + print(f"- Skipped: ⏭️ {suite_skipped}") + print("") + + # Show individual test results for failed suites + if suite_failures + suite_errors > 0: + print("**Failed Tests:**") + for testcase in testsuite.findall('testcase'): + test_name = testcase.get('name', 'Unknown') + failure = testcase.find('failure') + error = testcase.find('error') + + if failure is not None: + msg = failure.get('message', 'Unknown error')[:100] + print(f"- ❌ `{test_name}`: {msg}") + elif error is not None: + msg = error.get('message', 'Unknown error')[:100] + print(f"- ❌ `{test_name}`: ERROR - {msg}") + print("") + else: + # Show passed tests for successful suites + passed_count = 0 + for testcase in testsuite.findall('testcase'): + if testcase.find('failure') is None and testcase.find('error') is None: + if passed_count < 5: # Limit to first 5 to avoid spam + test_name = testcase.get('name', 'Unknown') + print(f"- ✅ `{test_name}`: PASSED") + passed_count += 1 + if passed_count > 5: + print(f"- ... and {passed_count - 5} more tests passed") + print("") + + # Summary statistics + print("### 📊 Test Statistics") + print(f"- **Total Tests**: {total_tests}") + print(f"- **Passed**: ✅ {passed_tests}") + print(f"- **Failed**: ❌ {failed_tests}") + if skipped_tests > 0: + print(f"- **Skipped**: ⏭️ {skipped_tests}") + + if failed_tests > 0: + print(f"\n❌ **{failed_tests} tests failed out of {total_tests} total**") + else: + print(f"\n✅ **All {total_tests} tests passed!**") + + except Exception as e: + print(f"❌ Error parsing test results: {e}") + EOF + else + echo "⚠️ **No detailed test report available**" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "Test artifacts may not have been generated properly." >> $GITHUB_STEP_SUMMARY + fi + + echo "" >> $GITHUB_STEP_SUMMARY + echo "---" >> $GITHUB_STEP_SUMMARY + echo "View detailed logs in the [Actions tab](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $GITHUB_STEP_SUMMARY + + - name: Comment test results on PR + if: github.event_name == 'pull_request' && needs.native-tests.result != 'skipped' + uses: actions/github-script@v7 + with: + script: | + const fs = require('fs'); + + // Read the step summary to use as PR comment + let testSummary = "## 🧪 Test Results Summary\n\n"; + + if ("${{ needs.native-tests.result }}" === "success") { + testSummary += "✅ **All tests passed!**\n\n"; + } else if ("${{ needs.native-tests.result }}" === "failure") { + testSummary += "❌ **Some tests failed.**\n\n"; + } else { + testSummary += "⚠️ **Tests did not complete normally.**\n\n"; + } + + testSummary += `View detailed results: [Actions Run](${context.payload.repository.html_url}/actions/runs/${context.runId})\n\n`; + testSummary += "---\n"; + testSummary += "*This comment will be automatically updated when new commits are pushed.*"; + + // Find existing comment + const comments = await github.rest.issues.listComments({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number + }); + + const botComment = comments.data.find(comment => + comment.user.type === 'Bot' && + comment.body.includes('🧪 Test Results Summary') + ); + + if (botComment) { + // Update existing comment + await github.rest.issues.updateComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: botComment.id, + body: testSummary + }); + } else { + // Create new comment + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: testSummary + }); + } + + - name: Set overall status + run: | + if [[ "${{ needs.native-tests.result }}" == "success" ]]; then + echo "All tests passed! ✅" + exit 0 + else + echo "Some tests failed! ❌" + exit 1 + fi From e55084629aac7b297efa2c24112ff92690d71e61 Mon Sep 17 00:00:00 2001 From: jake-b <1012393+jake-b@users.noreply.github.com> Date: Tue, 19 Aug 2025 09:10:53 -0400 Subject: [PATCH 138/180] Move heartbeat response before !available guard. (#7672) * Move heartbeat response before !available guard. * fix formatting. --------- Co-authored-by: Jake-B Co-authored-by: Ben Meadors --- src/mesh/PhoneAPI.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index 305689fff..a3a8a2087 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -192,12 +192,6 @@ bool PhoneAPI::handleToRadio(const uint8_t *buf, size_t bufLength) size_t PhoneAPI::getFromRadio(uint8_t *buf) { - if (!available()) { - return 0; - } - // In case we send a FromRadio packet - memset(&fromRadioScratch, 0, sizeof(fromRadioScratch)); - // Respond to heartbeat by sending queue status if (heartbeatReceived) { memset(&fromRadioScratch, 0, sizeof(fromRadioScratch)); @@ -209,6 +203,12 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) return numbytes; } + if (!available()) { + return 0; + } + // In case we send a FromRadio packet + memset(&fromRadioScratch, 0, sizeof(fromRadioScratch)); + // Advance states as needed switch (state) { case STATE_SEND_NOTHING: From 5b62bbe8e6e19643a91fee0c43b320f7a48aa580 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 19 Aug 2025 11:30:19 -0500 Subject: [PATCH 139/180] Disable for now --- .github/workflows/pr_tests.yml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pr_tests.yml b/.github/workflows/pr_tests.yml index f6a678a45..786feeced 100644 --- a/.github/workflows/pr_tests.yml +++ b/.github/workflows/pr_tests.yml @@ -1,18 +1,13 @@ name: Tests +# DISABLED: Changed from automatic PR triggers to manual only on: - pull_request: - branches: [master, develop] - paths-ignore: - - "**.md" - - "docs/**" - - "images/**" - pull_request_target: - branches: [master, develop] - paths-ignore: - - "**.md" - - "docs/**" - - "images/**" + workflow_dispatch: + inputs: + reason: + description: "Reason for manual test run" + required: false + default: "Manual test execution" concurrency: group: tests-${{ github.head_ref || github.run_id }} @@ -47,8 +42,7 @@ jobs: steps: - uses: actions/checkout@v5 with: - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} + submodules: recursive - name: Get release version string run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT From 68726a1b0e184432f4bbf56a0e2f61c11592a7f1 Mon Sep 17 00:00:00 2001 From: Austin Date: Tue, 19 Aug 2025 15:06:43 -0400 Subject: [PATCH 140/180] Docker: fix web assets location (#7683) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6a2ddeece..b1e151ac7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -61,7 +61,7 @@ RUN apt-get update && apt-get --no-install-recommends -y install \ # Fetch compiled binary from the builder COPY --from=builder /tmp/firmware/release/meshtasticd /usr/bin/ -COPY --from=builder /tmp/web /usr/share/meshtasticd/ +COPY --from=builder /tmp/web /usr/share/meshtasticd/web/ # Copy config templates COPY ./bin/config.d /etc/meshtasticd/available.d From 9654f5b21867d2f911b264006e1bc36ee39ac34a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 14:13:25 -0500 Subject: [PATCH 141/180] Update platform-native digest to 37d9864 (#7684) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- arch/portduino/portduino.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini index 33a4c4d05..20b3f8e3d 100644 --- a/arch/portduino/portduino.ini +++ b/arch/portduino/portduino.ini @@ -2,7 +2,7 @@ [portduino_base] platform = # renovate: datasource=git-refs depName=platform-native packageName=https://github.com/meshtastic/platform-native gitBranch=develop - https://github.com/meshtastic/platform-native/archive/cd32f4ed20812d1fe9c8f74c0b6e80dc93dfce54.zip + https://github.com/meshtastic/platform-native/archive/37d986499ce24511952d7146db72d667c6bdaff7.zip framework = arduino build_src_filter = From eb6ef1cbea08bab0619a001a9d3c95a9887a5069 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 14:13:53 -0500 Subject: [PATCH 142/180] Update meshtastic-esp8266-oled-ssd1306 digest to 9573abb (#7686) 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 528563def..3d1360cc4 100644 --- a/platformio.ini +++ b/platformio.ini @@ -60,7 +60,7 @@ monitor_speed = 115200 monitor_filters = direct lib_deps = # renovate: datasource=git-refs depName=meshtastic-esp8266-oled-ssd1306 packageName=https://github.com/meshtastic/esp8266-oled-ssd1306 gitBranch=master - https://github.com/meshtastic/esp8266-oled-ssd1306/archive/0119501e9983bd894830b02f545c377ee08d66fe.zip + https://github.com/meshtastic/esp8266-oled-ssd1306/archive/9573abb64dc9c94f3051348f2bf4fc5cedf03c22.zip # renovate: datasource=git-refs depName=meshtastic-OneButton packageName=https://github.com/meshtastic/OneButton gitBranch=master https://github.com/meshtastic/OneButton/archive/fa352d668c53f290cfa480a5f79ad422cd828c70.zip # renovate: datasource=git-refs depName=meshtastic-arduino-fsm packageName=https://github.com/meshtastic/arduino-fsm gitBranch=master From 1c1462e7766a5b0658ad3226dc52218fcb7d50a7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 14:14:12 -0500 Subject: [PATCH 143/180] Update meshtastic/device-ui digest to 8f5094b (#7633) 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 3d1360cc4..ac30eb32e 100644 --- a/platformio.ini +++ b/platformio.ini @@ -118,7 +118,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/0cd108ff783539e41ef38258ba2784ab3b1bdc97.zip + https://github.com/meshtastic/device-ui/archive/8f5094b248c15ea2f9acf19cedfef6d2248fc1ff.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 5de61b1a3ddfd3a177fb7bcbf48c2f51f9080309 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Tue, 19 Aug 2025 14:15:05 -0500 Subject: [PATCH 144/180] Only gate PKC behind the simradio CLI flag (#7681) * Only gate PKC behind the simradio CLI flag * Hide router.cpp simradio check behind #if ARCH_PORTDUINO --- src/mesh/Router.cpp | 6 ++++-- src/platform/portduino/PortduinoGlue.cpp | 5 ++--- src/platform/portduino/PortduinoGlue.h | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index a54dcb976..cceacfe9e 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -523,8 +523,10 @@ meshtastic_Routing_Error perhapsEncode(meshtastic_MeshPacket *p) // is not in the local nodedb // First, only PKC encrypt packets we are originating if (isFromUs(p) && - // Don't use PKC with simulator - radioType != SIM_RADIO && +#if ARCH_PORTDUINO + // Sim radio via the cli flag skips PKC + !portduino_config.force_simradio && +#endif // Don't use PKC with Ham mode !owner.is_licensed && // Don't use PKC if it's not explicitly requested and a non-primary channel is requested diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index ac4e79af1..3753c944c 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -34,7 +34,6 @@ std::ofstream traceFile; Ch341Hal *ch341Hal = nullptr; char *configPath = nullptr; char *optionMac = nullptr; -bool forceSimulated = false; bool verboseEnabled = false; const char *argp_program_version = optstr(APP_VERSION); @@ -67,7 +66,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) configPath = arg; break; case 's': - forceSimulated = true; + portduino_config.force_simradio = true; break; case 'h': optionMac = arg; @@ -190,7 +189,7 @@ void portduinoSetup() YAML::Node yamlConfig; - if (forceSimulated == true) { + if (portduino_config.force_simradio == true) { settingsMap[use_simradio] = true; } else if (configPath != nullptr) { if (loadConfig(configPath)) { diff --git a/src/platform/portduino/PortduinoGlue.h b/src/platform/portduino/PortduinoGlue.h index 64277322a..6e450c90e 100644 --- a/src/platform/portduino/PortduinoGlue.h +++ b/src/platform/portduino/PortduinoGlue.h @@ -134,4 +134,5 @@ extern struct portduino_config_struct { bool has_rfswitch_table = false; uint32_t rfswitch_dio_pins[5] = {RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC}; Module::RfSwitchMode_t rfswitch_table[8]; + bool force_simradio = false; } portduino_config; \ No newline at end of file From c19f573b49f6c2d75f3a33a66efbee0fee983836 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 19 Aug 2025 20:10:47 -0500 Subject: [PATCH 145/180] Fix TLS port bug on default mqtt validation --- src/mqtt/MQTT.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index d94aeff95..7f7a9d511 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -279,6 +279,8 @@ struct PubSubConfig { // Defaults static constexpr uint16_t defaultPort = 1883; + static constexpr uint16_t defaultPortTls = 8883; + uint16_t serverPort = defaultPort; String serverAddr = default_mqtt_address; const char *mqttUsername = default_mqtt_username; @@ -641,7 +643,7 @@ bool MQTT::isValidConfig(const meshtastic_ModuleConfig_MQTTConfig &config, MQTTC } const bool defaultServer = isDefaultServer(parsed.serverAddr); - if (defaultServer && parsed.serverPort != PubSubConfig::defaultPort) { + if (defaultServer && !IS_ONE_OF(parsed.serverPort, PubSubConfig::defaultPort, PubSubConfig::defaultPortTls)) { const char *warning = "Invalid MQTT config: default server address must not have a port specified"; LOG_ERROR(warning); #if !IS_RUNNING_TESTS From f413c49555fdf95730b265072a819ba78e637f23 Mon Sep 17 00:00:00 2001 From: Wilson Date: Wed, 20 Aug 2025 11:52:10 +0800 Subject: [PATCH 146/180] Add Meshtiny device (#7676) * Add Meshtiny device - nRF52 OLED upDown encoder * Update platformio.ini * Update platformio.ini * Add GPS Exclude to Meshtiny. --------- Co-authored-by: Ben Meadors --- boards/meshtiny.json | 52 ++++++ variants/nrf52840/meshtiny/platformio.ini | 19 +++ variants/nrf52840/meshtiny/variant.cpp | 54 ++++++ variants/nrf52840/meshtiny/variant.h | 199 ++++++++++++++++++++++ 4 files changed, 324 insertions(+) create mode 100644 boards/meshtiny.json create mode 100644 variants/nrf52840/meshtiny/platformio.ini create mode 100644 variants/nrf52840/meshtiny/variant.cpp create mode 100644 variants/nrf52840/meshtiny/variant.h diff --git a/boards/meshtiny.json b/boards/meshtiny.json new file mode 100644 index 000000000..1473388ea --- /dev/null +++ b/boards/meshtiny.json @@ -0,0 +1,52 @@ +{ + "build": { + "arduino": { + "ldscript": "nrf52840_s140_v6.ld" + }, + "core": "nRF5", + "cpu": "cortex-m4", + "extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA", + "f_cpu": "64000000L", + "hwids": [ + ["0x239A", "0x8029"], + ["0x239A", "0x0029"], + ["0x239A", "0x002A"], + ["0x239A", "0x802A"] + ], + "usb_product": "MeshTiny", + "mcu": "nrf52840", + "variant": "meshtiny", + "bsp": { + "name": "adafruit" + }, + "softdevice": { + "sd_flags": "-DS140", + "sd_name": "s140", + "sd_version": "6.1.1", + "sd_fwid": "0x00B6" + }, + "bootloader": { + "settings_addr": "0xFF000" + } + }, + "connectivity": ["bluetooth"], + "debug": { + "jlink_device": "nRF52840_xxAA", + "svd_path": "nrf52840.svd", + "openocd_target": "nrf52840-mdk-rs" + }, + "frameworks": ["arduino", "freertos"], + "name": "MeshTiny", + "upload": { + "maximum_ram_size": 248832, + "maximum_size": 815104, + "speed": 115200, + "protocol": "nrfutil", + "protocols": ["jlink", "nrfjprog", "nrfutil", "stlink"], + "use_1200bps_touch": true, + "require_upload_port": true, + "wait_for_upload_port": true + }, + "url": "https://github.com/meshtastic/firmware", + "vendor": "MTools Tec" +} diff --git a/variants/nrf52840/meshtiny/platformio.ini b/variants/nrf52840/meshtiny/platformio.ini new file mode 100644 index 000000000..ef744a1c3 --- /dev/null +++ b/variants/nrf52840/meshtiny/platformio.ini @@ -0,0 +1,19 @@ +; MeshTiny - Custom device based on GAT562 with encoder and buzzer support +[env:meshtiny] +extends = nrf52840_base +board = meshtiny +board_level = extra +build_flags = ${nrf52840_base.build_flags} -Ivariants/nrf52840/meshtiny -D MESHTINY + -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. + -DRADIOLIB_EXCLUDE_SX128X=1 + -DRADIOLIB_EXCLUDE_SX127X=1 + -DRADIOLIB_EXCLUDE_LR11X0=1 + -D INPUTDRIVER_ENCODER_TYPE=2 + -D INPUTDRIVER_ENCODER_UP=4 + -D INPUTDRIVER_ENCODER_DOWN=26 + -D INPUTDRIVER_ENCODER_BTN=28 + -D USE_PIN_BUZZER=PIN_BUZZER + -D MESHTASTIC_EXCLUDE_GPS=1 +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/meshtiny> +lib_deps = + ${nrf52840_base.lib_deps} diff --git a/variants/nrf52840/meshtiny/variant.cpp b/variants/nrf52840/meshtiny/variant.cpp new file mode 100644 index 000000000..2e8b00e4b --- /dev/null +++ b/variants/nrf52840/meshtiny/variant.cpp @@ -0,0 +1,54 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + Copyright (c) 2016 Sandeep Mistry All right reserved. + Copyright (c) 2018, Adafruit Industries (adafruit.com) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "variant.h" +#include "nrf.h" +#include "wiring_constants.h" +#include "wiring_digital.h" + +const uint32_t g_ADigitalPinMap[] = { + // P0 + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + + // P1 + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}; + +void initVariant() +{ + // LED1 & LED2 + pinMode(PIN_LED1, OUTPUT); + ledOff(PIN_LED1); + + pinMode(PIN_LED2, OUTPUT); + ledOff(PIN_LED2); + + // 3V3 Power Rail + pinMode(PIN_3V3_EN, OUTPUT); + digitalWrite(PIN_3V3_EN, HIGH); + + // Initialize Encoder pins + pinMode(INPUTDRIVER_ENCODER_UP, INPUT_PULLUP); + pinMode(INPUTDRIVER_ENCODER_DOWN, INPUT_PULLUP); + pinMode(INPUTDRIVER_ENCODER_BTN, INPUT_PULLUP); + + // Initialize Buzzer pin + pinMode(PIN_BUZZER, OUTPUT); + digitalWrite(PIN_BUZZER, LOW); +} diff --git a/variants/nrf52840/meshtiny/variant.h b/variants/nrf52840/meshtiny/variant.h new file mode 100644 index 000000000..83ad4c5b9 --- /dev/null +++ b/variants/nrf52840/meshtiny/variant.h @@ -0,0 +1,199 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + Copyright (c) 2016 Sandeep Mistry All right reserved. + Copyright (c) 2018, Adafruit Industries (adafruit.com) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _VARIANT_MESHTINY_ +#define _VARIANT_MESHTINY_ + +#define MESHTINY + +// #define RAK4630 + +/** Master clock frequency */ +#define VARIANT_MCK (64000000ul) + +#define USE_LFXO // Board uses 32khz crystal for LF +// define USE_LFRC // Board uses RC for LF + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "WVariant.h" + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +// Number of pins defined in PinDescription array +#define PINS_COUNT (48) +#define NUM_DIGITAL_PINS (48) +#define NUM_ANALOG_INPUTS (6) +#define NUM_ANALOG_OUTPUTS (0) + +// LEDs +#define PIN_LED1 (35) +#define PIN_LED2 (36) + +#define LED_BUILTIN PIN_LED1 +#define LED_CONN PIN_LED2 + +#define LED_GREEN PIN_LED1 +#define LED_BLUE PIN_LED2 + +#define LED_STATE_ON 1 // State when LED is litted + +/* + * Encoder + */ +#define INPUTDRIVER_ENCODER_TYPE 2 +#define INPUTDRIVER_ENCODER_UP 26 +#define INPUTDRIVER_ENCODER_DOWN 4 +#define INPUTDRIVER_ENCODER_BTN 28 + +#define CANNED_MESSAGE_MODULE_ENABLE 1 + +/* + * Buzzer - PWM + */ +#define PIN_BUZZER 30 + +/* + * Buttons + */ + +#define PIN_BUTTON1 9 +#define BUTTON_NEED_PULLUP +#define PIN_BUTTON2 12 +#define PIN_BUTTON3 24 +#define PIN_BUTTON4 25 + +/* + * Analog pins + */ +#define PIN_A0 (5) +#define PIN_A1 (31) +#define PIN_A2 (28) +#define PIN_A3 (29) +#define PIN_A4 (30) +#define PIN_A5 (31) +#define PIN_A6 (0xff) +#define PIN_A7 (0xff) + +static const uint8_t A0 = PIN_A0; +static const uint8_t A1 = PIN_A1; +static const uint8_t A2 = PIN_A2; +static const uint8_t A3 = PIN_A3; +static const uint8_t A4 = PIN_A4; +static const uint8_t A5 = PIN_A5; +static const uint8_t A6 = PIN_A6; +static const uint8_t A7 = PIN_A7; +#define ADC_RESOLUTION 14 + +// Other pins +#define PIN_AREF (2) +#define PIN_NFC1 (9) +#define PIN_NFC2 (10) + +static const uint8_t AREF = PIN_AREF; + +/* + * Serial interfaces + */ +#define PIN_SERIAL1_RX (15) +#define PIN_SERIAL1_TX (16) + +// Connected to Jlink CDC +#define PIN_SERIAL2_RX (8) +#define PIN_SERIAL2_TX (6) + +/* + * SPI Interfaces + */ +#define SPI_INTERFACES_COUNT 2 + +#define PIN_SPI_MISO (45) +#define PIN_SPI_MOSI (44) +#define PIN_SPI_SCK (43) + +#define PIN_SPI1_MISO (29) // (0 + 29) +#define PIN_SPI1_MOSI (30) // (0 + 30) +#define PIN_SPI1_SCK (3) // (0 + 3) + +static const uint8_t SS = 42; +static const uint8_t MOSI = PIN_SPI_MOSI; +static const uint8_t MISO = PIN_SPI_MISO; +static const uint8_t SCK = PIN_SPI_SCK; + +#define HAS_SCREEN 1 +#define USE_SSD1306 + +/* + * Wire Interfaces + */ +#define WIRE_INTERFACES_COUNT 1 + +#define PIN_WIRE_SDA (13) +#define PIN_WIRE_SCL (14) + +// QSPI Pins +#define PIN_QSPI_SCK 3 +#define PIN_QSPI_CS 22 // Changed from 26 to avoid conflict with encoder +#define PIN_QSPI_IO0 27 // Changed from 30 to avoid conflict with buzzer +#define PIN_QSPI_IO1 29 +#define PIN_QSPI_IO2 21 // Changed from 28 to avoid conflict with encoder button +#define PIN_QSPI_IO3 2 + +// On-board QSPI Flash +#define EXTERNAL_FLASH_DEVICES IS25LP080D +#define EXTERNAL_FLASH_USE_QSPI + +#define USE_SX1262 +#define SX126X_CS (42) +#define SX126X_DIO1 (47) +#define SX126X_BUSY (46) +#define SX126X_RESET (38) +#define SX126X_POWER_EN (37) +// DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3 +#define SX126X_DIO2_AS_RF_SWITCH +#define SX126X_DIO3_TCXO_VOLTAGE 1.8 + +// Testing USB detection +#define NRF_APM + +#define PIN_3V3_EN (34) + +// Battery +// The battery sense is hooked to pin A0 (5) +#define BATTERY_PIN PIN_A0 +// and has 12 bit resolution +#define BATTERY_SENSE_RESOLUTION_BITS 12 +#define BATTERY_SENSE_RESOLUTION 4096.0 +#undef AREF_VOLTAGE +#define AREF_VOLTAGE 3.0 +#define VBAT_AR_INTERNAL AR_INTERNAL_3_0 +#define ADC_MULTIPLIER 1.73 + +#ifdef __cplusplus +} +#endif + +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#endif From 890357d579b1905889d160e78a5e9948510a6425 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 20 Aug 2025 05:53:20 -0500 Subject: [PATCH 147/180] Update protobufs (#7693) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/config.pb.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/protobufs b/protobufs index be5137698..8985852d7 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit be5137698027f9e9fe6e68d5d5d638049f61ba8f +Subproject commit 8985852d752de3f7210f9a4a3e0923120ec438b3 diff --git a/src/mesh/generated/meshtastic/config.pb.h b/src/mesh/generated/meshtastic/config.pb.h index 8a68197f0..67d461611 100644 --- a/src/mesh/generated/meshtastic/config.pb.h +++ b/src/mesh/generated/meshtastic/config.pb.h @@ -207,10 +207,10 @@ typedef enum _meshtastic_Config_DisplayConfig_OledType { meshtastic_Config_DisplayConfig_OledType_OLED_SSD1306 = 1, /* Default / Autodetect */ meshtastic_Config_DisplayConfig_OledType_OLED_SH1106 = 2, - /* Can not be auto detected but set by proto. Used for 128x128 screens */ - meshtastic_Config_DisplayConfig_OledType_OLED_SH1107 = 3, /* Can not be auto detected but set by proto. Used for 128x64 screens */ - meshtastic_Config_DisplayConfig_OledType_OLED_SH1107_128_64 = 4 + meshtastic_Config_DisplayConfig_OledType_OLED_SH1107 = 3, + /* Can not be auto detected but set by proto. Used for 128x128 screens */ + meshtastic_Config_DisplayConfig_OledType_OLED_SH1107_128_128 = 4 } meshtastic_Config_DisplayConfig_OledType; typedef enum _meshtastic_Config_DisplayConfig_DisplayMode { @@ -682,8 +682,8 @@ extern "C" { #define _meshtastic_Config_DisplayConfig_DisplayUnits_ARRAYSIZE ((meshtastic_Config_DisplayConfig_DisplayUnits)(meshtastic_Config_DisplayConfig_DisplayUnits_IMPERIAL+1)) #define _meshtastic_Config_DisplayConfig_OledType_MIN meshtastic_Config_DisplayConfig_OledType_OLED_AUTO -#define _meshtastic_Config_DisplayConfig_OledType_MAX meshtastic_Config_DisplayConfig_OledType_OLED_SH1107_128_64 -#define _meshtastic_Config_DisplayConfig_OledType_ARRAYSIZE ((meshtastic_Config_DisplayConfig_OledType)(meshtastic_Config_DisplayConfig_OledType_OLED_SH1107_128_64+1)) +#define _meshtastic_Config_DisplayConfig_OledType_MAX meshtastic_Config_DisplayConfig_OledType_OLED_SH1107_128_128 +#define _meshtastic_Config_DisplayConfig_OledType_ARRAYSIZE ((meshtastic_Config_DisplayConfig_OledType)(meshtastic_Config_DisplayConfig_OledType_OLED_SH1107_128_128+1)) #define _meshtastic_Config_DisplayConfig_DisplayMode_MIN meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT #define _meshtastic_Config_DisplayConfig_DisplayMode_MAX meshtastic_Config_DisplayConfig_DisplayMode_COLOR From 11309662a98cccc1a03e5c528a4f3258a1ce1ef6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 20 Aug 2025 09:08:14 -0400 Subject: [PATCH 148/180] Update platformio/espressif32 to v6.12.0 (#7523) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- arch/esp32/esp32.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/esp32/esp32.ini b/arch/esp32/esp32.ini index 8990053eb..ffeaaf4cb 100644 --- a/arch/esp32/esp32.ini +++ b/arch/esp32/esp32.ini @@ -4,7 +4,7 @@ extends = arduino_base custom_esp32_kind = esp32 platform = # renovate: datasource=custom.pio depName=platformio/espressif32 packageName=platformio/platform/espressif32 - platformio/espressif32@6.11.0 + platformio/espressif32@6.12.0 build_src_filter = ${arduino_base.build_src_filter} - - - - - From 57e1725419009a3f10067577de8a14329fd2a5c0 Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 20 Aug 2025 10:10:39 -0400 Subject: [PATCH 149/180] Revert "Update platformio/espressif32 to v6.12.0 (#7523)" (#7695) This reverts commit 11309662a98cccc1a03e5c528a4f3258a1ce1ef6. --- arch/esp32/esp32.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/esp32/esp32.ini b/arch/esp32/esp32.ini index ffeaaf4cb..8990053eb 100644 --- a/arch/esp32/esp32.ini +++ b/arch/esp32/esp32.ini @@ -4,7 +4,7 @@ extends = arduino_base custom_esp32_kind = esp32 platform = # renovate: datasource=custom.pio depName=platformio/espressif32 packageName=platformio/platform/espressif32 - platformio/espressif32@6.12.0 + platformio/espressif32@6.11.0 build_src_filter = ${arduino_base.build_src_filter} - - - - - From 5ce47045e75d967fa0f7bddb0c62eaddece9694d Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Wed, 20 Aug 2025 12:51:14 -0500 Subject: [PATCH 150/180] Add SDL option to BaseUI on Native (#7568) * Add SDL option to BaseUI on Native * Update to latest LovyanGFX PR and use LGFX_SDL define * Move SDL backend to native-sdl target --- src/graphics/TFTDisplay.cpp | 62 +++++++++++++++++++++++- src/graphics/TFTDisplay.h | 1 + src/main.cpp | 8 ++- variants/native/portduino/platformio.ini | 20 +++++++- 4 files changed, 87 insertions(+), 4 deletions(-) diff --git a/src/graphics/TFTDisplay.cpp b/src/graphics/TFTDisplay.cpp index 24ea6c47a..f8787612f 100644 --- a/src/graphics/TFTDisplay.cpp +++ b/src/graphics/TFTDisplay.cpp @@ -667,15 +667,19 @@ static LGFX *tft = nullptr; static TFT_eSPI *tft = nullptr; // Invoke library, pins defined in User_Setup.h #elif ARCH_PORTDUINO #include // Graphics and font library for ST7735 driver chip +#if defined(LGFX_SDL) +#include +#endif class LGFX : public lgfx::LGFX_Device { - lgfx::Panel_Device *_panel_instance; lgfx::Bus_SPI _bus_instance; lgfx::ITouch *_touch_instance; public: + lgfx::Panel_Device *_panel_instance; + LGFX(void) { if (settingsMap[displayPanel] == st7789) @@ -694,6 +698,11 @@ class LGFX : public lgfx::LGFX_Device _panel_instance = new lgfx::Panel_ILI9488; else if (settingsMap[displayPanel] == hx8357d) _panel_instance = new lgfx::Panel_HX8357D; +#if defined(LGFX_SDL) + else if (settingsMap[displayPanel] == x11) { + _panel_instance = new lgfx::Panel_sdl; + } +#endif else { _panel_instance = new lgfx::Panel_NULL; LOG_ERROR("Unknown display panel configured!"); @@ -754,7 +763,13 @@ class LGFX : public lgfx::LGFX_Device _touch_instance->config(touch_cfg); _panel_instance->setTouch(_touch_instance); } - +#if defined(LGFX_SDL) + if (settingsMap[displayPanel] == x11) { + lgfx::Panel_sdl *sdl_panel_ = (lgfx::Panel_sdl *)_panel_instance; + sdl_panel_->setup(); + sdl_panel_->addKeyCodeMapping(SDLK_RETURN, SDL_SCANCODE_KP_ENTER); + } +#endif setPanel(_panel_instance); // Sets the panel to use. } }; @@ -1060,6 +1075,49 @@ void TFTDisplay::display(bool fromBlank) } } +void TFTDisplay::sdlLoop() +{ +#if defined(LGFX_SDL) + static int lastPressed = 0; + static int shuttingDown = false; + if (settingsMap[displayPanel] == x11) { + lgfx::Panel_sdl *sdl_panel_ = (lgfx::Panel_sdl *)tft->_panel_instance; + if (sdl_panel_->loop() && !shuttingDown) { + LOG_WARN("Window Closed!"); + InputEvent event = {.inputEvent = (input_broker_event)INPUT_BROKER_SHUTDOWN, .kbchar = 0, .touchX = 0, .touchY = 0}; + inputBroker->injectInputEvent(&event); + } + + // debounce + if (lastPressed != 0 && !lgfx::v1::gpio_in(lastPressed)) + return; + if (!lgfx::v1::gpio_in(37)) { + lastPressed = 37; + InputEvent event = {.inputEvent = (input_broker_event)INPUT_BROKER_RIGHT, .kbchar = 0, .touchX = 0, .touchY = 0}; + inputBroker->injectInputEvent(&event); + } else if (!lgfx::v1::gpio_in(36)) { + lastPressed = 36; + InputEvent event = {.inputEvent = (input_broker_event)INPUT_BROKER_UP, .kbchar = 0, .touchX = 0, .touchY = 0}; + inputBroker->injectInputEvent(&event); + } else if (!lgfx::v1::gpio_in(38)) { + lastPressed = 38; + InputEvent event = {.inputEvent = (input_broker_event)INPUT_BROKER_DOWN, .kbchar = 0, .touchX = 0, .touchY = 0}; + inputBroker->injectInputEvent(&event); + } else if (!lgfx::v1::gpio_in(39)) { + lastPressed = 39; + InputEvent event = {.inputEvent = (input_broker_event)INPUT_BROKER_LEFT, .kbchar = 0, .touchX = 0, .touchY = 0}; + inputBroker->injectInputEvent(&event); + } else if (!lgfx::v1::gpio_in(SDL_SCANCODE_KP_ENTER)) { + lastPressed = SDL_SCANCODE_KP_ENTER; + InputEvent event = {.inputEvent = (input_broker_event)INPUT_BROKER_SELECT, .kbchar = 0, .touchX = 0, .touchY = 0}; + inputBroker->injectInputEvent(&event); + } else { + lastPressed = 0; + } + } +#endif +} + // Send a command to the display (low level function) void TFTDisplay::sendCommand(uint8_t com) { diff --git a/src/graphics/TFTDisplay.h b/src/graphics/TFTDisplay.h index 38cd53ebb..60adfdf7c 100644 --- a/src/graphics/TFTDisplay.h +++ b/src/graphics/TFTDisplay.h @@ -23,6 +23,7 @@ class TFTDisplay : public OLEDDisplay // Write the buffer to the display memory virtual void display() override { display(false); }; virtual void display(bool fromBlank); + void sdlLoop(); // Turn the display upside down virtual void flipScreenVertically(); diff --git a/src/main.cpp b/src/main.cpp index c53877e37..ef5f5a721 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1562,7 +1562,13 @@ void loop() #endif service->loop(); - +#if defined(LGFX_SDL) + if (screen) { + auto dispdev = screen->getDisplayDevice(); + if (dispdev) + static_cast(dispdev)->sdlLoop(); + } +#endif long delayMsec = mainController.runOrDelay(); // We want to sleep as long as possible here - because it saves power diff --git a/variants/native/portduino/platformio.ini b/variants/native/portduino/platformio.ini index b8452bb48..62942a80e 100644 --- a/variants/native/portduino/platformio.ini +++ b/variants/native/portduino/platformio.ini @@ -25,7 +25,6 @@ build_flags = ${native_base.build_flags} -Os -lX11 -linput -lxkbcommon -ffunctio -D USE_X11=1 -D HAS_TFT=1 -D HAS_SCREEN=1 - -D LV_CACHE_DEF_SIZE=6291456 -D LV_BUILD_TEST=0 -D LV_USE_LIBINPUT=1 @@ -41,6 +40,25 @@ build_flags = ${native_base.build_flags} -Os -lX11 -linput -lxkbcommon -ffunctio build_src_filter = ${native_base.build_src_filter} +[env:native-sdl] +extends = native_base +build_type = release +lib_deps = + ${env.lib_deps} + ${networking_base.lib_deps} + ${radiolib_base.lib_deps} + ${environmental_base.lib_deps} + # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto + rweather/Crypto@0.4.0 + # renovate: datasource=git-refs depName=libch341-spi-userspace packageName=https://github.com/pine64/libch341-spi-userspace gitBranch=main + https://github.com/pine64/libch341-spi-userspace/archive/af9bc27c9c30fa90772279925b7c5913dff789b4.zip + # renovate: datasource=custom.pio depName=adafruit/Adafruit seesaw Library packageName=adafruit/library/Adafruit seesaw Library + adafruit/Adafruit seesaw Library@1.7.9 + https://github.com/jp-bennett/LovyanGFX/archive/7458f84a126c1f8fdc7b038074f71be903f6e4c0.zip +build_flags = ${native_base.build_flags} + !pkg-config --cflags --libs sdl2 --silence-errors || : + -D LGFX_SDL=1 + [env:native-fb] extends = native_base build_type = release From ce75bf4496fe8900dbe2d443cedef77c53e4fc5a Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Wed, 20 Aug 2025 14:18:20 -0500 Subject: [PATCH 151/180] Initial stab at rak6421 autoconf (#7691) * Initial stab at rak6421 autoconf * trunk * Add crc check to eeprom autoconf * Trunk again --- ...421.yaml => lora-RAK6421-13300-slot1.yaml} | 11 +-- bin/config.d/lora-RAK6421-13300-slot2.yaml | 8 ++ src/mesh/NodeDB.cpp | 6 +- src/platform/portduino/PortduinoGlue.cpp | 98 +++++++++++++++++-- src/platform/portduino/PortduinoGlue.h | 15 ++- 5 files changed, 113 insertions(+), 25 deletions(-) rename bin/config.d/{lora-RAK6421.yaml => lora-RAK6421-13300-slot1.yaml} (56%) create mode 100644 bin/config.d/lora-RAK6421-13300-slot2.yaml diff --git a/bin/config.d/lora-RAK6421.yaml b/bin/config.d/lora-RAK6421-13300-slot1.yaml similarity index 56% rename from bin/config.d/lora-RAK6421.yaml rename to bin/config.d/lora-RAK6421-13300-slot1.yaml index bbf38a474..6f65f9ccd 100644 --- a/bin/config.d/lora-RAK6421.yaml +++ b/bin/config.d/lora-RAK6421-13300-slot1.yaml @@ -9,13 +9,4 @@ Lora: DIO3_TCXO_VOLTAGE: true DIO2_AS_RF_SWITCH: true spidev: spidev0.0 - # CS: 8 - - - ### RAK13300in Slot 2 pins -# IRQ: 18 #IO6 -# Reset: 24 # IO4 -# Busy: 19 # IO5 -# # Ant_sw: 23 # IO3 -# spidev: spidev0.1 -# # CS: 7 \ No newline at end of file + # CS: 8 \ No newline at end of file diff --git a/bin/config.d/lora-RAK6421-13300-slot2.yaml b/bin/config.d/lora-RAK6421-13300-slot2.yaml new file mode 100644 index 000000000..cbc794d39 --- /dev/null +++ b/bin/config.d/lora-RAK6421-13300-slot2.yaml @@ -0,0 +1,8 @@ +Lora: + ### RAK13300in Slot 2 pins + IRQ: 18 #IO6 + Reset: 24 # IO4 + Busy: 19 # IO5 + # Ant_sw: 23 # IO3 + spidev: spidev0.1 + # CS: 7 \ No newline at end of file diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 97a1e463c..18014eb02 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -225,7 +225,11 @@ NodeDB::NodeDB() memcpy(myNodeInfo.device_id.bytes + sizeof(device_id_start), &device_id_end, sizeof(device_id_end)); myNodeInfo.device_id.size = 16; // Uncomment below to print the device id - +#elif ARCH_PORTDUINO + if (portduino_config.has_device_id) { + memcpy(myNodeInfo.device_id.bytes, portduino_config.device_id, 16); + myNodeInfo.device_id.size = 16; + } #else // FIXME - implement for other platforms #endif diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index 3753c944c..929a45d09 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -10,6 +10,7 @@ #include "linux/gpio/LinuxGPIOPin.h" #include "meshUtils.h" #include "yaml-cpp/yaml.h" +#include #include #include #include @@ -253,16 +254,95 @@ void portduinoSetup() std::cout << "autoconf: Could not locate CH341 device" << std::endl; } // Try Pi HAT+ - std::cout << "autoconf: Looking for Pi HAT+..." << std::endl; - if (access("/proc/device-tree/hat/product", R_OK) == 0) { - std::ifstream hatProductFile("/proc/device-tree/hat/product"); - if (hatProductFile.is_open()) { - hatProductFile.read(autoconf_product, 95); - hatProductFile.close(); + if (strlen(autoconf_product) < 6) { + std::cout << "autoconf: Looking for Pi HAT+..." << std::endl; + if (access("/proc/device-tree/hat/product", R_OK) == 0) { + std::ifstream hatProductFile("/proc/device-tree/hat/product"); + if (hatProductFile.is_open()) { + hatProductFile.read(autoconf_product, 95); + hatProductFile.close(); + } + std::cout << "autoconf: Found Pi HAT+ " << autoconf_product << " at /proc/device-tree/hat/product" << std::endl; + } else { + std::cout << "autoconf: Could not locate Pi HAT+ at /proc/device-tree/hat/product" << std::endl; + } + } + // attempt to load autoconf data from an EEPROM on 0x50 + // RAK6421-13300-S1:aabbcc123456:5ba85807d92138b7519cfb60460573af:3061e8d8 + // :mac address :<16 random unique bytes in hexidecimal> : crc32 + // crc32 is calculated on the eeprom string up to but not including the final colon + if (strlen(autoconf_product) < 6) { + try { + char *mac_start = nullptr; + char *devID_start = nullptr; + char *crc32_start = nullptr; + Wire.begin(); + Wire.beginTransmission(0x50); + Wire.write(0x0); + Wire.write(0x0); + Wire.endTransmission(); + Wire.requestFrom((uint8_t)0x50, (uint8_t)75); + uint8_t i = 0; + delay(100); + std::string autoconf_raw; + while (Wire.available() && i < sizeof(autoconf_product)) { + autoconf_product[i] = Wire.read(); + if (autoconf_product[i] == 0xff) { + autoconf_product[i] = 0x0; + break; + } + autoconf_raw += autoconf_product[i]; + if (autoconf_product[i] == ':') { + autoconf_product[i] = 0x0; + if (mac_start == nullptr) { + mac_start = autoconf_product + i + 1; + } else if (devID_start == nullptr) { + devID_start = autoconf_product + i + 1; + } else if (crc32_start == nullptr) { + crc32_start = autoconf_product + i + 1; + } + } + i++; + } + if (crc32_start != nullptr && strlen(crc32_start) == 8) { + std::string crc32_str(crc32_start); + uint32_t crc32_value = 0; + + // convert crc32 ascii to raw uint32 + for (int j = 0; j < 4; j++) { + crc32_value += std::stoi(crc32_str.substr(j * 2, 2), nullptr, 16) << (3 - j) * 8; + } + std::cout << "autoconf: Found eeprom crc " << crc32_start << std::endl; + + // set the autoconf string to blank and short circuit + if (crc32_value != crc32Buffer(autoconf_raw.c_str(), i - 9)) { + std::cout << "autoconf: crc32 mismatch, dropping " << std::endl; + autoconf_product[0] = 0x0; + } else { + std::cout << "autoconf: Found eeprom data " << autoconf_raw << std::endl; + if (mac_start != nullptr) { + std::cout << "autoconf: Found mac data " << mac_start << std::endl; + if (strlen(mac_start) == 12) + settingsStrings[mac_address] = std::string(mac_start); + } + if (devID_start != nullptr) { + std::cout << "autoconf: Found deviceid data " << devID_start << std::endl; + if (strlen(devID_start) == 32) { + std::string devID_str(devID_start); + for (int j = 0; j < 16; j++) { + portduino_config.device_id[j] = std::stoi(devID_str.substr(j * 2, 2), nullptr, 16); + } + portduino_config.has_device_id = true; + } + } + } + } else { + std::cout << "autoconf: crc32 missing " << std::endl; + autoconf_product[0] = 0x0; + } + } catch (...) { + std::cout << "autoconf: Could not locate EEPROM" << std::endl; } - std::cout << "autoconf: Found Pi HAT+ " << autoconf_product << " at /proc/device-tree/hat/product" << std::endl; - } else { - std::cout << "autoconf: Could not locate Pi HAT+ at /proc/device-tree/hat/product" << std::endl; } // Load the config file based on the product string if (strlen(autoconf_product) > 0) { diff --git a/src/platform/portduino/PortduinoGlue.h b/src/platform/portduino/PortduinoGlue.h index 6e450c90e..8c36a1180 100644 --- a/src/platform/portduino/PortduinoGlue.h +++ b/src/platform/portduino/PortduinoGlue.h @@ -10,11 +10,14 @@ // Product strings for auto-configuration // {"PRODUCT_STRING", "CONFIG.YAML"} // YAML paths are relative to `meshtastic/available.d` -inline const std::unordered_map configProducts = {{"MESHTOAD", "lora-usb-meshtoad-e22.yaml"}, - {"MESHSTICK", "lora-meshstick-1262.yaml"}, - {"MESHADV-PI", "lora-MeshAdv-900M30S.yaml"}, - {"MeshAdv Mini", "lora-MeshAdv-Mini-900M22S.yaml"}, - {"POWERPI", "lora-MeshAdv-900M30S.yaml"}}; +inline const std::unordered_map configProducts = { + {"MESHTOAD", "lora-usb-meshtoad-e22.yaml"}, + {"MESHSTICK", "lora-meshstick-1262.yaml"}, + {"MESHADV-PI", "lora-MeshAdv-900M30S.yaml"}, + {"MeshAdv Mini", "lora-MeshAdv-Mini-900M22S.yaml"}, + {"POWERPI", "lora-MeshAdv-900M30S.yaml"}, + {"RAK6421-13300-S1", "lora-RAK6421-13300-slot1.yaml"}, + {"RAK6421-13300-S2", "lora-RAK6421-13300-slot2.yaml"}}; enum configNames { default_gpiochip, @@ -135,4 +138,6 @@ extern struct portduino_config_struct { uint32_t rfswitch_dio_pins[5] = {RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC}; Module::RfSwitchMode_t rfswitch_table[8]; bool force_simradio = false; + bool has_device_id = false; + uint8_t device_id[16] = {0}; } portduino_config; \ No newline at end of file From 7574bfb7cbeaaf48ce29ef73ac2fcd38692186a6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 20 Aug 2025 14:18:33 -0500 Subject: [PATCH 152/180] Update meshtastic/device-ui digest to 3dc7cf3 (#7698) 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 ac30eb32e..cce4d2dcf 100644 --- a/platformio.ini +++ b/platformio.ini @@ -118,7 +118,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/8f5094b248c15ea2f9acf19cedfef6d2248fc1ff.zip + https://github.com/meshtastic/device-ui/archive/3dc7cf3e233aaa8cc23492cca50541fc099ebfa1.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From fe3f14a63e2dbd160eabfcb8fdf1fb7cfb8eb1db Mon Sep 17 00:00:00 2001 From: Wilson Date: Thu, 21 Aug 2025 18:01:31 +0800 Subject: [PATCH 153/180] Add on-screen keyboard implementation on Trackball device. (#7625) * Add on-screen keyboard implementation on Wio Tracker L1. * Update On-Screen Keyboard to new layout. * The on-screen keyboard dynamically adjusts the key size based on the screen. * Improve input box display on small screens. * Optimize the virtual keyboard layout and cursor movement logic, and adjust the keyboard starting position for small and wide screens. * Optimize the text alignment of numeric keys on ssd1306. --------- Co-authored-by: Ben Meadors --- src/buzz/BuzzerFeedbackThread.cpp | 1 + src/graphics/Screen.cpp | 75 ++- src/graphics/Screen.h | 4 +- src/graphics/VirtualKeyboard.cpp | 738 +++++++++++++++++++++ src/graphics/VirtualKeyboard.h | 80 +++ src/graphics/draw/MenuHandler.cpp | 3 + src/graphics/draw/NotificationRenderer.cpp | 111 +++- src/graphics/draw/NotificationRenderer.h | 6 + src/input/InputBroker.h | 1 + src/input/TrackballInterruptBase.cpp | 76 ++- src/input/TrackballInterruptBase.h | 13 +- src/input/TrackballInterruptImpl1.cpp | 7 +- src/main.cpp | 6 + src/main.h | 1 + src/modules/CannedMessageModule.cpp | 136 +++- 15 files changed, 1227 insertions(+), 31 deletions(-) create mode 100644 src/graphics/VirtualKeyboard.cpp create mode 100644 src/graphics/VirtualKeyboard.h diff --git a/src/buzz/BuzzerFeedbackThread.cpp b/src/buzz/BuzzerFeedbackThread.cpp index ce762c764..838224c69 100644 --- a/src/buzz/BuzzerFeedbackThread.cpp +++ b/src/buzz/BuzzerFeedbackThread.cpp @@ -28,6 +28,7 @@ int BuzzerFeedbackThread::handleInputEvent(const InputEvent *event) case INPUT_BROKER_USER_PRESS: case INPUT_BROKER_ALT_PRESS: case INPUT_BROKER_SELECT: + case INPUT_BROKER_SELECT_LONG: playBeep(); // Confirmation feedback break; diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index fa71e17d8..5e29814cb 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -216,6 +216,44 @@ void Screen::showNumberPicker(const char *message, uint32_t durationMs, uint8_t ui->update(); } +void Screen::showTextInput(const char *header, const char *initialText, uint32_t durationMs, + std::function textCallback) +{ + LOG_INFO("showTextInput called with header='%s', durationMs=%d", header ? header : "NULL", durationMs); + + if (NotificationRenderer::virtualKeyboard) { + delete NotificationRenderer::virtualKeyboard; + NotificationRenderer::virtualKeyboard = nullptr; + } + + NotificationRenderer::textInputCallback = nullptr; + + NotificationRenderer::virtualKeyboard = new VirtualKeyboard(); + if (header) { + NotificationRenderer::virtualKeyboard->setHeader(header); + } + if (initialText) { + NotificationRenderer::virtualKeyboard->setInputText(initialText); + } + + // Set up callback with safer cleanup mechanism + NotificationRenderer::textInputCallback = textCallback; + NotificationRenderer::virtualKeyboard->setCallback([textCallback](const std::string &text) { textCallback(text); }); + + // Store the message and set the expiration timestamp (use same pattern as other notifications) + strncpy(NotificationRenderer::alertBannerMessage, header ? header : "Text Input", 255); + NotificationRenderer::alertBannerMessage[255] = '\0'; + NotificationRenderer::alertBannerUntil = (durationMs == 0) ? 0 : millis() + durationMs; + NotificationRenderer::pauseBanner = false; + NotificationRenderer::current_notification_type = notificationTypeEnum::text_input; + + // Set the overlay using the same pattern as other notification types + static OverlayCallback overlays[] = {graphics::UIRenderer::drawNavigationBar, NotificationRenderer::drawBannercallback}; + ui->setOverlays(overlays, sizeof(overlays) / sizeof(overlays[0])); + ui->setTargetFPS(60); + ui->update(); +} + static void drawModuleFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) { uint8_t module_frame; @@ -713,13 +751,19 @@ int32_t Screen::runOnce() handleSetOn(false); break; case Cmd::ON_PRESS: - handleOnPress(); + if (NotificationRenderer::current_notification_type != notificationTypeEnum::text_input) { + handleOnPress(); + } break; case Cmd::SHOW_PREV_FRAME: - handleShowPrevFrame(); + if (NotificationRenderer::current_notification_type != notificationTypeEnum::text_input) { + handleShowPrevFrame(); + } break; case Cmd::SHOW_NEXT_FRAME: - handleShowNextFrame(); + if (NotificationRenderer::current_notification_type != notificationTypeEnum::text_input) { + handleShowNextFrame(); + } break; case Cmd::START_ALERT_FRAME: { showingBootScreen = false; // this should avoid the edge case where an alert triggers before the boot screen goes away @@ -741,7 +785,9 @@ int32_t Screen::runOnce() NotificationRenderer::pauseBanner = false; case Cmd::STOP_BOOT_SCREEN: EINK_ADD_FRAMEFLAG(dispdev, COSMETIC); // E-Ink: Explicitly use full-refresh for next frame - setFrames(); + if (NotificationRenderer::current_notification_type != notificationTypeEnum::text_input) { + setFrames(); + } break; case Cmd::NOOP: break; @@ -777,6 +823,7 @@ int32_t Screen::runOnce() if (showingNormalScreen) { // standard screen loop handling here if (config.display.auto_screen_carousel_secs > 0 && + NotificationRenderer::current_notification_type != notificationTypeEnum::text_input && !Throttle::isWithinTimespanMs(lastScreenTransition, config.display.auto_screen_carousel_secs * 1000)) { // If an E-Ink display struggles with fast refresh, force carousel to use full refresh instead @@ -867,6 +914,11 @@ void Screen::setScreensaverFrames(FrameCallback einkScreensaver) // Called when a frame should be added / removed, or custom frames should be cleared void Screen::setFrames(FrameFocus focus) { + // Block setFrames calls when virtual keyboard is active to prevent overlay interference + if (NotificationRenderer::current_notification_type == notificationTypeEnum::text_input) { + return; + } + uint8_t originalPosition = ui->getUiState()->currentFrame; uint8_t previousFrameCount = framesetInfo.frameCount; FramesetInfo fsi; // Location of specific frames, for applying focus parameter @@ -1313,6 +1365,11 @@ int Screen::handleTextMessage(const meshtastic_MeshPacket *packet) // Triggered by MeshModules int Screen::handleUIFrameEvent(const UIFrameEvent *event) { + // Block UI frame events when virtual keyboard is active + if (NotificationRenderer::current_notification_type == notificationTypeEnum::text_input) { + return 0; + } + if (showingNormalScreen) { // Regenerate the frameset, potentially honoring a module's internal requestFocus() call if (event->action == UIFrameEvent::Action::REGENERATE_FRAMESET) @@ -1335,6 +1392,16 @@ int Screen::handleInputEvent(const InputEvent *event) if (!screenOn) return 0; + // Handle text input notifications specially - pass input to virtual keyboard + if (NotificationRenderer::current_notification_type == notificationTypeEnum::text_input) { + NotificationRenderer::inEvent = *event; + static OverlayCallback overlays[] = {graphics::UIRenderer::drawNavigationBar, NotificationRenderer::drawBannercallback}; + ui->setOverlays(overlays, sizeof(overlays) / sizeof(overlays[0])); + setFastFramerate(); // Draw ASAP + ui->update(); + return 0; + } + #ifdef USE_EINK // the screen is the last input handler, so if an event makes it here, we can assume it will prompt a screen draw. EINK_ADD_FRAMEFLAG(dispdev, DEMAND_FAST); // Use fast-refresh for next frame, no skip please EINK_ADD_FRAMEFLAG(dispdev, BLOCKING); // Edge case: if this frame is promoted to COSMETIC, wait for update diff --git a/src/graphics/Screen.h b/src/graphics/Screen.h index 265900131..0f100d455 100644 --- a/src/graphics/Screen.h +++ b/src/graphics/Screen.h @@ -12,7 +12,7 @@ #define getStringCenteredX(s) ((SCREEN_WIDTH - display->getStringWidth(s)) / 2) namespace graphics { -enum notificationTypeEnum { none, text_banner, selection_picker, node_picker, number_picker }; +enum notificationTypeEnum { none, text_banner, selection_picker, node_picker, number_picker, text_input }; struct BannerOverlayOptions { const char *message; @@ -313,6 +313,8 @@ class Screen : public concurrency::OSThread void showNodePicker(const char *message, uint32_t durationMs, std::function bannerCallback); void showNumberPicker(const char *message, uint32_t durationMs, uint8_t digits, std::function bannerCallback); + void showTextInput(const char *header, const char *initialText, uint32_t durationMs, + std::function textCallback); void requestMenu(graphics::menuHandler::screenMenus menuToShow) { diff --git a/src/graphics/VirtualKeyboard.cpp b/src/graphics/VirtualKeyboard.cpp new file mode 100644 index 000000000..84d5551cb --- /dev/null +++ b/src/graphics/VirtualKeyboard.cpp @@ -0,0 +1,738 @@ +#include "VirtualKeyboard.h" +#include "configuration.h" +#include "graphics/Screen.h" +#include "graphics/ScreenFonts.h" +#include "graphics/SharedUIDisplay.h" +#include "main.h" +#include +#include + +namespace graphics +{ + +VirtualKeyboard::VirtualKeyboard() : cursorRow(0), cursorCol(0), lastActivityTime(millis()) +{ + initializeKeyboard(); + // Set cursor to H(2, 5) + cursorRow = 2; + cursorCol = 5; +} + +VirtualKeyboard::~VirtualKeyboard() {} + +void VirtualKeyboard::initializeKeyboard() +{ + // New 4 row, 11 column keyboard layout: + static const char LAYOUT[KEYBOARD_ROWS][KEYBOARD_COLS] = {{'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '\b'}, + {'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '\n'}, + {'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', ' '}, + {'z', 'x', 'c', 'v', 'b', 'n', 'm', '.', ',', '?', '\x1b'}}; + + // Derive layout dimensions and assert they match the configured keyboard grid + constexpr int LAYOUT_ROWS = (int)(sizeof(LAYOUT) / sizeof(LAYOUT[0])); + constexpr int LAYOUT_COLS = (int)(sizeof(LAYOUT[0]) / sizeof(LAYOUT[0][0])); + static_assert(LAYOUT_ROWS == KEYBOARD_ROWS, "LAYOUT rows must equal KEYBOARD_ROWS"); + static_assert(LAYOUT_COLS == KEYBOARD_COLS, "LAYOUT cols must equal KEYBOARD_COLS"); + + // Initialize all keys to empty first + for (int row = 0; row < LAYOUT_ROWS; row++) { + for (int col = 0; col < LAYOUT_COLS; col++) { + keyboard[row][col] = {0, VK_CHAR, 0, 0, 0, 0}; + } + } + + // Fill keyboard from the 2D layout + for (int row = 0; row < LAYOUT_ROWS; row++) { + for (int col = 0; col < LAYOUT_COLS; col++) { + char ch = LAYOUT[row][col]; + // No empty slots in the simplified layout + + VirtualKeyType type = VK_CHAR; + if (ch == '\b') { + type = VK_BACKSPACE; + } else if (ch == '\n') { + type = VK_ENTER; + } else if (ch == '\x1b') { // ESC + type = VK_ESC; + } else if (ch == ' ') { + type = VK_SPACE; + } + + // Make action keys wider to fit text while keeping the last column aligned + uint8_t width = (type == VK_BACKSPACE || type == VK_ENTER || type == VK_SPACE) ? (KEY_WIDTH * 3) : KEY_WIDTH; + keyboard[row][col] = {ch, type, (uint8_t)(col * KEY_WIDTH), (uint8_t)(row * KEY_HEIGHT), width, KEY_HEIGHT}; + } + } +} + +void VirtualKeyboard::draw(OLEDDisplay *display, int16_t offsetX, int16_t offsetY) +{ + // Repeat ticking is driven by NotificationRenderer once per frame + // Base styles + display->setColor(WHITE); + display->setFont(FONT_SMALL); + + // Screen geometry + const int screenW = display->getWidth(); + const int screenH = display->getHeight(); + + // Decide wide-screen mode: if there is comfortable width, allow taller keys and reserve fixed width for last column labels + // Heuristic: if screen width >= 200px (e.g., 240x135), treat as wide + const bool isWide = screenW >= 200; + + // Determine last-column label max width + display->setFont(FONT_SMALL); + const int wENTER = display->getStringWidth("ENTER"); + int lastColLabelW = wENTER; // ENTER is usually the widest + // Smaller padding on very small screens to avoid excessive whitespace + const int lastColPad = (screenW <= 128 ? 2 : 6); + const int reservedLastColW = lastColLabelW + lastColPad; // reserved width for last column keys + + // Always reserve width for the rightmost text column to avoid overlap on small screens + int cellW = 0; + int leftoverW = 0; + { + const int leftCols = KEYBOARD_COLS - 1; // 10 input characters + int usableW = screenW - reservedLastColW; + if (usableW < leftCols) { + // Guard: ensure at least 1px per left cell if labels are extremely wide (unlikely) + usableW = leftCols; + } + cellW = usableW / leftCols; + leftoverW = usableW - cellW * leftCols; // distribute extra pixels over left columns (left to right) + } + + // Dynamic key geometry + int cellH = KEY_HEIGHT; + int keyboardStartY = 0; + if (screenH <= 64) { + const int headerHeight = headerText.empty() ? 0 : (FONT_HEIGHT_SMALL - 2); + const int gapBelowHeader = 0; + const int singleLineBoxHeight = FONT_HEIGHT_SMALL; + const int gapAboveKeyboard = 0; + keyboardStartY = offsetY + headerHeight + gapBelowHeader + singleLineBoxHeight + gapAboveKeyboard; + if (keyboardStartY < 0) + keyboardStartY = 0; + if (keyboardStartY > screenH) + keyboardStartY = screenH; + int keyboardHeight = screenH - keyboardStartY; + cellH = std::max(1, keyboardHeight / KEYBOARD_ROWS); + } else if (isWide) { + // For wide screens (e.g., T114 240x135), prefer square keys: height equals left-column key width. + cellH = std::max((int)KEY_HEIGHT, cellW); + + // Guarantee at least 2 lines of input are visible by reducing cell height minimally if needed. + // Replicate the spacing used in drawInputArea(): headerGap=1, box-to-header gap=1, gap above keyboard=1 + display->setFont(FONT_SMALL); + const int headerHeight = headerText.empty() ? 0 : (FONT_HEIGHT_SMALL + 1); + const int headerToBoxGap = 1; + const int gapAboveKb = 1; + const int minBoxHeightForTwoLines = 2 * FONT_HEIGHT_SMALL + 2; // inner 1px top/bottom + int maxKeyboardHeight = screenH - (offsetY + headerHeight + headerToBoxGap + minBoxHeightForTwoLines + gapAboveKb); + int maxCellHAllowed = maxKeyboardHeight / KEYBOARD_ROWS; + if (maxCellHAllowed < (int)KEY_HEIGHT) + maxCellHAllowed = KEY_HEIGHT; + if (maxCellHAllowed > 0 && cellH > maxCellHAllowed) { + cellH = maxCellHAllowed; + } + // Keyboard placement from bottom for wide screens + int keyboardHeight = KEYBOARD_ROWS * cellH; + keyboardStartY = screenH - keyboardHeight; + if (keyboardStartY < 0) + keyboardStartY = 0; + } else { + // Default (non-wide, non-64px) behavior: use key height heuristic and place at bottom + cellH = KEY_HEIGHT; + int keyboardHeight = KEYBOARD_ROWS * cellH; + keyboardStartY = screenH - keyboardHeight; + if (keyboardStartY < 0) + keyboardStartY = 0; + } + + // Draw input area above keyboard + drawInputArea(display, offsetX, offsetY, keyboardStartY); + + // Precompute per-column x and width with leftover distributed over left columns for even spacing + int colX[KEYBOARD_COLS]; + int colW[KEYBOARD_COLS]; + int runningX = offsetX; + for (int col = 0; col < KEYBOARD_COLS - 1; ++col) { + int wcol = cellW + (col < leftoverW ? 1 : 0); + colX[col] = runningX; + colW[col] = wcol; + runningX += wcol; + } + // Last column + colX[KEYBOARD_COLS - 1] = runningX; + colW[KEYBOARD_COLS - 1] = reservedLastColW; + + // Draw keyboard grid + for (int row = 0; row < KEYBOARD_ROWS; row++) { + for (int col = 0; col < KEYBOARD_COLS; col++) { + const VirtualKey &k = keyboard[row][col]; + if (k.character != 0 || k.type != VK_CHAR) { + const bool isLastCol = (col == KEYBOARD_COLS - 1); + int x = colX[col]; + int w = colW[col]; + int y = offsetY + keyboardStartY + row * cellH; + int h = cellH; + bool selected = (row == cursorRow && col == cursorCol); + drawKey(display, k, selected, x, y, (uint8_t)w, (uint8_t)h, isLastCol); + } + } + } +} + +void VirtualKeyboard::drawInputArea(OLEDDisplay *display, int16_t offsetX, int16_t offsetY, int16_t keyboardStartY) +{ + display->setColor(WHITE); + + const int screenWidth = display->getWidth(); + const int screenHeight = display->getHeight(); + // Use the standard small font metrics for input box sizing (restore original size) + const int inputLineH = FONT_HEIGHT_SMALL; + + // Header uses the standard small (which may be larger on big screens) + display->setFont(FONT_SMALL); + int headerHeight = 0; + if (!headerText.empty()) { + // Draw header and reserve exact font height (plus a tighter gap) to maximize input area + display->drawString(offsetX + 2, offsetY, headerText.c_str()); + if (screenHeight <= 64) { + headerHeight = FONT_HEIGHT_SMALL - 2; // 11px + } else { + headerHeight = FONT_HEIGHT_SMALL; // no extra padding baked in + } + } + + const int boxX = offsetX; + const int boxWidth = screenWidth; + int boxY; + int boxHeight; + if (screenHeight <= 64) { + const int gapBelowHeader = 0; + const int fixedBoxHeight = inputLineH; + const int gapAboveKeyboard = 0; + boxY = offsetY + headerHeight + gapBelowHeader; + boxHeight = fixedBoxHeight; + if (boxY + boxHeight + gapAboveKeyboard > keyboardStartY) { + int over = boxY + boxHeight + gapAboveKeyboard - keyboardStartY; + boxHeight = std::max(1, fixedBoxHeight - over); + } + } else { + const int gapBelowHeader = 1; + int gapAboveKeyboard = 1; + int tmpBoxY = offsetY + headerHeight + gapBelowHeader; + const int minBoxHeight = inputLineH + 2; + int availableH = keyboardStartY - tmpBoxY - gapAboveKeyboard; + if (availableH < minBoxHeight) + availableH = minBoxHeight; + boxY = tmpBoxY; + boxHeight = availableH; + } + + // Draw box border + display->drawRect(boxX, boxY, boxWidth, boxHeight); + + display->setFont(FONT_SMALL); + + // Text rendering: multi-line if space allows (>= 2 lines), else single-line with leading ellipsis + const int textX = boxX + 2; + const int maxTextWidth = boxWidth - 4; + const int maxLines = (boxHeight - 2) / inputLineH; + if (maxLines >= 2) { + // Inner bounds for caret clamping + const int innerLeft = boxX + 1; + const int innerRight = boxX + boxWidth - 2; + const int innerTop = boxY + 1; + const int innerBottom = boxY + boxHeight - 2; + + // Wrap text greedily into lines that fit maxTextWidth + std::vector lines; + { + std::string remaining = inputText; + while (!remaining.empty()) { + int bestLen = 0; + for (int len = 1; len <= (int)remaining.size(); ++len) { + int w = display->getStringWidth(remaining.substr(0, len).c_str()); + if (w <= maxTextWidth) + bestLen = len; + else + break; + } + if (bestLen == 0) { + // At least show one character to make progress + bestLen = 1; + } + lines.emplace_back(remaining.substr(0, bestLen)); + remaining.erase(0, bestLen); + } + } + + const bool scrolledUp = ((int)lines.size() > maxLines); + int caretX = textX; + int caretY = innerTop; + + // Leave a small top gap to render '...' without replacing the first line + const int topInset = 2; + const int lineStep = std::max(1, inputLineH - 1); // slightly tighter than font height + int lineY = innerTop + topInset; + + if (scrolledUp) { + // Draw three small dots centered horizontally, vertically at the midpoint of the gap + // between the inner top and the first line's top baseline. This avoids using a tall glyph. + const int firstLineTop = lineY; // baseline top for the first visible line + const int gapMidY = innerTop + (firstLineTop - innerTop) / 2 + 1; // shift down 1px as requested + const int centerX = boxX + boxWidth / 2; + const int dotSpacing = 3; // px between dots + const int dotSize = 1; // small square dot + display->fillRect(centerX - dotSpacing, gapMidY, dotSize, dotSize); + display->fillRect(centerX, gapMidY, dotSize, dotSize); + display->fillRect(centerX + dotSpacing, gapMidY, dotSize, dotSize); + } + + // How many lines fit with our top inset and tighter step + const int linesCapacity = std::max(1, (innerBottom - lineY + 1) / lineStep); + const int linesToShow = std::min((int)lines.size(), linesCapacity); + const int startIndex = scrolledUp ? ((int)lines.size() - linesToShow) : 0; + + for (int i = 0; i < linesToShow; ++i) { + const std::string &chunk = lines[startIndex + i]; + display->drawString(textX, lineY, chunk.c_str()); + caretX = textX + display->getStringWidth(chunk.c_str()); + caretY = lineY; + lineY += lineStep; + } + + // Draw caret at end of the last visible line + int caretPadY = 2; + if (boxHeight >= inputLineH + 4) + caretPadY = 3; + int cursorTop = caretY + caretPadY; + // Use lineStep so caret height matches the row spacing + int cursorH = lineStep - caretPadY * 2; + if (cursorH < 1) + cursorH = 1; + // Clamp vertical bounds to stay inside the inner rect + if (cursorTop < innerTop) + cursorTop = innerTop; + if (cursorTop + cursorH - 1 > innerBottom) + cursorH = innerBottom - cursorTop + 1; + if (cursorH < 1) + cursorH = 1; + // Only draw if cursor is inside inner bounds + if (caretX >= innerLeft && caretX <= innerRight) { + display->drawVerticalLine(caretX, cursorTop, cursorH); + } + } else { + std::string displayText = inputText; + int textW = display->getStringWidth(displayText.c_str()); + std::string scrolled = displayText; + if (textW > maxTextWidth) { + // Trim from the left until it fits + while (textW > maxTextWidth && !scrolled.empty()) { + scrolled.erase(0, 1); + textW = display->getStringWidth(scrolled.c_str()); + } + // Add leading ellipsis and ensure it still fits + if (scrolled != displayText) { + scrolled = "..." + scrolled; + textW = display->getStringWidth(scrolled.c_str()); + // If adding ellipsis causes overflow, trim more after the ellipsis + while (textW > maxTextWidth && scrolled.size() > 3) { + scrolled.erase(3, 1); // remove chars after the ellipsis + textW = display->getStringWidth(scrolled.c_str()); + } + } + } else { + // Keep textW in sync with what we draw + textW = display->getStringWidth(scrolled.c_str()); + } + + int textY; + if (screenHeight <= 64) { + textY = boxY + (boxHeight - inputLineH) / 2; + } else { + const int innerLeft = boxX + 1; + const int innerRight = boxX + boxWidth - 2; + const int innerTop = boxY + 1; + const int innerBottom = boxY + boxHeight - 2; + + // Center text vertically within inner box for single-line, then clamp so it never overlaps borders + int innerH = innerBottom - innerTop + 1; + textY = innerTop + std::max(0, (innerH - inputLineH) / 2); + // Clamp fully inside the inner rect + if (textY < innerTop) + textY = innerTop; + int maxTop = innerBottom - inputLineH + 1; + if (textY > maxTop) + textY = maxTop; + } + + if (!scrolled.empty()) { + display->drawString(textX, textY, scrolled.c_str()); + } + + int cursorX = textX + textW; + if (screenHeight > 64) { + const int innerRight = boxX + boxWidth - 2; + if (cursorX > innerRight) + cursorX = innerRight; + } + + int cursorTop, cursorH; + if (screenHeight <= 64) { + cursorH = 10; + cursorTop = boxY + (boxHeight - cursorH) / 2; + } else { + const int innerLeft = boxX + 1; + const int innerRight = boxX + boxWidth - 2; + const int innerTop = boxY + 1; + const int innerBottom = boxY + boxHeight - 2; + + cursorTop = boxY + 2; + cursorH = boxHeight - 4; + if (cursorH < 1) + cursorH = 1; + if (cursorTop < innerTop) + cursorTop = innerTop; + if (cursorTop + cursorH - 1 > innerBottom) + cursorH = innerBottom - cursorTop + 1; + if (cursorH < 1) + cursorH = 1; + + if (cursorX < innerLeft || cursorX > innerRight) + return; + } + + display->drawVerticalLine(cursorX, cursorTop, cursorH); + } +} + +void VirtualKeyboard::drawKey(OLEDDisplay *display, const VirtualKey &key, bool selected, int16_t x, int16_t y, uint8_t width, + uint8_t height, bool isLastCol) +{ + // Draw key content + display->setFont(FONT_SMALL); + const int fontH = FONT_HEIGHT_SMALL; + // Build label and metrics first + std::string keyText; + if (key.type == VK_BACKSPACE || key.type == VK_ENTER || key.type == VK_SPACE || key.type == VK_ESC) { + // Keep literal text labels for the action keys on the rightmost column + keyText = (key.type == VK_BACKSPACE) ? "BACK" + : (key.type == VK_ENTER) ? "ENTER" + : (key.type == VK_SPACE) ? "SPACE" + : (key.type == VK_ESC) ? "ESC" + : ""; + } else { + char c = getCharForKey(key, false); + if (c >= 'a' && c <= 'z') { + c = c - 'a' + 'A'; + } + keyText = (key.character == ' ' || key.character == '_') ? "_" : std::string(1, c); + } + + int textWidth = display->getStringWidth(keyText.c_str()); + // Label alignment + // - Rightmost action column: right-align text with a small right padding (~2px) so it hugs screen edge neatly. + // - Other keys: center horizontally; use ceil-style rounding to avoid appearing left-biased on odd widths. + int textX; + if (isLastCol) { + const int rightPad = 1; + textX = x + width - textWidth - rightPad; + if (textX < x) + textX = x; // guard + } else { + if (display->getHeight() <= 64 && (key.character >= '0' && key.character <= '9')) { + textX = x + (width - textWidth + 1) / 2; + } else { + textX = x + (width - textWidth) / 2; + } + } + int contentTop = y; + int contentH = height; + if (selected) { + display->setColor(WHITE); + bool isAction = (key.type == VK_BACKSPACE || key.type == VK_ENTER || key.type == VK_SPACE || key.type == VK_ESC); + + if (display->getHeight() <= 64 && !isAction) { + display->fillRect(x, y, width, height); + } else if (isAction) { + const int padX = 1; + const int padY = 2; + int hlW = textWidth + padX * 2; + int hlX = textX - padX; + + if (hlX < x) { + hlW -= (x - hlX); + hlX = x; + } + int maxW = (x + width) - hlX; + if (hlW > maxW) + hlW = maxW; + if (hlW < 1) + hlW = 1; + + int hlH = std::min(fontH + padY * 2, (int)height); + int hlY = y + (height - hlH) / 2; + display->fillRect(hlX, hlY, hlW, hlH); + contentTop = hlY; + contentH = hlH; + } else { + display->fillRect(x, y, width, height); + } + display->setColor(BLACK); + } else { + display->setColor(WHITE); + } + + int centeredTextY; + if (display->getHeight() <= 64) { + centeredTextY = y + (height - fontH) / 2; + } else { + centeredTextY = contentTop + (contentH - fontH) / 2; + } + if (display->getHeight() > 64) { + if (centeredTextY < contentTop) + centeredTextY = contentTop; + if (centeredTextY + fontH > contentTop + contentH) + centeredTextY = std::max(contentTop, contentTop + contentH - fontH); + } + + if (display->getHeight() <= 64 && keyText.size() == 1) { + char ch = keyText[0]; + if (ch == '.' || ch == ',' || ch == ';') { + centeredTextY -= 1; + } + } + display->drawString(textX, centeredTextY, keyText.c_str()); +} + +char VirtualKeyboard::getCharForKey(const VirtualKey &key, bool isLongPress) +{ + if (key.type != VK_CHAR) { + return key.character; + } + + char c = key.character; + + // Long-press: only keep letter lowercase->uppercase conversion; remove other symbol mappings + if (isLongPress && c >= 'a' && c <= 'z') { + c = (char)(c - 'a' + 'A'); + } + + return c; +} + +void VirtualKeyboard::moveCursorDelta(int dRow, int dCol) +{ + resetTimeout(); + // wrap around rows and cols in the 4x11 grid + int r = (int)cursorRow + dRow; + int c = (int)cursorCol + dCol; + if (r < 0) + r = KEYBOARD_ROWS - 1; + else if (r >= KEYBOARD_ROWS) + r = 0; + if (c < 0) + c = KEYBOARD_COLS - 1; + else if (c >= KEYBOARD_COLS) + c = 0; + cursorRow = (uint8_t)r; + cursorCol = (uint8_t)c; +} + +void VirtualKeyboard::moveCursorUp() +{ + moveCursorDelta(-1, 0); +} +void VirtualKeyboard::moveCursorDown() +{ + moveCursorDelta(1, 0); +} +void VirtualKeyboard::moveCursorLeft() +{ + resetTimeout(); + + if (cursorCol > 0) { + cursorCol--; + } else { + if (cursorRow > 0) { + cursorRow--; + cursorCol = KEYBOARD_COLS - 1; + } else { + cursorRow = KEYBOARD_ROWS - 1; + cursorCol = KEYBOARD_COLS - 1; + } + } +} +void VirtualKeyboard::moveCursorRight() +{ + resetTimeout(); + + if (cursorCol < KEYBOARD_COLS - 1) { + cursorCol++; + } else { + if (cursorRow < KEYBOARD_ROWS - 1) { + cursorRow++; + cursorCol = 0; + } else { + cursorRow = 0; + cursorCol = 0; + } + } +} + +void VirtualKeyboard::handlePress() +{ + resetTimeout(); // Reset timeout on any input activity + + const VirtualKey &key = keyboard[cursorRow][cursorCol]; + + // Don't handle press if the key is empty (but allow special keys) + if (key.character == 0 && key.type == VK_CHAR) { + return; + } + + // For character keys, insert lowercase character + if (key.type == VK_CHAR) { + insertCharacter(getCharForKey(key, false)); // false = lowercase/normal char + return; + } + + // Handle non-character keys immediately + switch (key.type) { + case VK_BACKSPACE: + deleteCharacter(); + break; + case VK_ENTER: + submitText(); + break; + case VK_SPACE: + insertCharacter(' '); + break; + case VK_ESC: + if (onTextEntered) { + std::function callback = onTextEntered; + onTextEntered = nullptr; + inputText = ""; + callback(""); + } + return; + default: + break; + } +} + +void VirtualKeyboard::handleLongPress() +{ + resetTimeout(); // Reset timeout on any input activity + + const VirtualKey &key = keyboard[cursorRow][cursorCol]; + + // Don't handle press if the key is empty (but allow special keys) + if (key.character == 0 && key.type == VK_CHAR) { + return; + } + + // For character keys, insert uppercase/alternate character + if (key.type == VK_CHAR) { + insertCharacter(getCharForKey(key, true)); // true = uppercase/alternate char + return; + } + + switch (key.type) { + case VK_BACKSPACE: + // One-shot: delete up to 5 characters on long press + for (int i = 0; i < 5; ++i) { + if (inputText.empty()) + break; + deleteCharacter(); + } + break; + case VK_ENTER: + submitText(); + break; + case VK_SPACE: + insertCharacter(' '); + break; + case VK_ESC: + if (onTextEntered) { + onTextEntered(""); + } + break; + default: + break; + } +} + +void VirtualKeyboard::insertCharacter(char c) +{ + if (inputText.length() < 160) { // Reasonable text length limit + inputText += c; + } +} + +void VirtualKeyboard::deleteCharacter() +{ + if (!inputText.empty()) { + inputText.pop_back(); + } +} + +void VirtualKeyboard::submitText() +{ + LOG_INFO("Virtual keyboard: submitting text '%s'", inputText.c_str()); + + // Only submit if text is not empty + if (!inputText.empty() && onTextEntered) { + // Store callback and text to submit before clearing callback + std::function callback = onTextEntered; + std::string textToSubmit = inputText; + onTextEntered = nullptr; + // Don't clear inputText here - let the calling module handle cleanup + // inputText = ""; // Removed: keep text visible until module cleans up + callback(textToSubmit); + } else if (inputText.empty()) { + // For empty text, just ignore the submission - don't clear callback + // This keeps the virtual keyboard responsive for further input + LOG_INFO("Virtual keyboard: empty text submitted, ignoring - keyboard remains active"); + } else { + // No callback available + if (screen) { + screen->setFrames(graphics::Screen::FOCUS_PRESERVE); + } + } +} + +void VirtualKeyboard::setInputText(const std::string &text) +{ + inputText = text; +} + +std::string VirtualKeyboard::getInputText() const +{ + return inputText; +} + +void VirtualKeyboard::setHeader(const std::string &header) +{ + headerText = header; +} + +void VirtualKeyboard::setCallback(std::function callback) +{ + onTextEntered = callback; +} + +void VirtualKeyboard::resetTimeout() +{ + lastActivityTime = millis(); +} + +bool VirtualKeyboard::isTimedOut() const +{ + return (millis() - lastActivityTime) > TIMEOUT_MS; +} + +} // namespace graphics diff --git a/src/graphics/VirtualKeyboard.h b/src/graphics/VirtualKeyboard.h new file mode 100644 index 000000000..169163b57 --- /dev/null +++ b/src/graphics/VirtualKeyboard.h @@ -0,0 +1,80 @@ +#pragma once + +#include "configuration.h" +#include +#include +#include + +namespace graphics +{ + +enum VirtualKeyType { VK_CHAR, VK_BACKSPACE, VK_ENTER, VK_SHIFT, VK_ESC, VK_SPACE }; + +struct VirtualKey { + char character; + VirtualKeyType type; + uint8_t x; + uint8_t y; + uint8_t width; + uint8_t height; +}; + +class VirtualKeyboard +{ + public: + VirtualKeyboard(); + ~VirtualKeyboard(); + + void draw(OLEDDisplay *display, int16_t offsetX, int16_t offsetY); + void setInputText(const std::string &text); + std::string getInputText() const; + void setHeader(const std::string &header); + void setCallback(std::function callback); + + // Navigation methods for encoder input + void moveCursorUp(); + void moveCursorDown(); + void moveCursorLeft(); + void moveCursorRight(); + void handlePress(); + void handleLongPress(); + + // Timeout management + void resetTimeout(); + bool isTimedOut() const; + + private: + static const uint8_t KEYBOARD_ROWS = 4; + static const uint8_t KEYBOARD_COLS = 11; + static const uint8_t KEY_WIDTH = 9; + static const uint8_t KEY_HEIGHT = 9; // Compressed to fit 4 rows on 64px displays + static const uint8_t KEYBOARD_START_Y = 26; // Start just below input box bottom + + VirtualKey keyboard[KEYBOARD_ROWS][KEYBOARD_COLS]; + + std::string inputText; + std::string headerText; + std::function onTextEntered; + + uint8_t cursorRow; + uint8_t cursorCol; + + // Timeout management for auto-exit + uint32_t lastActivityTime; + static const uint32_t TIMEOUT_MS = 60000; // 1 minute timeout + + void initializeKeyboard(); + void drawKey(OLEDDisplay *display, const VirtualKey &key, bool selected, int16_t x, int16_t y, uint8_t w, uint8_t h, + bool isLastCol); + void drawInputArea(OLEDDisplay *display, int16_t offsetX, int16_t offsetY, int16_t keyboardStartY); + + // Unified cursor movement helper + void moveCursorDelta(int dRow, int dCol); + + char getCharForKey(const VirtualKey &key, bool isLongPress = false); + void insertCharacter(char c); + void deleteCharacter(); + void submitText(); +}; + +} // namespace graphics diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index 512f650ec..e02948864 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -10,7 +10,10 @@ #include "graphics/Screen.h" #include "graphics/SharedUIDisplay.h" #include "graphics/draw/UIRenderer.h" +#include "input/RotaryEncoderInterruptImpl1.h" +#include "input/UpDownInterruptImpl1.h" #include "main.h" +#include "mesh/MeshTypes.h" #include "modules/AdminModule.h" #include "modules/CannedMessageModule.h" #include "modules/KeyVerificationModule.h" diff --git a/src/graphics/draw/NotificationRenderer.cpp b/src/graphics/draw/NotificationRenderer.cpp index 3d635e588..221d95075 100644 --- a/src/graphics/draw/NotificationRenderer.cpp +++ b/src/graphics/draw/NotificationRenderer.cpp @@ -38,6 +38,8 @@ bool NotificationRenderer::pauseBanner = false; notificationTypeEnum NotificationRenderer::current_notification_type = notificationTypeEnum::none; uint32_t NotificationRenderer::numDigits = 0; uint32_t NotificationRenderer::currentNumber = 0; +VirtualKeyboard *NotificationRenderer::virtualKeyboard = nullptr; +std::function NotificationRenderer::textInputCallback = nullptr; uint32_t pow_of_10(uint32_t n) { @@ -89,14 +91,33 @@ void NotificationRenderer::resetBanner() void NotificationRenderer::drawBannercallback(OLEDDisplay *display, OLEDDisplayUiState *state) { - if (!isOverlayBannerShowing() && alertBannerMessage[0] != '\0') - resetBanner(); - if (!isOverlayBannerShowing() || pauseBanner) + // Handle text_input notifications first - they have their own timeout/banner logic + if (current_notification_type == notificationTypeEnum::text_input) { + // Check for timeout and reset if needed for text input + if (millis() > alertBannerUntil && alertBannerUntil > 0) { + resetBanner(); + return; + } + drawTextInput(display, state); return; + } + + if (millis() > alertBannerUntil && alertBannerUntil > 0) { + resetBanner(); + } + + // Exit if no banner is showing or banner is paused + if (!isOverlayBannerShowing() || pauseBanner) { + return; + } + switch (current_notification_type) { case notificationTypeEnum::none: // Do nothing - no notification to display break; + case notificationTypeEnum::text_input: + // Already handled above with dedicated logic (early return). Keep a case here to satisfy -Wswitch. + break; case notificationTypeEnum::text_banner: case notificationTypeEnum::selection_picker: drawAlertBannerOverlay(display, state); @@ -575,6 +596,90 @@ void NotificationRenderer::drawFrameFirmware(OLEDDisplay *display, OLEDDisplayUi "Please be patient and do not power off."); } +void NotificationRenderer::drawTextInput(OLEDDisplay *display, OLEDDisplayUiState *state) +{ + if (virtualKeyboard) { + // Check for timeout and auto-exit if needed + if (virtualKeyboard->isTimedOut()) { + LOG_INFO("Virtual keyboard timeout - auto-exiting"); + // Cancel virtual keyboard - call callback with empty string to indicate timeout + auto callback = textInputCallback; // Store callback before clearing + + // Clean up first to prevent re-entry + delete virtualKeyboard; + virtualKeyboard = nullptr; + textInputCallback = nullptr; + resetBanner(); + + // Call callback after cleanup + if (callback) { + callback(""); + } + + // Restore normal overlays + if (screen) { + screen->setFrames(graphics::Screen::FOCUS_PRESERVE); + } + return; + } + + // Handle input events for virtual keyboard navigation + if (inEvent.inputEvent != INPUT_BROKER_NONE) { + if (inEvent.inputEvent == INPUT_BROKER_UP) { + virtualKeyboard->moveCursorUp(); + } else if (inEvent.inputEvent == INPUT_BROKER_DOWN) { + virtualKeyboard->moveCursorDown(); + } else if (inEvent.inputEvent == INPUT_BROKER_LEFT) { + virtualKeyboard->moveCursorLeft(); + } else if (inEvent.inputEvent == INPUT_BROKER_RIGHT) { + virtualKeyboard->moveCursorRight(); + } else if (inEvent.inputEvent == INPUT_BROKER_ALT_PRESS) { + // Long press UP = move left + virtualKeyboard->moveCursorLeft(); + } else if (inEvent.inputEvent == INPUT_BROKER_USER_PRESS) { + // Long press DOWN = move right + virtualKeyboard->moveCursorRight(); + } else if (inEvent.inputEvent == INPUT_BROKER_SELECT) { + virtualKeyboard->handlePress(); + } else if (inEvent.inputEvent == INPUT_BROKER_SELECT_LONG) { + virtualKeyboard->handleLongPress(); + } else if (inEvent.inputEvent == INPUT_BROKER_CANCEL) { + // Cancel virtual keyboard - call callback with empty string + auto callback = textInputCallback; // Store callback before clearing + + // Clean up first to prevent re-entry + delete virtualKeyboard; + virtualKeyboard = nullptr; + textInputCallback = nullptr; + resetBanner(); + + // Call callback after cleanup + if (callback) { + callback(""); + } + + // Restore normal overlays + if (screen) { + screen->setFrames(graphics::Screen::FOCUS_PRESERVE); + } + return; + } + + // Reset input event after processing + inEvent.inputEvent = INPUT_BROKER_NONE; + } + + // Clear the display and draw virtual keyboard + display->setColor(BLACK); + display->fillRect(0, 0, display->getWidth(), display->getHeight()); + display->setColor(WHITE); + virtualKeyboard->draw(display, 0, 0); + } else { + // If virtualKeyboard is null, reset the banner to avoid getting stuck + resetBanner(); + } +} + bool NotificationRenderer::isOverlayBannerShowing() { return strlen(alertBannerMessage) > 0 && (alertBannerUntil == 0 || millis() <= alertBannerUntil); diff --git a/src/graphics/draw/NotificationRenderer.h b/src/graphics/draw/NotificationRenderer.h index 9c30b329c..edb069513 100644 --- a/src/graphics/draw/NotificationRenderer.h +++ b/src/graphics/draw/NotificationRenderer.h @@ -3,6 +3,9 @@ #include "OLEDDisplay.h" #include "OLEDDisplayUi.h" #include "graphics/Screen.h" +#include "graphics/VirtualKeyboard.h" +#include +#include #define MAX_LINES 5 namespace graphics @@ -22,6 +25,8 @@ class NotificationRenderer static std::function alertBannerCallback; static uint32_t numDigits; static uint32_t currentNumber; + static VirtualKeyboard *virtualKeyboard; + static std::function textInputCallback; static bool pauseBanner; @@ -30,6 +35,7 @@ class NotificationRenderer static void drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisplayUiState *state); static void drawNumberPicker(OLEDDisplay *display, OLEDDisplayUiState *state); static void drawNodePicker(OLEDDisplay *display, OLEDDisplayUiState *state); + static void drawTextInput(OLEDDisplay *display, OLEDDisplayUiState *state); static void drawNotificationBox(OLEDDisplay *display, OLEDDisplayUiState *state, const char *lines[MAX_LINES + 1], uint16_t totalLines, uint8_t firstOptionToShow, uint16_t maxWidth = 0); diff --git a/src/input/InputBroker.h b/src/input/InputBroker.h index 4487fa662..012a403f5 100644 --- a/src/input/InputBroker.h +++ b/src/input/InputBroker.h @@ -4,6 +4,7 @@ enum input_broker_event { INPUT_BROKER_NONE = 0, INPUT_BROKER_SELECT = 10, + INPUT_BROKER_SELECT_LONG, INPUT_BROKER_UP = 17, INPUT_BROKER_DOWN = 18, INPUT_BROKER_LEFT = 19, diff --git a/src/input/TrackballInterruptBase.cpp b/src/input/TrackballInterruptBase.cpp index d41ad2fd6..4c8ce6409 100644 --- a/src/input/TrackballInterruptBase.cpp +++ b/src/input/TrackballInterruptBase.cpp @@ -1,12 +1,14 @@ #include "TrackballInterruptBase.h" #include "configuration.h" +extern bool osk_found; TrackballInterruptBase::TrackballInterruptBase(const char *name) : concurrency::OSThread(name), _originName(name) {} void TrackballInterruptBase::init(uint8_t pinDown, uint8_t pinUp, uint8_t pinLeft, uint8_t pinRight, uint8_t pinPress, input_broker_event eventDown, input_broker_event eventUp, input_broker_event eventLeft, - input_broker_event eventRight, input_broker_event eventPressed, void (*onIntDown)(), - void (*onIntUp)(), void (*onIntLeft)(), void (*onIntRight)(), void (*onIntPress)()) + input_broker_event eventRight, input_broker_event eventPressed, + input_broker_event eventPressedLong, void (*onIntDown)(), void (*onIntUp)(), + void (*onIntLeft)(), void (*onIntRight)(), void (*onIntPress)()) { this->_pinDown = pinDown; this->_pinUp = pinUp; @@ -18,6 +20,7 @@ void TrackballInterruptBase::init(uint8_t pinDown, uint8_t pinUp, uint8_t pinLef this->_eventLeft = eventLeft; this->_eventRight = eventRight; this->_eventPressed = eventPressed; + this->_eventPressedLong = eventPressedLong; if (pinPress != 255) { pinMode(pinPress, INPUT_PULLUP); @@ -40,9 +43,9 @@ void TrackballInterruptBase::init(uint8_t pinDown, uint8_t pinUp, uint8_t pinLef attachInterrupt(this->_pinRight, onIntRight, TB_DIRECTION); } - LOG_DEBUG("Trackball GPIO initialized (%d, %d, %d, %d, %d)", this->_pinUp, this->_pinDown, this->_pinLeft, this->_pinRight, - pinPress); - + LOG_DEBUG("Trackball GPIO initialized - UP:%d DOWN:%d LEFT:%d RIGHT:%d PRESS:%d", this->_pinUp, this->_pinDown, + this->_pinLeft, this->_pinRight, pinPress); + osk_found = true; this->setInterval(100); } @@ -50,10 +53,47 @@ int32_t TrackballInterruptBase::runOnce() { InputEvent e; e.inputEvent = INPUT_BROKER_NONE; + + // Handle long press detection for press button + if (pressDetected && pressStartTime > 0) { + uint32_t pressDuration = millis() - pressStartTime; + bool buttonStillPressed = false; + +#if defined(T_DECK) + buttonStillPressed = (this->action == TB_ACTION_PRESSED); +#else + buttonStillPressed = !digitalRead(_pinPress); +#endif + + if (!buttonStillPressed) { + // Button released + if (pressDuration < LONG_PRESS_DURATION) { + // Short press + e.inputEvent = this->_eventPressed; + } + // Reset state + pressDetected = false; + pressStartTime = 0; + lastLongPressEventTime = 0; + this->action = TB_ACTION_NONE; + } else if (pressDuration >= LONG_PRESS_DURATION) { + // Long press detected + uint32_t currentTime = millis(); + // Only trigger long press event if enough time has passed since the last one + if (lastLongPressEventTime == 0 || (currentTime - lastLongPressEventTime) >= LONG_PRESS_REPEAT_INTERVAL) { + e.inputEvent = this->_eventPressedLong; + lastLongPressEventTime = currentTime; + } + this->action = TB_ACTION_PRESSED_LONG; + } + } + #if defined(T_DECK) // T-deck gets a super-simple debounce on trackball - if (this->action == TB_ACTION_PRESSED) { - // LOG_DEBUG("Trackball event Press"); - e.inputEvent = this->_eventPressed; + if (this->action == TB_ACTION_PRESSED && !pressDetected) { + // Start long press detection + pressDetected = true; + pressStartTime = millis(); + // Don't send event yet, wait to see if it's a long press } else if (this->action == TB_ACTION_UP && lastEvent == TB_ACTION_UP) { // LOG_DEBUG("Trackball event UP"); e.inputEvent = this->_eventUp; @@ -68,9 +108,11 @@ int32_t TrackballInterruptBase::runOnce() e.inputEvent = this->_eventRight; } #else - if (this->action == TB_ACTION_PRESSED && !digitalRead(_pinPress)) { - // LOG_DEBUG("Trackball event Press"); - e.inputEvent = this->_eventPressed; + if (this->action == TB_ACTION_PRESSED && !digitalRead(_pinPress) && !pressDetected) { + // Start long press detection + pressDetected = true; + pressStartTime = millis(); + // Don't send event yet, wait to see if it's a long press } else if (this->action == TB_ACTION_UP && !digitalRead(_pinUp)) { // LOG_DEBUG("Trackball event UP"); e.inputEvent = this->_eventUp; @@ -91,10 +133,16 @@ int32_t TrackballInterruptBase::runOnce() e.kbchar = 0x00; this->notifyObservers(&e); } - lastEvent = action; - this->action = TB_ACTION_NONE; - return 100; + // Only update lastEvent for non-press actions or completed press actions + if (this->action != TB_ACTION_PRESSED || !pressDetected) { + lastEvent = action; + if (!pressDetected) { + this->action = TB_ACTION_NONE; + } + } + + return 50; // Check more frequently for better long press detection } void TrackballInterruptBase::intPressHandler() diff --git a/src/input/TrackballInterruptBase.h b/src/input/TrackballInterruptBase.h index 92db8720e..38be22f20 100644 --- a/src/input/TrackballInterruptBase.h +++ b/src/input/TrackballInterruptBase.h @@ -18,8 +18,8 @@ class TrackballInterruptBase : public Observable, public con explicit TrackballInterruptBase(const char *name); void init(uint8_t pinDown, uint8_t pinUp, uint8_t pinLeft, uint8_t pinRight, uint8_t pinPress, input_broker_event eventDown, input_broker_event eventUp, input_broker_event eventLeft, input_broker_event eventRight, - input_broker_event eventPressed, void (*onIntDown)(), void (*onIntUp)(), void (*onIntLeft)(), void (*onIntRight)(), - void (*onIntPress)()); + input_broker_event eventPressed, input_broker_event eventPressedLong, void (*onIntDown)(), void (*onIntUp)(), + void (*onIntLeft)(), void (*onIntRight)(), void (*onIntPress)()); void intPressHandler(); void intDownHandler(); void intUpHandler(); @@ -33,6 +33,7 @@ class TrackballInterruptBase : public Observable, public con enum TrackballInterruptBaseActionType { TB_ACTION_NONE, TB_ACTION_PRESSED, + TB_ACTION_PRESSED_LONG, TB_ACTION_UP, TB_ACTION_DOWN, TB_ACTION_LEFT, @@ -46,12 +47,20 @@ class TrackballInterruptBase : public Observable, public con volatile TrackballInterruptBaseActionType action = TB_ACTION_NONE; + // Long press detection for press button + uint32_t pressStartTime = 0; + bool pressDetected = false; + uint32_t lastLongPressEventTime = 0; + static const uint32_t LONG_PRESS_DURATION = 500; // ms + static const uint32_t LONG_PRESS_REPEAT_INTERVAL = 500; // ms - interval between repeated long press events + private: input_broker_event _eventDown = INPUT_BROKER_NONE; input_broker_event _eventUp = INPUT_BROKER_NONE; input_broker_event _eventLeft = INPUT_BROKER_NONE; input_broker_event _eventRight = INPUT_BROKER_NONE; input_broker_event _eventPressed = INPUT_BROKER_NONE; + input_broker_event _eventPressedLong = INPUT_BROKER_NONE; const char *_originName; TrackballInterruptBaseActionType lastEvent = TB_ACTION_NONE; }; diff --git a/src/input/TrackballInterruptImpl1.cpp b/src/input/TrackballInterruptImpl1.cpp index 896238f38..594facdeb 100644 --- a/src/input/TrackballInterruptImpl1.cpp +++ b/src/input/TrackballInterruptImpl1.cpp @@ -13,11 +13,12 @@ void TrackballInterruptImpl1::init(uint8_t pinDown, uint8_t pinUp, uint8_t pinLe input_broker_event eventLeft = INPUT_BROKER_LEFT; input_broker_event eventRight = INPUT_BROKER_RIGHT; input_broker_event eventPressed = INPUT_BROKER_SELECT; + input_broker_event eventPressedLong = INPUT_BROKER_SELECT_LONG; TrackballInterruptBase::init(pinDown, pinUp, pinLeft, pinRight, pinPress, eventDown, eventUp, eventLeft, eventRight, - eventPressed, TrackballInterruptImpl1::handleIntDown, TrackballInterruptImpl1::handleIntUp, - TrackballInterruptImpl1::handleIntLeft, TrackballInterruptImpl1::handleIntRight, - TrackballInterruptImpl1::handleIntPressed); + eventPressed, eventPressedLong, TrackballInterruptImpl1::handleIntDown, + TrackballInterruptImpl1::handleIntUp, TrackballInterruptImpl1::handleIntLeft, + TrackballInterruptImpl1::handleIntRight, TrackballInterruptImpl1::handleIntPressed); inputBroker->registerSource(this); } diff --git a/src/main.cpp b/src/main.cpp index ef5f5a721..23ffa6b6d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -191,6 +191,8 @@ ScanI2C::DeviceAddress cardkb_found = ScanI2C::ADDRESS_NONE; uint8_t kb_model; // global bool to record that a kb is present bool kb_found = false; +// global bool to record that on-screen keyboard (OSK) is present +bool osk_found = false; // The I2C address of the RTC Module (if found) ScanI2C::DeviceAddress rtc_found = ScanI2C::ADDRESS_NONE; @@ -1412,6 +1414,10 @@ void setup() #endif #endif +#if defined(HAS_TRACKBALL) || (defined(INPUTDRIVER_ENCODER_TYPE) && INPUTDRIVER_ENCODER_TYPE == 2) + osk_found = true; +#endif + #if defined(ARCH_ESP32) && !MESHTASTIC_EXCLUDE_WEBSERVER // Start web server thread. webServerThread = new WebServerThread(); diff --git a/src/main.h b/src/main.h index 3568daad2..2ddd4862f 100644 --- a/src/main.h +++ b/src/main.h @@ -32,6 +32,7 @@ extern ScanI2C::DeviceAddress screen_found; extern ScanI2C::DeviceAddress cardkb_found; extern uint8_t kb_model; extern bool kb_found; +extern bool osk_found; extern ScanI2C::DeviceAddress rtc_found; extern ScanI2C::DeviceAddress accelerometer_found; extern ScanI2C::FoundDevice rgb_found; diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index d40dcd24f..76b950322 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -13,12 +13,16 @@ #include "detect/ScanI2C.h" #include "graphics/Screen.h" #include "graphics/SharedUIDisplay.h" +#include "graphics/draw/NotificationRenderer.h" #include "graphics/emotes.h" #include "graphics/images.h" #include "main.h" // for cardkb_found #include "mesh/generated/meshtastic/cannedmessages.pb.h" #include "modules/AdminModule.h" #include "modules/ExternalNotificationModule.h" // for buzzer control +#if HAS_TRACKBALL +#include "input/TrackballInterruptImpl1.h" +#endif #if !MESHTASTIC_EXCLUDE_GPS #include "GPS.h" #endif @@ -38,6 +42,7 @@ extern ScanI2C::DeviceAddress cardkb_found; extern bool graphics::isMuted; +extern bool osk_found; static const char *cannedMessagesConfigFile = "/prefs/cannedConf.proto"; static NodeNum lastDest = NODENUM_BROADCAST; @@ -151,10 +156,13 @@ int CannedMessageModule::splitConfiguredMessages() int tempCount = 0; // Insert at position 0 (top) tempMessages[tempCount++] = "[Select Destination]"; - #if defined(USE_VIRTUAL_KEYBOARD) - // Add a "Free Text" entry at the top if using a keyboard + // Add a "Free Text" entry at the top if using a touch screen virtual keyboard tempMessages[tempCount++] = "[-- Free Text --]"; +#else + if (osk_found && screen) { + tempMessages[tempCount++] = "[-- Free Text --]"; + } #endif // First message always starts at buffer start @@ -341,6 +349,8 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event) case CANNED_MESSAGE_RUN_STATE_FREETEXT: return handleFreeTextInput(event); // All allowed input for this state + // Virtual keyboard mode: Show virtual keyboard and handle input + // If sending, block all input except global/system (handled above) case CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE: return 1; @@ -627,6 +637,56 @@ bool CannedMessageModule::handleMessageSelectorInput(const InputEvent *event, bo notifyObservers(&e); return true; } +#else + if (strcmp(current, "[-- Free Text --]") == 0) { + if (osk_found && screen) { + char headerBuffer[64]; + if (this->dest == NODENUM_BROADCAST) { + snprintf(headerBuffer, sizeof(headerBuffer), "To: Broadcast@%s", channels.getName(this->channel)); + } else { + snprintf(headerBuffer, sizeof(headerBuffer), "To: %s", getNodeName(this->dest)); + } + screen->showTextInput(headerBuffer, "", 300000, [this](const std::string &text) { + if (!text.empty()) { + this->freetext = text.c_str(); + this->payload = CANNED_MESSAGE_RUN_STATE_FREETEXT; + runState = CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE; + currentMessageIndex = -1; + + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + this->notifyObservers(&e); + screen->forceDisplay(); + + setIntervalFromNow(500); + return; + } else { + // Don't delete virtual keyboard immediately - it might still be executing + // Instead, just clear the callback and reset banner to stop input processing + graphics::NotificationRenderer::textInputCallback = nullptr; + graphics::NotificationRenderer::resetBanner(); + + // Return to inactive state + this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; + this->currentMessageIndex = -1; + this->freetext = ""; + this->cursor = 0; + + // Force display update to show normal screen + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + this->notifyObservers(&e); + screen->forceDisplay(); + + // Schedule cleanup for next loop iteration to ensure safe deletion + setIntervalFromNow(50); + return; + } + }); + + return true; + } + } #endif // Normal canned message selection @@ -943,12 +1003,54 @@ int32_t CannedMessageModule::runOnce() // Normal module disable/idle handling if ((this->runState == CANNED_MESSAGE_RUN_STATE_DISABLED) || (this->runState == CANNED_MESSAGE_RUN_STATE_INACTIVE)) { + // Clean up virtual keyboard if needed when going inactive + if (graphics::NotificationRenderer::virtualKeyboard && graphics::NotificationRenderer::textInputCallback == nullptr) { + LOG_INFO("Performing delayed virtual keyboard cleanup"); + delete graphics::NotificationRenderer::virtualKeyboard; + graphics::NotificationRenderer::virtualKeyboard = nullptr; + } + temporaryMessage = ""; return INT32_MAX; } + // Handle delayed virtual keyboard message sending + if (this->runState == CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE && this->payload == CANNED_MESSAGE_RUN_STATE_FREETEXT) { + // Virtual keyboard message sending case - text was not empty + if (this->freetext.length() > 0) { + LOG_INFO("Processing delayed virtual keyboard send: '%s'", this->freetext.c_str()); + sendText(this->dest, this->channel, this->freetext.c_str(), true); + + // Clean up virtual keyboard after sending + if (graphics::NotificationRenderer::virtualKeyboard) { + LOG_INFO("Cleaning up virtual keyboard after message send"); + delete graphics::NotificationRenderer::virtualKeyboard; + graphics::NotificationRenderer::virtualKeyboard = nullptr; + graphics::NotificationRenderer::textInputCallback = nullptr; + graphics::NotificationRenderer::resetBanner(); + } + + // Clear payload to indicate virtual keyboard processing is complete + // But keep SENDING_ACTIVE state to show "Sending..." screen for 2 seconds + this->payload = 0; + } else { + // Empty message, just go inactive + LOG_INFO("Empty freetext detected in delayed processing, returning to inactive state"); + this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; + } + + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + this->currentMessageIndex = -1; + this->freetext = ""; + this->cursor = 0; + this->notifyObservers(&e); + return 2000; + } + UIFrameEvent e; - if ((this->runState == CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE) || + if ((this->runState == CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE && this->payload != 0 && + this->payload != CANNED_MESSAGE_RUN_STATE_FREETEXT) || (this->runState == CANNED_MESSAGE_RUN_STATE_ACK_NACK_RECEIVED) || (this->runState == CANNED_MESSAGE_RUN_STATE_MESSAGE_SELECTION)) { this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; @@ -958,6 +1060,18 @@ int32_t CannedMessageModule::runOnce() this->freetext = ""; this->cursor = 0; this->notifyObservers(&e); + } + // Handle SENDING_ACTIVE state transition after virtual keyboard message + else if (this->runState == CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE && this->payload == 0) { + // This happens after virtual keyboard message sending is complete + LOG_INFO("Virtual keyboard message sending completed, returning to inactive state"); + this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; + temporaryMessage = ""; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + this->currentMessageIndex = -1; + this->freetext = ""; + this->cursor = 0; + this->notifyObservers(&e); } else if (((this->runState == CANNED_MESSAGE_RUN_STATE_ACTIVE) || (this->runState == CANNED_MESSAGE_RUN_STATE_FREETEXT)) && !Throttle::isWithinTimespanMs(this->lastTouchMillis, INACTIVATE_AFTER_MS)) { // Reset module on inactivity @@ -966,9 +1080,23 @@ int32_t CannedMessageModule::runOnce() this->freetext = ""; this->cursor = 0; this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; + + // Clean up virtual keyboard if it exists during timeout + if (graphics::NotificationRenderer::virtualKeyboard) { + LOG_INFO("Cleaning up virtual keyboard due to module timeout"); + delete graphics::NotificationRenderer::virtualKeyboard; + graphics::NotificationRenderer::virtualKeyboard = nullptr; + graphics::NotificationRenderer::textInputCallback = nullptr; + graphics::NotificationRenderer::resetBanner(); + } + this->notifyObservers(&e); } else if (this->runState == CANNED_MESSAGE_RUN_STATE_ACTION_SELECT) { - if (this->payload == CANNED_MESSAGE_RUN_STATE_FREETEXT) { + if (this->payload == 0) { + // [Exit] button pressed - return to inactive state + LOG_INFO("Processing [Exit] action - returning to inactive state"); + this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; + } else if (this->payload == CANNED_MESSAGE_RUN_STATE_FREETEXT) { if (this->freetext.length() > 0) { sendText(this->dest, this->channel, this->freetext.c_str(), true); this->runState = CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE; From 1daf5aad1ff4a84071e3e09cc05252ab21811963 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 21 Aug 2025 06:29:23 -0500 Subject: [PATCH 154/180] Revert "Add on-screen keyboard implementation on Trackball device. (#7625)" (#7704) This reverts commit fe3f14a63e2dbd160eabfcb8fdf1fb7cfb8eb1db. --- src/buzz/BuzzerFeedbackThread.cpp | 1 - src/graphics/Screen.cpp | 75 +-- src/graphics/Screen.h | 4 +- src/graphics/VirtualKeyboard.cpp | 738 --------------------- src/graphics/VirtualKeyboard.h | 80 --- src/graphics/draw/MenuHandler.cpp | 3 - src/graphics/draw/NotificationRenderer.cpp | 109 +-- src/graphics/draw/NotificationRenderer.h | 6 - src/input/InputBroker.h | 1 - src/input/TrackballInterruptBase.cpp | 76 +-- src/input/TrackballInterruptBase.h | 13 +- src/input/TrackballInterruptImpl1.cpp | 7 +- src/main.cpp | 6 - src/main.h | 1 - src/modules/CannedMessageModule.cpp | 136 +--- 15 files changed, 30 insertions(+), 1226 deletions(-) delete mode 100644 src/graphics/VirtualKeyboard.cpp delete mode 100644 src/graphics/VirtualKeyboard.h diff --git a/src/buzz/BuzzerFeedbackThread.cpp b/src/buzz/BuzzerFeedbackThread.cpp index 838224c69..ce762c764 100644 --- a/src/buzz/BuzzerFeedbackThread.cpp +++ b/src/buzz/BuzzerFeedbackThread.cpp @@ -28,7 +28,6 @@ int BuzzerFeedbackThread::handleInputEvent(const InputEvent *event) case INPUT_BROKER_USER_PRESS: case INPUT_BROKER_ALT_PRESS: case INPUT_BROKER_SELECT: - case INPUT_BROKER_SELECT_LONG: playBeep(); // Confirmation feedback break; diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 5e29814cb..fa71e17d8 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -216,44 +216,6 @@ void Screen::showNumberPicker(const char *message, uint32_t durationMs, uint8_t ui->update(); } -void Screen::showTextInput(const char *header, const char *initialText, uint32_t durationMs, - std::function textCallback) -{ - LOG_INFO("showTextInput called with header='%s', durationMs=%d", header ? header : "NULL", durationMs); - - if (NotificationRenderer::virtualKeyboard) { - delete NotificationRenderer::virtualKeyboard; - NotificationRenderer::virtualKeyboard = nullptr; - } - - NotificationRenderer::textInputCallback = nullptr; - - NotificationRenderer::virtualKeyboard = new VirtualKeyboard(); - if (header) { - NotificationRenderer::virtualKeyboard->setHeader(header); - } - if (initialText) { - NotificationRenderer::virtualKeyboard->setInputText(initialText); - } - - // Set up callback with safer cleanup mechanism - NotificationRenderer::textInputCallback = textCallback; - NotificationRenderer::virtualKeyboard->setCallback([textCallback](const std::string &text) { textCallback(text); }); - - // Store the message and set the expiration timestamp (use same pattern as other notifications) - strncpy(NotificationRenderer::alertBannerMessage, header ? header : "Text Input", 255); - NotificationRenderer::alertBannerMessage[255] = '\0'; - NotificationRenderer::alertBannerUntil = (durationMs == 0) ? 0 : millis() + durationMs; - NotificationRenderer::pauseBanner = false; - NotificationRenderer::current_notification_type = notificationTypeEnum::text_input; - - // Set the overlay using the same pattern as other notification types - static OverlayCallback overlays[] = {graphics::UIRenderer::drawNavigationBar, NotificationRenderer::drawBannercallback}; - ui->setOverlays(overlays, sizeof(overlays) / sizeof(overlays[0])); - ui->setTargetFPS(60); - ui->update(); -} - static void drawModuleFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) { uint8_t module_frame; @@ -751,19 +713,13 @@ int32_t Screen::runOnce() handleSetOn(false); break; case Cmd::ON_PRESS: - if (NotificationRenderer::current_notification_type != notificationTypeEnum::text_input) { - handleOnPress(); - } + handleOnPress(); break; case Cmd::SHOW_PREV_FRAME: - if (NotificationRenderer::current_notification_type != notificationTypeEnum::text_input) { - handleShowPrevFrame(); - } + handleShowPrevFrame(); break; case Cmd::SHOW_NEXT_FRAME: - if (NotificationRenderer::current_notification_type != notificationTypeEnum::text_input) { - handleShowNextFrame(); - } + handleShowNextFrame(); break; case Cmd::START_ALERT_FRAME: { showingBootScreen = false; // this should avoid the edge case where an alert triggers before the boot screen goes away @@ -785,9 +741,7 @@ int32_t Screen::runOnce() NotificationRenderer::pauseBanner = false; case Cmd::STOP_BOOT_SCREEN: EINK_ADD_FRAMEFLAG(dispdev, COSMETIC); // E-Ink: Explicitly use full-refresh for next frame - if (NotificationRenderer::current_notification_type != notificationTypeEnum::text_input) { - setFrames(); - } + setFrames(); break; case Cmd::NOOP: break; @@ -823,7 +777,6 @@ int32_t Screen::runOnce() if (showingNormalScreen) { // standard screen loop handling here if (config.display.auto_screen_carousel_secs > 0 && - NotificationRenderer::current_notification_type != notificationTypeEnum::text_input && !Throttle::isWithinTimespanMs(lastScreenTransition, config.display.auto_screen_carousel_secs * 1000)) { // If an E-Ink display struggles with fast refresh, force carousel to use full refresh instead @@ -914,11 +867,6 @@ void Screen::setScreensaverFrames(FrameCallback einkScreensaver) // Called when a frame should be added / removed, or custom frames should be cleared void Screen::setFrames(FrameFocus focus) { - // Block setFrames calls when virtual keyboard is active to prevent overlay interference - if (NotificationRenderer::current_notification_type == notificationTypeEnum::text_input) { - return; - } - uint8_t originalPosition = ui->getUiState()->currentFrame; uint8_t previousFrameCount = framesetInfo.frameCount; FramesetInfo fsi; // Location of specific frames, for applying focus parameter @@ -1365,11 +1313,6 @@ int Screen::handleTextMessage(const meshtastic_MeshPacket *packet) // Triggered by MeshModules int Screen::handleUIFrameEvent(const UIFrameEvent *event) { - // Block UI frame events when virtual keyboard is active - if (NotificationRenderer::current_notification_type == notificationTypeEnum::text_input) { - return 0; - } - if (showingNormalScreen) { // Regenerate the frameset, potentially honoring a module's internal requestFocus() call if (event->action == UIFrameEvent::Action::REGENERATE_FRAMESET) @@ -1392,16 +1335,6 @@ int Screen::handleInputEvent(const InputEvent *event) if (!screenOn) return 0; - // Handle text input notifications specially - pass input to virtual keyboard - if (NotificationRenderer::current_notification_type == notificationTypeEnum::text_input) { - NotificationRenderer::inEvent = *event; - static OverlayCallback overlays[] = {graphics::UIRenderer::drawNavigationBar, NotificationRenderer::drawBannercallback}; - ui->setOverlays(overlays, sizeof(overlays) / sizeof(overlays[0])); - setFastFramerate(); // Draw ASAP - ui->update(); - return 0; - } - #ifdef USE_EINK // the screen is the last input handler, so if an event makes it here, we can assume it will prompt a screen draw. EINK_ADD_FRAMEFLAG(dispdev, DEMAND_FAST); // Use fast-refresh for next frame, no skip please EINK_ADD_FRAMEFLAG(dispdev, BLOCKING); // Edge case: if this frame is promoted to COSMETIC, wait for update diff --git a/src/graphics/Screen.h b/src/graphics/Screen.h index 0f100d455..265900131 100644 --- a/src/graphics/Screen.h +++ b/src/graphics/Screen.h @@ -12,7 +12,7 @@ #define getStringCenteredX(s) ((SCREEN_WIDTH - display->getStringWidth(s)) / 2) namespace graphics { -enum notificationTypeEnum { none, text_banner, selection_picker, node_picker, number_picker, text_input }; +enum notificationTypeEnum { none, text_banner, selection_picker, node_picker, number_picker }; struct BannerOverlayOptions { const char *message; @@ -313,8 +313,6 @@ class Screen : public concurrency::OSThread void showNodePicker(const char *message, uint32_t durationMs, std::function bannerCallback); void showNumberPicker(const char *message, uint32_t durationMs, uint8_t digits, std::function bannerCallback); - void showTextInput(const char *header, const char *initialText, uint32_t durationMs, - std::function textCallback); void requestMenu(graphics::menuHandler::screenMenus menuToShow) { diff --git a/src/graphics/VirtualKeyboard.cpp b/src/graphics/VirtualKeyboard.cpp deleted file mode 100644 index 84d5551cb..000000000 --- a/src/graphics/VirtualKeyboard.cpp +++ /dev/null @@ -1,738 +0,0 @@ -#include "VirtualKeyboard.h" -#include "configuration.h" -#include "graphics/Screen.h" -#include "graphics/ScreenFonts.h" -#include "graphics/SharedUIDisplay.h" -#include "main.h" -#include -#include - -namespace graphics -{ - -VirtualKeyboard::VirtualKeyboard() : cursorRow(0), cursorCol(0), lastActivityTime(millis()) -{ - initializeKeyboard(); - // Set cursor to H(2, 5) - cursorRow = 2; - cursorCol = 5; -} - -VirtualKeyboard::~VirtualKeyboard() {} - -void VirtualKeyboard::initializeKeyboard() -{ - // New 4 row, 11 column keyboard layout: - static const char LAYOUT[KEYBOARD_ROWS][KEYBOARD_COLS] = {{'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '\b'}, - {'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '\n'}, - {'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', ' '}, - {'z', 'x', 'c', 'v', 'b', 'n', 'm', '.', ',', '?', '\x1b'}}; - - // Derive layout dimensions and assert they match the configured keyboard grid - constexpr int LAYOUT_ROWS = (int)(sizeof(LAYOUT) / sizeof(LAYOUT[0])); - constexpr int LAYOUT_COLS = (int)(sizeof(LAYOUT[0]) / sizeof(LAYOUT[0][0])); - static_assert(LAYOUT_ROWS == KEYBOARD_ROWS, "LAYOUT rows must equal KEYBOARD_ROWS"); - static_assert(LAYOUT_COLS == KEYBOARD_COLS, "LAYOUT cols must equal KEYBOARD_COLS"); - - // Initialize all keys to empty first - for (int row = 0; row < LAYOUT_ROWS; row++) { - for (int col = 0; col < LAYOUT_COLS; col++) { - keyboard[row][col] = {0, VK_CHAR, 0, 0, 0, 0}; - } - } - - // Fill keyboard from the 2D layout - for (int row = 0; row < LAYOUT_ROWS; row++) { - for (int col = 0; col < LAYOUT_COLS; col++) { - char ch = LAYOUT[row][col]; - // No empty slots in the simplified layout - - VirtualKeyType type = VK_CHAR; - if (ch == '\b') { - type = VK_BACKSPACE; - } else if (ch == '\n') { - type = VK_ENTER; - } else if (ch == '\x1b') { // ESC - type = VK_ESC; - } else if (ch == ' ') { - type = VK_SPACE; - } - - // Make action keys wider to fit text while keeping the last column aligned - uint8_t width = (type == VK_BACKSPACE || type == VK_ENTER || type == VK_SPACE) ? (KEY_WIDTH * 3) : KEY_WIDTH; - keyboard[row][col] = {ch, type, (uint8_t)(col * KEY_WIDTH), (uint8_t)(row * KEY_HEIGHT), width, KEY_HEIGHT}; - } - } -} - -void VirtualKeyboard::draw(OLEDDisplay *display, int16_t offsetX, int16_t offsetY) -{ - // Repeat ticking is driven by NotificationRenderer once per frame - // Base styles - display->setColor(WHITE); - display->setFont(FONT_SMALL); - - // Screen geometry - const int screenW = display->getWidth(); - const int screenH = display->getHeight(); - - // Decide wide-screen mode: if there is comfortable width, allow taller keys and reserve fixed width for last column labels - // Heuristic: if screen width >= 200px (e.g., 240x135), treat as wide - const bool isWide = screenW >= 200; - - // Determine last-column label max width - display->setFont(FONT_SMALL); - const int wENTER = display->getStringWidth("ENTER"); - int lastColLabelW = wENTER; // ENTER is usually the widest - // Smaller padding on very small screens to avoid excessive whitespace - const int lastColPad = (screenW <= 128 ? 2 : 6); - const int reservedLastColW = lastColLabelW + lastColPad; // reserved width for last column keys - - // Always reserve width for the rightmost text column to avoid overlap on small screens - int cellW = 0; - int leftoverW = 0; - { - const int leftCols = KEYBOARD_COLS - 1; // 10 input characters - int usableW = screenW - reservedLastColW; - if (usableW < leftCols) { - // Guard: ensure at least 1px per left cell if labels are extremely wide (unlikely) - usableW = leftCols; - } - cellW = usableW / leftCols; - leftoverW = usableW - cellW * leftCols; // distribute extra pixels over left columns (left to right) - } - - // Dynamic key geometry - int cellH = KEY_HEIGHT; - int keyboardStartY = 0; - if (screenH <= 64) { - const int headerHeight = headerText.empty() ? 0 : (FONT_HEIGHT_SMALL - 2); - const int gapBelowHeader = 0; - const int singleLineBoxHeight = FONT_HEIGHT_SMALL; - const int gapAboveKeyboard = 0; - keyboardStartY = offsetY + headerHeight + gapBelowHeader + singleLineBoxHeight + gapAboveKeyboard; - if (keyboardStartY < 0) - keyboardStartY = 0; - if (keyboardStartY > screenH) - keyboardStartY = screenH; - int keyboardHeight = screenH - keyboardStartY; - cellH = std::max(1, keyboardHeight / KEYBOARD_ROWS); - } else if (isWide) { - // For wide screens (e.g., T114 240x135), prefer square keys: height equals left-column key width. - cellH = std::max((int)KEY_HEIGHT, cellW); - - // Guarantee at least 2 lines of input are visible by reducing cell height minimally if needed. - // Replicate the spacing used in drawInputArea(): headerGap=1, box-to-header gap=1, gap above keyboard=1 - display->setFont(FONT_SMALL); - const int headerHeight = headerText.empty() ? 0 : (FONT_HEIGHT_SMALL + 1); - const int headerToBoxGap = 1; - const int gapAboveKb = 1; - const int minBoxHeightForTwoLines = 2 * FONT_HEIGHT_SMALL + 2; // inner 1px top/bottom - int maxKeyboardHeight = screenH - (offsetY + headerHeight + headerToBoxGap + minBoxHeightForTwoLines + gapAboveKb); - int maxCellHAllowed = maxKeyboardHeight / KEYBOARD_ROWS; - if (maxCellHAllowed < (int)KEY_HEIGHT) - maxCellHAllowed = KEY_HEIGHT; - if (maxCellHAllowed > 0 && cellH > maxCellHAllowed) { - cellH = maxCellHAllowed; - } - // Keyboard placement from bottom for wide screens - int keyboardHeight = KEYBOARD_ROWS * cellH; - keyboardStartY = screenH - keyboardHeight; - if (keyboardStartY < 0) - keyboardStartY = 0; - } else { - // Default (non-wide, non-64px) behavior: use key height heuristic and place at bottom - cellH = KEY_HEIGHT; - int keyboardHeight = KEYBOARD_ROWS * cellH; - keyboardStartY = screenH - keyboardHeight; - if (keyboardStartY < 0) - keyboardStartY = 0; - } - - // Draw input area above keyboard - drawInputArea(display, offsetX, offsetY, keyboardStartY); - - // Precompute per-column x and width with leftover distributed over left columns for even spacing - int colX[KEYBOARD_COLS]; - int colW[KEYBOARD_COLS]; - int runningX = offsetX; - for (int col = 0; col < KEYBOARD_COLS - 1; ++col) { - int wcol = cellW + (col < leftoverW ? 1 : 0); - colX[col] = runningX; - colW[col] = wcol; - runningX += wcol; - } - // Last column - colX[KEYBOARD_COLS - 1] = runningX; - colW[KEYBOARD_COLS - 1] = reservedLastColW; - - // Draw keyboard grid - for (int row = 0; row < KEYBOARD_ROWS; row++) { - for (int col = 0; col < KEYBOARD_COLS; col++) { - const VirtualKey &k = keyboard[row][col]; - if (k.character != 0 || k.type != VK_CHAR) { - const bool isLastCol = (col == KEYBOARD_COLS - 1); - int x = colX[col]; - int w = colW[col]; - int y = offsetY + keyboardStartY + row * cellH; - int h = cellH; - bool selected = (row == cursorRow && col == cursorCol); - drawKey(display, k, selected, x, y, (uint8_t)w, (uint8_t)h, isLastCol); - } - } - } -} - -void VirtualKeyboard::drawInputArea(OLEDDisplay *display, int16_t offsetX, int16_t offsetY, int16_t keyboardStartY) -{ - display->setColor(WHITE); - - const int screenWidth = display->getWidth(); - const int screenHeight = display->getHeight(); - // Use the standard small font metrics for input box sizing (restore original size) - const int inputLineH = FONT_HEIGHT_SMALL; - - // Header uses the standard small (which may be larger on big screens) - display->setFont(FONT_SMALL); - int headerHeight = 0; - if (!headerText.empty()) { - // Draw header and reserve exact font height (plus a tighter gap) to maximize input area - display->drawString(offsetX + 2, offsetY, headerText.c_str()); - if (screenHeight <= 64) { - headerHeight = FONT_HEIGHT_SMALL - 2; // 11px - } else { - headerHeight = FONT_HEIGHT_SMALL; // no extra padding baked in - } - } - - const int boxX = offsetX; - const int boxWidth = screenWidth; - int boxY; - int boxHeight; - if (screenHeight <= 64) { - const int gapBelowHeader = 0; - const int fixedBoxHeight = inputLineH; - const int gapAboveKeyboard = 0; - boxY = offsetY + headerHeight + gapBelowHeader; - boxHeight = fixedBoxHeight; - if (boxY + boxHeight + gapAboveKeyboard > keyboardStartY) { - int over = boxY + boxHeight + gapAboveKeyboard - keyboardStartY; - boxHeight = std::max(1, fixedBoxHeight - over); - } - } else { - const int gapBelowHeader = 1; - int gapAboveKeyboard = 1; - int tmpBoxY = offsetY + headerHeight + gapBelowHeader; - const int minBoxHeight = inputLineH + 2; - int availableH = keyboardStartY - tmpBoxY - gapAboveKeyboard; - if (availableH < minBoxHeight) - availableH = minBoxHeight; - boxY = tmpBoxY; - boxHeight = availableH; - } - - // Draw box border - display->drawRect(boxX, boxY, boxWidth, boxHeight); - - display->setFont(FONT_SMALL); - - // Text rendering: multi-line if space allows (>= 2 lines), else single-line with leading ellipsis - const int textX = boxX + 2; - const int maxTextWidth = boxWidth - 4; - const int maxLines = (boxHeight - 2) / inputLineH; - if (maxLines >= 2) { - // Inner bounds for caret clamping - const int innerLeft = boxX + 1; - const int innerRight = boxX + boxWidth - 2; - const int innerTop = boxY + 1; - const int innerBottom = boxY + boxHeight - 2; - - // Wrap text greedily into lines that fit maxTextWidth - std::vector lines; - { - std::string remaining = inputText; - while (!remaining.empty()) { - int bestLen = 0; - for (int len = 1; len <= (int)remaining.size(); ++len) { - int w = display->getStringWidth(remaining.substr(0, len).c_str()); - if (w <= maxTextWidth) - bestLen = len; - else - break; - } - if (bestLen == 0) { - // At least show one character to make progress - bestLen = 1; - } - lines.emplace_back(remaining.substr(0, bestLen)); - remaining.erase(0, bestLen); - } - } - - const bool scrolledUp = ((int)lines.size() > maxLines); - int caretX = textX; - int caretY = innerTop; - - // Leave a small top gap to render '...' without replacing the first line - const int topInset = 2; - const int lineStep = std::max(1, inputLineH - 1); // slightly tighter than font height - int lineY = innerTop + topInset; - - if (scrolledUp) { - // Draw three small dots centered horizontally, vertically at the midpoint of the gap - // between the inner top and the first line's top baseline. This avoids using a tall glyph. - const int firstLineTop = lineY; // baseline top for the first visible line - const int gapMidY = innerTop + (firstLineTop - innerTop) / 2 + 1; // shift down 1px as requested - const int centerX = boxX + boxWidth / 2; - const int dotSpacing = 3; // px between dots - const int dotSize = 1; // small square dot - display->fillRect(centerX - dotSpacing, gapMidY, dotSize, dotSize); - display->fillRect(centerX, gapMidY, dotSize, dotSize); - display->fillRect(centerX + dotSpacing, gapMidY, dotSize, dotSize); - } - - // How many lines fit with our top inset and tighter step - const int linesCapacity = std::max(1, (innerBottom - lineY + 1) / lineStep); - const int linesToShow = std::min((int)lines.size(), linesCapacity); - const int startIndex = scrolledUp ? ((int)lines.size() - linesToShow) : 0; - - for (int i = 0; i < linesToShow; ++i) { - const std::string &chunk = lines[startIndex + i]; - display->drawString(textX, lineY, chunk.c_str()); - caretX = textX + display->getStringWidth(chunk.c_str()); - caretY = lineY; - lineY += lineStep; - } - - // Draw caret at end of the last visible line - int caretPadY = 2; - if (boxHeight >= inputLineH + 4) - caretPadY = 3; - int cursorTop = caretY + caretPadY; - // Use lineStep so caret height matches the row spacing - int cursorH = lineStep - caretPadY * 2; - if (cursorH < 1) - cursorH = 1; - // Clamp vertical bounds to stay inside the inner rect - if (cursorTop < innerTop) - cursorTop = innerTop; - if (cursorTop + cursorH - 1 > innerBottom) - cursorH = innerBottom - cursorTop + 1; - if (cursorH < 1) - cursorH = 1; - // Only draw if cursor is inside inner bounds - if (caretX >= innerLeft && caretX <= innerRight) { - display->drawVerticalLine(caretX, cursorTop, cursorH); - } - } else { - std::string displayText = inputText; - int textW = display->getStringWidth(displayText.c_str()); - std::string scrolled = displayText; - if (textW > maxTextWidth) { - // Trim from the left until it fits - while (textW > maxTextWidth && !scrolled.empty()) { - scrolled.erase(0, 1); - textW = display->getStringWidth(scrolled.c_str()); - } - // Add leading ellipsis and ensure it still fits - if (scrolled != displayText) { - scrolled = "..." + scrolled; - textW = display->getStringWidth(scrolled.c_str()); - // If adding ellipsis causes overflow, trim more after the ellipsis - while (textW > maxTextWidth && scrolled.size() > 3) { - scrolled.erase(3, 1); // remove chars after the ellipsis - textW = display->getStringWidth(scrolled.c_str()); - } - } - } else { - // Keep textW in sync with what we draw - textW = display->getStringWidth(scrolled.c_str()); - } - - int textY; - if (screenHeight <= 64) { - textY = boxY + (boxHeight - inputLineH) / 2; - } else { - const int innerLeft = boxX + 1; - const int innerRight = boxX + boxWidth - 2; - const int innerTop = boxY + 1; - const int innerBottom = boxY + boxHeight - 2; - - // Center text vertically within inner box for single-line, then clamp so it never overlaps borders - int innerH = innerBottom - innerTop + 1; - textY = innerTop + std::max(0, (innerH - inputLineH) / 2); - // Clamp fully inside the inner rect - if (textY < innerTop) - textY = innerTop; - int maxTop = innerBottom - inputLineH + 1; - if (textY > maxTop) - textY = maxTop; - } - - if (!scrolled.empty()) { - display->drawString(textX, textY, scrolled.c_str()); - } - - int cursorX = textX + textW; - if (screenHeight > 64) { - const int innerRight = boxX + boxWidth - 2; - if (cursorX > innerRight) - cursorX = innerRight; - } - - int cursorTop, cursorH; - if (screenHeight <= 64) { - cursorH = 10; - cursorTop = boxY + (boxHeight - cursorH) / 2; - } else { - const int innerLeft = boxX + 1; - const int innerRight = boxX + boxWidth - 2; - const int innerTop = boxY + 1; - const int innerBottom = boxY + boxHeight - 2; - - cursorTop = boxY + 2; - cursorH = boxHeight - 4; - if (cursorH < 1) - cursorH = 1; - if (cursorTop < innerTop) - cursorTop = innerTop; - if (cursorTop + cursorH - 1 > innerBottom) - cursorH = innerBottom - cursorTop + 1; - if (cursorH < 1) - cursorH = 1; - - if (cursorX < innerLeft || cursorX > innerRight) - return; - } - - display->drawVerticalLine(cursorX, cursorTop, cursorH); - } -} - -void VirtualKeyboard::drawKey(OLEDDisplay *display, const VirtualKey &key, bool selected, int16_t x, int16_t y, uint8_t width, - uint8_t height, bool isLastCol) -{ - // Draw key content - display->setFont(FONT_SMALL); - const int fontH = FONT_HEIGHT_SMALL; - // Build label and metrics first - std::string keyText; - if (key.type == VK_BACKSPACE || key.type == VK_ENTER || key.type == VK_SPACE || key.type == VK_ESC) { - // Keep literal text labels for the action keys on the rightmost column - keyText = (key.type == VK_BACKSPACE) ? "BACK" - : (key.type == VK_ENTER) ? "ENTER" - : (key.type == VK_SPACE) ? "SPACE" - : (key.type == VK_ESC) ? "ESC" - : ""; - } else { - char c = getCharForKey(key, false); - if (c >= 'a' && c <= 'z') { - c = c - 'a' + 'A'; - } - keyText = (key.character == ' ' || key.character == '_') ? "_" : std::string(1, c); - } - - int textWidth = display->getStringWidth(keyText.c_str()); - // Label alignment - // - Rightmost action column: right-align text with a small right padding (~2px) so it hugs screen edge neatly. - // - Other keys: center horizontally; use ceil-style rounding to avoid appearing left-biased on odd widths. - int textX; - if (isLastCol) { - const int rightPad = 1; - textX = x + width - textWidth - rightPad; - if (textX < x) - textX = x; // guard - } else { - if (display->getHeight() <= 64 && (key.character >= '0' && key.character <= '9')) { - textX = x + (width - textWidth + 1) / 2; - } else { - textX = x + (width - textWidth) / 2; - } - } - int contentTop = y; - int contentH = height; - if (selected) { - display->setColor(WHITE); - bool isAction = (key.type == VK_BACKSPACE || key.type == VK_ENTER || key.type == VK_SPACE || key.type == VK_ESC); - - if (display->getHeight() <= 64 && !isAction) { - display->fillRect(x, y, width, height); - } else if (isAction) { - const int padX = 1; - const int padY = 2; - int hlW = textWidth + padX * 2; - int hlX = textX - padX; - - if (hlX < x) { - hlW -= (x - hlX); - hlX = x; - } - int maxW = (x + width) - hlX; - if (hlW > maxW) - hlW = maxW; - if (hlW < 1) - hlW = 1; - - int hlH = std::min(fontH + padY * 2, (int)height); - int hlY = y + (height - hlH) / 2; - display->fillRect(hlX, hlY, hlW, hlH); - contentTop = hlY; - contentH = hlH; - } else { - display->fillRect(x, y, width, height); - } - display->setColor(BLACK); - } else { - display->setColor(WHITE); - } - - int centeredTextY; - if (display->getHeight() <= 64) { - centeredTextY = y + (height - fontH) / 2; - } else { - centeredTextY = contentTop + (contentH - fontH) / 2; - } - if (display->getHeight() > 64) { - if (centeredTextY < contentTop) - centeredTextY = contentTop; - if (centeredTextY + fontH > contentTop + contentH) - centeredTextY = std::max(contentTop, contentTop + contentH - fontH); - } - - if (display->getHeight() <= 64 && keyText.size() == 1) { - char ch = keyText[0]; - if (ch == '.' || ch == ',' || ch == ';') { - centeredTextY -= 1; - } - } - display->drawString(textX, centeredTextY, keyText.c_str()); -} - -char VirtualKeyboard::getCharForKey(const VirtualKey &key, bool isLongPress) -{ - if (key.type != VK_CHAR) { - return key.character; - } - - char c = key.character; - - // Long-press: only keep letter lowercase->uppercase conversion; remove other symbol mappings - if (isLongPress && c >= 'a' && c <= 'z') { - c = (char)(c - 'a' + 'A'); - } - - return c; -} - -void VirtualKeyboard::moveCursorDelta(int dRow, int dCol) -{ - resetTimeout(); - // wrap around rows and cols in the 4x11 grid - int r = (int)cursorRow + dRow; - int c = (int)cursorCol + dCol; - if (r < 0) - r = KEYBOARD_ROWS - 1; - else if (r >= KEYBOARD_ROWS) - r = 0; - if (c < 0) - c = KEYBOARD_COLS - 1; - else if (c >= KEYBOARD_COLS) - c = 0; - cursorRow = (uint8_t)r; - cursorCol = (uint8_t)c; -} - -void VirtualKeyboard::moveCursorUp() -{ - moveCursorDelta(-1, 0); -} -void VirtualKeyboard::moveCursorDown() -{ - moveCursorDelta(1, 0); -} -void VirtualKeyboard::moveCursorLeft() -{ - resetTimeout(); - - if (cursorCol > 0) { - cursorCol--; - } else { - if (cursorRow > 0) { - cursorRow--; - cursorCol = KEYBOARD_COLS - 1; - } else { - cursorRow = KEYBOARD_ROWS - 1; - cursorCol = KEYBOARD_COLS - 1; - } - } -} -void VirtualKeyboard::moveCursorRight() -{ - resetTimeout(); - - if (cursorCol < KEYBOARD_COLS - 1) { - cursorCol++; - } else { - if (cursorRow < KEYBOARD_ROWS - 1) { - cursorRow++; - cursorCol = 0; - } else { - cursorRow = 0; - cursorCol = 0; - } - } -} - -void VirtualKeyboard::handlePress() -{ - resetTimeout(); // Reset timeout on any input activity - - const VirtualKey &key = keyboard[cursorRow][cursorCol]; - - // Don't handle press if the key is empty (but allow special keys) - if (key.character == 0 && key.type == VK_CHAR) { - return; - } - - // For character keys, insert lowercase character - if (key.type == VK_CHAR) { - insertCharacter(getCharForKey(key, false)); // false = lowercase/normal char - return; - } - - // Handle non-character keys immediately - switch (key.type) { - case VK_BACKSPACE: - deleteCharacter(); - break; - case VK_ENTER: - submitText(); - break; - case VK_SPACE: - insertCharacter(' '); - break; - case VK_ESC: - if (onTextEntered) { - std::function callback = onTextEntered; - onTextEntered = nullptr; - inputText = ""; - callback(""); - } - return; - default: - break; - } -} - -void VirtualKeyboard::handleLongPress() -{ - resetTimeout(); // Reset timeout on any input activity - - const VirtualKey &key = keyboard[cursorRow][cursorCol]; - - // Don't handle press if the key is empty (but allow special keys) - if (key.character == 0 && key.type == VK_CHAR) { - return; - } - - // For character keys, insert uppercase/alternate character - if (key.type == VK_CHAR) { - insertCharacter(getCharForKey(key, true)); // true = uppercase/alternate char - return; - } - - switch (key.type) { - case VK_BACKSPACE: - // One-shot: delete up to 5 characters on long press - for (int i = 0; i < 5; ++i) { - if (inputText.empty()) - break; - deleteCharacter(); - } - break; - case VK_ENTER: - submitText(); - break; - case VK_SPACE: - insertCharacter(' '); - break; - case VK_ESC: - if (onTextEntered) { - onTextEntered(""); - } - break; - default: - break; - } -} - -void VirtualKeyboard::insertCharacter(char c) -{ - if (inputText.length() < 160) { // Reasonable text length limit - inputText += c; - } -} - -void VirtualKeyboard::deleteCharacter() -{ - if (!inputText.empty()) { - inputText.pop_back(); - } -} - -void VirtualKeyboard::submitText() -{ - LOG_INFO("Virtual keyboard: submitting text '%s'", inputText.c_str()); - - // Only submit if text is not empty - if (!inputText.empty() && onTextEntered) { - // Store callback and text to submit before clearing callback - std::function callback = onTextEntered; - std::string textToSubmit = inputText; - onTextEntered = nullptr; - // Don't clear inputText here - let the calling module handle cleanup - // inputText = ""; // Removed: keep text visible until module cleans up - callback(textToSubmit); - } else if (inputText.empty()) { - // For empty text, just ignore the submission - don't clear callback - // This keeps the virtual keyboard responsive for further input - LOG_INFO("Virtual keyboard: empty text submitted, ignoring - keyboard remains active"); - } else { - // No callback available - if (screen) { - screen->setFrames(graphics::Screen::FOCUS_PRESERVE); - } - } -} - -void VirtualKeyboard::setInputText(const std::string &text) -{ - inputText = text; -} - -std::string VirtualKeyboard::getInputText() const -{ - return inputText; -} - -void VirtualKeyboard::setHeader(const std::string &header) -{ - headerText = header; -} - -void VirtualKeyboard::setCallback(std::function callback) -{ - onTextEntered = callback; -} - -void VirtualKeyboard::resetTimeout() -{ - lastActivityTime = millis(); -} - -bool VirtualKeyboard::isTimedOut() const -{ - return (millis() - lastActivityTime) > TIMEOUT_MS; -} - -} // namespace graphics diff --git a/src/graphics/VirtualKeyboard.h b/src/graphics/VirtualKeyboard.h deleted file mode 100644 index 169163b57..000000000 --- a/src/graphics/VirtualKeyboard.h +++ /dev/null @@ -1,80 +0,0 @@ -#pragma once - -#include "configuration.h" -#include -#include -#include - -namespace graphics -{ - -enum VirtualKeyType { VK_CHAR, VK_BACKSPACE, VK_ENTER, VK_SHIFT, VK_ESC, VK_SPACE }; - -struct VirtualKey { - char character; - VirtualKeyType type; - uint8_t x; - uint8_t y; - uint8_t width; - uint8_t height; -}; - -class VirtualKeyboard -{ - public: - VirtualKeyboard(); - ~VirtualKeyboard(); - - void draw(OLEDDisplay *display, int16_t offsetX, int16_t offsetY); - void setInputText(const std::string &text); - std::string getInputText() const; - void setHeader(const std::string &header); - void setCallback(std::function callback); - - // Navigation methods for encoder input - void moveCursorUp(); - void moveCursorDown(); - void moveCursorLeft(); - void moveCursorRight(); - void handlePress(); - void handleLongPress(); - - // Timeout management - void resetTimeout(); - bool isTimedOut() const; - - private: - static const uint8_t KEYBOARD_ROWS = 4; - static const uint8_t KEYBOARD_COLS = 11; - static const uint8_t KEY_WIDTH = 9; - static const uint8_t KEY_HEIGHT = 9; // Compressed to fit 4 rows on 64px displays - static const uint8_t KEYBOARD_START_Y = 26; // Start just below input box bottom - - VirtualKey keyboard[KEYBOARD_ROWS][KEYBOARD_COLS]; - - std::string inputText; - std::string headerText; - std::function onTextEntered; - - uint8_t cursorRow; - uint8_t cursorCol; - - // Timeout management for auto-exit - uint32_t lastActivityTime; - static const uint32_t TIMEOUT_MS = 60000; // 1 minute timeout - - void initializeKeyboard(); - void drawKey(OLEDDisplay *display, const VirtualKey &key, bool selected, int16_t x, int16_t y, uint8_t w, uint8_t h, - bool isLastCol); - void drawInputArea(OLEDDisplay *display, int16_t offsetX, int16_t offsetY, int16_t keyboardStartY); - - // Unified cursor movement helper - void moveCursorDelta(int dRow, int dCol); - - char getCharForKey(const VirtualKey &key, bool isLongPress = false); - void insertCharacter(char c); - void deleteCharacter(); - void submitText(); -}; - -} // namespace graphics diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index e02948864..512f650ec 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -10,10 +10,7 @@ #include "graphics/Screen.h" #include "graphics/SharedUIDisplay.h" #include "graphics/draw/UIRenderer.h" -#include "input/RotaryEncoderInterruptImpl1.h" -#include "input/UpDownInterruptImpl1.h" #include "main.h" -#include "mesh/MeshTypes.h" #include "modules/AdminModule.h" #include "modules/CannedMessageModule.h" #include "modules/KeyVerificationModule.h" diff --git a/src/graphics/draw/NotificationRenderer.cpp b/src/graphics/draw/NotificationRenderer.cpp index 221d95075..3d635e588 100644 --- a/src/graphics/draw/NotificationRenderer.cpp +++ b/src/graphics/draw/NotificationRenderer.cpp @@ -38,8 +38,6 @@ bool NotificationRenderer::pauseBanner = false; notificationTypeEnum NotificationRenderer::current_notification_type = notificationTypeEnum::none; uint32_t NotificationRenderer::numDigits = 0; uint32_t NotificationRenderer::currentNumber = 0; -VirtualKeyboard *NotificationRenderer::virtualKeyboard = nullptr; -std::function NotificationRenderer::textInputCallback = nullptr; uint32_t pow_of_10(uint32_t n) { @@ -91,33 +89,14 @@ void NotificationRenderer::resetBanner() void NotificationRenderer::drawBannercallback(OLEDDisplay *display, OLEDDisplayUiState *state) { - // Handle text_input notifications first - they have their own timeout/banner logic - if (current_notification_type == notificationTypeEnum::text_input) { - // Check for timeout and reset if needed for text input - if (millis() > alertBannerUntil && alertBannerUntil > 0) { - resetBanner(); - return; - } - drawTextInput(display, state); - return; - } - - if (millis() > alertBannerUntil && alertBannerUntil > 0) { + if (!isOverlayBannerShowing() && alertBannerMessage[0] != '\0') resetBanner(); - } - - // Exit if no banner is showing or banner is paused - if (!isOverlayBannerShowing() || pauseBanner) { + if (!isOverlayBannerShowing() || pauseBanner) return; - } - switch (current_notification_type) { case notificationTypeEnum::none: // Do nothing - no notification to display break; - case notificationTypeEnum::text_input: - // Already handled above with dedicated logic (early return). Keep a case here to satisfy -Wswitch. - break; case notificationTypeEnum::text_banner: case notificationTypeEnum::selection_picker: drawAlertBannerOverlay(display, state); @@ -596,90 +575,6 @@ void NotificationRenderer::drawFrameFirmware(OLEDDisplay *display, OLEDDisplayUi "Please be patient and do not power off."); } -void NotificationRenderer::drawTextInput(OLEDDisplay *display, OLEDDisplayUiState *state) -{ - if (virtualKeyboard) { - // Check for timeout and auto-exit if needed - if (virtualKeyboard->isTimedOut()) { - LOG_INFO("Virtual keyboard timeout - auto-exiting"); - // Cancel virtual keyboard - call callback with empty string to indicate timeout - auto callback = textInputCallback; // Store callback before clearing - - // Clean up first to prevent re-entry - delete virtualKeyboard; - virtualKeyboard = nullptr; - textInputCallback = nullptr; - resetBanner(); - - // Call callback after cleanup - if (callback) { - callback(""); - } - - // Restore normal overlays - if (screen) { - screen->setFrames(graphics::Screen::FOCUS_PRESERVE); - } - return; - } - - // Handle input events for virtual keyboard navigation - if (inEvent.inputEvent != INPUT_BROKER_NONE) { - if (inEvent.inputEvent == INPUT_BROKER_UP) { - virtualKeyboard->moveCursorUp(); - } else if (inEvent.inputEvent == INPUT_BROKER_DOWN) { - virtualKeyboard->moveCursorDown(); - } else if (inEvent.inputEvent == INPUT_BROKER_LEFT) { - virtualKeyboard->moveCursorLeft(); - } else if (inEvent.inputEvent == INPUT_BROKER_RIGHT) { - virtualKeyboard->moveCursorRight(); - } else if (inEvent.inputEvent == INPUT_BROKER_ALT_PRESS) { - // Long press UP = move left - virtualKeyboard->moveCursorLeft(); - } else if (inEvent.inputEvent == INPUT_BROKER_USER_PRESS) { - // Long press DOWN = move right - virtualKeyboard->moveCursorRight(); - } else if (inEvent.inputEvent == INPUT_BROKER_SELECT) { - virtualKeyboard->handlePress(); - } else if (inEvent.inputEvent == INPUT_BROKER_SELECT_LONG) { - virtualKeyboard->handleLongPress(); - } else if (inEvent.inputEvent == INPUT_BROKER_CANCEL) { - // Cancel virtual keyboard - call callback with empty string - auto callback = textInputCallback; // Store callback before clearing - - // Clean up first to prevent re-entry - delete virtualKeyboard; - virtualKeyboard = nullptr; - textInputCallback = nullptr; - resetBanner(); - - // Call callback after cleanup - if (callback) { - callback(""); - } - - // Restore normal overlays - if (screen) { - screen->setFrames(graphics::Screen::FOCUS_PRESERVE); - } - return; - } - - // Reset input event after processing - inEvent.inputEvent = INPUT_BROKER_NONE; - } - - // Clear the display and draw virtual keyboard - display->setColor(BLACK); - display->fillRect(0, 0, display->getWidth(), display->getHeight()); - display->setColor(WHITE); - virtualKeyboard->draw(display, 0, 0); - } else { - // If virtualKeyboard is null, reset the banner to avoid getting stuck - resetBanner(); - } -} - bool NotificationRenderer::isOverlayBannerShowing() { return strlen(alertBannerMessage) > 0 && (alertBannerUntil == 0 || millis() <= alertBannerUntil); diff --git a/src/graphics/draw/NotificationRenderer.h b/src/graphics/draw/NotificationRenderer.h index edb069513..9c30b329c 100644 --- a/src/graphics/draw/NotificationRenderer.h +++ b/src/graphics/draw/NotificationRenderer.h @@ -3,9 +3,6 @@ #include "OLEDDisplay.h" #include "OLEDDisplayUi.h" #include "graphics/Screen.h" -#include "graphics/VirtualKeyboard.h" -#include -#include #define MAX_LINES 5 namespace graphics @@ -25,8 +22,6 @@ class NotificationRenderer static std::function alertBannerCallback; static uint32_t numDigits; static uint32_t currentNumber; - static VirtualKeyboard *virtualKeyboard; - static std::function textInputCallback; static bool pauseBanner; @@ -35,7 +30,6 @@ class NotificationRenderer static void drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisplayUiState *state); static void drawNumberPicker(OLEDDisplay *display, OLEDDisplayUiState *state); static void drawNodePicker(OLEDDisplay *display, OLEDDisplayUiState *state); - static void drawTextInput(OLEDDisplay *display, OLEDDisplayUiState *state); static void drawNotificationBox(OLEDDisplay *display, OLEDDisplayUiState *state, const char *lines[MAX_LINES + 1], uint16_t totalLines, uint8_t firstOptionToShow, uint16_t maxWidth = 0); diff --git a/src/input/InputBroker.h b/src/input/InputBroker.h index 012a403f5..4487fa662 100644 --- a/src/input/InputBroker.h +++ b/src/input/InputBroker.h @@ -4,7 +4,6 @@ enum input_broker_event { INPUT_BROKER_NONE = 0, INPUT_BROKER_SELECT = 10, - INPUT_BROKER_SELECT_LONG, INPUT_BROKER_UP = 17, INPUT_BROKER_DOWN = 18, INPUT_BROKER_LEFT = 19, diff --git a/src/input/TrackballInterruptBase.cpp b/src/input/TrackballInterruptBase.cpp index 4c8ce6409..d41ad2fd6 100644 --- a/src/input/TrackballInterruptBase.cpp +++ b/src/input/TrackballInterruptBase.cpp @@ -1,14 +1,12 @@ #include "TrackballInterruptBase.h" #include "configuration.h" -extern bool osk_found; TrackballInterruptBase::TrackballInterruptBase(const char *name) : concurrency::OSThread(name), _originName(name) {} void TrackballInterruptBase::init(uint8_t pinDown, uint8_t pinUp, uint8_t pinLeft, uint8_t pinRight, uint8_t pinPress, input_broker_event eventDown, input_broker_event eventUp, input_broker_event eventLeft, - input_broker_event eventRight, input_broker_event eventPressed, - input_broker_event eventPressedLong, void (*onIntDown)(), void (*onIntUp)(), - void (*onIntLeft)(), void (*onIntRight)(), void (*onIntPress)()) + input_broker_event eventRight, input_broker_event eventPressed, void (*onIntDown)(), + void (*onIntUp)(), void (*onIntLeft)(), void (*onIntRight)(), void (*onIntPress)()) { this->_pinDown = pinDown; this->_pinUp = pinUp; @@ -20,7 +18,6 @@ void TrackballInterruptBase::init(uint8_t pinDown, uint8_t pinUp, uint8_t pinLef this->_eventLeft = eventLeft; this->_eventRight = eventRight; this->_eventPressed = eventPressed; - this->_eventPressedLong = eventPressedLong; if (pinPress != 255) { pinMode(pinPress, INPUT_PULLUP); @@ -43,9 +40,9 @@ void TrackballInterruptBase::init(uint8_t pinDown, uint8_t pinUp, uint8_t pinLef attachInterrupt(this->_pinRight, onIntRight, TB_DIRECTION); } - LOG_DEBUG("Trackball GPIO initialized - UP:%d DOWN:%d LEFT:%d RIGHT:%d PRESS:%d", this->_pinUp, this->_pinDown, - this->_pinLeft, this->_pinRight, pinPress); - osk_found = true; + LOG_DEBUG("Trackball GPIO initialized (%d, %d, %d, %d, %d)", this->_pinUp, this->_pinDown, this->_pinLeft, this->_pinRight, + pinPress); + this->setInterval(100); } @@ -53,47 +50,10 @@ int32_t TrackballInterruptBase::runOnce() { InputEvent e; e.inputEvent = INPUT_BROKER_NONE; - - // Handle long press detection for press button - if (pressDetected && pressStartTime > 0) { - uint32_t pressDuration = millis() - pressStartTime; - bool buttonStillPressed = false; - -#if defined(T_DECK) - buttonStillPressed = (this->action == TB_ACTION_PRESSED); -#else - buttonStillPressed = !digitalRead(_pinPress); -#endif - - if (!buttonStillPressed) { - // Button released - if (pressDuration < LONG_PRESS_DURATION) { - // Short press - e.inputEvent = this->_eventPressed; - } - // Reset state - pressDetected = false; - pressStartTime = 0; - lastLongPressEventTime = 0; - this->action = TB_ACTION_NONE; - } else if (pressDuration >= LONG_PRESS_DURATION) { - // Long press detected - uint32_t currentTime = millis(); - // Only trigger long press event if enough time has passed since the last one - if (lastLongPressEventTime == 0 || (currentTime - lastLongPressEventTime) >= LONG_PRESS_REPEAT_INTERVAL) { - e.inputEvent = this->_eventPressedLong; - lastLongPressEventTime = currentTime; - } - this->action = TB_ACTION_PRESSED_LONG; - } - } - #if defined(T_DECK) // T-deck gets a super-simple debounce on trackball - if (this->action == TB_ACTION_PRESSED && !pressDetected) { - // Start long press detection - pressDetected = true; - pressStartTime = millis(); - // Don't send event yet, wait to see if it's a long press + if (this->action == TB_ACTION_PRESSED) { + // LOG_DEBUG("Trackball event Press"); + e.inputEvent = this->_eventPressed; } else if (this->action == TB_ACTION_UP && lastEvent == TB_ACTION_UP) { // LOG_DEBUG("Trackball event UP"); e.inputEvent = this->_eventUp; @@ -108,11 +68,9 @@ int32_t TrackballInterruptBase::runOnce() e.inputEvent = this->_eventRight; } #else - if (this->action == TB_ACTION_PRESSED && !digitalRead(_pinPress) && !pressDetected) { - // Start long press detection - pressDetected = true; - pressStartTime = millis(); - // Don't send event yet, wait to see if it's a long press + if (this->action == TB_ACTION_PRESSED && !digitalRead(_pinPress)) { + // LOG_DEBUG("Trackball event Press"); + e.inputEvent = this->_eventPressed; } else if (this->action == TB_ACTION_UP && !digitalRead(_pinUp)) { // LOG_DEBUG("Trackball event UP"); e.inputEvent = this->_eventUp; @@ -133,16 +91,10 @@ int32_t TrackballInterruptBase::runOnce() e.kbchar = 0x00; this->notifyObservers(&e); } + lastEvent = action; + this->action = TB_ACTION_NONE; - // Only update lastEvent for non-press actions or completed press actions - if (this->action != TB_ACTION_PRESSED || !pressDetected) { - lastEvent = action; - if (!pressDetected) { - this->action = TB_ACTION_NONE; - } - } - - return 50; // Check more frequently for better long press detection + return 100; } void TrackballInterruptBase::intPressHandler() diff --git a/src/input/TrackballInterruptBase.h b/src/input/TrackballInterruptBase.h index 38be22f20..92db8720e 100644 --- a/src/input/TrackballInterruptBase.h +++ b/src/input/TrackballInterruptBase.h @@ -18,8 +18,8 @@ class TrackballInterruptBase : public Observable, public con explicit TrackballInterruptBase(const char *name); void init(uint8_t pinDown, uint8_t pinUp, uint8_t pinLeft, uint8_t pinRight, uint8_t pinPress, input_broker_event eventDown, input_broker_event eventUp, input_broker_event eventLeft, input_broker_event eventRight, - input_broker_event eventPressed, input_broker_event eventPressedLong, void (*onIntDown)(), void (*onIntUp)(), - void (*onIntLeft)(), void (*onIntRight)(), void (*onIntPress)()); + input_broker_event eventPressed, void (*onIntDown)(), void (*onIntUp)(), void (*onIntLeft)(), void (*onIntRight)(), + void (*onIntPress)()); void intPressHandler(); void intDownHandler(); void intUpHandler(); @@ -33,7 +33,6 @@ class TrackballInterruptBase : public Observable, public con enum TrackballInterruptBaseActionType { TB_ACTION_NONE, TB_ACTION_PRESSED, - TB_ACTION_PRESSED_LONG, TB_ACTION_UP, TB_ACTION_DOWN, TB_ACTION_LEFT, @@ -47,20 +46,12 @@ class TrackballInterruptBase : public Observable, public con volatile TrackballInterruptBaseActionType action = TB_ACTION_NONE; - // Long press detection for press button - uint32_t pressStartTime = 0; - bool pressDetected = false; - uint32_t lastLongPressEventTime = 0; - static const uint32_t LONG_PRESS_DURATION = 500; // ms - static const uint32_t LONG_PRESS_REPEAT_INTERVAL = 500; // ms - interval between repeated long press events - private: input_broker_event _eventDown = INPUT_BROKER_NONE; input_broker_event _eventUp = INPUT_BROKER_NONE; input_broker_event _eventLeft = INPUT_BROKER_NONE; input_broker_event _eventRight = INPUT_BROKER_NONE; input_broker_event _eventPressed = INPUT_BROKER_NONE; - input_broker_event _eventPressedLong = INPUT_BROKER_NONE; const char *_originName; TrackballInterruptBaseActionType lastEvent = TB_ACTION_NONE; }; diff --git a/src/input/TrackballInterruptImpl1.cpp b/src/input/TrackballInterruptImpl1.cpp index 594facdeb..896238f38 100644 --- a/src/input/TrackballInterruptImpl1.cpp +++ b/src/input/TrackballInterruptImpl1.cpp @@ -13,12 +13,11 @@ void TrackballInterruptImpl1::init(uint8_t pinDown, uint8_t pinUp, uint8_t pinLe input_broker_event eventLeft = INPUT_BROKER_LEFT; input_broker_event eventRight = INPUT_BROKER_RIGHT; input_broker_event eventPressed = INPUT_BROKER_SELECT; - input_broker_event eventPressedLong = INPUT_BROKER_SELECT_LONG; TrackballInterruptBase::init(pinDown, pinUp, pinLeft, pinRight, pinPress, eventDown, eventUp, eventLeft, eventRight, - eventPressed, eventPressedLong, TrackballInterruptImpl1::handleIntDown, - TrackballInterruptImpl1::handleIntUp, TrackballInterruptImpl1::handleIntLeft, - TrackballInterruptImpl1::handleIntRight, TrackballInterruptImpl1::handleIntPressed); + eventPressed, TrackballInterruptImpl1::handleIntDown, TrackballInterruptImpl1::handleIntUp, + TrackballInterruptImpl1::handleIntLeft, TrackballInterruptImpl1::handleIntRight, + TrackballInterruptImpl1::handleIntPressed); inputBroker->registerSource(this); } diff --git a/src/main.cpp b/src/main.cpp index 23ffa6b6d..ef5f5a721 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -191,8 +191,6 @@ ScanI2C::DeviceAddress cardkb_found = ScanI2C::ADDRESS_NONE; uint8_t kb_model; // global bool to record that a kb is present bool kb_found = false; -// global bool to record that on-screen keyboard (OSK) is present -bool osk_found = false; // The I2C address of the RTC Module (if found) ScanI2C::DeviceAddress rtc_found = ScanI2C::ADDRESS_NONE; @@ -1414,10 +1412,6 @@ void setup() #endif #endif -#if defined(HAS_TRACKBALL) || (defined(INPUTDRIVER_ENCODER_TYPE) && INPUTDRIVER_ENCODER_TYPE == 2) - osk_found = true; -#endif - #if defined(ARCH_ESP32) && !MESHTASTIC_EXCLUDE_WEBSERVER // Start web server thread. webServerThread = new WebServerThread(); diff --git a/src/main.h b/src/main.h index 2ddd4862f..3568daad2 100644 --- a/src/main.h +++ b/src/main.h @@ -32,7 +32,6 @@ extern ScanI2C::DeviceAddress screen_found; extern ScanI2C::DeviceAddress cardkb_found; extern uint8_t kb_model; extern bool kb_found; -extern bool osk_found; extern ScanI2C::DeviceAddress rtc_found; extern ScanI2C::DeviceAddress accelerometer_found; extern ScanI2C::FoundDevice rgb_found; diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index 76b950322..d40dcd24f 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -13,16 +13,12 @@ #include "detect/ScanI2C.h" #include "graphics/Screen.h" #include "graphics/SharedUIDisplay.h" -#include "graphics/draw/NotificationRenderer.h" #include "graphics/emotes.h" #include "graphics/images.h" #include "main.h" // for cardkb_found #include "mesh/generated/meshtastic/cannedmessages.pb.h" #include "modules/AdminModule.h" #include "modules/ExternalNotificationModule.h" // for buzzer control -#if HAS_TRACKBALL -#include "input/TrackballInterruptImpl1.h" -#endif #if !MESHTASTIC_EXCLUDE_GPS #include "GPS.h" #endif @@ -42,7 +38,6 @@ extern ScanI2C::DeviceAddress cardkb_found; extern bool graphics::isMuted; -extern bool osk_found; static const char *cannedMessagesConfigFile = "/prefs/cannedConf.proto"; static NodeNum lastDest = NODENUM_BROADCAST; @@ -156,13 +151,10 @@ int CannedMessageModule::splitConfiguredMessages() int tempCount = 0; // Insert at position 0 (top) tempMessages[tempCount++] = "[Select Destination]"; + #if defined(USE_VIRTUAL_KEYBOARD) - // Add a "Free Text" entry at the top if using a touch screen virtual keyboard + // Add a "Free Text" entry at the top if using a keyboard tempMessages[tempCount++] = "[-- Free Text --]"; -#else - if (osk_found && screen) { - tempMessages[tempCount++] = "[-- Free Text --]"; - } #endif // First message always starts at buffer start @@ -349,8 +341,6 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event) case CANNED_MESSAGE_RUN_STATE_FREETEXT: return handleFreeTextInput(event); // All allowed input for this state - // Virtual keyboard mode: Show virtual keyboard and handle input - // If sending, block all input except global/system (handled above) case CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE: return 1; @@ -637,56 +627,6 @@ bool CannedMessageModule::handleMessageSelectorInput(const InputEvent *event, bo notifyObservers(&e); return true; } -#else - if (strcmp(current, "[-- Free Text --]") == 0) { - if (osk_found && screen) { - char headerBuffer[64]; - if (this->dest == NODENUM_BROADCAST) { - snprintf(headerBuffer, sizeof(headerBuffer), "To: Broadcast@%s", channels.getName(this->channel)); - } else { - snprintf(headerBuffer, sizeof(headerBuffer), "To: %s", getNodeName(this->dest)); - } - screen->showTextInput(headerBuffer, "", 300000, [this](const std::string &text) { - if (!text.empty()) { - this->freetext = text.c_str(); - this->payload = CANNED_MESSAGE_RUN_STATE_FREETEXT; - runState = CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE; - currentMessageIndex = -1; - - UIFrameEvent e; - e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; - this->notifyObservers(&e); - screen->forceDisplay(); - - setIntervalFromNow(500); - return; - } else { - // Don't delete virtual keyboard immediately - it might still be executing - // Instead, just clear the callback and reset banner to stop input processing - graphics::NotificationRenderer::textInputCallback = nullptr; - graphics::NotificationRenderer::resetBanner(); - - // Return to inactive state - this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; - this->currentMessageIndex = -1; - this->freetext = ""; - this->cursor = 0; - - // Force display update to show normal screen - UIFrameEvent e; - e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; - this->notifyObservers(&e); - screen->forceDisplay(); - - // Schedule cleanup for next loop iteration to ensure safe deletion - setIntervalFromNow(50); - return; - } - }); - - return true; - } - } #endif // Normal canned message selection @@ -1003,54 +943,12 @@ int32_t CannedMessageModule::runOnce() // Normal module disable/idle handling if ((this->runState == CANNED_MESSAGE_RUN_STATE_DISABLED) || (this->runState == CANNED_MESSAGE_RUN_STATE_INACTIVE)) { - // Clean up virtual keyboard if needed when going inactive - if (graphics::NotificationRenderer::virtualKeyboard && graphics::NotificationRenderer::textInputCallback == nullptr) { - LOG_INFO("Performing delayed virtual keyboard cleanup"); - delete graphics::NotificationRenderer::virtualKeyboard; - graphics::NotificationRenderer::virtualKeyboard = nullptr; - } - temporaryMessage = ""; return INT32_MAX; } - // Handle delayed virtual keyboard message sending - if (this->runState == CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE && this->payload == CANNED_MESSAGE_RUN_STATE_FREETEXT) { - // Virtual keyboard message sending case - text was not empty - if (this->freetext.length() > 0) { - LOG_INFO("Processing delayed virtual keyboard send: '%s'", this->freetext.c_str()); - sendText(this->dest, this->channel, this->freetext.c_str(), true); - - // Clean up virtual keyboard after sending - if (graphics::NotificationRenderer::virtualKeyboard) { - LOG_INFO("Cleaning up virtual keyboard after message send"); - delete graphics::NotificationRenderer::virtualKeyboard; - graphics::NotificationRenderer::virtualKeyboard = nullptr; - graphics::NotificationRenderer::textInputCallback = nullptr; - graphics::NotificationRenderer::resetBanner(); - } - - // Clear payload to indicate virtual keyboard processing is complete - // But keep SENDING_ACTIVE state to show "Sending..." screen for 2 seconds - this->payload = 0; - } else { - // Empty message, just go inactive - LOG_INFO("Empty freetext detected in delayed processing, returning to inactive state"); - this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; - } - - UIFrameEvent e; - e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; - this->currentMessageIndex = -1; - this->freetext = ""; - this->cursor = 0; - this->notifyObservers(&e); - return 2000; - } - UIFrameEvent e; - if ((this->runState == CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE && this->payload != 0 && - this->payload != CANNED_MESSAGE_RUN_STATE_FREETEXT) || + if ((this->runState == CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE) || (this->runState == CANNED_MESSAGE_RUN_STATE_ACK_NACK_RECEIVED) || (this->runState == CANNED_MESSAGE_RUN_STATE_MESSAGE_SELECTION)) { this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; @@ -1060,18 +958,6 @@ int32_t CannedMessageModule::runOnce() this->freetext = ""; this->cursor = 0; this->notifyObservers(&e); - } - // Handle SENDING_ACTIVE state transition after virtual keyboard message - else if (this->runState == CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE && this->payload == 0) { - // This happens after virtual keyboard message sending is complete - LOG_INFO("Virtual keyboard message sending completed, returning to inactive state"); - this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; - temporaryMessage = ""; - e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; - this->currentMessageIndex = -1; - this->freetext = ""; - this->cursor = 0; - this->notifyObservers(&e); } else if (((this->runState == CANNED_MESSAGE_RUN_STATE_ACTIVE) || (this->runState == CANNED_MESSAGE_RUN_STATE_FREETEXT)) && !Throttle::isWithinTimespanMs(this->lastTouchMillis, INACTIVATE_AFTER_MS)) { // Reset module on inactivity @@ -1080,23 +966,9 @@ int32_t CannedMessageModule::runOnce() this->freetext = ""; this->cursor = 0; this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; - - // Clean up virtual keyboard if it exists during timeout - if (graphics::NotificationRenderer::virtualKeyboard) { - LOG_INFO("Cleaning up virtual keyboard due to module timeout"); - delete graphics::NotificationRenderer::virtualKeyboard; - graphics::NotificationRenderer::virtualKeyboard = nullptr; - graphics::NotificationRenderer::textInputCallback = nullptr; - graphics::NotificationRenderer::resetBanner(); - } - this->notifyObservers(&e); } else if (this->runState == CANNED_MESSAGE_RUN_STATE_ACTION_SELECT) { - if (this->payload == 0) { - // [Exit] button pressed - return to inactive state - LOG_INFO("Processing [Exit] action - returning to inactive state"); - this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; - } else if (this->payload == CANNED_MESSAGE_RUN_STATE_FREETEXT) { + if (this->payload == CANNED_MESSAGE_RUN_STATE_FREETEXT) { if (this->freetext.length() > 0) { sendText(this->dest, this->channel, this->freetext.c_str(), true); this->runState = CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE; From 8b42bf7a957f5ff8018307ec0dec87c4e2fce286 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 23 Aug 2025 05:47:51 -0500 Subject: [PATCH 155/180] Don't reboot when setting lora config with portduino sim radio (#7716) --- src/modules/AdminModule.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 4014e1c36..4c893e462 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -718,6 +718,13 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c) requiresReboot = false; } +#if defined(ARCH_PORTDUINO) + // If running on portduino and using SimRadio, do not require reboot + if (SimRadio::instance) { + requiresReboot = false; + } +#endif + #ifdef RF95_FAN_EN // Turn PA off if disabled by config if (c.payload_variant.lora.pa_fan_disabled) { From 5136c8ba24bccea7de83ad7cc35e69a3a28f5b2b Mon Sep 17 00:00:00 2001 From: Lewis He Date: Sat, 23 Aug 2025 19:46:59 +0800 Subject: [PATCH 156/180] The T-Deck-Pro 4G version sets the modem to be disabled by default. (#7715) Co-authored-by: Ben Meadors --- src/main.cpp | 10 ++++++++++ variants/esp32s3/t-deck-pro/variant.h | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index ef5f5a721..0260cbc07 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -404,6 +404,16 @@ void setup() initDeepSleep(); +#if defined(MODEM_POWER_EN) + pinMode(MODEM_POWER_EN, OUTPUT); + digitalWrite(MODEM_POWER_EN, LOW); +#endif + +#if defined(MODEM_PWRKEY) + pinMode(MODEM_PWRKEY, OUTPUT); + digitalWrite(MODEM_PWRKEY, LOW); +#endif + #if defined(LORA_TCXO_GPIO) pinMode(LORA_TCXO_GPIO, OUTPUT); digitalWrite(LORA_TCXO_GPIO, HIGH); diff --git a/variants/esp32s3/t-deck-pro/variant.h b/variants/esp32s3/t-deck-pro/variant.h index b08d3f65f..abe0a772a 100644 --- a/variants/esp32s3/t-deck-pro/variant.h +++ b/variants/esp32s3/t-deck-pro/variant.h @@ -92,3 +92,12 @@ #define SX126X_DIO3_TCXO_VOLTAGE 2.4 // Internally the TTGO module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for the sx1262interface // code) + +#define MODEM_POWER_EN 41 +#define MODEM_PWRKEY 40 +#define MODEM_RST 9 +#define MODEM_RI 7 +#define MODEM_DTR 8 +#define MODEM_RX 10 +#define MODEM_TX 11 + From 915f882e1f6b741b64f3a4a1ded2445412909b74 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sun, 24 Aug 2025 10:13:18 -0500 Subject: [PATCH 157/180] Pkc fix (#7722) --- src/mesh/Router.cpp | 5 +++-- src/modules/AdminModule.cpp | 28 +++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index cceacfe9e..1f835bca7 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -529,8 +529,9 @@ meshtastic_Routing_Error perhapsEncode(meshtastic_MeshPacket *p) #endif // Don't use PKC with Ham mode !owner.is_licensed && - // Don't use PKC if it's not explicitly requested and a non-primary channel is requested - !(p->pki_encrypted != true && p->channel > 0) && + // Don't use PKC on 'serial' or 'gpio' channels unless explicitly requested + !(p->pki_encrypted != true && (strcasecmp(channels.getName(chIndex), Channels::serialChannel) == 0 || + strcasecmp(channels.getName(chIndex), Channels::gpioChannel) == 0)) && // Check for valid keys and single node destination config.security.private_key.size == 32 && !isBroadcast(p->to) && node != nullptr && // Check for a known public key for the destination diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 4c893e462..9e8ce2e6b 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -505,7 +505,9 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta if (mp.decoded.want_response && !myReply) { myReply = allocErrorResponse(meshtastic_Routing_Error_NONE, &mp); } - + if (mp.pki_encrypted) { + myReply->pki_encrypted = true; + } return handled; } @@ -941,6 +943,9 @@ void AdminModule::handleGetOwner(const meshtastic_MeshPacket &req) res.which_payload_variant = meshtastic_AdminMessage_get_owner_response_tag; setPassKey(&res); myReply = allocDataProtobuf(res); + if (req.pki_encrypted) { + myReply->pki_encrypted = true; + } } } @@ -1012,6 +1017,9 @@ void AdminModule::handleGetConfig(const meshtastic_MeshPacket &req, const uint32 res.which_payload_variant = meshtastic_AdminMessage_get_config_response_tag; setPassKey(&res); myReply = allocDataProtobuf(res); + if (req.pki_encrypted) { + myReply->pki_encrypted = true; + } } } @@ -1099,6 +1107,9 @@ void AdminModule::handleGetModuleConfig(const meshtastic_MeshPacket &req, const res.which_payload_variant = meshtastic_AdminMessage_get_module_config_response_tag; setPassKey(&res); myReply = allocDataProtobuf(res); + if (req.pki_encrypted) { + myReply->pki_encrypted = true; + } } } @@ -1123,6 +1134,9 @@ void AdminModule::handleGetNodeRemoteHardwarePins(const meshtastic_MeshPacket &r } setPassKey(&r); myReply = allocDataProtobuf(r); + if (req.pki_encrypted) { + myReply->pki_encrypted = true; + } } void AdminModule::handleGetDeviceMetadata(const meshtastic_MeshPacket &req) @@ -1132,6 +1146,9 @@ void AdminModule::handleGetDeviceMetadata(const meshtastic_MeshPacket &req) r.which_payload_variant = meshtastic_AdminMessage_get_device_metadata_response_tag; setPassKey(&r); myReply = allocDataProtobuf(r); + if (req.pki_encrypted) { + myReply->pki_encrypted = true; + } } void AdminModule::handleGetDeviceConnectionStatus(const meshtastic_MeshPacket &req) @@ -1200,6 +1217,9 @@ void AdminModule::handleGetDeviceConnectionStatus(const meshtastic_MeshPacket &r r.which_payload_variant = meshtastic_AdminMessage_get_device_connection_status_response_tag; setPassKey(&r); myReply = allocDataProtobuf(r); + if (req.pki_encrypted) { + myReply->pki_encrypted = true; + } } void AdminModule::handleGetChannel(const meshtastic_MeshPacket &req, uint32_t channelIndex) @@ -1211,6 +1231,9 @@ void AdminModule::handleGetChannel(const meshtastic_MeshPacket &req, uint32_t ch r.which_payload_variant = meshtastic_AdminMessage_get_channel_response_tag; setPassKey(&r); myReply = allocDataProtobuf(r); + if (req.pki_encrypted) { + myReply->pki_encrypted = true; + } } } @@ -1220,6 +1243,9 @@ void AdminModule::handleGetDeviceUIConfig(const meshtastic_MeshPacket &req) r.which_payload_variant = meshtastic_AdminMessage_get_ui_config_response_tag; r.get_ui_config_response = uiconfig; myReply = allocDataProtobuf(r); + if (req.pki_encrypted) { + myReply->pki_encrypted = true; + } } void AdminModule::reboot(int32_t seconds) From 3d825c51dd7bd837ea58f2e148c2b63c698e67c6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 24 Aug 2025 14:44:51 -0500 Subject: [PATCH 158/180] Update meshtastic/device-ui digest to 0f32b64 (#7728) 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 cce4d2dcf..543205996 100644 --- a/platformio.ini +++ b/platformio.ini @@ -118,7 +118,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/3dc7cf3e233aaa8cc23492cca50541fc099ebfa1.zip + https://github.com/meshtastic/device-ui/archive/0f32b64dca418c6465763ec576509a6a2bfbc50a.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 1a279c6053f485fdfb606145767124b208fb20a4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 26 Aug 2025 06:31:38 -0500 Subject: [PATCH 159/180] Upgrade trunk (#7677) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> --- .trunk/trunk.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index de38e3ec0..a0dcf2ff5 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -4,19 +4,19 @@ cli: plugins: sources: - id: trunk - ref: v1.7.1 + ref: v1.7.2 uri: https://github.com/trunk-io/plugins lint: enabled: - - checkov@3.2.461 - - renovate@41.74.0 + - checkov@3.2.465 + - renovate@41.82.10 - prettier@3.6.2 - trufflehog@3.90.5 - yamllint@1.37.1 - bandit@1.8.6 - - trivy@0.64.1 - - taplo@0.9.3 - - ruff@0.12.7 + - trivy@0.65.0 + - taplo@0.10.0 + - ruff@0.12.10 - isort@6.0.1 - markdownlint@0.45.0 - oxipng@9.1.5 @@ -25,7 +25,7 @@ lint: - flake8@7.3.0 - hadolint@2.12.1-beta - shfmt@3.6.0 - - shellcheck@0.10.0 + - shellcheck@0.11.0 - black@25.1.0 - git-diff-check - gitleaks@8.28.0 From 3f5c30e3b35c5a8c779ff3542c52cfe7b107c871 Mon Sep 17 00:00:00 2001 From: Manuel <71137295+mverch67@users.noreply.github.com> Date: Tue, 26 Aug 2025 16:35:25 +0200 Subject: [PATCH 160/180] T-Lora Pager (#7613) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * initial commit * preset rotary1 encoder * define TAB+ESC * haptic feedback * allow switch off haptic feedback * enable audio amplifier * include PR4684 * fix for tft target * add ES8311 audio codec * fix KB scan duplicate * display workaround to avoid debris * fix debris on display * keyboard backlight * enable screen options * fsm based bounce-free rotary encoder implementation * use fsm RotaryEncoder only for T-Lora Pager * change inputbroker default config to allow using rotary wheel for screens AND menues --------- Co-authored-by: Thomas Göttgens Co-authored-by: Ben Meadors --- src/detect/ScanI2C.h | 3 +- src/detect/ScanI2CTwoWire.cpp | 10 +- src/graphics/Screen.cpp | 4 +- src/graphics/ScreenFonts.h | 2 +- src/graphics/TFTDisplay.cpp | 199 +++++++++++++-- src/graphics/TFTDisplay.h | 2 + src/graphics/draw/DebugRenderer.cpp | 8 +- src/graphics/draw/MenuHandler.cpp | 10 +- src/graphics/draw/UIRenderer.cpp | 2 +- src/graphics/images.h | 3 +- src/input/RotaryEncoderImpl.cpp | 73 ++++++ src/input/RotaryEncoderImpl.h | 28 +++ src/input/TLoraPagerKeyboard.cpp | 230 ++++++++++++++++++ src/input/TLoraPagerKeyboard.h | 23 +- src/input/cardKbI2cImpl.cpp | 4 +- src/main.cpp | 37 ++- src/main.h | 2 +- src/mesh/NodeDB.cpp | 11 +- src/modules/Modules.cpp | 10 + src/platform/esp32/architecture.h | 2 + .../extra_variants/t_lora_pager/variant.cpp | 27 ++ variants/esp32s3/tlora-pager/pins_arduino.h | 19 ++ variants/esp32s3/tlora-pager/platformio.ini | 70 ++++++ variants/esp32s3/tlora-pager/variant.h | 125 ++++++++++ 24 files changed, 855 insertions(+), 49 deletions(-) create mode 100644 src/input/RotaryEncoderImpl.cpp create mode 100644 src/input/RotaryEncoderImpl.h create mode 100644 src/input/TLoraPagerKeyboard.cpp create mode 100644 src/platform/extra_variants/t_lora_pager/variant.cpp create mode 100644 variants/esp32s3/tlora-pager/pins_arduino.h create mode 100644 variants/esp32s3/tlora-pager/platformio.ini create mode 100644 variants/esp32s3/tlora-pager/variant.h diff --git a/src/detect/ScanI2C.h b/src/detect/ScanI2C.h index c1358861b..e46c6f623 100644 --- a/src/detect/ScanI2C.h +++ b/src/detect/ScanI2C.h @@ -79,7 +79,8 @@ class ScanI2C BQ27220, LTR553ALS, BHI260AP, - BMM150 + BMM150, + DRV2605 } DeviceType; // typedef uint8_t DeviceAddress; diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index 8b3670cd9..9aef9defe 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -483,8 +483,14 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) type = MLX90614; logFoundDevice("MLX90614", (uint8_t)addr.address); } else { - type = MPR121KB; - logFoundDevice("MPR121KB", (uint8_t)addr.address); + registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 1); // DRV2605_REG_STATUS + if (registerValue == 0xe0) { + type = DRV2605; + logFoundDevice("DRV2605", (uint8_t)addr.address); + } else { + type = MPR121KB; + logFoundDevice("MPR121KB", (uint8_t)addr.address); + } } break; diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index fa71e17d8..dea08d5ba 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -318,7 +318,7 @@ Screen::Screen(ScanI2C::DeviceAddress address, meshtastic_Config_DisplayConfig_O dispdev = new SSD1306Wire(address.address, -1, -1, geometry, (address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE); #elif defined(ST7735_CS) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7789_CS) || \ - defined(RAK14014) || defined(HX8357_CS) || defined(ILI9488_CS) + defined(RAK14014) || defined(HX8357_CS) || defined(ILI9488_CS) || defined(ST7796_CS) dispdev = new TFTDisplay(address.address, -1, -1, geometry, (address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE); #elif defined(USE_EINK) && !defined(USE_EINK_DYNAMICDISPLAY) @@ -550,7 +550,7 @@ void Screen::setup() #else if (!config.display.flip_screen) { #if defined(ST7701_CS) || defined(ST7735_CS) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7789_CS) || \ - defined(RAK14014) || defined(HX8357_CS) || defined(ILI9488_CS) + defined(RAK14014) || defined(HX8357_CS) || defined(ILI9488_CS) || defined(ST7796_CS) static_cast(dispdev)->flipScreenVertically(); #elif defined(USE_ST7789) static_cast(dispdev)->flipScreenVertically(); diff --git a/src/graphics/ScreenFonts.h b/src/graphics/ScreenFonts.h index 84ec45977..a25417b05 100644 --- a/src/graphics/ScreenFonts.h +++ b/src/graphics/ScreenFonts.h @@ -73,7 +73,7 @@ #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(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS) || defined(ILI9488_CS) || defined(ST7796_CS)) && \ !defined(DISPLAY_FORCE_SMALL_FONTS) // The screen is bigger so use bigger fonts #define FONT_SMALL FONT_MEDIUM_LOCAL // Height: 19 diff --git a/src/graphics/TFTDisplay.cpp b/src/graphics/TFTDisplay.cpp index f8787612f..b1814005e 100644 --- a/src/graphics/TFTDisplay.cpp +++ b/src/graphics/TFTDisplay.cpp @@ -562,6 +562,91 @@ class LGFX : public lgfx::LGFX_Device static LGFX *tft = nullptr; +#elif defined(ST7796_CS) +#include // Graphics and font library for ST7796 driver chip + +class LGFX : public lgfx::LGFX_Device +{ + lgfx::Panel_ST7796 _panel_instance; + lgfx::Bus_SPI _bus_instance; + lgfx::Light_PWM _light_instance; + + public: + LGFX(void) + { + { + auto cfg = _bus_instance.config(); + + // SPI + cfg.spi_host = ST7796_SPI_HOST; + cfg.spi_mode = 0; + cfg.freq_write = SPI_FREQUENCY; // SPI clock for transmission (up to 80MHz, rounded to the value obtained by dividing + // 80MHz by an integer) + cfg.freq_read = SPI_READ_FREQUENCY; // SPI clock when receiving + cfg.spi_3wire = false; + cfg.use_lock = true; // Set to true to use transaction locking + cfg.dma_channel = SPI_DMA_CH_AUTO; // SPI_DMA_CH_AUTO; // Set DMA channel to use (0=not use DMA / 1=1ch / 2=ch / + // SPI_DMA_CH_AUTO=auto setting) + cfg.pin_sclk = ST7796_SCK; // Set SPI SCLK pin number + cfg.pin_mosi = ST7796_SDA; // Set SPI MOSI pin number + cfg.pin_miso = ST7796_MISO; // Set SPI MISO pin number (-1 = disable) + cfg.pin_dc = ST7796_RS; // Set SPI DC pin number (-1 = disable) + + _bus_instance.config(cfg); // applies the set value to the bus. + _panel_instance.setBus(&_bus_instance); // set the bus on the panel. + } + + { // Set the display panel control. + auto cfg = _panel_instance.config(); // Gets a structure for display panel settings. + + cfg.pin_cs = ST7796_CS; // Pin number where CS is connected (-1 = disable) + cfg.pin_rst = ST7796_RESET; // Pin number where RST is connected (-1 = disable) + cfg.pin_busy = ST7796_BUSY; // Pin number where BUSY is connected (-1 = disable) + + // cfg.memory_width = TFT_WIDTH; // Maximum width supported by the driver IC + // cfg.memory_height = TFT_HEIGHT; // Maximum height supported by the driver IC + cfg.panel_width = TFT_WIDTH; // actual displayable width + cfg.panel_height = TFT_HEIGHT; // actual displayable height + cfg.offset_x = TFT_OFFSET_X; // Panel offset amount in X direction + cfg.offset_y = TFT_OFFSET_Y; // Panel offset amount in Y direction + cfg.offset_rotation = TFT_OFFSET_ROTATION; // Rotation direction value offset 0~7 (4~7 is mirrored) +#ifdef TFT_DUMMY_READ_PIXELS + cfg.dummy_read_pixel = TFT_DUMMY_READ_PIXELS; // Number of bits for dummy read before pixel readout +#else + cfg.dummy_read_pixel = 8; // Number of bits for dummy read before pixel readout +#endif + cfg.dummy_read_bits = 1; // Number of bits for dummy read before non-pixel data read + cfg.readable = true; // Set to true if data can be read + cfg.invert = true; // Set to true if the light/darkness of the panel is reversed + cfg.rgb_order = false; // Set to true if the panel's red and blue are swapped + cfg.dlen_16bit = + false; // Set to true for panels that transmit data length in 16-bit units with 16-bit parallel or SPI + cfg.bus_shared = true; // If the bus is shared with the SD card, set to true (bus control with drawJpgFile etc.) + + _panel_instance.config(cfg); + } + +#ifdef ST7796_BL + // Set the backlight control. (delete if not necessary) + { + auto cfg = _light_instance.config(); // Gets a structure for backlight settings. + + cfg.pin_bl = ST7796_BL; // Pin number to which the backlight is connected + cfg.invert = false; // true to invert the brightness of the backlight + cfg.freq = 44100; + cfg.pwm_channel = 7; + + _light_instance.config(cfg); + _panel_instance.setLight(&_light_instance); // Set the backlight on the panel. + } +#endif + + setPanel(&_panel_instance); // Sets the panel to use. + } +}; + +static LGFX *tft = nullptr; + #elif defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) #include // Graphics and font library for ILI9341/ILI9342 driver chip @@ -997,8 +1082,9 @@ static LGFX *tft = nullptr; #endif -#if defined(ST7701_CS) || defined(ST7735_CS) || defined(ST7789_CS) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || \ - defined(RAK14014) || defined(HX8357_CS) || defined(ILI9488_CS) || defined(ST72xx_DE) || (ARCH_PORTDUINO && HAS_SCREEN != 0) +#if defined(ST7701_CS) || defined(ST7735_CS) || defined(ST7789_CS) || defined(ST7796_CS) || defined(ILI9341_DRIVER) || \ + defined(ILI9342_DRIVER) || defined(RAK14014) || defined(HX8357_CS) || defined(ILI9488_CS) || defined(ST72xx_DE) || \ + (ARCH_PORTDUINO && HAS_SCREEN != 0) #include "SPILock.h" #include "TFTDisplay.h" #include @@ -1047,32 +1133,97 @@ void TFTDisplay::display(bool fromBlank) { if (fromBlank) tft->fillScreen(TFT_BLACK); - // tft->clear(); + concurrency::LockGuard g(spiLock); - uint16_t x, y; + uint32_t x, y; + uint32_t y_byteIndex; + uint8_t y_byteMask; + uint32_t x_FirstPixelUpdate; + uint32_t x_LastPixelUpdate; + bool isset, dblbuf_isset; + uint16_t colorTftMesh, colorTftBlack; + bool somethingChanged = false; - for (y = 0; y < displayHeight; y++) { - for (x = 0; x < displayWidth; x++) { - auto isset = buffer[x + (y / 8) * displayWidth] & (1 << (y & 7)); + // Store colors byte-reversed so that TFT_eSPI doesn't have to swap bytes in a separate step + colorTftMesh = (TFT_MESH >> 8) | ((TFT_MESH & 0xFF) << 8); + colorTftBlack = (TFT_BLACK >> 8) | ((TFT_BLACK & 0xFF) << 8); + + y = 0; + while (y < displayHeight) { + y_byteIndex = (y / 8) * displayWidth; + y_byteMask = (1 << (y & 7)); + + // Step 1: Do a quick scan of 8 rows together. This allows fast-forwarding over unchanged screen areas. + if (y_byteMask == 1) { if (!fromBlank) { - // get src pixel in the page based ordering the OLED lib uses FIXME, super inefficent - auto dblbuf_isset = buffer_back[x + (y / 8) * displayWidth] & (1 << (y & 7)); - if (isset != dblbuf_isset) { - tft->drawPixel(x, y, isset ? TFT_MESH : TFT_BLACK); + for (x = 0; x < displayWidth; x++) { + if (buffer[x + y_byteIndex] != buffer_back[x + y_byteIndex]) + break; } - } else if (isset) { - tft->drawPixel(x, y, TFT_MESH); + } else { + for (x = 0; x < displayWidth; x++) { + if (buffer[x + y_byteIndex] != 0) + break; + } + } + if (x >= displayWidth) { + // No changed pixels found in these 8 rows, fast-forward to the next 8 + y = y + 8; + continue; } } + + // Step 2: Scan each of the 8 rows individually. Find the first pixel in each row that needs updating + for (x_FirstPixelUpdate = 0; x_FirstPixelUpdate < displayWidth; x_FirstPixelUpdate++) { + isset = buffer[x_FirstPixelUpdate + y_byteIndex] & y_byteMask; + + if (!fromBlank) { + // get src pixel in the page based ordering the OLED lib uses + dblbuf_isset = buffer_back[x_FirstPixelUpdate + y_byteIndex] & y_byteMask; + if (isset != dblbuf_isset) { + break; + } + } else if (isset) { + break; + } + } + + // Did we find a pixel that needs updating on this row? + if (x_FirstPixelUpdate < displayWidth) { + + // Quickly write out the first changed pixel (saves another array lookup) + linePixelBuffer[x_FirstPixelUpdate] = isset ? colorTftMesh : colorTftBlack; + x_LastPixelUpdate = x_FirstPixelUpdate; + + // Step 3: copy all remaining pixels in this row into the pixel line buffer, + // while also recording the last pixel in the row that needs updating + for (x = x_FirstPixelUpdate + 1; x < displayWidth; x++) { + isset = buffer[x + y_byteIndex] & y_byteMask; + linePixelBuffer[x] = isset ? colorTftMesh : colorTftBlack; + + if (!fromBlank) { + dblbuf_isset = buffer_back[x + y_byteIndex] & y_byteMask; + if (isset != dblbuf_isset) { + x_LastPixelUpdate = x; + } + } else if (isset) { + x_LastPixelUpdate = x; + } + } + + // Step 4: Send the changed pixels on this line to the screen as a single block transfer. + // This function accepts pixel data MSB first so it can dump the memory straight out the SPI port. + tft->pushRect(x_FirstPixelUpdate, y, (x_LastPixelUpdate - x_FirstPixelUpdate + 1), 1, + &linePixelBuffer[x_FirstPixelUpdate]); + + somethingChanged = true; + } + y++; } // Copy the Buffer to the Back Buffer - for (y = 0; y < (displayHeight / 8); y++) { - for (x = 0; x < displayWidth; x++) { - uint16_t pos = x + y * displayWidth; - buffer_back[pos] = buffer[pos]; - } - } + if (somethingChanged) + memcpy(buffer_back, buffer, displayBufferSize); } void TFTDisplay::sdlLoop() @@ -1264,13 +1415,21 @@ bool TFTDisplay::connect() tft->setRotation(1); // T-Deck has the TFT in landscape #elif defined(T_WATCH_S3) tft->setRotation(2); // T-Watch S3 left-handed orientation -#elif ARCH_PORTDUINO || defined(SENSECAP_INDICATOR) +#elif ARCH_PORTDUINO || defined(SENSECAP_INDICATOR) || defined(T_LORA_PAGER) tft->setRotation(0); // use config.yaml to set rotation #else tft->setRotation(3); // Orient horizontal and wide underneath the silkscreen name label #endif tft->fillScreen(TFT_BLACK); + if (this->linePixelBuffer == NULL) { + this->linePixelBuffer = (uint16_t *)malloc(sizeof(uint16_t) * displayWidth); + + if (!this->linePixelBuffer) { + LOG_ERROR("Not enough memory to create TFT line buffer\n"); + return false; + } + } return true; } diff --git a/src/graphics/TFTDisplay.h b/src/graphics/TFTDisplay.h index 60adfdf7c..27672ad29 100644 --- a/src/graphics/TFTDisplay.h +++ b/src/graphics/TFTDisplay.h @@ -58,4 +58,6 @@ class TFTDisplay : public OLEDDisplay // Connect to the display virtual bool connect() override; + + uint16_t *linePixelBuffer = nullptr; }; \ No newline at end of file diff --git a/src/graphics/draw/DebugRenderer.cpp b/src/graphics/draw/DebugRenderer.cpp index 5d9b5a33b..a0f29f10d 100644 --- a/src/graphics/draw/DebugRenderer.cpp +++ b/src/graphics/draw/DebugRenderer.cpp @@ -94,7 +94,8 @@ void drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16 if (!Throttle::isWithinTimespanMs(storeForwardModule->lastHeartbeat, (storeForwardModule->heartbeatInterval * 1200))) { // no heartbeat, overlap a bit #if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \ - defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS) || ARCH_PORTDUINO) && \ + defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS) || defined(ST7796_CS) || \ + ARCH_PORTDUINO) && \ !defined(DISPLAY_FORCE_SMALL_FONTS) display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(screen->ourId), y + 3 + FONT_HEIGHT_SMALL, 12, 8, imgQuestionL1); @@ -106,7 +107,7 @@ void drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16 #endif } else { #if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \ - defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS)) && \ + defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS) || defined(ST7796_CS)) && \ !defined(DISPLAY_FORCE_SMALL_FONTS) display->drawFastImage(x + SCREEN_WIDTH - 18 - display->getStringWidth(screen->ourId), y + 3 + FONT_HEIGHT_SMALL, 16, 8, imgSFL1); @@ -121,7 +122,8 @@ void drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16 } else { // TODO: Raspberry Pi supports more than just the one screen size #if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \ - defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS) || ARCH_PORTDUINO) && \ + defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS) || defined(ST7796_CS) || \ + ARCH_PORTDUINO) && \ !defined(DISPLAY_FORCE_SMALL_FONTS) display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(screen->ourId), y + 3 + FONT_HEIGHT_SMALL, 12, 8, imgInfoL1); diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index 512f650ec..bcd8d8ee8 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -434,8 +434,8 @@ void menuHandler::systemBaseMenu() optionsArray[options] = "Notifications"; optionsEnumArray[options++] = Notifications; -#if defined(ST7789_CS) || defined(USE_OLED) || defined(USE_SSD1306) || defined(USE_SH1106) || defined(USE_SH1107) || \ - defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) || HAS_TFT +#if defined(ST7789_CS) || defined(ST7796_CS) || defined(USE_OLED) || defined(USE_SSD1306) || defined(USE_SH1106) || \ + defined(USE_SH1107) || defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) || HAS_TFT optionsArray[options] = "Screen Options"; optionsEnumArray[options++] = ScreenOptions; #endif @@ -725,7 +725,7 @@ void menuHandler::BrightnessPickerMenu() #if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) // For HELTEC devices, use analogWrite to control backlight analogWrite(VTFT_LEDA, uiconfig.screen_brightness); -#elif defined(ST7789_CS) +#elif defined(ST7789_CS) || defined(ST7796_CS) static_cast(screen->getDisplayDevice())->setDisplayBrightness(uiconfig.screen_brightness); #elif defined(USE_OLED) || defined(USE_SSD1306) || defined(USE_SH1106) || defined(USE_SH1107) screen->getDisplayDevice()->setBrightness(uiconfig.screen_brightness); @@ -768,7 +768,7 @@ void menuHandler::TFTColorPickerMenu(OLEDDisplay *display) bannerOptions.optionsArrayPtr = optionsArray; bannerOptions.optionsCount = 10; bannerOptions.bannerCallback = [display](int selected) -> void { -#if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) || defined(T_DECK) || HAS_TFT +#if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) || defined(T_DECK) || defined(T_LORA_PAGER) || HAS_TFT uint8_t TFT_MESH_r = 0; uint8_t TFT_MESH_g = 0; uint8_t TFT_MESH_b = 0; @@ -1045,7 +1045,7 @@ void menuHandler::screenOptionsMenu() } // Only show screen color for TFT displays -#if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) || defined(T_DECK) || HAS_TFT +#if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) || defined(T_DECK) || defined(T_LORA_PAGER) || HAS_TFT optionsArray[options] = "Screen Color"; optionsEnumArray[options++] = ScreenColor; #endif diff --git a/src/graphics/draw/UIRenderer.cpp b/src/graphics/draw/UIRenderer.cpp index 71d92616f..049722df8 100644 --- a/src/graphics/draw/UIRenderer.cpp +++ b/src/graphics/draw/UIRenderer.cpp @@ -194,7 +194,7 @@ void UIRenderer::drawNodes(OLEDDisplay *display, int16_t x, int16_t y, const mes } #if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \ - defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS)) && \ + defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS) || defined(ST7796_CS)) && \ !defined(DISPLAY_FORCE_SMALL_FONTS) if (isHighResolution) { diff --git a/src/graphics/images.h b/src/graphics/images.h index beef3a1b2..c66e4b992 100644 --- a/src/graphics/images.h +++ b/src/graphics/images.h @@ -27,7 +27,8 @@ const uint8_t bluetoothConnectedIcon[36] PROGMEM = {0xfe, 0x01, 0xff, 0x03, 0x03 0xfe, 0x31, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0xf0, 0x3f, 0xe0, 0x1f}; #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) || ARCH_PORTDUINO) && \ + defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS) || defined(ILI9488_CS) || defined(ST7796_CS) || \ + ARCH_PORTDUINO) && \ !defined(DISPLAY_FORCE_SMALL_FONTS) const uint8_t imgQuestionL1[] PROGMEM = {0xff, 0x01, 0x01, 0x32, 0x7b, 0x49, 0x49, 0x6f, 0x26, 0x01, 0x01, 0xff}; const uint8_t imgQuestionL2[] PROGMEM = {0x0f, 0x08, 0x08, 0x08, 0x06, 0x0f, 0x0f, 0x06, 0x08, 0x08, 0x08, 0x0f}; diff --git a/src/input/RotaryEncoderImpl.cpp b/src/input/RotaryEncoderImpl.cpp new file mode 100644 index 000000000..b71e800e0 --- /dev/null +++ b/src/input/RotaryEncoderImpl.cpp @@ -0,0 +1,73 @@ +#ifdef T_LORA_PAGER + +#include "RotaryEncoderImpl.h" +#include "InputBroker.h" +#include "RotaryEncoder.h" + +#define ORIGIN_NAME "RotaryEncoder" + +RotaryEncoderImpl *rotaryEncoderImpl; + +RotaryEncoderImpl::RotaryEncoderImpl() : concurrency::OSThread(ORIGIN_NAME), originName(ORIGIN_NAME) {} + +bool RotaryEncoderImpl::init() +{ + if (!moduleConfig.canned_message.updown1_enabled || moduleConfig.canned_message.inputbroker_pin_a == 0 || + moduleConfig.canned_message.inputbroker_pin_b == 0) { + // Input device is disabled. + disable(); + return false; + } + + eventCw = static_cast(moduleConfig.canned_message.inputbroker_event_cw); + eventCcw = static_cast(moduleConfig.canned_message.inputbroker_event_ccw); + eventPressed = static_cast(moduleConfig.canned_message.inputbroker_event_press); + + rotary = new RotaryEncoder(moduleConfig.canned_message.inputbroker_pin_a, moduleConfig.canned_message.inputbroker_pin_b, + moduleConfig.canned_message.inputbroker_pin_press); + rotary->resetButton(); + + inputBroker->registerSource(this); + + LOG_INFO("RotaryEncoder initialized pins(%d, %d, %d), events(%d, %d, %d)", moduleConfig.canned_message.inputbroker_pin_a, + moduleConfig.canned_message.inputbroker_pin_b, moduleConfig.canned_message.inputbroker_pin_press, eventCw, eventCcw, + eventPressed); + return true; +} + +int32_t RotaryEncoderImpl::runOnce() +{ + InputEvent e; + e.inputEvent = INPUT_BROKER_NONE; + e.source = this->originName; + + static uint32_t lastPressed = millis(); + if (rotary->readButton() == RotaryEncoder::ButtonState::BUTTON_PRESSED) { + if (lastPressed + 200 < millis()) { + LOG_DEBUG("Rotary event Press"); + lastPressed = millis(); + e.inputEvent = this->eventPressed; + } + } else { + switch (rotary->process()) { + case RotaryEncoder::DIRECTION_CW: + LOG_DEBUG("Rotary event CW"); + e.inputEvent = this->eventCw; + break; + case RotaryEncoder::DIRECTION_CCW: + LOG_DEBUG("Rotary event CCW"); + e.inputEvent = this->eventCcw; + break; + default: + break; + } + } + + if (e.inputEvent != INPUT_BROKER_NONE) { + this->notifyObservers(&e); + } + + return 20; +} + +#endif \ No newline at end of file diff --git a/src/input/RotaryEncoderImpl.h b/src/input/RotaryEncoderImpl.h new file mode 100644 index 000000000..ae2a7c6fd --- /dev/null +++ b/src/input/RotaryEncoderImpl.h @@ -0,0 +1,28 @@ +#pragma once + +// This is a non-interrupt version of RotaryEncoder which is based on a debounce inherent FSM table (see RotaryEncoder library) + +#include "InputBroker.h" +#include "concurrency/OSThread.h" +#include "mesh/NodeDB.h" + +class RotaryEncoder; + +class RotaryEncoderImpl : public Observable, public concurrency::OSThread +{ + public: + RotaryEncoderImpl(); + bool init(void); + + protected: + virtual int32_t runOnce() override; + + input_broker_event eventCw = INPUT_BROKER_NONE; + input_broker_event eventCcw = INPUT_BROKER_NONE; + input_broker_event eventPressed = INPUT_BROKER_NONE; + + RotaryEncoder *rotary; + const char *originName; +}; + +extern RotaryEncoderImpl *rotaryEncoderImpl; diff --git a/src/input/TLoraPagerKeyboard.cpp b/src/input/TLoraPagerKeyboard.cpp new file mode 100644 index 000000000..b3f62a36c --- /dev/null +++ b/src/input/TLoraPagerKeyboard.cpp @@ -0,0 +1,230 @@ +#if defined(T_LORA_PAGER) + +#include "TLoraPagerKeyboard.h" +#include "main.h" + +#ifndef LEDC_BACKLIGHT_CHANNEL +#define LEDC_BACKLIGHT_CHANNEL 4 +#endif + +#ifndef LEDC_BACKLIGHT_BIT_WIDTH +#define LEDC_BACKLIGHT_BIT_WIDTH 8 +#endif + +#ifndef LEDC_BACKLIGHT_FREQ +#define LEDC_BACKLIGHT_FREQ 1000 // Hz +#endif + +#define _TCA8418_COLS 10 +#define _TCA8418_ROWS 4 +#define _TCA8418_NUM_KEYS 31 + +#define _TCA8418_MULTI_TAP_THRESHOLD 1500 + +using Key = TCA8418KeyboardBase::TCA8418Key; + +constexpr uint8_t modifierRightShiftKey = 29 - 1; // keynum -1 +constexpr uint8_t modifierRightShift = 0b0001; +constexpr uint8_t modifierSymKey = 21 - 1; +constexpr uint8_t modifierSym = 0b0010; + +// Num chars per key, Modulus for rotating through characters +static uint8_t TLoraPagerTapMod[_TCA8418_NUM_KEYS] = {3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}; + +static unsigned char TLoraPagerTapMap[_TCA8418_NUM_KEYS][3] = {{'q', 'Q', '1'}, + {'w', 'W', '2'}, + {'e', 'E', '3'}, + {'r', 'R', '4'}, + {'t', 'T', '5'}, + {'y', 'Y', '6'}, + {'u', 'U', '7'}, + {'i', 'I', '8'}, + {'o', 'O', '9'}, + {'p', 'P', '0'}, + {'a', 'A', '*'}, + {'s', 'S', '/'}, + {'d', 'D', '+'}, + {'f', 'F', '-'}, + {'g', 'G', '='}, + {'h', 'H', ':'}, + {'j', 'J', '\''}, + {'k', 'K', '"'}, + {'l', 'L', '@'}, + {Key::SELECT, 0x00, Key::TAB}, + {0x00, 0x00, 0x00}, + {'z', 'Z', '_'}, + {'x', 'X', '$'}, + {'c', 'C', ';'}, + {'v', 'V', '?'}, + {'b', 'B', '!'}, + {'n', 'N', ','}, + {'m', 'M', '.'}, + {0x00, 0x00, 0x00}, + {Key::BSP, 0x00, Key::ESC}, + {' ', 0x00, Key::BL_TOGGLE}}; + +TLoraPagerKeyboard::TLoraPagerKeyboard() + : TCA8418KeyboardBase(_TCA8418_ROWS, _TCA8418_COLS), modifierFlag(0), last_modifier_time(0), last_key(-1), next_key(-1), + last_tap(0L), char_idx(0), tap_interval(0) +{ +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) + ledcAttach(KB_BL_PIN, LEDC_BACKLIGHT_FREQ, LEDC_BACKLIGHT_BIT_WIDTH); +#else + ledcSetup(LEDC_BACKLIGHT_CHANNEL, LEDC_BACKLIGHT_FREQ, LEDC_BACKLIGHT_BIT_WIDTH); + ledcAttachPin(KB_BL_PIN, LEDC_BACKLIGHT_CHANNEL); +#endif + reset(); +} + +void TLoraPagerKeyboard::reset(void) +{ + TCA8418KeyboardBase::reset(); + pinMode(KB_BL_PIN, OUTPUT); + digitalWrite(KB_BL_PIN, LOW); + setBacklight(false); +} + +// handle multi-key presses (shift and alt) +void TLoraPagerKeyboard::trigger() +{ + uint8_t count = keyCount(); + if (count == 0) + return; + for (uint8_t i = 0; i < count; ++i) { + uint8_t k = readRegister(TCA8418_REG_KEY_EVENT_A + i); + uint8_t key = k & 0x7F; + if (k & 0x80) { + pressed(key); + } else { + released(); + state = Idle; + } + } +} + +void TLoraPagerKeyboard::setBacklight(bool on) +{ + toggleBacklight(!on); +} + +void TLoraPagerKeyboard::pressed(uint8_t key) +{ + if (state == Init || state == Busy) { + return; + } + if (config.device.buzzer_mode == meshtastic_Config_DeviceConfig_BuzzerMode_ALL_ENABLED || + config.device.buzzer_mode == meshtastic_Config_DeviceConfig_BuzzerMode_SYSTEM_ONLY) { + hapticFeedback(); + } + + if (modifierFlag && (millis() - last_modifier_time > _TCA8418_MULTI_TAP_THRESHOLD)) { + modifierFlag = 0; + } + + uint8_t next_key = 0; + int row = (key - 1) / 10; + int col = (key - 1) % 10; + + if (row >= _TCA8418_ROWS || col >= _TCA8418_COLS) { + return; // Invalid key + } + + next_key = row * _TCA8418_COLS + col; + state = Held; + + uint32_t now = millis(); + tap_interval = now - last_tap; + + updateModifierFlag(next_key); + if (isModifierKey(next_key)) { + last_modifier_time = now; + } + + if (tap_interval < 0) { + last_tap = 0; + state = Busy; + return; + } + + if (next_key != last_key || tap_interval > _TCA8418_MULTI_TAP_THRESHOLD) { + char_idx = 0; + } else { + char_idx += 1; + } + + last_key = next_key; + last_tap = now; +} + +void TLoraPagerKeyboard::released() +{ + if (state != Held) { + return; + } + + if (last_key < 0 || last_key >= _TCA8418_NUM_KEYS) { + last_key = -1; + state = Idle; + return; + } + + uint32_t now = millis(); + last_tap = now; + + if (TLoraPagerTapMap[last_key][modifierFlag % TLoraPagerTapMod[last_key]] == Key::BL_TOGGLE) { + toggleBacklight(); + return; + } + + queueEvent(TLoraPagerTapMap[last_key][modifierFlag % TLoraPagerTapMod[last_key]]); + if (isModifierKey(last_key) == false) + modifierFlag = 0; +} + +void TLoraPagerKeyboard::hapticFeedback() +{ + drv.setWaveform(0, 14); // strong buzz 100% + drv.setWaveform(1, 0); // end waveform + drv.go(); +} + +// toggle brightness of the backlight in three steps +void TLoraPagerKeyboard::toggleBacklight(bool off) +{ + static uint32_t brightness = 0; + if (off) { + brightness = 0; + } else { + if (brightness == 0) { + brightness = 40; + } else if (brightness == 40) { + brightness = 127; + } else if (brightness >= 127) { + brightness = 0; + } + } + LOG_DEBUG("Toggle backlight: %d", brightness); + +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) + ledcWrite(KB_BL_PIN, brightness); +#else + ledcWrite(LEDC_BACKLIGHT_CHANNEL, brightness); +#endif +} + +void TLoraPagerKeyboard::updateModifierFlag(uint8_t key) +{ + if (key == modifierRightShiftKey) { + modifierFlag ^= modifierRightShift; + } else if (key == modifierSymKey) { + modifierFlag ^= modifierSym; + } +} + +bool TLoraPagerKeyboard::isModifierKey(uint8_t key) +{ + return (key == modifierRightShiftKey || key == modifierSymKey); +} + +#endif \ No newline at end of file diff --git a/src/input/TLoraPagerKeyboard.h b/src/input/TLoraPagerKeyboard.h index d31b05978..4dabbac64 100644 --- a/src/input/TLoraPagerKeyboard.h +++ b/src/input/TLoraPagerKeyboard.h @@ -4,9 +4,26 @@ class TLoraPagerKeyboard : public TCA8418KeyboardBase { public: TLoraPagerKeyboard(); - void setBacklight(bool on) override{}; + void reset(void); + void trigger(void) override; + void setBacklight(bool on) override; + virtual ~TLoraPagerKeyboard() {} protected: - void pressed(uint8_t key) override{}; - void released(void) override{}; + void pressed(uint8_t key) override; + void released(void) override; + void hapticFeedback(void); + + void updateModifierFlag(uint8_t key); + bool isModifierKey(uint8_t key); + void toggleBacklight(bool off = false); + + private: + uint8_t modifierFlag; // Flag to indicate if a modifier key is pressed + uint32_t last_modifier_time; // Timestamp of the last modifier key press + int8_t last_key; + int8_t next_key; + uint32_t last_tap; + uint8_t char_idx; + int32_t tap_interval; }; diff --git a/src/input/cardKbI2cImpl.cpp b/src/input/cardKbI2cImpl.cpp index fcbdd0a3f..9b0926a1d 100644 --- a/src/input/cardKbI2cImpl.cpp +++ b/src/input/cardKbI2cImpl.cpp @@ -12,8 +12,8 @@ void CardKbI2cImpl::init() #if !MESHTASTIC_EXCLUDE_I2C && !defined(ARCH_PORTDUINO) && !defined(I2C_NO_RESCAN) if (cardkb_found.address == 0x00) { LOG_DEBUG("Rescan for I2C keyboard"); - uint8_t i2caddr_scan[] = {CARDKB_ADDR, TDECK_KB_ADDR, BBQ10_KB_ADDR, MPR121_KB_ADDR, XPOWERS_AXP192_AXP2101_ADDRESS}; - uint8_t i2caddr_asize = 5; + uint8_t i2caddr_scan[] = {CARDKB_ADDR, TDECK_KB_ADDR, BBQ10_KB_ADDR, MPR121_KB_ADDR, TCA8418_KB_ADDR}; + uint8_t i2caddr_asize = sizeof(i2caddr_scan) / sizeof(i2caddr_scan[0]); auto i2cScanner = std::unique_ptr(new ScanI2CTwoWire()); #if WIRE_INTERFACES_COUNT == 2 diff --git a/src/main.cpp b/src/main.cpp index 0260cbc07..338487914 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -135,8 +135,9 @@ AccelerometerThread *accelerometerThread = nullptr; AudioThread *audioThread = nullptr; #endif -#ifdef USE_PCA9557 -PCA9557 IOEXP; +#ifdef USE_XL9555 +#include "ExtensionIOXL9555.hpp" +ExtensionIOXL9555 io; #endif #if HAS_TFT @@ -201,7 +202,7 @@ ScanI2C::FoundDevice rgb_found = ScanI2C::FoundDevice(ScanI2C::DeviceType::NONE, /// The I2C address of our Air Quality Indicator (if found) ScanI2C::DeviceAddress aqi_found = ScanI2C::ADDRESS_NONE; -#ifdef T_WATCH_S3 +#if defined(T_WATCH_S3) || defined(T_LORA_PAGER) Adafruit_DRV2605 drv; #endif @@ -359,6 +360,30 @@ void setup() digitalWrite(SDCARD_CS, HIGH); pinMode(PIN_EINK_CS, OUTPUT); digitalWrite(PIN_EINK_CS, HIGH); +#elif defined(T_LORA_PAGER) + pinMode(LORA_CS, OUTPUT); + digitalWrite(LORA_CS, HIGH); + pinMode(SDCARD_CS, OUTPUT); + digitalWrite(SDCARD_CS, HIGH); + pinMode(TFT_CS, OUTPUT); + digitalWrite(TFT_CS, HIGH); + // io expander + io.begin(Wire, XL9555_SLAVE_ADDRESS0, SDA, SCL); + io.pinMode(EXPANDS_DRV_EN, OUTPUT); + io.digitalWrite(EXPANDS_DRV_EN, HIGH); + io.pinMode(EXPANDS_AMP_EN, OUTPUT); + io.digitalWrite(EXPANDS_AMP_EN, HIGH); + io.pinMode(EXPANDS_LORA_EN, OUTPUT); + io.digitalWrite(EXPANDS_LORA_EN, HIGH); + io.pinMode(EXPANDS_GPS_EN, OUTPUT); + io.digitalWrite(EXPANDS_GPS_EN, HIGH); + io.pinMode(EXPANDS_KB_EN, OUTPUT); + io.digitalWrite(EXPANDS_KB_EN, HIGH); + io.pinMode(EXPANDS_SD_EN, OUTPUT); + io.digitalWrite(EXPANDS_SD_EN, HIGH); + io.pinMode(EXPANDS_GPIO_EN, OUTPUT); + io.digitalWrite(EXPANDS_GPIO_EN, HIGH); + io.pinMode(EXPANDS_SD_PULLEN, INPUT); #endif concurrency::hasBeenSetup = true; @@ -805,7 +830,7 @@ void setup() #endif #endif -#ifdef T_WATCH_S3 +#if defined(T_WATCH_S3) || defined(T_LORA_PAGER) drv.begin(); drv.selectLibrary(1); // I2C trigger by sending 'go' command @@ -851,7 +876,7 @@ void setup() if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { #if defined(ST7701_CS) || defined(ST7735_CS) || defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || \ - defined(ST7789_CS) || defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS) + defined(ST7789_CS) || defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(ST7796_CS) screen = new graphics::Screen(screen_found, screen_model, screen_geometry); #elif defined(ARCH_PORTDUINO) if ((screen_found.port != ScanI2C::I2CPort::NO_I2C || settingsMap[displayPanel]) && @@ -1114,7 +1139,7 @@ void setup() // Don't call screen setup until after nodedb is setup (because we need // the current region name) #if defined(ST7701_CS) || defined(ST7735_CS) || defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || \ - defined(ST7789_CS) || defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS) + defined(ST7789_CS) || defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(ST7796_CS) if (screen) screen->setup(); #elif defined(ARCH_PORTDUINO) diff --git a/src/main.h b/src/main.h index 3568daad2..ef1f241ef 100644 --- a/src/main.h +++ b/src/main.h @@ -41,7 +41,7 @@ extern bool eink_found; extern bool pmu_found; extern bool isUSBPowered; -#ifdef T_WATCH_S3 +#if defined(T_WATCH_S3) || defined(T_LORA_PAGER) #include extern Adafruit_DRV2605 drv; #endif diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 18014eb02..d544d0174 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -663,7 +663,7 @@ void NodeDB::installDefaultConfig(bool preserveKey = false) config.bluetooth.fixed_pin = defaultBLEPin; #if defined(ST7735_CS) || defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7789_CS) || \ - defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS) + defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(ST7796_CS) bool hasScreen = true; #ifdef HELTEC_MESH_NODE_T114 uint32_t st7789_id = get_st7789_id(ST7789_NSS, ST7789_SCK, ST7789_SDA, ST7789_RS, ST7789_RESET); @@ -830,6 +830,15 @@ void NodeDB::installDefaultModuleConfig() moduleConfig.external_notification.alert_message = true; moduleConfig.external_notification.output_ms = 1000; moduleConfig.external_notification.nag_timeout = 60; +#endif +#ifdef T_LORA_PAGER + moduleConfig.canned_message.updown1_enabled = true; + moduleConfig.canned_message.inputbroker_pin_a = ROTARY_A; + moduleConfig.canned_message.inputbroker_pin_b = ROTARY_B; + moduleConfig.canned_message.inputbroker_pin_press = ROTARY_PRESS; + moduleConfig.canned_message.inputbroker_event_cw = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar(28); + moduleConfig.canned_message.inputbroker_event_ccw = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar(29); + moduleConfig.canned_message.inputbroker_event_press = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT; #endif moduleConfig.has_canned_message = true; #if USERPREFS_MQTT_ENABLED && !MESHTASTIC_EXCLUDE_MQTT diff --git a/src/modules/Modules.cpp b/src/modules/Modules.cpp index 3528f57f5..0d405fa81 100644 --- a/src/modules/Modules.cpp +++ b/src/modules/Modules.cpp @@ -3,6 +3,7 @@ #include "buzz/BuzzerFeedbackThread.h" #include "input/ExpressLRSFiveWay.h" #include "input/InputBroker.h" +#include "input/RotaryEncoderImpl.h" #include "input/RotaryEncoderInterruptImpl1.h" #include "input/SerialKeyboardImpl.h" #include "input/TrackballInterruptImpl1.h" @@ -170,11 +171,20 @@ void setupModules() delete rotaryEncoderInterruptImpl1; rotaryEncoderInterruptImpl1 = nullptr; } +#ifdef T_LORA_PAGER + // use a special FSM based rotary encoder version for T-LoRa Pager + rotaryEncoderImpl = new RotaryEncoderImpl(); + if (!rotaryEncoderImpl->init()) { + delete rotaryEncoderImpl; + rotaryEncoderImpl = nullptr; + } +#else upDownInterruptImpl1 = new UpDownInterruptImpl1(); if (!upDownInterruptImpl1->init()) { delete upDownInterruptImpl1; upDownInterruptImpl1 = nullptr; } +#endif cardKbI2cImpl = new CardKbI2cImpl(); cardKbI2cImpl->init(); #ifdef INPUTBROKER_MATRIX_TYPE diff --git a/src/platform/esp32/architecture.h b/src/platform/esp32/architecture.h index 522e862ac..cb0f0dab3 100644 --- a/src/platform/esp32/architecture.h +++ b/src/platform/esp32/architecture.h @@ -192,6 +192,8 @@ #define HW_VENDOR meshtastic_HardwareModel_LINK_32 #elif defined(T_DECK_PRO) #define HW_VENDOR meshtastic_HardwareModel_T_DECK_PRO +#elif defined(T_LORA_PAGER) +#define HW_VENDOR meshtastic_HardwareModel_T_LORA_PAGER #endif // ----------------------------------------------------------------------------- diff --git a/src/platform/extra_variants/t_lora_pager/variant.cpp b/src/platform/extra_variants/t_lora_pager/variant.cpp new file mode 100644 index 000000000..ea5773d30 --- /dev/null +++ b/src/platform/extra_variants/t_lora_pager/variant.cpp @@ -0,0 +1,27 @@ +#include "configuration.h" + +#ifdef T_LORA_PAGER + +#include "AudioBoard.h" + +DriverPins PinsAudioBoardES8311; +AudioBoard board(AudioDriverES8311, PinsAudioBoardES8311); + +// TLora Pager specific init +void lateInitVariant() +{ + // AudioDriverLogger.begin(Serial, AudioDriverLogLevel::Debug); + // I2C: function, scl, sda + PinsAudioBoardES8311.addI2C(PinFunction::CODEC, Wire); + // I2S: function, mclk, bck, ws, data_out, data_in + PinsAudioBoardES8311.addI2S(PinFunction::CODEC, DAC_I2S_MCLK, DAC_I2S_BCK, DAC_I2S_WS, DAC_I2S_DOUT, DAC_I2S_DIN); + + // configure codec + CodecConfig cfg; + cfg.input_device = ADC_INPUT_LINE1; + cfg.output_device = DAC_OUTPUT_ALL; + cfg.i2s.bits = BIT_LENGTH_16BITS; + cfg.i2s.rate = RATE_44K; + board.begin(cfg); +} +#endif \ No newline at end of file diff --git a/variants/esp32s3/tlora-pager/pins_arduino.h b/variants/esp32s3/tlora-pager/pins_arduino.h new file mode 100644 index 000000000..a6321f510 --- /dev/null +++ b/variants/esp32s3/tlora-pager/pins_arduino.h @@ -0,0 +1,19 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +#define USB_VID 0x303a +#define USB_PID 0x1001 + +// used for keyboard, battery gauge, charger and haptic driver +static const uint8_t SDA = 3; +static const uint8_t SCL = 2; + +// Default SPI will be mapped to Radio +static const uint8_t SS = 36; +static const uint8_t MOSI = 34; +static const uint8_t MISO = 33; +static const uint8_t SCK = 35; + +#endif /* Pins_Arduino_h */ diff --git a/variants/esp32s3/tlora-pager/platformio.ini b/variants/esp32s3/tlora-pager/platformio.ini new file mode 100644 index 000000000..3d77d879c --- /dev/null +++ b/variants/esp32s3/tlora-pager/platformio.ini @@ -0,0 +1,70 @@ +; LilyGo T-Lora-Pager +[env:tlora-pager] +extends = esp32s3_base +board = t-deck-pro ; same as T-Deck Pro +board_check = true +board_build.partitions = default_16MB.csv +upload_protocol = esptool + +build_flags = ${esp32s3_base.build_flags} + -I variants/esp32s3/tlora-pager + -D T_LORA_PAGER + -D BOARD_HAS_PSRAM + -D GPS_POWER_TOGGLE + -D HAS_SDCARD + -D SDCARD_USE_SPI1 + -D ENABLE_ROTARY_PULLUP + -D ENABLE_BUTTON_PULLUP + -D HALF_STEP + +lib_deps = ${esp32s3_base.lib_deps} + lovyan03/LovyanGFX@1.2.7 + earlephilhower/ESP8266Audio@1.9.9 + earlephilhower/ESP8266SAM@1.0.1 + adafruit/Adafruit DRV2605 Library@1.2.4 + lewisxhe/PCF8563_Library@1.0.1 + lewisxhe/SensorLib@0.3.1 + https://github.com/pschatzmann/arduino-audio-driver/archive/refs/tags/v0.1.3.zip + https://github.com/mverch67/BQ27220/archive/07d92be846abd8a0258a50c23198dac0858b22ed.zip + https://github.com/mverch67/RotaryEncoder + +[env:tlora-pager-tft] +extends = env:tlora-pager +build_flags = + ${env:tlora-pager.build_flags} + -D CONFIG_DISABLE_HAL_LOCKS=1 + -D INPUTDRIVER_ROTARY_TYPE=1 + -D INPUTDRIVER_ROTARY_UP=40 + -D INPUTDRIVER_ROTARY_DOWN=41 + -D INPUTDRIVER_ROTARY_BTN=7 + -D INPUTDRIVER_BUTTON_TYPE=0 + -D HAS_SCREEN=1 + -D HAS_TFT=1 + -D USE_I2S_BUZZER + -D RAM_SIZE=5120 + -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 + -D LV_USE_MEM_MONITOR=0 + -D LV_USE_LOG=0 + -D USE_LOG_DEBUG + -D LOG_DEBUG_INC=\"DebugConfiguration.h\" + -D RADIOLIB_SPI_PARANOID=0 + -D LGFX_SCREEN_WIDTH=222 + -D LGFX_SCREEN_HEIGHT=480 + -D DISPLAY_SIZE=480x222 ; landscape mode + -D DISPLAY_SET_RESOLUTION + -D LGFX_DRIVER=LGFX_TLORA_PAGER + -D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_T_LORA_PAGER.h\" +; -D LVGL_DRIVER=LVGL_T_LORA_PAGER +; -D LV_USE_ST7796=1 + -D VIEW_480x222 + -D USE_PACKET_API + -D MAP_FULL_REDRAW + +lib_deps = + ${env:tlora-pager.lib_deps} + ${device-ui_base.lib_deps} diff --git a/variants/esp32s3/tlora-pager/variant.h b/variants/esp32s3/tlora-pager/variant.h new file mode 100644 index 000000000..ee48088c8 --- /dev/null +++ b/variants/esp32s3/tlora-pager/variant.h @@ -0,0 +1,125 @@ +// ST7796 TFT LCD +#define TFT_CS 38 +#define ST7796_CS TFT_CS +#define ST7796_RS 37 // DC +#define ST7796_SDA MOSI // MOSI +#define ST7796_SCK SCK +#define ST7796_RESET -1 +#define ST7796_MISO MISO +#define ST7796_BUSY -1 +#define ST7796_BL 42 +#define ST7796_SPI_HOST SPI2_HOST +#define TFT_BL 42 +#define SPI_FREQUENCY 75000000 +#define SPI_READ_FREQUENCY 16000000 +#define TFT_HEIGHT 480 +#define TFT_WIDTH 222 +#define TFT_OFFSET_X 49 +#define TFT_OFFSET_Y 0 +#define TFT_OFFSET_ROTATION 3 +#define SCREEN_ROTATE +#define SCREEN_TRANSITION_FRAMERATE 5 +#define BRIGHTNESS_DEFAULT 130 // Medium Low Brightness + +#define I2C_SDA SDA +#define I2C_SCL SCL + +#define USE_POWERSAVE +#define SLEEP_TIME 120 + +// GNNS +#define HAS_GPS 1 +#define GPS_BAUDRATE 38400 +#define GPS_RX_PIN 4 +#define GPS_TX_PIN 12 +#define PIN_GPS_PPS 13 + +// PCF8563 RTC Module +#if __has_include("pcf8563.h") +#include "pcf8563.h" +#endif +#define PCF8563_RTC 0x51 +#define HAS_RTC 1 + +// Rotary +#define ROTARY_A (40) +#define ROTARY_B (41) +#define ROTARY_PRESS (7) + +#define BUTTON_PIN 0 + +// SPI interface SD card slot +#define SPI_MOSI MOSI +#define SPI_SCK SCK +#define SPI_MISO MISO +#define SPI_CS 21 +#define SDCARD_CS SPI_CS +#define SD_SPI_FREQUENCY 75000000U + +// TCA8418 keyboard +#define I2C_NO_RESCAN +#define KB_BL_PIN 46 +#define KB_INT 6 +#define CANNED_MESSAGE_MODULE_ENABLE 1 + +// audio codec ES8311 +#define HAS_I2S +#define DAC_I2S_BCK 11 +#define DAC_I2S_WS 18 +#define DAC_I2S_DOUT 45 +#define DAC_I2S_DIN 17 +#define DAC_I2S_MCLK 10 + +// gyroscope BHI260AP +#define HAS_BHI260AP + +// battery charger BQ25896 +#define HAS_PPM 1 +#define XPOWERS_CHIP_BQ25896 + +// battery quality management BQ27220 +#define HAS_BQ27220 1 +#define BQ27220_I2C_SDA SDA +#define BQ27220_I2C_SCL SCL +#define BQ27220_DESIGN_CAPACITY 1500 + +// NFC ST25R3916 +#define NFC_INT 5 +#define NFC_CS 39 + +// External expansion chip XL9555 +#define USE_XL9555 +#define EXPANDS_DRV_EN (0) +#define EXPANDS_AMP_EN (1) +#define EXPANDS_KB_RST (2) +#define EXPANDS_LORA_EN (3) +#define EXPANDS_GPS_EN (4) +#define EXPANDS_NFC_EN (5) +#define EXPANDS_GPS_RST (7) +#define EXPANDS_KB_EN (8) +#define EXPANDS_GPIO_EN (9) +#define EXPANDS_SD_DET (10) +#define EXPANDS_SD_PULLEN (11) +#define EXPANDS_SD_EN (12) + +// LoRa +#define USE_SX1262 +#define USE_SX1268 + +#define LORA_SCK 35 +#define LORA_MISO 33 +#define LORA_MOSI 34 +#define LORA_CS 36 + +#define LORA_DIO0 -1 // a No connect on the SX1262 module +#define LORA_RESET 47 +#define LORA_DIO1 14 // SX1262 IRQ +#define LORA_DIO2 48 // SX1262 BUSY +#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262, if DIO3 is high the TXCO is enabled + +#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.0 From 596cd7e0b6c4225ea21509601ede589bce205937 Mon Sep 17 00:00:00 2001 From: Manuel <71137295+mverch67@users.noreply.github.com> Date: Tue, 26 Aug 2025 20:39:43 +0200 Subject: [PATCH 161/180] enable device telemetry (#7757) --- variants/esp32s3/elecrow_panel/platformio.ini | 2 -- 1 file changed, 2 deletions(-) diff --git a/variants/esp32s3/elecrow_panel/platformio.ini b/variants/esp32s3/elecrow_panel/platformio.ini index 59bc26000..065f22538 100644 --- a/variants/esp32s3/elecrow_panel/platformio.ini +++ b/variants/esp32s3/elecrow_panel/platformio.ini @@ -19,8 +19,6 @@ build_flags = ${esp32s3_base.build_flags} -Os -D MESHTASTIC_EXCLUDE_SERIAL=1 -D MESHTASTIC_EXCLUDE_SOCKETAPI=1 -D MESHTASTIC_EXCLUDE_SCREEN=1 - -D MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1 - -D HAS_TELEMETRY=0 -D CONFIG_DISABLE_HAL_LOCKS=1 -D USE_PIN_BUZZER -D HAS_SCREEN=0 From 2c071a32836ff2837f36c2b6e62d1028b4c8d7c6 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Tue, 26 Aug 2025 13:41:33 -0500 Subject: [PATCH 162/180] Don't use pin 0 on RAK for input (#7755) * Don't use pin 0 on RAK for input * Use boolean instead of define --------- Co-authored-by: Ben Meadors --- src/input/RotaryEncoderInterruptBase.cpp | 23 ++++++++++++++++------- src/input/UpDownInterruptBase.cpp | 23 ++++++++++++++++------- 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/src/input/RotaryEncoderInterruptBase.cpp b/src/input/RotaryEncoderInterruptBase.cpp index 0557bc180..88b07a389 100644 --- a/src/input/RotaryEncoderInterruptBase.cpp +++ b/src/input/RotaryEncoderInterruptBase.cpp @@ -18,14 +18,23 @@ void RotaryEncoderInterruptBase::init( this->_eventCcw = eventCcw; this->_eventPressed = eventPressed; - pinMode(pinPress, INPUT_PULLUP); - pinMode(this->_pinA, INPUT_PULLUP); - pinMode(this->_pinB, INPUT_PULLUP); + bool isRAK = false; +#ifdef RAK_4631 + isRAK = true; +#endif - // attachInterrupt(pinPress, onIntPress, RISING); - attachInterrupt(pinPress, onIntPress, RISING); - attachInterrupt(this->_pinA, onIntA, CHANGE); - attachInterrupt(this->_pinB, onIntB, CHANGE); + if (!isRAK || pinPress != 0) { + pinMode(pinPress, INPUT_PULLUP); + attachInterrupt(pinPress, onIntPress, RISING); + } + if (!isRAK || this->_pinA != 0) { + pinMode(this->_pinA, INPUT_PULLUP); + attachInterrupt(this->_pinA, onIntA, CHANGE); + } + if (!isRAK || this->_pinA != 0) { + pinMode(this->_pinB, INPUT_PULLUP); + attachInterrupt(this->_pinB, onIntB, CHANGE); + } this->rotaryLevelA = digitalRead(this->_pinA); this->rotaryLevelB = digitalRead(this->_pinB); diff --git a/src/input/UpDownInterruptBase.cpp b/src/input/UpDownInterruptBase.cpp index c66eb13d0..26b281aaf 100644 --- a/src/input/UpDownInterruptBase.cpp +++ b/src/input/UpDownInterruptBase.cpp @@ -15,14 +15,23 @@ void UpDownInterruptBase::init(uint8_t pinDown, uint8_t pinUp, uint8_t pinPress, this->_eventDown = eventDown; this->_eventUp = eventUp; this->_eventPressed = eventPressed; + bool isRAK = false; +#ifdef RAK_4631 + isRAK = true; +#endif - pinMode(pinPress, INPUT_PULLUP); - pinMode(this->_pinDown, INPUT_PULLUP); - pinMode(this->_pinUp, INPUT_PULLUP); - - attachInterrupt(pinPress, onIntPress, RISING); - attachInterrupt(this->_pinDown, onIntDown, RISING); - attachInterrupt(this->_pinUp, onIntUp, RISING); + if (!isRAK || pinPress != 0) { + pinMode(pinPress, INPUT_PULLUP); + attachInterrupt(pinPress, onIntPress, RISING); + } + if (!isRAK || this->_pinDown != 0) { + pinMode(this->_pinDown, INPUT_PULLUP); + attachInterrupt(this->_pinDown, onIntDown, RISING); + } + if (!isRAK || this->_pinUp != 0) { + pinMode(this->_pinUp, INPUT_PULLUP); + attachInterrupt(this->_pinUp, onIntUp, RISING); + } LOG_DEBUG("Up/down/press GPIO initialized (%d, %d, %d)", this->_pinUp, this->_pinDown, pinPress); From 3dd384dd53e56cd3ecf0b6721790ac968ad926f8 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 26 Aug 2025 19:45:26 -0500 Subject: [PATCH 163/180] Null check --- src/modules/AdminModule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 9e8ce2e6b..407003f7e 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -505,7 +505,7 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta if (mp.decoded.want_response && !myReply) { myReply = allocErrorResponse(meshtastic_Routing_Error_NONE, &mp); } - if (mp.pki_encrypted) { + if (mp.pki_encrypted && myReply) { myReply->pki_encrypted = true; } return handled; From f8ba392a2413fdf749d7e2a649dfd8246f737baf Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 26 Aug 2025 20:29:11 -0500 Subject: [PATCH 164/180] Add BaseUI support for L1 EInk (#7751) * Add BaseUI support for L1 EInk * Fix Eink offset * Add joystick * Updates * Adjust Seeed Wio Tracker L1 E-Ink variant (#7326) * Rename variant Needs the -inkhud suffix to work correctly with the web flasher * Display driver for ZJY122250_0213BAAMFGN * Remove dead code from nicheGraphics.h Remnants of T-Echo's nicheGraphics.h file, which was used as a template. * Use ZJY122250_0213BAAMFGN driver Improves display health. We don't need as many full refreshes now. * Tidying * board_check = true --------- Co-authored-by: Ben Meadors * Consolidation * Add hack for existing InkHUD button functionality --------- Co-authored-by: todd-herbert --- src/configuration.h | 2 +- src/graphics/EInkDisplay2.cpp | 19 ++++-- src/graphics/EInkDisplay2.h | 2 +- .../Drivers/EInk/ZJY122250_0213BAAMFGN.cpp | 68 +++++++++++++++++++ .../Drivers/EInk/ZJY122250_0213BAAMFGN.h | 42 ++++++++++++ src/graphics/niche/InkHUD/DisplayHealth.cpp | 5 -- .../seeed_wio_tracker_L1_eink/nicheGraphics.h | 30 ++------ .../seeed_wio_tracker_L1_eink/platformio.ini | 38 +++++++++-- .../seeed_wio_tracker_L1_eink/variant.h | 25 ++++--- 9 files changed, 181 insertions(+), 50 deletions(-) create mode 100644 src/graphics/niche/Drivers/EInk/ZJY122250_0213BAAMFGN.cpp create mode 100644 src/graphics/niche/Drivers/EInk/ZJY122250_0213BAAMFGN.h diff --git a/src/configuration.h b/src/configuration.h index 0e24990b5..8b4fd82c7 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -135,7 +135,7 @@ along with this program. If not, see . // ----------------------------------------------------------------------------- // OLED & Input // ----------------------------------------------------------------------------- -#if defined(SEEED_WIO_TRACKER_L1) +#if defined(SEEED_WIO_TRACKER_L1) && !defined(SEEED_WIO_TRACKER_L1_EINK) #define SSD1306_ADDRESS 0x3D #define USE_SH1106 #else diff --git a/src/graphics/EInkDisplay2.cpp b/src/graphics/EInkDisplay2.cpp index 1c9f290b6..c0c09cc27 100644 --- a/src/graphics/EInkDisplay2.cpp +++ b/src/graphics/EInkDisplay2.cpp @@ -67,20 +67,28 @@ bool EInkDisplay::forceDisplay(uint32_t msecLimit) // FIXME - only draw bits have changed (use backbuf similar to the other displays) const bool flipped = config.display.flip_screen; + // HACK for L1 EInk +#if defined(SEEED_WIO_TRACKER_L1_EINK) + // For SEEED_WIO_TRACKER_L1_EINK, setRotation(3) is correct but mirrored; flip both axes + for (uint32_t y = 0; y < displayHeight; y++) { + for (uint32_t x = 0; x < displayWidth; x++) { + auto b = buffer[x + (y / 8) * displayWidth]; + auto isset = b & (1 << (y & 7)); + adafruitDisplay->drawPixel((displayWidth - 1) - x, (displayHeight - 1) - y, isset ? GxEPD_BLACK : GxEPD_WHITE); + } + } +#else for (uint32_t y = 0; y < displayHeight; y++) { for (uint32_t x = 0; x < displayWidth; x++) { - // get src pixel in the page based ordering the OLED lib uses FIXME, super inefficient auto b = buffer[x + (y / 8) * displayWidth]; auto isset = b & (1 << (y & 7)); - - // Handle flip here, rather than with setRotation(), - // Avoids issues when display width is not a multiple of 8 if (flipped) adafruitDisplay->drawPixel((displayWidth - 1) - x, (displayHeight - 1) - y, isset ? GxEPD_BLACK : GxEPD_WHITE); else adafruitDisplay->drawPixel(x, y, isset ? GxEPD_BLACK : GxEPD_WHITE); } } +#endif // Trigger the refresh in GxEPD2 LOG_DEBUG("Update E-Paper"); @@ -235,7 +243,7 @@ bool EInkDisplay::connect() adafruitDisplay->setRotation(1); adafruitDisplay->setPartialWindow(0, 0, EINK_WIDTH, EINK_HEIGHT); } -#elif defined(HELTEC_MESH_POCKET) +#elif defined(HELTEC_MESH_POCKET) || defined(SEEED_WIO_TRACKER_L1_EINK) { spi1 = &SPI1; spi1->begin(); @@ -249,6 +257,7 @@ bool EInkDisplay::connect() // Init GxEPD2 adafruitDisplay->init(); adafruitDisplay->setRotation(3); + adafruitDisplay->setPartialWindow(0, 0, EINK_WIDTH, EINK_HEIGHT); } #elif defined(HELTEC_WIRELESS_PAPER) || defined(HELTEC_VISION_MASTER_E213) diff --git a/src/graphics/EInkDisplay2.h b/src/graphics/EInkDisplay2.h index b840ce9ba..b4cee81fe 100644 --- a/src/graphics/EInkDisplay2.h +++ b/src/graphics/EInkDisplay2.h @@ -84,7 +84,7 @@ class EInkDisplay : public OLEDDisplay SPIClass *hspi = NULL; #endif -#if defined(HELTEC_MESH_POCKET) +#if defined(HELTEC_MESH_POCKET) || defined(SEEED_WIO_TRACKER_L1_EINK) SPIClass *spi1 = NULL; #endif diff --git a/src/graphics/niche/Drivers/EInk/ZJY122250_0213BAAMFGN.cpp b/src/graphics/niche/Drivers/EInk/ZJY122250_0213BAAMFGN.cpp new file mode 100644 index 000000000..e83588905 --- /dev/null +++ b/src/graphics/niche/Drivers/EInk/ZJY122250_0213BAAMFGN.cpp @@ -0,0 +1,68 @@ +#include "./ZJY122250_0213BAAMFGN.h" + +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + +using namespace NicheGraphics::Drivers; + +// Map the display controller IC's output to the connected panel +void ZJY122250_0213BAAMFGN::configScanning() +{ + // "Driver output control" + // Scan gates from 0 to 249 (vertical resolution 250px) + sendCommand(0x01); + sendData(0xF9); + sendData(0x00); + sendData(0x00); +} + +// Specify which information is used to control the sequence of voltages applied to move the pixels +// - For this display, configUpdateSequence() specifies that a suitable LUT will be loaded from +// the controller IC's OTP memory, when the update procedure begins. +void ZJY122250_0213BAAMFGN::configWaveform() +{ + switch (updateType) { + case FAST: + sendCommand(0x3C); // Border waveform: + sendData(0x80); // VCOM + break; + case FULL: + default: + sendCommand(0x3C); // Border waveform: + sendData(0x01); // Follow LUT 1 (blink same as white pixels) + break; + } + + sendCommand(0x18); // Temperature sensor: + sendData(0x80); // Use internal temperature sensor to select an appropriate refresh waveform +} + +void ZJY122250_0213BAAMFGN::configUpdateSequence() +{ + switch (updateType) { + case FAST: + sendCommand(0x22); // Set "update sequence" + sendData(0xFF); // Will load LUT from OTP memory, Display mode 2 "differential refresh" + break; + + case FULL: + default: + sendCommand(0x22); // Set "update sequence" + sendData(0xF7); // Will load LUT from OTP memory + break; + } +} + +// Once the refresh operation has been started, +// begin periodically polling the display to check for completion, using the normal Meshtastic threading code +// Only used when refresh is "async" +void ZJY122250_0213BAAMFGN::detachFromUpdate() +{ + switch (updateType) { + case FAST: + return beginPolling(50, 500); // At least 500ms for fast refresh + case FULL: + default: + return beginPolling(100, 2000); // At least 2 seconds for full refresh + } +} +#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file diff --git a/src/graphics/niche/Drivers/EInk/ZJY122250_0213BAAMFGN.h b/src/graphics/niche/Drivers/EInk/ZJY122250_0213BAAMFGN.h new file mode 100644 index 000000000..82c4ec107 --- /dev/null +++ b/src/graphics/niche/Drivers/EInk/ZJY122250_0213BAAMFGN.h @@ -0,0 +1,42 @@ +/* + +E-Ink display driver + - ZJY122250_0213BAAMFGN + - Manufacturer: Zhongjingyuan + - Size: 2.13 inch + - Resolution: 250px x 122px + - Flex connector marking (not a unique identifier): FPC-A002 + +*/ + +#pragma once + +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + +#include "configuration.h" + +#include "./SSD16XX.h" + +namespace NicheGraphics::Drivers +{ +class ZJY122250_0213BAAMFGN : public SSD16XX +{ + // Display properties + private: + static constexpr uint32_t width = 122; + static constexpr uint32_t height = 250; + static constexpr UpdateTypes supported = (UpdateTypes)(FULL | FAST); + + public: + ZJY122250_0213BAAMFGN() : SSD16XX(width, height, supported) {} + + protected: + virtual void configScanning() override; + virtual void configWaveform() override; + virtual void configUpdateSequence() override; + void detachFromUpdate() override; +}; + +} // namespace NicheGraphics::Drivers + +#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file diff --git a/src/graphics/niche/InkHUD/DisplayHealth.cpp b/src/graphics/niche/InkHUD/DisplayHealth.cpp index 7e1accafd..e8849b72e 100644 --- a/src/graphics/niche/InkHUD/DisplayHealth.cpp +++ b/src/graphics/niche/InkHUD/DisplayHealth.cpp @@ -7,12 +7,7 @@ using namespace NicheGraphics; // Timing for "maintenance" // Paying off full-refresh debt with unprovoked updates, if the display is not very active - -#ifdef SEEED_WIO_TRACKER_L1 -static constexpr uint32_t MAINTENANCE_MS_INITIAL = 5 * 1000UL; -#else static constexpr uint32_t MAINTENANCE_MS_INITIAL = 60 * 1000UL; -#endif static constexpr uint32_t MAINTENANCE_MS = 60 * 60 * 1000UL; InkHUD::DisplayHealth::DisplayHealth() : concurrency::OSThread("Mediator") diff --git a/variants/nrf52840/seeed_wio_tracker_L1_eink/nicheGraphics.h b/variants/nrf52840/seeed_wio_tracker_L1_eink/nicheGraphics.h index a32753343..7fb890303 100644 --- a/variants/nrf52840/seeed_wio_tracker_L1_eink/nicheGraphics.h +++ b/variants/nrf52840/seeed_wio_tracker_L1_eink/nicheGraphics.h @@ -18,16 +18,9 @@ // Shared NicheGraphics components // -------------------------------- -#include "graphics/niche/Drivers/Backlight/LatchingBacklight.h" -#include "graphics/niche/Drivers/EInk/GDEY0213B74.h" +#include "graphics/niche/Drivers/EInk/ZJY122250_0213BAAMFGN.h" #include "graphics/niche/Inputs/TwoButton.h" -// Special case - fix T-Echo's touch button -// ---------------------------------------- -// On a handful of T-Echos, LoRa TX triggers the capacitive touch -// To avoid this, we lockout the button during TX -#include "mesh/RadioLibInterface.h" - void setupNicheGraphics() { using namespace NicheGraphics; @@ -41,7 +34,7 @@ void setupNicheGraphics() // E-Ink Driver // ----------------------------- - Drivers::EInk *driver = new Drivers::GDEY0213B74; + Drivers::EInk *driver = new Drivers::ZJY122250_0213BAAMFGN; driver->begin(&SPI1, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES); // InkHUD @@ -53,8 +46,7 @@ void setupNicheGraphics() inkhud->setDriver(driver); // Set how many FAST updates per FULL update - // Set how unhealthy additional FAST updates beyond this number are - inkhud->setDisplayResilience(7, 1.5); + inkhud->setDisplayResilience(15); // Select fonts InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252; @@ -62,16 +54,10 @@ void setupNicheGraphics() InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252; // Customize default settings - inkhud->persistence->settings.userTiles.maxCount = 2; // Two applets side-by-side - // 270 degrees clockwise + inkhud->persistence->settings.rotation = 1; // 90 degrees clockwise inkhud->persistence->settings.optionalFeatures.batteryIcon = true; // Device definitely has a battery - inkhud->persistence->settings.optionalMenuItems.backlight = true; // Until proves capacitive button works by touching it - inkhud->persistence->settings.userTiles.count = 1; // One tile only by default, keep things simple for new users - - // Setup backlight controller - // Note: AUX button attached further down - Drivers::LatchingBacklight *backlight = Drivers::LatchingBacklight::getInstance(); - backlight->setPin(PIN_EINK_EN); + inkhud->persistence->settings.userTiles.count = 1; // One tile only by default, keep things simple for new users + inkhud->persistence->settings.userTiles.maxCount = 2; // Two applets side-by-side // Pick applets // Note: order of applets determines priority of "auto-show" feature @@ -83,11 +69,9 @@ void setupNicheGraphics() inkhud->addApplet("Recents List", new InkHUD::RecentsListApplet); // - inkhud->addApplet("Heard", new InkHUD::HeardApplet, true, false, 0); // Activated, no autoshow, default on tile 0 - inkhud->persistence->settings.rotation = 1; - // inkhud->persistence->printSettings(&inkhud->persistence->settings); // Start running InkHUD inkhud->begin(); - // inkhud->persistence->printSettings(&inkhud->persistence->settings); + // Buttons // -------------------------- diff --git a/variants/nrf52840/seeed_wio_tracker_L1_eink/platformio.ini b/variants/nrf52840/seeed_wio_tracker_L1_eink/platformio.ini index 52ff39d49..7f9eb0e2c 100644 --- a/variants/nrf52840/seeed_wio_tracker_L1_eink/platformio.ini +++ b/variants/nrf52840/seeed_wio_tracker_L1_eink/platformio.ini @@ -1,17 +1,47 @@ [env:seeed_wio_tracker_L1_eink] board = seeed_wio_tracker_L1 -extends = nrf52840_base, inkhud +extends = nrf52840_base ;board_level = extra build_flags = ${nrf52840_base.build_flags} - ${inkhud.build_flags} -I variants/nrf52840/seeed_wio_tracker_L1_eink -D SEEED_WIO_TRACKER_L1_EINK -D SEEED_WIO_TRACKER_L1 -I src/platform/nrf52/softdevice -I src/platform/nrf52/softdevice/nrf52 + -DUSE_EINK + -DEINK_DISPLAY_MODEL=GxEPD2_213_B74 + -DEINK_WIDTH=250 + -DEINK_HEIGHT=122 + -DUSE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk + -DEINK_LIMIT_FASTREFRESH=10 ; How many consecutive fast-refreshes are permitted + -DEINK_LIMIT_RATE_BACKGROUND_SEC=30 ; Minimum interval between BACKGROUND updates + -DEINK_LIMIT_RATE_RESPONSIVE_SEC=1 ; Minimum interval between RESPONSIVE updates +; -D EINK_LIMIT_GHOSTING_PX=2000 ; (Optional) How much image ghosting is tolerated + -DEINK_BACKGROUND_USES_FAST ; (Optional) Use FAST refresh for both BACKGROUND and RESPONSIVE, until a limit is reached. + -DEINK_HASQUIRK_GHOSTING ; Display model is identified as "prone to ghosting" + -DEINK_HASQUIRK_WEAKFASTREFRESH ; Pixels set with fast-refresh are easy to clear, disrupted by sunlight board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld -build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/seeed_wio_tracker_L1_eink> ${inkhud.build_src_filter} +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/seeed_wio_tracker_L1_eink> lib_deps = - ${inkhud.lib_deps} ${nrf52840_base.lib_deps} + https://github.com/meshtastic/GxEPD2#b202ebfec6a4821e098cf7a625ba0f6f2400292d debug_tool = jlink + +[env:seeed_wio_tracker_L1_eink-inkhud] +board = seeed_wio_tracker_L1 +extends = nrf52840_base, inkhud +build_flags = + ${nrf52840_base.build_flags} + ${inkhud.build_flags} + -I variants/nrf52840/seeed_wio_tracker_L1_eink + -D SEEED_WIO_TRACKER_L1 + -D BUTTON_PIN=D13 +board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld +build_src_filter = + ${nrf52_base.build_src_filter} + ${inkhud.build_src_filter} + +<../variants/nrf52840/seeed_wio_tracker_L1_eink> +lib_deps = + ${inkhud.lib_deps} ; Before base libs_deps, so we use ZinggJM/GFXRoot instead of AdafruitGFX (saves space) + ${nrf52840_base.lib_deps} +debug_tool = jlink \ No newline at end of file diff --git a/variants/nrf52840/seeed_wio_tracker_L1_eink/variant.h b/variants/nrf52840/seeed_wio_tracker_L1_eink/variant.h index 98a7b2c39..f33d200b1 100644 --- a/variants/nrf52840/seeed_wio_tracker_L1_eink/variant.h +++ b/variants/nrf52840/seeed_wio_tracker_L1_eink/variant.h @@ -33,17 +33,10 @@ // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // Button Configuration // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -#ifdef BUTTON_PIN -#undef BUTTON_PIN -#endif - -#define BUTTON_PIN D13 // This is the Program Button +#define CANCEL_BUTTON_PIN D13 // This is the Program Button // #define BUTTON_NEED_PULLUP 1 -#define BUTTON_ACTIVE_LOW true -#define BUTTON_ACTIVE_PULLUP false - -#define BUTTON_PIN_TOUCH 13 // Touch button +#define CANCEL_BUTTON_ACTIVE_LOW true +#define CANCEL_BUTTON_ACTIVE_PULLUP false // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // Digital Pin Mapping (D0-D10) // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -116,7 +109,7 @@ static const uint8_t SCL = PIN_WIRE_SCL; #define PIN_EINK_SCLK 31 #define PIN_EINK_MOSI 33 #define PIN_EINK_EN 14 // unused -#define PIN_SPI1_MISO 15 // unused +#define PIN_SPI1_MISO -1 // 15 unused #define PIN_SPI1_MOSI PIN_EINK_MOSI #define PIN_SPI1_SCK PIN_EINK_SCLK @@ -175,7 +168,17 @@ static const uint8_t SCL = PIN_WIRE_SCL; // joystick // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// trackball +#define HAS_TRACKBALL 1 +#define TB_UP 25 +#define TB_DOWN 26 +#define TB_LEFT 27 +#define TB_RIGHT 28 +#define TB_PRESS 29 +#define TB_DIRECTION FALLING + #define CANNED_MESSAGE_MODULE_ENABLE 1 +#define CANNED_MESSAGE_ADD_CONFIRMATION 1 // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // Compatibility Definitions From 0903ed8232d6693c5f3aac948760b3f8ce294a14 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 27 Aug 2025 06:02:54 -0500 Subject: [PATCH 165/180] Mesh solar integrate (#7764) * Added HELTEC MeshSolar board. (#7499) * Added HELTEC MeshSolar board. * Set emergency shutdown pin as high impedance * Set emergency shutdown pin as high impedance Set emergency shutdown pin as high impedance * Update variants/nrf52840/heltec_mesh_solar/variant.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update variants/nrf52840/heltec_mesh_solar/variant.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update variants/nrf52840/heltec_mesh_solar/variant.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update I2C SCL pin definition in variant.h --------- Co-authored-by: Ben Meadors Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Updates --------- Co-authored-by: Quency-D <55523105+Quency-D@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- boards/heltec_mesh_solar.json | 54 ++++++ src/Power.cpp | 74 +++++++++ src/SerialConsole.cpp | 8 + src/mesh/StreamAPI.cpp | 119 ++++++++----- src/mesh/StreamAPI.h | 3 + src/modules/SerialModule.cpp | 23 ++- src/platform/nrf52/architecture.h | 2 + src/platform/nrf52/main-nrf52.cpp | 2 +- src/power.h | 2 + .../nrf52840/heltec_mesh_solar/platformio.ini | 19 +++ .../nrf52840/heltec_mesh_solar/variant.cpp | 36 ++++ variants/nrf52840/heltec_mesh_solar/variant.h | 157 ++++++++++++++++++ 12 files changed, 452 insertions(+), 47 deletions(-) create mode 100644 boards/heltec_mesh_solar.json create mode 100644 variants/nrf52840/heltec_mesh_solar/platformio.ini create mode 100644 variants/nrf52840/heltec_mesh_solar/variant.cpp create mode 100644 variants/nrf52840/heltec_mesh_solar/variant.h diff --git a/boards/heltec_mesh_solar.json b/boards/heltec_mesh_solar.json new file mode 100644 index 000000000..9e551c082 --- /dev/null +++ b/boards/heltec_mesh_solar.json @@ -0,0 +1,54 @@ +{ + "build": { + "arduino": { + "ldscript": "nrf52840_s140_v6.ld" + }, + "core": "nRF5", + "cpu": "cortex-m4", + "extra_flags": "-DNRF52840_XXAA", + "f_cpu": "64000000L", + "hwids": [ + ["0x239A", "0x4405"], + ["0x239A", "0x0029"], + ["0x239A", "0x002A"], + ["0x239A", "0x0071"] + ], + "usb_product": "HT-n5262", + "mcu": "nrf52840", + "variant": "heltec_mesh_solar", + "variants_dir": "variants", + "bsp": { + "name": "adafruit" + }, + "softdevice": { + "sd_flags": "-DS140", + "sd_name": "s140", + "sd_version": "6.1.1", + "sd_fwid": "0x00B6" + }, + "bootloader": { + "settings_addr": "0xFF000" + } + }, + "connectivity": ["bluetooth"], + "debug": { + "jlink_device": "nRF52840_xxAA", + "onboard_tools": ["jlink"], + "svd_path": "nrf52840.svd", + "openocd_target": "nrf52840-mdk-rs" + }, + "frameworks": ["arduino"], + "name": "Heltec nrf (Adafruit BSP)", + "upload": { + "maximum_ram_size": 248832, + "maximum_size": 815104, + "speed": 115200, + "protocol": "nrfutil", + "protocols": ["jlink", "nrfjprog", "nrfutil", "stlink"], + "use_1200bps_touch": true, + "require_upload_port": true, + "wait_for_upload_port": true + }, + "url": "https://heltec.org/project/meshsolar/", + "vendor": "Heltec" +} diff --git a/src/Power.cpp b/src/Power.cpp index 8a16132f1..bf74f6e53 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -681,6 +681,8 @@ bool Power::setup() found = true; } else if (lipoChargerInit()) { found = true; + } else if (meshSolarInit()) { + found = true; } else if (analogInit()) { found = true; } @@ -1450,3 +1452,75 @@ bool Power::lipoChargerInit() return false; } #endif + + + +#ifdef HELTEC_MESH_SOLAR +#include "meshSolarApp.h" + +/** + * meshSolar class for an SMBUS battery sensor. + */ +class meshSolarBatteryLevel : public HasBatteryLevel +{ + + public: + /** + * Init the I2C meshSolar battery level sensor + */ + bool runOnce() + { + meshSolarStart(); + return true; + } + + /** + * Battery state of charge, from 0 to 100 or -1 for unknown + */ + virtual int getBatteryPercent() override { return meshSolarGetBatteryPercent(); } + + /** + * The raw voltage of the battery in millivolts, or NAN if unknown + */ + virtual uint16_t getBattVoltage() override { return meshSolarGetBattVoltage(); } + + /** + * return true if there is a battery installed in this unit + */ + virtual bool isBatteryConnect() override { return meshSolarIsBatteryConnect(); } + + /** + * return true if there is an external power source detected + */ + virtual bool isVbusIn() override { return meshSolarIsVbusIn();} + + /** + * return true if the battery is currently charging + */ + virtual bool isCharging() override { return meshSolarIsCharging(); } +}; + +meshSolarBatteryLevel meshSolarLevel; + +/** + * Init the meshSolar battery level sensor + */ +bool Power::meshSolarInit() +{ + bool result = meshSolarLevel.runOnce(); + LOG_DEBUG("Power::meshSolarInit mesh solar sensor is %s", result ? "ready" : "not ready yet"); + if (!result) + return false; + batteryLevel = &meshSolarLevel; + return true; +} + +#else +/** + * The meshSolar battery level sensor is unavailable - default to AnalogBatteryLevel + */ +bool Power::meshSolarInit() +{ + return false; +} +#endif \ No newline at end of file diff --git a/src/SerialConsole.cpp b/src/SerialConsole.cpp index 68c41980d..093a24678 100644 --- a/src/SerialConsole.cpp +++ b/src/SerialConsole.cpp @@ -64,6 +64,14 @@ SerialConsole::SerialConsole() : StreamAPI(&Port), RedirectablePrint(&Port), con int32_t SerialConsole::runOnce() { +#ifdef HELTEC_MESH_SOLAR + //After enabling the mesh solar serial port module configuration, command processing is handled by the serial port module. + if(moduleConfig.serial.enabled && moduleConfig.serial.override_console_serial_port + && moduleConfig.serial.mode==meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MS_CONFIG) + { + return 250; + } +#endif return runOncePart(); } diff --git a/src/mesh/StreamAPI.cpp b/src/mesh/StreamAPI.cpp index 4a42e5197..3d652b6d6 100644 --- a/src/mesh/StreamAPI.cpp +++ b/src/mesh/StreamAPI.cpp @@ -15,9 +15,65 @@ int32_t StreamAPI::runOncePart() checkConnectionTimeout(); return result; } +int32_t StreamAPI::runOncePart(char *buf, uint16_t bufLen) +{ + auto result = readStream(buf, bufLen); + writeStream(); + checkConnectionTimeout(); + return result; +} + +int32_t StreamAPI::handleRecStream(char *buf, uint16_t bufLen) +{ + uint16_t index = 0; + while (bufLen > index) { // Currently we never want to block + int cInt = buf[index++]; + if (cInt < 0) + break; // We ran out of characters (even though available said otherwise) - this can happen on rf52 adafruit + // arduino + + uint8_t c = (uint8_t)cInt; + + // Use the read pointer for a little state machine, first look for framing, then length bytes, then payload + size_t ptr = rxPtr; + + rxPtr++; // assume we will probably advance the rxPtr + rxBuf[ptr] = c; // store all bytes (including framing) + + // console->printf("rxPtr %d ptr=%d c=0x%x\n", rxPtr, ptr, c); + + if (ptr == 0) { // looking for START1 + if (c != START1) + rxPtr = 0; // failed to find framing + } else if (ptr == 1) { // looking for START2 + if (c != START2) + rxPtr = 0; // failed to find framing + } else if (ptr >= HEADER_LEN - 1) { // we have at least read our 4 byte framing + uint32_t len = (rxBuf[2] << 8) + rxBuf[3]; // big endian 16 bit length follows framing + + // console->printf("len %d\n", len); + + if (ptr == HEADER_LEN - 1) { + // we _just_ finished our 4 byte header, validate length now (note: a length of zero is a valid + // protobuf also) + if (len > MAX_TO_FROM_RADIO_SIZE) + rxPtr = 0; // length is bogus, restart search for framing + } + + if (rxPtr != 0) // Is packet still considered 'good'? + if (ptr + 1 >= len + HEADER_LEN) { // have we received all of the payload? + rxPtr = 0; // start over again on the next packet + + // If we didn't just fail the packet and we now have the right # of bytes, parse it + handleToRadio(rxBuf + HEADER_LEN, len); + } + } + } + return 0; +} /** - * Read any rx chars from the link and call handleToRadio + * Read any rx chars from the link and call handleRecStream */ int32_t StreamAPI::readStream() { @@ -26,50 +82,29 @@ int32_t StreamAPI::readStream() bool recentRx = Throttle::isWithinTimespanMs(lastRxMsec, 2000); return recentRx ? 5 : 250; } else { + char buf[1]; while (stream->available()) { // Currently we never want to block - int cInt = stream->read(); - if (cInt < 0) - break; // We ran out of characters (even though available said otherwise) - this can happen on rf52 adafruit - // arduino - - uint8_t c = (uint8_t)cInt; - - // Use the read pointer for a little state machine, first look for framing, then length bytes, then payload - size_t ptr = rxPtr; - - rxPtr++; // assume we will probably advance the rxPtr - rxBuf[ptr] = c; // store all bytes (including framing) - - // console->printf("rxPtr %d ptr=%d c=0x%x\n", rxPtr, ptr, c); - - if (ptr == 0) { // looking for START1 - if (c != START1) - rxPtr = 0; // failed to find framing - } else if (ptr == 1) { // looking for START2 - if (c != START2) - rxPtr = 0; // failed to find framing - } else if (ptr >= HEADER_LEN - 1) { // we have at least read our 4 byte framing - uint32_t len = (rxBuf[2] << 8) + rxBuf[3]; // big endian 16 bit length follows framing - - // console->printf("len %d\n", len); - - if (ptr == HEADER_LEN - 1) { - // we _just_ finished our 4 byte header, validate length now (note: a length of zero is a valid - // protobuf also) - if (len > MAX_TO_FROM_RADIO_SIZE) - rxPtr = 0; // length is bogus, restart search for framing - } - - if (rxPtr != 0) // Is packet still considered 'good'? - if (ptr + 1 >= len + HEADER_LEN) { // have we received all of the payload? - rxPtr = 0; // start over again on the next packet - - // If we didn't just fail the packet and we now have the right # of bytes, parse it - handleToRadio(rxBuf + HEADER_LEN, len); - } - } + buf[0] = stream->read(); + handleRecStream(buf, 1); } + // we had bytes available this time, so assume we might have them next time also + lastRxMsec = millis(); + return 0; + } +} +/** + * Read any rx chars from the link and call handleRecStream + */ +int32_t StreamAPI::readStream(char *buf, uint16_t bufLen) +{ + uint16_t index = 0; + if (bufLen < 1) { + // Nothing available this time, if the computer has talked to us recently, poll often, otherwise let CPU sleep a long time + bool recentRx = Throttle::isWithinTimespanMs(lastRxMsec, 2000); + return recentRx ? 5 : 250; + } else { + handleRecStream(buf, bufLen); // we had bytes available this time, so assume we might have them next time also lastRxMsec = millis(); return 0; diff --git a/src/mesh/StreamAPI.h b/src/mesh/StreamAPI.h index 6e0364bc1..547dd0175 100644 --- a/src/mesh/StreamAPI.h +++ b/src/mesh/StreamAPI.h @@ -50,12 +50,15 @@ class StreamAPI : public PhoneAPI * phone. */ virtual int32_t runOncePart(); + virtual int32_t runOncePart(char *buf,uint16_t bufLen); private: /** * Read any rx chars from the link and call handleToRadio */ int32_t readStream(); + int32_t readStream(char *buf,uint16_t bufLen); + int32_t handleRecStream(char *buf,uint16_t bufLen); /** * call getFromRadio() and deliver encapsulated packets to the Stream diff --git a/src/modules/SerialModule.cpp b/src/modules/SerialModule.cpp index 866497ecc..a2dbb07d3 100644 --- a/src/modules/SerialModule.cpp +++ b/src/modules/SerialModule.cpp @@ -45,6 +45,9 @@ */ +#ifdef HELTEC_MESH_SOLAR +#include "meshSolarApp.h" +#endif #if (defined(ARCH_ESP32) || defined(ARCH_NRF52) || defined(ARCH_RP2040)) && !defined(CONFIG_IDF_TARGET_ESP32S2) && \ !defined(CONFIG_IDF_TARGET_ESP32C3) @@ -60,8 +63,9 @@ SerialModule *serialModule; SerialModuleRadio *serialModuleRadio; -#if defined(TTGO_T_ECHO) || defined(T_ECHO_LITE) || defined(CANARYONE) || defined(MESHLINK) || defined(ELECROW_ThinkNode_M1) || \ - defined(ELECROW_ThinkNode_M5) + +#if defined(TTGO_T_ECHO) || defined(CANARYONE) || defined(MESHLINK) || defined(ELECROW_ThinkNode_M1) || \ + defined(ELECROW_ThinkNode_M5) || defined(HELTEC_MESH_SOLAR) SerialModule::SerialModule() : StreamAPI(&Serial), concurrency::OSThread("Serial") {} static Print *serialPrint = &Serial; #elif defined(CONFIG_IDF_TARGET_ESP32C6) @@ -78,7 +82,8 @@ size_t serialPayloadSize; bool SerialModule::isValidConfig(const meshtastic_ModuleConfig_SerialConfig &config) { if (config.override_console_serial_port && !IS_ONE_OF(config.mode, meshtastic_ModuleConfig_SerialConfig_Serial_Mode_NMEA, - meshtastic_ModuleConfig_SerialConfig_Serial_Mode_CALTOPO)) { + meshtastic_ModuleConfig_SerialConfig_Serial_Mode_CALTOPO, + meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MS_CONFIG)) { const char *warning = "Invalid Serial config: override console serial port is only supported in NMEA and CalTopo output-only modes."; LOG_ERROR(warning); @@ -241,7 +246,17 @@ int32_t SerialModule::runOnce() else if ((moduleConfig.serial.mode == meshtastic_ModuleConfig_SerialConfig_Serial_Mode_WS85)) { processWXSerial(); - } else { + } +#if defined(HELTEC_MESH_SOLAR) + else if ((moduleConfig.serial.mode == meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MS_CONFIG)) { + serialPayloadSize = Serial.readBytes(serialBytes, sizeof(serialBytes)-1); + //If the parsing fails, the following parsing will be performed. + if((serialPayloadSize > 0) && (meshSolarCmdHandle(serialBytes)!=0)) { + return runOncePart(serialBytes,serialPayloadSize); + } + } +#endif + else { #if defined(CONFIG_IDF_TARGET_ESP32C6) while (Serial1.available()) { serialPayloadSize = Serial1.readBytes(serialBytes, meshtastic_Constants_DATA_PAYLOAD_LEN); diff --git a/src/platform/nrf52/architecture.h b/src/platform/nrf52/architecture.h index 064bd8ef0..c9938062e 100644 --- a/src/platform/nrf52/architecture.h +++ b/src/platform/nrf52/architecture.h @@ -98,6 +98,8 @@ #define HW_VENDOR meshtastic_HardwareModel_SEEED_WIO_TRACKER_L1_EINK #elif defined(SEEED_WIO_TRACKER_L1) #define HW_VENDOR meshtastic_HardwareModel_SEEED_WIO_TRACKER_L1 +#elif defined(HELTEC_MESH_SOLAR) +#define HW_VENDOR meshtastic_HardwareModel_HELTEC_MESH_SOLAR #else #define HW_VENDOR meshtastic_HardwareModel_NRF52_UNKNOWN #endif diff --git a/src/platform/nrf52/main-nrf52.cpp b/src/platform/nrf52/main-nrf52.cpp index 590d2f0ae..8ce74d5f7 100644 --- a/src/platform/nrf52/main-nrf52.cpp +++ b/src/platform/nrf52/main-nrf52.cpp @@ -323,7 +323,7 @@ void cpuDeepSleep(uint32_t msecToWake) #endif #endif -#ifdef HELTEC_MESH_NODE_T114 +#if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_MESH_SOLAR) nrf_gpio_cfg_default(PIN_GPS_PPS); detachInterrupt(PIN_GPS_PPS); detachInterrupt(PIN_BUTTON1); diff --git a/src/power.h b/src/power.h index 1c078c06d..e96f5b022 100644 --- a/src/power.h +++ b/src/power.h @@ -128,6 +128,8 @@ class Power : private concurrency::OSThread bool lipoInit(); /// Setup a Lipo charger bool lipoChargerInit(); + /// Setup a meshSolar battery sensor + bool meshSolarInit(); private: void shutdown(); diff --git a/variants/nrf52840/heltec_mesh_solar/platformio.ini b/variants/nrf52840/heltec_mesh_solar/platformio.ini new file mode 100644 index 000000000..65d26dc40 --- /dev/null +++ b/variants/nrf52840/heltec_mesh_solar/platformio.ini @@ -0,0 +1,19 @@ +; First prototype nrf52840/sx1262 device +[env:heltec-mesh-solar] +extends = nrf52840_base +board = heltec_mesh_solar +board_level = pr +debug_tool = jlink + +# add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling. +build_flags = ${nrf52840_base.build_flags} + -Ivariants/nrf52840/heltec_mesh_solar + -DGPS_POWER_TOGGLE + -DHELTEC_MESH_SOLAR + +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/heltec_mesh_solar> +lib_deps = + ${nrf52840_base.lib_deps} + https://github.com/NMIoT/meshsolar/archive/dfc5330dad443982e6cdd37a61d33fc7252f468b.zip + lewisxhe/PCF8563_Library@^1.0.1 + ArduinoJson@6.21.4 diff --git a/variants/nrf52840/heltec_mesh_solar/variant.cpp b/variants/nrf52840/heltec_mesh_solar/variant.cpp new file mode 100644 index 000000000..8236d7cf4 --- /dev/null +++ b/variants/nrf52840/heltec_mesh_solar/variant.cpp @@ -0,0 +1,36 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + Copyright (c) 2016 Sandeep Mistry All right reserved. + Copyright (c) 2018, Adafruit Industries (adafruit.com) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "variant.h" +#include "nrf.h" +#include "wiring_constants.h" +#include "wiring_digital.h" + +const uint32_t g_ADigitalPinMap[] = { + // P0 - pins 0 and 1 are hardwired for xtal and should never be enabled + 0xff, 0xff, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + + // P1 + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}; + +void initVariant() +{ + pinMode(BQ4050_EMERGENCY_SHUTDOWN_PIN, INPUT); +} diff --git a/variants/nrf52840/heltec_mesh_solar/variant.h b/variants/nrf52840/heltec_mesh_solar/variant.h new file mode 100644 index 000000000..33c2b2556 --- /dev/null +++ b/variants/nrf52840/heltec_mesh_solar/variant.h @@ -0,0 +1,157 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + Copyright (c) 2016 Sandeep Mistry All right reserved. + Copyright (c) 2018, Adafruit Industries (adafruit.com) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _VARIANT_HELTEC_NRF_ +#define _VARIANT_HELTEC_NRF_ +/** Master clock frequency */ +#define VARIANT_MCK (64000000ul) + +#define USE_LFXO // Board uses 32khz crystal for LF + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "WVariant.h" + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +// Number of pins defined in PinDescription array +#define PINS_COUNT (48) +#define NUM_DIGITAL_PINS (48) +#define NUM_ANALOG_INPUTS (1) +#define NUM_ANALOG_OUTPUTS (0) + + +#define PIN_LED1 (0 + 12) // green (confirmed on 1.0 board) +#define LED_BLUE PIN_LED1 // fake for bluefruit library +#define LED_GREEN PIN_LED1 +#define LED_BUILTIN LED_GREEN +#define LED_STATE_ON 0 // State when LED is lit + +#define HAS_NEOPIXEL // Enable the use of neopixels +#define NEOPIXEL_COUNT 1 // How many neopixels are connected +#define NEOPIXEL_DATA (32+15) // gpio pin used to send data to the neopixels +#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use + +/* + * Buttons + */ +#define PIN_BUTTON1 (32 + 10) +// #define PIN_BUTTON2 (0 + 18) // 0.18 is labeled on the board as RESET but we configure it in the bootloader as a regular +// GPIO + +/* +No longer populated on PCB +*/ +#define PIN_SERIAL2_RX (0 + 9) +#define PIN_SERIAL2_TX (0 + 10) +// #define PIN_SERIAL2_EN (0 + 17) + +/* + * I2C + */ + +#define WIRE_INTERFACES_COUNT 2 + +// I2C bus 0 +// Routed to footprint for PCF8563TS RTC +// Not populated on T114 V1, maybe in future? +#define PIN_WIRE_SDA (0 + 6) // P0.26 +#define PIN_WIRE_SCL (0 + 26) // P0.26 + +// I2C bus 1 +// Available on header pins, for general use +#define PIN_WIRE1_SDA (0 + 30) // P0.30 +#define PIN_WIRE1_SCL (0 + 5) // P0.13 + +/* + * Lora radio + */ + +#define USE_SX1262 +// #define USE_SX1268 +#define SX126X_CS (0 + 24) // FIXME - we really should define LORA_CS instead +#define LORA_CS (0 + 24) +#define SX126X_DIO1 (0 + 20) +// Note DIO2 is attached internally to the module to an analog switch for TX/RX switching +// #define SX1262_DIO3 (0 + 21) +// This is used as an *output* from the sx1262 and connected internally to power the tcxo, do not drive from the +// main +// CPU? +#define SX126X_BUSY (0 + 17) +#define SX126X_RESET (0 + 25) +// Not really an E22 but TTGO seems to be trying to clone that +#define SX126X_DIO2_AS_RF_SWITCH +#define SX126X_DIO3_TCXO_VOLTAGE 1.8 + +/* + * GPS pins + */ + +#define GPS_L76K + +// #define PIN_GPS_RESET (32 + 6) // An output to reset L76K GPS. As per datasheet, low for > 100ms will reset the L76K +// #define GPS_RESET_MODE LOW +// #define PIN_GPS_EN (21) +#define PERIPHERAL_WARMUP_MS 1000 // Make sure I2C QuickLink has stable power before continuing +#define VEXT_ON_VALUE HIGH +// #define GPS_EN_ACTIVE HIGH +#define PIN_GPS_STANDBY (32 + 2) // An output to wake GPS, low means allow sleep, high means force wake +#define PIN_GPS_PPS (32 + 4) +// Seems to be missing on this new board +// #define PIN_GPS_PPS (32 + 4) // Pulse per second input from the GPS +#define GPS_TX_PIN (32 + 5) // This is for bits going TOWARDS the CPU +#define GPS_RX_PIN (32 + 7) // This is for bits going TOWARDS the GPS + +#define GPS_THREAD_INTERVAL 50 + +#define PIN_SERIAL1_RX GPS_TX_PIN +#define PIN_SERIAL1_TX GPS_RX_PIN + +/* + * SPI Interfaces + */ +#define SPI_INTERFACES_COUNT 1 + +// For LORA, spi 0 +#define PIN_SPI_MISO (0 + 23) +#define PIN_SPI_MOSI (0 + 22) +#define PIN_SPI_SCK (0 + 19) + +// #define PIN_PWR_EN (0 + 6) + +// To debug via the segger JLINK console rather than the CDC-ACM serial device +// #define USE_SEGGER + +#define BQ4050_SDA_PIN (32+1) // I2C data line pin +#define BQ4050_SCL_PIN (32+0) // I2C clock line pin +#define BQ4050_EMERGENCY_SHUTDOWN_PIN (32+3) // Emergency shutdown pin + +#define HAS_RTC 0 +#ifdef __cplusplus +} +#endif + +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#endif From 3120bb8fd77bd3dc340ca14b923a0847b95f6ad4 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 27 Aug 2025 06:50:53 -0500 Subject: [PATCH 166/180] Fix check --- src/input/RotaryEncoderImpl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/input/RotaryEncoderImpl.cpp b/src/input/RotaryEncoderImpl.cpp index b71e800e0..d3fcbbf9d 100644 --- a/src/input/RotaryEncoderImpl.cpp +++ b/src/input/RotaryEncoderImpl.cpp @@ -8,7 +8,10 @@ RotaryEncoderImpl *rotaryEncoderImpl; -RotaryEncoderImpl::RotaryEncoderImpl() : concurrency::OSThread(ORIGIN_NAME), originName(ORIGIN_NAME) {} +RotaryEncoderImpl::RotaryEncoderImpl() : concurrency::OSThread(ORIGIN_NAME), originName(ORIGIN_NAME) +{ + rotary = nullptr; +} bool RotaryEncoderImpl::init() { From 06bccef46204d073f72c7b98b9f5e9e3cc424b64 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 27 Aug 2025 07:17:46 -0500 Subject: [PATCH 167/180] Reinstitute previous streamapi readStream --- src/mesh/StreamAPI.cpp | 80 +++++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 37 deletions(-) diff --git a/src/mesh/StreamAPI.cpp b/src/mesh/StreamAPI.cpp index 3d652b6d6..a45e11ac3 100644 --- a/src/mesh/StreamAPI.cpp +++ b/src/mesh/StreamAPI.cpp @@ -73,7 +73,7 @@ int32_t StreamAPI::handleRecStream(char *buf, uint16_t bufLen) } /** - * Read any rx chars from the link and call handleRecStream + * Read any rx chars from the link and call handleToRadio */ int32_t StreamAPI::readStream() { @@ -82,50 +82,56 @@ int32_t StreamAPI::readStream() bool recentRx = Throttle::isWithinTimespanMs(lastRxMsec, 2000); return recentRx ? 5 : 250; } else { - char buf[1]; while (stream->available()) { // Currently we never want to block - buf[0] = stream->read(); - handleRecStream(buf, 1); + int cInt = stream->read(); + if (cInt < 0) + break; // We ran out of characters (even though available said otherwise) - this can happen on rf52 adafruit + // arduino + + uint8_t c = (uint8_t)cInt; + + // Use the read pointer for a little state machine, first look for framing, then length bytes, then payload + size_t ptr = rxPtr; + + rxPtr++; // assume we will probably advance the rxPtr + rxBuf[ptr] = c; // store all bytes (including framing) + + // console->printf("rxPtr %d ptr=%d c=0x%x\n", rxPtr, ptr, c); + + if (ptr == 0) { // looking for START1 + if (c != START1) + rxPtr = 0; // failed to find framing + } else if (ptr == 1) { // looking for START2 + if (c != START2) + rxPtr = 0; // failed to find framing + } else if (ptr >= HEADER_LEN - 1) { // we have at least read our 4 byte framing + uint32_t len = (rxBuf[2] << 8) + rxBuf[3]; // big endian 16 bit length follows framing + + // console->printf("len %d\n", len); + + if (ptr == HEADER_LEN - 1) { + // we _just_ finished our 4 byte header, validate length now (note: a length of zero is a valid + // protobuf also) + if (len > MAX_TO_FROM_RADIO_SIZE) + rxPtr = 0; // length is bogus, restart search for framing + } + + if (rxPtr != 0) // Is packet still considered 'good'? + if (ptr + 1 >= len + HEADER_LEN) { // have we received all of the payload? + rxPtr = 0; // start over again on the next packet + + // If we didn't just fail the packet and we now have the right # of bytes, parse it + handleToRadio(rxBuf + HEADER_LEN, len); + } + } } + // we had bytes available this time, so assume we might have them next time also lastRxMsec = millis(); return 0; } } -/** - * Read any rx chars from the link and call handleRecStream - */ -int32_t StreamAPI::readStream(char *buf, uint16_t bufLen) -{ - uint16_t index = 0; - if (bufLen < 1) { - // Nothing available this time, if the computer has talked to us recently, poll often, otherwise let CPU sleep a long time - bool recentRx = Throttle::isWithinTimespanMs(lastRxMsec, 2000); - return recentRx ? 5 : 250; - } else { - handleRecStream(buf, bufLen); - // we had bytes available this time, so assume we might have them next time also - lastRxMsec = millis(); - return 0; - } -} - -/** - * call getFromRadio() and deliver encapsulated packets to the Stream - */ -void StreamAPI::writeStream() -{ - if (canWrite) { - uint32_t len; - do { - // Send every packet we can - len = getFromRadio(txBuf + HEADER_LEN); - emitTxBuffer(len); - } while (len); - } -} - /** * Send the current txBuffer over our stream */ From 237b8908f75bab38c18cc8ec735b86ea59983b76 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 27 Aug 2025 09:54:39 -0500 Subject: [PATCH 168/180] Chainsaw took too much off the top --- src/mesh/StreamAPI.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/mesh/StreamAPI.cpp b/src/mesh/StreamAPI.cpp index a45e11ac3..20026767e 100644 --- a/src/mesh/StreamAPI.cpp +++ b/src/mesh/StreamAPI.cpp @@ -15,6 +15,7 @@ int32_t StreamAPI::runOncePart() checkConnectionTimeout(); return result; } + int32_t StreamAPI::runOncePart(char *buf, uint16_t bufLen) { auto result = readStream(buf, bufLen); @@ -23,6 +24,38 @@ int32_t StreamAPI::runOncePart(char *buf, uint16_t bufLen) return result; } +/** + * Read any rx chars from the link and call handleRecStream + */ +int32_t StreamAPI::readStream(char *buf, uint16_t bufLen) +{ + if (bufLen < 1) { + // Nothing available this time, if the computer has talked to us recently, poll often, otherwise let CPU sleep a long time + bool recentRx = Throttle::isWithinTimespanMs(lastRxMsec, 2000); + return recentRx ? 5 : 250; + } else { + handleRecStream(buf, bufLen); + // we had bytes available this time, so assume we might have them next time also + lastRxMsec = millis(); + return 0; + } +} + +/** + * call getFromRadio() and deliver encapsulated packets to the Stream + */ +void StreamAPI::writeStream() +{ + if (canWrite) { + uint32_t len; + do { + // Send every packet we can + len = getFromRadio(txBuf + HEADER_LEN); + emitTxBuffer(len); + } while (len); + } +} + int32_t StreamAPI::handleRecStream(char *buf, uint16_t bufLen) { uint16_t index = 0; From 26c38ffc8e3f181e004445a1e86d4da3ecbaf1da Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 27 Aug 2025 11:55:27 -0500 Subject: [PATCH 169/180] Remove debug logging --- variants/esp32s3/unphone/platformio.ini | 2 -- 1 file changed, 2 deletions(-) diff --git a/variants/esp32s3/unphone/platformio.ini b/variants/esp32s3/unphone/platformio.ini index ecb1cbd67..f6c3e2855 100644 --- a/variants/esp32s3/unphone/platformio.ini +++ b/variants/esp32s3/unphone/platformio.ini @@ -52,8 +52,6 @@ build_flags = -D LV_USE_PERF_MONITOR=0 -D LV_USE_MEM_MONITOR=0 -D LV_USE_LOG=0 - -D USE_LOG_DEBUG - -D LOG_DEBUG_INC=\"DebugConfiguration.h\" -D LGFX_SCREEN_WIDTH=320 -D LGFX_SCREEN_HEIGHT=480 -D DISPLAY_SIZE=320x480 ; portrait mode From d21d6d208542b8ca645333e67e3b1e743811eb75 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 27 Aug 2025 13:53:34 -0500 Subject: [PATCH 170/180] Update meshtastic/device-ui digest to a3e0e1b (#7766) 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 543205996..ef0fef791 100644 --- a/platformio.ini +++ b/platformio.ini @@ -118,7 +118,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/0f32b64dca418c6465763ec576509a6a2bfbc50a.zip + https://github.com/meshtastic/device-ui/archive/a3e0e1be372d069f47b4c19d718f5267251744d7.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From a4d96bebfbe8c699fdef8662a0e28fa8a0c6014b Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 27 Aug 2025 14:35:29 -0500 Subject: [PATCH 171/180] Drop for now --- variants/esp32s3/unphone/platformio.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/variants/esp32s3/unphone/platformio.ini b/variants/esp32s3/unphone/platformio.ini index f6c3e2855..476858ff5 100644 --- a/variants/esp32s3/unphone/platformio.ini +++ b/variants/esp32s3/unphone/platformio.ini @@ -32,6 +32,7 @@ lib_deps = ${esp32s3_base.lib_deps} [env:unphone-tft] +board_level = extra extends = env:unphone build_flags = ${env:unphone.build_flags} From 25a19b49ad9a20fd8296b120183154976b46c0cc Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 27 Aug 2025 15:18:26 -0500 Subject: [PATCH 172/180] This one is not working yet --- variants/esp32s3/tlora-pager/platformio.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/variants/esp32s3/tlora-pager/platformio.ini b/variants/esp32s3/tlora-pager/platformio.ini index 3d77d879c..b16e516a7 100644 --- a/variants/esp32s3/tlora-pager/platformio.ini +++ b/variants/esp32s3/tlora-pager/platformio.ini @@ -29,6 +29,7 @@ lib_deps = ${esp32s3_base.lib_deps} https://github.com/mverch67/RotaryEncoder [env:tlora-pager-tft] +board_level = extra extends = env:tlora-pager build_flags = ${env:tlora-pager.build_flags} From 834c3c5cc2be305cf3ee465c600e4282e0928f46 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 27 Aug 2025 16:24:57 -0500 Subject: [PATCH 173/180] Add this back in --- src/modules/SerialModule.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/modules/SerialModule.cpp b/src/modules/SerialModule.cpp index a2dbb07d3..880768839 100644 --- a/src/modules/SerialModule.cpp +++ b/src/modules/SerialModule.cpp @@ -45,7 +45,7 @@ */ -#ifdef HELTEC_MESH_SOLAR +#ifdef HELTEC_MESH_SOLAR #include "meshSolarApp.h" #endif @@ -63,9 +63,8 @@ SerialModule *serialModule; SerialModuleRadio *serialModuleRadio; - #if defined(TTGO_T_ECHO) || defined(CANARYONE) || defined(MESHLINK) || defined(ELECROW_ThinkNode_M1) || \ - defined(ELECROW_ThinkNode_M5) || defined(HELTEC_MESH_SOLAR) + defined(ELECROW_ThinkNode_M5) || defined(HELTEC_MESH_SOLAR) || defined(T_ECHO_LITE) SerialModule::SerialModule() : StreamAPI(&Serial), concurrency::OSThread("Serial") {} static Print *serialPrint = &Serial; #elif defined(CONFIG_IDF_TARGET_ESP32C6) @@ -83,7 +82,7 @@ bool SerialModule::isValidConfig(const meshtastic_ModuleConfig_SerialConfig &con { if (config.override_console_serial_port && !IS_ONE_OF(config.mode, meshtastic_ModuleConfig_SerialConfig_Serial_Mode_NMEA, meshtastic_ModuleConfig_SerialConfig_Serial_Mode_CALTOPO, - meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MS_CONFIG)) { + meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MS_CONFIG)) { const char *warning = "Invalid Serial config: override console serial port is only supported in NMEA and CalTopo output-only modes."; LOG_ERROR(warning); @@ -249,11 +248,11 @@ int32_t SerialModule::runOnce() } #if defined(HELTEC_MESH_SOLAR) else if ((moduleConfig.serial.mode == meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MS_CONFIG)) { - serialPayloadSize = Serial.readBytes(serialBytes, sizeof(serialBytes)-1); - //If the parsing fails, the following parsing will be performed. - if((serialPayloadSize > 0) && (meshSolarCmdHandle(serialBytes)!=0)) { - return runOncePart(serialBytes,serialPayloadSize); - } + serialPayloadSize = Serial.readBytes(serialBytes, sizeof(serialBytes) - 1); + // If the parsing fails, the following parsing will be performed. + if ((serialPayloadSize > 0) && (meshSolarCmdHandle(serialBytes) != 0)) { + return runOncePart(serialBytes, serialPayloadSize); + } } #endif else { From 6c7cff7de2a13f7665e98f85050d8df4d968cf3f Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 28 Aug 2025 06:02:24 -0500 Subject: [PATCH 174/180] Merge pull request #7777 from meshtastic/create-pull-request/bump-version Bump release version --- bin/org.meshtastic.meshtasticd.metainfo.xml | 3 +++ debian/changelog | 5 +++-- version.properties | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/org.meshtastic.meshtasticd.metainfo.xml b/bin/org.meshtastic.meshtasticd.metainfo.xml index f3b3bb14d..1d97e2a66 100644 --- a/bin/org.meshtastic.meshtasticd.metainfo.xml +++ b/bin/org.meshtastic.meshtasticd.metainfo.xml @@ -87,6 +87,9 @@ + + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.7 + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.6 diff --git a/debian/changelog b/debian/changelog index b36a22168..ff59db89e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -meshtasticd (2.7.6.0) UNRELEASED; urgency=medium +meshtasticd (2.7.7.0) UNRELEASED; urgency=medium [ Austin Lane ] * Initial packaging @@ -39,5 +39,6 @@ meshtasticd (2.7.6.0) UNRELEASED; urgency=medium [ ] * GitHub Actions Automatic version bump + * GitHub Actions Automatic version bump - -- Tue, 12 Aug 2025 23:48:48 +0000 + -- Ubuntu Thu, 28 Aug 2025 10:33:25 +0000 diff --git a/version.properties b/version.properties index f9e2cb279..2e5193d49 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 7 -build = 6 +build = 7 From b0e8321514d91da0f5a90c324e3d9dce0b36af5b Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Fri, 29 Aug 2025 09:45:46 +1000 Subject: [PATCH 175/180] Only send Neighbours if we have some to send. (#7493) * Only send Neighbours if we have some to send. The original intent of NeighborInfo was that when a NeighbourInfo was sent all of the nodes that saw it would reply with NeighbourInfo. So, NeighbourInfo was sent even if there were no hop-zero nodes in the NodeDB. Since 2023, when this was implemented, our understanding of running city-wide meshes has improved substantially. We have taken steps to reduce the impact of NeighborInfo over LoRa. This change aligns with those ideas: we will now only send NeighborInfo if we have some neighbors to contribute. The impact of this change is that a node must first see another directly connected node in another packet type before NeighborInfo is sent. This means that a node with no neighbors is no longer able to trigger other nodes to broadcast NeighborInfo. It will, however, receive the regular periodic broadcast of NeighborInfo, and will be able to send NeighborInfo if it has at least 1 neighbor. * Include all the things * AvOid memleak --- src/modules/NeighborInfoModule.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/modules/NeighborInfoModule.cpp b/src/modules/NeighborInfoModule.cpp index eebf428a4..97dc17001 100644 --- a/src/modules/NeighborInfoModule.cpp +++ b/src/modules/NeighborInfoModule.cpp @@ -105,14 +105,15 @@ void NeighborInfoModule::sendNeighborInfo(NodeNum dest, bool wantReplies) { meshtastic_NeighborInfo neighborInfo = meshtastic_NeighborInfo_init_zero; collectNeighborInfo(&neighborInfo); - meshtastic_MeshPacket *p = allocDataProtobuf(neighborInfo); - // send regardless of whether or not we have neighbors in our DB, - // because we want to get neighbors for the next cycle - p->to = dest; - p->decoded.want_response = wantReplies; - p->priority = meshtastic_MeshPacket_Priority_BACKGROUND; - printNeighborInfo("SENDING", &neighborInfo); - service->sendToMesh(p, RX_SRC_LOCAL, true); + // only send neighbours if we have some to send + if (neighborInfo.neighbors_count > 0) { + meshtastic_MeshPacket *p = allocDataProtobuf(neighborInfo); + p->to = dest; + p->decoded.want_response = wantReplies; + p->priority = meshtastic_MeshPacket_Priority_BACKGROUND; + printNeighborInfo("SENDING", &neighborInfo); + service->sendToMesh(p, RX_SRC_LOCAL, true); + } } /* @@ -214,4 +215,4 @@ meshtastic_Neighbor *NeighborInfoModule::getOrCreateNeighbor(NodeNum originalSen neighbors.push_back(new_nbr); } return &neighbors.back(); -} \ No newline at end of file +} From d3e3a91096f2189ea710d94c7dda145f1046c6ad Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Sat, 30 Aug 2025 00:08:33 +1000 Subject: [PATCH 176/180] We don't gotTime if time is 2019. (#7772) There are certain GPS chips that have a hard-coded time in firmware that they will return before lock. We set our own hard-coded time, BUILD_EPOCH, that should be newer and use the comparison to not set a bad time. In https://github.com/meshtastic/firmware/pull/7261 we introduced the RTCSetResult and improved it in https://github.com/meshtastic/firmware/pull/7375 . However, the original try-fix left logic in GPS.cpp that could still result in broadcasting the bad time. Further, as part of our fix we cleared the GPS buffer if we didn't get a good time. The mesh was hurting at the time, so this was a reasonable approach. However, given time tends to come in when we're trying to get early lock, this had the potential side effect of throwing away valuable information to get position lock. This change reverses the clearBuffer and changes the logic so if time is not set it will not be broadcast. Fixes https://github.com/meshtastic/firmware/issues/7771 Fixes https://github.com/meshtastic/firmware/issues/7750 --- src/gps/GPS.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index ae74f0fe2..881021975 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -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. * 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() { @@ -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) { 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()); - if (perhapsSetRTC(RTCQualityGPS, t) == RTCSetResultInvalidTime) { - // Clear the GPS buffer if we got an invalid time - clearBuffer(); + if (perhapsSetRTC(RTCQualityGPS, t) == RTCSetResultSuccess) { + LOG_DEBUG("Time set."); + return true; + } else { + return false; } - return true; } else return false; } else From 4e03df5ea7a30ac6458545df59ec24557a46598d Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 29 Aug 2025 12:09:22 -0500 Subject: [PATCH 177/180] Fix freetext hang (#7781) * Fixed freetext hangs by adding canned modules back to self-sourced packets and transition to SENDING_ACTIVE state * Update meshmodule handling --- src/mesh/MeshModule.cpp | 11 ++--------- src/mesh/MeshModule.h | 2 +- src/mesh/NodeDB.cpp | 8 ++++---- src/mesh/Router.cpp | 6 +++--- src/modules/CannedMessageModule.cpp | 3 +-- src/modules/RoutingModule.cpp | 2 +- src/modules/RoutingModule.h | 2 -- 7 files changed, 12 insertions(+), 22 deletions(-) diff --git a/src/mesh/MeshModule.cpp b/src/mesh/MeshModule.cpp index 409c52179..22fcec663 100644 --- a/src/mesh/MeshModule.cpp +++ b/src/mesh/MeshModule.cpp @@ -85,11 +85,8 @@ meshtastic_MeshPacket *MeshModule::allocErrorResponse(meshtastic_Routing_Error e 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"); 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 auto ourNodeNum = nodeDB->getNodeNum(); bool toUs = isBroadcast(mp.to) || isToUs(&mp); + bool fromUs = mp.from == ourNodeNum; for (auto i = modules->begin(); i != modules->end(); ++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 = ∓ /// We only call modules that are interested in the packet (and the message is destined to us or we are promiscious) diff --git a/src/mesh/MeshModule.h b/src/mesh/MeshModule.h index bf735439f..eda3f8881 100644 --- a/src/mesh/MeshModule.h +++ b/src/mesh/MeshModule.h @@ -73,7 +73,7 @@ class MeshModule /** 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 GetMeshModulesWithUIFrames(int startIndex); static void observeUIEvents(Observer *observer); diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index d544d0174..c8eba1b2e 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -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 void NodeDB::updateFrom(const meshtastic_MeshPacket &mp) { - // if (mp.from == getNodeNum()) { - // LOG_DEBUG("Ignore update from self"); - // return; - // } + if (mp.from == getNodeNum()) { + LOG_DEBUG("Ignore update from self"); + return; + } 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); diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index 1f835bca7..c7e32c4a1 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -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) p->channel = hash; if (hash < 0) { - // No suitable channel could be found for sending + // No suitable channel could be found for return meshtastic_Routing_Error_NO_CHANNEL; } 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) p->channel = hash; if (hash < 0) { - // No suitable channel could be found for sending + // No suitable channel could be found for return meshtastic_Routing_Error_NO_CHANNEL; } 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); #endif } 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 diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index d40dcd24f..e9165e57c 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -632,10 +632,10 @@ bool CannedMessageModule::handleMessageSelectorInput(const InputEvent *event, bo // Normal canned message selection if (runState == CANNED_MESSAGE_RUN_STATE_INACTIVE || runState == CANNED_MESSAGE_RUN_STATE_DISABLED) { } else { +#if CANNED_MESSAGE_ADD_CONFIRMATION // Show confirmation dialog before sending canned message NodeNum destNode = dest; ChannelIndex chan = channel; -#if CANNED_MESSAGE_ADD_CONFIRMATION graphics::menuHandler::showConfirmationBanner("Send message?", [this, destNode, chan, current]() { this->sendText(destNode, chan, current, false); payload = runState; @@ -991,7 +991,6 @@ int32_t CannedMessageModule::runOnce() this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE; } } - e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; this->currentMessageIndex = -1; this->freetext = ""; this->cursor = 0; diff --git a/src/modules/RoutingModule.cpp b/src/modules/RoutingModule.cpp index b10413cc8..e7e92c79a 100644 --- a/src/modules/RoutingModule.cpp +++ b/src/modules/RoutingModule.cpp @@ -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 } -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; diff --git a/src/modules/RoutingModule.h b/src/modules/RoutingModule.h index 7b43a6e98..c047f6e29 100644 --- a/src/modules/RoutingModule.h +++ b/src/modules/RoutingModule.h @@ -2,8 +2,6 @@ #include "Channels.h" #include "ProtobufModule.h" -static const char *ROUTING_MODULE = "routing"; - /** * Routing module for router control messages */ From 11db6d4dcc1d886f79696b797659e3ac58cb9d43 Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Sat, 30 Aug 2025 04:22:23 +1000 Subject: [PATCH 178/180] Can't trust RTCs to tell the time. (#7779) Further to https://github.com/meshtastic/firmware/pull/7772 , we discovered that some RTCs have hard-coded start times well in the past. This patch gives RTCs the same treatment as GPS - if the time is earlier than BUILD_EPOCH, we don't use it. Fixes #7771 Fixes #7750 --- src/gps/RTC.cpp | 26 ++++++++++++++++++++++---- src/gps/RTC.h | 2 +- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/gps/RTC.cpp b/src/gps/RTC.cpp index d574c9ad0..185adacd9 100644 --- a/src/gps/RTC.cpp +++ b/src/gps/RTC.cpp @@ -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. * @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*/ #ifdef RV3028_RTC @@ -44,8 +44,15 @@ void readFromRTC() t.tm_sec = rtc.getSecond(); tv.tv_sec = gm_mktime(&t); 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 + +#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, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, printableEpoch); timeStartMsec = now; @@ -53,6 +60,7 @@ void readFromRTC() if (currentQuality == RTCQualityNone) { currentQuality = RTCQualityDevice; } + return RTCSetResultSuccess; } #elif defined(PCF8563_RTC) if (rtc_found.address == PCF8563_RTC) { @@ -75,8 +83,15 @@ void readFromRTC() t.tm_sec = tc.second; tv.tv_sec = gm_mktime(&t); 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 + +#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, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, printableEpoch); timeStartMsec = now; @@ -84,6 +99,7 @@ void readFromRTC() if (currentQuality == RTCQualityNone) { currentQuality = RTCQualityDevice; } + return RTCSetResultSuccess; } #else if (!gettimeofday(&tv, NULL)) { @@ -92,8 +108,10 @@ void readFromRTC() LOG_DEBUG("Read RTC time as %ld", printableEpoch); timeStartMsec = now; zeroOffsetSecs = tv.tv_sec; + return RTCSetResultSuccess; } #endif + return RTCSetResultNotSet; } /** @@ -101,7 +119,7 @@ void readFromRTC() * * @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. - * @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 */ diff --git a/src/gps/RTC.h b/src/gps/RTC.h index 96dec575b..010be6886 100644 --- a/src/gps/RTC.h +++ b/src/gps/RTC.h @@ -48,7 +48,7 @@ uint32_t getTime(bool local = false); /// Return time since 1970 in secs. If quality is RTCQualityNone return zero uint32_t getValidTime(RTCQuality minQuality, bool local = false); -void readFromRTC(); +RTCSetResult readFromRTC(); time_t gm_mktime(struct tm *tm); From ed394f5f9df0cc854d97ab342ab364e027f58006 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 29 Aug 2025 13:58:32 -0500 Subject: [PATCH 179/180] Update protobufs (#7784) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protobufs b/protobufs index 8985852d7..4c4427c4a 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 8985852d752de3f7210f9a4a3e0923120ec438b3 +Subproject commit 4c4427c4a73c86fed7dc8632188bb8be95349d81 From 5ae4ff9162c4c9d90bc33b249b5f28a36d263d40 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 29 Aug 2025 13:59:40 -0500 Subject: [PATCH 180/180] Upgrade trunk (#7763) Co-authored-by: vidplace7 <1779290+vidplace7@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 a0dcf2ff5..c57c16319 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -8,8 +8,8 @@ plugins: uri: https://github.com/trunk-io/plugins lint: enabled: - - checkov@3.2.465 - - renovate@41.82.10 + - checkov@3.2.467 + - renovate@41.88.0 - prettier@3.6.2 - trufflehog@3.90.5 - yamllint@1.37.1