diff --git a/.github/workflows/build_native.yml b/.github/workflows/build_native.yml deleted file mode 100644 index cca839328..000000000 --- a/.github/workflows/build_native.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Build Native - -on: workflow_call - -permissions: - contents: write - packages: write - -jobs: - build-native: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: recursive - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - - - name: Setup native build - id: base - uses: ./.github/actions/setup-native - - - name: Build Native - run: bin/build-native.sh - - - name: Get release version string - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version - - - name: Store binaries as an artifact - uses: actions/upload-artifact@v4 - with: - name: firmware-native-${{ steps.version.outputs.long }}.zip - overwrite: true - path: | - release/meshtasticd_linux_x86_64 - bin/config-dist.yaml diff --git a/.github/workflows/build_raspbian.yml b/.github/workflows/build_raspbian.yml deleted file mode 100644 index 646c6c9f3..000000000 --- a/.github/workflows/build_raspbian.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Build Raspbian - -on: workflow_call - -permissions: - contents: write - packages: write - -jobs: - build-raspbian: - runs-on: [self-hosted, linux, ARM64] - steps: - - name: Install libbluetooth - shell: bash - run: | - sudo apt-get update -y --fix-missing - sudo apt-get install -y libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev libulfius-dev liborcania-dev libusb-1.0-0-dev libi2c-dev - - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: recursive - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - - - name: Upgrade python tools - shell: bash - run: | - python -m pip install --upgrade pip - pip install -U platformio adafruit-nrfutil - pip install -U meshtastic --pre - - - name: Upgrade platformio - shell: bash - run: | - pio upgrade - - - name: Build Raspbian - run: bin/build-native.sh - - - name: Get release version string - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version - - - name: Store binaries as an artifact - uses: actions/upload-artifact@v4 - with: - name: firmware-raspbian-${{ steps.version.outputs.long }}.zip - overwrite: true - path: | - release/meshtasticd_linux_aarch64 - bin/config-dist.yaml diff --git a/.github/workflows/build_raspbian_armv7l.yml b/.github/workflows/build_raspbian_armv7l.yml deleted file mode 100644 index 21b1aea79..000000000 --- a/.github/workflows/build_raspbian_armv7l.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Build Raspbian Arm - -on: workflow_call - -permissions: - contents: write - packages: write - -jobs: - build-raspbian-armv7l: - runs-on: [self-hosted, linux, ARM] - steps: - - name: Install libbluetooth - shell: bash - run: | - sudo apt-get update -y --fix-missing - sudo apt-get install -y libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev libulfius-dev liborcania-dev libusb-1.0-0-dev libi2c-dev - - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: recursive - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - - - name: Upgrade python tools - shell: bash - run: | - python -m pip install --upgrade pip - pip install -U platformio adafruit-nrfutil - pip install -U meshtastic --pre - - - name: Upgrade platformio - shell: bash - run: | - pio upgrade - - - name: Build Raspbian - run: bin/build-native.sh - - - name: Get release version string - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version - - - name: Store binaries as an artifact - uses: actions/upload-artifact@v4 - with: - name: firmware-raspbian-armv7l-${{ steps.version.outputs.long }}.zip - overwrite: true - path: | - release/meshtasticd_linux_armv7l - bin/config-dist.yaml diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index a9678f4fc..b13866435 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -128,15 +128,6 @@ jobs: with: board: ${{ matrix.board }} - package-raspbian: - uses: ./.github/workflows/package_raspbian.yml - - package-raspbian-armv7l: - uses: ./.github/workflows/package_raspbian_armv7l.yml - - package-native: - uses: ./.github/workflows/package_amd64.yml - build-debian-src: uses: ./.github/workflows/build_debian_src.yml with: @@ -158,7 +149,7 @@ jobs: docker-alpine-amd64: uses: ./.github/workflows/docker_build.yml with: - distro: debian + distro: alpine platform: linux/amd64 runs-on: ubuntu-24.04 push: false @@ -288,14 +279,7 @@ jobs: if: ${{ github.event_name == 'workflow_dispatch' }} outputs: upload_url: ${{ steps.create_release.outputs.upload_url }} - needs: - [ - gather-artifacts, - package-raspbian, - package-raspbian-armv7l, - package-native, - build-debian-src, - ] + needs: [gather-artifacts, build-debian-src] steps: - name: Checkout uses: actions/checkout@v4 @@ -324,13 +308,6 @@ jobs: body: | Autogenerated by github action, developer should edit as required before publishing... - - name: Download deb files - uses: actions/download-artifact@v4 - with: - pattern: meshtasticd_${{ steps.version.outputs.long }}_*.deb - merge-multiple: true - path: ./output - - name: Download source deb uses: actions/download-artifact@v4 with: @@ -346,11 +323,8 @@ jobs: - name: Display structure of downloaded files run: ls -lR - - name: Add deb files to release + - name: Add source deb to release run: | - gh release upload v${{ steps.version.outputs.long }} ./output/meshtasticd_${{ steps.version.outputs.long }}_arm64.deb - gh release upload v${{ steps.version.outputs.long }} ./output/meshtasticd_${{ steps.version.outputs.long }}_armhf.deb - gh release upload v${{ steps.version.outputs.long }} ./output/meshtasticd_${{ steps.version.outputs.long }}_amd64.deb gh release upload v${{ steps.version.outputs.long }} ./output/meshtasticd-${{ steps.version.outputs.deb }}-src.zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/package_amd64.yml b/.github/workflows/package_amd64.yml deleted file mode 100644 index d9f041736..000000000 --- a/.github/workflows/package_amd64.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: Package Native - -on: - workflow_call: - workflow_dispatch: - -permissions: - contents: write - packages: write - -jobs: - build-native: - uses: ./.github/workflows/build_native.yml - - package-native: - runs-on: ubuntu-22.04 - needs: build-native - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: recursive - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - - - name: Pull web ui - uses: dsaltares/fetch-gh-release-asset@master - with: - repo: meshtastic/web - file: build.tar - target: build.tar - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Get release version string - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version - - - name: Download artifacts - uses: actions/download-artifact@v4 - with: - name: firmware-native-${{ steps.version.outputs.long }}.zip - merge-multiple: true - - - name: Display structure of downloaded files - run: ls -R - - - name: build .debpkg - run: | - mkdir -p .debpkg/DEBIAN - mkdir -p .debpkg/usr/share/meshtasticd/web - mkdir -p .debpkg/usr/sbin - mkdir -p .debpkg/etc/meshtasticd - mkdir -p .debpkg/etc/meshtasticd/config.d - mkdir -p .debpkg/etc/meshtasticd/available.d - mkdir -p .debpkg/usr/lib/systemd/system/ - tar -xf build.tar -C .debpkg/usr/share/meshtasticd/web - shopt -s dotglob nullglob - if [ -d .debpkg/usr/share/meshtasticd/web/build ]; then mv .debpkg/usr/share/meshtasticd/web/build/* .debpkg/usr/share/meshtasticd/web/; fi - if [ -d .debpkg/usr/share/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/meshtasticd/web/build; fi - if [ -d .debpkg/usr/share/meshtasticd/web/.DS_Store ]; then rm -f .debpkg/usr/share/meshtasticd/web/.DS_Store; fi - gunzip .debpkg/usr/share/meshtasticd/web/ -r - cp release/meshtasticd_linux_x86_64 .debpkg/usr/sbin/meshtasticd - cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml - cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/ -r - chmod +x .debpkg/usr/sbin/meshtasticd - cp bin/meshtasticd.service .debpkg/usr/lib/systemd/system/meshtasticd.service - echo "/etc/meshtasticd/config.yaml" > .debpkg/DEBIAN/conffiles - chmod +x .debpkg/DEBIAN/conffiles - # Transition /usr/share/doc/meshtasticd to /usr/share/meshtasticd - echo "rm -rf /usr/share/doc/meshtasticd" > .debpkg/DEBIAN/preinst - chmod +x .debpkg/DEBIAN/preinst - echo "ln -sf /usr/share/meshtasticd /usr/share/doc/meshtasticd" > .debpkg/DEBIAN/postinst - chmod +x .debpkg/DEBIAN/postinst - - - uses: jiro4989/build-deb-action@v3 - with: - package: meshtasticd - package_root: .debpkg - maintainer: Jonathan Bennett - version: ${{ steps.version.outputs.long }} # refs/tags/v*.*.* - arch: amd64 - depends: libyaml-cpp0.7, openssl, libulfius2.7, libi2c0 - desc: Native Linux Meshtastic binary. - - - uses: actions/upload-artifact@v4 - with: - name: meshtasticd_${{ steps.version.outputs.long }}_amd64.deb - overwrite: true - path: | - ./*.deb diff --git a/.github/workflows/package_raspbian.yml b/.github/workflows/package_raspbian.yml deleted file mode 100644 index 62613f85f..000000000 --- a/.github/workflows/package_raspbian.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: Package Raspbian - -on: - workflow_call: - workflow_dispatch: - -permissions: - contents: write - packages: write - -jobs: - build-raspbian: - uses: ./.github/workflows/build_raspbian.yml - - package-raspbian: - runs-on: ubuntu-22.04 - needs: build-raspbian - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: recursive - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - - - name: Pull web ui - uses: dsaltares/fetch-gh-release-asset@master - with: - repo: meshtastic/web - file: build.tar - target: build.tar - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Get release version string - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version - - - name: Download artifacts - uses: actions/download-artifact@v4 - with: - name: firmware-raspbian-${{ steps.version.outputs.long }}.zip - merge-multiple: true - - - name: Display structure of downloaded files - run: ls -R - - - name: build .debpkg - run: | - mkdir -p .debpkg/DEBIAN - mkdir -p .debpkg/usr/share/meshtasticd/web - mkdir -p .debpkg/usr/sbin - mkdir -p .debpkg/etc/meshtasticd - mkdir -p .debpkg/etc/meshtasticd/config.d - mkdir -p .debpkg/etc/meshtasticd/available.d - mkdir -p .debpkg/usr/lib/systemd/system/ - tar -xf build.tar -C .debpkg/usr/share/meshtasticd/web - shopt -s dotglob nullglob - if [ -d .debpkg/usr/share/meshtasticd/web/build ]; then mv .debpkg/usr/share/meshtasticd/web/build/* .debpkg/usr/share/meshtasticd/web/; fi - if [ -d .debpkg/usr/share/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/meshtasticd/web/build; fi - if [ -d .debpkg/usr/share/meshtasticd/web/.DS_Store ]; then rm -f .debpkg/usr/share/meshtasticd/web/.DS_Store; fi - gunzip .debpkg/usr/share/meshtasticd/web/ -r - cp release/meshtasticd_linux_aarch64 .debpkg/usr/sbin/meshtasticd - cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml - cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/ -r - chmod +x .debpkg/usr/sbin/meshtasticd - cp bin/meshtasticd.service .debpkg/usr/lib/systemd/system/meshtasticd.service - echo "/etc/meshtasticd/config.yaml" > .debpkg/DEBIAN/conffiles - chmod +x .debpkg/DEBIAN/conffiles - # Transition /usr/share/doc/meshtasticd to /usr/share/meshtasticd - echo "rm -rf /usr/share/doc/meshtasticd" > .debpkg/DEBIAN/preinst - chmod +x .debpkg/DEBIAN/preinst - echo "ln -sf /usr/share/meshtasticd /usr/share/doc/meshtasticd" > .debpkg/DEBIAN/postinst - chmod +x .debpkg/DEBIAN/postinst - - - uses: jiro4989/build-deb-action@v3 - with: - package: meshtasticd - package_root: .debpkg - maintainer: Jonathan Bennett - version: ${{ steps.version.outputs.long }} # refs/tags/v*.*.* - arch: arm64 - depends: libyaml-cpp0.7, openssl, libulfius2.7, libi2c0 - desc: Native Linux Meshtastic binary. - - - uses: actions/upload-artifact@v4 - with: - name: meshtasticd_${{ steps.version.outputs.long }}_arm64.deb - overwrite: true - path: | - ./*.deb diff --git a/.github/workflows/package_raspbian_armv7l.yml b/.github/workflows/package_raspbian_armv7l.yml deleted file mode 100644 index 8a9df1710..000000000 --- a/.github/workflows/package_raspbian_armv7l.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: Package Raspbian - -on: - workflow_call: - workflow_dispatch: - -permissions: - contents: write - packages: write - -jobs: - build-raspbian_armv7l: - uses: ./.github/workflows/build_raspbian_armv7l.yml - - package-raspbian_armv7l: - runs-on: ubuntu-22.04 - needs: build-raspbian_armv7l - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: recursive - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - - - name: Pull web ui - uses: dsaltares/fetch-gh-release-asset@master - with: - repo: meshtastic/web - file: build.tar - target: build.tar - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Get release version string - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version - - - name: Download artifacts - uses: actions/download-artifact@v4 - with: - name: firmware-raspbian-armv7l-${{ steps.version.outputs.long }}.zip - merge-multiple: true - - - name: Display structure of downloaded files - run: ls -R - - - name: build .debpkg - run: | - mkdir -p .debpkg/DEBIAN - mkdir -p .debpkg/usr/share/meshtasticd/web - mkdir -p .debpkg/usr/sbin - mkdir -p .debpkg/etc/meshtasticd - mkdir -p .debpkg/etc/meshtasticd/config.d - mkdir -p .debpkg/etc/meshtasticd/available.d - mkdir -p .debpkg/usr/lib/systemd/system/ - tar -xf build.tar -C .debpkg/usr/share/meshtasticd/web - shopt -s dotglob nullglob - if [ -d .debpkg/usr/share/meshtasticd/web/build ]; then mv .debpkg/usr/share/meshtasticd/web/build/* .debpkg/usr/share/meshtasticd/web/; fi - if [ -d .debpkg/usr/share/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/meshtasticd/web/build; fi - if [ -d .debpkg/usr/share/meshtasticd/web/.DS_Store ]; then rm -f .debpkg/usr/share/meshtasticd/web/.DS_Store; fi - gunzip .debpkg/usr/share/meshtasticd/web/ -r - cp release/meshtasticd_linux_armv7l .debpkg/usr/sbin/meshtasticd - cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml - cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/ -r - chmod +x .debpkg/usr/sbin/meshtasticd - cp bin/meshtasticd.service .debpkg/usr/lib/systemd/system/meshtasticd.service - echo "/etc/meshtasticd/config.yaml" > .debpkg/DEBIAN/conffiles - chmod +x .debpkg/DEBIAN/conffiles - # Transition /usr/share/doc/meshtasticd to /usr/share/meshtasticd - echo "rm -rf /usr/share/doc/meshtasticd" > .debpkg/DEBIAN/preinst - chmod +x .debpkg/DEBIAN/preinst - echo "ln -sf /usr/share/meshtasticd /usr/share/doc/meshtasticd" > .debpkg/DEBIAN/postinst - chmod +x .debpkg/DEBIAN/postinst - - - uses: jiro4989/build-deb-action@v3 - with: - package: meshtasticd - package_root: .debpkg - maintainer: Jonathan Bennett - version: ${{ steps.version.outputs.long }} # refs/tags/v*.*.* - arch: armhf - depends: libyaml-cpp0.7, openssl, libulfius2.7, libi2c0 - desc: Native Linux Meshtastic binary. - - - uses: actions/upload-artifact@v4 - with: - name: meshtasticd_${{ steps.version.outputs.long }}_armhf.deb - overwrite: true - path: | - ./*.deb diff --git a/.github/workflows/release_channels.yml b/.github/workflows/release_channels.yml index a3a105d6d..9cdabde9e 100644 --- a/.github/workflows/release_channels.yml +++ b/.github/workflows/release_channels.yml @@ -37,9 +37,9 @@ jobs: ${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }} secrets: inherit - # hook-copr: - # uses: ./.github/workflows/hook_copr.yml - # with: - # copr_project: |- - # ${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }} - # secrets: inherit + hook-copr: + uses: ./.github/workflows/hook_copr.yml + with: + copr_project: |- + ${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }} + secrets: inherit diff --git a/bin/build-firmware.sh b/bin/build-firmware.sh new file mode 100644 index 000000000..c53f1b660 --- /dev/null +++ b/bin/build-firmware.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +sed -i 's/#-DBUILD_EPOCH=$UNIX_TIME/-DBUILD_EPOCH=$UNIX_TIME/' platformio.ini + +export PIP_BREAK_SYSTEM_PACKAGES=1 + +if (echo $2 | grep -q "esp32"); then + bin/build-esp32.sh $1 +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 +else + echo "Unknown target $2" + exit 1 +fi \ No newline at end of file diff --git a/debian/changelog b/debian/changelog index 1b371296b..3ec57b805 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,9 @@ -meshtasticd (2.5.21.0) UNRELEASED; urgency=medium +meshtasticd (2.5.22.0) UNRELEASED; urgency=medium * Initial packaging * GitHub Actions Automatic version bump * GitHub Actions Automatic version bump * GitHub Actions Automatic version bump + * GitHub Actions Automatic version bump - -- Austin Lane Sat, 25 Jan 2025 01:39:16 +0000 + -- Austin Lane Wed, 05 Feb 2025 01:10:33 +0000 diff --git a/debian/ci_pack_sdeb.sh b/debian/ci_pack_sdeb.sh index 1f311af93..a8b2252ae 100755 --- a/debian/ci_pack_sdeb.sh +++ b/debian/ci_pack_sdeb.sh @@ -11,7 +11,7 @@ platformio pkg install -e native -t platformio/tool-scons@4.40502.0 tar -cf pio.tar pio/ rm -rf pio # Download the latest meshtastic/web release build.tar to `web.tar` -curl -L https://github.com/meshtastic/web/releases/download/latest/build.tar -o web.tar +curl -L https://github.com/meshtastic/web/releases/latest/download/build.tar -o web.tar package=$(dpkg-parsechangelog --show-field Source) diff --git a/meshtasticd.spec.rpkg b/meshtasticd.spec.rpkg index 720e94408..0a0f03557 100644 --- a/meshtasticd.spec.rpkg +++ b/meshtasticd.spec.rpkg @@ -21,7 +21,7 @@ Summary: Meshtastic daemon for communicating with Meshtastic devices License: GPL-3.0 URL: https://github.com/meshtastic/firmware Source0: {{{ git_dir_pack }}} -Source1: https://github.com/meshtastic/web/releases/download/latest/build.tar +Source1: https://github.com/meshtastic/web/releases/latest/download/build.tar BuildRequires: systemd-rpm-macros BuildRequires: python3-devel diff --git a/protobufs b/protobufs index 7f13df0e5..b80785b16 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 7f13df0e5f7cbb07f0e6f3a57c0d86ad448738db +Subproject commit b80785b16bc0d243b97917998706e7bf209cd9d0 diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index 863f956cf..c2aae0381 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -449,7 +449,22 @@ bool GPS::setup() if (!didSerialInit) { int msglen = 0; if (tx_gpio && gnssModel == GNSS_MODEL_UNKNOWN) { +#ifdef TRACKER_T1000_E + // add power up/down strategy, improve ag3335 detection success + digitalWrite(PIN_GPS_EN, LOW); + delay(500); + digitalWrite(GPS_VRTC_EN, LOW); + delay(1000); + digitalWrite(GPS_VRTC_EN, HIGH); + delay(500); + digitalWrite(PIN_GPS_EN, HIGH); + delay(1000); +#endif +#ifdef TRACKER_T1000_E + if (probeTries < 5) { +#else if (probeTries < 2) { +#endif LOG_DEBUG("Probe for GPS at %d", serialSpeeds[speedSelect]); gnssModel = probe(serialSpeeds[speedSelect]); if (gnssModel == GNSS_MODEL_UNKNOWN) { @@ -460,7 +475,11 @@ bool GPS::setup() } } // Rare Serial Speeds +#ifdef TRACKER_T1000_E + if (probeTries == 5) { +#else if (probeTries == 2) { +#endif LOG_DEBUG("Probe for GPS at %d", rareSerialSpeeds[speedSelect]); gnssModel = probe(rareSerialSpeeds[speedSelect]); if (gnssModel == GNSS_MODEL_UNKNOWN) { @@ -772,6 +791,9 @@ void GPS::setPowerState(GPSPowerState newState, uint32_t sleepTime) setPowerPMU(true); // Power (PMU): on writePinStandby(false); // Standby (pin): awake (not standby) setPowerUBLOX(true); // Standby (UBLOX): awake +#ifdef GNSS_AIROHA + lastFixStartMsec = 0; +#endif break; case GPS_SOFTSLEEP: diff --git a/src/graphics/EInkDynamicDisplay.cpp b/src/graphics/EInkDynamicDisplay.cpp index 6664646b9..47012ca47 100644 --- a/src/graphics/EInkDynamicDisplay.cpp +++ b/src/graphics/EInkDynamicDisplay.cpp @@ -238,7 +238,7 @@ void EInkDynamicDisplay::checkRateLimiting() // Skip update: too soon for BACKGROUND if (frameFlags == BACKGROUND) { - if (Throttle::isWithinTimespanMs(previousRunMs, EINK_LIMIT_RATE_BACKGROUND_SEC * 1000)) { + if (Throttle::isWithinTimespanMs(previousRunMs, 30000)) { refresh = SKIPPED; reason = EXCEEDED_RATELIMIT_FULL; return; @@ -251,7 +251,7 @@ void EInkDynamicDisplay::checkRateLimiting() // Skip update: too soon for RESPONSIVE if (frameFlags & RESPONSIVE) { - if (Throttle::isWithinTimespanMs(previousRunMs, EINK_LIMIT_RATE_RESPONSIVE_SEC * 1000)) { + if (Throttle::isWithinTimespanMs(previousRunMs, 1000)) { refresh = SKIPPED; reason = EXCEEDED_RATELIMIT_FAST; LOG_DEBUG("refresh=SKIPPED, reason=EXCEEDED_RATELIMIT_FAST, frameFlags=0x%x", frameFlags); diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index c9004432f..4ee49e3c0 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -1446,9 +1446,9 @@ static void drawNodeInfo(OLEDDisplay *display, OLEDDisplayUiState *state, int16_ static char distStr[20]; if (config.display.units == meshtastic_Config_DisplayConfig_DisplayUnits_IMPERIAL) { - strncpy(distStr, "? mi", sizeof(distStr)); // might not have location data + strncpy(distStr, "? mi ?°", sizeof(distStr)); // might not have location data } else { - strncpy(distStr, "? km", sizeof(distStr)); + strncpy(distStr, "? km ?°", sizeof(distStr)); } meshtastic_NodeInfoLite *ourNode = nodeDB->getMeshNode(nodeDB->getNodeNum()); const char *fields[] = {username, lastStr, signalStr, distStr, NULL}; @@ -1481,18 +1481,6 @@ static void drawNodeInfo(OLEDDisplay *display, OLEDDisplayUiState *state, int16_ float d = GeoCoord::latLongToMeter(DegD(p.latitude_i), DegD(p.longitude_i), DegD(op.latitude_i), DegD(op.longitude_i)); - if (config.display.units == meshtastic_Config_DisplayConfig_DisplayUnits_IMPERIAL) { - if (d < (2 * MILES_TO_FEET)) - snprintf(distStr, sizeof(distStr), "%.0f ft", d * METERS_TO_FEET); - else - snprintf(distStr, sizeof(distStr), "%.1f mi", d * METERS_TO_FEET / MILES_TO_FEET); - } else { - if (d < 2000) - snprintf(distStr, sizeof(distStr), "%.0f m", d); - else - snprintf(distStr, sizeof(distStr), "%.1f km", d / 1000); - } - float bearingToOther = GeoCoord::bearing(DegD(op.latitude_i), DegD(op.longitude_i), DegD(p.latitude_i), DegD(p.longitude_i)); // If the top of the compass is a static north then bearingToOther can be drawn on the compass directly @@ -1500,6 +1488,23 @@ static void drawNodeInfo(OLEDDisplay *display, OLEDDisplayUiState *state, int16_ if (!config.display.compass_north_top) bearingToOther -= myHeading; screen->drawNodeHeading(display, compassX, compassY, compassDiam, bearingToOther); + + float bearingToOtherDegrees = (bearingToOther < 0) ? bearingToOther + 2*PI : bearingToOther; + bearingToOtherDegrees = bearingToOtherDegrees * 180 / PI; + + if (config.display.units == meshtastic_Config_DisplayConfig_DisplayUnits_IMPERIAL) { + if (d < (2 * MILES_TO_FEET)) + snprintf(distStr, sizeof(distStr), "%.0fft %.0f°", d * METERS_TO_FEET, bearingToOtherDegrees); + else + snprintf(distStr, sizeof(distStr), "%.1fmi %.0f°", d * METERS_TO_FEET / MILES_TO_FEET, bearingToOtherDegrees); + } else { + if (d < 2000) + snprintf(distStr, sizeof(distStr), "%.0fm %.0f°", d, bearingToOtherDegrees); + else + snprintf(distStr, sizeof(distStr), "%.1fkm %.0f°", d / 1000, bearingToOtherDegrees); + } + + } } if (!hasNodeHeading) { diff --git a/src/mesh/CryptoEngine.cpp b/src/mesh/CryptoEngine.cpp index 1624ab0d5..4613a6218 100644 --- a/src/mesh/CryptoEngine.cpp +++ b/src/mesh/CryptoEngine.cpp @@ -74,7 +74,7 @@ bool CryptoEngine::encryptCurve25519(uint32_t toNode, uint32_t fromNode, meshtas auth = bytesOut + numBytes; memcpy((uint8_t *)(auth + 8), &extraNonceTmp, sizeof(uint32_t)); // do not use dereference on potential non aligned pointers : *extraNonce = extraNonceTmp; - LOG_INFO("Random nonce value: %d", extraNonceTmp); + LOG_DEBUG("Random nonce value: %d", extraNonceTmp); if (remotePublic.size == 0) { LOG_DEBUG("Node %d or their public_key not found", toNode); return false; diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 762982287..9caa03928 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -23,7 +23,6 @@ #include "modules/NeighborInfoModule.h" #include #include -#include #include #include #include @@ -408,7 +407,7 @@ bool NodeDB::resetRadioConfig(bool factory_reset) rebootAtMsec = millis() + (5 * 1000); } -#if (defined(T_DECK) || defined(T_WATCH_S3) || defined(UNPHONE) || defined(PICOMPUTER_S3)) && defined(HAS_TFT) +#if (defined(T_DECK) || defined(T_WATCH_S3) || defined(UNPHONE) || defined(PICOMPUTER_S3)) && HAS_TFT // as long as PhoneAPI shares BT and TFT app switch BT off config.bluetooth.enabled = false; if (moduleConfig.external_notification.nag_timeout == 60) @@ -1529,4 +1528,4 @@ void recordCriticalError(meshtastic_CriticalErrorCode code, uint32_t address, co LOG_ERROR("A critical failure occurred, portduino is exiting"); exit(2); #endif -} \ No newline at end of file +} diff --git a/src/mesh/generated/meshtastic/config.pb.h b/src/mesh/generated/meshtastic/config.pb.h index 14aed9dfe..4747ddb5a 100644 --- a/src/mesh/generated/meshtastic/config.pb.h +++ b/src/mesh/generated/meshtastic/config.pb.h @@ -468,6 +468,9 @@ typedef struct _meshtastic_Config_DisplayConfig { bool wake_on_tap_or_motion; /* Indicates how to rotate or invert the compass output to accurate display on the display. */ meshtastic_Config_DisplayConfig_CompassOrientation compass_orientation; + /* If false (default), the device will display the time in 24-hour format on screen. + If true, the device will display the time in 12-hour format on screen. */ + bool use_12h_clock; } meshtastic_Config_DisplayConfig; /* Lora Config */ @@ -690,7 +693,7 @@ extern "C" { #define meshtastic_Config_PowerConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_Config_NetworkConfig_init_default {0, "", "", "", 0, _meshtastic_Config_NetworkConfig_AddressMode_MIN, false, meshtastic_Config_NetworkConfig_IpV4Config_init_default, "", 0} #define meshtastic_Config_NetworkConfig_IpV4Config_init_default {0, 0, 0, 0} -#define meshtastic_Config_DisplayConfig_init_default {0, _meshtastic_Config_DisplayConfig_GpsCoordinateFormat_MIN, 0, 0, 0, _meshtastic_Config_DisplayConfig_DisplayUnits_MIN, _meshtastic_Config_DisplayConfig_OledType_MIN, _meshtastic_Config_DisplayConfig_DisplayMode_MIN, 0, 0, _meshtastic_Config_DisplayConfig_CompassOrientation_MIN} +#define meshtastic_Config_DisplayConfig_init_default {0, _meshtastic_Config_DisplayConfig_GpsCoordinateFormat_MIN, 0, 0, 0, _meshtastic_Config_DisplayConfig_DisplayUnits_MIN, _meshtastic_Config_DisplayConfig_OledType_MIN, _meshtastic_Config_DisplayConfig_DisplayMode_MIN, 0, 0, _meshtastic_Config_DisplayConfig_CompassOrientation_MIN, 0} #define meshtastic_Config_LoRaConfig_init_default {0, _meshtastic_Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, _meshtastic_Config_LoRaConfig_RegionCode_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0} #define meshtastic_Config_BluetoothConfig_init_default {0, _meshtastic_Config_BluetoothConfig_PairingMode_MIN, 0} #define meshtastic_Config_SecurityConfig_init_default {{0, {0}}, {0, {0}}, 0, {{0, {0}}, {0, {0}}, {0, {0}}}, 0, 0, 0, 0} @@ -701,7 +704,7 @@ extern "C" { #define meshtastic_Config_PowerConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_Config_NetworkConfig_init_zero {0, "", "", "", 0, _meshtastic_Config_NetworkConfig_AddressMode_MIN, false, meshtastic_Config_NetworkConfig_IpV4Config_init_zero, "", 0} #define meshtastic_Config_NetworkConfig_IpV4Config_init_zero {0, 0, 0, 0} -#define meshtastic_Config_DisplayConfig_init_zero {0, _meshtastic_Config_DisplayConfig_GpsCoordinateFormat_MIN, 0, 0, 0, _meshtastic_Config_DisplayConfig_DisplayUnits_MIN, _meshtastic_Config_DisplayConfig_OledType_MIN, _meshtastic_Config_DisplayConfig_DisplayMode_MIN, 0, 0, _meshtastic_Config_DisplayConfig_CompassOrientation_MIN} +#define meshtastic_Config_DisplayConfig_init_zero {0, _meshtastic_Config_DisplayConfig_GpsCoordinateFormat_MIN, 0, 0, 0, _meshtastic_Config_DisplayConfig_DisplayUnits_MIN, _meshtastic_Config_DisplayConfig_OledType_MIN, _meshtastic_Config_DisplayConfig_DisplayMode_MIN, 0, 0, _meshtastic_Config_DisplayConfig_CompassOrientation_MIN, 0} #define meshtastic_Config_LoRaConfig_init_zero {0, _meshtastic_Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, _meshtastic_Config_LoRaConfig_RegionCode_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0} #define meshtastic_Config_BluetoothConfig_init_zero {0, _meshtastic_Config_BluetoothConfig_PairingMode_MIN, 0} #define meshtastic_Config_SecurityConfig_init_zero {{0, {0}}, {0, {0}}, 0, {{0, {0}}, {0, {0}}, {0, {0}}}, 0, 0, 0, 0} @@ -765,6 +768,7 @@ extern "C" { #define meshtastic_Config_DisplayConfig_heading_bold_tag 9 #define meshtastic_Config_DisplayConfig_wake_on_tap_or_motion_tag 10 #define meshtastic_Config_DisplayConfig_compass_orientation_tag 11 +#define meshtastic_Config_DisplayConfig_use_12h_clock_tag 12 #define meshtastic_Config_LoRaConfig_use_preset_tag 1 #define meshtastic_Config_LoRaConfig_modem_preset_tag 2 #define meshtastic_Config_LoRaConfig_bandwidth_tag 3 @@ -907,7 +911,8 @@ X(a, STATIC, SINGULAR, UENUM, oled, 7) \ X(a, STATIC, SINGULAR, UENUM, displaymode, 8) \ X(a, STATIC, SINGULAR, BOOL, heading_bold, 9) \ X(a, STATIC, SINGULAR, BOOL, wake_on_tap_or_motion, 10) \ -X(a, STATIC, SINGULAR, UENUM, compass_orientation, 11) +X(a, STATIC, SINGULAR, UENUM, compass_orientation, 11) \ +X(a, STATIC, SINGULAR, BOOL, use_12h_clock, 12) #define meshtastic_Config_DisplayConfig_CALLBACK NULL #define meshtastic_Config_DisplayConfig_DEFAULT NULL @@ -985,7 +990,7 @@ extern const pb_msgdesc_t meshtastic_Config_SessionkeyConfig_msg; #define MESHTASTIC_MESHTASTIC_CONFIG_PB_H_MAX_SIZE meshtastic_Config_size #define meshtastic_Config_BluetoothConfig_size 10 #define meshtastic_Config_DeviceConfig_size 98 -#define meshtastic_Config_DisplayConfig_size 30 +#define meshtastic_Config_DisplayConfig_size 32 #define meshtastic_Config_LoRaConfig_size 85 #define meshtastic_Config_NetworkConfig_IpV4Config_size 20 #define meshtastic_Config_NetworkConfig_size 202 diff --git a/src/mesh/generated/meshtastic/localonly.pb.h b/src/mesh/generated/meshtastic/localonly.pb.h index dc0f507c9..7a6712bf0 100644 --- a/src/mesh/generated/meshtastic/localonly.pb.h +++ b/src/mesh/generated/meshtastic/localonly.pb.h @@ -187,7 +187,7 @@ extern const pb_msgdesc_t meshtastic_LocalModuleConfig_msg; /* Maximum encoded size of messages (where known) */ #define MESHTASTIC_MESHTASTIC_LOCALONLY_PB_H_MAX_SIZE meshtastic_LocalConfig_size -#define meshtastic_LocalConfig_size 741 +#define meshtastic_LocalConfig_size 743 #define meshtastic_LocalModuleConfig_size 699 #ifdef __cplusplus diff --git a/src/modules/PositionModule.cpp b/src/modules/PositionModule.cpp index e0f5b513f..acbc3143d 100644 --- a/src/modules/PositionModule.cpp +++ b/src/modules/PositionModule.cpp @@ -276,7 +276,8 @@ meshtastic_MeshPacket *PositionModule::allocPositionPacket() meshtastic_MeshPacket *PositionModule::allocReply() { - if (lastSentToMesh && Throttle::isWithinTimespanMs(lastSentToMesh, 3 * 60 * 1000)) { + if (config.device.role != meshtastic_Config_DeviceConfig_Role_LOST_AND_FOUND && lastSentToMesh && + Throttle::isWithinTimespanMs(lastSentToMesh, 3 * 60 * 1000)) { LOG_DEBUG("Skip Position reply since we sent it <3min ago"); ignoreRequest = true; // Mark it as ignored for MeshModule return nullptr; diff --git a/src/modules/Telemetry/Sensor/INA226Sensor.cpp b/src/modules/Telemetry/Sensor/INA226Sensor.cpp index 1ee7cd92e..8b1cded60 100644 --- a/src/modules/Telemetry/Sensor/INA226Sensor.cpp +++ b/src/modules/Telemetry/Sensor/INA226Sensor.cpp @@ -40,14 +40,14 @@ bool INA226Sensor::getMetrics(meshtastic_Telemetry *measurement) measurement->variant.environment_metrics.has_current = true; // mV conversion to V - measurement->variant.environment_metrics.voltage = ina226.getBusVoltage() / 1000; + measurement->variant.environment_metrics.voltage = ina226.getBusVoltage(); measurement->variant.environment_metrics.current = ina226.getCurrent_mA(); return true; } uint16_t INA226Sensor::getBusVoltageMv() { - return lround(ina226.getBusVoltage()); + return lround(ina226.getBusVoltage() * 1000); } int16_t INA226Sensor::getCurrentMa() diff --git a/src/modules/WaypointModule.cpp b/src/modules/WaypointModule.cpp index b8b738309..08b48b682 100644 --- a/src/modules/WaypointModule.cpp +++ b/src/modules/WaypointModule.cpp @@ -135,20 +135,6 @@ void WaypointModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, myHeading = screen->estimatedHeading(DegD(op.latitude_i), DegD(op.longitude_i)); screen->drawCompassNorth(display, compassX, compassY, myHeading); - // Distance to Waypoint - float d = GeoCoord::latLongToMeter(DegD(wp.latitude_i), DegD(wp.longitude_i), DegD(op.latitude_i), DegD(op.longitude_i)); - if (config.display.units == meshtastic_Config_DisplayConfig_DisplayUnits_IMPERIAL) { - if (d < (2 * MILES_TO_FEET)) - snprintf(distStr, sizeof(distStr), "%.0f ft", d * METERS_TO_FEET); - else - snprintf(distStr, sizeof(distStr), "%.1f mi", d * METERS_TO_FEET / MILES_TO_FEET); - } else { - if (d < 2000) - snprintf(distStr, sizeof(distStr), "%.0f m", d); - else - snprintf(distStr, sizeof(distStr), "%.1f km", d / 1000); - } - // Compass bearing to waypoint float bearingToOther = GeoCoord::bearing(DegD(op.latitude_i), DegD(op.longitude_i), DegD(wp.latitude_i), DegD(wp.longitude_i)); @@ -157,6 +143,25 @@ void WaypointModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, if (!config.display.compass_north_top) bearingToOther -= myHeading; screen->drawNodeHeading(display, compassX, compassY, compassDiam, bearingToOther); + + float bearingToOtherDegrees = (bearingToOther < 0) ? bearingToOther + 2*PI : bearingToOther; + bearingToOtherDegrees = bearingToOtherDegrees * 180 / PI; + + // Distance to Waypoint + float d = GeoCoord::latLongToMeter(DegD(wp.latitude_i), DegD(wp.longitude_i), DegD(op.latitude_i), DegD(op.longitude_i)); + if (config.display.units == meshtastic_Config_DisplayConfig_DisplayUnits_IMPERIAL) { + if (d < (2 * MILES_TO_FEET)) + snprintf(distStr, sizeof(distStr), "%.0fft %.0f°", d * METERS_TO_FEET, bearingToOtherDegrees); + else + snprintf(distStr, sizeof(distStr), "%.1fmi %.0f°", d * METERS_TO_FEET / MILES_TO_FEET, bearingToOtherDegrees); + } else { + if (d < 2000) + snprintf(distStr, sizeof(distStr), "%.0fm %.0f°", d, bearingToOtherDegrees); + else + snprintf(distStr, sizeof(distStr), "%.1fkm %.0f°", d / 1000, bearingToOtherDegrees); + } + + } // If our node doesn't have position @@ -166,9 +171,9 @@ void WaypointModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, // ? in the distance field if (config.display.units == meshtastic_Config_DisplayConfig_DisplayUnits_IMPERIAL) - strncpy(distStr, "? mi", sizeof(distStr)); + strncpy(distStr, "? mi ?°", sizeof(distStr)); else - strncpy(distStr, "? km", sizeof(distStr)); + strncpy(distStr, "? km ?°", sizeof(distStr)); } // Draw compass circle diff --git a/src/serialization/JSONValue.cpp b/src/serialization/JSONValue.cpp index b2e9575bf..64dc10abe 100644 --- a/src/serialization/JSONValue.cpp +++ b/src/serialization/JSONValue.cpp @@ -22,7 +22,6 @@ * THE SOFTWARE. */ -#include #include #include #include diff --git a/variants/diy/nrf52_promicro_diy_tcxo/E80_RSSI_per_case.webp b/variants/diy/nrf52_promicro_diy_tcxo/E80_RSSI_per_case.webp new file mode 100644 index 000000000..825c3cbc0 Binary files /dev/null and b/variants/diy/nrf52_promicro_diy_tcxo/E80_RSSI_per_case.webp differ diff --git a/variants/diy/nrf52_promicro_diy_tcxo/readme.md b/variants/diy/nrf52_promicro_diy_tcxo/readme.md new file mode 100644 index 000000000..585ac36de --- /dev/null +++ b/variants/diy/nrf52_promicro_diy_tcxo/readme.md @@ -0,0 +1,107 @@ +# Notes + +## General + +The pinout is contained in the variant.h file, and a [generic schematic](./Schematic_Pro-Micro_Pinouts%202024-12-14.pdf) is located in this directory. + +### Note on DIO2, RXEN, TXEN, and RF switching + +Several modules require external switching between transmit (Tx) and receive (Rx). This can be achieved using several methods: + +1. Link the TXEN pin on the radio module to DIO2 on the same module, and then connect RXEN on the radio module to pin 0.17 on the Pro-Micro. +2. Use DIO2 to drive a logic inverter, so that when DIO2 is `high`, RXEN is `low`, and vice versa. +3. Use DIO2 to drive a pair of MOSFETs or transistors to supply the same function. + +RXEN is not required to be connected if the selected module already has internal RF switching, or if external RF switching logic is already applied. +Also worth noting that the Seeed WIO SX1262 in particular only has RXEN exposed (marked RF_SW) and has the DIO2-TXEN link internally. + +
+ + The table of known modules is at the bottom of the variant.h, and reproduced here for convenience. + +| Mfr | Module | TCXO | RF Switch | Notes | +| ------------ | ---------------- | ---- | --------- | ------------------------------------- | +| Ebyte | E22-900M22S | Yes | Ext | | +| Ebyte | E22-900MM22S | No | Ext | | +| Ebyte | E22-900M30S | Yes | Ext | | +| Ebyte | E22-900M33S | Yes | Ext | MAX_POWER must be set to 8 for this | +| Ebyte | E220-900M22S | No | Ext | LLCC68, looks like DIO3 not connected | +| AI-Thinker | RA-01SH | No | Int | SX1262 | +| Heltec | HT-RA62 | Yes | Int | | +| NiceRF | Lora1262 | yes | Int | | +| Waveshare | Core1262-HF | yes | Ext | | +| Waveshare | LoRa Node Module | yes | Int | | +| Seeed | Wio-SX1262 | yes | Ext | Cute! DIO2/TXEN are not exposed | +| AI-Thinker | RA-02 | No | Int | SX1278 **433mhz band only** | +| RF Solutions | RFM95 | No | Int | Untested | +| Ebyte | E80-900M2213S | Yes | Int | LR1121 radio | + +
+ +## LR1121 modules - E80 is the default + +The E80 from CDEbyte is the most obtainable module at present, and has been selected as the default option. + +Naturally, CDEbyte have chosen to ignore the generic Semtech impelementation of the RF switching logic and have supplied confusing and contradictory documentation, which is explained below. + +tl;dr: The E80 is chosen as the default. **If you wish to use another module, the table in `rfswitch.h` must be adjusted accordingly.** + +### E80 switching - the saga + +The CDEbyte implementation of the LR1121 is contained in their E80 module. As stated above, CDEbyte have chosen to ignore the generic Semtech implementation of the RF switching logic and have their own table, which is located at the bottom of the page [here](https://www.cdebyte.com/products/E80-900M2213S/2#Pin), and reflected on page 6 of their user manual, and reproduced below: + +| DIO5/RFSW0 | DIO6/RFSW1 | RF status | +| ---------- | ---------- | ----------------------------- | +| 0 | 0 | RX | +| 0 | 1 | TX (Sub-1GHz low power mode) | +| 1 | 0 | TX (Sub-1GHz high power mode) | +| 1 | 1 | TX(2.4GHz) | + +However, looking at the sample code they provide on page 9, the values would be: + +| DIO5/RFSW0 | DIO6/RFSW1 | RF status | +| ---------- | ---------- | ----------------------------- | +| 0 | 1 | RX | +| 1 | 1 | TX (Sub-1GHz low power mode) | +| 1 | 0 | TX (Sub-1GHz high power mode) | +| 0 | 0 | TX(2.4GHz) | + +The Semtech default, the values are (taken from [here](https://github.com/Lora-net/SWSD006/blob/v2.6.1/lib/app_subGHz_config_lr11xx.c#L145-L154)): + +
+ +```cpp + .rfswitch = { + .enable = LR11XX_SYSTEM_RFSW0_HIGH | LR11XX_SYSTEM_RFSW1_HIGH | LR11XX_SYSTEM_RFSW2_HIGH, + .standby = 0, + .rx = LR11XX_SYSTEM_RFSW0_HIGH, + .tx = LR11XX_SYSTEM_RFSW0_HIGH | LR11XX_SYSTEM_RFSW1_HIGH, + .tx_hp = LR11XX_SYSTEM_RFSW1_HIGH, + .tx_hf = 0, + .gnss = LR11XX_SYSTEM_RFSW2_HIGH, + .wifi = 0, + }, +``` + +
+ +| DIO5/RFSW0 | DIO6/RFSW1 | RF status | +| ---------- | ---------- | ----------------------------- | +| 1 | 0 | RX | +| 1 | 1 | TX (Sub-1GHz low power mode) | +| 0 | 1 | TX (Sub-1GHz high power mode) | +| 0 | 0 | TX(2.4GHz) | + +It is evident from the tables above that there is no real consistency to those provided by Ebyte. + +#### An experiment + +Tests were conducted in each of the three configurations between a known-good SX1262 and an E80, passing packets in both directions and recording the reported RSSI. The E80 was set at 22db and 14db to activate the high and low power settings respectively. The results are shown in the chart below. + +![Chart showing RSSI readings in each configuration and setting](./E80_RSSI_per_case.webp) + +## Conclusion + +The RF switching is based on the code example given. Logically, this shows the DIO5 and DIO6 are swapped compared to the reference design. + +If future DIYers wish to use an alternative module, the table in `rfswitch.h` must be adjusted accordingly. diff --git a/variants/diy/nrf52_promicro_diy_tcxo/rfswitch.h b/variants/diy/nrf52_promicro_diy_tcxo/rfswitch.h index 2258c3135..71508c037 100644 --- a/variants/diy/nrf52_promicro_diy_tcxo/rfswitch.h +++ b/variants/diy/nrf52_promicro_diy_tcxo/rfswitch.h @@ -1,17 +1,20 @@ #include "RadioLib.h" +// This is rewritten to match the requirements of the E80-900M2213S +// The E80 does not conform to the reference Semtech switches(!) and therefore needs a custom matrix. +// See footnote #3 in "https://www.cdebyte.com/products/E80-900M2213S/2#Pin" // RF Switch Matrix SubG RFO_HP_LF / RFO_LP_LF / RFI_[NP]_LF0 // DIO5 -> RFSW0_V1 // DIO6 -> RFSW1_V2 -// DIO7 -> ANT_CTRL_ON + ESP_IO9/LR_GPS_ANT_DC_EN -> RFI_GPS (Bias-T GPS) (LR11x0 only) +// DIO7 -> not connected on E80 module - note that GNSS and Wifi scanning are not possible. static const uint32_t rfswitch_dio_pins[] = {RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6, RADIOLIB_LR11X0_DIO7, RADIOLIB_NC, RADIOLIB_NC}; static const Module::RfSwitchMode_t rfswitch_table[] = { // mode DIO5 DIO6 DIO7 - {LR11x0::MODE_STBY, {LOW, LOW, LOW}}, {LR11x0::MODE_RX, {HIGH, LOW, LOW}}, - {LR11x0::MODE_TX, {LOW, HIGH, LOW}}, {LR11x0::MODE_TX_HP, {LOW, HIGH, LOW}}, + {LR11x0::MODE_STBY, {LOW, LOW, LOW}}, {LR11x0::MODE_RX, {LOW, HIGH, LOW}}, + {LR11x0::MODE_TX, {HIGH, HIGH, LOW}}, {LR11x0::MODE_TX_HP, {HIGH, LOW, LOW}}, {LR11x0::MODE_TX_HF, {LOW, LOW, LOW}}, {LR11x0::MODE_GNSS, {LOW, LOW, HIGH}}, {LR11x0::MODE_WIFI, {LOW, LOW, LOW}}, END_OF_MODE_TABLE, -}; \ No newline at end of file +}; diff --git a/variants/diy/nrf52_promicro_diy_tcxo/variant.h b/variants/diy/nrf52_promicro_diy_tcxo/variant.h index 5e939c023..de49018f4 100644 --- a/variants/diy/nrf52_promicro_diy_tcxo/variant.h +++ b/variants/diy/nrf52_promicro_diy_tcxo/variant.h @@ -22,26 +22,26 @@ extern "C" { /* NRF52 PRO MICRO PIN ASSIGNMENT -| Pin   | Function   |   | Pin     | Function     | RF95 | +| Pin   | Function   |   | Pin     | Function     | RF95 | | ----- | ----------- | --- | -------- | ------------ | ----- | -| Gnd   |             |   | vbat     |             | | -| P0.06 | Serial2 RX |   | vbat     |             | | -| P0.08 | Serial2 TX |   | Gnd     |             | | -| Gnd   |             |   | reset   |             | | -| Gnd   |             |   | ext_vcc | *see 0.13   | | -| P0.17 | RXEN       |   | P0.31   | BATTERY_PIN | | -| P0.20 | GPS_RX     |   | P0.29   | BUSY         | DIO0 | -| P0.22 | GPS_TX     |   | P0.02   | MISO | MISO | -| P0.24 | GPS_EN     |   | P1.15   | MOSI         | MOSI | -| P1.00 | BUTTON_PIN |   | P1.13   | CS           | CS   | -| P0.11 | SCL         |   | P1.11   | SCK         | SCK | -| P1.04 | SDA         |   | P0.10   | DIO1/IRQ     | DIO1 | -| P1.06 | Free pin   |   | P0.09   | RESET       | RST | -|       |             |   |         |             | | -|       | Mid board   |   |         | Internal     | | -| P1.01 | Free pin   |   | 0.15     | LED         | | -| P1.02 | Free pin   |   | 0.13     | 3V3_EN       | | -| P1.07 | Free pin   |   |         |             | | +| Gnd   |             |   | vbat     |             | | +| P0.06 | Serial2 RX |   | vbat     |             | | +| P0.08 | Serial2 TX |   | Gnd     |             | | +| Gnd   |             |   | reset   |             | | +| Gnd   |             |   | ext_vcc | *see 0.13   | | +| P0.17 | RXEN       |   | P0.31   | BATTERY_PIN | | +| P0.20 | GPS_RX     |   | P0.29   | BUSY         | DIO0 | +| P0.22 | GPS_TX     |   | P0.02   | MISO | MISO | +| P0.24 | GPS_EN     |   | P1.15   | MOSI         | MOSI | +| P1.00 | BUTTON_PIN |   | P1.13   | CS           | CS   | +| P0.11 | SCL         |   | P1.11   | SCK         | SCK | +| P1.04 | SDA         |   | P0.10   | DIO1/IRQ     | DIO1 | +| P1.06 | Free pin   |   | P0.09   | RESET       | RST | +|       |             |   |         |             | | +|       | Mid board   |   |         | Internal     | | +| P1.01 | Free pin   |   | 0.15     | LED         | | +| P1.02 | Free pin   |   | 0.13     | 3V3_EN       | | +| P1.07 | Free pin   |   |         |             | | */ // Number of pins defined in PinDescription array @@ -175,7 +175,7 @@ settings. | NiceRF | Lora1262 | yes | Int | | | Waveshare | Core1262-HF | yes | Ext | | | Waveshare | LoRa Node Module | yes | Int | | -| Seeed | Wio-SX1262 | yes | Int | Sooooo cute! | +| Seeed | Wio-SX1262 | yes | Ext | Cute! DIO2/TXEN are not exposed | | AI-Thinker | RA-02 | No | Int | SX1278 **433mhz band only** | | RF Solutions | RFM95 | No | Int | Untested | | Ebyte | E80-900M2213S | Yes | Int | LR1121 radio | @@ -193,4 +193,4 @@ settings. * Arduino objects - C++ only *----------------------------------------------------------------------------*/ -#endif \ No newline at end of file +#endif diff --git a/variants/heltec_vision_master_e213/platformio.ini b/variants/heltec_vision_master_e213/platformio.ini index 709ae321f..cc6f283b5 100644 --- a/variants/heltec_vision_master_e213/platformio.ini +++ b/variants/heltec_vision_master_e213/platformio.ini @@ -10,12 +10,8 @@ build_flags = -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 lib_deps = ${esp32s3_base.lib_deps} https://github.com/meshtastic/GxEPD2#b202ebfec6a4821e098cf7a625ba0f6f2400292d diff --git a/variants/heltec_vision_master_e290/platformio.ini b/variants/heltec_vision_master_e290/platformio.ini index e1ba100ae..06804e4f2 100644 --- a/variants/heltec_vision_master_e290/platformio.ini +++ b/variants/heltec_vision_master_e290/platformio.ini @@ -11,12 +11,8 @@ build_flags = -D EINK_HEIGHT=128 -D USE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk -D EINK_LIMIT_FASTREFRESH=10 ; How many consecutive fast-refreshes are permitted - -D EINK_LIMIT_RATE_BACKGROUND_SEC=30 ; Minimum interval between BACKGROUND updates - -D EINK_LIMIT_RATE_RESPONSIVE_SEC=1 ; Minimum interval between RESPONSIVE updates -D EINK_HASQUIRK_GHOSTING ; Display model is identified as "prone to ghosting" - -D EINK_HASQUIRK_WEAKFASTREFRESH ; Pixels set with fast-refresh are easy to clear, disrupted by sunlight -; -D EINK_LIMIT_GHOSTING_PX=2000 ; How much image ghosting is tolerated -; -D EINK_BACKGROUND_USES_FAST ; (If enabled) don't redraw RESPONSIVE frames at next BACKGROUND update + lib_deps = ${esp32s3_base.lib_deps} diff --git a/variants/heltec_wireless_paper/platformio.ini b/variants/heltec_wireless_paper/platformio.ini index afbbd8be9..a7045b182 100644 --- a/variants/heltec_wireless_paper/platformio.ini +++ b/variants/heltec_wireless_paper/platformio.ini @@ -10,12 +10,8 @@ build_flags = -D EINK_HEIGHT=122 -D USE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk -D EINK_LIMIT_FASTREFRESH=10 ; How many consecutive fast-refreshes are permitted - -D EINK_LIMIT_RATE_BACKGROUND_SEC=30 ; Minimum interval between BACKGROUND updates - -D EINK_LIMIT_RATE_RESPONSIVE_SEC=1 ; Minimum interval between RESPONSIVE updates -; -D EINK_LIMIT_GHOSTING_PX=2000 ; (Optional) How much image ghosting is tolerated -D EINK_BACKGROUND_USES_FAST ; (Optional) Use FAST refresh for both BACKGROUND and RESPONSIVE, until a limit is reached. -D EINK_HASQUIRK_GHOSTING ; Display model is identified as "prone to ghosting" - -D EINK_HASQUIRK_WEAKFASTREFRESH ; Pixels set with fast-refresh are easy to clear, disrupted by sunlight lib_deps = ${esp32s3_base.lib_deps} https://github.com/meshtastic/GxEPD2#b202ebfec6a4821e098cf7a625ba0f6f2400292d diff --git a/variants/heltec_wireless_paper_v1/platformio.ini b/variants/heltec_wireless_paper_v1/platformio.ini index c94bcacca..2ce7559f9 100644 --- a/variants/heltec_wireless_paper_v1/platformio.ini +++ b/variants/heltec_wireless_paper_v1/platformio.ini @@ -11,11 +11,7 @@ build_flags = -D EINK_HEIGHT=122 -D USE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk -D EINK_LIMIT_FASTREFRESH=5 ; How many consecutive fast-refreshes are permitted - -D EINK_LIMIT_RATE_BACKGROUND_SEC=30 ; Minimum interval between BACKGROUND updates - -D EINK_LIMIT_RATE_RESPONSIVE_SEC=1 ; Minimum interval between RESPONSIVE updates -D EINK_LIMIT_GHOSTING_PX=2000 ; (Optional) How much image ghosting is tolerated - ;-D EINK_BACKGROUND_USES_FAST ; (Optional) Use FAST refresh for both BACKGROUND and RESPONSIVE, until a limit is reached. - -D EINK_HASQUIRK_VICIOUSFASTREFRESH ; Identify that pixels drawn by fast-refresh are harder to clear lib_deps = ${esp32s3_base.lib_deps} https://github.com/meshtastic/GxEPD2#55f618961db45a23eff0233546430f1e5a80f63a diff --git a/variants/t-echo/platformio.ini b/variants/t-echo/platformio.ini index 5b295c96a..ce58c0b88 100644 --- a/variants/t-echo/platformio.ini +++ b/variants/t-echo/platformio.ini @@ -14,9 +14,6 @@ build_flags = ${nrf52840_base.build_flags} -Ivariants/t-echo -DEINK_HEIGHT=200 -DUSE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk -DEINK_LIMIT_FASTREFRESH=20 ; 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 -; -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/t-echo> diff --git a/variants/tlora_t3s3_epaper/platformio.ini b/variants/tlora_t3s3_epaper/platformio.ini index ceb4fbaf5..3f3b3fe50 100644 --- a/variants/tlora_t3s3_epaper/platformio.ini +++ b/variants/tlora_t3s3_epaper/platformio.ini @@ -12,11 +12,6 @@ build_flags = -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 - -DEINK_HASQUIRK_VICIOUSFASTREFRESH ; Identify that pixels drawn by fast-refresh are harder to clear - ;-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} diff --git a/variants/tracker-t1000-e/variant.h b/variants/tracker-t1000-e/variant.h index 6a1f99600..e65f26c93 100644 --- a/variants/tracker-t1000-e/variant.h +++ b/variants/tracker-t1000-e/variant.h @@ -55,7 +55,7 @@ extern "C" { #define BUTTON_PIN (0 + 6) // P0.06 #define BUTTON_ACTIVE_LOW false #define BUTTON_ACTIVE_PULLUP false -#define BUTTON_SENSE_TYPE 0x6 +#define BUTTON_SENSE_TYPE 0x5 // enable input pull-down #define HAS_WIRE 1 diff --git a/version.properties b/version.properties index efc42428c..2e207e21e 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 5 -build = 21 +build = 22