mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-20 18:31:28 +10:00
Compare commits
268
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9785369da9 | ||
|
|
aec98b61b9 | ||
|
|
99abfebc4a | ||
|
|
068f5af4d8 | ||
|
|
993c242202 | ||
|
|
3d4f0b895b | ||
|
|
3b29eea577 | ||
|
|
e7e34e86d5 | ||
|
|
5a009889cc | ||
|
|
c4bac04be3 | ||
|
|
b9bdc87367 | ||
|
|
3b079c91bf | ||
|
|
d693fd4232 | ||
|
|
163c54877c | ||
|
|
2e2993f180 | ||
|
|
450f2adab0 | ||
|
|
0ad1b66387 | ||
|
|
5716aeba3b | ||
|
|
723209b198 | ||
|
|
5a8ce60d68 | ||
|
|
c77b10a317 | ||
|
|
8fa5b4f7ce | ||
|
|
e30294b6da | ||
|
|
948c28afff | ||
|
|
d09433e453 | ||
|
|
139b970409 | ||
|
|
1fe9a41fb9 | ||
|
|
2aefd386b6 | ||
|
|
532a63e541 | ||
|
|
e4c5bfd161 | ||
|
|
ea3386f34a | ||
|
|
e1d238b75f | ||
|
|
286bc852b3 | ||
|
|
e282491cd8 | ||
|
|
58fee80b30 | ||
|
|
3673af46cf | ||
|
|
7404228555 | ||
|
|
76b6eaa48a | ||
|
|
344fe2f70b | ||
|
|
458e46b1ea | ||
|
|
6f5448fa61 | ||
|
|
d369825c38 | ||
|
|
4fbd5c9f80 | ||
|
|
aebcb34c80 | ||
|
|
39aefde18d | ||
|
|
b7379f1516 | ||
|
|
fe8bfa0069 | ||
|
|
52750927e3 | ||
|
|
3ef7a15a17 | ||
|
|
b155a63d3b | ||
|
|
60730a73c2 | ||
|
|
421f9afead | ||
|
|
429cf51539 | ||
|
|
d9e2b12097 | ||
|
|
d7d08a4725 | ||
|
|
0668b82858 | ||
|
|
0797378a4d | ||
|
|
a79b75a0d5 | ||
|
|
391928ed08 | ||
|
|
6cbb9ab09a | ||
|
|
f185abbcdd | ||
|
|
5d12edbe07 | ||
|
|
398d1adea1 | ||
|
|
393cd96ba2 | ||
|
|
6658ec2603 | ||
|
|
8390b65d24 | ||
|
|
b941dab900 | ||
|
|
ffe6f706f9 | ||
|
|
0ed537a336 | ||
|
|
86dad90573 | ||
|
|
20db5fdbb7 | ||
|
|
5b1ea922f3 | ||
|
|
5b94f580dc | ||
|
|
3d524be965 | ||
|
|
e87215b1ed | ||
|
|
4ec59ce75d | ||
|
|
cb28c38828 | ||
|
|
969aefa551 | ||
|
|
3f5828c0e9 | ||
|
|
5cf365245e | ||
|
|
fdd17ac75c | ||
|
|
9e40c8893f | ||
|
|
afd5e29bce | ||
|
|
20f838a61e | ||
|
|
58736f5184 | ||
|
|
22031c5886 | ||
|
|
fe4e75eb66 | ||
|
|
42075da09e | ||
|
|
6ba82ed5b6 | ||
|
|
935b0504d4 | ||
|
|
a8fed3256e | ||
|
|
1626836a71 | ||
|
|
66161da2a7 | ||
|
|
ab54e5ffc1 | ||
|
|
6bbdfe1797 | ||
|
|
7ea28d34b2 | ||
|
|
65bf1630b3 | ||
|
|
3972fe1fd0 | ||
|
|
5ced739a57 | ||
|
|
b7bf251798 | ||
|
|
90742fc87e | ||
|
|
f7f356e2e2 | ||
|
|
1fad7facd6 | ||
|
|
153ab81a9f | ||
|
|
8d73d67246 | ||
|
|
0d46943bb8 | ||
|
|
deb45e471c | ||
|
|
3601eabbf8 | ||
|
|
31794dc7bd | ||
|
|
eb2f3cef89 | ||
|
|
85be5965b0 | ||
|
|
1e34c1ef1b | ||
|
|
5f852a1c05 | ||
|
|
1d90ea6f1d | ||
|
|
65eee22396 | ||
|
|
cb938266c7 | ||
|
|
8093e2ed5a | ||
|
|
80af726877 | ||
|
|
3f5dc78744 | ||
|
|
563adc6aaa | ||
|
|
67f806b0a5 | ||
|
|
c7dc536640 | ||
|
|
6920a5f8b1 | ||
|
|
2b7a230977 | ||
|
|
1e16185fdd | ||
|
|
60c2592694 | ||
|
|
fc0ad4956e | ||
|
|
43aa90fc3f | ||
|
|
c28bdbd7e6 | ||
|
|
857c7b3a3a | ||
|
|
83cac93ca8 | ||
|
|
d34fa3e7df | ||
|
|
75cb8bb5ea | ||
|
|
2a99cc6a25 | ||
|
|
b5f98d1270 | ||
|
|
ef697319da | ||
|
|
efd68f9fad | ||
|
|
3a74e049ab | ||
|
|
3b1b308357 | ||
|
|
5a068431ed | ||
|
|
25f086a64f | ||
|
|
a93d4d7e9d | ||
|
|
54781cf51a | ||
|
|
ad7d19c317 | ||
|
|
58496e56d2 | ||
|
|
2c18a41613 | ||
|
|
c65eecc295 | ||
|
|
cac45d9ced | ||
|
|
02d42f87d3 | ||
|
|
9c439f8d0a | ||
|
|
cf998f03b6 | ||
|
|
f9d1f2414a | ||
|
|
13b25c0614 | ||
|
|
607b631114 | ||
|
|
99e88bb499 | ||
|
|
4f84cf011d | ||
|
|
417ca86c30 | ||
|
|
7df37f8254 | ||
|
|
0726a9f774 | ||
|
|
f8cc1d6046 | ||
|
|
9383d0bcfc | ||
|
|
f615990c00 | ||
|
|
8feb34e7a8 | ||
|
|
a5523b04ef | ||
|
|
af518fbd2b | ||
|
|
8c37d6923b | ||
|
|
299ef95f25 | ||
|
|
8f81b194d3 | ||
|
|
6bc3e31537 | ||
|
|
840b29860f | ||
|
|
15460c8f97 | ||
|
|
a77ac21e0d | ||
|
|
2b6d8f6824 | ||
|
+19 |
4c91beeda9 | ||
|
|
d0cf79a991 | ||
|
|
86986d6337 | ||
|
|
5408e81de7 | ||
|
|
178c3114d9 | ||
|
|
357a33f454 | ||
|
|
4fccda26c6 | ||
|
|
f94c01b452 | ||
|
|
3ca68e7788 | ||
|
|
a4ba312579 | ||
|
|
a227fd7028 | ||
|
|
6b44b5786e | ||
|
|
5feba46b53 | ||
|
|
0cbf53b7a7 | ||
|
|
321ccbf5e2 | ||
|
|
57268bf4ea | ||
|
|
56fd9c7813 | ||
|
|
32db70037d | ||
|
|
778823e623 | ||
|
|
545826d319 | ||
|
|
dbef1de286 | ||
|
|
b0bd3df226 | ||
|
|
167bcf2863 | ||
|
|
ff485d5ff8 | ||
|
|
184e4ddd83 | ||
|
|
aed2c7ca9b | ||
|
|
e1f9ccd337 | ||
|
|
df14561560 | ||
|
|
c8ff02cc35 | ||
|
|
d770ef27c7 | ||
|
|
71edf2fb48 | ||
|
|
c79e1925d9 | ||
|
|
3d649d518f | ||
|
|
947f8176dc | ||
|
|
d5bde83ff5 | ||
|
|
c3321771ef | ||
|
|
b6e5534a8c | ||
|
|
f10d786d82 | ||
|
|
1a7f560372 | ||
|
|
38c7ad0ed6 | ||
|
|
bfbce2e314 | ||
|
+1 |
15297cb56f | ||
|
|
6d299eac67 | ||
|
|
31fe15bb73 | ||
|
|
97983d8014 | ||
|
|
c366e53326 | ||
|
|
648148af8a | ||
|
|
f96a8593f2 | ||
|
|
75f3d123f3 | ||
|
|
44941b79cd | ||
|
|
65adfa894f | ||
|
|
a092f6bb22 | ||
|
|
927a4e47b8 | ||
|
|
af18f061cf | ||
|
|
b12cac3e00 | ||
|
|
73adeee385 | ||
|
|
4ce554e09d | ||
|
|
eb145f8adc | ||
|
|
a60e7cfe62 | ||
|
|
39139cc2ea | ||
|
|
4a4b1f4a87 | ||
|
|
779e446d14 | ||
|
|
2361776992 | ||
|
|
94b7149958 | ||
|
|
ac611c4b62 | ||
|
|
89df5ef669 | ||
|
|
bfc3eebd54 | ||
|
|
538a5f0dfc | ||
|
|
b7db22055d | ||
|
|
0703e0e6d7 | ||
|
|
f514bc230b | ||
|
|
4570163190 | ||
|
|
0022148323 | ||
|
|
9d06c1bf34 | ||
|
|
1d30342c00 | ||
|
|
86fa917362 | ||
|
|
3575c48e36 | ||
|
|
469abe8dec | ||
|
|
fefce15b1a | ||
|
|
50ea7ace98 | ||
|
|
96f371eafd | ||
|
|
dbc52c7576 | ||
|
|
232e0412ff | ||
|
|
b94659ff6a | ||
|
|
059e17b3e2 | ||
|
|
b09f6db9e2 | ||
|
|
64706153e0 | ||
|
|
f94043e4f2 | ||
|
|
bc82cd803c | ||
|
|
c15b6de138 | ||
|
|
fbf32b93b6 | ||
|
|
b7289f7f2d | ||
|
|
d3d932ccee | ||
|
|
3a267b440d | ||
|
|
b1821bfd4f |
@@ -20,7 +20,7 @@ ENV PIP_ROOT_USER_ACTION=ignore
|
|||||||
RUN apt-get update && apt-get install --no-install-recommends -y \
|
RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||||
cmake git zip libgpiod-dev libbluetooth-dev libi2c-dev \
|
cmake git zip libgpiod-dev libbluetooth-dev libi2c-dev \
|
||||||
libunistring-dev libmicrohttpd-dev libgnutls28-dev libgcrypt20-dev \
|
libunistring-dev libmicrohttpd-dev libgnutls28-dev libgcrypt20-dev \
|
||||||
libusb-1.0-0-dev libssl-dev pkg-config libsqlite3-dev && \
|
libusb-1.0-0-dev libssl-dev pkg-config libsqlite3-dev libsdl2-dev && \
|
||||||
apt-get clean && rm -rf /var/lib/apt/lists/* && \
|
apt-get clean && rm -rf /var/lib/apt/lists/* && \
|
||||||
pip install --no-cache-dir -U \
|
pip install --no-cache-dir -U \
|
||||||
platformio==6.1.16 \
|
platformio==6.1.16 \
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ runs:
|
|||||||
id: version
|
id: version
|
||||||
|
|
||||||
- name: Store binaries as an artifact
|
- name: Store binaries as an artifact
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: firmware-${{ inputs.arch }}-${{ inputs.board }}-${{ steps.version.outputs.long }}
|
name: firmware-${{ inputs.arch }}-${{ inputs.board }}-${{ steps.version.outputs.long }}
|
||||||
overwrite: true
|
overwrite: true
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ runs:
|
|||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
@@ -4,16 +4,16 @@
|
|||||||
|
|
||||||
- Before starting on some new big chunk of code, it it is optional but highly recommended to open an issue first
|
- Before starting on some new big chunk of code, it it is optional but highly recommended to open an issue first
|
||||||
to say "Hey, I think this idea X should be implemented and I'm starting work on it. My general plan is Y, any feedback
|
to say "Hey, I think this idea X should be implemented and I'm starting work on it. My general plan is Y, any feedback
|
||||||
is appreciated." This will allow other devs to potentially save you time by not accidentially duplicating work etc...
|
is appreciated." This will allow other devs to potentially save you time by not accidentally duplicating work etc...
|
||||||
- Please do not check in files that don't have real changes
|
- Please do not check in files that don't have real changes
|
||||||
- Please do not reformat lines that you didn't have to change the code on
|
- Please do not reformat lines that you didn't have to change the code on
|
||||||
- We recommend using the [Visual Studio Code](https://platformio.org/install/ide?install=vscode) editor along with the ['Trunk Check' extension](https://marketplace.visualstudio.com/items?itemName=trunk.io) (In beta for windows, WSL2 for the linux version),
|
- We recommend using the [Visual Studio Code](https://platformio.org/install/ide?install=vscode) editor along with the ['Trunk Check' extension](https://marketplace.visualstudio.com/items?itemName=trunk.io) (In beta for windows, WSL2 for the Linux version),
|
||||||
because it automatically follows our indentation rules and its auto reformatting will not cause spurious changes to lines.
|
because it automatically follows our indentation rules and its auto reformatting will not cause spurious changes to lines.
|
||||||
- If your PR fixes a bug, mention "fixes #bugnum" somewhere in your pull request description.
|
- If your PR fixes a bug, mention "fixes #bugnum" somewhere in your pull request description.
|
||||||
- If your other co-developers have comments on your PR please tweak as needed.
|
- If your other co-developers have comments on your PR please tweak as needed.
|
||||||
- Please also enable "Allow edits by maintainers".
|
- Please also enable "Allow edits by maintainers".
|
||||||
- Please do not submit untested code.
|
- Please do not submit untested code.
|
||||||
- If you do not have the affected hardware to test your code changes adequately against regressions, please indicate this, so that contributors and commnunity members can help test your changes.
|
- If you do not have the affected hardware to test your code changes adequately against regressions, please indicate this, so that contributors and community members can help test your changes.
|
||||||
- If your PR gets accepted you can request a "Contributor" role in the Meshtastic Discord
|
- If your PR gets accepted you can request a "Contributor" role in the Meshtastic Discord
|
||||||
|
|
||||||
## 🤝 Attestations
|
## 🤝 Attestations
|
||||||
|
|||||||
@@ -16,8 +16,7 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: read
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-debian-src:
|
build-debian-src:
|
||||||
@@ -28,8 +27,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
path: meshtasticd
|
path: meshtasticd
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -42,7 +39,8 @@ jobs:
|
|||||||
sudo mk-build-deps --install --remove --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
|
sudo mk-build-deps --install --remove --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
|
||||||
|
|
||||||
- name: Import GPG key
|
- name: Import GPG key
|
||||||
uses: crazy-max/ghaction-import-gpg@v6
|
if: github.event_name != 'pull_request' && github.event_name != 'pull_request_target'
|
||||||
|
uses: crazy-max/ghaction-import-gpg@v7
|
||||||
with:
|
with:
|
||||||
gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }}
|
gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }}
|
||||||
id: gpg
|
id: gpg
|
||||||
@@ -60,11 +58,11 @@ jobs:
|
|||||||
run: debian/ci_pack_sdeb.sh
|
run: debian/ci_pack_sdeb.sh
|
||||||
env:
|
env:
|
||||||
SERIES: ${{ inputs.series }}
|
SERIES: ${{ inputs.series }}
|
||||||
GPG_KEY_ID: ${{ steps.gpg.outputs.keyid }}
|
GPG_KEY_ID: ${{ steps.gpg.outputs.keyid || '' }}
|
||||||
PKG_VERSION: ${{ steps.version.outputs.deb }}
|
PKG_VERSION: ${{ steps.version.outputs.deb }}
|
||||||
|
|
||||||
- name: Store binaries as an artifact
|
- name: Store binaries as an artifact
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: firmware-debian-${{ steps.version.outputs.deb }}~${{ inputs.series }}-src
|
name: firmware-debian-${{ steps.version.outputs.deb }}~${{ inputs.series }}-src
|
||||||
overwrite: true
|
overwrite: true
|
||||||
|
|||||||
@@ -26,8 +26,6 @@ jobs:
|
|||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- name: Build ${{ inputs.platform }}
|
- name: Build ${{ inputs.platform }}
|
||||||
id: build
|
id: build
|
||||||
@@ -111,7 +109,7 @@ jobs:
|
|||||||
echo "</details>" >> $GITHUB_STEP_SUMMARY
|
echo "</details>" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
- name: Store binaries as an artifact
|
- name: Store binaries as an artifact
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v7
|
||||||
id: upload-firmware
|
id: upload-firmware
|
||||||
with:
|
with:
|
||||||
name: firmware-${{ inputs.platform }}-${{ inputs.pio_env }}-${{ inputs.version }}
|
name: firmware-${{ inputs.platform }}-${{ inputs.pio_env }}-${{ inputs.version }}
|
||||||
@@ -127,7 +125,7 @@ jobs:
|
|||||||
release/device-*.bat
|
release/device-*.bat
|
||||||
|
|
||||||
- name: Store manifests as an artifact
|
- name: Store manifests as an artifact
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v7
|
||||||
id: upload-manifest
|
id: upload-manifest
|
||||||
with:
|
with:
|
||||||
name: manifest-${{ inputs.platform }}-${{ inputs.pio_env }}-${{ inputs.version }}
|
name: manifest-${{ inputs.platform }}-${{ inputs.pio_env }}-${{ inputs.version }}
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ jobs:
|
|||||||
|
|
||||||
gather-artifacts:
|
gather-artifacts:
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: read
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [version, build]
|
needs: [version, build]
|
||||||
@@ -98,7 +98,7 @@ jobs:
|
|||||||
ref: ${{github.event.pull_request.head.ref}}
|
ref: ${{github.event.pull_request.head.ref}}
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||||
|
|
||||||
- uses: actions/download-artifact@v7
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
path: ./
|
path: ./
|
||||||
pattern: firmware-*-*
|
pattern: firmware-*-*
|
||||||
@@ -111,7 +111,7 @@ jobs:
|
|||||||
run: mv -b -t ./ ./bin/device-*.sh ./bin/device-*.bat
|
run: mv -b -t ./ ./bin/device-*.sh ./bin/device-*.bat
|
||||||
|
|
||||||
- name: Repackage in single firmware zip
|
- name: Repackage in single firmware zip
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: firmware-${{inputs.target}}-${{ needs.version.outputs.long }}
|
name: firmware-${{inputs.target}}-${{ needs.version.outputs.long }}
|
||||||
overwrite: true
|
overwrite: true
|
||||||
@@ -127,7 +127,7 @@ jobs:
|
|||||||
./Meshtastic_nRF52_factory_erase*.uf2
|
./Meshtastic_nRF52_factory_erase*.uf2
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
- uses: actions/download-artifact@v7
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
pattern: firmware-*-${{ needs.version.outputs.long }}
|
pattern: firmware-*-${{ needs.version.outputs.long }}
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
@@ -146,7 +146,7 @@ jobs:
|
|||||||
run: zip -j -9 -r ./firmware-${{inputs.target}}-${{ needs.version.outputs.long }}.zip ./output
|
run: zip -j -9 -r ./firmware-${{inputs.target}}-${{ needs.version.outputs.long }}.zip ./output
|
||||||
|
|
||||||
- name: Repackage in single elfs zip
|
- name: Repackage in single elfs zip
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: debug-elfs-${{inputs.target}}-${{ needs.version.outputs.long }}.zip
|
name: debug-elfs-${{inputs.target}}-${{ needs.version.outputs.long }}.zip
|
||||||
overwrite: true
|
overwrite: true
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ on:
|
|||||||
- .github/workflows/hook_copr.yml
|
- .github/workflows/hook_copr.yml
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -35,8 +35,8 @@ jobs:
|
|||||||
series:
|
series:
|
||||||
- jammy # 22.04 LTS
|
- jammy # 22.04 LTS
|
||||||
- noble # 24.04 LTS
|
- noble # 24.04 LTS
|
||||||
- plucky # 25.04
|
|
||||||
- questing # 25.10
|
- questing # 25.10
|
||||||
|
- resolute # 26.04 LTS
|
||||||
uses: ./.github/workflows/package_ppa.yml
|
uses: ./.github/workflows/package_ppa.yml
|
||||||
with:
|
with:
|
||||||
ppa_repo: ppa:meshtastic/daily
|
ppa_repo: ppa:meshtastic/daily
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ on:
|
|||||||
value: ${{ jobs.docker-build.outputs.digest }}
|
value: ${{ jobs.docker-build.outputs.digest }}
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -50,8 +50,6 @@ jobs:
|
|||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- name: Get release version string
|
- name: Get release version string
|
||||||
run: |
|
run: |
|
||||||
@@ -60,16 +58,16 @@ jobs:
|
|||||||
|
|
||||||
- name: Docker login
|
- name: Docker login
|
||||||
if: ${{ inputs.push }}
|
if: ${{ inputs.push }}
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v4
|
||||||
with:
|
with:
|
||||||
username: meshtastic
|
username: meshtastic
|
||||||
password: ${{ secrets.DOCKER_FIRMWARE_TOKEN }}
|
password: ${{ secrets.DOCKER_FIRMWARE_TOKEN }}
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v4
|
||||||
|
|
||||||
- name: Docker setup
|
- name: Docker setup
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
- name: Sanitize platform string
|
- name: Sanitize platform string
|
||||||
id: sanitize_platform
|
id: sanitize_platform
|
||||||
@@ -78,7 +76,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Docker tag
|
- name: Docker tag
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v6
|
||||||
with:
|
with:
|
||||||
images: meshtastic/meshtasticd
|
images: meshtastic/meshtasticd
|
||||||
tags: |
|
tags: |
|
||||||
@@ -86,7 +84,7 @@ jobs:
|
|||||||
flavor: latest=false
|
flavor: latest=false
|
||||||
|
|
||||||
- name: Docker build and push
|
- name: Docker build and push
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v7
|
||||||
id: docker_variant
|
id: docker_variant
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -86,8 +86,6 @@ jobs:
|
|||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- name: Get release version string
|
- name: Get release version string
|
||||||
run: |
|
run: |
|
||||||
@@ -139,14 +137,14 @@ jobs:
|
|||||||
id: tags
|
id: tags
|
||||||
|
|
||||||
- name: Docker login
|
- name: Docker login
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v4
|
||||||
with:
|
with:
|
||||||
username: meshtastic
|
username: meshtastic
|
||||||
password: ${{ secrets.DOCKER_FIRMWARE_TOKEN }}
|
password: ${{ secrets.DOCKER_FIRMWARE_TOKEN }}
|
||||||
|
|
||||||
- name: Docker meta (Debian)
|
- name: Docker meta (Debian)
|
||||||
id: meta_debian
|
id: meta_debian
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v6
|
||||||
with:
|
with:
|
||||||
images: meshtastic/meshtasticd
|
images: meshtastic/meshtasticd
|
||||||
tags: |
|
tags: |
|
||||||
@@ -167,7 +165,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Docker meta (Alpine)
|
- name: Docker meta (Alpine)
|
||||||
id: meta_alpine
|
id: meta_alpine
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v6
|
||||||
with:
|
with:
|
||||||
images: meshtastic/meshtasticd
|
images: meshtastic/meshtasticd
|
||||||
tags: |
|
tags: |
|
||||||
|
|||||||
@@ -11,8 +11,7 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: read
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-copr-hook:
|
build-copr-hook:
|
||||||
@@ -22,8 +21,6 @@ jobs:
|
|||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
ref: ${{ github.ref }}
|
|
||||||
repository: ${{ github.repository }}
|
|
||||||
|
|
||||||
- name: Trigger COPR build
|
- name: Trigger COPR build
|
||||||
uses: vidplace7/copr-build@main
|
uses: vidplace7/copr-build@main
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ on:
|
|||||||
- "**.md"
|
- "**.md"
|
||||||
- version.properties
|
- version.properties
|
||||||
|
|
||||||
# Note: This is different from "pull_request". Need to specify ref when doing checkouts.
|
pull_request:
|
||||||
pull_request_target:
|
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- develop
|
- develop
|
||||||
@@ -29,6 +28,8 @@ on:
|
|||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
setup:
|
setup:
|
||||||
strategy:
|
strategy:
|
||||||
@@ -88,8 +89,6 @@ jobs:
|
|||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
- name: Check ${{ matrix.check.board }}
|
- name: Check ${{ matrix.check.board }}
|
||||||
uses: meshtastic/gh-action-firmware@main
|
uses: meshtastic/gh-action-firmware@main
|
||||||
with:
|
with:
|
||||||
@@ -126,9 +125,16 @@ jobs:
|
|||||||
|
|
||||||
test-native:
|
test-native:
|
||||||
if: ${{ !contains(github.ref_name, 'event/') && github.repository == 'meshtastic/firmware' }}
|
if: ${{ !contains(github.ref_name, 'event/') && github.repository == 'meshtastic/firmware' }}
|
||||||
|
permissions: # Needed for dorny/test-reporter.
|
||||||
|
contents: read
|
||||||
|
actions: read
|
||||||
|
checks: write
|
||||||
uses: ./.github/workflows/test_native.yml
|
uses: ./.github/workflows/test_native.yml
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
|
permissions: # Needed for pushing to GHCR.
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -153,9 +159,6 @@ jobs:
|
|||||||
gather-artifacts:
|
gather-artifacts:
|
||||||
# trunk-ignore(checkov/CKV2_GHA_1)
|
# trunk-ignore(checkov/CKV2_GHA_1)
|
||||||
if: github.repository == 'meshtastic/firmware'
|
if: github.repository == 'meshtastic/firmware'
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -173,11 +176,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v7
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
path: ./
|
path: ./
|
||||||
pattern: firmware-${{matrix.arch}}-*
|
pattern: firmware-${{matrix.arch}}-*
|
||||||
@@ -187,7 +187,7 @@ jobs:
|
|||||||
run: ls -R
|
run: ls -R
|
||||||
|
|
||||||
- name: Repackage in single firmware zip
|
- name: Repackage in single firmware zip
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
name: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
||||||
overwrite: true
|
overwrite: true
|
||||||
@@ -205,7 +205,7 @@ jobs:
|
|||||||
./Meshtastic_nRF52_factory_erase*.uf2
|
./Meshtastic_nRF52_factory_erase*.uf2
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
- uses: actions/download-artifact@v7
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
name: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
name: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
@@ -224,20 +224,13 @@ jobs:
|
|||||||
run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ needs.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
|
- name: Repackage in single elfs zip
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
name: debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
||||||
overwrite: true
|
overwrite: true
|
||||||
path: ./*.elf
|
path: ./*.elf
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
- uses: scruplelesswizard/comment-artifact@main
|
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
|
||||||
with:
|
|
||||||
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 }}
|
|
||||||
|
|
||||||
shame:
|
shame:
|
||||||
if: github.repository == 'meshtastic/firmware'
|
if: github.repository == 'meshtastic/firmware'
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
@@ -245,42 +238,44 @@ jobs:
|
|||||||
needs: [build]
|
needs: [build]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
if: github.event_name == 'pull_request_target'
|
if: github.event_name == 'pull_request'
|
||||||
with:
|
with:
|
||||||
filter: blob:none # means we download all the git history but none of the commit (except ones with checkout like the head)
|
filter: blob:none # means we download all the git history but none of the commit (except ones with checkout like the head)
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Download the current manifests
|
- name: Download the current manifests
|
||||||
uses: actions/download-artifact@v7
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
path: ./manifests-new/
|
path: ./manifests-new/
|
||||||
pattern: manifest-*
|
pattern: manifest-*
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
- name: Upload combined manifests for later commit and global stats crunching.
|
- name: Upload combined manifests for later commit and global stats crunching.
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v7
|
||||||
id: upload-manifest
|
id: upload-manifest
|
||||||
with:
|
with:
|
||||||
name: manifests-${{ github.sha }}
|
name: manifests-${{ github.sha }}
|
||||||
overwrite: true
|
overwrite: true
|
||||||
path: manifests-new/*.mt.json
|
path: manifests-new/*.mt.json
|
||||||
- name: Find the merge base
|
- name: Find the merge base
|
||||||
if: github.event_name == 'pull_request_target'
|
if: github.event_name == 'pull_request'
|
||||||
run: echo "MERGE_BASE=$(git merge-base "origin/$base" "$head")" >> $GITHUB_ENV
|
run: echo "MERGE_BASE=$(git merge-base "origin/$base" "$head")" >> $GITHUB_ENV
|
||||||
env:
|
env:
|
||||||
base: ${{ github.base_ref }}
|
base: ${{ github.base_ref }}
|
||||||
head: ${{ github.sha }}
|
head: ${{ github.sha }}
|
||||||
# Currently broken (for-loop through EVERY artifact -- rate limiting)
|
# Currently broken (for-loop through EVERY artifact -- rate limiting)
|
||||||
# - name: Download the old manifests
|
# - name: Download the old manifests
|
||||||
# if: github.event_name == 'pull_request_target'
|
# if: github.event_name == 'pull_request'
|
||||||
# run: gh run download -R "$repo" --name "manifests-$merge_base" --dir manifest-old/
|
# run: gh run download -R "$repo" --name "manifests-$merge_base" --dir manifest-old/
|
||||||
# env:
|
# env:
|
||||||
# GH_TOKEN: ${{ github.token }}
|
# GH_TOKEN: ${{ github.token }}
|
||||||
# merge_base: ${{ env.MERGE_BASE }}
|
# merge_base: ${{ env.MERGE_BASE }}
|
||||||
# repo: ${{ github.repository }}
|
# repo: ${{ github.repository }}
|
||||||
# - name: Do scan and post comment
|
# - name: Do scan and post comment
|
||||||
# if: github.event_name == 'pull_request_target'
|
# if: github.event_name == 'pull_request'
|
||||||
# run: python3 bin/shame.py ${{ github.event.pull_request.number }} manifests-old/ manifests-new/
|
# run: python3 bin/shame.py ${{ github.event.pull_request.number }} manifests-old/ manifests-new/
|
||||||
|
|
||||||
release-artifacts:
|
release-artifacts:
|
||||||
|
permissions: # Needed for 'gh release upload'.
|
||||||
|
contents: write
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' && github.repository == 'meshtastic/firmware' }}
|
if: ${{ github.event_name == 'workflow_dispatch' && github.repository == 'meshtastic/firmware' }}
|
||||||
outputs:
|
outputs:
|
||||||
@@ -324,14 +319,14 @@ jobs:
|
|||||||
body: ${{ steps.release_notes.outputs.notes }}
|
body: ${{ steps.release_notes.outputs.notes }}
|
||||||
|
|
||||||
- name: Download source deb
|
- name: Download source deb
|
||||||
uses: actions/download-artifact@v7
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
pattern: firmware-debian-${{ needs.version.outputs.deb }}~UNRELEASED-src
|
pattern: firmware-debian-${{ needs.version.outputs.deb }}~UNRELEASED-src
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
path: ./output/debian-src
|
path: ./output/debian-src
|
||||||
|
|
||||||
- name: Download `native-tft` pio deps
|
- name: Download `native-tft` pio deps
|
||||||
uses: actions/download-artifact@v7
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
pattern: platformio-deps-native-tft-${{ needs.version.outputs.long }}
|
pattern: platformio-deps-native-tft-${{ needs.version.outputs.long }}
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
@@ -355,7 +350,7 @@ jobs:
|
|||||||
}' > firmware-${{ needs.version.outputs.long }}.json
|
}' > firmware-${{ needs.version.outputs.long }}.json
|
||||||
|
|
||||||
- name: Save Release manifest artifact
|
- name: Save Release manifest artifact
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: manifest-${{ needs.version.outputs.long }}
|
name: manifest-${{ needs.version.outputs.long }}
|
||||||
overwrite: true
|
overwrite: true
|
||||||
@@ -372,6 +367,8 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
release-firmware:
|
release-firmware:
|
||||||
|
permissions: # Needed for 'gh release upload'.
|
||||||
|
contents: write
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -396,7 +393,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: 3.x
|
python-version: 3.x
|
||||||
|
|
||||||
- uses: actions/download-artifact@v7
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
pattern: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
pattern: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
@@ -413,7 +410,7 @@ jobs:
|
|||||||
- name: Zip firmware
|
- name: Zip firmware
|
||||||
run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip ./output
|
run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip ./output
|
||||||
|
|
||||||
- uses: actions/download-artifact@v7
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
name: debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
name: debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
@@ -454,14 +451,14 @@ jobs:
|
|||||||
python-version: 3.x
|
python-version: 3.x
|
||||||
|
|
||||||
- name: Get firmware artifacts
|
- name: Get firmware artifacts
|
||||||
uses: actions/download-artifact@v7
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
pattern: firmware-{${{ env.targets }}}-${{ needs.version.outputs.long }}
|
pattern: firmware-{${{ env.targets }}}-${{ needs.version.outputs.long }}
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
path: ./publish
|
path: ./publish
|
||||||
|
|
||||||
- name: Get manifest artifact
|
- name: Get manifest artifact
|
||||||
uses: actions/download-artifact@v7
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
pattern: manifest-${{ needs.version.outputs.long }}
|
pattern: manifest-${{ needs.version.outputs.long }}
|
||||||
path: ./publish
|
path: ./publish
|
||||||
|
|||||||
@@ -1,371 +0,0 @@
|
|||||||
name: Merge Queue
|
|
||||||
# Not sure how concurrency works in merge_queue, removing for now.
|
|
||||||
# concurrency:
|
|
||||||
# group: merge-queue-${{ github.head_ref || github.run_id }}
|
|
||||||
# cancel-in-progress: true
|
|
||||||
on:
|
|
||||||
# Merge group is a special trigger that is used to trigger the workflow when a merge group is created.
|
|
||||||
merge_group:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
setup:
|
|
||||||
strategy:
|
|
||||||
fail-fast: true
|
|
||||||
matrix:
|
|
||||||
arch:
|
|
||||||
- all
|
|
||||||
- check
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
- uses: actions/setup-python@v6
|
|
||||||
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}})
|
|
||||||
else
|
|
||||||
TARGETS=$(./bin/generate_ci_matrix.py ${{matrix.arch}} --level pr)
|
|
||||||
fi
|
|
||||||
echo "Name: $GITHUB_REF_NAME Base: $GITHUB_BASE_REF Ref: $GITHUB_REF"
|
|
||||||
echo "${{matrix.arch}}=$TARGETS" >> $GITHUB_OUTPUT
|
|
||||||
outputs:
|
|
||||||
all: ${{ steps.jsonStep.outputs.all }}
|
|
||||||
check: ${{ steps.jsonStep.outputs.check }}
|
|
||||||
|
|
||||||
version:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
- 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:
|
|
||||||
fail-fast: true
|
|
||||||
matrix:
|
|
||||||
check: ${{ fromJson(needs.setup.outputs.check) }}
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: ${{ github.event_name != 'workflow_dispatch' }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
- name: Build base
|
|
||||||
id: base
|
|
||||||
uses: ./.github/actions/setup-base
|
|
||||||
- name: Check ${{ matrix.check.board }}
|
|
||||||
run: bin/check-all.sh ${{ matrix.check.board }}
|
|
||||||
|
|
||||||
build:
|
|
||||||
needs: [setup, version]
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
build: ${{ fromJson(needs.setup.outputs.all) }}
|
|
||||||
uses: ./.github/workflows/build_firmware.yml
|
|
||||||
with:
|
|
||||||
version: ${{ needs.version.outputs.long }}
|
|
||||||
pio_env: ${{ matrix.build.board }}
|
|
||||||
platform: ${{ matrix.build.platform }}
|
|
||||||
|
|
||||||
build-debian-src:
|
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
uses: ./.github/workflows/build_debian_src.yml
|
|
||||||
with:
|
|
||||||
series: UNRELEASED
|
|
||||||
build_location: local
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
package-pio-deps-native-tft:
|
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' }}
|
|
||||||
uses: ./.github/workflows/package_pio_deps.yml
|
|
||||||
with:
|
|
||||||
pio_env: native-tft
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
test-native:
|
|
||||||
if: ${{ !contains(github.ref_name, 'event/') }}
|
|
||||||
uses: ./.github/workflows/test_native.yml
|
|
||||||
|
|
||||||
docker:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
distro: [debian, alpine]
|
|
||||||
platform: [linux/amd64, linux/arm64, linux/arm/v7]
|
|
||||||
pio_env: [native, native-tft]
|
|
||||||
exclude:
|
|
||||||
- distro: alpine
|
|
||||||
platform: linux/arm/v7
|
|
||||||
- pio_env: native-tft
|
|
||||||
platform: linux/arm64
|
|
||||||
- pio_env: native-tft
|
|
||||||
platform: linux/arm/v7
|
|
||||||
uses: ./.github/workflows/docker_build.yml
|
|
||||||
with:
|
|
||||||
distro: ${{ matrix.distro }}
|
|
||||||
platform: ${{ matrix.platform }}
|
|
||||||
runs-on: ${{ contains(matrix.platform, 'arm') && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
|
|
||||||
pio_env: ${{ matrix.pio_env }}
|
|
||||||
push: false
|
|
||||||
|
|
||||||
gather-artifacts:
|
|
||||||
# trunk-ignore(checkov/CKV2_GHA_1)
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
arch:
|
|
||||||
- esp32
|
|
||||||
- esp32s3
|
|
||||||
- esp32c3
|
|
||||||
- esp32c6
|
|
||||||
- nrf52840
|
|
||||||
- rp2040
|
|
||||||
- rp2350
|
|
||||||
- stm32
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [version, build]
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v7
|
|
||||||
with:
|
|
||||||
path: ./
|
|
||||||
pattern: firmware-${{matrix.arch}}-*
|
|
||||||
merge-multiple: true
|
|
||||||
|
|
||||||
- name: Display structure of downloaded files
|
|
||||||
run: ls -R
|
|
||||||
|
|
||||||
- name: Move files up
|
|
||||||
run: mv -b -t ./ ./bin/device-*.sh ./bin/device-*.bat
|
|
||||||
|
|
||||||
- name: Repackage in single firmware zip
|
|
||||||
uses: actions/upload-artifact@v6
|
|
||||||
with:
|
|
||||||
name: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
|
||||||
overwrite: true
|
|
||||||
path: |
|
|
||||||
./firmware-*.bin
|
|
||||||
./firmware-*.uf2
|
|
||||||
./firmware-*.hex
|
|
||||||
./firmware-*.zip
|
|
||||||
./device-*.sh
|
|
||||||
./device-*.bat
|
|
||||||
./littlefs-*.bin
|
|
||||||
./bleota*bin
|
|
||||||
./Meshtastic_nRF52_factory_erase*.uf2
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v7
|
|
||||||
with:
|
|
||||||
name: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
|
||||||
merge-multiple: true
|
|
||||||
path: ./output
|
|
||||||
|
|
||||||
# For diagnostics
|
|
||||||
- name: Show artifacts
|
|
||||||
run: ls -lR
|
|
||||||
|
|
||||||
- name: Device scripts permissions
|
|
||||||
run: |
|
|
||||||
chmod +x ./output/device-install.sh || true
|
|
||||||
chmod +x ./output/device-update.sh || true
|
|
||||||
|
|
||||||
- name: Zip firmware
|
|
||||||
run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip ./output
|
|
||||||
|
|
||||||
- name: Repackage in single elfs zip
|
|
||||||
uses: actions/upload-artifact@v6
|
|
||||||
with:
|
|
||||||
name: debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
|
||||||
overwrite: true
|
|
||||||
path: ./*.elf
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
- uses: scruplelesswizard/comment-artifact@main
|
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
|
||||||
with:
|
|
||||||
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:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' }}
|
|
||||||
outputs:
|
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
needs:
|
|
||||||
- version
|
|
||||||
- gather-artifacts
|
|
||||||
- build-debian-src
|
|
||||||
- package-pio-deps-native-tft
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Create release
|
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
id: create_release
|
|
||||||
with:
|
|
||||||
draft: true
|
|
||||||
prerelease: true
|
|
||||||
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@v7
|
|
||||||
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@v7
|
|
||||||
with:
|
|
||||||
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-${{ 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
|
|
||||||
run: ls -lR
|
|
||||||
|
|
||||||
- name: Add Linux sources to GtiHub Release
|
|
||||||
# Only run when targeting master branch with workflow_dispatch
|
|
||||||
if: ${{ github.ref_name == 'master' }}
|
|
||||||
run: |
|
|
||||||
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 }}
|
|
||||||
|
|
||||||
release-firmware:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
arch:
|
|
||||||
- esp32
|
|
||||||
- esp32s3
|
|
||||||
- esp32c3
|
|
||||||
- esp32c6
|
|
||||||
- nrf52840
|
|
||||||
- rp2040
|
|
||||||
- rp2350
|
|
||||||
- stm32
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' }}
|
|
||||||
needs: [release-artifacts, version]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v7
|
|
||||||
with:
|
|
||||||
pattern: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
|
||||||
merge-multiple: true
|
|
||||||
path: ./output
|
|
||||||
|
|
||||||
- name: Display structure of downloaded files
|
|
||||||
run: ls -lR
|
|
||||||
|
|
||||||
- name: Device scripts permissions
|
|
||||||
run: |
|
|
||||||
chmod +x ./output/device-install.sh || true
|
|
||||||
chmod +x ./output/device-update.sh || true
|
|
||||||
|
|
||||||
- name: Zip firmware
|
|
||||||
run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip ./output
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v7
|
|
||||||
with:
|
|
||||||
name: debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
|
||||||
merge-multiple: true
|
|
||||||
path: ./elfs
|
|
||||||
|
|
||||||
- name: Zip debug elfs
|
|
||||||
run: zip -j -9 -r ./debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip ./elfs
|
|
||||||
|
|
||||||
# For diagnostics
|
|
||||||
- name: Display structure of downloaded files
|
|
||||||
run: ls -lR
|
|
||||||
|
|
||||||
- name: Add bins and debug elfs to GitHub Release
|
|
||||||
# Only run when targeting master branch with workflow_dispatch
|
|
||||||
if: ${{ github.ref_name == 'master' }}
|
|
||||||
run: |
|
|
||||||
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, version]
|
|
||||||
env:
|
|
||||||
targets: |-
|
|
||||||
esp32,esp32s3,esp32c3,esp32c6,nrf52840,rp2040,rp2350,stm32
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v7
|
|
||||||
with:
|
|
||||||
pattern: firmware-{${{ env.targets }}}-${{ needs.version.outputs.long }}
|
|
||||||
merge-multiple: true
|
|
||||||
path: ./publish
|
|
||||||
|
|
||||||
- name: Publish firmware to meshtastic.github.io
|
|
||||||
uses: peaceiris/actions-gh-pages@v4
|
|
||||||
env:
|
|
||||||
# On event/* branches, use the event name as the destination prefix
|
|
||||||
DEST_PREFIX: ${{ contains(github.ref_name, 'event/') && format('{0}/', github.ref_name) || '' }}
|
|
||||||
with:
|
|
||||||
deploy_key: ${{ secrets.DIST_PAGES_DEPLOY_KEY }}
|
|
||||||
external_repository: meshtastic/meshtastic.github.io
|
|
||||||
publish_branch: master
|
|
||||||
publish_dir: ./publish
|
|
||||||
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: ${{ needs.version.outputs.long }}
|
|
||||||
enable_jekyll: true
|
|
||||||
@@ -18,8 +18,7 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: read
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-debian-src:
|
build-debian-src:
|
||||||
@@ -58,7 +57,7 @@ jobs:
|
|||||||
id: version
|
id: version
|
||||||
|
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v7
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
name: firmware-debian-${{ steps.version.outputs.deb }}~${{ inputs.series }}-src
|
name: firmware-debian-${{ steps.version.outputs.deb }}~${{ inputs.series }}-src
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|||||||
@@ -16,8 +16,7 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: read
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pkg-pio-libdeps:
|
pkg-pio-libdeps:
|
||||||
@@ -27,8 +26,6 @@ jobs:
|
|||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v6
|
||||||
@@ -54,9 +51,19 @@ jobs:
|
|||||||
PLATFORMIO_LIBDEPS_DIR: pio/libdeps
|
PLATFORMIO_LIBDEPS_DIR: pio/libdeps
|
||||||
PLATFORMIO_PACKAGES_DIR: pio/packages
|
PLATFORMIO_PACKAGES_DIR: pio/packages
|
||||||
PLATFORMIO_CORE_DIR: pio/core
|
PLATFORMIO_CORE_DIR: pio/core
|
||||||
|
PLATFORMIO_SETTING_ENABLE_TELEMETRY: 0
|
||||||
|
PLATFORMIO_SETTING_CHECK_PLATFORMIO_INTERVAL: 3650
|
||||||
|
PLATFORMIO_SETTING_CHECK_PRUNE_SYSTEM_THRESHOLD: 10240
|
||||||
|
|
||||||
|
- name: Mangle platformio cache
|
||||||
|
# Add "1" to epoch-timestamps of all downloads in the cache.
|
||||||
|
# This is a hack to prevent internet access at build-time.
|
||||||
|
run: |
|
||||||
|
cp pio/core/.cache/downloads/usage.db pio/core/.cache/downloads/usage.db.bak
|
||||||
|
jq -c 'with_entries(.value |= (. | tostring + "1" | tonumber))' pio/core/.cache/downloads/usage.db.bak > pio/core/.cache/downloads/usage.db
|
||||||
|
|
||||||
- name: Store binaries as an artifact
|
- name: Store binaries as an artifact
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: platformio-deps-${{ inputs.pio_env }}-${{ steps.version.outputs.long }}
|
name: platformio-deps-${{ inputs.pio_env }}-${{ steps.version.outputs.long }}
|
||||||
overwrite: true
|
overwrite: true
|
||||||
|
|||||||
@@ -16,8 +16,7 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: read
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-debian-src:
|
build-debian-src:
|
||||||
@@ -36,8 +35,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
path: meshtasticd
|
path: meshtasticd
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -46,7 +43,7 @@ jobs:
|
|||||||
sudo apt-get install -y dput
|
sudo apt-get install -y dput
|
||||||
|
|
||||||
- name: Import GPG key
|
- name: Import GPG key
|
||||||
uses: crazy-max/ghaction-import-gpg@v6
|
uses: crazy-max/ghaction-import-gpg@v7
|
||||||
with:
|
with:
|
||||||
gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }}
|
gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }}
|
||||||
id: gpg
|
id: gpg
|
||||||
@@ -60,7 +57,7 @@ jobs:
|
|||||||
id: version
|
id: version
|
||||||
|
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v7
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
name: firmware-debian-${{ steps.version.outputs.deb }}~${{ inputs.series }}-src
|
name: firmware-debian-${{ steps.version.outputs.deb }}~${{ inputs.series }}-src
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Download test artifacts
|
- name: Download test artifacts
|
||||||
if: needs.native-tests.result != 'skipped'
|
if: needs.native-tests.result != 'skipped'
|
||||||
uses: actions/download-artifact@v7
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
name: platformio-test-report-${{ steps.version.outputs.long }}
|
name: platformio-test-report-${{ steps.version.outputs.long }}
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ jobs:
|
|||||||
series:
|
series:
|
||||||
- jammy # 22.04 LTS
|
- jammy # 22.04 LTS
|
||||||
- noble # 24.04 LTS
|
- noble # 24.04 LTS
|
||||||
- plucky # 25.04
|
|
||||||
- questing # 25.10
|
- questing # 25.10
|
||||||
|
- resolute # 26.04 LTS
|
||||||
uses: ./.github/workflows/package_ppa.yml
|
uses: ./.github/workflows/package_ppa.yml
|
||||||
with:
|
with:
|
||||||
ppa_repo: |-
|
ppa_repo: |-
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ jobs:
|
|||||||
|
|
||||||
# step 3
|
# step 3
|
||||||
- name: save report as pipeline artifact
|
- name: save report as pipeline artifact
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: report.sarif
|
name: report.sarif
|
||||||
overwrite: true
|
overwrite: true
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Stale PR+Issues
|
- name: Stale PR+Issues
|
||||||
uses: actions/stale@v10.1.1
|
uses: actions/stale@v10.2.0
|
||||||
with:
|
with:
|
||||||
days-before-stale: 45
|
days-before-stale: 45
|
||||||
stale-issue-message: This issue has not had any comment or update in the last month. If it is still relevant, please post update comments. If no comments are made, this issue will be closed automagically in 7 days.
|
stale-issue-message: This issue has not had any comment or update in the last month. If it is still relevant, please post update comments. If no comments are made, this issue will be closed automagically in 7 days.
|
||||||
|
|||||||
@@ -16,8 +16,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Setup native build
|
- name: Setup native build
|
||||||
@@ -59,7 +57,7 @@ jobs:
|
|||||||
id: version
|
id: version
|
||||||
|
|
||||||
- name: Save coverage information
|
- name: Save coverage information
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v7
|
||||||
if: always() # run this step even if previous step failed
|
if: always() # run this step even if previous step failed
|
||||||
with:
|
with:
|
||||||
name: lcov-coverage-info-native-simulator-test-${{ steps.version.outputs.long }}
|
name: lcov-coverage-info-native-simulator-test-${{ steps.version.outputs.long }}
|
||||||
@@ -72,8 +70,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Setup native build
|
- name: Setup native build
|
||||||
@@ -94,7 +90,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Save test results
|
- name: Save test results
|
||||||
if: always() # run this step even if previous step failed
|
if: always() # run this step even if previous step failed
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: platformio-test-report-${{ steps.version.outputs.long }}
|
name: platformio-test-report-${{ steps.version.outputs.long }}
|
||||||
overwrite: true
|
overwrite: true
|
||||||
@@ -108,7 +104,7 @@ jobs:
|
|||||||
sed -i -e "s#${PWD}#.#" coverage_tests.info # Make paths relative.
|
sed -i -e "s#${PWD}#.#" coverage_tests.info # Make paths relative.
|
||||||
|
|
||||||
- name: Save coverage information
|
- name: Save coverage information
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v7
|
||||||
if: always() # run this step even if previous step failed
|
if: always() # run this step even if previous step failed
|
||||||
with:
|
with:
|
||||||
name: lcov-coverage-info-native-platformio-tests-${{ steps.version.outputs.long }}
|
name: lcov-coverage-info-native-platformio-tests-${{ steps.version.outputs.long }}
|
||||||
@@ -128,29 +124,26 @@ jobs:
|
|||||||
if: always()
|
if: always()
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
with:
|
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- name: Get release version string
|
- name: Get release version string
|
||||||
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
id: version
|
id: version
|
||||||
|
|
||||||
- name: Download test artifacts
|
- name: Download test artifacts
|
||||||
uses: actions/download-artifact@v7
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
name: platformio-test-report-${{ steps.version.outputs.long }}
|
name: platformio-test-report-${{ steps.version.outputs.long }}
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|
||||||
- name: Test Report
|
- name: Test Report
|
||||||
uses: dorny/test-reporter@v2.5.0
|
uses: dorny/test-reporter@v3.0.0
|
||||||
with:
|
with:
|
||||||
name: PlatformIO Tests
|
name: PlatformIO Tests
|
||||||
path: testreport.xml
|
path: testreport.xml
|
||||||
reporter: java-junit
|
reporter: java-junit
|
||||||
|
|
||||||
- name: Download coverage artifacts
|
- name: Download coverage artifacts
|
||||||
uses: actions/download-artifact@v7
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
pattern: lcov-coverage-info-native-*-${{ steps.version.outputs.long }}
|
pattern: lcov-coverage-info-native-*-${{ steps.version.outputs.long }}
|
||||||
path: code-coverage-report
|
path: code-coverage-report
|
||||||
@@ -163,7 +156,7 @@ jobs:
|
|||||||
genhtml --quiet --legend --prefix "${PWD}" code-coverage-report/coverage_src.info --output-directory code-coverage-report
|
genhtml --quiet --legend --prefix "${PWD}" code-coverage-report/coverage_src.info --output-directory code-coverage-report
|
||||||
|
|
||||||
- name: Save Code Coverage Report
|
- name: Save Code Coverage Report
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: code-coverage-report-${{ steps.version.outputs.long }}
|
name: code-coverage-report-${{ steps.version.outputs.long }}
|
||||||
path: code-coverage-report
|
path: code-coverage-report
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ jobs:
|
|||||||
node-version: 24
|
node-version: 24
|
||||||
|
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v5
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ permissions: read-all
|
|||||||
jobs:
|
jobs:
|
||||||
update-protobufs:
|
update-protobufs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions: # Needed for peter-evans/create-pull-request.
|
||||||
contents: write
|
contents: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ __pycache__
|
|||||||
*~
|
*~
|
||||||
|
|
||||||
venv/
|
venv/
|
||||||
|
.venv/
|
||||||
release/
|
release/
|
||||||
.vscode/extensions.json
|
.vscode/extensions.json
|
||||||
/compile_commands.json
|
/compile_commands.json
|
||||||
|
|||||||
+13
-13
@@ -4,31 +4,31 @@ cli:
|
|||||||
plugins:
|
plugins:
|
||||||
sources:
|
sources:
|
||||||
- id: trunk
|
- id: trunk
|
||||||
ref: v1.7.4
|
ref: v1.7.6
|
||||||
uri: https://github.com/trunk-io/plugins
|
uri: https://github.com/trunk-io/plugins
|
||||||
lint:
|
lint:
|
||||||
enabled:
|
enabled:
|
||||||
- checkov@3.2.501
|
- checkov@3.2.511
|
||||||
- renovate@43.8.5
|
- renovate@43.92.1
|
||||||
- prettier@3.8.1
|
- prettier@3.8.1
|
||||||
- trufflehog@3.93.3
|
- trufflehog@3.94.1
|
||||||
- yamllint@1.38.0
|
- yamllint@1.38.0
|
||||||
- bandit@1.9.3
|
- bandit@1.9.4
|
||||||
- trivy@0.69.1
|
- trivy@0.69.3
|
||||||
- taplo@0.10.0
|
- taplo@0.10.0
|
||||||
- ruff@0.15.0
|
- ruff@0.15.8
|
||||||
- isort@7.0.0
|
- isort@8.0.1
|
||||||
- markdownlint@0.47.0
|
- markdownlint@0.48.0
|
||||||
- oxipng@10.1.0
|
- oxipng@10.1.0
|
||||||
- svgo@4.0.0
|
- svgo@4.0.1
|
||||||
- actionlint@1.7.10
|
- actionlint@1.7.11
|
||||||
- flake8@7.3.0
|
- flake8@7.3.0
|
||||||
- hadolint@2.14.0
|
- hadolint@2.14.0
|
||||||
- shfmt@3.6.0
|
- shfmt@3.6.0
|
||||||
- shellcheck@0.11.0
|
- shellcheck@0.11.0
|
||||||
- black@26.1.0
|
- black@26.3.1
|
||||||
- git-diff-check
|
- git-diff-check
|
||||||
- gitleaks@8.30.0
|
- gitleaks@8.30.1
|
||||||
- clang-format@16.0.3
|
- clang-format@16.0.3
|
||||||
ignore:
|
ignore:
|
||||||
- linters: [ALL]
|
- linters: [ALL]
|
||||||
|
|||||||
+2
-2
@@ -14,7 +14,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
|
|||||||
curl wget g++ zip git ca-certificates pkg-config \
|
curl wget g++ zip git ca-certificates pkg-config \
|
||||||
libgpiod-dev libyaml-cpp-dev libbluetooth-dev libi2c-dev libuv1-dev \
|
libgpiod-dev libyaml-cpp-dev libbluetooth-dev libi2c-dev libuv1-dev \
|
||||||
libusb-1.0-0-dev libulfius-dev liborcania-dev libssl-dev \
|
libusb-1.0-0-dev libulfius-dev liborcania-dev libssl-dev \
|
||||||
libx11-dev libinput-dev libxkbcommon-x11-dev libsqlite3-dev \
|
libx11-dev libinput-dev libxkbcommon-x11-dev libsqlite3-dev libsdl2-dev \
|
||||||
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
|
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
|
||||||
&& pip install --no-cache-dir -U platformio \
|
&& pip install --no-cache-dir -U platformio \
|
||||||
&& mkdir /tmp/firmware
|
&& mkdir /tmp/firmware
|
||||||
@@ -53,7 +53,7 @@ USER root
|
|||||||
RUN apt-get update && apt-get --no-install-recommends -y install \
|
RUN apt-get update && apt-get --no-install-recommends -y install \
|
||||||
libc-bin libc6 libgpiod3 libyaml-cpp0.8 libi2c0 libuv1t64 libusb-1.0-0-dev \
|
libc-bin libc6 libgpiod3 libyaml-cpp0.8 libi2c0 libuv1t64 libusb-1.0-0-dev \
|
||||||
liborcania2.3 libulfius2.7t64 libssl3t64 \
|
liborcania2.3 libulfius2.7t64 libssl3t64 \
|
||||||
libx11-6 libinput10 libxkbcommon-x11-0 \
|
libx11-6 libinput10 libxkbcommon-x11-0 libsdl2-2.0-0 \
|
||||||
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
|
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
|
||||||
&& mkdir -p /var/lib/meshtasticd \
|
&& mkdir -p /var/lib/meshtasticd \
|
||||||
&& mkdir -p /etc/meshtasticd/config.d \
|
&& mkdir -p /etc/meshtasticd/config.d \
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# Lightweight container for running native PlatformIO tests on non-Linux hosts
|
||||||
|
FROM python:3.14-slim-trixie
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
ENV PIP_ROOT_USER_ACTION=ignore
|
||||||
|
|
||||||
|
# hadolint ignore=DL3008
|
||||||
|
RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||||
|
g++ git ca-certificates pkg-config \
|
||||||
|
libgpiod-dev libyaml-cpp-dev libbluetooth-dev libi2c-dev libuv1-dev \
|
||||||
|
libusb-1.0-0-dev libulfius-dev liborcania-dev libssl-dev \
|
||||||
|
libx11-dev libinput-dev libxkbcommon-x11-dev libsqlite3-dev libsdl2-dev \
|
||||||
|
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& pip install --no-cache-dir platformio==6.1.19 \
|
||||||
|
&& useradd --create-home --shell /usr/sbin/nologin meshtastic
|
||||||
|
|
||||||
|
WORKDIR /firmware
|
||||||
|
RUN chown -R meshtastic:meshtastic /firmware
|
||||||
|
|
||||||
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
||||||
|
CMD platformio --version || exit 1
|
||||||
|
|
||||||
|
USER meshtastic
|
||||||
|
|
||||||
|
# Run tests by default; override with docker run args for specific filters
|
||||||
|
CMD ["platformio", "test", "-e", "coverage", "-v"]
|
||||||
+2
-2
@@ -11,7 +11,7 @@ RUN apk --no-cache add \
|
|||||||
bash g++ libstdc++-dev linux-headers zip git ca-certificates libbsd-dev \
|
bash g++ libstdc++-dev linux-headers zip git ca-certificates libbsd-dev \
|
||||||
libgpiod-dev yaml-cpp-dev bluez-dev \
|
libgpiod-dev yaml-cpp-dev bluez-dev \
|
||||||
libusb-dev i2c-tools-dev libuv-dev openssl-dev pkgconf argp-standalone \
|
libusb-dev i2c-tools-dev libuv-dev openssl-dev pkgconf argp-standalone \
|
||||||
libx11-dev libinput-dev libxkbcommon-dev sqlite-dev \
|
libx11-dev libinput-dev libxkbcommon-dev sqlite-dev sdl2-dev \
|
||||||
&& rm -rf /var/cache/apk/* \
|
&& rm -rf /var/cache/apk/* \
|
||||||
&& pip install --no-cache-dir -U platformio \
|
&& pip install --no-cache-dir -U platformio \
|
||||||
&& mkdir /tmp/firmware
|
&& mkdir /tmp/firmware
|
||||||
@@ -42,7 +42,7 @@ USER root
|
|||||||
|
|
||||||
RUN apk --no-cache add \
|
RUN apk --no-cache add \
|
||||||
shadow libstdc++ libbsd libgpiod yaml-cpp libusb \
|
shadow libstdc++ libbsd libgpiod yaml-cpp libusb \
|
||||||
i2c-tools libuv libx11 libinput libxkbcommon \
|
i2c-tools libuv libx11 libinput libxkbcommon sdl2 \
|
||||||
&& rm -rf /var/cache/apk/* \
|
&& rm -rf /var/cache/apk/* \
|
||||||
&& mkdir -p /var/lib/meshtasticd \
|
&& mkdir -p /var/lib/meshtasticd \
|
||||||
&& mkdir -p /etc/meshtasticd/config.d \
|
&& mkdir -p /etc/meshtasticd/config.d \
|
||||||
|
|||||||
+1
-1
@@ -23,4 +23,4 @@ for BOARD in $BOARDS; do
|
|||||||
CHECK="${CHECK} -e ${BOARD}"
|
CHECK="${CHECK} -e ${BOARD}"
|
||||||
done
|
done
|
||||||
|
|
||||||
pio check --flags "-DAPP_VERSION=${APP_VERSION} --suppressions-list=suppressions.txt --inline-suppr" $CHECK --skip-packages --pattern="src/" --fail-on-defect=medium --fail-on-defect=high
|
pio check --flags "-DAPP_VERSION=${APP_VERSION} --suppressions-list=suppressions.txt --inline-suppr" $CHECK --skip-packages --pattern="src/" --fail-on-defect=low --fail-on-defect=medium --fail-on-defect=high
|
||||||
|
|||||||
@@ -187,6 +187,7 @@ Logging:
|
|||||||
LogLevel: info # debug, info, warn, error
|
LogLevel: info # debug, info, warn, error
|
||||||
# TraceFile: /var/log/meshtasticd.json
|
# TraceFile: /var/log/meshtasticd.json
|
||||||
# JSONFile: /packets.json # File location for JSON output of decoded packets
|
# JSONFile: /packets.json # File location for JSON output of decoded packets
|
||||||
|
# JSONFileRotate: 60 # Rotate JSON file every N minutes, or 0 for no rotation
|
||||||
# JSONFilter: position # filter for packets to save to JSON file
|
# JSONFilter: position # filter for packets to save to JSON file
|
||||||
# AsciiLogs: true # default if not specified is !isatty() on stdout
|
# AsciiLogs: true # default if not specified is !isatty() on stdout
|
||||||
|
|
||||||
@@ -214,3 +215,4 @@ General:
|
|||||||
AvailableDirectory: /etc/meshtasticd/available.d/
|
AvailableDirectory: /etc/meshtasticd/available.d/
|
||||||
# MACAddress: AA:BB:CC:DD:EE:FF
|
# MACAddress: AA:BB:CC:DD:EE:FF
|
||||||
# MACAddressSource: eth0
|
# MACAddressSource: eth0
|
||||||
|
# APIPort: 4403
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
Meta:
|
||||||
|
name: BananaPi-BPI-R4-sx1262
|
||||||
|
support: community
|
||||||
|
compatible:
|
||||||
|
- bananapi_bpi-r4 # OpenWrt target
|
||||||
|
|
||||||
Lora:
|
Lora:
|
||||||
Module: sx1262 # BananaPi-BPI-R4 SPI via 26p GPIO Header
|
Module: sx1262 # BananaPi-BPI-R4 SPI via 26p GPIO Header
|
||||||
## CS: 28
|
## CS: 28
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
## https://www.mikroe.com/lr-iot-click
|
## https://www.mikroe.com/lr-iot-click
|
||||||
|
Meta:
|
||||||
|
name: OpenWRT One mikroBUS LR-IOT-CLICK
|
||||||
|
support: community
|
||||||
|
compatible:
|
||||||
|
- openwrt_one # OpenWrt target
|
||||||
|
|
||||||
Lora:
|
Lora:
|
||||||
Module: lr1110 # OpenWRT ONE mikroBUS with LR-IOT-CLICK
|
Module: lr1110 # OpenWRT ONE mikroBUS with LR-IOT-CLICK
|
||||||
# CS: 25
|
# CS: 25
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
Meta:
|
||||||
|
name: OpenWRT One mikroBUS sx1262
|
||||||
|
support: community
|
||||||
|
compatible:
|
||||||
|
- openwrt_one # OpenWrt target
|
||||||
|
|
||||||
Lora:
|
Lora:
|
||||||
Module: sx1262
|
Module: sx1262
|
||||||
IRQ: 10
|
IRQ: 10
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
# meshtasticd configuration files
|
||||||
|
|
||||||
|
This directory contains YAML configuration files for meshtasticd. Each file describes a specific hardware configuration, including the LoRa module and pin assignments. These configurations are used by meshtasticd to correctly interface with the hardware.
|
||||||
|
|
||||||
|
## Metadata structure
|
||||||
|
|
||||||
|
Each configuration file includes a `Meta` section that provides information about the configuration.
|
||||||
|
This configuration is consumed by configuration-selection tools.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
Meta:
|
||||||
|
name: MeshAdv-Pi E22-900M30S # A unique identifier for this configuration.
|
||||||
|
support: community # community, official, or deprecated; determined by Meshtastic Leads.
|
||||||
|
compatible: # A list of compatible products or platforms.
|
||||||
|
- raspberry-pi
|
||||||
|
```
|
||||||
|
`name`: A unique identifier for the configuration, typically reflecting the hardware it supports.
|
||||||
|
|
||||||
|
`support`: Indicates the level of support for this configuration. It can be one of the following:
|
||||||
|
|
||||||
|
- `community`: Supported by the Meshtastic community. Meshtastic Members may not possess, or have not tested this configuration.
|
||||||
|
- `official`: Fully supported by Meshtastic. Meshtastic Members have tested and verified this configuration.
|
||||||
|
- `deprecated`: No longer recommended for deployment by Meshtastic.
|
||||||
|
|
||||||
|
`compatible`: A list of compatible products or platforms that can use this configuration.
|
||||||
|
This will vary depending on the intended use case / platform.
|
||||||
|
Multiple compatible entries can be included. E.g. Armbian `BOARD` value or OpenWrt `TARGET` value.
|
||||||
|
These tags can be consumed by different configuration-selection tools, filtering based upon their platform/etc.
|
||||||
@@ -1,3 +1,9 @@
|
|||||||
|
Meta:
|
||||||
|
name: Waveshare 1.44inch LCD HAT
|
||||||
|
support: community
|
||||||
|
compatible:
|
||||||
|
- raspberry-pi
|
||||||
|
|
||||||
### Waveshare 1.44inch LCD HAT
|
### Waveshare 1.44inch LCD HAT
|
||||||
Display:
|
Display:
|
||||||
Panel: ST7735S
|
Panel: ST7735S
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
Meta:
|
||||||
|
name: Waveshare 2.8inch LCD HAT
|
||||||
|
support: community
|
||||||
|
compatible:
|
||||||
|
- raspberry-pi
|
||||||
|
|
||||||
Display:
|
Display:
|
||||||
|
|
||||||
### Waveshare 2.8inch RPi LCD
|
### Waveshare 2.8inch RPi LCD
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
Meta:
|
||||||
|
name: Adafruit RFM9x
|
||||||
|
support: deprecated
|
||||||
|
compatible:
|
||||||
|
- raspberry-pi
|
||||||
|
|
||||||
Lora:
|
Lora:
|
||||||
Module: RF95 # Adafruit RFM9x
|
Module: RF95 # Adafruit RFM9x
|
||||||
Reset: 25
|
Reset: 25
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# MeshAdv-Pi E22-900M30S
|
# MeshAdv-Pi E22-900M30S
|
||||||
# https://github.com/chrismyers2000/MeshAdv-Pi-Hat
|
# https://github.com/chrismyers2000/MeshAdv-Pi-Hat
|
||||||
|
Meta:
|
||||||
|
name: MeshAdv-Pi E22-900M30S
|
||||||
|
support: community
|
||||||
|
compatible:
|
||||||
|
- raspberry-pi
|
||||||
|
|
||||||
Lora:
|
Lora:
|
||||||
Module: sx1262
|
Module: sx1262
|
||||||
CS: 21
|
CS: 21
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# MeshAdv Mini E22-900M22S
|
# MeshAdv Mini E22-900M22S
|
||||||
# https://github.com/chrismyers2000/MeshAdv-Mini
|
# https://github.com/chrismyers2000/MeshAdv-Mini
|
||||||
|
Meta:
|
||||||
|
name: MeshAdv Mini E22-900M22S
|
||||||
|
support: community
|
||||||
|
compatible:
|
||||||
|
- raspberry-pi
|
||||||
|
|
||||||
Lora:
|
Lora:
|
||||||
Module: sx1262 # Ebyte E22-900M22S
|
Module: sx1262 # Ebyte E22-900M22S
|
||||||
CS: 8
|
CS: 8
|
||||||
|
|||||||
@@ -1,11 +1,20 @@
|
|||||||
|
Meta:
|
||||||
|
name: RAK6421 + RAK13300 Slot 1
|
||||||
|
support: official
|
||||||
|
compatible:
|
||||||
|
- raspberry-pi
|
||||||
|
|
||||||
Lora:
|
Lora:
|
||||||
|
|
||||||
### RAK13300in Slot 1
|
### RAK13300 in Slot 1
|
||||||
Module: sx1262
|
Module: sx1262
|
||||||
IRQ: 22 #IO6
|
IRQ: 22 #IO6
|
||||||
Reset: 16 # IO4
|
Reset: 16 # IO4
|
||||||
Busy: 24 # IO5
|
Busy: 24 # IO5
|
||||||
# Ant_sw: 13 # IO3
|
# Ant_sw: 13 # IO3
|
||||||
|
Enable_Pins:
|
||||||
|
- 12
|
||||||
|
- 13
|
||||||
DIO3_TCXO_VOLTAGE: true
|
DIO3_TCXO_VOLTAGE: true
|
||||||
DIO2_AS_RF_SWITCH: true
|
DIO2_AS_RF_SWITCH: true
|
||||||
spidev: spidev0.0
|
spidev: spidev0.0
|
||||||
|
|||||||
@@ -1,8 +1,17 @@
|
|||||||
|
Meta:
|
||||||
|
name: RAK6421 + RAK13300 Slot 2
|
||||||
|
support: official
|
||||||
|
compatible:
|
||||||
|
- raspberry-pi
|
||||||
|
|
||||||
Lora:
|
Lora:
|
||||||
### RAK13300in Slot 2 pins
|
### RAK13300 in Slot 2 pins
|
||||||
IRQ: 18 #IO6
|
IRQ: 18 #IO6
|
||||||
Reset: 24 # IO4
|
Reset: 24 # IO4
|
||||||
Busy: 19 # IO5
|
Busy: 19 # IO5
|
||||||
# Ant_sw: 23 # IO3
|
# Ant_sw: 23 # IO3
|
||||||
|
Enable_Pins:
|
||||||
|
- 26
|
||||||
|
- 23
|
||||||
spidev: spidev0.1
|
spidev: spidev0.1
|
||||||
# CS: 7
|
# CS: 7
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
Meta:
|
||||||
|
name: RAK6421 + RAK13302 Slot 1
|
||||||
|
support: official
|
||||||
|
compatible:
|
||||||
|
- raspberry-pi
|
||||||
|
|
||||||
|
Lora:
|
||||||
|
|
||||||
|
### RAK13302 in Slot 1
|
||||||
|
Module: sx1262
|
||||||
|
IRQ: 22 #IO6
|
||||||
|
Reset: 16 # IO4
|
||||||
|
Busy: 24 # IO5
|
||||||
|
# Ant_sw: 13 # IO3
|
||||||
|
Enable_Pins:
|
||||||
|
- 12
|
||||||
|
- 13
|
||||||
|
DIO3_TCXO_VOLTAGE: true
|
||||||
|
DIO2_AS_RF_SWITCH: true
|
||||||
|
spidev: spidev0.0
|
||||||
|
# CS: 8
|
||||||
|
TX_GAIN_LORA: [9, 9, 10, 11, 9, 8, 9, 10, 10, 10, 11, 12, 12, 12, 12, 12, 12, 12, 12, 10, 9, 8]
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Meta:
|
||||||
|
name: RAK6421 + RAK13302 Slot 2
|
||||||
|
support: official
|
||||||
|
compatible:
|
||||||
|
- raspberry-pi
|
||||||
|
|
||||||
|
Lora:
|
||||||
|
### RAK13302 in Slot 2 pins
|
||||||
|
IRQ: 18 #IO6
|
||||||
|
Reset: 24 # IO4
|
||||||
|
Busy: 19 # IO5
|
||||||
|
# Ant_sw: 23 # IO3
|
||||||
|
Enable_Pins:
|
||||||
|
- 26
|
||||||
|
- 23
|
||||||
|
spidev: spidev0.1
|
||||||
|
# CS: 7
|
||||||
|
TX_GAIN_LORA: [9, 9, 10, 11, 9, 8, 9, 10, 10, 10, 11, 12, 12, 12, 12, 12, 12, 12, 12, 10, 9, 8]
|
||||||
+22
-20
@@ -1,20 +1,22 @@
|
|||||||
---
|
---
|
||||||
Lora:
|
Meta:
|
||||||
## Ebyte E80-900M22S
|
name: Femtofox Ebyte E80-900M22S with TCXO
|
||||||
## This is a bit experimental
|
support: community
|
||||||
##
|
compatible:
|
||||||
##
|
- luckfox-pico-mini # Armbian
|
||||||
Module: lr1121
|
|
||||||
gpiochip: 1 # subtract 32 from the gpio numbers
|
Lora:
|
||||||
DIO3_TCXO_VOLTAGE: 1.8
|
## Ebyte E80-900M22S
|
||||||
CS: 16 #pin6 / GPIO48 1C0
|
## This is a bit experimental
|
||||||
IRQ: 23 #pin17 / GPIO55 1C7
|
##
|
||||||
Busy: 22 #pin16 / GPIO54 1C6
|
##
|
||||||
Reset: 25 #pin13 / GPIO57 1D1
|
Module: lr1121
|
||||||
|
gpiochip: 1 # subtract 32 from the gpio numbers
|
||||||
|
DIO3_TCXO_VOLTAGE: 1.8
|
||||||
spidev: spidev0.0 #pins are (CS=16, CLK=17, MOSI=18, MISO=19)
|
CS: 16 #pin6 / GPIO48 1C0
|
||||||
spiSpeed: 2000000
|
IRQ: 23 #pin17 / GPIO55 1C7
|
||||||
|
Busy: 22 #pin16 / GPIO54 1C6
|
||||||
General:
|
Reset: 25 #pin13 / GPIO57 1D1
|
||||||
MACAddressSource: eth0
|
|
||||||
|
spidev: spidev0.0 #pins are (CS=16, CLK=17, MOSI=18, MISO=19)
|
||||||
|
spiSpeed: 2000000
|
||||||
+24
-21
@@ -1,21 +1,24 @@
|
|||||||
---
|
---
|
||||||
Lora:
|
Meta:
|
||||||
## Ebyte E22-900M30S, E22-900M22S with or without external RF switching setup
|
name: Femtofox SX1262 TCXO
|
||||||
## HT-RA62 (Has internal switching, but whatever)
|
support: community
|
||||||
## Seeed WIO SX1262 (already has TXEN-DIO2 link, but needs RXEN)
|
compatible:
|
||||||
## Will work with any module with or without RF switching, and with TCXO
|
- luckfox-pico-mini # Armbian
|
||||||
Module: sx1262
|
|
||||||
gpiochip: 1 # subtract 32 from the gpio numbers
|
Lora:
|
||||||
DIO2_AS_RF_SWITCH: true
|
## Ebyte E22-900M30S, E22-900M22S with or without external RF switching setup
|
||||||
DIO3_TCXO_VOLTAGE: true
|
## HT-RA62 (Has internal switching, but whatever)
|
||||||
CS: 16 #pin6 / GPIO48 1C0
|
## Seeed WIO SX1262 (already has TXEN-DIO2 link, but needs RXEN)
|
||||||
IRQ: 23 #pin17 / GPIO55 1C7
|
## Will work with any module with or without RF switching, and with TCXO
|
||||||
Busy: 22 #pin16 / GPIO54 1C6
|
Module: sx1262
|
||||||
Reset: 25 #pin13 / GPIO57 1D1
|
gpiochip: 1 # subtract 32 from the gpio numbers
|
||||||
RXen: 24 #pin12 / GPIO56 1D0 # Not strictly needed for auto-switching, but why complicate things?
|
DIO2_AS_RF_SWITCH: true
|
||||||
# TXen: bridge to DIO2 on E22 module
|
DIO3_TCXO_VOLTAGE: true
|
||||||
spidev: spidev0.0 #pins are (CS=16, CLK=17, MOSI=18, MISO=19)
|
CS: 16 #pin6 / GPIO48 1C0
|
||||||
spiSpeed: 2000000
|
IRQ: 23 #pin17 / GPIO55 1C7
|
||||||
|
Busy: 22 #pin16 / GPIO54 1C6
|
||||||
General:
|
Reset: 25 #pin13 / GPIO57 1D1
|
||||||
MACAddressSource: eth0
|
RXen: 24 #pin12 / GPIO56 1D0 # Not strictly needed for auto-switching, but why complicate things?
|
||||||
|
# TXen: bridge to DIO2 on E22 module
|
||||||
|
spidev: spidev0.0 #pins are (CS=16, CLK=17, MOSI=18, MISO=19)
|
||||||
|
spiSpeed: 2000000
|
||||||
+24
-21
@@ -1,21 +1,24 @@
|
|||||||
---
|
---
|
||||||
Lora:
|
Meta:
|
||||||
## Ebyte E22-900MM22S with no external RF switching setup
|
name: Femtofox SX1262 XTAL
|
||||||
## Waveshare SX126X XXXM, AI Thinker RA-01SH
|
support: community
|
||||||
## Will work with any module with or without RF switching and no TCXO
|
compatible:
|
||||||
|
- luckfox-pico-mini # Armbian
|
||||||
Module: sx1262
|
|
||||||
gpiochip: 1 # subtract 32 from the gpio numbers
|
Lora:
|
||||||
DIO2_AS_RF_SWITCH: true
|
## Ebyte E22-900MM22S with no external RF switching setup
|
||||||
DIO3_TCXO_VOLTAGE: false
|
## Waveshare SX126X XXXM, AI Thinker RA-01SH
|
||||||
CS: 16 #pin6 / GPIO48 1C0
|
## Will work with any module with or without RF switching and no TCXO
|
||||||
IRQ: 23 #pin17 / GPIO55 1C7
|
|
||||||
Busy: 22 #pin16 / GPIO54 1C6
|
Module: sx1262
|
||||||
Reset: 25 #pin13 / GPIO57 1D1
|
gpiochip: 1 # subtract 32 from the gpio numbers
|
||||||
RXen: 24 #pin12 / GPIO56 1D0 # Not strictly needed for auto-switching, but why complicate things?
|
DIO2_AS_RF_SWITCH: true
|
||||||
# TXen: bridge to DIO2 on E22 module
|
DIO3_TCXO_VOLTAGE: false
|
||||||
spidev: spidev0.0 #pins are (CS=16, CLK=17, MOSI=18, MISO=19)
|
CS: 16 #pin6 / GPIO48 1C0
|
||||||
spiSpeed: 2000000
|
IRQ: 23 #pin17 / GPIO55 1C7
|
||||||
|
Busy: 22 #pin16 / GPIO54 1C6
|
||||||
General:
|
Reset: 25 #pin13 / GPIO57 1D1
|
||||||
MACAddressSource: eth0
|
RXen: 24 #pin12 / GPIO56 1D0 # Not strictly needed for auto-switching, but why complicate things?
|
||||||
|
# TXen: bridge to DIO2 on E22 module
|
||||||
|
spidev: spidev0.0 #pins are (CS=16, CLK=17, MOSI=18, MISO=19)
|
||||||
|
spiSpeed: 2000000
|
||||||
@@ -1,11 +1,21 @@
|
|||||||
|
Meta:
|
||||||
|
name: RAK6421 + RAK13300 Slot 1 (Autoconf default)
|
||||||
|
support: official
|
||||||
|
compatible:
|
||||||
|
- raspberry-pi
|
||||||
|
|
||||||
Lora:
|
Lora:
|
||||||
|
|
||||||
### RAK13300in Slot 1
|
### RAK13300 in Slot 1
|
||||||
Module: sx1262
|
Module: sx1262
|
||||||
IRQ: 22 #IO6
|
IRQ: 22 #IO6
|
||||||
Reset: 16 # IO4
|
Reset: 16 # IO4
|
||||||
Busy: 24 # IO5
|
Busy: 24 # IO5
|
||||||
# Ant_sw: 13 # IO3
|
Enable_Pins:
|
||||||
|
- 12
|
||||||
|
- 13
|
||||||
DIO3_TCXO_VOLTAGE: true
|
DIO3_TCXO_VOLTAGE: true
|
||||||
DIO2_AS_RF_SWITCH: true
|
DIO2_AS_RF_SWITCH: true
|
||||||
spidev: spidev0.0
|
spidev: spidev0.0
|
||||||
|
# GPIO_DETECT_PA: 13
|
||||||
|
TX_GAIN_LORA: [9, 9, 10, 11, 9, 8, 9, 10, 10, 10, 11, 12, 12, 12, 12, 12, 12, 12, 12, 10, 9, 8]
|
||||||
@@ -1,3 +1,9 @@
|
|||||||
|
Meta:
|
||||||
|
name: Luckfox Lyra PicoCalc Wio LoRa SX1262
|
||||||
|
support: official
|
||||||
|
compatible:
|
||||||
|
- luckfox-lyra-plus # Armbian
|
||||||
|
|
||||||
Lora:
|
Lora:
|
||||||
Module: sx1262
|
Module: sx1262
|
||||||
DIO2_AS_RF_SWITCH: true
|
DIO2_AS_RF_SWITCH: true
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# For use with Armbian luckfox-lyra-ultra-w
|
||||||
|
# Enable overlay 'luckfox-lyra-ultra-w-spi0-cs0-spidev' with armbian-config
|
||||||
|
# https://github.com/wehooper4/Meshtastic-Hardware/tree/main/Luckfox%20Ultra%20Hat
|
||||||
|
# 1 Watt Lyra Ultra hat
|
||||||
|
Meta:
|
||||||
|
name: wehooper4 Luckfox Ultra 1W
|
||||||
|
support: community
|
||||||
|
compatible:
|
||||||
|
- luckfox-pico-ultra # Armbian
|
||||||
|
- luckfox-lyra-ultra # Armbian
|
||||||
|
|
||||||
|
Lora:
|
||||||
|
Module: sx1262
|
||||||
|
DIO2_AS_RF_SWITCH: true
|
||||||
|
DIO3_TCXO_VOLTAGE: true
|
||||||
|
CS: 10
|
||||||
|
IRQ: 5
|
||||||
|
Busy: 11
|
||||||
|
Reset: 9
|
||||||
|
RXen: 14
|
||||||
|
|
||||||
|
spidev: spidev0.0 #pins are (CS=10, CLK=8, MOSI=6, MISO=7)
|
||||||
|
spiSpeed: 2000000
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
# For use with Armbian luckfox-lyra-ultra-w
|
||||||
|
# Enable overlay 'luckfox-lyra-ultra-w-spi0-cs0-spidev' with armbian-config
|
||||||
|
# https://github.com/wehooper4/Meshtastic-Hardware/tree/main/Luckfox%20Ultra%20Hat
|
||||||
|
# 2 Watt Lyra Ultra hat
|
||||||
|
Meta:
|
||||||
|
name: wehooper4 Luckfox Ultra 2W
|
||||||
|
support: community
|
||||||
|
compatible:
|
||||||
|
- luckfox-pico-ultra # Armbian
|
||||||
|
- luckfox-lyra-ultra # Armbian
|
||||||
|
|
||||||
|
Lora:
|
||||||
|
Module: sx1262
|
||||||
|
DIO2_AS_RF_SWITCH: true
|
||||||
|
DIO3_TCXO_VOLTAGE: true
|
||||||
|
SX126X_MAX_POWER: 8
|
||||||
|
CS: 10
|
||||||
|
IRQ: 5
|
||||||
|
Busy: 11
|
||||||
|
Reset: 9
|
||||||
|
RXen: 14
|
||||||
|
|
||||||
|
spidev: spidev0.0 #pins are (CS=10, CLK=8, MOSI=6, MISO=7)
|
||||||
|
spiSpeed: 2000000
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# For use with Armbian luckfox-lyra // luckfox-lyra-plus
|
||||||
|
# Enable overlay 'luckfox-lyra-plus-spi0-cs0_rmio13-spidev' with armbian-config
|
||||||
|
# Waveshare LoRa HAT for Raspberry Pi Pico
|
||||||
|
# https://www.waveshare.com/wiki/Pico-LoRa-SX1262
|
||||||
|
Meta:
|
||||||
|
name: Waveshare LoRa HAT for Raspberry Pi Pico
|
||||||
|
support: community
|
||||||
|
compatible:
|
||||||
|
- luckfox-lyra-plus # Armbian
|
||||||
|
|
||||||
|
Lora:
|
||||||
|
Module: sx1262
|
||||||
|
DIO2_AS_RF_SWITCH: true
|
||||||
|
DIO3_TCXO_VOLTAGE: true
|
||||||
|
spidev: spidev0.0
|
||||||
|
CS: # GPIO0_B5
|
||||||
|
pin: 13
|
||||||
|
gpiochip: 0
|
||||||
|
line: 13
|
||||||
|
IRQ: # GPIO1_C2
|
||||||
|
pin: 50
|
||||||
|
gpiochip: 1
|
||||||
|
line: 18
|
||||||
|
Busy: # GPIO0_B4
|
||||||
|
pin: 12
|
||||||
|
gpiochip: 0
|
||||||
|
line: 12
|
||||||
|
Reset: # GPIO0_A2
|
||||||
|
pin: 2
|
||||||
|
gpiochip: 0
|
||||||
|
line: 2
|
||||||
@@ -1,3 +1,9 @@
|
|||||||
|
Meta:
|
||||||
|
name: Lora Meshstick SX1262
|
||||||
|
support: official
|
||||||
|
compatible:
|
||||||
|
- usb
|
||||||
|
|
||||||
Lora:
|
Lora:
|
||||||
Module: sx1262
|
Module: sx1262
|
||||||
CS: 0
|
CS: 0
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
Meta:
|
||||||
|
name: Lora Meshstick SX1262
|
||||||
|
support: community
|
||||||
|
compatible:
|
||||||
|
- usb
|
||||||
|
|
||||||
Lora:
|
Lora:
|
||||||
Module: lr1121
|
Module: lr1121
|
||||||
CS: 0
|
CS: 0
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
|
Meta:
|
||||||
|
name: Pinedio USB SX1262
|
||||||
|
support: deprecated
|
||||||
|
compatible:
|
||||||
|
- usb
|
||||||
|
|
||||||
Lora:
|
Lora:
|
||||||
Module: sx1262
|
Module: sx1262
|
||||||
CS: 0
|
CS: 0
|
||||||
IRQ: 10
|
IRQ: 10
|
||||||
spidev: ch341
|
spidev: ch341
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
Meta:
|
||||||
|
name: raxda-rock2f-starter-edition-hat
|
||||||
|
support: community
|
||||||
|
compatible:
|
||||||
|
- rock-2f # Armbian
|
||||||
|
|
||||||
Lora:
|
Lora:
|
||||||
|
|
||||||
### Raxda Rock 2F running Armbian Linux 6.1.99-vendor-rk35xx
|
### Raxda Rock 2F running Armbian Linux 6.1.99-vendor-rk35xx
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# https://www.waveshare.com/core1262-868m.htm
|
# https://www.waveshare.com/core1262-868m.htm
|
||||||
# https://github.com/markbirss/lora-starter-edition-sx1262-i2c
|
# https://github.com/markbirss/lora-starter-edition-sx1262-i2c
|
||||||
|
Meta:
|
||||||
|
name: lora-starter-edition-sx1262-i2c
|
||||||
|
support: community
|
||||||
|
compatible:
|
||||||
|
- raspberry-pi
|
||||||
|
|
||||||
Lora:
|
Lora:
|
||||||
Module: sx1262 # Starter Edition SX1262 I2C Raspberry Pi HAT
|
Module: sx1262 # Starter Edition SX1262 I2C Raspberry Pi HAT
|
||||||
DIO2_AS_RF_SWITCH: true
|
DIO2_AS_RF_SWITCH: true
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
Meta:
|
||||||
|
name: meshstick-1262
|
||||||
|
support: official
|
||||||
|
compatible:
|
||||||
|
- usb
|
||||||
|
|
||||||
Lora:
|
Lora:
|
||||||
Module: sx1262
|
Module: sx1262
|
||||||
CS: 0
|
CS: 0
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
Meta:
|
||||||
|
name: meshtoad-e22
|
||||||
|
support: official
|
||||||
|
compatible:
|
||||||
|
- usb
|
||||||
|
|
||||||
Lora:
|
Lora:
|
||||||
Module: sx1262
|
Module: sx1262
|
||||||
CS: 0
|
CS: 0
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
Meta:
|
||||||
|
name: umesh-1262-30dbm
|
||||||
|
support: community
|
||||||
|
compatible:
|
||||||
|
- clockwork-uconsole
|
||||||
|
|
||||||
Lora:
|
Lora:
|
||||||
Module: sx1262
|
Module: sx1262
|
||||||
CS: 0
|
CS: 0
|
||||||
@@ -13,8 +19,7 @@ Lora:
|
|||||||
# USB_Serialnum: 12345678
|
# USB_Serialnum: 12345678
|
||||||
SX126X_MAX_POWER: 22
|
SX126X_MAX_POWER: 22
|
||||||
# Reduce output power to improve EMI
|
# Reduce output power to improve EMI
|
||||||
NUM_PA_POINTS: 22
|
TX_GAIN_LORA: [12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 9, 8, 8, 7]
|
||||||
TX_GAIN_LORA: 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 9, 8, 8, 7
|
|
||||||
# Note: This module integrates an additional PA to achieve higher output power.
|
# Note: This module integrates an additional PA to achieve higher output power.
|
||||||
# The 'power' parameter here does not represent the actual RF output.
|
# The 'power' parameter here does not represent the actual RF output.
|
||||||
# TX_GAIN_LORA defines the gain offset applied at each SX1262 input power step (1–22 dBm).
|
# TX_GAIN_LORA defines the gain offset applied at each SX1262 input power step (1–22 dBm).
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
Meta:
|
||||||
|
name: umesh-1268-30dbm
|
||||||
|
support: community
|
||||||
|
compatible:
|
||||||
|
- clockwork-uconsole
|
||||||
|
|
||||||
Lora:
|
Lora:
|
||||||
Module: sx1268
|
Module: sx1268
|
||||||
CS: 0
|
CS: 0
|
||||||
@@ -13,8 +19,7 @@ Lora:
|
|||||||
# USB_Serialnum: 12345678
|
# USB_Serialnum: 12345678
|
||||||
SX126X_MAX_POWER: 22
|
SX126X_MAX_POWER: 22
|
||||||
# Reduce output power to improve EMI
|
# Reduce output power to improve EMI
|
||||||
NUM_PA_POINTS: 22
|
TX_GAIN_LORA: [12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 9, 8, 8, 7]
|
||||||
TX_GAIN_LORA: 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 9, 8, 8, 7
|
|
||||||
# Note: This module integrates an additional PA to achieve higher output power.
|
# Note: This module integrates an additional PA to achieve higher output power.
|
||||||
# The 'power' parameter here does not represent the actual RF output.
|
# The 'power' parameter here does not represent the actual RF output.
|
||||||
# TX_GAIN_LORA defines the gain offset applied at each SX1262 input power step (1–22 dBm).
|
# TX_GAIN_LORA defines the gain offset applied at each SX1262 input power step (1–22 dBm).
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
Meta:
|
||||||
|
name: Waveshare SX1262
|
||||||
|
support: deprecated
|
||||||
|
compatible:
|
||||||
|
- raspberry-pi
|
||||||
|
|
||||||
Lora:
|
Lora:
|
||||||
Module: sx1262 # Waveshare SX126X XXXM
|
Module: sx1262 # Waveshare SX126X XXXM
|
||||||
DIO2_AS_RF_SWITCH: true
|
DIO2_AS_RF_SWITCH: true
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
# https://www.waveshare.com/pico-lora-sx1262-868m.htm
|
# https://www.waveshare.com/pico-lora-sx1262-868m.htm
|
||||||
# https://github.com/markbirss/lora-ws-raspberry-pi-pico-to-rpi-adapter
|
# https://github.com/markbirss/lora-ws-raspberry-pi-pico-to-rpi-adapter
|
||||||
|
|
||||||
|
Meta:
|
||||||
|
name: ws-raspberry-pico-to-rpi-adapter
|
||||||
|
support: community
|
||||||
|
compatible:
|
||||||
|
- raspberry-pi
|
||||||
|
|
||||||
Lora:
|
Lora:
|
||||||
Module: sx1262 # Waveshare Raspberry Pi Pico to Raspberry Pi HAT Adapter
|
Module: sx1262 # Waveshare Raspberry Pi Pico to Raspberry Pi HAT Adapter
|
||||||
DIO2_AS_RF_SWITCH: true
|
DIO2_AS_RF_SWITCH: true
|
||||||
|
|||||||
@@ -15,6 +15,12 @@
|
|||||||
# 5 CS 24
|
# 5 CS 24
|
||||||
# 26 DIO1/IRQ 26
|
# 26 DIO1/IRQ 26
|
||||||
|
|
||||||
|
Meta:
|
||||||
|
name: ws-raspberry-pico-to-orangepi-03
|
||||||
|
support: community
|
||||||
|
compatible:
|
||||||
|
- orange-pi-zero-3 # Armbian
|
||||||
|
|
||||||
Lora:
|
Lora:
|
||||||
Module: sx1262 # Waveshare Raspberry Pico Lora module
|
Module: sx1262 # Waveshare Raspberry Pico Lora module
|
||||||
DIO2_AS_RF_SWITCH: true
|
DIO2_AS_RF_SWITCH: true
|
||||||
|
|||||||
@@ -87,6 +87,9 @@
|
|||||||
</screenshots>
|
</screenshots>
|
||||||
|
|
||||||
<releases>
|
<releases>
|
||||||
|
<release version="2.7.21" date="2026-03-11">
|
||||||
|
<url type="details">https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.21</url>
|
||||||
|
</release>
|
||||||
<release version="2.7.20" date="2026-02-11">
|
<release version="2.7.20" date="2026-02-11">
|
||||||
<url type="details">https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.20</url>
|
<url type="details">https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.20</url>
|
||||||
</release>
|
</release>
|
||||||
|
|||||||
Executable
+44
@@ -0,0 +1,44 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Run native PlatformIO tests inside Docker (for macOS / non-Linux hosts).
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# ./bin/test-native-docker.sh # run all native tests
|
||||||
|
# ./bin/test-native-docker.sh -f test_transmit_history # run specific test filter
|
||||||
|
# ./bin/test-native-docker.sh --rebuild # force rebuild the image
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
|
ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||||
|
IMAGE_NAME="meshtastic-native-test"
|
||||||
|
|
||||||
|
REBUILD=false
|
||||||
|
EXTRA_ARGS=()
|
||||||
|
|
||||||
|
for arg in "$@"; do
|
||||||
|
if [[ "$arg" == "--rebuild" ]]; then
|
||||||
|
REBUILD=true
|
||||||
|
else
|
||||||
|
EXTRA_ARGS+=("$arg")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if $REBUILD || ! docker image inspect "$IMAGE_NAME" >/dev/null 2>&1; then
|
||||||
|
echo "Building test image (first run may take a few minutes)..."
|
||||||
|
docker build -t "$IMAGE_NAME" -f "$ROOT_DIR/Dockerfile.test" "$ROOT_DIR"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Disable BUILD_EPOCH to avoid full rebuilds between test runs (matches CI)
|
||||||
|
sed_cmd='s/-DBUILD_EPOCH=$UNIX_TIME/#-DBUILD_EPOCH=$UNIX_TIME/'
|
||||||
|
|
||||||
|
# Default: run all tests. Pass extra args (e.g. -f test_transmit_history) through.
|
||||||
|
if [[ ${#EXTRA_ARGS[@]} -eq 0 ]]; then
|
||||||
|
CMD=("platformio" "test" "-e" "coverage" "-v")
|
||||||
|
else
|
||||||
|
CMD=("platformio" "test" "-e" "coverage" "-v" "${EXTRA_ARGS[@]}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec docker run --rm \
|
||||||
|
-v "$ROOT_DIR:/src:ro" \
|
||||||
|
"$IMAGE_NAME" \
|
||||||
|
bash -c "rm -rf /tmp/fw-test && cp -a /src /tmp/fw-test && cd /tmp/fw-test && sed -i '${sed_cmd}' platformio.ini && ${CMD[*]}"
|
||||||
@@ -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"],
|
||||||
|
["0x2886", "0x1667"]
|
||||||
|
],
|
||||||
|
"usb_product": "HT-n5262G",
|
||||||
|
"mcu": "nrf52840",
|
||||||
|
"variant": "heltec_mesh_node_t096",
|
||||||
|
"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/",
|
||||||
|
"vendor": "Heltec"
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino": {
|
||||||
|
"ldscript": "esp32s3_out.ld",
|
||||||
|
"partitions": "default.csv"
|
||||||
|
},
|
||||||
|
"core": "esp32",
|
||||||
|
"extra_flags": [
|
||||||
|
"-DBOARD_HAS_PSRAM",
|
||||||
|
"-DARDUINO_ESP32S3_DEV",
|
||||||
|
"-DARDUINO_USB_MODE=1",
|
||||||
|
"-DARDUINO_USB_CDC_ON_BOOT=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"],
|
||||||
|
"debug": {
|
||||||
|
"default_tool": "esp-builtin",
|
||||||
|
"onboard_tools": ["esp-builtin"],
|
||||||
|
"openocd_target": "esp32s3.cfg"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino", "espidf"],
|
||||||
|
"name": "LilyGo Mini-Epaper-S3 (4 MB Flash, 2MB PSRAM)",
|
||||||
|
"upload": {
|
||||||
|
"flash_size": "4MB",
|
||||||
|
"maximum_ram_size": 327680,
|
||||||
|
"maximum_size": 4194304,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"speed": 460800
|
||||||
|
},
|
||||||
|
"url": "https://www.lilygo.cc",
|
||||||
|
"vendor": "LilyGo"
|
||||||
|
}
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
"extra_flags": [
|
"extra_flags": [
|
||||||
"-DBOARD_HAS_PSRAM",
|
"-DBOARD_HAS_PSRAM",
|
||||||
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
||||||
"-DARDUINO_USB_MODE=0",
|
"-DARDUINO_USB_MODE=1",
|
||||||
"-DARDUINO_RUNNING_CORE=1",
|
"-DARDUINO_RUNNING_CORE=1",
|
||||||
"-DARDUINO_EVENT_RUNNING_CORE=0"
|
"-DARDUINO_EVENT_RUNNING_CORE=0"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino": {
|
||||||
|
"ldscript": "esp32s3_out.ld",
|
||||||
|
"memory_type": "qio_opi",
|
||||||
|
"partitions": "default_16MB.csv"
|
||||||
|
},
|
||||||
|
"core": "esp32",
|
||||||
|
"extra_flags": [
|
||||||
|
"-DBOARD_HAS_PSRAM",
|
||||||
|
"-DARDUINO_RUNNING_CORE=1",
|
||||||
|
"-DARDUINO_EVENT_RUNNING_CORE=0",
|
||||||
|
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
||||||
|
"-DARDUINO_USB_MODE=1"
|
||||||
|
],
|
||||||
|
"f_cpu": "240000000L",
|
||||||
|
"f_flash": "80000000L",
|
||||||
|
"flash_mode": "qio",
|
||||||
|
"hwids": [["0x303A", "0x1001"]],
|
||||||
|
"mcu": "esp32s3",
|
||||||
|
"variant": "esp32s3"
|
||||||
|
},
|
||||||
|
"connectivity": ["wifi", "bluetooth", "lora"],
|
||||||
|
"debug": {
|
||||||
|
"openocd_target": "esp32s3.cfg"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino", "espidf"],
|
||||||
|
"name": "LilyGo T5-ePaper-S3",
|
||||||
|
"upload": {
|
||||||
|
"flash_size": "16MB",
|
||||||
|
"maximum_ram_size": 327680,
|
||||||
|
"maximum_size": 16777216,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"speed": 921600
|
||||||
|
},
|
||||||
|
"url": "https://lilygo.cc/products/t5-e-paper-s3-pro",
|
||||||
|
"vendor": "LILYGO"
|
||||||
|
}
|
||||||
+1
-1
@@ -12,6 +12,6 @@ Ex:
|
|||||||
- `logo_320x480.png`
|
- `logo_320x480.png`
|
||||||
- `logo_320x240.png`
|
- `logo_320x240.png`
|
||||||
|
|
||||||
This file is copied to `data/boot/logo.png` before filesytem image compilation.
|
This file is copied to `data/boot/logo.png` before filesystem image compilation.
|
||||||
|
|
||||||
For additional examples see the [`event/defcon33` branch](https://github.com/meshtastic/firmware/tree/event/defcon33).
|
For additional examples see the [`event/defcon33` branch](https://github.com/meshtastic/firmware/tree/event/defcon33).
|
||||||
|
|||||||
Vendored
+6
@@ -1,3 +1,9 @@
|
|||||||
|
meshtasticd (2.7.21.0) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Version 2.7.21
|
||||||
|
|
||||||
|
-- GitHub Actions <github-actions[bot]@users.noreply.github.com> Wed, 11 Mar 2026 11:45:36 +0000
|
||||||
|
|
||||||
meshtasticd (2.7.20.0) unstable; urgency=medium
|
meshtasticd (2.7.20.0) unstable; urgency=medium
|
||||||
|
|
||||||
* Version 2.7.20
|
* Version 2.7.20
|
||||||
|
|||||||
Vendored
+14
-2
@@ -3,10 +3,17 @@ export DEBEMAIL="jbennett@incomsystems.biz"
|
|||||||
export PLATFORMIO_LIBDEPS_DIR=pio/libdeps
|
export PLATFORMIO_LIBDEPS_DIR=pio/libdeps
|
||||||
export PLATFORMIO_PACKAGES_DIR=pio/packages
|
export PLATFORMIO_PACKAGES_DIR=pio/packages
|
||||||
export PLATFORMIO_CORE_DIR=pio/core
|
export PLATFORMIO_CORE_DIR=pio/core
|
||||||
|
export PLATFORMIO_SETTING_ENABLE_TELEMETRY=0
|
||||||
|
export PLATFORMIO_SETTING_CHECK_PLATFORMIO_INTERVAL=3650
|
||||||
|
export PLATFORMIO_SETTING_CHECK_PRUNE_SYSTEM_THRESHOLD=10240
|
||||||
|
|
||||||
# Download libraries to `pio`
|
# Download libraries to `pio`
|
||||||
platformio pkg install -e native-tft
|
platformio pkg install -e native-tft
|
||||||
platformio pkg install -e native-tft -t platformio/tool-scons@4.40502.0
|
platformio pkg install -e native-tft -t platformio/tool-scons@4.40502.0
|
||||||
|
# Mangle PlatformIO cache to prevent internet access at build-time
|
||||||
|
# Simply adds 1 to all expiry (epoch) timestamps, adding ~500 years to expiry date
|
||||||
|
cp pio/core/.cache/downloads/usage.db pio/core/.cache/downloads/usage.db.bak
|
||||||
|
jq -c 'with_entries(.value |= (. | tostring + "1" | tonumber))' pio/core/.cache/downloads/usage.db.bak >pio/core/.cache/downloads/usage.db
|
||||||
# Compress `pio` directory to prevent dh_clean from sanitizing it
|
# Compress `pio` directory to prevent dh_clean from sanitizing it
|
||||||
tar -cf pio.tar pio/
|
tar -cf pio.tar pio/
|
||||||
rm -rf pio
|
rm -rf pio
|
||||||
@@ -20,5 +27,10 @@ rm -rf debian/changelog
|
|||||||
dch --create --distribution "$SERIES" --package "$package" --newversion "$PKG_VERSION~$SERIES" \
|
dch --create --distribution "$SERIES" --package "$package" --newversion "$PKG_VERSION~$SERIES" \
|
||||||
"GitHub Actions Automatic packaging for $PKG_VERSION~$SERIES"
|
"GitHub Actions Automatic packaging for $PKG_VERSION~$SERIES"
|
||||||
|
|
||||||
# Build the source deb
|
if [[ -n $GPG_KEY_ID ]]; then
|
||||||
debuild -S -nc -k"$GPG_KEY_ID"
|
# Build and sign the source deb
|
||||||
|
debuild -S -nc -k"$GPG_KEY_ID"
|
||||||
|
else
|
||||||
|
# Build the source deb without signing (forks)
|
||||||
|
debuild -S -nc
|
||||||
|
fi
|
||||||
|
|||||||
Vendored
+2
-1
@@ -26,7 +26,8 @@ Build-Depends: debhelper-compat (= 13),
|
|||||||
libx11-dev,
|
libx11-dev,
|
||||||
libinput-dev,
|
libinput-dev,
|
||||||
libxkbcommon-x11-dev,
|
libxkbcommon-x11-dev,
|
||||||
libsqlite3-dev
|
libsqlite3-dev,
|
||||||
|
libsdl2-dev
|
||||||
Standards-Version: 4.6.2
|
Standards-Version: 4.6.2
|
||||||
Homepage: https://github.com/meshtastic/firmware
|
Homepage: https://github.com/meshtastic/firmware
|
||||||
Rules-Requires-Root: no
|
Rules-Requires-Root: no
|
||||||
|
|||||||
Vendored
+4
-1
@@ -9,7 +9,10 @@
|
|||||||
PIO_ENV:=\
|
PIO_ENV:=\
|
||||||
PLATFORMIO_CORE_DIR=pio/core \
|
PLATFORMIO_CORE_DIR=pio/core \
|
||||||
PLATFORMIO_LIBDEPS_DIR=pio/libdeps \
|
PLATFORMIO_LIBDEPS_DIR=pio/libdeps \
|
||||||
PLATFORMIO_PACKAGES_DIR=pio/packages
|
PLATFORMIO_PACKAGES_DIR=pio/packages \
|
||||||
|
PLATFORMIO_SETTING_ENABLE_TELEMETRY=0 \
|
||||||
|
PLATFORMIO_SETTING_CHECK_PLATFORMIO_INTERVAL=3650 \
|
||||||
|
PLATFORMIO_SETTING_CHECK_PRUNE_SYSTEM_THRESHOLD=10240
|
||||||
|
|
||||||
# Raspbian armhf builds should be compatible with armv6-hardfloat
|
# Raspbian armhf builds should be compatible with armv6-hardfloat
|
||||||
# https://www.valvers.com/open-software/raspberry-pi/bare-metal-programming-in-c-part-1/#rpi1-compiler-flags
|
# https://www.valvers.com/open-software/raspberry-pi/bare-metal-programming-in-c-part-1/#rpi1-compiler-flags
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ BuildRequires: pkgconfig(libulfius)
|
|||||||
BuildRequires: pkgconfig(x11)
|
BuildRequires: pkgconfig(x11)
|
||||||
BuildRequires: pkgconfig(libinput)
|
BuildRequires: pkgconfig(libinput)
|
||||||
BuildRequires: pkgconfig(xkbcommon-x11)
|
BuildRequires: pkgconfig(xkbcommon-x11)
|
||||||
|
BuildRequires: pkgconfig(sdl2)
|
||||||
|
|
||||||
# libbsd is needed on older Fedora/RHEL to provide 'strlcpy'
|
# libbsd is needed on older Fedora/RHEL to provide 'strlcpy'
|
||||||
%if 0%{?fedora} >= 39 || 0%{?rhel} >= 10
|
%if 0%{?fedora} >= 39 || 0%{?rhel} >= 10
|
||||||
@@ -59,8 +60,14 @@ BuildRequires: pkgconfig(libbsd-overlay)
|
|||||||
|
|
||||||
Requires: systemd-udev
|
Requires: systemd-udev
|
||||||
|
|
||||||
|
# Declare that this package provides the user/group it creates in %pre
|
||||||
|
# Required for Fedora 43+ which tracks users/groups as RPM dependencies
|
||||||
|
Provides: user(%{meshtasticd_user})
|
||||||
|
Provides: group(%{meshtasticd_user})
|
||||||
|
Provides: group(spi)
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Meshtastic daemon for controlling Meshtastic devices. Meshtastic is an off-grid
|
Meshtastic daemon. Meshtastic is an off-grid
|
||||||
text communication platform that uses inexpensive LoRa radios.
|
text communication platform that uses inexpensive LoRa radios.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
@@ -151,6 +158,7 @@ fi
|
|||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc README.md
|
%doc README.md
|
||||||
%{_bindir}/meshtasticd
|
%{_bindir}/meshtasticd
|
||||||
|
%{_bindir}/meshtasticd-start.sh
|
||||||
%dir %{_localstatedir}/lib/meshtasticd
|
%dir %{_localstatedir}/lib/meshtasticd
|
||||||
%{_udevrulesdir}/99-meshtasticd-udev.rules
|
%{_udevrulesdir}/99-meshtasticd-udev.rules
|
||||||
%dir %{_sysconfdir}/meshtasticd
|
%dir %{_sysconfdir}/meshtasticd
|
||||||
|
|||||||
+33
-39
@@ -50,11 +50,13 @@ build_flags = -Wno-missing-field-initializers
|
|||||||
-DRADIOLIB_EXCLUDE_APRS=1
|
-DRADIOLIB_EXCLUDE_APRS=1
|
||||||
-DRADIOLIB_EXCLUDE_LORAWAN=1
|
-DRADIOLIB_EXCLUDE_LORAWAN=1
|
||||||
-DMESHTASTIC_EXCLUDE_DROPZONE=1
|
-DMESHTASTIC_EXCLUDE_DROPZONE=1
|
||||||
|
-DMESHTASTIC_EXCLUDE_REPLYBOT=1
|
||||||
-DMESHTASTIC_EXCLUDE_REMOTEHARDWARE=1
|
-DMESHTASTIC_EXCLUDE_REMOTEHARDWARE=1
|
||||||
-DMESHTASTIC_EXCLUDE_HEALTH_TELEMETRY=1
|
-DMESHTASTIC_EXCLUDE_HEALTH_TELEMETRY=1
|
||||||
-DMESHTASTIC_EXCLUDE_POWERSTRESS=1 ; exclude power stress test module from main firmware
|
-DMESHTASTIC_EXCLUDE_POWERSTRESS=1 ; exclude power stress test module from main firmware
|
||||||
-DMESHTASTIC_EXCLUDE_GENERIC_THREAD_MODULE=1
|
-DMESHTASTIC_EXCLUDE_GENERIC_THREAD_MODULE=1
|
||||||
-DMESHTASTIC_EXCLUDE_POWERMON=1
|
-DMESHTASTIC_EXCLUDE_POWERMON=1
|
||||||
|
-DMESHTASTIC_EXCLUDE_STATUS=1
|
||||||
-D MAX_THREADS=40 ; As we've split modules, we have more threads to manage
|
-D MAX_THREADS=40 ; As we've split modules, we have more threads to manage
|
||||||
-DLED_BUILTIN=-1
|
-DLED_BUILTIN=-1
|
||||||
#-DBUILD_EPOCH=$UNIX_TIME ; set in platformio-custom.py now
|
#-DBUILD_EPOCH=$UNIX_TIME ; set in platformio-custom.py now
|
||||||
@@ -95,7 +97,11 @@ lib_deps =
|
|||||||
${env.lib_deps}
|
${env.lib_deps}
|
||||||
# renovate: datasource=custom.pio depName=NonBlockingRTTTL packageName=end2endzone/library/NonBlockingRTTTL
|
# renovate: datasource=custom.pio depName=NonBlockingRTTTL packageName=end2endzone/library/NonBlockingRTTTL
|
||||||
end2endzone/NonBlockingRTTTL@1.4.0
|
end2endzone/NonBlockingRTTTL@1.4.0
|
||||||
|
build_unflags =
|
||||||
|
-std=c++11
|
||||||
|
-std=gnu++11
|
||||||
build_flags = ${env.build_flags} -Os
|
build_flags = ${env.build_flags} -Os
|
||||||
|
-std=gnu++17
|
||||||
build_src_filter = ${env.build_src_filter} -<platform/portduino/> -<graphics/niche/>
|
build_src_filter = ${env.build_src_filter} -<platform/portduino/> -<graphics/niche/>
|
||||||
|
|
||||||
; Common libs for communicating over TCP/IP networks such as MQTT
|
; Common libs for communicating over TCP/IP networks such as MQTT
|
||||||
@@ -115,12 +121,12 @@ lib_deps =
|
|||||||
[radiolib_base]
|
[radiolib_base]
|
||||||
lib_deps =
|
lib_deps =
|
||||||
# renovate: datasource=custom.pio depName=RadioLib packageName=jgromes/library/RadioLib
|
# renovate: datasource=custom.pio depName=RadioLib packageName=jgromes/library/RadioLib
|
||||||
jgromes/RadioLib@7.5.0
|
jgromes/RadioLib@7.6.0
|
||||||
|
|
||||||
[device-ui_base]
|
[device-ui_base]
|
||||||
lib_deps =
|
lib_deps =
|
||||||
# renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master
|
# renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master
|
||||||
https://github.com/meshtastic/device-ui/archive/6c75195e9987b7a49563232234f2f868dd343cae.zip
|
https://github.com/meshtastic/device-ui/archive/499f3a806d729e49ea5148a1633e9b64ae8c2d2e.zip
|
||||||
|
|
||||||
; Common libs for environmental measurements in telemetry module
|
; Common libs for environmental measurements in telemetry module
|
||||||
[environmental_base]
|
[environmental_base]
|
||||||
@@ -136,7 +142,7 @@ lib_deps =
|
|||||||
# renovate: datasource=custom.pio depName=Adafruit BME280 packageName=adafruit/library/Adafruit BME280 Library
|
# renovate: datasource=custom.pio depName=Adafruit BME280 packageName=adafruit/library/Adafruit BME280 Library
|
||||||
adafruit/Adafruit BME280 Library@2.3.0
|
adafruit/Adafruit BME280 Library@2.3.0
|
||||||
# renovate: datasource=custom.pio depName=Adafruit DPS310 packageName=adafruit/library/Adafruit DPS310
|
# renovate: datasource=custom.pio depName=Adafruit DPS310 packageName=adafruit/library/Adafruit DPS310
|
||||||
adafruit/Adafruit DPS310@1.1.5
|
adafruit/Adafruit DPS310@1.1.6
|
||||||
# renovate: datasource=custom.pio depName=Adafruit MCP9808 packageName=adafruit/library/Adafruit MCP9808 Library
|
# renovate: datasource=custom.pio depName=Adafruit MCP9808 packageName=adafruit/library/Adafruit MCP9808 Library
|
||||||
adafruit/Adafruit MCP9808 Library@2.0.2
|
adafruit/Adafruit MCP9808 Library@2.0.2
|
||||||
# renovate: datasource=custom.pio depName=Adafruit INA260 packageName=adafruit/library/Adafruit INA260 Library
|
# renovate: datasource=custom.pio depName=Adafruit INA260 packageName=adafruit/library/Adafruit INA260 Library
|
||||||
@@ -148,7 +154,7 @@ lib_deps =
|
|||||||
# renovate: datasource=custom.pio depName=Adafruit LIS3DH packageName=adafruit/library/Adafruit LIS3DH
|
# renovate: datasource=custom.pio depName=Adafruit LIS3DH packageName=adafruit/library/Adafruit LIS3DH
|
||||||
adafruit/Adafruit LIS3DH@1.3.0
|
adafruit/Adafruit LIS3DH@1.3.0
|
||||||
# renovate: datasource=custom.pio depName=Adafruit AHTX0 packageName=adafruit/library/Adafruit AHTX0
|
# renovate: datasource=custom.pio depName=Adafruit AHTX0 packageName=adafruit/library/Adafruit AHTX0
|
||||||
adafruit/Adafruit AHTX0@2.0.5
|
adafruit/Adafruit AHTX0@2.0.6
|
||||||
# renovate: datasource=custom.pio depName=Adafruit LSM6DS packageName=adafruit/library/Adafruit LSM6DS
|
# renovate: datasource=custom.pio depName=Adafruit LSM6DS packageName=adafruit/library/Adafruit LSM6DS
|
||||||
adafruit/Adafruit LSM6DS@4.7.4
|
adafruit/Adafruit LSM6DS@4.7.4
|
||||||
# renovate: datasource=custom.pio depName=Adafruit TSL2591 packageName=adafruit/library/Adafruit TSL2591 Library
|
# renovate: datasource=custom.pio depName=Adafruit TSL2591 packageName=adafruit/library/Adafruit TSL2591 Library
|
||||||
@@ -156,7 +162,7 @@ lib_deps =
|
|||||||
# renovate: datasource=custom.pio depName=EmotiBit MLX90632 packageName=emotibit/library/EmotiBit MLX90632
|
# renovate: datasource=custom.pio depName=EmotiBit MLX90632 packageName=emotibit/library/EmotiBit MLX90632
|
||||||
emotibit/EmotiBit MLX90632@1.0.8
|
emotibit/EmotiBit MLX90632@1.0.8
|
||||||
# renovate: datasource=custom.pio depName=Adafruit MLX90614 packageName=adafruit/library/Adafruit MLX90614 Library
|
# renovate: datasource=custom.pio depName=Adafruit MLX90614 packageName=adafruit/library/Adafruit MLX90614 Library
|
||||||
adafruit/Adafruit MLX90614 Library@2.1.5
|
adafruit/Adafruit MLX90614 Library@2.1.6
|
||||||
# renovate: datasource=git-refs depName=INA3221 packageName=https://github.com/sgtwilko/INA3221 gitBranch=FixOverflow
|
# renovate: datasource=git-refs depName=INA3221 packageName=https://github.com/sgtwilko/INA3221 gitBranch=FixOverflow
|
||||||
https://github.com/sgtwilko/INA3221/archive/bb03d7e9bfcc74fc798838a54f4f99738f29fc6a.zip
|
https://github.com/sgtwilko/INA3221/archive/bb03d7e9bfcc74fc798838a54f4f99738f29fc6a.zip
|
||||||
# renovate: datasource=custom.pio depName=QMC5883L Compass packageName=mprograms/library/QMC5883LCompass
|
# renovate: datasource=custom.pio depName=QMC5883L Compass packageName=mprograms/library/QMC5883LCompass
|
||||||
@@ -178,12 +184,12 @@ lib_deps =
|
|||||||
# renovate: datasource=custom.pio depName=DFRobot_BMM150 packageName=dfrobot/library/DFRobot_BMM150
|
# renovate: datasource=custom.pio depName=DFRobot_BMM150 packageName=dfrobot/library/DFRobot_BMM150
|
||||||
dfrobot/DFRobot_BMM150@1.0.0
|
dfrobot/DFRobot_BMM150@1.0.0
|
||||||
# renovate: datasource=custom.pio depName=Adafruit_TSL2561 packageName=adafruit/library/Adafruit TSL2561
|
# renovate: datasource=custom.pio depName=Adafruit_TSL2561 packageName=adafruit/library/Adafruit TSL2561
|
||||||
adafruit/Adafruit TSL2561@1.1.2
|
adafruit/Adafruit TSL2561@1.1.3
|
||||||
# renovate: datasource=custom.pio depName=BH1750_WE packageName=wollewald/library/BH1750_WE
|
# renovate: datasource=custom.pio depName=BH1750_WE packageName=wollewald/library/BH1750_WE
|
||||||
wollewald/BH1750_WE@1.1.10
|
wollewald/BH1750_WE@1.1.10
|
||||||
|
|
||||||
; (not included in native / portduino)
|
; Common environmental sensor libraries (not included in native / portduino)
|
||||||
[environmental_extra]
|
[environmental_extra_common]
|
||||||
lib_deps =
|
lib_deps =
|
||||||
# renovate: datasource=custom.pio depName=Adafruit BMP3XX packageName=adafruit/library/Adafruit BMP3XX Library
|
# renovate: datasource=custom.pio depName=Adafruit BMP3XX packageName=adafruit/library/Adafruit BMP3XX Library
|
||||||
adafruit/Adafruit BMP3XX Library@2.1.6
|
adafruit/Adafruit BMP3XX Library@2.1.6
|
||||||
@@ -203,41 +209,29 @@ lib_deps =
|
|||||||
sparkfun/SparkFun Qwiic Scale NAU7802 Arduino Library@1.0.6
|
sparkfun/SparkFun Qwiic Scale NAU7802 Arduino Library@1.0.6
|
||||||
# renovate: datasource=custom.pio depName=ClosedCube OPT3001 packageName=closedcube/library/ClosedCube OPT3001
|
# renovate: datasource=custom.pio depName=ClosedCube OPT3001 packageName=closedcube/library/ClosedCube OPT3001
|
||||||
closedcube/ClosedCube OPT3001@1.1.2
|
closedcube/ClosedCube OPT3001@1.1.2
|
||||||
|
# renovate: datasource=git-refs depName=meshtastic-DFRobot_LarkWeatherStation packageName=https://github.com/meshtastic/DFRobot_LarkWeatherStation gitBranch=master
|
||||||
|
https://github.com/meshtastic/DFRobot_LarkWeatherStation/archive/4de3a9cadef0f6a5220a8a906cf9775b02b0040d.zip
|
||||||
|
# renovate: datasource=custom.pio depName=Sensirion Core packageName=sensirion/library/Sensirion Core
|
||||||
|
sensirion/Sensirion Core@0.7.3
|
||||||
|
# renovate: datasource=custom.pio depName=Sensirion I2C SCD4x packageName=sensirion/library/Sensirion I2C SCD4x
|
||||||
|
sensirion/Sensirion I2C SCD4x@1.1.0
|
||||||
|
# renovate: datasource=custom.pio depName=Sensirion I2C SFA3x packageName=sensirion/library/Sensirion I2C SFA3x
|
||||||
|
sensirion/Sensirion I2C SFA3x@1.0.0
|
||||||
|
# renovate: datasource=custom.pio depName=Sensirion I2C SCD30 packageName=sensirion/library/Sensirion I2C SCD30
|
||||||
|
sensirion/Sensirion I2C SCD30@1.0.0
|
||||||
|
|
||||||
|
; Environmental sensors with BSEC2 (Bosch proprietary IAQ)
|
||||||
|
[environmental_extra]
|
||||||
|
lib_deps =
|
||||||
|
${environmental_extra_common.lib_deps}
|
||||||
# renovate: datasource=custom.pio depName=Bosch BSEC2 packageName=boschsensortec/library/bsec2
|
# renovate: datasource=custom.pio depName=Bosch BSEC2 packageName=boschsensortec/library/bsec2
|
||||||
boschsensortec/bsec2@1.10.2610
|
boschsensortec/bsec2@1.10.2610
|
||||||
# renovate: datasource=custom.pio depName=Bosch BME68x packageName=boschsensortec/library/BME68x Sensor Library
|
# renovate: datasource=custom.pio depName=Bosch BME68x packageName=boschsensortec/library/BME68x Sensor Library
|
||||||
boschsensortec/BME68x Sensor Library@1.3.40408
|
boschsensortec/BME68x Sensor Library@1.3.40408
|
||||||
# renovate: datasource=git-refs depName=meshtastic-DFRobot_LarkWeatherStation packageName=https://github.com/meshtastic/DFRobot_LarkWeatherStation gitBranch=master
|
|
||||||
https://github.com/meshtastic/DFRobot_LarkWeatherStation/archive/4de3a9cadef0f6a5220a8a906cf9775b02b0040d.zip
|
|
||||||
# renovate: datasource=custom.pio depName=Sensirion Core packageName=sensirion/library/Sensirion Core
|
|
||||||
sensirion/Sensirion Core@0.7.3
|
|
||||||
# renovate: datasource=custom.pio depName=Sensirion I2C SCD4x packageName=sensirion/library/Sensirion I2C SCD4x
|
|
||||||
sensirion/Sensirion I2C SCD4x@1.1.0
|
|
||||||
|
|
||||||
; Same as environmental_extra but without BSEC (saves ~3.5KB DRAM for original ESP32 targets)
|
; Environmental sensors without BSEC (saves ~3.5KB DRAM for original ESP32 targets)
|
||||||
[environmental_extra_no_bsec]
|
[environmental_extra_no_bsec]
|
||||||
lib_deps =
|
lib_deps =
|
||||||
# renovate: datasource=custom.pio depName=Adafruit BMP3XX packageName=adafruit/library/Adafruit BMP3XX Library
|
${environmental_extra_common.lib_deps}
|
||||||
adafruit/Adafruit BMP3XX Library@2.1.6
|
# renovate: datasource=custom.pio depName=Adafruit_BME680 packageName=adafruit/library/Adafruit BME680 Library
|
||||||
# renovate: datasource=custom.pio depName=Adafruit MAX1704X packageName=adafruit/library/Adafruit MAX1704X
|
adafruit/Adafruit BME680 Library@2.0.6
|
||||||
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.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
|
|
||||||
adafruit/Adafruit SHT31 Library@2.2.2
|
|
||||||
# renovate: datasource=custom.pio depName=Adafruit VEML7700 packageName=adafruit/library/Adafruit VEML7700 Library
|
|
||||||
adafruit/Adafruit VEML7700 Library@2.1.6
|
|
||||||
# renovate: datasource=custom.pio depName=Adafruit SHT4x packageName=adafruit/library/Adafruit SHT4x Library
|
|
||||||
adafruit/Adafruit SHT4x Library@1.0.5
|
|
||||||
# renovate: datasource=custom.pio depName=SparkFun Qwiic Scale NAU7802 packageName=sparkfun/library/SparkFun Qwiic Scale NAU7802 Arduino Library
|
|
||||||
sparkfun/SparkFun Qwiic Scale NAU7802 Arduino Library@1.0.6
|
|
||||||
# renovate: datasource=custom.pio depName=ClosedCube OPT3001 packageName=closedcube/library/ClosedCube OPT3001
|
|
||||||
closedcube/ClosedCube OPT3001@1.1.2
|
|
||||||
# renovate: datasource=git-refs depName=meshtastic-DFRobot_LarkWeatherStation packageName=https://github.com/meshtastic/DFRobot_LarkWeatherStation gitBranch=master
|
|
||||||
https://github.com/meshtastic/DFRobot_LarkWeatherStation/archive/4de3a9cadef0f6a5220a8a906cf9775b02b0040d.zip
|
|
||||||
# renovate: datasource=custom.pio depName=Sensirion Core packageName=sensirion/library/Sensirion Core
|
|
||||||
sensirion/Sensirion Core@0.7.3
|
|
||||||
# renovate: datasource=custom.pio depName=Sensirion I2C SCD4x packageName=sensirion/library/Sensirion I2C SCD4x
|
|
||||||
sensirion/Sensirion I2C SCD4x@1.1.0
|
|
||||||
|
|||||||
+1
-1
Submodule protobufs updated: e1a6b3a868...cb1f89372a
+68
-59
@@ -1,19 +1,23 @@
|
|||||||
|
#ifndef AMBIENTLIGHTINGTHREAD_H
|
||||||
|
#define AMBIENTLIGHTINGTHREAD_H
|
||||||
|
|
||||||
#include "Observer.h"
|
#include "Observer.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
#include "detect/ScanI2C.h"
|
||||||
|
#include "sleep.h"
|
||||||
|
|
||||||
#ifdef HAS_NCP5623
|
#ifdef HAS_NCP5623
|
||||||
#include <graphics/RAKled.h>
|
#include <Wire.h>
|
||||||
NCP5623 rgb;
|
|
||||||
|
#include <NCP5623.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_LP5562
|
#ifdef HAS_LP5562
|
||||||
#include <graphics/NomadStarLED.h>
|
#include <graphics/NomadStarLED.h>
|
||||||
LP5562 rgbw;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_NEOPIXEL
|
#ifdef HAS_NEOPIXEL
|
||||||
#include <graphics/NeoPixel.h>
|
#include <Adafruit_NeoPixel.h>
|
||||||
Adafruit_NeoPixel pixels(NEOPIXEL_COUNT, NEOPIXEL_DATA, NEOPIXEL_TYPE);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef UNPHONE
|
#ifdef UNPHONE
|
||||||
@@ -21,10 +25,24 @@ Adafruit_NeoPixel pixels(NEOPIXEL_COUNT, NEOPIXEL_DATA, NEOPIXEL_TYPE);
|
|||||||
extern unPhone unphone;
|
extern unPhone unphone;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace concurrency
|
|
||||||
{
|
|
||||||
class AmbientLightingThread : public concurrency::OSThread
|
class AmbientLightingThread : public concurrency::OSThread
|
||||||
{
|
{
|
||||||
|
friend class StatusLEDModule; // Let the LEDStatusModule trigger the ambient lighting for notifications and battery status.
|
||||||
|
friend class ExternalNotificationModule; // Let the ExternalNotificationModule trigger the ambient lighting for notifications.
|
||||||
|
|
||||||
|
private:
|
||||||
|
#ifdef HAS_NCP5623
|
||||||
|
NCP5623 rgb;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAS_LP5562
|
||||||
|
LP5562 rgbw;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAS_NEOPIXEL
|
||||||
|
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NEOPIXEL_COUNT, NEOPIXEL_DATA, NEOPIXEL_TYPE);
|
||||||
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AmbientLightingThread(ScanI2C::DeviceType type) : OSThread("AmbientLighting")
|
explicit AmbientLightingThread(ScanI2C::DeviceType type) : OSThread("AmbientLighting")
|
||||||
{
|
{
|
||||||
@@ -36,14 +54,15 @@ class AmbientLightingThread : public concurrency::OSThread
|
|||||||
moduleConfig.ambient_lighting.led_state = true;
|
moduleConfig.ambient_lighting.led_state = true;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
// Uncomment to test module
|
#if AMBIENT_LIGHTING_TEST
|
||||||
// moduleConfig.ambient_lighting.led_state = true;
|
// define to enable test
|
||||||
// moduleConfig.ambient_lighting.current = 10;
|
moduleConfig.ambient_lighting.led_state = true;
|
||||||
|
moduleConfig.ambient_lighting.current = 10;
|
||||||
// Default to a color based on our node number
|
// Default to a color based on our node number
|
||||||
// moduleConfig.ambient_lighting.red = (myNodeInfo.my_node_num & 0xFF0000) >> 16;
|
moduleConfig.ambient_lighting.red = (myNodeInfo.my_node_num & 0xFF0000) >> 16;
|
||||||
// moduleConfig.ambient_lighting.green = (myNodeInfo.my_node_num & 0x00FF00) >> 8;
|
moduleConfig.ambient_lighting.green = (myNodeInfo.my_node_num & 0x00FF00) >> 8;
|
||||||
// moduleConfig.ambient_lighting.blue = myNodeInfo.my_node_num & 0x0000FF;
|
moduleConfig.ambient_lighting.blue = myNodeInfo.my_node_num & 0x0000FF;
|
||||||
|
#endif
|
||||||
#if defined(HAS_NCP5623) || defined(HAS_LP5562)
|
#if defined(HAS_NCP5623) || defined(HAS_LP5562)
|
||||||
_type = type;
|
_type = type;
|
||||||
if (_type == ScanI2C::DeviceType::NONE) {
|
if (_type == ScanI2C::DeviceType::NONE) {
|
||||||
@@ -53,11 +72,6 @@ class AmbientLightingThread : public concurrency::OSThread
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAS_RGB_LED
|
#ifdef HAS_RGB_LED
|
||||||
if (!moduleConfig.ambient_lighting.led_state) {
|
|
||||||
LOG_DEBUG("AmbientLighting Disable due to moduleConfig.ambient_lighting.led_state OFF");
|
|
||||||
disable();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
LOG_DEBUG("AmbientLighting init");
|
LOG_DEBUG("AmbientLighting init");
|
||||||
#ifdef HAS_NCP5623
|
#ifdef HAS_NCP5623
|
||||||
if (_type == ScanI2C::NCP5623) {
|
if (_type == ScanI2C::NCP5623) {
|
||||||
@@ -77,7 +91,13 @@ class AmbientLightingThread : public concurrency::OSThread
|
|||||||
pixels.clear(); // Set all pixel colors to 'off'
|
pixels.clear(); // Set all pixel colors to 'off'
|
||||||
pixels.setBrightness(moduleConfig.ambient_lighting.current);
|
pixels.setBrightness(moduleConfig.ambient_lighting.current);
|
||||||
#endif
|
#endif
|
||||||
setLighting();
|
if (!moduleConfig.ambient_lighting.led_state) {
|
||||||
|
LOG_DEBUG("AmbientLighting Disable due to moduleConfig.ambient_lighting.led_state OFF");
|
||||||
|
disable();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setLighting(moduleConfig.ambient_lighting.current, moduleConfig.ambient_lighting.red,
|
||||||
|
moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue);
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAS_NCP5623) || defined(HAS_LP5562)
|
#if defined(HAS_NCP5623) || defined(HAS_LP5562)
|
||||||
}
|
}
|
||||||
@@ -91,7 +111,8 @@ class AmbientLightingThread : public concurrency::OSThread
|
|||||||
#if defined(HAS_NCP5623) || defined(HAS_LP5562)
|
#if defined(HAS_NCP5623) || defined(HAS_LP5562)
|
||||||
if ((_type == ScanI2C::NCP5623 || _type == ScanI2C::LP5562) && moduleConfig.ambient_lighting.led_state) {
|
if ((_type == ScanI2C::NCP5623 || _type == ScanI2C::LP5562) && moduleConfig.ambient_lighting.led_state) {
|
||||||
#endif
|
#endif
|
||||||
setLighting();
|
setLighting(moduleConfig.ambient_lighting.current, moduleConfig.ambient_lighting.red,
|
||||||
|
moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue);
|
||||||
return 30000; // 30 seconds to reset from any animations that may have been running from Ext. Notification
|
return 30000; // 30 seconds to reset from any animations that may have been running from Ext. Notification
|
||||||
#if defined(HAS_NCP5623) || defined(HAS_LP5562)
|
#if defined(HAS_NCP5623) || defined(HAS_LP5562)
|
||||||
}
|
}
|
||||||
@@ -148,65 +169,53 @@ class AmbientLightingThread : public concurrency::OSThread
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setLighting()
|
protected:
|
||||||
|
void setLighting(float current, uint8_t red, uint8_t green, uint8_t blue)
|
||||||
{
|
{
|
||||||
#ifdef HAS_NCP5623
|
#ifdef HAS_NCP5623
|
||||||
rgb.setCurrent(moduleConfig.ambient_lighting.current);
|
rgb.setCurrent(current);
|
||||||
rgb.setRed(moduleConfig.ambient_lighting.red);
|
rgb.setRed(red);
|
||||||
rgb.setGreen(moduleConfig.ambient_lighting.green);
|
rgb.setGreen(green);
|
||||||
rgb.setBlue(moduleConfig.ambient_lighting.blue);
|
rgb.setBlue(blue);
|
||||||
LOG_DEBUG("Init NCP5623 Ambient light w/ current=%d, red=%d, green=%d, blue=%d",
|
LOG_DEBUG("Init NCP5623 Ambient light w/ current=%f, red=%d, green=%d, blue=%d", current, red, green, blue);
|
||||||
moduleConfig.ambient_lighting.current, moduleConfig.ambient_lighting.red,
|
|
||||||
moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue);
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAS_LP5562
|
#ifdef HAS_LP5562
|
||||||
rgbw.setCurrent(moduleConfig.ambient_lighting.current);
|
rgbw.setCurrent(current);
|
||||||
rgbw.setRed(moduleConfig.ambient_lighting.red);
|
rgbw.setRed(red);
|
||||||
rgbw.setGreen(moduleConfig.ambient_lighting.green);
|
rgbw.setGreen(green);
|
||||||
rgbw.setBlue(moduleConfig.ambient_lighting.blue);
|
rgbw.setBlue(blue);
|
||||||
LOG_DEBUG("Init LP5562 Ambient light w/ current=%d, red=%d, green=%d, blue=%d", moduleConfig.ambient_lighting.current,
|
LOG_DEBUG("Init LP5562 Ambient light w/ current=%f, red=%d, green=%d, blue=%d", current, red, green, blue);
|
||||||
moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue);
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAS_NEOPIXEL
|
#ifdef HAS_NEOPIXEL
|
||||||
pixels.fill(pixels.Color(moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green,
|
pixels.fill(pixels.Color(red, green, blue), 0, NEOPIXEL_COUNT);
|
||||||
moduleConfig.ambient_lighting.blue),
|
|
||||||
0, NEOPIXEL_COUNT);
|
|
||||||
|
|
||||||
// RadioMaster Bandit has addressable LED at the two buttons
|
// RadioMaster Bandit has addressable LED at the two buttons
|
||||||
// this allow us to set different lighting for them in variant.h file.
|
// this allow us to set different lighting for them in variant.h file.
|
||||||
#ifdef RADIOMASTER_900_BANDIT
|
|
||||||
#if defined(BUTTON1_COLOR) && defined(BUTTON1_COLOR_INDEX)
|
#if defined(BUTTON1_COLOR) && defined(BUTTON1_COLOR_INDEX)
|
||||||
pixels.fill(BUTTON1_COLOR, BUTTON1_COLOR_INDEX, 1);
|
pixels.fill(BUTTON1_COLOR, BUTTON1_COLOR_INDEX, 1);
|
||||||
#endif
|
#endif
|
||||||
#if defined(BUTTON2_COLOR) && defined(BUTTON2_COLOR_INDEX)
|
#if defined(BUTTON2_COLOR) && defined(BUTTON2_COLOR_INDEX)
|
||||||
pixels.fill(BUTTON2_COLOR, BUTTON2_COLOR_INDEX, 1);
|
pixels.fill(BUTTON2_COLOR, BUTTON2_COLOR_INDEX, 1);
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
pixels.show();
|
pixels.show();
|
||||||
// LOG_DEBUG("Init NeoPixel Ambient light w/ brightness(current)=%d, red=%d, green=%d, blue=%d",
|
// LOG_DEBUG("Init NeoPixel Ambient light w/ brightness(current)=%f, red=%d, green=%d, blue=%d",
|
||||||
// moduleConfig.ambient_lighting.current, moduleConfig.ambient_lighting.red,
|
// current, red, green, blue);
|
||||||
// moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue);
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef RGBLED_CA
|
#ifdef RGBLED_CA
|
||||||
analogWrite(RGBLED_RED, 255 - moduleConfig.ambient_lighting.red);
|
analogWrite(RGBLED_RED, 255 - red);
|
||||||
analogWrite(RGBLED_GREEN, 255 - moduleConfig.ambient_lighting.green);
|
analogWrite(RGBLED_GREEN, 255 - green);
|
||||||
analogWrite(RGBLED_BLUE, 255 - moduleConfig.ambient_lighting.blue);
|
analogWrite(RGBLED_BLUE, 255 - blue);
|
||||||
LOG_DEBUG("Init Ambient light RGB Common Anode w/ red=%d, green=%d, blue=%d", moduleConfig.ambient_lighting.red,
|
LOG_DEBUG("Init Ambient light RGB Common Anode w/ red=%d, green=%d, blue=%d", red, green, blue);
|
||||||
moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue);
|
|
||||||
#elif defined(RGBLED_RED)
|
#elif defined(RGBLED_RED)
|
||||||
analogWrite(RGBLED_RED, moduleConfig.ambient_lighting.red);
|
analogWrite(RGBLED_RED, red);
|
||||||
analogWrite(RGBLED_GREEN, moduleConfig.ambient_lighting.green);
|
analogWrite(RGBLED_GREEN, green);
|
||||||
analogWrite(RGBLED_BLUE, moduleConfig.ambient_lighting.blue);
|
analogWrite(RGBLED_BLUE, blue);
|
||||||
LOG_DEBUG("Init Ambient light RGB Common Cathode w/ red=%d, green=%d, blue=%d", moduleConfig.ambient_lighting.red,
|
LOG_DEBUG("Init Ambient light RGB Common Cathode w/ red=%d, green=%d, blue=%d", red, green, blue);
|
||||||
moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue);
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef UNPHONE
|
#ifdef UNPHONE
|
||||||
unphone.rgb(moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green,
|
unphone.rgb(red, green, blue);
|
||||||
moduleConfig.ambient_lighting.blue);
|
LOG_DEBUG("Init unPhone Ambient light w/ red=%d, green=%d, blue=%d", red, green, blue);
|
||||||
LOG_DEBUG("Init unPhone Ambient light w/ red=%d, green=%d, blue=%d", moduleConfig.ambient_lighting.red,
|
|
||||||
moduleConfig.ambient_lighting.green, moduleConfig.ambient_lighting.blue);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
#endif // AMBIENTLIGHTINGTHREAD_H
|
||||||
} // namespace concurrency
|
|
||||||
+11
-16
@@ -4,6 +4,7 @@
|
|||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "sleep.h"
|
#include "sleep.h"
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#ifdef HAS_I2S
|
#ifdef HAS_I2S
|
||||||
#include <AudioFileSourcePROGMEM.h>
|
#include <AudioFileSourcePROGMEM.h>
|
||||||
@@ -29,9 +30,9 @@ class AudioThread : public concurrency::OSThread
|
|||||||
io.digitalWrite(EXPANDS_AMP_EN, HIGH);
|
io.digitalWrite(EXPANDS_AMP_EN, HIGH);
|
||||||
#endif
|
#endif
|
||||||
setCPUFast(true);
|
setCPUFast(true);
|
||||||
rtttlFile = new AudioFileSourcePROGMEM(data, len);
|
rtttlFile = std::unique_ptr<AudioFileSourcePROGMEM>(new AudioFileSourcePROGMEM(data, len));
|
||||||
i2sRtttl = new AudioGeneratorRTTTL();
|
i2sRtttl = std::unique_ptr<AudioGeneratorRTTTL>(new AudioGeneratorRTTTL());
|
||||||
i2sRtttl->begin(rtttlFile, audioOut);
|
i2sRtttl->begin(rtttlFile.get(), audioOut.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Also handles actually playing the RTTTL, needs to be called in loop
|
// Also handles actually playing the RTTTL, needs to be called in loop
|
||||||
@@ -47,14 +48,10 @@ class AudioThread : public concurrency::OSThread
|
|||||||
{
|
{
|
||||||
if (i2sRtttl != nullptr) {
|
if (i2sRtttl != nullptr) {
|
||||||
i2sRtttl->stop();
|
i2sRtttl->stop();
|
||||||
delete i2sRtttl;
|
|
||||||
i2sRtttl = nullptr;
|
i2sRtttl = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rtttlFile != nullptr) {
|
rtttlFile = nullptr;
|
||||||
delete rtttlFile;
|
|
||||||
rtttlFile = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
setCPUFast(false);
|
setCPUFast(false);
|
||||||
#ifdef T_LORA_PAGER
|
#ifdef T_LORA_PAGER
|
||||||
@@ -66,16 +63,14 @@ class AudioThread : public concurrency::OSThread
|
|||||||
{
|
{
|
||||||
if (i2sRtttl != nullptr) {
|
if (i2sRtttl != nullptr) {
|
||||||
i2sRtttl->stop();
|
i2sRtttl->stop();
|
||||||
delete i2sRtttl;
|
|
||||||
i2sRtttl = nullptr;
|
i2sRtttl = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef T_LORA_PAGER
|
#ifdef T_LORA_PAGER
|
||||||
io.digitalWrite(EXPANDS_AMP_EN, HIGH);
|
io.digitalWrite(EXPANDS_AMP_EN, HIGH);
|
||||||
#endif
|
#endif
|
||||||
ESP8266SAM *sam = new ESP8266SAM;
|
auto sam = std::unique_ptr<ESP8266SAM>(new ESP8266SAM);
|
||||||
sam->Say(audioOut, text);
|
sam->Say(audioOut.get(), text);
|
||||||
delete sam;
|
|
||||||
setCPUFast(false);
|
setCPUFast(false);
|
||||||
#ifdef T_LORA_PAGER
|
#ifdef T_LORA_PAGER
|
||||||
io.digitalWrite(EXPANDS_AMP_EN, LOW);
|
io.digitalWrite(EXPANDS_AMP_EN, LOW);
|
||||||
@@ -96,15 +91,15 @@ class AudioThread : public concurrency::OSThread
|
|||||||
private:
|
private:
|
||||||
void initOutput()
|
void initOutput()
|
||||||
{
|
{
|
||||||
audioOut = new AudioOutputI2S(1, AudioOutputI2S::EXTERNAL_I2S);
|
audioOut = std::unique_ptr<AudioOutputI2S>(new AudioOutputI2S(1, AudioOutputI2S::EXTERNAL_I2S));
|
||||||
audioOut->SetPinout(DAC_I2S_BCK, DAC_I2S_WS, DAC_I2S_DOUT, DAC_I2S_MCLK);
|
audioOut->SetPinout(DAC_I2S_BCK, DAC_I2S_WS, DAC_I2S_DOUT, DAC_I2S_MCLK);
|
||||||
audioOut->SetGain(0.2);
|
audioOut->SetGain(0.2);
|
||||||
};
|
};
|
||||||
|
|
||||||
AudioGeneratorRTTTL *i2sRtttl = nullptr;
|
std::unique_ptr<AudioGeneratorRTTTL> i2sRtttl = nullptr;
|
||||||
AudioOutputI2S *audioOut = nullptr;
|
std::unique_ptr<AudioOutputI2S> audioOut = nullptr;
|
||||||
|
|
||||||
AudioFileSourcePROGMEM *rtttlFile = nullptr;
|
std::unique_ptr<AudioFileSourcePROGMEM> rtttlFile = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+2
-10
@@ -89,22 +89,14 @@ class BluetoothStatus : public Status
|
|||||||
case ConnectionState::CONNECTED:
|
case ConnectionState::CONNECTED:
|
||||||
LOG_DEBUG("BluetoothStatus CONNECTED");
|
LOG_DEBUG("BluetoothStatus CONNECTED");
|
||||||
#ifdef BLE_LED
|
#ifdef BLE_LED
|
||||||
#ifdef BLE_LED_INVERTED
|
digitalWrite(BLE_LED, LED_STATE_ON);
|
||||||
digitalWrite(BLE_LED, LOW);
|
|
||||||
#else
|
|
||||||
digitalWrite(BLE_LED, HIGH);
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ConnectionState::DISCONNECTED:
|
case ConnectionState::DISCONNECTED:
|
||||||
LOG_DEBUG("BluetoothStatus DISCONNECTED");
|
LOG_DEBUG("BluetoothStatus DISCONNECTED");
|
||||||
#ifdef BLE_LED
|
#ifdef BLE_LED
|
||||||
#ifdef BLE_LED_INVERTED
|
digitalWrite(BLE_LED, LED_STATE_OFF);
|
||||||
digitalWrite(BLE_LED, HIGH);
|
|
||||||
#else
|
|
||||||
digitalWrite(BLE_LED, LOW);
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
-66
@@ -1,66 +0,0 @@
|
|||||||
#include "Led.h"
|
|
||||||
#include "PowerMon.h"
|
|
||||||
#include "main.h"
|
|
||||||
#include "power.h"
|
|
||||||
|
|
||||||
GpioVirtPin ledForceOn, ledBlink;
|
|
||||||
|
|
||||||
#if defined(LED_PIN)
|
|
||||||
// Most boards have a GPIO for LED control
|
|
||||||
static GpioHwPin ledRawHwPin(LED_PIN);
|
|
||||||
#else
|
|
||||||
static GpioVirtPin ledRawHwPin; // Dummy pin for no hardware
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LED_STATE_ON == 0
|
|
||||||
static GpioVirtPin ledHwPin;
|
|
||||||
static GpioNotTransformer ledInverter(&ledHwPin, &ledRawHwPin);
|
|
||||||
#else
|
|
||||||
static GpioPin &ledHwPin = ledRawHwPin;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(HAS_PMU)
|
|
||||||
/**
|
|
||||||
* A GPIO controlled by the PMU
|
|
||||||
*/
|
|
||||||
class GpioPmuPin : public GpioPin
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void set(bool value)
|
|
||||||
{
|
|
||||||
if (pmu_found && PMU) {
|
|
||||||
// blink the axp led
|
|
||||||
PMU->setChargingLedMode(value ? XPOWERS_CHG_LED_ON : XPOWERS_CHG_LED_OFF);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} ledPmuHwPin;
|
|
||||||
|
|
||||||
// In some cases we need to drive a PMU LED and a normal LED
|
|
||||||
static GpioSplitter ledFinalPin(&ledHwPin, &ledPmuHwPin);
|
|
||||||
#else
|
|
||||||
static GpioPin &ledFinalPin = ledHwPin;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_POWERMON
|
|
||||||
/**
|
|
||||||
* We monitor changes to the LED drive output because we use that as a sanity test in our power monitor stuff.
|
|
||||||
*/
|
|
||||||
class MonitoredLedPin : public GpioPin
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void set(bool value)
|
|
||||||
{
|
|
||||||
if (powerMon) {
|
|
||||||
if (value)
|
|
||||||
powerMon->setState(meshtastic_PowerMon_State_LED_On);
|
|
||||||
else
|
|
||||||
powerMon->clearState(meshtastic_PowerMon_State_LED_On);
|
|
||||||
}
|
|
||||||
ledFinalPin.set(value);
|
|
||||||
}
|
|
||||||
} monitoredLedPin;
|
|
||||||
#else
|
|
||||||
static GpioPin &monitoredLedPin = ledFinalPin;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static GpioBinaryTransformer ledForcer(&ledForceOn, &ledBlink, &monitoredLedPin, GpioBinaryTransformer::Or);
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#include "GpioLogic.h"
|
|
||||||
#include "configuration.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ledForceOn and ledForceOff both override the normal ledBlinker behavior (which is controlled by main)
|
|
||||||
*/
|
|
||||||
extern GpioVirtPin ledForceOn, ledBlink;
|
|
||||||
+98
-11
@@ -459,6 +459,8 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
|||||||
}
|
}
|
||||||
// if it's not HIGH - check the battery
|
// if it's not HIGH - check the battery
|
||||||
#endif
|
#endif
|
||||||
|
// If we have an EXT_PWR_DETECT pin and it indicates no external power, believe it.
|
||||||
|
return false;
|
||||||
|
|
||||||
// technically speaking this should work for all(?) NRF52 boards
|
// technically speaking this should work for all(?) NRF52 boards
|
||||||
// but needs testing across multiple devices. NRF52 USB would not even work if
|
// but needs testing across multiple devices. NRF52 USB would not even work if
|
||||||
@@ -690,7 +692,9 @@ bool Power::setup()
|
|||||||
bool found = false;
|
bool found = false;
|
||||||
if (axpChipInit()) {
|
if (axpChipInit()) {
|
||||||
found = true;
|
found = true;
|
||||||
} else if (lipoInit()) {
|
} else if (cw2015Init()) {
|
||||||
|
found = true;
|
||||||
|
} else if (max17048Init()) {
|
||||||
found = true;
|
found = true;
|
||||||
} else if (lipoChargerInit()) {
|
} else if (lipoChargerInit()) {
|
||||||
found = true;
|
found = true;
|
||||||
@@ -700,11 +704,11 @@ bool Power::setup()
|
|||||||
found = true;
|
found = true;
|
||||||
} else if (analogInit()) {
|
} else if (analogInit()) {
|
||||||
found = true;
|
found = true;
|
||||||
}
|
} else {
|
||||||
|
|
||||||
#ifdef NRF_APM
|
#ifdef NRF_APM
|
||||||
found = true;
|
found = true;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
#ifdef EXT_PWR_DETECT
|
#ifdef EXT_PWR_DETECT
|
||||||
attachInterrupt(
|
attachInterrupt(
|
||||||
EXT_PWR_DETECT,
|
EXT_PWR_DETECT,
|
||||||
@@ -842,8 +846,10 @@ void Power::readPowerStatus()
|
|||||||
|
|
||||||
if (batteryLevel) {
|
if (batteryLevel) {
|
||||||
hasBattery = batteryLevel->isBatteryConnect() ? OptTrue : OptFalse;
|
hasBattery = batteryLevel->isBatteryConnect() ? OptTrue : OptFalse;
|
||||||
|
#ifndef NRF_APM
|
||||||
usbPowered = batteryLevel->isVbusIn() ? OptTrue : OptFalse;
|
usbPowered = batteryLevel->isVbusIn() ? OptTrue : OptFalse;
|
||||||
isChargingNow = batteryLevel->isCharging() ? OptTrue : OptFalse;
|
isChargingNow = batteryLevel->isCharging() ? OptTrue : OptFalse;
|
||||||
|
#endif
|
||||||
if (hasBattery) {
|
if (hasBattery) {
|
||||||
batteryVoltageMv = batteryLevel->getBattVoltage();
|
batteryVoltageMv = batteryLevel->getBattVoltage();
|
||||||
// If the AXP192 returns a valid battery percentage, use it
|
// If the AXP192 returns a valid battery percentage, use it
|
||||||
@@ -1319,7 +1325,7 @@ bool Power::axpChipInit()
|
|||||||
/**
|
/**
|
||||||
* Wrapper class for an I2C MAX17048 Lipo battery sensor.
|
* Wrapper class for an I2C MAX17048 Lipo battery sensor.
|
||||||
*/
|
*/
|
||||||
class LipoBatteryLevel : public HasBatteryLevel
|
class MAX17048BatteryLevel : public HasBatteryLevel
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
MAX17048Singleton *max17048 = nullptr;
|
MAX17048Singleton *max17048 = nullptr;
|
||||||
@@ -1367,18 +1373,18 @@ class LipoBatteryLevel : public HasBatteryLevel
|
|||||||
virtual bool isCharging() override { return max17048->isBatteryCharging(); }
|
virtual bool isCharging() override { return max17048->isBatteryCharging(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
LipoBatteryLevel lipoLevel;
|
MAX17048BatteryLevel max17048Level;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Init the Lipo battery level sensor
|
* Init the Lipo battery level sensor
|
||||||
*/
|
*/
|
||||||
bool Power::lipoInit()
|
bool Power::max17048Init()
|
||||||
{
|
{
|
||||||
bool result = lipoLevel.runOnce();
|
bool result = max17048Level.runOnce();
|
||||||
LOG_DEBUG("Power::lipoInit lipo sensor is %s", result ? "ready" : "not ready yet");
|
LOG_DEBUG("Power::max17048Init lipo sensor is %s", result ? "ready" : "not ready yet");
|
||||||
if (!result)
|
if (!result)
|
||||||
return false;
|
return false;
|
||||||
batteryLevel = &lipoLevel;
|
batteryLevel = &max17048Level;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1386,7 +1392,88 @@ bool Power::lipoInit()
|
|||||||
/**
|
/**
|
||||||
* The Lipo battery level sensor is unavailable - default to AnalogBatteryLevel
|
* The Lipo battery level sensor is unavailable - default to AnalogBatteryLevel
|
||||||
*/
|
*/
|
||||||
bool Power::lipoInit()
|
bool Power::max17048Init()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !MESHTASTIC_EXCLUDE_I2C && HAS_CW2015
|
||||||
|
|
||||||
|
class CW2015BatteryLevel : public AnalogBatteryLevel
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Battery state of charge, from 0 to 100 or -1 for unknown
|
||||||
|
*/
|
||||||
|
virtual int getBatteryPercent() override
|
||||||
|
{
|
||||||
|
int data = -1;
|
||||||
|
Wire.beginTransmission(CW2015_ADDR);
|
||||||
|
Wire.write(0x04);
|
||||||
|
if (Wire.endTransmission() == 0) {
|
||||||
|
if (Wire.requestFrom(CW2015_ADDR, (uint8_t)1)) {
|
||||||
|
data = Wire.read();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The raw voltage of the battery in millivolts, or NAN if unknown
|
||||||
|
*/
|
||||||
|
virtual uint16_t getBattVoltage() override
|
||||||
|
{
|
||||||
|
uint16_t mv = 0;
|
||||||
|
Wire.beginTransmission(CW2015_ADDR);
|
||||||
|
Wire.write(0x02);
|
||||||
|
if (Wire.endTransmission() == 0) {
|
||||||
|
if (Wire.requestFrom(CW2015_ADDR, (uint8_t)2)) {
|
||||||
|
mv = Wire.read();
|
||||||
|
mv <<= 8;
|
||||||
|
mv |= Wire.read();
|
||||||
|
// Voltage is read in 305uV units, convert to mV
|
||||||
|
mv = mv * 305 / 1000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return mv;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
CW2015BatteryLevel cw2015Level;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Init the CW2015 battery level sensor
|
||||||
|
*/
|
||||||
|
bool Power::cw2015Init()
|
||||||
|
{
|
||||||
|
|
||||||
|
Wire.beginTransmission(CW2015_ADDR);
|
||||||
|
uint8_t getInfo[] = {0x0a, 0x00};
|
||||||
|
Wire.write(getInfo, 2);
|
||||||
|
Wire.endTransmission();
|
||||||
|
delay(10);
|
||||||
|
Wire.beginTransmission(CW2015_ADDR);
|
||||||
|
Wire.write(0x00);
|
||||||
|
bool result = false;
|
||||||
|
if (Wire.endTransmission() == 0) {
|
||||||
|
if (Wire.requestFrom(CW2015_ADDR, (uint8_t)1)) {
|
||||||
|
uint8_t data = Wire.read();
|
||||||
|
LOG_DEBUG("CW2015 init read data: 0x%x", data);
|
||||||
|
if (data == 0x73) {
|
||||||
|
result = true;
|
||||||
|
batteryLevel = &cw2015Level;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
/**
|
||||||
|
* The CW2015 battery level sensor is unavailable - default to AnalogBatteryLevel
|
||||||
|
*/
|
||||||
|
bool Power::cw2015Init()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-6
@@ -9,13 +9,13 @@
|
|||||||
*/
|
*/
|
||||||
#include "PowerFSM.h"
|
#include "PowerFSM.h"
|
||||||
#include "Default.h"
|
#include "Default.h"
|
||||||
#include "Led.h"
|
|
||||||
#include "MeshService.h"
|
#include "MeshService.h"
|
||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "PowerMon.h"
|
#include "PowerMon.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "graphics/Screen.h"
|
#include "graphics/Screen.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include "modules/StatusLEDModule.h"
|
||||||
#include "sleep.h"
|
#include "sleep.h"
|
||||||
#include "target_specific.h"
|
#include "target_specific.h"
|
||||||
|
|
||||||
@@ -38,7 +38,10 @@ static bool isPowered()
|
|||||||
return true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool isRouter = (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER ? 1 : 0);
|
bool isRouter = ((config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER ||
|
||||||
|
config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER_LATE)
|
||||||
|
? 1
|
||||||
|
: 0);
|
||||||
|
|
||||||
// If we are not a router and we already have AC power go to POWER state after init, otherwise go to ON
|
// If we are not a router and we already have AC power go to POWER state after init, otherwise go to ON
|
||||||
// We assume routers might be powered all the time, but from a low current (solar) source
|
// We assume routers might be powered all the time, but from a low current (solar) source
|
||||||
@@ -103,7 +106,7 @@ static void lsIdle()
|
|||||||
uint32_t sleepTime = SLEEP_TIME;
|
uint32_t sleepTime = SLEEP_TIME;
|
||||||
|
|
||||||
powerMon->setState(meshtastic_PowerMon_State_CPU_LightSleep);
|
powerMon->setState(meshtastic_PowerMon_State_CPU_LightSleep);
|
||||||
ledBlink.set(false); // Never leave led on while in light sleep
|
statusLEDModule->setPowerLED(false);
|
||||||
esp_sleep_source_t wakeCause2 = doLightSleep(sleepTime * 1000LL);
|
esp_sleep_source_t wakeCause2 = doLightSleep(sleepTime * 1000LL);
|
||||||
powerMon->clearState(meshtastic_PowerMon_State_CPU_LightSleep);
|
powerMon->clearState(meshtastic_PowerMon_State_CPU_LightSleep);
|
||||||
|
|
||||||
@@ -111,7 +114,7 @@ static void lsIdle()
|
|||||||
case ESP_SLEEP_WAKEUP_TIMER:
|
case ESP_SLEEP_WAKEUP_TIMER:
|
||||||
// Normal case: timer expired, we should just go back to sleep ASAP
|
// Normal case: timer expired, we should just go back to sleep ASAP
|
||||||
|
|
||||||
ledBlink.set(true); // briefly turn on led
|
statusLEDModule->setPowerLED(true);
|
||||||
wakeCause2 = doLightSleep(100); // leave led on for 1ms
|
wakeCause2 = doLightSleep(100); // leave led on for 1ms
|
||||||
|
|
||||||
secsSlept += sleepTime;
|
secsSlept += sleepTime;
|
||||||
@@ -146,7 +149,7 @@ static void lsIdle()
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Time to stop sleeping!
|
// Time to stop sleeping!
|
||||||
ledBlink.set(false);
|
statusLEDModule->setPowerLED(false);
|
||||||
LOG_INFO("Reached ls_secs, service loop()");
|
LOG_INFO("Reached ls_secs, service loop()");
|
||||||
powerFSM.trigger(EVENT_WAKE_TIMER);
|
powerFSM.trigger(EVENT_WAKE_TIMER);
|
||||||
}
|
}
|
||||||
@@ -262,7 +265,10 @@ Fsm powerFSM(&stateBOOT);
|
|||||||
|
|
||||||
void PowerFSM_setup()
|
void PowerFSM_setup()
|
||||||
{
|
{
|
||||||
bool isRouter = (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER ? 1 : 0);
|
bool isRouter = ((config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER ||
|
||||||
|
config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER_LATE)
|
||||||
|
? 1
|
||||||
|
: 0);
|
||||||
bool hasPower = isPowered();
|
bool hasPower = isPowered();
|
||||||
|
|
||||||
LOG_INFO("PowerFSM init, USB power=%d", hasPower ? 1 : 0);
|
LOG_INFO("PowerFSM init, USB power=%d", hasPower ? 1 : 0);
|
||||||
|
|||||||
+19
-30
@@ -227,34 +227,21 @@ void RedirectablePrint::log_to_ble(const char *logLevel, const char *format, va_
|
|||||||
isBleConnected = nrf52Bluetooth != nullptr && nrf52Bluetooth->isConnected();
|
isBleConnected = nrf52Bluetooth != nullptr && nrf52Bluetooth->isConnected();
|
||||||
#endif
|
#endif
|
||||||
if (isBleConnected) {
|
if (isBleConnected) {
|
||||||
char *message;
|
|
||||||
size_t initialLen;
|
|
||||||
size_t len;
|
|
||||||
initialLen = strlen(format);
|
|
||||||
message = new char[initialLen + 1];
|
|
||||||
len = vsnprintf(message, initialLen + 1, format, arg);
|
|
||||||
if (len > initialLen) {
|
|
||||||
delete[] message;
|
|
||||||
message = new char[len + 1];
|
|
||||||
vsnprintf(message, len + 1, format, arg);
|
|
||||||
}
|
|
||||||
auto thread = concurrency::OSThread::currentThread;
|
auto thread = concurrency::OSThread::currentThread;
|
||||||
meshtastic_LogRecord logRecord = meshtastic_LogRecord_init_zero;
|
meshtastic_LogRecord logRecord = meshtastic_LogRecord_init_zero;
|
||||||
logRecord.level = getLogLevel(logLevel);
|
logRecord.level = getLogLevel(logLevel);
|
||||||
strcpy(logRecord.message, message);
|
vsprintf(logRecord.message, format, arg);
|
||||||
if (thread)
|
if (thread)
|
||||||
strcpy(logRecord.source, thread->ThreadName.c_str());
|
strcpy(logRecord.source, thread->ThreadName.c_str());
|
||||||
logRecord.time = getValidTime(RTCQuality::RTCQualityDevice, true);
|
logRecord.time = getValidTime(RTCQuality::RTCQualityDevice, true);
|
||||||
|
|
||||||
uint8_t *buffer = new uint8_t[meshtastic_LogRecord_size];
|
auto buffer = std::unique_ptr<uint8_t[]>(new uint8_t[meshtastic_LogRecord_size]);
|
||||||
size_t size = pb_encode_to_bytes(buffer, meshtastic_LogRecord_size, meshtastic_LogRecord_fields, &logRecord);
|
size_t size = pb_encode_to_bytes(buffer.get(), meshtastic_LogRecord_size, meshtastic_LogRecord_fields, &logRecord);
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
nimbleBluetooth->sendLog(buffer, size);
|
nimbleBluetooth->sendLog(buffer.get(), size);
|
||||||
#elif defined(ARCH_NRF52)
|
#elif defined(ARCH_NRF52)
|
||||||
nrf52Bluetooth->sendLog(buffer, size);
|
nrf52Bluetooth->sendLog(buffer.get(), size);
|
||||||
#endif
|
#endif
|
||||||
delete[] message;
|
|
||||||
delete[] buffer;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@@ -292,8 +279,8 @@ void RedirectablePrint::log(const char *logLevel, const char *format, ...)
|
|||||||
|
|
||||||
// append \n to format
|
// append \n to format
|
||||||
size_t len = strlen(format);
|
size_t len = strlen(format);
|
||||||
char *newFormat = new char[len + 2];
|
auto newFormat = std::unique_ptr<char[]>(new char[len + 2]);
|
||||||
strcpy(newFormat, format);
|
strcpy(newFormat.get(), format);
|
||||||
newFormat[len] = '\n';
|
newFormat[len] = '\n';
|
||||||
newFormat[len + 1] = '\0';
|
newFormat[len + 1] = '\0';
|
||||||
|
|
||||||
@@ -310,23 +297,18 @@ void RedirectablePrint::log(const char *logLevel, const char *format, ...)
|
|||||||
va_end(arg);
|
va_end(arg);
|
||||||
}
|
}
|
||||||
if (portduino_config.logoutputlevel < level_trace && strcmp(logLevel, MESHTASTIC_LOG_LEVEL_TRACE) == 0) {
|
if (portduino_config.logoutputlevel < level_trace && strcmp(logLevel, MESHTASTIC_LOG_LEVEL_TRACE) == 0) {
|
||||||
delete[] newFormat;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (portduino_config.logoutputlevel < level_debug && strcmp(logLevel, MESHTASTIC_LOG_LEVEL_DEBUG) == 0) {
|
if (portduino_config.logoutputlevel < level_debug && strcmp(logLevel, MESHTASTIC_LOG_LEVEL_DEBUG) == 0) {
|
||||||
delete[] newFormat;
|
|
||||||
return;
|
return;
|
||||||
} else if (portduino_config.logoutputlevel < level_info && strcmp(logLevel, MESHTASTIC_LOG_LEVEL_INFO) == 0) {
|
} else if (portduino_config.logoutputlevel < level_info && strcmp(logLevel, MESHTASTIC_LOG_LEVEL_INFO) == 0) {
|
||||||
delete[] newFormat;
|
|
||||||
return;
|
return;
|
||||||
} else if (portduino_config.logoutputlevel < level_warn && strcmp(logLevel, MESHTASTIC_LOG_LEVEL_WARN) == 0) {
|
} else if (portduino_config.logoutputlevel < level_warn && strcmp(logLevel, MESHTASTIC_LOG_LEVEL_WARN) == 0) {
|
||||||
delete[] newFormat;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (moduleConfig.serial.override_console_serial_port && strcmp(logLevel, MESHTASTIC_LOG_LEVEL_DEBUG) == 0) {
|
if (moduleConfig.serial.override_console_serial_port && strcmp(logLevel, MESHTASTIC_LOG_LEVEL_DEBUG) == 0) {
|
||||||
delete[] newFormat;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,11 +320,19 @@ void RedirectablePrint::log(const char *logLevel, const char *format, ...)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
va_list arg;
|
va_list arg;
|
||||||
|
va_list arg_copy;
|
||||||
|
|
||||||
va_start(arg, format);
|
va_start(arg, format);
|
||||||
|
|
||||||
log_to_serial(logLevel, newFormat, arg);
|
va_copy(arg_copy, arg);
|
||||||
log_to_syslog(logLevel, newFormat, arg);
|
log_to_serial(logLevel, newFormat.get(), arg_copy);
|
||||||
log_to_ble(logLevel, newFormat, arg);
|
va_end(arg_copy);
|
||||||
|
|
||||||
|
va_copy(arg_copy, arg);
|
||||||
|
log_to_syslog(logLevel, newFormat.get(), arg_copy);
|
||||||
|
va_end(arg_copy);
|
||||||
|
|
||||||
|
log_to_ble(logLevel, newFormat.get(), arg);
|
||||||
|
|
||||||
va_end(arg);
|
va_end(arg);
|
||||||
#ifdef HAS_FREE_RTOS
|
#ifdef HAS_FREE_RTOS
|
||||||
@@ -352,11 +342,10 @@ void RedirectablePrint::log(const char *logLevel, const char *format, ...)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
delete[] newFormat;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RedirectablePrint::hexDump(const char *logLevel, unsigned char *buf, uint16_t len)
|
void RedirectablePrint::hexDump(const char *logLevel, const unsigned char *buf, uint16_t len)
|
||||||
{
|
{
|
||||||
const char alphabet[17] = "0123456789abcdef";
|
const char alphabet[17] = "0123456789abcdef";
|
||||||
log(logLevel, " +------------------------------------------------+ +----------------+");
|
log(logLevel, " +------------------------------------------------+ +----------------+");
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class RedirectablePrint : public Print
|
|||||||
/** like printf but va_list based */
|
/** like printf but va_list based */
|
||||||
size_t vprintf(const char *logLevel, const char *format, va_list arg);
|
size_t vprintf(const char *logLevel, const char *format, va_list arg);
|
||||||
|
|
||||||
void hexDump(const char *logLevel, unsigned char *buf, uint16_t len);
|
void hexDump(const char *logLevel, const unsigned char *buf, uint16_t len);
|
||||||
|
|
||||||
std::string mt_sprintf(const std::string fmt_str, ...);
|
std::string mt_sprintf(const std::string fmt_str, ...);
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ void consoleInit()
|
|||||||
#if defined(SERIAL_HAS_ON_RECEIVE)
|
#if defined(SERIAL_HAS_ON_RECEIVE)
|
||||||
// onReceive does only exist for HardwareSerial not for USB CDC serial
|
// onReceive does only exist for HardwareSerial not for USB CDC serial
|
||||||
Port.onReceive([sc]() { sc->rxInt(); });
|
Port.onReceive([sc]() { sc->rxInt(); });
|
||||||
|
#else
|
||||||
|
(void)sc;
|
||||||
#endif
|
#endif
|
||||||
DEBUG_PORT.rpInit(); // Simply sets up semaphore
|
DEBUG_PORT.rpInit(); // Simply sets up semaphore
|
||||||
}
|
}
|
||||||
|
|||||||
+56
-1
@@ -6,6 +6,11 @@
|
|||||||
#include "Tone.h"
|
#include "Tone.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAS_I2S)
|
||||||
|
#include "main.h"
|
||||||
|
#include <unordered_map>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined(ARCH_PORTDUINO)
|
#if !defined(ARCH_PORTDUINO)
|
||||||
extern "C" void delay(uint32_t dwMs);
|
extern "C" void delay(uint32_t dwMs);
|
||||||
#endif
|
#endif
|
||||||
@@ -50,6 +55,50 @@ const int DURATION_1_2 = 500; // 1/2 note
|
|||||||
const int DURATION_3_4 = 750; // 3/4 note
|
const int DURATION_3_4 = 750; // 3/4 note
|
||||||
const int DURATION_1_1 = 1000; // 1/1 note
|
const int DURATION_1_1 = 1000; // 1/1 note
|
||||||
|
|
||||||
|
#ifdef HAS_I2S
|
||||||
|
void playTonesRTTTL(const ToneDuration *tone_durations, int size)
|
||||||
|
{
|
||||||
|
// translate ToneDuration[] to RTTTL string and play using audioThread
|
||||||
|
static std::unordered_map<int, std::string> freqToNote = {
|
||||||
|
{NOTE_C3, "c4"}, {NOTE_CS3, "c#4"}, {NOTE_D3, "d4"}, {NOTE_DS3, "d#4"}, {NOTE_E3, "e4"}, {NOTE_F3, "f4"},
|
||||||
|
{NOTE_FS3, "f#4"}, {NOTE_G3, "g4"}, {NOTE_GS3, "g#4"}, {NOTE_A3, "a4"}, {NOTE_AS3, "a#4"}, {NOTE_B3, "b4"},
|
||||||
|
{NOTE_C4, "c5"}, {NOTE_E4, "e5"}, {NOTE_G4, "g5"}, {NOTE_A4, "a5"}, {NOTE_C5, "c6"}, {NOTE_E5, "e6"},
|
||||||
|
{NOTE_G5, "g6"}, {NOTE_F5, "f6"}, {NOTE_G6, "g7"}, {NOTE_E7, "e8"}};
|
||||||
|
|
||||||
|
char rtttl[128] = "tone:d=32,o=4,b=200:"; // default duration and octave
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
const auto &td = tone_durations[i];
|
||||||
|
std::string note = "b4";
|
||||||
|
if (freqToNote.find(td.frequency_khz) != freqToNote.end()) {
|
||||||
|
note = freqToNote[td.frequency_khz];
|
||||||
|
}
|
||||||
|
int dur = 32; // default duration
|
||||||
|
if (td.duration_ms >= 1000)
|
||||||
|
dur = 1;
|
||||||
|
else if (td.duration_ms >= 500)
|
||||||
|
dur = 2;
|
||||||
|
else if (td.duration_ms >= 250)
|
||||||
|
dur = 4;
|
||||||
|
else if (td.duration_ms >= 125)
|
||||||
|
dur = 8;
|
||||||
|
else if (td.duration_ms >= 62)
|
||||||
|
dur = 16;
|
||||||
|
else
|
||||||
|
dur = 32;
|
||||||
|
|
||||||
|
char noteStr[64];
|
||||||
|
snprintf(noteStr, sizeof(noteStr), "%s,%d", note.c_str(), dur);
|
||||||
|
strncat(rtttl, noteStr, sizeof(rtttl) - strlen(rtttl) - 1);
|
||||||
|
|
||||||
|
audioThread->beginRttl(rtttl, strlen(rtttl));
|
||||||
|
while (audioThread->isPlaying()) {
|
||||||
|
delay(10);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void playTones(const ToneDuration *tone_durations, int size)
|
void playTones(const ToneDuration *tone_durations, int size)
|
||||||
{
|
{
|
||||||
if (config.device.buzzer_mode == meshtastic_Config_DeviceConfig_BuzzerMode_DISABLED ||
|
if (config.device.buzzer_mode == meshtastic_Config_DeviceConfig_BuzzerMode_DISABLED ||
|
||||||
@@ -57,7 +106,13 @@ void playTones(const ToneDuration *tone_durations, int size)
|
|||||||
// Buzzer is disabled or not set to system tones
|
// Buzzer is disabled or not set to system tones
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#ifdef PIN_BUZZER
|
#ifdef HAS_I2S
|
||||||
|
if (moduleConfig.external_notification.use_i2s_as_buzzer && audioThread) {
|
||||||
|
playTonesRTTTL(tone_durations, size);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#if defined(PIN_BUZZER)
|
||||||
if (!config.device.buzzer_gpio)
|
if (!config.device.buzzer_gpio)
|
||||||
config.device.buzzer_gpio = PIN_BUZZER;
|
config.device.buzzer_gpio = PIN_BUZZER;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -76,8 +76,10 @@ bool NotifiedWorkerThread::notifyLater(uint32_t delay, uint32_t v, bool overwrit
|
|||||||
|
|
||||||
void NotifiedWorkerThread::checkNotification()
|
void NotifiedWorkerThread::checkNotification()
|
||||||
{
|
{
|
||||||
auto n = notification;
|
// Atomically read and clear. (This avoids a potential race condition where an interrupt handler could set a new notification
|
||||||
notification = 0; // clear notification
|
// after checkNotification reads but before it clears, which would cause us to miss that notification until the next one comes
|
||||||
|
// in.)
|
||||||
|
auto n = notification.exchange(0); // read+clear atomically: like `n = notification; notification = 0;` but interrupt-safe
|
||||||
if (n) {
|
if (n) {
|
||||||
onNotify(n);
|
onNotify(n);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "OSThread.h"
|
#include "OSThread.h"
|
||||||
|
#include <atomic>
|
||||||
|
|
||||||
namespace concurrency
|
namespace concurrency
|
||||||
{
|
{
|
||||||
@@ -13,7 +14,7 @@ class NotifiedWorkerThread : public OSThread
|
|||||||
/**
|
/**
|
||||||
* The notification that was most recently used to wake the thread. Read from runOnce()
|
* The notification that was most recently used to wake the thread. Read from runOnce()
|
||||||
*/
|
*/
|
||||||
uint32_t notification = 0;
|
std::atomic<uint32_t> notification{0};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
NotifiedWorkerThread(const char *name) : OSThread(name) {}
|
NotifiedWorkerThread(const char *name) : OSThread(name) {}
|
||||||
|
|||||||
@@ -1,24 +1,29 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "concurrency/OSThread.h"
|
#include "concurrency/OSThread.h"
|
||||||
|
|
||||||
namespace concurrency
|
namespace concurrency
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Periodically invoke a callback. This just provides C-style callback conventions
|
* @brief Periodically invoke a callback.
|
||||||
* rather than a virtual function - FIXME, remove?
|
* Supports both legacy function pointers and modern callables.
|
||||||
*/
|
*/
|
||||||
class Periodic : public OSThread
|
class Periodic : public OSThread
|
||||||
{
|
{
|
||||||
int32_t (*callback)();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// callback returns the period for the next callback invocation (or 0 if we should no longer be called)
|
// callback returns the period for the next callback invocation (or 0 if we should no longer be called)
|
||||||
Periodic(const char *name, int32_t (*_callback)()) : OSThread(name), callback(_callback) {}
|
Periodic(const char *name, int32_t (*cb)()) : OSThread(name), callback(cb) {}
|
||||||
|
Periodic(const char *name, std::function<int32_t()> cb) : OSThread(name), callback(std::move(cb)) {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int32_t runOnce() override { return callback(); }
|
int32_t runOnce() override { return callback ? callback() : 0; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::function<int32_t()> callback;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace concurrency
|
} // namespace concurrency
|
||||||
|
|||||||
@@ -149,6 +149,23 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define TX_GAIN_LORA 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 9, 9, 8, 7
|
#define TX_GAIN_LORA 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 9, 9, 8, 7
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_KCT8103L_PA
|
||||||
|
// Power Amps are often non-linear, so we can use an array of values for the power curve
|
||||||
|
#if defined(HELTEC_WIRELESS_TRACKER_V2)
|
||||||
|
#define NUM_PA_POINTS 22
|
||||||
|
#define TX_GAIN_LORA 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 12, 12, 11, 10, 9, 8, 7
|
||||||
|
#elif defined(HELTEC_MESH_NODE_T096)
|
||||||
|
#define NUM_PA_POINTS 22
|
||||||
|
#define TX_GAIN_LORA 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 12, 11, 10, 9, 8, 7
|
||||||
|
#else
|
||||||
|
// If a board enables USE_KCT8103L_PA but does not match a known variant and has
|
||||||
|
// not already provided a PA curve, fail at compile time to avoid unsafe defaults.
|
||||||
|
#if !defined(NUM_PA_POINTS) || !defined(TX_GAIN_LORA)
|
||||||
|
#error "USE_KCT8103L_PA is defined, but no PA gain curve (NUM_PA_POINTS / TX_GAIN_LORA) is configured for this board."
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef RAK13302
|
#ifdef RAK13302
|
||||||
#define NUM_PA_POINTS 22
|
#define NUM_PA_POINTS 22
|
||||||
#define TX_GAIN_LORA 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8
|
#define TX_GAIN_LORA 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8
|
||||||
@@ -163,6 +180,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define TX_GAIN_LORA 0
|
#define TX_GAIN_LORA 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAS_LORA_FEM
|
||||||
|
#define HAS_LORA_FEM 0
|
||||||
|
#endif
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Feature toggles
|
// Feature toggles
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
@@ -217,6 +238,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define SHTC3_ADDR 0x70
|
#define SHTC3_ADDR 0x70
|
||||||
#define LPS22HB_ADDR 0x5C
|
#define LPS22HB_ADDR 0x5C
|
||||||
#define LPS22HB_ADDR_ALT 0x5D
|
#define LPS22HB_ADDR_ALT 0x5D
|
||||||
|
#define SFA30_ADDR 0x5D
|
||||||
#define SHT31_4x_ADDR 0x44
|
#define SHT31_4x_ADDR 0x44
|
||||||
#define SHT31_4x_ADDR_ALT 0x45
|
#define SHT31_4x_ADDR_ALT 0x45
|
||||||
#define PMSA003I_ADDR 0x12
|
#define PMSA003I_ADDR 0x12
|
||||||
@@ -233,6 +255,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define NAU7802_ADDR 0x2A
|
#define NAU7802_ADDR 0x2A
|
||||||
#define MAX30102_ADDR 0x57
|
#define MAX30102_ADDR 0x57
|
||||||
#define SCD4X_ADDR 0x62
|
#define SCD4X_ADDR 0x62
|
||||||
|
#define CW2015_ADDR 0x62
|
||||||
#define MLX90614_ADDR_DEF 0x5A
|
#define MLX90614_ADDR_DEF 0x5A
|
||||||
#define CGRADSENS_ADDR 0x66
|
#define CGRADSENS_ADDR 0x66
|
||||||
#define LTR390UV_ADDR 0x53
|
#define LTR390UV_ADDR 0x53
|
||||||
@@ -242,6 +265,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define BQ25896_ADDR 0x6B
|
#define BQ25896_ADDR 0x6B
|
||||||
#define LTR553ALS_ADDR 0x23
|
#define LTR553ALS_ADDR 0x23
|
||||||
#define SEN5X_ADDR 0x69
|
#define SEN5X_ADDR 0x69
|
||||||
|
#define SCD30_ADDR 0x61
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// ACCELEROMETER
|
// ACCELEROMETER
|
||||||
@@ -258,6 +282,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define BHI260AP_ADDR 0x28
|
#define BHI260AP_ADDR 0x28
|
||||||
#define BMM150_ADDR 0x13
|
#define BMM150_ADDR 0x13
|
||||||
#define DA217_ADDR 0x26
|
#define DA217_ADDR 0x26
|
||||||
|
#define BMI270_ADDR 0x68
|
||||||
|
#define BMI270_ADDR_ALT 0x69
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// LED
|
// LED
|
||||||
@@ -275,6 +301,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define TCA9535_ADDR 0x20
|
#define TCA9535_ADDR 0x20
|
||||||
#define TCA9555_ADDR 0x26
|
#define TCA9555_ADDR 0x26
|
||||||
|
|
||||||
|
// used for display brightness control
|
||||||
|
#define STC8H1K28_ADDR 0x30
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Touchscreen
|
// Touchscreen
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -37,14 +37,14 @@ ScanI2C::FoundDevice ScanI2C::firstKeyboard() const
|
|||||||
|
|
||||||
ScanI2C::FoundDevice ScanI2C::firstAccelerometer() const
|
ScanI2C::FoundDevice ScanI2C::firstAccelerometer() const
|
||||||
{
|
{
|
||||||
ScanI2C::DeviceType types[] = {MPU6050, LIS3DH, BMA423, LSM6DS3, BMX160, STK8BAXX, ICM20948, QMA6100P, BMM150};
|
ScanI2C::DeviceType types[] = {MPU6050, LIS3DH, BMA423, LSM6DS3, BMX160, STK8BAXX, ICM20948, QMA6100P, BMM150, BMI270};
|
||||||
return firstOfOrNONE(9, types);
|
return firstOfOrNONE(10, types);
|
||||||
}
|
}
|
||||||
|
|
||||||
ScanI2C::FoundDevice ScanI2C::firstAQI() const
|
ScanI2C::FoundDevice ScanI2C::firstAQI() const
|
||||||
{
|
{
|
||||||
ScanI2C::DeviceType types[] = {PMSA003I, SEN5X, SCD4X};
|
ScanI2C::DeviceType types[] = {PMSA003I, SEN5X, SCD4X, SFA30};
|
||||||
return firstOfOrNONE(2, types);
|
return firstOfOrNONE(4, types);
|
||||||
}
|
}
|
||||||
|
|
||||||
ScanI2C::FoundDevice ScanI2C::firstRGBLED() const
|
ScanI2C::FoundDevice ScanI2C::firstRGBLED() const
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ class ScanI2C
|
|||||||
NAU7802,
|
NAU7802,
|
||||||
FT6336U,
|
FT6336U,
|
||||||
STK8BAXX,
|
STK8BAXX,
|
||||||
|
STC8H1K28,
|
||||||
ICM20948,
|
ICM20948,
|
||||||
SCD4X,
|
SCD4X,
|
||||||
MAX30102,
|
MAX30102,
|
||||||
@@ -89,7 +90,12 @@ class ScanI2C
|
|||||||
DA217,
|
DA217,
|
||||||
CHSC6X,
|
CHSC6X,
|
||||||
CST226SE,
|
CST226SE,
|
||||||
SEN5X
|
BMI270,
|
||||||
|
SEN5X,
|
||||||
|
SFA30,
|
||||||
|
CW2015,
|
||||||
|
SCD30,
|
||||||
|
ADS1115
|
||||||
} DeviceType;
|
} DeviceType;
|
||||||
|
|
||||||
// typedef uint8_t DeviceAddress;
|
// typedef uint8_t DeviceAddress;
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
#include "ScanI2CTwoWire.h"
|
#include "ScanI2CTwoWire.h"
|
||||||
|
#include "configuration.h"
|
||||||
|
#include "detect/ScanI2C.h"
|
||||||
|
|
||||||
#if !MESHTASTIC_EXCLUDE_I2C
|
#if !MESHTASTIC_EXCLUDE_I2C
|
||||||
|
|
||||||
@@ -115,6 +117,25 @@ uint16_t ScanI2CTwoWire::getRegisterValue(const ScanI2CTwoWire::RegisterLocation
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ScanI2CTwoWire::i2cCommandResponseLength(ScanI2C::DeviceAddress addr, uint16_t command, uint8_t expectedLength) const
|
||||||
|
{
|
||||||
|
TwoWire *i2cBus = fetchI2CBus(addr);
|
||||||
|
i2cBus->beginTransmission(addr.address);
|
||||||
|
if (command > 0xFF) {
|
||||||
|
i2cBus->write((uint8_t)(command >> 8));
|
||||||
|
}
|
||||||
|
i2cBus->write((uint8_t)(command & 0xFF));
|
||||||
|
if (i2cBus->endTransmission() != 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
delay(20);
|
||||||
|
uint8_t received = i2cBus->requestFrom(addr.address, expectedLength);
|
||||||
|
bool match = (received == expectedLength);
|
||||||
|
while (i2cBus->available())
|
||||||
|
i2cBus->read();
|
||||||
|
return match;
|
||||||
|
}
|
||||||
|
|
||||||
/// for SEN5X detection
|
/// for SEN5X detection
|
||||||
// Note, this code needs to be called before setting the I2C bus speed
|
// Note, this code needs to be called before setting the I2C bus speed
|
||||||
// for the screen at high speed. The speed needs to be at 100kHz, otherwise
|
// for the screen at high speed. The speed needs to be at 100kHz, otherwise
|
||||||
@@ -283,6 +304,8 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
|
|||||||
#endif
|
#endif
|
||||||
#ifdef HAS_LP5562
|
#ifdef HAS_LP5562
|
||||||
SCAN_SIMPLE_CASE(LP5562_ADDR, LP5562, "LP5562", (uint8_t)addr.address);
|
SCAN_SIMPLE_CASE(LP5562_ADDR, LP5562, "LP5562", (uint8_t)addr.address);
|
||||||
|
#else
|
||||||
|
SCAN_SIMPLE_CASE(STC8H1K28_ADDR, LP5562, "STC8H1K28", (uint8_t)addr.address);
|
||||||
#endif
|
#endif
|
||||||
case XPOWERS_AXP192_AXP2101_ADDRESS:
|
case XPOWERS_AXP192_AXP2101_ADDRESS:
|
||||||
// Do we have the axp2101/192 or the TCA8418
|
// Do we have the axp2101/192 or the TCA8418
|
||||||
@@ -320,7 +343,9 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
|
|||||||
type = DPS310;
|
type = DPS310;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
if (type == DPS310) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 1); // GET_ID
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 1); // GET_ID
|
||||||
switch (registerValue) {
|
switch (registerValue) {
|
||||||
@@ -430,8 +455,7 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
|
|||||||
if (getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x7E), 2) == 0x5449) {
|
if (getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x7E), 2) == 0x5449) {
|
||||||
type = OPT3001;
|
type = OPT3001;
|
||||||
logFoundDevice("OPT3001", (uint8_t)addr.address);
|
logFoundDevice("OPT3001", (uint8_t)addr.address);
|
||||||
} else if (getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x89), 6) !=
|
} else if (i2cCommandResponseLength(addr, 0x89, 6)) { // SHT4x serial number (6 bytes inc. CRC)
|
||||||
0) { // unique SHT4x serial number (6 bytes inc. CRC)
|
|
||||||
type = SHT4X;
|
type = SHT4X;
|
||||||
logFoundDevice("SHT4X", (uint8_t)addr.address);
|
logFoundDevice("SHT4X", (uint8_t)addr.address);
|
||||||
} else {
|
} else {
|
||||||
@@ -456,6 +480,19 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LPS22HB_ADDR_ALT:
|
case LPS22HB_ADDR_ALT:
|
||||||
|
// SFA30 detection: send 2-byte command 0xD060 (Get Device Marking) and check for 48-byte response
|
||||||
|
if (i2cCommandResponseLength(addr, 0xD060, 48)) {
|
||||||
|
type = SFA30;
|
||||||
|
logFoundDevice("SFA30", (uint8_t)addr.address);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// Fallback: LPS22HB detection at alternate address using WHO_AM_I register (0x0F == 0xB1)
|
||||||
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0F), 1);
|
||||||
|
if (registerValue == 0xB1) {
|
||||||
|
type = LPS22HB;
|
||||||
|
logFoundDevice("LPS22HB", (uint8_t)addr.address);
|
||||||
|
}
|
||||||
|
break;
|
||||||
SCAN_SIMPLE_CASE(LPS22HB_ADDR, LPS22HB, "LPS22HB", (uint8_t)addr.address)
|
SCAN_SIMPLE_CASE(LPS22HB_ADDR, LPS22HB, "LPS22HB", (uint8_t)addr.address)
|
||||||
SCAN_SIMPLE_CASE(QMC6310U_ADDR, QMC6310U, "QMC6310U", (uint8_t)addr.address)
|
SCAN_SIMPLE_CASE(QMC6310U_ADDR, QMC6310U, "QMC6310U", (uint8_t)addr.address)
|
||||||
|
|
||||||
@@ -548,6 +585,7 @@ 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(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(LTR390UV_ADDR, LTR390UV, "LTR390UV", (uint8_t)addr.address);
|
||||||
SCAN_SIMPLE_CASE(PCT2075_ADDR, PCT2075, "PCT2075", (uint8_t)addr.address);
|
SCAN_SIMPLE_CASE(PCT2075_ADDR, PCT2075, "PCT2075", (uint8_t)addr.address);
|
||||||
|
SCAN_SIMPLE_CASE(SCD30_ADDR, SCD30, "SCD30", (uint8_t)addr.address);
|
||||||
case CST328_ADDR:
|
case CST328_ADDR:
|
||||||
// Do we have the CST328 or the CST226SE
|
// Do we have the CST328 or the CST226SE
|
||||||
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xAB), 1);
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xAB), 1);
|
||||||
@@ -581,7 +619,17 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
SCAN_SIMPLE_CASE(BHI260AP_ADDR, BHI260AP, "BHI260AP", (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);
|
case SCD4X_ADDR: {
|
||||||
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x8), 1);
|
||||||
|
if (registerValue == 0x18) {
|
||||||
|
logFoundDevice("CW2015", (uint8_t)addr.address);
|
||||||
|
type = CW2015;
|
||||||
|
} else {
|
||||||
|
logFoundDevice("SCD4X", (uint8_t)addr.address);
|
||||||
|
type = SCD4X;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
SCAN_SIMPLE_CASE(BMM150_ADDR, BMM150, "BMM150", (uint8_t)addr.address);
|
SCAN_SIMPLE_CASE(BMM150_ADDR, BMM150, "BMM150", (uint8_t)addr.address);
|
||||||
#ifdef HAS_TPS65233
|
#ifdef HAS_TPS65233
|
||||||
SCAN_SIMPLE_CASE(TPS65233_ADDR, TPS65233, "TPS65233", (uint8_t)addr.address);
|
SCAN_SIMPLE_CASE(TPS65233_ADDR, TPS65233, "TPS65233", (uint8_t)addr.address);
|
||||||
@@ -608,9 +656,8 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ICM20948_ADDR: // same as BMX160_ADDR and SEN5X_ADDR
|
case ICM20948_ADDR: // same as BMX160_ADDR, BMI270_ADDR_ALT, and SEN5X_ADDR
|
||||||
case ICM20948_ADDR_ALT: // same as MPU6050_ADDR
|
case ICM20948_ADDR_ALT: // same as MPU6050_ADDR, BMI270_ADDR
|
||||||
// ICM20948 Register check
|
|
||||||
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 1);
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 1);
|
||||||
#ifdef HAS_ICM20948
|
#ifdef HAS_ICM20948
|
||||||
type = ICM20948;
|
type = ICM20948;
|
||||||
@@ -621,6 +668,14 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
|
|||||||
type = ICM20948;
|
type = ICM20948;
|
||||||
logFoundDevice("ICM20948", (uint8_t)addr.address);
|
logFoundDevice("ICM20948", (uint8_t)addr.address);
|
||||||
break;
|
break;
|
||||||
|
} else if (registerValue == 0x24) {
|
||||||
|
type = BMI270;
|
||||||
|
logFoundDevice("BMI270", (uint8_t)addr.address);
|
||||||
|
break;
|
||||||
|
} else if (registerValue == 0xD8) { // BMX160 chip ID at register 0x00
|
||||||
|
type = BMX160;
|
||||||
|
logFoundDevice("BMX160", (uint8_t)addr.address);
|
||||||
|
break;
|
||||||
} else {
|
} else {
|
||||||
String prod = "";
|
String prod = "";
|
||||||
prod = readSEN5xProductName(i2cBus, addr.address);
|
prod = readSEN5xProductName(i2cBus, addr.address);
|
||||||
@@ -674,11 +729,18 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
|
|||||||
if (len == 5 && memcmp(expectedInfo, info, len) == 0) {
|
if (len == 5 && memcmp(expectedInfo, info, len) == 0) {
|
||||||
LOG_INFO("NXP SE050 crypto chip found");
|
LOG_INFO("NXP SE050 crypto chip found");
|
||||||
type = NXP_SE050;
|
type = NXP_SE050;
|
||||||
|
break;
|
||||||
} else {
|
|
||||||
LOG_INFO("FT6336U touchscreen found");
|
|
||||||
type = FT6336U;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x01), 2);
|
||||||
|
if (registerValue == 0x8583 || registerValue == 0x8580) {
|
||||||
|
type = ADS1115;
|
||||||
|
logFoundDevice("ADS1115 ADC", (uint8_t)addr.address);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG_INFO("FT6336U touchscreen found");
|
||||||
|
type = FT6336U;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ class ScanI2CTwoWire : public ScanI2C
|
|||||||
|
|
||||||
uint16_t getRegisterValue(const RegisterLocation &, ResponseWidth, bool) const;
|
uint16_t getRegisterValue(const RegisterLocation &, ResponseWidth, bool) const;
|
||||||
|
|
||||||
|
bool i2cCommandResponseLength(DeviceAddress addr, uint16_t command, uint8_t expectedLength) const;
|
||||||
|
|
||||||
DeviceType probeOLED(ScanI2C::DeviceAddress) const;
|
DeviceType probeOLED(ScanI2C::DeviceAddress) const;
|
||||||
|
|
||||||
static void logFoundDevice(const char *device, uint8_t address);
|
static void logFoundDevice(const char *device, uint8_t address);
|
||||||
|
|||||||
+16
-18
@@ -52,7 +52,7 @@ SerialUART *GPS::_serial_gps = &GPS_SERIAL_PORT;
|
|||||||
HardwareSerial *GPS::_serial_gps = nullptr;
|
HardwareSerial *GPS::_serial_gps = nullptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GPS *gps = nullptr;
|
std::unique_ptr<GPS> gps = nullptr;
|
||||||
|
|
||||||
static GPSUpdateScheduling scheduling;
|
static GPSUpdateScheduling scheduling;
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ static const char *getGPSPowerStateString(GPSPowerState state)
|
|||||||
|
|
||||||
#ifdef PIN_GPS_SWITCH
|
#ifdef PIN_GPS_SWITCH
|
||||||
// If we have a hardware switch, define a periodic watcher outside of the GPS runOnce thread, since this can be sleeping
|
// If we have a hardware switch, define a periodic watcher outside of the GPS runOnce thread, since this can be sleeping
|
||||||
// idefinitely
|
// indefinitely
|
||||||
|
|
||||||
int lastState = LOW;
|
int lastState = LOW;
|
||||||
bool firstrun = true;
|
bool firstrun = true;
|
||||||
@@ -127,7 +127,7 @@ static int32_t gpsSwitch()
|
|||||||
return 1000;
|
return 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
static concurrency::Periodic *gpsPeriodic;
|
static std::unique_ptr<concurrency::Periodic> gpsPeriodic;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void UBXChecksum(uint8_t *message, size_t length)
|
static void UBXChecksum(uint8_t *message, size_t length)
|
||||||
@@ -586,14 +586,14 @@ bool GPS::setup()
|
|||||||
_serial_gps->write("$PMTK301,2*2E\r\n");
|
_serial_gps->write("$PMTK301,2*2E\r\n");
|
||||||
delay(250);
|
delay(250);
|
||||||
} else if (gnssModel == GNSS_MODEL_ATGM336H) {
|
} else if (gnssModel == GNSS_MODEL_ATGM336H) {
|
||||||
// Set the intial configuration of the device - these _should_ work for most AT6558 devices
|
// Set the initial configuration of the device - these _should_ work for most AT6558 devices
|
||||||
msglen = makeCASPacket(0x06, 0x07, sizeof(_message_CAS_CFG_NAVX_CONF), _message_CAS_CFG_NAVX_CONF);
|
msglen = makeCASPacket(0x06, 0x07, sizeof(_message_CAS_CFG_NAVX_CONF), _message_CAS_CFG_NAVX_CONF);
|
||||||
_serial_gps->write(UBXscratch, msglen);
|
_serial_gps->write(UBXscratch, msglen);
|
||||||
if (getACKCas(0x06, 0x07, 250) != GNSS_RESPONSE_OK) {
|
if (getACKCas(0x06, 0x07, 250) != GNSS_RESPONSE_OK) {
|
||||||
LOG_WARN("ATGM336H: Could not set Config");
|
LOG_WARN("ATGM336H: Could not set Config");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the update frequence to 1Hz
|
// Set the update frequency to 1Hz
|
||||||
msglen = makeCASPacket(0x06, 0x04, sizeof(_message_CAS_CFG_RATE_1HZ), _message_CAS_CFG_RATE_1HZ);
|
msglen = makeCASPacket(0x06, 0x04, sizeof(_message_CAS_CFG_RATE_1HZ), _message_CAS_CFG_RATE_1HZ);
|
||||||
_serial_gps->write(UBXscratch, msglen);
|
_serial_gps->write(UBXscratch, msglen);
|
||||||
if (getACKCas(0x06, 0x04, 250) != GNSS_RESPONSE_OK) {
|
if (getACKCas(0x06, 0x04, 250) != GNSS_RESPONSE_OK) {
|
||||||
@@ -700,7 +700,7 @@ bool GPS::setup()
|
|||||||
} else { // 8,9
|
} else { // 8,9
|
||||||
LOG_INFO("GPS+SBAS+GLONASS+Galileo configured");
|
LOG_INFO("GPS+SBAS+GLONASS+Galileo configured");
|
||||||
}
|
}
|
||||||
// Documentation say, we need wait atleast 0.5s after reconfiguration of GNSS module, before sending next
|
// Documentation say, we need wait at least 0.5s after reconfiguration of GNSS module, before sending next
|
||||||
// commands for the M8 it tends to be more... 1 sec should be enough ;>)
|
// commands for the M8 it tends to be more... 1 sec should be enough ;>)
|
||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
||||||
@@ -733,7 +733,7 @@ bool GPS::setup()
|
|||||||
SEND_UBX_PACKET(0x06, 0x86, _message_PMS, "enable powersave for GPS", 500);
|
SEND_UBX_PACKET(0x06, 0x86, _message_PMS, "enable powersave for GPS", 500);
|
||||||
SEND_UBX_PACKET(0x06, 0x3B, _message_CFG_PM2, "enable powersave details for GPS", 500);
|
SEND_UBX_PACKET(0x06, 0x3B, _message_CFG_PM2, "enable powersave details for GPS", 500);
|
||||||
|
|
||||||
// For M8 we want to enable NMEA vserion 4.10 so we can see the additional sats.
|
// For M8 we want to enable NMEA version 4.10 so we can see the additional sats.
|
||||||
if (gnssModel == GNSS_MODEL_UBLOX8) {
|
if (gnssModel == GNSS_MODEL_UBLOX8) {
|
||||||
clearBuffer();
|
clearBuffer();
|
||||||
SEND_UBX_PACKET(0x06, 0x17, _message_NMEA, "enable NMEA 4.10", 500);
|
SEND_UBX_PACKET(0x06, 0x17, _message_NMEA, "enable NMEA 4.10", 500);
|
||||||
@@ -1211,7 +1211,7 @@ int32_t GPS::runOnce()
|
|||||||
return disable(); // This should trigger when we have a fixed position, and get that first position
|
return disable(); // This should trigger when we have a fixed position, and get that first position
|
||||||
|
|
||||||
// 9600bps is approx 1 byte per msec, so considering our buffer size we never need to wake more often than 200ms
|
// 9600bps is approx 1 byte per msec, so considering our buffer size we never need to wake more often than 200ms
|
||||||
// if not awake we can run super infrquently (once every 5 secs?) to see if we need to wake.
|
// if not awake we can run super infrequently (once every 5 secs?) to see if we need to wake.
|
||||||
return (powerState == GPS_ACTIVE) ? GPS_THREAD_INTERVAL : 5000;
|
return (powerState == GPS_ACTIVE) ? GPS_THREAD_INTERVAL : 5000;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1485,7 +1485,7 @@ GnssModel_t GPS::getProbeResponse(unsigned long timeout, const std::vector<ChipI
|
|||||||
if (bufferSize > 2048)
|
if (bufferSize > 2048)
|
||||||
bufferSize = 2048;
|
bufferSize = 2048;
|
||||||
|
|
||||||
char *response = new char[bufferSize](); // Dynamically allocate based on baud rate
|
auto response = std::unique_ptr<char[]>(new char[bufferSize]); // Dynamically allocate based on baud rate
|
||||||
uint16_t responseLen = 0;
|
uint16_t responseLen = 0;
|
||||||
unsigned long start = millis();
|
unsigned long start = millis();
|
||||||
while (millis() - start < timeout) {
|
while (millis() - start < timeout) {
|
||||||
@@ -1501,19 +1501,18 @@ GnssModel_t GPS::getProbeResponse(unsigned long timeout, const std::vector<ChipI
|
|||||||
if (c == ',' || (responseLen >= 2 && response[responseLen - 2] == '\r' && response[responseLen - 1] == '\n')) {
|
if (c == ',' || (responseLen >= 2 && response[responseLen - 2] == '\r' && response[responseLen - 1] == '\n')) {
|
||||||
// check if we can see our chips
|
// check if we can see our chips
|
||||||
for (const auto &chipInfo : responseMap) {
|
for (const auto &chipInfo : responseMap) {
|
||||||
if (strstr(response, chipInfo.detectionString.c_str()) != nullptr) {
|
if (strstr(response.get(), chipInfo.detectionString.c_str()) != nullptr) {
|
||||||
#ifdef GPS_DEBUG
|
#ifdef GPS_DEBUG
|
||||||
LOG_DEBUG(response);
|
LOG_DEBUG(response.get());
|
||||||
#endif
|
#endif
|
||||||
LOG_INFO("%s detected", chipInfo.chipName.c_str());
|
LOG_INFO("%s detected", chipInfo.chipName.c_str());
|
||||||
delete[] response; // Cleanup before return
|
|
||||||
return chipInfo.driver;
|
return chipInfo.driver;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (responseLen >= 2 && response[responseLen - 2] == '\r' && response[responseLen - 1] == '\n') {
|
if (responseLen >= 2 && response[responseLen - 2] == '\r' && response[responseLen - 1] == '\n') {
|
||||||
#ifdef GPS_DEBUG
|
#ifdef GPS_DEBUG
|
||||||
LOG_DEBUG(response);
|
LOG_DEBUG(response.get());
|
||||||
#endif
|
#endif
|
||||||
// Reset the response buffer for the next potential message
|
// Reset the response buffer for the next potential message
|
||||||
responseLen = 0;
|
responseLen = 0;
|
||||||
@@ -1522,13 +1521,12 @@ GnssModel_t GPS::getProbeResponse(unsigned long timeout, const std::vector<ChipI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef GPS_DEBUG
|
#ifdef GPS_DEBUG
|
||||||
LOG_DEBUG(response);
|
LOG_DEBUG(response.get());
|
||||||
#endif
|
#endif
|
||||||
delete[] response; // Cleanup before return
|
|
||||||
return GNSS_MODEL_UNKNOWN; // Return unknown on timeout
|
return GNSS_MODEL_UNKNOWN; // Return unknown on timeout
|
||||||
}
|
}
|
||||||
|
|
||||||
GPS *GPS::createGps()
|
std::unique_ptr<GPS> GPS::createGps()
|
||||||
{
|
{
|
||||||
int8_t _rx_gpio = config.position.rx_gpio;
|
int8_t _rx_gpio = config.position.rx_gpio;
|
||||||
int8_t _tx_gpio = config.position.tx_gpio;
|
int8_t _tx_gpio = config.position.tx_gpio;
|
||||||
@@ -1553,7 +1551,7 @@ GPS *GPS::createGps()
|
|||||||
if (!_rx_gpio || !_serial_gps) // Configured to have no GPS at all
|
if (!_rx_gpio || !_serial_gps) // Configured to have no GPS at all
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
GPS *new_gps = new GPS;
|
auto new_gps = std::unique_ptr<GPS>(new GPS());
|
||||||
new_gps->rx_gpio = _rx_gpio;
|
new_gps->rx_gpio = _rx_gpio;
|
||||||
new_gps->tx_gpio = _tx_gpio;
|
new_gps->tx_gpio = _tx_gpio;
|
||||||
|
|
||||||
@@ -1581,7 +1579,7 @@ GPS *GPS::createGps()
|
|||||||
#ifdef PIN_GPS_SWITCH
|
#ifdef PIN_GPS_SWITCH
|
||||||
// toggle GPS via external GPIO switch
|
// toggle GPS via external GPIO switch
|
||||||
pinMode(PIN_GPS_SWITCH, INPUT);
|
pinMode(PIN_GPS_SWITCH, INPUT);
|
||||||
gpsPeriodic = new concurrency::Periodic("GPSSwitch", gpsSwitch);
|
gpsPeriodic = std::unique_ptr<concurrency::Periodic>(new concurrency::Periodic("GPSSwitch", gpsSwitch));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Currently disabled per issue #525 (TinyGPS++ crash bug)
|
// Currently disabled per issue #525 (TinyGPS++ crash bug)
|
||||||
|
|||||||
+4
-2
@@ -2,6 +2,8 @@
|
|||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#if !MESHTASTIC_EXCLUDE_GPS
|
#if !MESHTASTIC_EXCLUDE_GPS
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include "GPSStatus.h"
|
#include "GPSStatus.h"
|
||||||
#include "GpioLogic.h"
|
#include "GpioLogic.h"
|
||||||
#include "Observer.h"
|
#include "Observer.h"
|
||||||
@@ -118,7 +120,7 @@ class GPS : private concurrency::OSThread
|
|||||||
|
|
||||||
// Creates an instance of the GPS class.
|
// Creates an instance of the GPS class.
|
||||||
// Returns the new instance or null if the GPS is not present.
|
// Returns the new instance or null if the GPS is not present.
|
||||||
static GPS *createGps();
|
static std::unique_ptr<GPS> createGps();
|
||||||
|
|
||||||
// Wake the GPS hardware - ready for an update
|
// Wake the GPS hardware - ready for an update
|
||||||
void up();
|
void up();
|
||||||
@@ -256,5 +258,5 @@ class GPS : private concurrency::OSThread
|
|||||||
uint8_t fixeddelayCtr = 0;
|
uint8_t fixeddelayCtr = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern GPS *gps;
|
extern std::unique_ptr<GPS> gps;
|
||||||
#endif // Exclude GPS
|
#endif // Exclude GPS
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ GeoCoord::GeoCoord(int32_t lat, int32_t lon, int32_t alt) : _latitude(lat), _lon
|
|||||||
|
|
||||||
GeoCoord::GeoCoord(float lat, float lon, int32_t alt) : _altitude(alt)
|
GeoCoord::GeoCoord(float lat, float lon, int32_t alt) : _altitude(alt)
|
||||||
{
|
{
|
||||||
// Change decimial representation to int32_t. I.e., 12.345 becomes 123450000
|
// Change decimal representation to int32_t. I.e., 12.345 becomes 123450000
|
||||||
_latitude = int32_t(lat * 1e+7);
|
_latitude = int32_t(lat * 1e+7);
|
||||||
_longitude = int32_t(lon * 1e+7);
|
_longitude = int32_t(lon * 1e+7);
|
||||||
GeoCoord::setCoords();
|
GeoCoord::setCoords();
|
||||||
@@ -20,7 +20,7 @@ GeoCoord::GeoCoord(float lat, float lon, int32_t alt) : _altitude(alt)
|
|||||||
|
|
||||||
GeoCoord::GeoCoord(double lat, double lon, int32_t alt) : _altitude(alt)
|
GeoCoord::GeoCoord(double lat, double lon, int32_t alt) : _altitude(alt)
|
||||||
{
|
{
|
||||||
// Change decimial representation to int32_t. I.e., 12.345 becomes 123450000
|
// Change decimal representation to int32_t. I.e., 12.345 becomes 123450000
|
||||||
_latitude = int32_t(lat * 1e+7);
|
_latitude = int32_t(lat * 1e+7);
|
||||||
_longitude = int32_t(lon * 1e+7);
|
_longitude = int32_t(lon * 1e+7);
|
||||||
GeoCoord::setCoords();
|
GeoCoord::setCoords();
|
||||||
@@ -467,10 +467,10 @@ int32_t GeoCoord::bearingTo(const GeoCoord &pointB)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new point bassed on the passed in poin
|
* Create a new point based on the passed-in point
|
||||||
* Ported from http://www.edwilliams.org/avform147.htm#LL
|
* Ported from http://www.edwilliams.org/avform147.htm#LL
|
||||||
* @param bearing
|
* @param bearing
|
||||||
* The bearing in raidans
|
* The bearing in radians
|
||||||
* @param range_meters
|
* @param range_meters
|
||||||
* range in meters
|
* range in meters
|
||||||
* @return GeoCoord object of point at bearing and range from initial point
|
* @return GeoCoord object of point at bearing and range from initial point
|
||||||
@@ -593,4 +593,4 @@ double GeoCoord::toRadians(double deg)
|
|||||||
double GeoCoord::toDegrees(double r)
|
double GeoCoord::toDegrees(double r)
|
||||||
{
|
{
|
||||||
return r * 180 / PI;
|
return r * 180 / PI;
|
||||||
}
|
}
|
||||||
|
|||||||
+31
-3
@@ -2,6 +2,7 @@
|
|||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "detect/ScanI2C.h"
|
#include "detect/ScanI2C.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include "modules/NodeInfoModule.h"
|
||||||
#include <Throttle.h>
|
#include <Throttle.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@@ -12,6 +13,14 @@ uint32_t lastSetFromPhoneNtpOrGps = 0;
|
|||||||
static uint32_t lastTimeValidationWarning = 0;
|
static uint32_t lastTimeValidationWarning = 0;
|
||||||
static const uint32_t TIME_VALIDATION_WARNING_INTERVAL_MS = 15000; // 15 seconds
|
static const uint32_t TIME_VALIDATION_WARNING_INTERVAL_MS = 15000; // 15 seconds
|
||||||
|
|
||||||
|
static void triggerNodeInfoCheckOnTimeSource(RTCQuality oldQuality, RTCQuality newQuality)
|
||||||
|
{
|
||||||
|
if (oldQuality == RTCQualityNone && newQuality > RTCQualityNone && nodeInfoModule) {
|
||||||
|
LOG_DEBUG("Time source acquired (%s -> %s), triggering NodeInfo recheck", RtcName(oldQuality), RtcName(newQuality));
|
||||||
|
nodeInfoModule->triggerImmediateNodeInfoCheck();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RTCQuality getRTCQuality()
|
RTCQuality getRTCQuality()
|
||||||
{
|
{
|
||||||
return currentQuality;
|
return currentQuality;
|
||||||
@@ -61,9 +70,11 @@ RTCSetResult readFromRTC()
|
|||||||
LOG_DEBUG("Read RTC time from RV3028 getTime as %02d-%02d-%02d %02d:%02d:%02d (%ld)", t.tm_year + 1900, t.tm_mon + 1,
|
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);
|
t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, printableEpoch);
|
||||||
if (currentQuality == RTCQualityNone) {
|
if (currentQuality == RTCQualityNone) {
|
||||||
|
RTCQuality oldQuality = currentQuality;
|
||||||
timeStartMsec = now;
|
timeStartMsec = now;
|
||||||
zeroOffsetSecs = tv.tv_sec;
|
zeroOffsetSecs = tv.tv_sec;
|
||||||
currentQuality = RTCQualityDevice;
|
currentQuality = RTCQualityDevice;
|
||||||
|
triggerNodeInfoCheckOnTimeSource(oldQuality, currentQuality);
|
||||||
}
|
}
|
||||||
return RTCSetResultSuccess;
|
return RTCSetResultSuccess;
|
||||||
} else {
|
} else {
|
||||||
@@ -105,9 +116,11 @@ RTCSetResult readFromRTC()
|
|||||||
LOG_DEBUG("Read RTC time from %s getDateTime as %02d-%02d-%02d %02d:%02d:%02d (%ld)", rtc.getChipName(), t.tm_year + 1900,
|
LOG_DEBUG("Read RTC time from %s getDateTime as %02d-%02d-%02d %02d:%02d:%02d (%ld)", rtc.getChipName(), t.tm_year + 1900,
|
||||||
t.tm_mon + 1, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, printableEpoch);
|
t.tm_mon + 1, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, printableEpoch);
|
||||||
if (currentQuality == RTCQualityNone) {
|
if (currentQuality == RTCQualityNone) {
|
||||||
|
RTCQuality oldQuality = currentQuality;
|
||||||
timeStartMsec = now;
|
timeStartMsec = now;
|
||||||
zeroOffsetSecs = tv.tv_sec;
|
zeroOffsetSecs = tv.tv_sec;
|
||||||
currentQuality = RTCQualityDevice;
|
currentQuality = RTCQualityDevice;
|
||||||
|
triggerNodeInfoCheckOnTimeSource(oldQuality, currentQuality);
|
||||||
}
|
}
|
||||||
return RTCSetResultSuccess;
|
return RTCSetResultSuccess;
|
||||||
} else {
|
} else {
|
||||||
@@ -139,9 +152,11 @@ RTCSetResult readFromRTC()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (currentQuality == RTCQualityNone) {
|
if (currentQuality == RTCQualityNone) {
|
||||||
|
RTCQuality oldQuality = currentQuality;
|
||||||
timeStartMsec = now;
|
timeStartMsec = now;
|
||||||
zeroOffsetSecs = tv.tv_sec;
|
zeroOffsetSecs = tv.tv_sec;
|
||||||
currentQuality = RTCQualityDevice;
|
currentQuality = RTCQualityDevice;
|
||||||
|
triggerNodeInfoCheckOnTimeSource(oldQuality, currentQuality);
|
||||||
}
|
}
|
||||||
return RTCSetResultSuccess;
|
return RTCSetResultSuccess;
|
||||||
}
|
}
|
||||||
@@ -214,6 +229,7 @@ RTCSetResult perhapsSetRTC(RTCQuality q, const struct timeval *tv, bool forceUpd
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (shouldSet) {
|
if (shouldSet) {
|
||||||
|
RTCQuality oldQuality = currentQuality;
|
||||||
currentQuality = q;
|
currentQuality = q;
|
||||||
lastSetMsec = now;
|
lastSetMsec = now;
|
||||||
if (currentQuality >= RTCQualityNTP) {
|
if (currentQuality >= RTCQualityNTP) {
|
||||||
@@ -223,7 +239,7 @@ RTCSetResult perhapsSetRTC(RTCQuality q, const struct timeval *tv, bool forceUpd
|
|||||||
// This delta value works on all platforms
|
// This delta value works on all platforms
|
||||||
timeStartMsec = now;
|
timeStartMsec = now;
|
||||||
zeroOffsetSecs = tv->tv_sec;
|
zeroOffsetSecs = tv->tv_sec;
|
||||||
// If this platform has a setable RTC, set it
|
// If this platform has a settable RTC, set it
|
||||||
#ifdef RV3028_RTC
|
#ifdef RV3028_RTC
|
||||||
if (rtc_found.address == RV3028_RTC) {
|
if (rtc_found.address == RV3028_RTC) {
|
||||||
Melopero_RV3028 rtc;
|
Melopero_RV3028 rtc;
|
||||||
@@ -281,6 +297,7 @@ RTCSetResult perhapsSetRTC(RTCQuality q, const struct timeval *tv, bool forceUpd
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
readFromRTC();
|
readFromRTC();
|
||||||
|
triggerNodeInfoCheckOnTimeSource(oldQuality, currentQuality);
|
||||||
return RTCSetResultSuccess;
|
return RTCSetResultSuccess;
|
||||||
} else {
|
} else {
|
||||||
return RTCSetResultNotSet; // RTC was already set with a higher quality time
|
return RTCSetResultNotSet; // RTC was already set with a higher quality time
|
||||||
@@ -312,7 +329,7 @@ const char *RtcName(RTCQuality quality)
|
|||||||
* @param t The time to potentially set the RTC to.
|
* @param t The time to potentially set the RTC to.
|
||||||
* @return True if the RTC was set to the provided time, false otherwise.
|
* @return True if the RTC was set to the provided time, false otherwise.
|
||||||
*/
|
*/
|
||||||
RTCSetResult perhapsSetRTC(RTCQuality q, struct tm &t)
|
RTCSetResult perhapsSetRTC(RTCQuality q, const struct tm &t)
|
||||||
{
|
{
|
||||||
/* Convert to unix time
|
/* Convert to unix time
|
||||||
The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970
|
The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970
|
||||||
@@ -397,12 +414,23 @@ uint32_t getValidTime(RTCQuality minQuality, bool local)
|
|||||||
return (currentQuality >= minQuality) ? getTime(local) : 0;
|
return (currentQuality >= minQuality) ? getTime(local) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PIO_UNIT_TESTING
|
||||||
|
void setBootRelativeTimeForUnitTest(uint32_t secondsSinceBoot)
|
||||||
|
{
|
||||||
|
currentQuality = RTCQualityNone;
|
||||||
|
zeroOffsetSecs = 0;
|
||||||
|
timeStartMsec = millis() - (secondsSinceBoot * 1000);
|
||||||
|
lastSetFromPhoneNtpOrGps = 0;
|
||||||
|
lastTimeValidationWarning = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
time_t gm_mktime(const struct tm *tm)
|
time_t gm_mktime(const struct tm *tm)
|
||||||
{
|
{
|
||||||
#if !MESHTASTIC_EXCLUDE_TZ
|
#if !MESHTASTIC_EXCLUDE_TZ
|
||||||
time_t result = 0;
|
time_t result = 0;
|
||||||
|
|
||||||
// First, get us to the start of tm->year, by calcuating the number of days since the Unix epoch.
|
// First, get us to the start of tm->year, by calculating the number of days since the Unix epoch.
|
||||||
int year = 1900 + tm->tm_year; // tm_year is years since 1900
|
int year = 1900 + tm->tm_year; // tm_year is years since 1900
|
||||||
int year_minus_one = year - 1;
|
int year_minus_one = year - 1;
|
||||||
int days_before_this_year = 0;
|
int days_before_this_year = 0;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user