mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-15 23:32:34 +00:00
Compare commits
1 Commits
log-freque
...
fix-ble-td
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38eb51414c |
@@ -76,7 +76,7 @@ bool loopCanSleep()
|
|||||||
// Called just prior to starting Meshtastic. Allows for setting config values before startup.
|
// Called just prior to starting Meshtastic. Allows for setting config values before startup.
|
||||||
void lateInitVariant()
|
void lateInitVariant()
|
||||||
{
|
{
|
||||||
portduino_config.logoutputlevel = level_error;
|
settingsMap[logoutputlevel] = level_error;
|
||||||
channelFile.channels[0] = meshtastic_Channel{
|
channelFile.channels[0] = meshtastic_Channel{
|
||||||
.has_settings = true,
|
.has_settings = true,
|
||||||
.settings =
|
.settings =
|
||||||
@@ -132,7 +132,7 @@ int portduino_main(int argc, char **argv); // Renamed "main" function from Mesht
|
|||||||
// Start Meshtastic in a thread and wait till it has reached the ON state.
|
// Start Meshtastic in a thread and wait till it has reached the ON state.
|
||||||
int LLVMFuzzerInitialize(int *argc, char ***argv)
|
int LLVMFuzzerInitialize(int *argc, char ***argv)
|
||||||
{
|
{
|
||||||
portduino_config.maxtophone = 5;
|
settingsMap[maxtophone] = 5;
|
||||||
|
|
||||||
meshtasticThread = std::thread([program = *argv[0]]() {
|
meshtasticThread = std::thread([program = *argv[0]]() {
|
||||||
char nodeIdStr[12];
|
char nodeIdStr[12];
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
# trunk-ignore-all(terrascan/AC_DOCKER_0002): Known terrascan issue
|
|
||||||
# trunk-ignore-all(hadolint/DL3008): Do not pin apt package versions
|
|
||||||
# trunk-ignore-all(hadolint/DL3013): Do not pin pip package versions
|
|
||||||
FROM mcr.microsoft.com/devcontainers/cpp:1-debian-12
|
FROM mcr.microsoft.com/devcontainers/cpp:1-debian-12
|
||||||
|
|
||||||
USER root
|
USER root
|
||||||
|
|
||||||
|
# trunk-ignore(terrascan/AC_DOCKER_0002): Known terrascan issue
|
||||||
|
# trunk-ignore(hadolint/DL3008): Use latest version of packages
|
||||||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||||
&& apt-get -y install --no-install-recommends \
|
&& apt-get -y install --no-install-recommends \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
@@ -28,15 +27,9 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
|||||||
hwdata \
|
hwdata \
|
||||||
gpg \
|
gpg \
|
||||||
gnupg2 \
|
gnupg2 \
|
||||||
libusb-1.0-0-dev \
|
|
||||||
libuv1-dev \
|
|
||||||
libi2c-dev \
|
|
||||||
libxcb-xkb-dev \
|
|
||||||
libxkbcommon-dev \
|
|
||||||
libinput-dev \
|
|
||||||
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN pipx install platformio
|
RUN pipx install platformio==6.1.15
|
||||||
|
|
||||||
COPY 99-platformio-udev.rules /etc/udev/rules.d/99-platformio-udev.rules
|
COPY 99-platformio-udev.rules /etc/udev/rules.d/99-platformio-udev.rules
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
git submodule update --init
|
git submodule update --init
|
||||||
|
|
||||||
pip install --no-cache-dir setuptools
|
|
||||||
pipx install esptool
|
|
||||||
|
|||||||
5
.gitattributes
vendored
5
.gitattributes
vendored
@@ -1,5 +1,4 @@
|
|||||||
* text=auto eol=lf
|
* text=auto eol=lf
|
||||||
*.cmd text eol=crlf
|
*.{cmd,[cC][mM][dD]} text eol=crlf
|
||||||
*.bat text eol=crlf
|
*.{bat,[bB][aA][tT]} text eol=crlf
|
||||||
*.ps1 text eol=crlf
|
|
||||||
*.{sh,[sS][hH]} text eol=lf
|
*.{sh,[sS][hH]} text eol=lf
|
||||||
|
|||||||
3
.github/FUNDING.yml
vendored
3
.github/FUNDING.yml
vendored
@@ -1,3 +0,0 @@
|
|||||||
# These are supported funding model platforms
|
|
||||||
|
|
||||||
open_collective: meshtastic
|
|
||||||
11
.github/ISSUE_TEMPLATE/Bug Report.yml
vendored
11
.github/ISSUE_TEMPLATE/Bug Report.yml
vendored
@@ -1,7 +1,7 @@
|
|||||||
name: Bug Report
|
name: Bug Report
|
||||||
description: File a bug report
|
description: File a bug report
|
||||||
title: "[Bug]: "
|
title: "[Bug]: "
|
||||||
labels: [bug, triage]
|
labels: ["bug", "triage"]
|
||||||
body:
|
body:
|
||||||
- type: markdown
|
- type: markdown
|
||||||
attributes:
|
attributes:
|
||||||
@@ -72,15 +72,6 @@ body:
|
|||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
- type: checkboxes
|
|
||||||
id: mui
|
|
||||||
attributes:
|
|
||||||
label: Is this bug report about any UI component firmware like InkHUD or Meshtatic UI (MUI)?
|
|
||||||
options:
|
|
||||||
- label: Meshtastic UI aka MUI colorTFT
|
|
||||||
- label: InkHUD ePaper
|
|
||||||
- label: OLED slide UI on any display
|
|
||||||
|
|
||||||
- type: input
|
- type: input
|
||||||
id: version
|
id: version
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/New Board.yml
vendored
2
.github/ISSUE_TEMPLATE/New Board.yml
vendored
@@ -1,7 +1,7 @@
|
|||||||
name: New Board
|
name: New Board
|
||||||
description: Request us to support new hardware
|
description: Request us to support new hardware
|
||||||
title: "[Board]: "
|
title: "[Board]: "
|
||||||
labels: [enhancement, triage]
|
labels: ["enhancement", "triage"]
|
||||||
body:
|
body:
|
||||||
- type: markdown
|
- type: markdown
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/feature.yml
vendored
2
.github/ISSUE_TEMPLATE/feature.yml
vendored
@@ -1,7 +1,7 @@
|
|||||||
name: Feature Request
|
name: Feature Request
|
||||||
description: Request a new feature
|
description: Request a new feature
|
||||||
title: "[Feature Request]: "
|
title: "[Feature Request]: "
|
||||||
labels: [enhancement]
|
labels: ["enhancement"]
|
||||||
body:
|
body:
|
||||||
- type: markdown
|
- type: markdown
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
5
.github/actionlint.yaml
vendored
5
.github/actionlint.yaml
vendored
@@ -1,5 +0,0 @@
|
|||||||
# Configuration related to self-hosted runner.
|
|
||||||
self-hosted-runner:
|
|
||||||
# Labels of self-hosted runner in array of strings.
|
|
||||||
labels:
|
|
||||||
- test-runner
|
|
||||||
47
.github/actions/build-variant/action.yml
vendored
47
.github/actions/build-variant/action.yml
vendored
@@ -27,14 +27,14 @@ inputs:
|
|||||||
description: A newline separated list of paths to store as artifacts
|
description: A newline separated list of paths to store as artifacts
|
||||||
required: false
|
required: false
|
||||||
default: ""
|
default: ""
|
||||||
# include-web-ui:
|
include-web-ui:
|
||||||
# description: Include the web UI in the build
|
description: Include the web UI in the build
|
||||||
# required: false
|
required: false
|
||||||
# default: "false"
|
default: "false"
|
||||||
arch:
|
arch:
|
||||||
description: Processor arch name
|
description: Processor arch name
|
||||||
required: true
|
required: true
|
||||||
default: esp32
|
default: "esp32"
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
@@ -43,29 +43,22 @@ runs:
|
|||||||
id: base
|
id: base
|
||||||
uses: ./.github/actions/setup-base
|
uses: ./.github/actions/setup-base
|
||||||
|
|
||||||
# - name: Get web ui version
|
- name: Pull web ui
|
||||||
# if: inputs.include-web-ui == 'true'
|
if: inputs.include-web-ui == 'true'
|
||||||
# id: webver
|
uses: dsaltares/fetch-gh-release-asset@master
|
||||||
# shell: bash
|
with:
|
||||||
# run: |
|
repo: meshtastic/web
|
||||||
# echo "ver=$(cat bin/web.version)" >> $GITHUB_OUTPUT
|
file: build.tar
|
||||||
|
target: build.tar
|
||||||
|
token: ${{ inputs.github_token }}
|
||||||
|
version: tags/v2.5.3
|
||||||
|
|
||||||
# - name: Pull web ui
|
- name: Unpack web ui
|
||||||
# if: inputs.include-web-ui == 'true'
|
if: inputs.include-web-ui == 'true'
|
||||||
# uses: dsaltares/fetch-gh-release-asset@master
|
shell: bash
|
||||||
# with:
|
run: |
|
||||||
# repo: meshtastic/web
|
tar -xf build.tar -C data/static
|
||||||
# file: build.tar
|
rm build.tar
|
||||||
# target: build.tar
|
|
||||||
# token: ${{ inputs.github_token }}
|
|
||||||
# version: tags/v${{ steps.webver.outputs.ver }}
|
|
||||||
|
|
||||||
# - name: Unpack web ui
|
|
||||||
# if: inputs.include-web-ui == 'true'
|
|
||||||
# shell: bash
|
|
||||||
# run: |
|
|
||||||
# tar -xf build.tar -C data/static
|
|
||||||
# rm build.tar
|
|
||||||
|
|
||||||
- name: Remove debug flags for release
|
- name: Remove debug flags for release
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
17
.github/actions/setup-base/action.yml
vendored
17
.github/actions/setup-base/action.yml
vendored
@@ -1,16 +1,21 @@
|
|||||||
name: Setup Build Base Composite Action
|
name: "Setup Build Base Composite Action"
|
||||||
description: Base build actions for Meshtastic Platform IO steps
|
description: "Base build actions for Meshtastic Platform IO steps"
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: "recursive"
|
||||||
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}}
|
||||||
|
|
||||||
|
- name: Uncomment build epoch
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sed -i 's/#-DBUILD_EPOCH=$UNIX_TIME/-DBUILD_EPOCH=$UNIX_TIME/' platformio.ini
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -18,7 +23,7 @@ runs:
|
|||||||
sudo apt-get install -y cppcheck libbluetooth-dev libgpiod-dev libyaml-cpp-dev lsb-release
|
sudo apt-get install -y cppcheck libbluetooth-dev libgpiod-dev libyaml-cpp-dev lsb-release
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: 3.x
|
python-version: 3.x
|
||||||
cache: pip
|
cache: pip
|
||||||
|
|||||||
2
.github/actions/setup-native/action.yml
vendored
2
.github/actions/setup-native/action.yml
vendored
@@ -11,4 +11,4 @@ runs:
|
|||||||
- name: Install libs needed for native build
|
- name: Install libs needed for native build
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install -y libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev libulfius-dev liborcania-dev libusb-1.0-0-dev libi2c-dev libuv1-dev
|
sudo apt-get install -y libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev libulfius-dev liborcania-dev libusb-1.0-0-dev libi2c-dev
|
||||||
|
|||||||
26
.github/dependabot.yml
vendored
Normal file
26
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: docker
|
||||||
|
directory: devcontainer
|
||||||
|
schedule:
|
||||||
|
interval: daily
|
||||||
|
time: "05:00" # trunk-ignore(yamllint/quoted-strings): required by dependabot syntax check
|
||||||
|
timezone: US/Pacific
|
||||||
|
- package-ecosystem: docker
|
||||||
|
directory: /
|
||||||
|
schedule:
|
||||||
|
interval: daily
|
||||||
|
time: "05:00" # trunk-ignore(yamllint/quoted-strings): required by dependabot syntax check
|
||||||
|
timezone: US/Pacific
|
||||||
|
- package-ecosystem: gitsubmodule
|
||||||
|
directory: /
|
||||||
|
schedule:
|
||||||
|
interval: daily
|
||||||
|
time: "05:00" # trunk-ignore(yamllint/quoted-strings): required by dependabot syntax check
|
||||||
|
timezone: US/Pacific
|
||||||
|
- package-ecosystem: github-actions
|
||||||
|
directory: /.github/workflows
|
||||||
|
schedule:
|
||||||
|
interval: daily
|
||||||
|
time: "05:00" # trunk-ignore(yamllint/quoted-strings): required by dependabot syntax check
|
||||||
|
timezone: US/Pacific
|
||||||
BIN
.github/meshtastic_logo.png
vendored
BIN
.github/meshtastic_logo.png
vendored
Binary file not shown.
|
Before Width: | Height: | Size: 89 KiB |
17
.github/pull_request_template.md
vendored
17
.github/pull_request_template.md
vendored
@@ -1,7 +1,7 @@
|
|||||||
## 🙏 Thank you for sending in a pull request, here's some tips to get started!
|
|
||||||
|
|
||||||
### ❌ (Please delete all these tips and replace them with your text) ❌
|
### ❌ (Please delete all these tips and replace them with your text) ❌
|
||||||
|
|
||||||
|
## Thank you for sending in a pull request, here's some tips to get started!
|
||||||
|
|
||||||
- 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 accidentially duplicating work etc...
|
||||||
@@ -12,17 +12,4 @@
|
|||||||
- 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.
|
|
||||||
- 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 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
|
|
||||||
|
|
||||||
- [ ] I have tested that my proposed changes behave as described.
|
|
||||||
- [ ] I have tested that my proposed changes do not cause any obvious regressions on the following devices:
|
|
||||||
- [ ] Heltec (Lora32) V3
|
|
||||||
- [ ] LilyGo T-Deck
|
|
||||||
- [ ] LilyGo T-Beam
|
|
||||||
- [ ] RAK WisBlock 4631
|
|
||||||
- [ ] Seeed Studio T-1000E tracker card
|
|
||||||
- [ ] Other (please specify below)
|
|
||||||
|
|||||||
4
.github/workflows/build_debian_src.yml
vendored
4
.github/workflows/build_debian_src.yml
vendored
@@ -4,7 +4,7 @@ on:
|
|||||||
workflow_call:
|
workflow_call:
|
||||||
secrets:
|
secrets:
|
||||||
PPA_GPG_PRIVATE_KEY:
|
PPA_GPG_PRIVATE_KEY:
|
||||||
required: false
|
required: true
|
||||||
inputs:
|
inputs:
|
||||||
series:
|
series:
|
||||||
description: Ubuntu/Debian series to target
|
description: Ubuntu/Debian series to target
|
||||||
@@ -24,7 +24,7 @@ jobs:
|
|||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
path: meshtasticd
|
path: meshtasticd
|
||||||
|
|||||||
37
.github/workflows/build_esp32.yml
vendored
Normal file
37
.github/workflows/build_esp32.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
name: Build ESP32
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
board:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-esp32:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Build ESP32
|
||||||
|
id: build
|
||||||
|
uses: ./.github/actions/build-variant
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
board: ${{ inputs.board }}
|
||||||
|
remove-debug-flags: >-
|
||||||
|
./arch/esp32/esp32.ini
|
||||||
|
./arch/esp32/esp32s2.ini
|
||||||
|
./arch/esp32/esp32s3.ini
|
||||||
|
./arch/esp32/esp32c3.ini
|
||||||
|
./arch/esp32/esp32c6.ini
|
||||||
|
build-script-path: bin/build-esp32.sh
|
||||||
|
ota-firmware-source: firmware.bin
|
||||||
|
ota-firmware-target: release/bleota.bin
|
||||||
|
artifact-paths: |
|
||||||
|
release/*.bin
|
||||||
|
release/*.elf
|
||||||
|
include-web-ui: true
|
||||||
|
arch: esp32
|
||||||
37
.github/workflows/build_esp32_c3.yml
vendored
Normal file
37
.github/workflows/build_esp32_c3.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
name: Build ESP32-C3
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
board:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-esp32-c3:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Build ESP32-C3
|
||||||
|
id: build
|
||||||
|
uses: ./.github/actions/build-variant
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
board: ${{ inputs.board }}
|
||||||
|
remove-debug-flags: >-
|
||||||
|
./arch/esp32/esp32.ini
|
||||||
|
./arch/esp32/esp32s2.ini
|
||||||
|
./arch/esp32/esp32s3.ini
|
||||||
|
./arch/esp32/esp32c3.ini
|
||||||
|
./arch/esp32/esp32c6.ini
|
||||||
|
build-script-path: bin/build-esp32.sh
|
||||||
|
ota-firmware-source: firmware-c3.bin
|
||||||
|
ota-firmware-target: release/bleota-c3.bin
|
||||||
|
artifact-paths: |
|
||||||
|
release/*.bin
|
||||||
|
release/*.elf
|
||||||
|
include-web-ui: true
|
||||||
|
arch: esp32c3
|
||||||
37
.github/workflows/build_esp32_c6.yml
vendored
Normal file
37
.github/workflows/build_esp32_c6.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
name: Build ESP32-C6
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
board:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-esp32-c6:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Build ESP32-C6
|
||||||
|
id: build
|
||||||
|
uses: ./.github/actions/build-variant
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
board: ${{ inputs.board }}
|
||||||
|
remove-debug-flags: >-
|
||||||
|
./arch/esp32/esp32.ini
|
||||||
|
./arch/esp32/esp32s2.ini
|
||||||
|
./arch/esp32/esp32s3.ini
|
||||||
|
./arch/esp32/esp32c3.ini
|
||||||
|
./arch/esp32/esp32c6.ini
|
||||||
|
build-script-path: bin/build-esp32.sh
|
||||||
|
ota-firmware-source: firmware-c3.bin
|
||||||
|
ota-firmware-target: release/bleota-c3.bin
|
||||||
|
artifact-paths: |
|
||||||
|
release/*.bin
|
||||||
|
release/*.elf
|
||||||
|
include-web-ui: true
|
||||||
|
arch: esp32c6
|
||||||
37
.github/workflows/build_esp32_s3.yml
vendored
Normal file
37
.github/workflows/build_esp32_s3.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
name: Build ESP32-S3
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
board:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-esp32-s3:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Build ESP32-S3
|
||||||
|
id: build
|
||||||
|
uses: ./.github/actions/build-variant
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
board: ${{ inputs.board }}
|
||||||
|
remove-debug-flags: >-
|
||||||
|
./arch/esp32/esp32.ini
|
||||||
|
./arch/esp32/esp32s2.ini
|
||||||
|
./arch/esp32/esp32s3.ini
|
||||||
|
./arch/esp32/esp32c3.ini
|
||||||
|
./arch/esp32/esp32c6.ini
|
||||||
|
build-script-path: bin/build-esp32.sh
|
||||||
|
ota-firmware-source: firmware-s3.bin
|
||||||
|
ota-firmware-target: release/bleota-s3.bin
|
||||||
|
artifact-paths: |
|
||||||
|
release/*.bin
|
||||||
|
release/*.elf
|
||||||
|
include-web-ui: true
|
||||||
|
arch: esp32s3
|
||||||
69
.github/workflows/build_firmware.yml
vendored
69
.github/workflows/build_firmware.yml
vendored
@@ -1,69 +0,0 @@
|
|||||||
name: Build
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
version:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
platform:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
pio_env:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
permissions: read-all
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
pio-build:
|
|
||||||
name: build-${{ inputs.platform }}
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
outputs:
|
|
||||||
artifact-id: ${{ steps.upload.outputs.artifact-id }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- name: Set OTA firmware source and target
|
|
||||||
if: startsWith(inputs.platform, 'esp32')
|
|
||||||
id: ota_dir
|
|
||||||
env:
|
|
||||||
PIO_PLATFORM: ${{ inputs.platform }}
|
|
||||||
run: |
|
|
||||||
if [ "$PIO_PLATFORM" = "esp32s3" ]; then
|
|
||||||
echo "src=firmware-s3.bin" >> $GITHUB_OUTPUT
|
|
||||||
echo "tgt=release/bleota-s3.bin" >> $GITHUB_OUTPUT
|
|
||||||
elif [ "$PIO_PLATFORM" = "esp32c3" ] || [ "$PIO_PLATFORM" = "esp32c6" ]; then
|
|
||||||
echo "src=firmware-c3.bin" >> $GITHUB_OUTPUT
|
|
||||||
echo "tgt=release/bleota-c3.bin" >> $GITHUB_OUTPUT
|
|
||||||
elif [ "$PIO_PLATFORM" = "esp32" ]; then
|
|
||||||
echo "src=firmware.bin" >> $GITHUB_OUTPUT
|
|
||||||
echo "tgt=release/bleota.bin" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Build ${{ inputs.platform }}
|
|
||||||
id: build
|
|
||||||
uses: meshtastic/gh-action-firmware@main
|
|
||||||
with:
|
|
||||||
pio_platform: ${{ inputs.platform }}
|
|
||||||
pio_env: ${{ inputs.pio_env }}
|
|
||||||
pio_target: build
|
|
||||||
ota_firmware_source: ${{ steps.ota_dir.outputs.src || '' }}
|
|
||||||
ota_firmware_target: ${{ steps.ota_dir.outputs.tgt || '' }}
|
|
||||||
|
|
||||||
- name: Store binaries as an artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
id: upload
|
|
||||||
with:
|
|
||||||
name: firmware-${{ inputs.platform }}-${{ inputs.pio_env }}-${{ inputs.version }}.zip
|
|
||||||
overwrite: true
|
|
||||||
path: |
|
|
||||||
release/*.bin
|
|
||||||
release/*.elf
|
|
||||||
release/*.uf2
|
|
||||||
release/*.hex
|
|
||||||
release/*-ota.zip
|
|
||||||
28
.github/workflows/build_nrf52.yml
vendored
Normal file
28
.github/workflows/build_nrf52.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
name: Build NRF52
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
board:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-nrf52:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Build NRF52
|
||||||
|
id: build
|
||||||
|
uses: ./.github/actions/build-variant
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
board: ${{ inputs.board }}
|
||||||
|
build-script-path: bin/build-nrf52.sh
|
||||||
|
artifact-paths: |
|
||||||
|
release/*.hex
|
||||||
|
release/*.uf2
|
||||||
|
release/*.elf
|
||||||
|
release/*.zip
|
||||||
|
arch: nrf52840
|
||||||
176
.github/workflows/build_one_arch.yml
vendored
176
.github/workflows/build_one_arch.yml
vendored
@@ -1,176 +0,0 @@
|
|||||||
name: Build One Arch
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
# trunk-ignore(checkov/CKV_GHA_7)
|
|
||||||
arch:
|
|
||||||
type: choice
|
|
||||||
options:
|
|
||||||
- esp32
|
|
||||||
- esp32s3
|
|
||||||
- esp32c3
|
|
||||||
- esp32c6
|
|
||||||
- nrf52840
|
|
||||||
- rp2040
|
|
||||||
- rp2350
|
|
||||||
- stm32
|
|
||||||
- native
|
|
||||||
|
|
||||||
permissions: read-all
|
|
||||||
|
|
||||||
env:
|
|
||||||
INPUT_ARCH: ${{ github.event.inputs.arch }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
setup:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
- uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
cache: pip
|
|
||||||
- run: pip install -U platformio
|
|
||||||
- name: Generate matrix
|
|
||||||
id: jsonStep
|
|
||||||
run: |
|
|
||||||
TARGETS=$(./bin/generate_ci_matrix.py $INPUT_ARCH --level extra)
|
|
||||||
echo "Name: $GITHUB_REF_NAME Base: $GITHUB_BASE_REF Ref: $GITHUB_REF"
|
|
||||||
echo "selected_arch=$TARGETS" >> $GITHUB_OUTPUT
|
|
||||||
outputs:
|
|
||||||
selected_arch: ${{ steps.jsonStep.outputs.selected_arch }}
|
|
||||||
|
|
||||||
version:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
- 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 }}
|
|
||||||
|
|
||||||
build:
|
|
||||||
if: ${{ github.event_name != 'workflow_dispatch' }}
|
|
||||||
needs: [setup, version]
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
build: ${{ fromJson(needs.setup.outputs.selected_arch) }}
|
|
||||||
uses: ./.github/workflows/build_firmware.yml
|
|
||||||
with:
|
|
||||||
version: ${{ needs.version.outputs.long }}
|
|
||||||
pio_env: ${{ matrix.build.board }}
|
|
||||||
platform: ${{ matrix.build.arch }}
|
|
||||||
|
|
||||||
build-debian-src:
|
|
||||||
if: ${{ github.repository == 'meshtastic/firmware' && github.event_name != 'workflow_dispatch' || inputs.arch == 'native' }}
|
|
||||||
uses: ./.github/workflows/build_debian_src.yml
|
|
||||||
with:
|
|
||||||
series: UNRELEASED
|
|
||||||
build_location: local
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
package-pio-deps-native-tft:
|
|
||||||
if: ${{ inputs.arch == 'native' }}
|
|
||||||
uses: ./.github/workflows/package_pio_deps.yml
|
|
||||||
with:
|
|
||||||
pio_env: native-tft
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
test-native:
|
|
||||||
if: ${{ !contains(github.ref_name, 'event/') && github.event_name != 'workflow_dispatch' || !contains(github.ref_name, 'event/') && inputs.arch == 'native' }}
|
|
||||||
uses: ./.github/workflows/test_native.yml
|
|
||||||
|
|
||||||
gather-artifacts:
|
|
||||||
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@v5
|
|
||||||
with:
|
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v5
|
|
||||||
with:
|
|
||||||
path: ./
|
|
||||||
pattern: firmware-${{inputs.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@v4
|
|
||||||
with:
|
|
||||||
name: firmware-${{inputs.arch}}-${{ needs.version.outputs.long }}
|
|
||||||
overwrite: true
|
|
||||||
path: |
|
|
||||||
./firmware-*.bin
|
|
||||||
./firmware-*.uf2
|
|
||||||
./firmware-*.hex
|
|
||||||
./firmware-*-ota.zip
|
|
||||||
./device-*.sh
|
|
||||||
./device-*.bat
|
|
||||||
./littlefs-*.bin
|
|
||||||
./bleota*bin
|
|
||||||
./Meshtastic_nRF52_factory_erase*.uf2
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v5
|
|
||||||
with:
|
|
||||||
name: firmware-${{inputs.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
|
|
||||||
chmod +x ./output/device-update.sh
|
|
||||||
|
|
||||||
- name: Zip firmware
|
|
||||||
run: zip -j -9 -r ./firmware-${{inputs.arch}}-${{ needs.version.outputs.long }}.zip ./output
|
|
||||||
|
|
||||||
- name: Repackage in single elfs zip
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: debug-elfs-${{inputs.arch}}-${{ needs.version.outputs.long }}.zip
|
|
||||||
overwrite: true
|
|
||||||
path: ./*.elf
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
- uses: scruplelesswizard/comment-artifact@main
|
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
|
||||||
with:
|
|
||||||
name: firmware-${{inputs.arch}}-${{ needs.version.outputs.long }}
|
|
||||||
description: "Download firmware-${{inputs.arch}}-${{ needs.version.outputs.long }}.zip. This artifact will be available for 90 days from creation"
|
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
182
.github/workflows/build_one_target.yml
vendored
182
.github/workflows/build_one_target.yml
vendored
@@ -1,182 +0,0 @@
|
|||||||
name: Build One Target
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
# trunk-ignore(checkov/CKV_GHA_7)
|
|
||||||
arch:
|
|
||||||
type: choice
|
|
||||||
options:
|
|
||||||
- esp32
|
|
||||||
- esp32s3
|
|
||||||
- esp32c3
|
|
||||||
- esp32c6
|
|
||||||
- nrf52840
|
|
||||||
- rp2040
|
|
||||||
- rp2350
|
|
||||||
- stm32
|
|
||||||
- native
|
|
||||||
target:
|
|
||||||
type: string
|
|
||||||
required: false
|
|
||||||
description: Choose the target board, e.g. nrf52_promicro_diy_tcxo. If blank, will find available targets.
|
|
||||||
# find-target:
|
|
||||||
# type: boolean
|
|
||||||
# default: true
|
|
||||||
# description: 'Find the available targets'
|
|
||||||
|
|
||||||
permissions: read-all
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
find-targets:
|
|
||||||
if: ${{ inputs.target == '' }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
arch:
|
|
||||||
- esp32
|
|
||||||
- esp32s3
|
|
||||||
- esp32c3
|
|
||||||
- esp32c6
|
|
||||||
- nrf52840
|
|
||||||
- rp2040
|
|
||||||
- rp2350
|
|
||||||
- stm32
|
|
||||||
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
- uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
cache: pip
|
|
||||||
- run: pip install -U platformio
|
|
||||||
- name: Generate matrix
|
|
||||||
id: jsonStep
|
|
||||||
run: |
|
|
||||||
TARGETS=$(./bin/generate_ci_matrix.py ${{matrix.arch}} --level extra)
|
|
||||||
echo "Name: $GITHUB_REF_NAME" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "Base: $GITHUB_BASE_REF" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "Arch: ${{matrix.arch}}" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "Ref: $GITHUB_REF" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "Targets:" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo $TARGETS >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
version:
|
|
||||||
if: ${{ inputs.target != '' }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
- 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 }}
|
|
||||||
|
|
||||||
build:
|
|
||||||
if: ${{ inputs.target != '' && inputs.arch != 'native' }}
|
|
||||||
needs: [version]
|
|
||||||
uses: ./.github/workflows/build_firmware.yml
|
|
||||||
with:
|
|
||||||
version: ${{ needs.version.outputs.long }}
|
|
||||||
pio_env: ${{ inputs.target }}
|
|
||||||
platform: ${{ inputs.arch }}
|
|
||||||
|
|
||||||
build-debian-src:
|
|
||||||
if: ${{ github.repository == 'meshtastic/firmware' && inputs.arch == 'native' }}
|
|
||||||
uses: ./.github/workflows/build_debian_src.yml
|
|
||||||
with:
|
|
||||||
series: UNRELEASED
|
|
||||||
build_location: local
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
package-pio-deps-native-tft:
|
|
||||||
if: ${{ inputs.arch == 'native' }}
|
|
||||||
uses: ./.github/workflows/package_pio_deps.yml
|
|
||||||
with:
|
|
||||||
pio_env: native-tft
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
test-native:
|
|
||||||
if: ${{ !contains(github.ref_name, 'event/') && github.event_name != 'workflow_dispatch' || !contains(github.ref_name, 'event/') && inputs.arch == 'native' && inputs.target != '' }}
|
|
||||||
uses: ./.github/workflows/test_native.yml
|
|
||||||
|
|
||||||
gather-artifacts:
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [version, build]
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v5
|
|
||||||
with:
|
|
||||||
path: ./
|
|
||||||
pattern: firmware-*-*
|
|
||||||
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@v4
|
|
||||||
with:
|
|
||||||
name: firmware-${{inputs.target}}-${{ needs.version.outputs.long }}
|
|
||||||
overwrite: true
|
|
||||||
path: |
|
|
||||||
./firmware-*.bin
|
|
||||||
./firmware-*.uf2
|
|
||||||
./firmware-*.hex
|
|
||||||
./firmware-*-ota.zip
|
|
||||||
./device-*.sh
|
|
||||||
./device-*.bat
|
|
||||||
./littlefs-*.bin
|
|
||||||
./bleota*bin
|
|
||||||
./Meshtastic_nRF52_factory_erase*.uf2
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v5
|
|
||||||
with:
|
|
||||||
pattern: firmware-*-${{ 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
|
|
||||||
chmod +x ./output/device-update.sh
|
|
||||||
|
|
||||||
- name: Zip firmware
|
|
||||||
run: zip -j -9 -r ./firmware-${{inputs.target}}-${{ needs.version.outputs.long }}.zip ./output
|
|
||||||
|
|
||||||
- name: Repackage in single elfs zip
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: debug-elfs-${{inputs.target}}-${{ needs.version.outputs.long }}.zip
|
|
||||||
overwrite: true
|
|
||||||
path: ./*.elf
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
- uses: scruplelesswizard/comment-artifact@main
|
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
|
||||||
with:
|
|
||||||
name: firmware-${{inputs.target}}-${{ needs.version.outputs.long }}
|
|
||||||
description: "Download firmware-${{inputs.target}}-${{ needs.version.outputs.long }}.zip. This artifact will be available for 90 days from creation"
|
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
26
.github/workflows/build_rpi2040.yml
vendored
Normal file
26
.github/workflows/build_rpi2040.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
name: Build RPI2040
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
board:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-rpi2040:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Build Raspberry Pi 2040
|
||||||
|
id: build
|
||||||
|
uses: ./.github/actions/build-variant
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
board: ${{ inputs.board }}
|
||||||
|
build-script-path: bin/build-rpi2040.sh
|
||||||
|
artifact-paths: |
|
||||||
|
release/*.uf2
|
||||||
|
release/*.elf
|
||||||
|
arch: rp2040
|
||||||
27
.github/workflows/build_stm32.yml
vendored
Normal file
27
.github/workflows/build_stm32.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
name: Build STM32
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
board:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-stm32:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Build STM32WL
|
||||||
|
id: build
|
||||||
|
uses: ./.github/actions/build-variant
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
board: ${{ inputs.board }}
|
||||||
|
build-script-path: bin/build-stm32.sh
|
||||||
|
artifact-paths: |
|
||||||
|
release/*.hex
|
||||||
|
release/*.bin
|
||||||
|
release/*.elf
|
||||||
|
arch: stm32
|
||||||
12
.github/workflows/daily_packaging.yml
vendored
12
.github/workflows/daily_packaging.yml
vendored
@@ -1,7 +1,7 @@
|
|||||||
name: Daily Packaging
|
name: Daily Packaging
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: 0 2 * * *
|
- cron: 0 9 * * *
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
@@ -21,22 +21,16 @@ permissions:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker-multiarch:
|
docker-multiarch:
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
uses: ./.github/workflows/docker_manifest.yml
|
uses: ./.github/workflows/docker_manifest.yml
|
||||||
with:
|
with:
|
||||||
release_channel: daily
|
release_channel: daily
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
package-ppa:
|
package-ppa:
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
series:
|
series: [plucky, oracular, noble, jammy]
|
||||||
- jammy # 22.04 LTS
|
|
||||||
- noble # 24.04 LTS
|
|
||||||
- plucky # 25.04
|
|
||||||
- questing # 25.10
|
|
||||||
uses: ./.github/workflows/package_ppa.yml
|
uses: ./.github/workflows/package_ppa.yml
|
||||||
with:
|
with:
|
||||||
ppa_repo: ppa:meshtastic/daily
|
ppa_repo: ppa:meshtastic/daily
|
||||||
@@ -44,7 +38,6 @@ jobs:
|
|||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
package-obs:
|
package-obs:
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
uses: ./.github/workflows/package_obs.yml
|
uses: ./.github/workflows/package_obs.yml
|
||||||
with:
|
with:
|
||||||
obs_project: network:Meshtastic:daily
|
obs_project: network:Meshtastic:daily
|
||||||
@@ -52,7 +45,6 @@ jobs:
|
|||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
hook-copr:
|
hook-copr:
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
uses: ./.github/workflows/hook_copr.yml
|
uses: ./.github/workflows/hook_copr.yml
|
||||||
with:
|
with:
|
||||||
copr_project: daily
|
copr_project: daily
|
||||||
|
|||||||
9
.github/workflows/docker_build.yml
vendored
9
.github/workflows/docker_build.yml
vendored
@@ -26,11 +26,6 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
pio_env:
|
|
||||||
description: PlatformIO environment to build
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
default: native
|
|
||||||
outputs:
|
outputs:
|
||||||
digest:
|
digest:
|
||||||
description: Digest of built image
|
description: Digest of built image
|
||||||
@@ -47,7 +42,7 @@ jobs:
|
|||||||
runs-on: ${{ inputs.runs-on }}
|
runs-on: ${{ inputs.runs-on }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
ref: ${{github.event.pull_request.head.ref}}
|
||||||
@@ -95,5 +90,3 @@ jobs:
|
|||||||
push: ${{ inputs.push }}
|
push: ${{ inputs.push }}
|
||||||
tags: ${{ steps.meta.outputs.tags }} # Tag is only meant to be consumed by the "manifest" job
|
tags: ${{ steps.meta.outputs.tags }} # Tag is only meant to be consumed by the "manifest" job
|
||||||
platforms: ${{ inputs.platform }}
|
platforms: ${{ inputs.platform }}
|
||||||
build-args: |
|
|
||||||
PIO_ENV=${{ inputs.pio_env }}
|
|
||||||
|
|||||||
2
.github/workflows/docker_manifest.yml
vendored
2
.github/workflows/docker_manifest.yml
vendored
@@ -83,7 +83,7 @@ jobs:
|
|||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
ref: ${{github.event.pull_request.head.ref}}
|
||||||
|
|||||||
35
.github/workflows/generate-userprefs.yml
vendored
Normal file
35
.github/workflows/generate-userprefs.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
name: Generate UsersPrefs JSON manifest
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- userPrefs.h
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
generate-userprefs:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Clang
|
||||||
|
run: sudo apt-get install -y clang
|
||||||
|
|
||||||
|
- name: Install trunk
|
||||||
|
run: curl https://get.trunk.io -fsSL | bash
|
||||||
|
|
||||||
|
- name: Generate userPrefs.jsom
|
||||||
|
run: python3 ./bin/build-userprefs-json.py
|
||||||
|
|
||||||
|
- name: Trunk format json
|
||||||
|
run: trunk format userPrefs.json
|
||||||
|
|
||||||
|
- name: Commit userPrefs.json
|
||||||
|
run: |
|
||||||
|
git config --global user.email "actions@github.com"
|
||||||
|
git config --global user.name "GitHub Actions"
|
||||||
|
git add userPrefs.json
|
||||||
|
git commit -m "Update userPrefs.json"
|
||||||
|
git push
|
||||||
2
.github/workflows/hook_copr.yml
vendored
2
.github/workflows/hook_copr.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
|||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
ref: ${{ github.ref }}
|
ref: ${{ github.ref }}
|
||||||
|
|||||||
405
.github/workflows/main_matrix.yml
vendored
405
.github/workflows/main_matrix.yml
vendored
@@ -3,22 +3,16 @@ concurrency:
|
|||||||
group: ci-${{ github.head_ref || github.run_id }}
|
group: ci-${{ github.head_ref || github.run_id }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
on:
|
on:
|
||||||
# # Triggers the workflow on push but only for the main branches
|
# # Triggers the workflow on push but only for the master branch
|
||||||
push:
|
push:
|
||||||
branches:
|
branches: [master, develop]
|
||||||
- master
|
|
||||||
- develop
|
|
||||||
- event/*
|
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- "**.md"
|
- "**.md"
|
||||||
- version.properties
|
- version.properties
|
||||||
|
|
||||||
# Note: This is different from "pull_request". Need to specify ref when doing checkouts.
|
# Note: This is different from "pull_request". Need to specify ref when doing checkouts.
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
branches:
|
branches: [master, develop]
|
||||||
- master
|
|
||||||
- develop
|
|
||||||
- event/*
|
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- "**.md"
|
- "**.md"
|
||||||
#- "**.yml"
|
#- "**.yml"
|
||||||
@@ -28,147 +22,192 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
setup:
|
setup:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
arch:
|
arch: [esp32, esp32s3, esp32c3, esp32c6, nrf52840, rp2040, stm32, check]
|
||||||
- all
|
|
||||||
- check
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
- 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
|
|
||||||
echo "$TARGETS" >> $GITHUB_STEP_SUMMARY
|
|
||||||
outputs:
|
|
||||||
all: ${{ steps.jsonStep.outputs.all }}
|
|
||||||
check: ${{ steps.jsonStep.outputs.check }}
|
|
||||||
|
|
||||||
version:
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- id: checkout
|
||||||
- name: Get release version string
|
uses: actions/checkout@v4
|
||||||
|
name: Checkout base
|
||||||
|
- id: jsonStep
|
||||||
run: |
|
run: |
|
||||||
echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
if [[ "${{ github.head_ref }}" == "" ]]; then
|
||||||
echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT
|
TARGETS=$(./bin/generate_ci_matrix.py ${{matrix.arch}})
|
||||||
id: version
|
else
|
||||||
env:
|
TARGETS=$(./bin/generate_ci_matrix.py ${{matrix.arch}} quick)
|
||||||
BUILD_LOCATION: local
|
fi
|
||||||
|
echo "Name: ${{ github.ref_name }} Base: ${{ github.base_ref }} } Ref: ${{ github.ref }} Targets: $TARGETS"
|
||||||
|
echo "${{matrix.arch}}=$(jq -cn --argjson environments "$TARGETS" '{board: $environments}')" >> $GITHUB_OUTPUT
|
||||||
outputs:
|
outputs:
|
||||||
long: ${{ steps.version.outputs.long }}
|
esp32: ${{ steps.jsonStep.outputs.esp32 }}
|
||||||
deb: ${{ steps.version.outputs.deb }}
|
esp32s3: ${{ steps.jsonStep.outputs.esp32s3 }}
|
||||||
|
esp32c3: ${{ steps.jsonStep.outputs.esp32c3 }}
|
||||||
|
esp32c6: ${{ steps.jsonStep.outputs.esp32c6 }}
|
||||||
|
nrf52840: ${{ steps.jsonStep.outputs.nrf52840 }}
|
||||||
|
rp2040: ${{ steps.jsonStep.outputs.rp2040 }}
|
||||||
|
stm32: ${{ steps.jsonStep.outputs.stm32 }}
|
||||||
|
check: ${{ steps.jsonStep.outputs.check }}
|
||||||
|
|
||||||
check:
|
check:
|
||||||
needs: setup
|
needs: setup
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix: ${{ fromJson(needs.setup.outputs.check) }}
|
||||||
check: ${{ fromJson(needs.setup.outputs.check) }}
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name != 'workflow_dispatch' && github.repository == 'meshtastic/firmware' }}
|
if: ${{ github.event_name != 'workflow_dispatch' }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
- name: Build base
|
- name: Build base
|
||||||
id: base
|
id: base
|
||||||
uses: ./.github/actions/setup-base
|
uses: ./.github/actions/setup-base
|
||||||
- name: Check ${{ matrix.check.board }}
|
- name: Check ${{ matrix.board }}
|
||||||
run: bin/check-all.sh ${{ matrix.check.board }}
|
run: bin/check-all.sh ${{ matrix.board }}
|
||||||
|
|
||||||
build:
|
build-esp32:
|
||||||
needs: [setup, version]
|
needs: setup
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix: ${{ fromJson(needs.setup.outputs.esp32) }}
|
||||||
build: ${{ fromJson(needs.setup.outputs.all) }}
|
uses: ./.github/workflows/build_esp32.yml
|
||||||
uses: ./.github/workflows/build_firmware.yml
|
|
||||||
with:
|
with:
|
||||||
version: ${{ needs.version.outputs.long }}
|
board: ${{ matrix.board }}
|
||||||
pio_env: ${{ matrix.build.board }}
|
|
||||||
platform: ${{ matrix.build.platform }}
|
build-esp32-s3:
|
||||||
|
needs: setup
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix: ${{ fromJson(needs.setup.outputs.esp32s3) }}
|
||||||
|
uses: ./.github/workflows/build_esp32_s3.yml
|
||||||
|
with:
|
||||||
|
board: ${{ matrix.board }}
|
||||||
|
|
||||||
|
build-esp32-c3:
|
||||||
|
needs: setup
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix: ${{ fromJson(needs.setup.outputs.esp32c3) }}
|
||||||
|
uses: ./.github/workflows/build_esp32_c3.yml
|
||||||
|
with:
|
||||||
|
board: ${{ matrix.board }}
|
||||||
|
|
||||||
|
build-esp32-c6:
|
||||||
|
needs: setup
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix: ${{ fromJson(needs.setup.outputs.esp32c6) }}
|
||||||
|
uses: ./.github/workflows/build_esp32_c6.yml
|
||||||
|
with:
|
||||||
|
board: ${{ matrix.board }}
|
||||||
|
|
||||||
|
build-nrf52:
|
||||||
|
needs: setup
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix: ${{ fromJson(needs.setup.outputs.nrf52840) }}
|
||||||
|
uses: ./.github/workflows/build_nrf52.yml
|
||||||
|
with:
|
||||||
|
board: ${{ matrix.board }}
|
||||||
|
|
||||||
|
build-rpi2040:
|
||||||
|
needs: setup
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix: ${{ fromJson(needs.setup.outputs.rp2040) }}
|
||||||
|
uses: ./.github/workflows/build_rpi2040.yml
|
||||||
|
with:
|
||||||
|
board: ${{ matrix.board }}
|
||||||
|
|
||||||
|
build-stm32:
|
||||||
|
needs: setup
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix: ${{ fromJson(needs.setup.outputs.stm32) }}
|
||||||
|
uses: ./.github/workflows/build_stm32.yml
|
||||||
|
with:
|
||||||
|
board: ${{ matrix.board }}
|
||||||
|
|
||||||
build-debian-src:
|
build-debian-src:
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
uses: ./.github/workflows/build_debian_src.yml
|
uses: ./.github/workflows/build_debian_src.yml
|
||||||
with:
|
with:
|
||||||
series: UNRELEASED
|
series: UNRELEASED
|
||||||
build_location: local
|
build_location: local
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
package-pio-deps-native-tft:
|
|
||||||
if: ${{ github.repository == 'meshtastic/firmware' && github.event_name == 'workflow_dispatch' }}
|
|
||||||
uses: ./.github/workflows/package_pio_deps.yml
|
|
||||||
with:
|
|
||||||
pio_env: native-tft
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
test-native:
|
test-native:
|
||||||
if: ${{ !contains(github.ref_name, 'event/') && github.repository == 'meshtastic/firmware' }}
|
|
||||||
uses: ./.github/workflows/test_native.yml
|
uses: ./.github/workflows/test_native.yml
|
||||||
|
|
||||||
docker:
|
docker-debian-amd64:
|
||||||
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
|
uses: ./.github/workflows/docker_build.yml
|
||||||
with:
|
with:
|
||||||
distro: ${{ matrix.distro }}
|
distro: debian
|
||||||
platform: ${{ matrix.platform }}
|
platform: linux/amd64
|
||||||
runs-on: ${{ contains(matrix.platform, 'arm') && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
|
runs-on: ubuntu-24.04
|
||||||
pio_env: ${{ matrix.pio_env }}
|
|
||||||
push: false
|
push: false
|
||||||
|
|
||||||
|
docker-alpine-amd64:
|
||||||
|
uses: ./.github/workflows/docker_build.yml
|
||||||
|
with:
|
||||||
|
distro: alpine
|
||||||
|
platform: linux/amd64
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
push: false
|
||||||
|
|
||||||
|
docker-debian-arm64:
|
||||||
|
uses: ./.github/workflows/docker_build.yml
|
||||||
|
with:
|
||||||
|
distro: debian
|
||||||
|
platform: linux/arm64
|
||||||
|
runs-on: ubuntu-24.04-arm
|
||||||
|
push: false
|
||||||
|
|
||||||
|
docker-debian-armv7:
|
||||||
|
uses: ./.github/workflows/docker_build.yml
|
||||||
|
with:
|
||||||
|
distro: debian
|
||||||
|
platform: linux/arm/v7
|
||||||
|
runs-on: ubuntu-24.04-arm
|
||||||
|
push: false
|
||||||
|
|
||||||
|
after-checks:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.event_name != 'workflow_dispatch' }}
|
||||||
|
needs: [check]
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{github.event.pull_request.head.ref}}
|
||||||
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||||
|
|
||||||
gather-artifacts:
|
gather-artifacts:
|
||||||
# trunk-ignore(checkov/CKV2_GHA_1)
|
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
arch:
|
arch: [esp32, esp32s3, esp32c3, esp32c6, nrf52840, rp2040, stm32]
|
||||||
- esp32
|
|
||||||
- esp32s3
|
|
||||||
- esp32c3
|
|
||||||
- esp32c6
|
|
||||||
- nrf52840
|
|
||||||
- rp2040
|
|
||||||
- rp2350
|
|
||||||
- stm32
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [version, build]
|
needs:
|
||||||
|
[
|
||||||
|
build-esp32,
|
||||||
|
build-esp32-s3,
|
||||||
|
build-esp32-c3,
|
||||||
|
build-esp32-c6,
|
||||||
|
build-nrf52,
|
||||||
|
build-rpi2040,
|
||||||
|
build-stm32,
|
||||||
|
]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
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@v5
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: ./
|
path: ./
|
||||||
pattern: firmware-${{matrix.arch}}-*
|
pattern: firmware-${{matrix.arch}}-*
|
||||||
@@ -177,13 +216,17 @@ jobs:
|
|||||||
- name: Display structure of downloaded files
|
- name: Display structure of downloaded files
|
||||||
run: ls -R
|
run: ls -R
|
||||||
|
|
||||||
|
- name: Get release version string
|
||||||
|
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
|
id: version
|
||||||
|
|
||||||
- name: Move files up
|
- name: Move files up
|
||||||
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@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
name: firmware-${{matrix.arch}}-${{ steps.version.outputs.long }}
|
||||||
overwrite: true
|
overwrite: true
|
||||||
path: |
|
path: |
|
||||||
./firmware-*.bin
|
./firmware-*.bin
|
||||||
@@ -193,13 +236,14 @@ jobs:
|
|||||||
./device-*.sh
|
./device-*.sh
|
||||||
./device-*.bat
|
./device-*.bat
|
||||||
./littlefs-*.bin
|
./littlefs-*.bin
|
||||||
|
./littlefswebui-*.bin
|
||||||
./bleota*bin
|
./bleota*bin
|
||||||
./Meshtastic_nRF52_factory_erase*.uf2
|
./Meshtastic_nRF52_factory_erase*.uf2
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
- uses: actions/download-artifact@v5
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
name: firmware-${{matrix.arch}}-${{ steps.version.outputs.long }}
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
path: ./output
|
path: ./output
|
||||||
|
|
||||||
@@ -213,12 +257,12 @@ jobs:
|
|||||||
chmod +x ./output/device-update.sh
|
chmod +x ./output/device-update.sh
|
||||||
|
|
||||||
- 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}}-${{ steps.version.outputs.long }}.zip ./output
|
||||||
|
|
||||||
- name: Repackage in single elfs zip
|
- name: Repackage in single elfs zip
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip
|
name: debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip
|
||||||
overwrite: true
|
overwrite: true
|
||||||
path: ./*.elf
|
path: ./*.elf
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
@@ -226,101 +270,105 @@ jobs:
|
|||||||
- uses: scruplelesswizard/comment-artifact@main
|
- uses: scruplelesswizard/comment-artifact@main
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
with:
|
with:
|
||||||
name: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
name: firmware-${{matrix.arch}}-${{ steps.version.outputs.long }}
|
||||||
description: "Download firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip. This artifact will be available for 90 days from creation"
|
description: "Download firmware-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip. This artifact will be available for 90 days from creation"
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
release-artifacts:
|
release-artifacts:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' && github.repository == 'meshtastic/firmware' }}
|
if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||||
outputs:
|
outputs:
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
needs:
|
needs: [gather-artifacts, build-debian-src]
|
||||||
- version
|
|
||||||
- gather-artifacts
|
|
||||||
- build-debian-src
|
|
||||||
- package-pio-deps-native-tft
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: 3.x
|
python-version: 3.x
|
||||||
|
|
||||||
|
- name: Get release version string
|
||||||
|
run: |
|
||||||
|
echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
|
echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT
|
||||||
|
id: version
|
||||||
|
env:
|
||||||
|
BUILD_LOCATION: local
|
||||||
|
|
||||||
- name: Create release
|
- name: Create release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
id: create_release
|
id: create_release
|
||||||
with:
|
with:
|
||||||
draft: true
|
draft: true
|
||||||
prerelease: true
|
prerelease: true
|
||||||
name: Meshtastic Firmware ${{ needs.version.outputs.long }} Alpha
|
name: Meshtastic Firmware ${{ steps.version.outputs.long }} Alpha
|
||||||
tag_name: v${{ needs.version.outputs.long }}
|
tag_name: v${{ steps.version.outputs.long }}
|
||||||
body: |
|
body: |
|
||||||
Autogenerated by github action, developer should edit as required before publishing...
|
Autogenerated by github action, developer should edit as required before publishing...
|
||||||
|
|
||||||
- name: Download source deb
|
- name: Download source deb
|
||||||
uses: actions/download-artifact@v5
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
pattern: firmware-debian-${{ needs.version.outputs.deb }}~UNRELEASED-src
|
pattern: firmware-debian-${{ steps.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: Zip source deb
|
||||||
uses: actions/download-artifact@v5
|
|
||||||
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
|
working-directory: output
|
||||||
run: |
|
run: zip -j -9 -r ./meshtasticd-${{ steps.version.outputs.deb }}-src.zip ./debian-src
|
||||||
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
|
# For diagnostics
|
||||||
- name: Display structure of downloaded files
|
- name: Display structure of downloaded files
|
||||||
run: ls -lR
|
run: ls -lR
|
||||||
|
|
||||||
- name: Add Linux sources to GtiHub Release
|
- name: Add source deb to release
|
||||||
# Only run when targeting master branch with workflow_dispatch
|
|
||||||
if: ${{ github.ref_name == 'master' }}
|
|
||||||
run: |
|
run: |
|
||||||
gh release upload v${{ needs.version.outputs.long }} ./output/meshtasticd-${{ needs.version.outputs.deb }}-src.zip
|
gh release upload v${{ steps.version.outputs.long }} ./output/meshtasticd-${{ steps.version.outputs.deb }}-src.zip
|
||||||
gh release upload v${{ needs.version.outputs.long }} ./output/platformio-deps-native-tft-${{ needs.version.outputs.long }}.zip
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Bump version.properties
|
||||||
|
run: >-
|
||||||
|
bin/bump_version.py
|
||||||
|
|
||||||
|
- name: Update debian changelog
|
||||||
|
run: >-
|
||||||
|
debian/ci_changelog.sh
|
||||||
|
|
||||||
|
- name: Create version.properties pull request
|
||||||
|
uses: peter-evans/create-pull-request@v7
|
||||||
|
with:
|
||||||
|
title: Bump version.properties
|
||||||
|
add-paths: |
|
||||||
|
version.properties
|
||||||
|
debian/changelog
|
||||||
|
|
||||||
release-firmware:
|
release-firmware:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
arch:
|
arch: [esp32, esp32s3, esp32c3, esp32c6, nrf52840, rp2040, stm32]
|
||||||
- esp32
|
|
||||||
- esp32s3
|
|
||||||
- esp32c3
|
|
||||||
- esp32c6
|
|
||||||
- nrf52840
|
|
||||||
- rp2040
|
|
||||||
- rp2350
|
|
||||||
- stm32
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' && github.repository == 'meshtastic/firmware'}}
|
if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||||
needs: [release-artifacts, version]
|
needs: [release-artifacts]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: 3.x
|
python-version: 3.x
|
||||||
|
|
||||||
- uses: actions/download-artifact@v5
|
- name: Get release version string
|
||||||
|
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
|
id: version
|
||||||
|
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
pattern: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
pattern: firmware-${{matrix.arch}}-${{ steps.version.outputs.long }}
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
path: ./output
|
path: ./output
|
||||||
|
|
||||||
@@ -333,65 +381,24 @@ jobs:
|
|||||||
chmod +x ./output/device-update.sh
|
chmod +x ./output/device-update.sh
|
||||||
|
|
||||||
- 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}}-${{ steps.version.outputs.long }}.zip ./output
|
||||||
|
|
||||||
- uses: actions/download-artifact@v5
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip
|
name: debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
path: ./elfs
|
path: ./elfs
|
||||||
|
|
||||||
- name: Zip debug elfs
|
- name: Zip debug elfs
|
||||||
run: zip -j -9 -r ./debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip ./elfs
|
run: zip -j -9 -r ./debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip ./elfs
|
||||||
|
|
||||||
# For diagnostics
|
# For diagnostics
|
||||||
- name: Display structure of downloaded files
|
- name: Display structure of downloaded files
|
||||||
run: ls -lR
|
run: ls -lR
|
||||||
|
|
||||||
- name: Add bins and debug elfs to GitHub Release
|
- name: Add bins and debug elfs to release
|
||||||
# Only run when targeting master branch with workflow_dispatch
|
|
||||||
if: ${{ github.ref_name == 'master' }}
|
|
||||||
run: |
|
run: |
|
||||||
gh release upload v${{ needs.version.outputs.long }} ./firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip
|
gh release upload v${{ steps.version.outputs.long }} ./firmware-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip
|
||||||
gh release upload v${{ needs.version.outputs.long }} ./debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip
|
gh release upload v${{ steps.version.outputs.long }} ./debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
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@v5
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v5
|
|
||||||
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
|
|
||||||
|
|||||||
376
.github/workflows/merge_queue.yml
vendored
376
.github/workflows/merge_queue.yml
vendored
@@ -1,376 +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@v5
|
|
||||||
- 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@v5
|
|
||||||
- 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@v5
|
|
||||||
- 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@v5
|
|
||||||
with:
|
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v5
|
|
||||||
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@v4
|
|
||||||
with:
|
|
||||||
name: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
|
||||||
overwrite: true
|
|
||||||
path: |
|
|
||||||
./firmware-*.bin
|
|
||||||
./firmware-*.uf2
|
|
||||||
./firmware-*.hex
|
|
||||||
./firmware-*-ota.zip
|
|
||||||
./device-*.sh
|
|
||||||
./device-*.bat
|
|
||||||
./littlefs-*.bin
|
|
||||||
./bleota*bin
|
|
||||||
./Meshtastic_nRF52_factory_erase*.uf2
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v5
|
|
||||||
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
|
|
||||||
chmod +x ./output/device-update.sh
|
|
||||||
|
|
||||||
- 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@v4
|
|
||||||
with:
|
|
||||||
name: debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip
|
|
||||||
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@v5
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
|
|
||||||
- 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@v5
|
|
||||||
with:
|
|
||||||
pattern: firmware-debian-${{ needs.version.outputs.deb }}~UNRELEASED-src
|
|
||||||
merge-multiple: true
|
|
||||||
path: ./output/debian-src
|
|
||||||
|
|
||||||
- name: Download `native-tft` pio deps
|
|
||||||
uses: actions/download-artifact@v5
|
|
||||||
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@v5
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v5
|
|
||||||
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
|
|
||||||
chmod +x ./output/device-update.sh
|
|
||||||
|
|
||||||
- name: Zip firmware
|
|
||||||
run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip ./output
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v5
|
|
||||||
with:
|
|
||||||
name: debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip
|
|
||||||
merge-multiple: true
|
|
||||||
path: ./elfs
|
|
||||||
|
|
||||||
- name: Zip debug elfs
|
|
||||||
run: zip -j -9 -r ./debug-elfs-${{matrix.arch}}-${{ 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@v5
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v5
|
|
||||||
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
|
|
||||||
28
.github/workflows/nightly.yml
vendored
28
.github/workflows/nightly.yml
vendored
@@ -4,36 +4,16 @@ on:
|
|||||||
- cron: 0 8 * * 1-5
|
- cron: 0 8 * * 1-5
|
||||||
workflow_dispatch: {}
|
workflow_dispatch: {}
|
||||||
|
|
||||||
permissions: read-all
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
trunk_check:
|
trunk_check:
|
||||||
if: github.repository == 'meshtastic/firmware'
|
name: Trunk Check Upload
|
||||||
name: Trunk Check and Upload
|
runs-on: ubuntu-latest
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Trunk Check
|
- name: Trunk Check
|
||||||
uses: trunk-io/trunk-action@v1
|
uses: trunk-io/trunk-action@782e83f803ca6e369f035d64c6ba2768174ba61b
|
||||||
with:
|
with:
|
||||||
trunk-token: ${{ secrets.TRUNK_TOKEN }}
|
trunk-token: ${{ secrets.TRUNK_TOKEN }}
|
||||||
|
|
||||||
trunk_upgrade:
|
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
# See: https://github.com/trunk-io/trunk-action/blob/v1/readme.md#automatic-upgrades
|
|
||||||
name: Trunk Upgrade (PR)
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
permissions:
|
|
||||||
contents: write # For trunk to create PRs
|
|
||||||
pull-requests: write # For trunk to create PRs
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Trunk Upgrade
|
|
||||||
uses: trunk-io/trunk-action/upgrade@v1
|
|
||||||
with:
|
|
||||||
base: master
|
|
||||||
|
|||||||
4
.github/workflows/package_obs.yml
vendored
4
.github/workflows/package_obs.yml
vendored
@@ -34,7 +34,7 @@ jobs:
|
|||||||
needs: build-debian-src
|
needs: build-debian-src
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
path: meshtasticd
|
path: meshtasticd
|
||||||
@@ -58,7 +58,7 @@ jobs:
|
|||||||
id: version
|
id: version
|
||||||
|
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v5
|
uses: actions/download-artifact@v4
|
||||||
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
|
||||||
|
|||||||
65
.github/workflows/package_pio_deps.yml
vendored
65
.github/workflows/package_pio_deps.yml
vendored
@@ -1,65 +0,0 @@
|
|||||||
name: Package PlatformIO Library Dependencies
|
|
||||||
# trunk-ignore-all(checkov/CKV_GHA_7): Allow workflow_dispatch inputs for testing
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
pio_env:
|
|
||||||
description: PlatformIO environment to target
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
pio_env:
|
|
||||||
description: PlatformIO environment to target
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
pkg-pio-libdeps:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
|
|
||||||
- name: Install deps
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
pip install platformio
|
|
||||||
|
|
||||||
- name: Get release version string
|
|
||||||
run: |
|
|
||||||
echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
|
||||||
id: version
|
|
||||||
|
|
||||||
- name: Fetch libdeps
|
|
||||||
shell: bash
|
|
||||||
run: |-
|
|
||||||
platformio pkg install -e ${{ inputs.pio_env }}
|
|
||||||
platformio pkg install -e ${{ inputs.pio_env }} -t platformio/tool-scons@4.40502.0
|
|
||||||
env:
|
|
||||||
PLATFORMIO_LIBDEPS_DIR: pio/libdeps
|
|
||||||
PLATFORMIO_PACKAGES_DIR: pio/packages
|
|
||||||
PLATFORMIO_CORE_DIR: pio/core
|
|
||||||
|
|
||||||
- name: Store binaries as an artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: platformio-deps-${{ inputs.pio_env }}-${{ steps.version.outputs.long }}
|
|
||||||
overwrite: true
|
|
||||||
include-hidden-files: true
|
|
||||||
path: |
|
|
||||||
pio/*
|
|
||||||
4
.github/workflows/package_ppa.yml
vendored
4
.github/workflows/package_ppa.yml
vendored
@@ -32,7 +32,7 @@ jobs:
|
|||||||
needs: build-debian-src
|
needs: build-debian-src
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
path: meshtasticd
|
path: meshtasticd
|
||||||
@@ -60,7 +60,7 @@ jobs:
|
|||||||
id: version
|
id: version
|
||||||
|
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v5
|
uses: actions/download-artifact@v4
|
||||||
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
|
||||||
|
|||||||
24
.github/workflows/pr_enforce_labels.yml
vendored
24
.github/workflows/pr_enforce_labels.yml
vendored
@@ -1,24 +0,0 @@
|
|||||||
name: Check PR Labels
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types: [opened, edited, labeled, unlabeled, synchronize, reopened]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
pull-requests: read
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
check-label:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Check for PR labels
|
|
||||||
uses: actions/github-script@v8
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const labels = context.payload.pull_request.labels.map(label => label.name);
|
|
||||||
const requiredLabels = ['bugfix', 'enhancement', 'hardware-support', 'dependencies', 'submodules', 'github_actions', 'trunk'];
|
|
||||||
const hasRequiredLabel = labels.some(label => requiredLabels.includes(label));
|
|
||||||
if (!hasRequiredLabel) {
|
|
||||||
core.setFailed(`PR must have at least one of the following labels before it can be merged: ${requiredLabels.join(', ')}.`);
|
|
||||||
}
|
|
||||||
238
.github/workflows/pr_tests.yml
vendored
238
.github/workflows/pr_tests.yml
vendored
@@ -1,238 +0,0 @@
|
|||||||
name: Tests
|
|
||||||
|
|
||||||
# DISABLED: Changed from automatic PR triggers to manual only
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
reason:
|
|
||||||
description: "Reason for manual test run"
|
|
||||||
required: false
|
|
||||||
default: "Manual test execution"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: tests-${{ github.head_ref || github.run_id }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
actions: read
|
|
||||||
checks: write
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
native-tests:
|
|
||||||
name: "🧪 Native Tests"
|
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
uses: ./.github/workflows/test_native.yml
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
actions: read
|
|
||||||
checks: write
|
|
||||||
|
|
||||||
test-summary:
|
|
||||||
name: "📊 Test Results"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [native-tests]
|
|
||||||
if: always()
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
actions: read
|
|
||||||
checks: write
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Get release version string
|
|
||||||
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
|
||||||
id: version
|
|
||||||
|
|
||||||
- name: Download test artifacts
|
|
||||||
if: needs.native-tests.result != 'skipped'
|
|
||||||
uses: actions/download-artifact@v5
|
|
||||||
with:
|
|
||||||
name: platformio-test-report-${{ steps.version.outputs.long }}.zip
|
|
||||||
merge-multiple: true
|
|
||||||
|
|
||||||
- name: Parse test results and create detailed summary
|
|
||||||
id: test-results
|
|
||||||
run: |
|
|
||||||
echo "## 🧪 Test Results Summary" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
# Check overall job status first
|
|
||||||
if [[ "${{ needs.native-tests.result }}" == "success" ]]; then
|
|
||||||
echo "✅ **Overall Status**: PASSED" >> $GITHUB_STEP_SUMMARY
|
|
||||||
elif [[ "${{ needs.native-tests.result }}" == "failure" ]]; then
|
|
||||||
echo "❌ **Overall Status**: FAILED" >> $GITHUB_STEP_SUMMARY
|
|
||||||
elif [[ "${{ needs.native-tests.result }}" == "cancelled" ]]; then
|
|
||||||
echo "⏸️ **Overall Status**: CANCELLED" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "Tests were cancelled before completion." >> $GITHUB_STEP_SUMMARY
|
|
||||||
exit 0
|
|
||||||
else
|
|
||||||
echo "⚠️ **Overall Status**: SKIPPED" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "Tests were skipped." >> $GITHUB_STEP_SUMMARY
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
# Parse detailed test results if available
|
|
||||||
if [ -f "testreport.xml" ]; then
|
|
||||||
echo "### 🔍 Individual Test Results" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
python3 << 'EOF'
|
|
||||||
import xml.etree.ElementTree as ET
|
|
||||||
import os
|
|
||||||
|
|
||||||
try:
|
|
||||||
tree = ET.parse('testreport.xml')
|
|
||||||
root = tree.getroot()
|
|
||||||
|
|
||||||
total_tests = 0
|
|
||||||
passed_tests = 0
|
|
||||||
failed_tests = 0
|
|
||||||
skipped_tests = 0
|
|
||||||
|
|
||||||
# Parse testsuite elements
|
|
||||||
for testsuite in root.findall('.//testsuite'):
|
|
||||||
suite_name = testsuite.get('name', 'Unknown')
|
|
||||||
suite_tests = int(testsuite.get('tests', '0'))
|
|
||||||
suite_failures = int(testsuite.get('failures', '0'))
|
|
||||||
suite_errors = int(testsuite.get('errors', '0'))
|
|
||||||
suite_skipped = int(testsuite.get('skipped', '0'))
|
|
||||||
|
|
||||||
total_tests += suite_tests
|
|
||||||
failed_tests += suite_failures + suite_errors
|
|
||||||
skipped_tests += suite_skipped
|
|
||||||
passed_tests += suite_tests - suite_failures - suite_errors - suite_skipped
|
|
||||||
|
|
||||||
if suite_tests > 0:
|
|
||||||
status = "✅" if (suite_failures + suite_errors) == 0 else "❌"
|
|
||||||
print(f"**{status} Test Suite: {suite_name}**")
|
|
||||||
print(f"- Total: {suite_tests}")
|
|
||||||
print(f"- Passed: ✅ {suite_tests - suite_failures - suite_errors - suite_skipped}")
|
|
||||||
print(f"- Failed: ❌ {suite_failures + suite_errors}")
|
|
||||||
if suite_skipped > 0:
|
|
||||||
print(f"- Skipped: ⏭️ {suite_skipped}")
|
|
||||||
print("")
|
|
||||||
|
|
||||||
# Show individual test results for failed suites
|
|
||||||
if suite_failures + suite_errors > 0:
|
|
||||||
print("**Failed Tests:**")
|
|
||||||
for testcase in testsuite.findall('testcase'):
|
|
||||||
test_name = testcase.get('name', 'Unknown')
|
|
||||||
failure = testcase.find('failure')
|
|
||||||
error = testcase.find('error')
|
|
||||||
|
|
||||||
if failure is not None:
|
|
||||||
msg = failure.get('message', 'Unknown error')[:100]
|
|
||||||
print(f"- ❌ `{test_name}`: {msg}")
|
|
||||||
elif error is not None:
|
|
||||||
msg = error.get('message', 'Unknown error')[:100]
|
|
||||||
print(f"- ❌ `{test_name}`: ERROR - {msg}")
|
|
||||||
print("")
|
|
||||||
else:
|
|
||||||
# Show passed tests for successful suites
|
|
||||||
passed_count = 0
|
|
||||||
for testcase in testsuite.findall('testcase'):
|
|
||||||
if testcase.find('failure') is None and testcase.find('error') is None:
|
|
||||||
if passed_count < 5: # Limit to first 5 to avoid spam
|
|
||||||
test_name = testcase.get('name', 'Unknown')
|
|
||||||
print(f"- ✅ `{test_name}`: PASSED")
|
|
||||||
passed_count += 1
|
|
||||||
if passed_count > 5:
|
|
||||||
print(f"- ... and {passed_count - 5} more tests passed")
|
|
||||||
print("")
|
|
||||||
|
|
||||||
# Summary statistics
|
|
||||||
print("### 📊 Test Statistics")
|
|
||||||
print(f"- **Total Tests**: {total_tests}")
|
|
||||||
print(f"- **Passed**: ✅ {passed_tests}")
|
|
||||||
print(f"- **Failed**: ❌ {failed_tests}")
|
|
||||||
if skipped_tests > 0:
|
|
||||||
print(f"- **Skipped**: ⏭️ {skipped_tests}")
|
|
||||||
|
|
||||||
if failed_tests > 0:
|
|
||||||
print(f"\n❌ **{failed_tests} tests failed out of {total_tests} total**")
|
|
||||||
else:
|
|
||||||
print(f"\n✅ **All {total_tests} tests passed!**")
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
print(f"❌ Error parsing test results: {e}")
|
|
||||||
EOF
|
|
||||||
else
|
|
||||||
echo "⚠️ **No detailed test report available**" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "Test artifacts may not have been generated properly." >> $GITHUB_STEP_SUMMARY
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "---" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "View detailed logs in the [Actions tab](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
- name: Comment test results on PR
|
|
||||||
if: github.event_name == 'pull_request' && needs.native-tests.result != 'skipped'
|
|
||||||
uses: actions/github-script@v8
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const fs = require('fs');
|
|
||||||
|
|
||||||
// Read the step summary to use as PR comment
|
|
||||||
let testSummary = "## 🧪 Test Results Summary\n\n";
|
|
||||||
|
|
||||||
if ("${{ needs.native-tests.result }}" === "success") {
|
|
||||||
testSummary += "✅ **All tests passed!**\n\n";
|
|
||||||
} else if ("${{ needs.native-tests.result }}" === "failure") {
|
|
||||||
testSummary += "❌ **Some tests failed.**\n\n";
|
|
||||||
} else {
|
|
||||||
testSummary += "⚠️ **Tests did not complete normally.**\n\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
testSummary += `View detailed results: [Actions Run](${context.payload.repository.html_url}/actions/runs/${context.runId})\n\n`;
|
|
||||||
testSummary += "---\n";
|
|
||||||
testSummary += "*This comment will be automatically updated when new commits are pushed.*";
|
|
||||||
|
|
||||||
// Find existing comment
|
|
||||||
const comments = await github.rest.issues.listComments({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
issue_number: context.issue.number
|
|
||||||
});
|
|
||||||
|
|
||||||
const botComment = comments.data.find(comment =>
|
|
||||||
comment.user.type === 'Bot' &&
|
|
||||||
comment.body.includes('🧪 Test Results Summary')
|
|
||||||
);
|
|
||||||
|
|
||||||
if (botComment) {
|
|
||||||
// Update existing comment
|
|
||||||
await github.rest.issues.updateComment({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
comment_id: botComment.id,
|
|
||||||
body: testSummary
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// Create new comment
|
|
||||||
await github.rest.issues.createComment({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
issue_number: context.issue.number,
|
|
||||||
body: testSummary
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
- name: Set overall status
|
|
||||||
run: |
|
|
||||||
if [[ "${{ needs.native-tests.result }}" == "success" ]]; then
|
|
||||||
echo "All tests passed! ✅"
|
|
||||||
exit 0
|
|
||||||
else
|
|
||||||
echo "Some tests failed! ❌"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
69
.github/workflows/release_channels.yml
vendored
69
.github/workflows/release_channels.yml
vendored
@@ -20,11 +20,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
series:
|
series: [plucky, oracular, noble, jammy]
|
||||||
- jammy # 22.04 LTS
|
|
||||||
- noble # 24.04 LTS
|
|
||||||
- plucky # 25.04
|
|
||||||
- questing # 25.10
|
|
||||||
uses: ./.github/workflows/package_ppa.yml
|
uses: ./.github/workflows/package_ppa.yml
|
||||||
with:
|
with:
|
||||||
ppa_repo: |-
|
ppa_repo: |-
|
||||||
@@ -47,66 +43,3 @@ jobs:
|
|||||||
copr_project: |-
|
copr_project: |-
|
||||||
${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }}
|
${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
# Create a PR to bump version when a release is Published
|
|
||||||
bump-version:
|
|
||||||
if: github.event.action == 'published'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
contents: write
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
|
|
||||||
- name: Bump version.properties
|
|
||||||
run: |
|
|
||||||
# Bump version.properties
|
|
||||||
chmod +x ./bin/bump_version.py
|
|
||||||
./bin/bump_version.py
|
|
||||||
|
|
||||||
- name: Get new release version string
|
|
||||||
run: |
|
|
||||||
echo "short=$(./bin/buildinfo.py short)" >> $GITHUB_OUTPUT
|
|
||||||
id: new_version
|
|
||||||
|
|
||||||
- name: Ensure debian deps are installed
|
|
||||||
run: |
|
|
||||||
sudo apt-get update -y --fix-missing
|
|
||||||
sudo apt-get install -y devscripts
|
|
||||||
|
|
||||||
- name: Update debian changelog
|
|
||||||
run: |
|
|
||||||
# Update debian changelog
|
|
||||||
chmod +x ./debian/ci_changelog.sh
|
|
||||||
./debian/ci_changelog.sh
|
|
||||||
|
|
||||||
- name: Bump org.meshtastic.meshtasticd.metainfo.xml
|
|
||||||
run: |
|
|
||||||
# Bump org.meshtastic.meshtasticd.metainfo.xml
|
|
||||||
pip install -r bin/bump_metainfo/requirements.txt -q
|
|
||||||
chmod +x ./bin/bump_metainfo/bump_metainfo.py
|
|
||||||
./bin/bump_metainfo/bump_metainfo.py --file bin/org.meshtastic.meshtasticd.metainfo.xml "${{ steps.new_version.outputs.short }}"
|
|
||||||
env:
|
|
||||||
PIP_DISABLE_PIP_VERSION_CHECK: 1
|
|
||||||
|
|
||||||
- name: Create Bumps pull request
|
|
||||||
uses: peter-evans/create-pull-request@v7
|
|
||||||
with:
|
|
||||||
base: ${{ github.event.repository.default_branch }}
|
|
||||||
branch: create-pull-request/bump-version
|
|
||||||
labels: github_actions
|
|
||||||
title: Bump release version
|
|
||||||
commit-message: Automated version bumps
|
|
||||||
add-paths: |
|
|
||||||
version.properties
|
|
||||||
debian/changelog
|
|
||||||
bin/org.meshtastic.meshtasticd.metainfo.xml
|
|
||||||
|
|||||||
41
.github/workflows/sec_sast_flawfinder.yml
vendored
Normal file
41
.github/workflows/sec_sast_flawfinder.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
---
|
||||||
|
name: Flawfinder Scan
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master, develop]
|
||||||
|
paths-ignore:
|
||||||
|
- "**.md"
|
||||||
|
- "version.properties"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
flawfinder:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Flawfinder
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# step 1
|
||||||
|
- name: clone application source code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# step 2
|
||||||
|
- name: flawfinder_scan
|
||||||
|
uses: david-a-wheeler/flawfinder@2.0.19
|
||||||
|
with:
|
||||||
|
arguments: "--sarif ./"
|
||||||
|
output: "flawfinder_report.sarif"
|
||||||
|
|
||||||
|
# step 3
|
||||||
|
- name: save report as pipeline artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: flawfinder_report.sarif
|
||||||
|
overwrite: true
|
||||||
|
path: flawfinder_report.sarif
|
||||||
|
|
||||||
|
# step 4
|
||||||
|
- name: publish code scanning alerts
|
||||||
|
uses: github/codeql-action/upload-sarif@v3
|
||||||
|
with:
|
||||||
|
sarif_file: flawfinder_report.sarif
|
||||||
|
category: flawfinder
|
||||||
16
.github/workflows/sec_sast_semgrep_cron.yml
vendored
16
.github/workflows/sec_sast_semgrep_cron.yml
vendored
@@ -3,25 +3,21 @@ name: Semgrep Full Scan
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
schedule:
|
schedule:
|
||||||
- cron: 0 1 * * 6
|
- cron: "0 1 * * 6"
|
||||||
|
|
||||||
permissions:
|
|
||||||
actions: read
|
|
||||||
contents: read
|
|
||||||
security-events: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
semgrep-full:
|
semgrep-full:
|
||||||
if: github.repository == 'meshtastic/firmware'
|
runs-on: ubuntu-latest
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
container:
|
container:
|
||||||
image: semgrep/semgrep
|
image: semgrep/semgrep
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# step 1
|
# step 1
|
||||||
- name: clone application source code
|
- name: clone application source code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# step 2
|
# step 2
|
||||||
- name: full scan
|
- name: full scan
|
||||||
@@ -41,7 +37,7 @@ jobs:
|
|||||||
|
|
||||||
# step 4
|
# step 4
|
||||||
- name: publish code scanning alerts
|
- name: publish code scanning alerts
|
||||||
uses: github/codeql-action/upload-sarif@v4
|
uses: github/codeql-action/upload-sarif@v3
|
||||||
with:
|
with:
|
||||||
sarif_file: report.sarif
|
sarif_file: report.sarif
|
||||||
category: semgrep
|
category: semgrep
|
||||||
|
|||||||
6
.github/workflows/sec_sast_semgrep_pull.yml
vendored
6
.github/workflows/sec_sast_semgrep_pull.yml
vendored
@@ -2,18 +2,16 @@
|
|||||||
name: Semgrep Differential Scan
|
name: Semgrep Differential Scan
|
||||||
on: pull_request
|
on: pull_request
|
||||||
|
|
||||||
permissions: read-all
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
semgrep-diff:
|
semgrep-diff:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
image: semgrep/semgrep
|
image: semgrep/semgrep
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# step 1
|
# step 1
|
||||||
- name: clone application source code
|
- name: clone application source code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
|||||||
4
.github/workflows/stale_bot.yml
vendored
4
.github/workflows/stale_bot.yml
vendored
@@ -11,14 +11,12 @@ permissions:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
stale_issues:
|
stale_issues:
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
name: Close Stale Issues
|
name: Close Stale Issues
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Stale PR+Issues
|
- name: Stale PR+Issues
|
||||||
uses: actions/stale@v10.1.0
|
uses: actions/stale@v9.0.0
|
||||||
with:
|
with:
|
||||||
days-before-stale: 45
|
|
||||||
exempt-issue-labels: pinned,3.0
|
exempt-issue-labels: pinned,3.0
|
||||||
exempt-pr-labels: pinned,3.0
|
exempt-pr-labels: pinned,3.0
|
||||||
|
|||||||
14
.github/workflows/test_native.yml
vendored
14
.github/workflows/test_native.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
|||||||
name: Native Simulator Tests
|
name: Native Simulator Tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
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}}
|
||||||
@@ -40,7 +40,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Integration test
|
- name: Integration test
|
||||||
run: |
|
run: |
|
||||||
.pio/build/coverage/program -s &
|
.pio/build/coverage/program &
|
||||||
PID=$!
|
PID=$!
|
||||||
timeout 20 bash -c "until ls -al /proc/$PID/fd | grep socket; do sleep 1; done"
|
timeout 20 bash -c "until ls -al /proc/$PID/fd | grep socket; do sleep 1; done"
|
||||||
echo "Simulator started, launching python test..."
|
echo "Simulator started, launching python test..."
|
||||||
@@ -70,7 +70,7 @@ jobs:
|
|||||||
name: Native PlatformIO Tests
|
name: Native PlatformIO Tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
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}}
|
||||||
@@ -127,7 +127,7 @@ jobs:
|
|||||||
- platformio-tests
|
- platformio-tests
|
||||||
if: always()
|
if: always()
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
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}}
|
||||||
@@ -137,20 +137,20 @@ jobs:
|
|||||||
id: version
|
id: version
|
||||||
|
|
||||||
- name: Download test artifacts
|
- name: Download test artifacts
|
||||||
uses: actions/download-artifact@v5
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: platformio-test-report-${{ steps.version.outputs.long }}.zip
|
name: platformio-test-report-${{ steps.version.outputs.long }}.zip
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|
||||||
- name: Test Report
|
- name: Test Report
|
||||||
uses: dorny/test-reporter@v2.1.1
|
uses: dorny/test-reporter@v1.9.1
|
||||||
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@v5
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
pattern: lcov-coverage-info-native-*-${{ steps.version.outputs.long }}.zip
|
pattern: lcov-coverage-info-native-*-${{ steps.version.outputs.long }}.zip
|
||||||
path: code-coverage-report
|
path: code-coverage-report
|
||||||
|
|||||||
15
.github/workflows/tests.yml
vendored
15
.github/workflows/tests.yml
vendored
@@ -2,25 +2,18 @@ name: End to end tests
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: 0 0 * * * # Run every day at midnight
|
- cron: "0 0 * * *" # Run every day at midnight
|
||||||
workflow_dispatch: {}
|
workflow_dispatch: {}
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
actions: read
|
|
||||||
checks: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
native-tests:
|
native-tests:
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
uses: ./.github/workflows/test_native.yml
|
uses: ./.github/workflows/test_native.yml
|
||||||
|
|
||||||
hardware-tests:
|
hardware-tests:
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
runs-on: test-runner
|
runs-on: test-runner
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# - uses: actions/setup-python@v5
|
# - uses: actions/setup-python@v5
|
||||||
# with:
|
# with:
|
||||||
@@ -47,9 +40,9 @@ jobs:
|
|||||||
pio upgrade
|
pio upgrade
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v5
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 18
|
||||||
|
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
|
|||||||
@@ -9,16 +9,14 @@ permissions: read-all
|
|||||||
jobs:
|
jobs:
|
||||||
trunk_check:
|
trunk_check:
|
||||||
name: Trunk Check Runner
|
name: Trunk Check Runner
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
checks: write # For trunk to post annotations
|
checks: write # For trunk to post annotations
|
||||||
contents: read # For repo checkout
|
contents: read # For repo checkout
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Trunk Check
|
- name: Trunk Check
|
||||||
uses: trunk-io/trunk-action@v1
|
uses: trunk-io/trunk-action@v1
|
||||||
with:
|
|
||||||
save-annotations: true
|
|
||||||
26
.github/workflows/trunk_annotate_pr.yml
vendored
26
.github/workflows/trunk_annotate_pr.yml
vendored
@@ -1,26 +0,0 @@
|
|||||||
name: Annotate PR with trunk issues
|
|
||||||
# See: https://github.com/trunk-io/trunk-action/blob/v1/readme.md#getting-inline-annotations-for-fork-prs
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_run:
|
|
||||||
workflows: [Pull Request] # Name from `trunk_check.yml`
|
|
||||||
types: [completed]
|
|
||||||
|
|
||||||
permissions: read-all
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
trunk_check:
|
|
||||||
name: Trunk Code Quality Annotate
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
permissions:
|
|
||||||
checks: write # For trunk to post annotations
|
|
||||||
contents: read # For repo checkout
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Trunk Check
|
|
||||||
uses: trunk-io/trunk-action@v1
|
|
||||||
with:
|
|
||||||
post-annotations: true
|
|
||||||
10
.github/workflows/trunk_format_pr.yml
vendored
10
.github/workflows/trunk_format_pr.yml
vendored
@@ -4,18 +4,14 @@ on:
|
|||||||
issue_comment:
|
issue_comment:
|
||||||
types: [created]
|
types: [created]
|
||||||
|
|
||||||
permissions: read-all
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
trunk-fmt:
|
trunk-fmt:
|
||||||
if: github.event.issue.pull_request != null && contains(github.event.comment.body, 'trunk fmt')
|
if: github.event.issue.pull_request != null && contains(github.event.comment.body, 'trunk fmt')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
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}}
|
||||||
@@ -39,7 +35,7 @@ jobs:
|
|||||||
git push
|
git push
|
||||||
|
|
||||||
- name: Comment on PR
|
- name: Comment on PR
|
||||||
uses: actions/github-script@v8
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
script: |
|
script: |
|
||||||
|
|||||||
11
.github/workflows/update_protobufs.yml
vendored
11
.github/workflows/update_protobufs.yml
vendored
@@ -1,17 +1,13 @@
|
|||||||
name: Update protobufs and regenerate classes
|
name: Update protobufs and regenerate classes
|
||||||
on: workflow_dispatch
|
on: workflow_dispatch
|
||||||
|
|
||||||
permissions: read-all
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update-protobufs:
|
update-protobufs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
@@ -33,10 +29,7 @@ jobs:
|
|||||||
- name: Create pull request
|
- name: Create pull request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v7
|
||||||
with:
|
with:
|
||||||
branch: create-pull-request/update-protobufs
|
|
||||||
labels: submodules
|
|
||||||
title: Update protobufs and classes
|
title: Update protobufs and classes
|
||||||
commit-message: Update protobufs
|
|
||||||
add-paths: |
|
add-paths: |
|
||||||
protobufs
|
protobufs
|
||||||
src/mesh
|
src/mesh
|
||||||
|
|||||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -37,7 +37,4 @@ release/
|
|||||||
.vscode/extensions.json
|
.vscode/extensions.json
|
||||||
/compile_commands.json
|
/compile_commands.json
|
||||||
src/mesh/raspihttp/certificate.pem
|
src/mesh/raspihttp/certificate.pem
|
||||||
src/mesh/raspihttp/private_key.pem
|
src/mesh/raspihttp/private_key.pem
|
||||||
|
|
||||||
# Ignore logo (set at build time with platformio-custom.py)
|
|
||||||
data/boot/logo.*
|
|
||||||
@@ -8,4 +8,3 @@ line_length: false
|
|||||||
spaces: false
|
spaces: false
|
||||||
url: false
|
url: false
|
||||||
whitespace: false
|
whitespace: false
|
||||||
headings: false
|
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
renovate.json
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"overrides": [
|
|
||||||
{
|
|
||||||
"files": "userPrefs.jsonc",
|
|
||||||
"options": {
|
|
||||||
"trailingComma": "none"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,35 +1,37 @@
|
|||||||
version: 0.1
|
version: 0.1
|
||||||
cli:
|
cli:
|
||||||
version: 1.25.0
|
version: 1.22.8
|
||||||
plugins:
|
plugins:
|
||||||
sources:
|
sources:
|
||||||
- id: trunk
|
- id: trunk
|
||||||
ref: v1.7.3
|
ref: v1.6.6
|
||||||
uri: https://github.com/trunk-io/plugins
|
uri: https://github.com/trunk-io/plugins
|
||||||
lint:
|
lint:
|
||||||
enabled:
|
enabled:
|
||||||
- checkov@3.2.477
|
- prettier@3.4.2
|
||||||
- renovate@41.144.1
|
- trufflehog@3.86.1
|
||||||
- prettier@3.6.2
|
- yamllint@1.35.1
|
||||||
- trufflehog@3.90.8
|
- bandit@1.8.0
|
||||||
- yamllint@1.37.1
|
- checkov@3.2.334
|
||||||
- bandit@1.8.6
|
- terrascan@1.19.9
|
||||||
- trivy@0.67.1
|
- trivy@0.58.0
|
||||||
- taplo@0.10.0
|
#- trufflehog@3.63.2-rc0
|
||||||
- ruff@0.14.0
|
- taplo@0.9.3
|
||||||
- isort@6.1.0
|
- ruff@0.8.3
|
||||||
- markdownlint@0.45.0
|
- isort@5.13.2
|
||||||
- oxipng@9.1.5
|
- markdownlint@0.43.0
|
||||||
- svgo@4.0.0
|
- oxipng@9.1.3
|
||||||
- actionlint@1.7.7
|
- svgo@3.3.2
|
||||||
- flake8@7.3.0
|
- actionlint@1.7.4
|
||||||
- hadolint@2.14.0
|
- flake8@7.1.1
|
||||||
|
- hadolint@2.12.1-beta
|
||||||
- shfmt@3.6.0
|
- shfmt@3.6.0
|
||||||
- shellcheck@0.11.0
|
- shellcheck@0.10.0
|
||||||
- black@25.9.0
|
- black@24.10.0
|
||||||
- git-diff-check
|
- git-diff-check
|
||||||
- gitleaks@8.28.0
|
- gitleaks@8.21.2
|
||||||
- clang-format@16.0.3
|
- clang-format@16.0.3
|
||||||
|
#- prettier@3.3.3
|
||||||
ignore:
|
ignore:
|
||||||
- linters: [ALL]
|
- linters: [ALL]
|
||||||
paths:
|
paths:
|
||||||
@@ -38,7 +40,7 @@ runtimes:
|
|||||||
enabled:
|
enabled:
|
||||||
- python@3.10.8
|
- python@3.10.8
|
||||||
- go@1.21.0
|
- go@1.21.0
|
||||||
- node@22.16.0
|
- node@18.20.5
|
||||||
actions:
|
actions:
|
||||||
disabled:
|
disabled:
|
||||||
- trunk-announce
|
- trunk-announce
|
||||||
|
|||||||
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -7,8 +7,5 @@
|
|||||||
"cmake.configureOnOpen": false,
|
"cmake.configureOnOpen": false,
|
||||||
"[cpp]": {
|
"[cpp]": {
|
||||||
"editor.defaultFormatter": "trunk.io"
|
"editor.defaultFormatter": "trunk.io"
|
||||||
},
|
|
||||||
"[powershell]": {
|
|
||||||
"editor.defaultFormatter": "ms-vscode.powershell"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
55
Dockerfile
55
Dockerfile
@@ -1,67 +1,48 @@
|
|||||||
|
# trunk-ignore-all(terrascan/AC_DOCKER_0002): Known terrascan issue
|
||||||
|
# trunk-ignore-all(hadolint/DL3008): Use latest version of apt packages for buildchain
|
||||||
# trunk-ignore-all(trivy/DS002): We must run as root for this container
|
# trunk-ignore-all(trivy/DS002): We must run as root for this container
|
||||||
|
# trunk-ignore-all(checkov/CKV_DOCKER_8): We must run as root for this container
|
||||||
# trunk-ignore-all(hadolint/DL3002): We must run as root for this container
|
# trunk-ignore-all(hadolint/DL3002): We must run as root for this container
|
||||||
# trunk-ignore-all(hadolint/DL3008): Do not pin apt package versions
|
|
||||||
# trunk-ignore-all(hadolint/DL3013): Do not pin pip package versions
|
|
||||||
|
|
||||||
FROM python:3.14-slim-trixie AS builder
|
FROM python:3.12-bookworm AS builder
|
||||||
ARG PIO_ENV=native
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
ENV TZ=Etc/UTC
|
ENV TZ=Etc/UTC
|
||||||
|
|
||||||
# Install Dependencies
|
# Install Dependencies
|
||||||
ENV PIP_ROOT_USER_ACTION=ignore
|
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 wget g++ zip git ca-certificates \
|
||||||
curl wget g++ zip git ca-certificates pkg-config \
|
libgpiod-dev libyaml-cpp-dev libbluetooth-dev libi2c-dev \
|
||||||
libgpiod-dev libyaml-cpp-dev libbluetooth-dev libi2c-dev libuv1-dev \
|
libusb-1.0-0-dev libulfius-dev liborcania-dev libssl-dev pkg-config && \
|
||||||
libusb-1.0-0-dev libulfius-dev liborcania-dev libssl-dev \
|
apt-get clean && rm -rf /var/lib/apt/lists/* && \
|
||||||
libx11-dev libinput-dev libxkbcommon-x11-dev \
|
pip install --no-cache-dir -U platformio==6.1.16 && \
|
||||||
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
|
mkdir /tmp/firmware
|
||||||
&& pip install --no-cache-dir -U platformio \
|
|
||||||
&& mkdir /tmp/firmware
|
|
||||||
|
|
||||||
# Copy source code
|
# Copy source code
|
||||||
WORKDIR /tmp/firmware
|
WORKDIR /tmp/firmware
|
||||||
COPY . /tmp/firmware
|
COPY . /tmp/firmware
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
RUN bash ./bin/build-native.sh "$PIO_ENV" && \
|
RUN bash ./bin/build-native.sh && \
|
||||||
cp "/tmp/firmware/release/meshtasticd_linux_$(uname -m)" "/tmp/firmware/release/meshtasticd"
|
cp "/tmp/firmware/release/meshtasticd_linux_$(uname -m)" "/tmp/firmware/release/meshtasticd"
|
||||||
|
|
||||||
# Fetch web assets
|
|
||||||
RUN curl -L "https://github.com/meshtastic/web/releases/download/v$(cat /tmp/firmware/bin/web.version)/build.tar" -o /tmp/web.tar \
|
|
||||||
&& mkdir -p /tmp/web \
|
|
||||||
&& tar -xf /tmp/web.tar -C /tmp/web/ \
|
|
||||||
&& gzip -dr /tmp/web \
|
|
||||||
&& rm /tmp/web.tar
|
|
||||||
|
|
||||||
##### PRODUCTION BUILD #############
|
##### PRODUCTION BUILD #############
|
||||||
|
|
||||||
FROM debian:trixie-slim
|
FROM debian:bookworm-slim
|
||||||
LABEL org.opencontainers.image.title="Meshtastic" \
|
|
||||||
org.opencontainers.image.description="Debian Meshtastic daemon and web interface" \
|
|
||||||
org.opencontainers.image.url="https://meshtastic.org" \
|
|
||||||
org.opencontainers.image.documentation="https://meshtastic.org/docs/" \
|
|
||||||
org.opencontainers.image.authors="Meshtastic" \
|
|
||||||
org.opencontainers.image.licenses="GPL-3.0-or-later" \
|
|
||||||
org.opencontainers.image.source="https://github.com/meshtastic/firmware/"
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
ENV TZ=Etc/UTC
|
ENV TZ=Etc/UTC
|
||||||
|
|
||||||
# nosemgrep: dockerfile.security.last-user-is-root.last-user-is-root
|
# nosemgrep: dockerfile.security.last-user-is-root.last-user-is-root
|
||||||
USER root
|
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 libgpiod2 libyaml-cpp0.7 libi2c0 libulfius2.7 libusb-1.0-0-dev liborcania2.3 libssl3 && \
|
||||||
libc-bin libc6 libgpiod3 libyaml-cpp0.8 libi2c0 libuv1t64 libusb-1.0-0-dev \
|
apt-get clean && rm -rf /var/lib/apt/lists/* \
|
||||||
liborcania2.3 libulfius2.7t64 libssl3t64 \
|
|
||||||
libx11-6 libinput10 libxkbcommon-x11-0 \
|
|
||||||
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
|
|
||||||
&& mkdir -p /var/lib/meshtasticd \
|
&& mkdir -p /var/lib/meshtasticd \
|
||||||
&& mkdir -p /etc/meshtasticd/config.d \
|
&& mkdir -p /etc/meshtasticd/config.d \
|
||||||
&& mkdir -p /etc/meshtasticd/ssl
|
&& mkdir -p /etc/meshtasticd/ssl
|
||||||
|
|
||||||
# Fetch compiled binary from the builder
|
# Fetch compiled binary from the builder
|
||||||
COPY --from=builder /tmp/firmware/release/meshtasticd /usr/bin/
|
COPY --from=builder /tmp/firmware/release/meshtasticd /usr/sbin/
|
||||||
COPY --from=builder /tmp/web /usr/share/meshtasticd/web/
|
|
||||||
# Copy config templates
|
# Copy config templates
|
||||||
COPY ./bin/config.d /etc/meshtasticd/available.d
|
COPY ./bin/config.d /etc/meshtasticd/available.d
|
||||||
|
|
||||||
@@ -70,9 +51,7 @@ VOLUME /var/lib/meshtasticd
|
|||||||
|
|
||||||
# Expose Meshtastic TCP API port from the host
|
# Expose Meshtastic TCP API port from the host
|
||||||
EXPOSE 4403
|
EXPOSE 4403
|
||||||
# Expose Meshtastic Web UI port from the host
|
|
||||||
EXPOSE 9443
|
|
||||||
|
|
||||||
CMD [ "sh", "-cx", "meshtasticd --fsdir=/var/lib/meshtasticd" ]
|
CMD [ "sh", "-cx", "meshtasticd -d /var/lib/meshtasticd" ]
|
||||||
|
|
||||||
HEALTHCHECK NONE
|
HEALTHCHECK NONE
|
||||||
32
README.md
32
README.md
@@ -1,7 +1,4 @@
|
|||||||
<div align="center" markdown="1">
|
# Meshtastic Firmware
|
||||||
|
|
||||||
<img src=".github/meshtastic_logo.png" alt="Meshtastic Logo" width="80"/>
|
|
||||||
<h1>Meshtastic Firmware</h1>
|
|
||||||
|
|
||||||

|

|
||||||
[](https://github.com/meshtastic/firmware/actions/workflows/ci.yml)
|
[](https://github.com/meshtastic/firmware/actions/workflows/ci.yml)
|
||||||
@@ -9,32 +6,13 @@
|
|||||||
[](https://opencollective.com/meshtastic/)
|
[](https://opencollective.com/meshtastic/)
|
||||||
[](https://vercel.com?utm_source=meshtastic&utm_campaign=oss)
|
[](https://vercel.com?utm_source=meshtastic&utm_campaign=oss)
|
||||||
|
|
||||||
<a href="https://trendshift.io/repositories/5524" target="_blank"><img src="https://trendshift.io/api/badge/repositories/5524" alt="meshtastic%2Ffirmware | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div align="center">
|
|
||||||
<a href="https://meshtastic.org">Website</a>
|
|
||||||
-
|
|
||||||
<a href="https://meshtastic.org/docs/">Documentation</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
This repository contains the official device firmware for Meshtastic, an open-source LoRa mesh networking project designed for long-range, low-power communication without relying on internet or cellular infrastructure. The firmware supports various hardware platforms, including ESP32, nRF52, RP2040/RP2350, and Linux-based devices.
|
This repository contains the device firmware for the Meshtastic project.
|
||||||
|
|
||||||
Meshtastic enables text messaging, location sharing, and telemetry over a decentralized mesh network, making it ideal for outdoor adventures, emergency preparedness, and remote operations.
|
- **[Building Instructions](https://meshtastic.org/docs/development/firmware/build)**
|
||||||
|
- **[Flashing Instructions](https://meshtastic.org/docs/getting-started/flashing-firmware/)**
|
||||||
### Get Started
|
|
||||||
|
|
||||||
- 🔧 **[Building Instructions](https://meshtastic.org/docs/development/firmware/build)** – Learn how to compile the firmware from source.
|
|
||||||
- ⚡ **[Flashing Instructions](https://meshtastic.org/docs/getting-started/flashing-firmware/)** – Install or update the firmware on your device.
|
|
||||||
|
|
||||||
Join our community and help improve Meshtastic! 🚀
|
|
||||||
|
|
||||||
## Stats
|
## Stats
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
| Firmware Version | Supported |
|
| Firmware Version | Supported |
|
||||||
| ---------------- | ------------------ |
|
| ---------------- | ------------------ |
|
||||||
| 2.6.x | :white_check_mark: |
|
| 2.5.x | :white_check_mark: |
|
||||||
| <= 2.5.x | :x: |
|
| <= 2.4.x | :x: |
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,14 @@
|
|||||||
# trunk-ignore-all(trivy/DS002): We must run as root for this container
|
# trunk-ignore-all(trivy/DS002): We must run as root for this container
|
||||||
|
# trunk-ignore-all(checkov/CKV_DOCKER_8): We must run as root for this container
|
||||||
# trunk-ignore-all(hadolint/DL3002): We must run as root for this container
|
# trunk-ignore-all(hadolint/DL3002): We must run as root for this container
|
||||||
# trunk-ignore-all(hadolint/DL3018): Do not pin apk package versions
|
|
||||||
# trunk-ignore-all(hadolint/DL3013): Do not pin pip package versions
|
|
||||||
|
|
||||||
FROM python:3.14-alpine3.22 AS builder
|
FROM python:3.12-alpine3.21 AS builder
|
||||||
ARG PIO_ENV=native
|
|
||||||
ENV PIP_ROOT_USER_ACTION=ignore
|
ENV PIP_ROOT_USER_ACTION=ignore
|
||||||
|
RUN apk add bash g++ libstdc++-dev linux-headers zip git ca-certificates libgpiod-dev yaml-cpp-dev bluez-dev \
|
||||||
RUN apk --no-cache add \
|
libusb-dev i2c-tools-dev openssl-dev pkgconf argp-standalone && \
|
||||||
bash g++ libstdc++-dev linux-headers zip git ca-certificates libgpiod-dev yaml-cpp-dev bluez-dev \
|
pip install --no-cache-dir -U platformio==6.1.16 && \
|
||||||
libusb-dev i2c-tools-dev libuv-dev openssl-dev pkgconf argp-standalone \
|
mkdir /tmp/firmware
|
||||||
libx11-dev libinput-dev libxkbcommon-dev \
|
|
||||||
&& rm -rf /var/cache/apk/* \
|
|
||||||
&& pip install --no-cache-dir -U platformio \
|
|
||||||
&& mkdir /tmp/firmware
|
|
||||||
|
|
||||||
WORKDIR /tmp/firmware
|
WORKDIR /tmp/firmware
|
||||||
COPY . /tmp/firmware
|
COPY . /tmp/firmware
|
||||||
@@ -22,35 +17,21 @@ COPY . /tmp/firmware
|
|||||||
# Add `argp` for musl
|
# Add `argp` for musl
|
||||||
ENV PLATFORMIO_BUILD_FLAGS="-Os -ffunction-sections -fdata-sections -Wl,--gc-sections -largp"
|
ENV PLATFORMIO_BUILD_FLAGS="-Os -ffunction-sections -fdata-sections -Wl,--gc-sections -largp"
|
||||||
|
|
||||||
RUN bash ./bin/build-native.sh "$PIO_ENV" && \
|
RUN bash ./bin/build-native.sh && \
|
||||||
cp "/tmp/firmware/release/meshtasticd_linux_$(uname -m)" "/tmp/firmware/release/meshtasticd"
|
cp "/tmp/firmware/release/meshtasticd_linux_$(uname -m)" "/tmp/firmware/release/meshtasticd"
|
||||||
|
|
||||||
# ##### PRODUCTION BUILD #############
|
# ##### PRODUCTION BUILD #############
|
||||||
|
|
||||||
FROM alpine:3.22
|
FROM alpine:3.21
|
||||||
LABEL org.opencontainers.image.title="Meshtastic" \
|
|
||||||
org.opencontainers.image.description="Alpine Meshtastic daemon" \
|
|
||||||
org.opencontainers.image.url="https://meshtastic.org" \
|
|
||||||
org.opencontainers.image.documentation="https://meshtastic.org/docs/" \
|
|
||||||
org.opencontainers.image.authors="Meshtastic" \
|
|
||||||
org.opencontainers.image.licenses="GPL-3.0-or-later" \
|
|
||||||
org.opencontainers.image.source="https://github.com/meshtastic/firmware/"
|
|
||||||
|
|
||||||
# nosemgrep: dockerfile.security.last-user-is-root.last-user-is-root
|
# nosemgrep: dockerfile.security.last-user-is-root.last-user-is-root
|
||||||
USER root
|
USER root
|
||||||
|
|
||||||
RUN apk --no-cache add \
|
RUN apk add libstdc++ libgpiod yaml-cpp libusb i2c-tools \
|
||||||
shadow libstdc++ libgpiod yaml-cpp libusb i2c-tools libuv \
|
|
||||||
libx11 libinput libxkbcommon \
|
|
||||||
&& 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 \
|
||||||
&& mkdir -p /etc/meshtasticd/ssl
|
&& mkdir -p /etc/meshtasticd/ssl
|
||||||
|
COPY --from=builder /tmp/firmware/release/meshtasticd /usr/sbin/
|
||||||
# Fetch compiled binary from the builder
|
|
||||||
COPY --from=builder /tmp/firmware/release/meshtasticd /usr/bin/
|
|
||||||
# Copy config templates
|
|
||||||
COPY ./bin/config.d /etc/meshtasticd/available.d
|
|
||||||
|
|
||||||
WORKDIR /var/lib/meshtasticd
|
WORKDIR /var/lib/meshtasticd
|
||||||
VOLUME /var/lib/meshtasticd
|
VOLUME /var/lib/meshtasticd
|
||||||
|
|||||||
@@ -2,9 +2,7 @@
|
|||||||
[esp32_base]
|
[esp32_base]
|
||||||
extends = arduino_base
|
extends = arduino_base
|
||||||
custom_esp32_kind = esp32
|
custom_esp32_kind = esp32
|
||||||
platform =
|
platform = platformio/espressif32@6.9.0
|
||||||
# renovate: datasource=custom.pio depName=platformio/espressif32 packageName=platformio/platform/espressif32
|
|
||||||
platformio/espressif32@6.11.0
|
|
||||||
|
|
||||||
build_src_filter =
|
build_src_filter =
|
||||||
${arduino_base.build_src_filter} -<platform/nrf52/> -<platform/stm32wl> -<platform/rp2xx0> -<mesh/eth/> -<mesh/raspihttp>
|
${arduino_base.build_src_filter} -<platform/nrf52/> -<platform/stm32wl> -<platform/rp2xx0> -<mesh/eth/> -<mesh/raspihttp>
|
||||||
@@ -31,37 +29,27 @@ build_flags =
|
|||||||
-DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL
|
-DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL
|
||||||
-DAXP_DEBUG_PORT=Serial
|
-DAXP_DEBUG_PORT=Serial
|
||||||
-DCONFIG_BT_NIMBLE_ENABLED
|
-DCONFIG_BT_NIMBLE_ENABLED
|
||||||
-DCONFIG_BT_NIMBLE_MAX_BONDS=6 # default is 3
|
|
||||||
-DCONFIG_NIMBLE_CPP_LOG_LEVEL=2
|
-DCONFIG_NIMBLE_CPP_LOG_LEVEL=2
|
||||||
-DCONFIG_BT_NIMBLE_MAX_CCCDS=20
|
-DCONFIG_BT_NIMBLE_MAX_CCCDS=20
|
||||||
-DCONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=8192
|
-DCONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=8192
|
||||||
-DESP_OPENSSL_SUPPRESS_LEGACY_WARNING
|
-DESP_OPENSSL_SUPPRESS_LEGACY_WARNING
|
||||||
-DSERIAL_BUFFER_SIZE=4096
|
-DSERIAL_BUFFER_SIZE=4096
|
||||||
-DSERIAL_HAS_ON_RECEIVE
|
|
||||||
-DLIBPAX_ARDUINO
|
-DLIBPAX_ARDUINO
|
||||||
-DLIBPAX_WIFI
|
-DLIBPAX_WIFI
|
||||||
-DLIBPAX_BLE
|
-DLIBPAX_BLE
|
||||||
-DHAS_UDP_MULTICAST=1
|
|
||||||
;-DDEBUG_HEAP
|
;-DDEBUG_HEAP
|
||||||
|
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${arduino_base.lib_deps}
|
${arduino_base.lib_deps}
|
||||||
${networking_base.lib_deps}
|
${networking_base.lib_deps}
|
||||||
${environmental_base.lib_deps}
|
${environmental_base.lib_deps}
|
||||||
${environmental_extra.lib_deps}
|
|
||||||
${radiolib_base.lib_deps}
|
${radiolib_base.lib_deps}
|
||||||
# renovate: datasource=git-refs depName=meshtastic-esp32_https_server packageName=https://github.com/meshtastic/esp32_https_server gitBranch=master
|
https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2
|
||||||
https://github.com/meshtastic/esp32_https_server/archive/3223704846752e6d545139204837bdb2a55459ca.zip
|
h2zero/NimBLE-Arduino@^1.4.2
|
||||||
# renovate: datasource=custom.pio depName=NimBLE-Arduino packageName=h2zero/library/NimBLE-Arduino
|
https://github.com/dbinfrago/libpax.git#3cdc0371c375676a97967547f4065607d4c53fd1
|
||||||
h2zero/NimBLE-Arduino@^1.4.3
|
lewisxhe/XPowersLib@^0.2.6
|
||||||
# renovate: datasource=git-refs depName=libpax packageName=https://github.com/dbinfrago/libpax gitBranch=master
|
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f
|
||||||
https://github.com/dbinfrago/libpax/archive/3cdc0371c375676a97967547f4065607d4c53fd1.zip
|
rweather/Crypto@^0.4.0
|
||||||
# renovate: datasource=github-tags depName=XPowersLib packageName=lewisxhe/XPowersLib
|
|
||||||
https://github.com/lewisxhe/XPowersLib/archive/v0.3.1.zip
|
|
||||||
# renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master
|
|
||||||
https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip
|
|
||||||
# renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto
|
|
||||||
rweather/Crypto@0.4.0
|
|
||||||
|
|
||||||
lib_ignore =
|
lib_ignore =
|
||||||
segger_rtt
|
segger_rtt
|
||||||
@@ -77,4 +65,4 @@ lib_ignore =
|
|||||||
|
|
||||||
; customize the partition table
|
; customize the partition table
|
||||||
; http://docs.platformio.org/en/latest/platforms/espressif32.html#partition-tables
|
; http://docs.platformio.org/en/latest/platforms/espressif32.html#partition-tables
|
||||||
board_build.partitions = partition-table.csv
|
board_build.partitions = partition-table.csv
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
[esp32c6_base]
|
[esp32c6_base]
|
||||||
extends = esp32_base
|
extends = esp32_base
|
||||||
platform =
|
platform = https://github.com/Jason2866/platform-espressif32.git#22faa566df8c789000f8136cd8d0aca49617af55
|
||||||
# Do not renovate until we have switched to pioarduino tagged builds
|
|
||||||
https://github.com/Jason2866/platform-espressif32/archive/22faa566df8c789000f8136cd8d0aca49617af55.zip
|
|
||||||
build_flags =
|
build_flags =
|
||||||
${arduino_base.build_flags}
|
${arduino_base.build_flags}
|
||||||
-Wall
|
-Wall
|
||||||
@@ -25,14 +23,10 @@ lib_deps =
|
|||||||
${arduino_base.lib_deps}
|
${arduino_base.lib_deps}
|
||||||
${networking_base.lib_deps}
|
${networking_base.lib_deps}
|
||||||
${environmental_base.lib_deps}
|
${environmental_base.lib_deps}
|
||||||
${environmental_extra.lib_deps}
|
|
||||||
${radiolib_base.lib_deps}
|
${radiolib_base.lib_deps}
|
||||||
# renovate: datasource=custom.pio depName=XPowersLib packageName=lewisxhe/library/XPowersLib
|
lewisxhe/XPowersLib@^0.2.6
|
||||||
lewisxhe/XPowersLib@0.3.1
|
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f
|
||||||
# renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master
|
rweather/Crypto@^0.4.0
|
||||||
https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip
|
|
||||||
# renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto
|
|
||||||
rweather/Crypto@0.4.0
|
|
||||||
|
|
||||||
build_src_filter =
|
build_src_filter =
|
||||||
${esp32_base.build_src_filter} -<mesh/http>
|
${esp32_base.build_src_filter} -<mesh/http>
|
||||||
@@ -44,4 +38,4 @@ lib_ignore =
|
|||||||
NonBlockingRTTTL
|
NonBlockingRTTTL
|
||||||
NimBLE-Arduino
|
NimBLE-Arduino
|
||||||
libpax
|
libpax
|
||||||
|
|
||||||
@@ -16,4 +16,4 @@ build_flags =
|
|||||||
lib_ignore =
|
lib_ignore =
|
||||||
${esp32_base.lib_ignore}
|
${esp32_base.lib_ignore}
|
||||||
NimBLE-Arduino
|
NimBLE-Arduino
|
||||||
libpax
|
libpax
|
||||||
@@ -3,3 +3,4 @@ extends = esp32_base
|
|||||||
custom_esp32_kind = esp32s3
|
custom_esp32_kind = esp32s3
|
||||||
|
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,11 @@
|
|||||||
[nrf52_base]
|
[nrf52_base]
|
||||||
; Instead of the standard nordicnrf52 platform, we use our fork which has our added variant files
|
; Instead of the standard nordicnrf52 platform, we use our fork which has our added variant files
|
||||||
platform =
|
platform = platformio/nordicnrf52@^10.7.0
|
||||||
# renovate: datasource=custom.pio depName=platformio/nordicnrf52 packageName=platformio/platform/nordicnrf52
|
|
||||||
platformio/nordicnrf52@^10.8.0
|
|
||||||
extends = arduino_base
|
extends = arduino_base
|
||||||
platform_packages =
|
platform_packages =
|
||||||
; our custom Git version until they merge our PR
|
; our custom Git version until they merge our PR
|
||||||
# TODO renovate
|
framework-arduinoadafruitnrf52 @ https://github.com/meshtastic/Adafruit_nRF52_Arduino.git#e13f5820002a4fb2a5e6754b42ace185277e5adf
|
||||||
platformio/framework-arduinoadafruitnrf52 @ https://github.com/meshtastic/Adafruit_nRF52_Arduino#e13f5820002a4fb2a5e6754b42ace185277e5adf
|
toolchain-gccarmnoneeabi@~1.90301.0
|
||||||
; Don't renovate toolchain-gccarmnoneeabi
|
|
||||||
platformio/toolchain-gccarmnoneeabi@~1.90301.0
|
|
||||||
|
|
||||||
build_type = debug
|
build_type = debug
|
||||||
build_flags =
|
build_flags =
|
||||||
@@ -21,16 +17,16 @@ build_flags =
|
|||||||
-DLFS_NO_ASSERT ; Disable LFS assertions , see https://github.com/meshtastic/firmware/pull/3818
|
-DLFS_NO_ASSERT ; Disable LFS assertions , see https://github.com/meshtastic/firmware/pull/3818
|
||||||
-DMESHTASTIC_EXCLUDE_AUDIO=1
|
-DMESHTASTIC_EXCLUDE_AUDIO=1
|
||||||
-DMESHTASTIC_EXCLUDE_PAXCOUNTER=1
|
-DMESHTASTIC_EXCLUDE_PAXCOUNTER=1
|
||||||
|
-DMAX_NUM_NODES=80
|
||||||
|
|
||||||
build_src_filter =
|
build_src_filter =
|
||||||
${arduino_base.build_src_filter} -<platform/esp32/> -<platform/stm32wl> -<nimble/> -<mesh/wifi/> -<mesh/api/> -<mesh/http/> -<modules/esp32> -<platform/rp2xx0> -<mesh/eth/> -<mesh/raspihttp> -<serialization/>
|
${arduino_base.build_src_filter} -<platform/esp32/> -<platform/stm32wl> -<nimble/> -<mesh/wifi/> -<mesh/api/> -<mesh/http/> -<modules/esp32> -<platform/rp2xx0> -<mesh/eth/> -<mesh/raspihttp>
|
||||||
|
|
||||||
lib_deps=
|
lib_deps=
|
||||||
${arduino_base.lib_deps}
|
${arduino_base.lib_deps}
|
||||||
${radiolib_base.lib_deps}
|
${radiolib_base.lib_deps}
|
||||||
# renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto
|
rweather/Crypto@^0.4.0
|
||||||
rweather/Crypto@0.4.0
|
|
||||||
|
|
||||||
lib_ignore =
|
lib_ignore =
|
||||||
BluetoothOTA
|
BluetoothOTA
|
||||||
lvgl
|
lvgl
|
||||||
@@ -6,9 +6,7 @@ build_flags = ${nrf52_base.build_flags}
|
|||||||
lib_deps =
|
lib_deps =
|
||||||
${nrf52_base.lib_deps}
|
${nrf52_base.lib_deps}
|
||||||
${environmental_base.lib_deps}
|
${environmental_base.lib_deps}
|
||||||
${environmental_extra.lib_deps}
|
https://github.com/Kongduino/Adafruit_nRFCrypto.git#e31a8825ea3300b163a0a3c1ddd5de34e10e1371
|
||||||
# renovate: datasource=git-refs depName=Kongduino-Adafruit_nRFCrypto packageName=https://github.com/Kongduino/Adafruit_nRFCrypto gitBranch=master
|
|
||||||
https://github.com/Kongduino/Adafruit_nRFCrypto/archive/5f838d2709461a2c981f642917aa50254a25c14c.zip
|
|
||||||
|
|
||||||
; Common NRF52 debugging settings follow. See the Meshtastic developer docs for how to connect SWD debugging probes to your board.
|
; Common NRF52 debugging settings follow. See the Meshtastic developer docs for how to connect SWD debugging probes to your board.
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
; The Portduino based 'native' environment. Currently supported on Linux targets with real LoRa hardware (or simulated).
|
; The Portduino based 'native' environment. Currently supported on Linux targets with real LoRa hardware (or simulated).
|
||||||
[portduino_base]
|
[portduino_base]
|
||||||
platform =
|
platform = https://github.com/meshtastic/platform-native.git#562d189828f09fbf4c4093b3c0104bae9d8e9ff9
|
||||||
# renovate: datasource=git-refs depName=platform-native packageName=https://github.com/meshtastic/platform-native gitBranch=develop
|
|
||||||
https://github.com/meshtastic/platform-native/archive/d3f6e339534233c7217818867368767590ce549e.zip
|
|
||||||
framework = arduino
|
framework = arduino
|
||||||
|
|
||||||
build_src_filter =
|
build_src_filter =
|
||||||
@@ -17,42 +15,29 @@ build_src_filter =
|
|||||||
+<mesh/raspihttp/>
|
+<mesh/raspihttp/>
|
||||||
-<mesh/eth/>
|
-<mesh/eth/>
|
||||||
-<modules/esp32>
|
-<modules/esp32>
|
||||||
|
-<modules/Telemetry/EnvironmentTelemetry.cpp>
|
||||||
|
-<modules/Telemetry/AirQualityTelemetry.cpp>
|
||||||
|
-<modules/Telemetry/Sensor>
|
||||||
|
+<../variants/portduino>
|
||||||
|
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${env.lib_deps}
|
${env.lib_deps}
|
||||||
${networking_base.lib_deps}
|
${networking_base.lib_deps}
|
||||||
${radiolib_base.lib_deps}
|
${radiolib_base.lib_deps}
|
||||||
${environmental_base.lib_deps}
|
rweather/Crypto@^0.4.0
|
||||||
# renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto
|
|
||||||
rweather/Crypto@0.4.0
|
|
||||||
# renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX
|
|
||||||
lovyan03/LovyanGFX@^1.2.0
|
lovyan03/LovyanGFX@^1.2.0
|
||||||
# renovate: datasource=git-refs depName=libch341-spi-userspace packageName=https://github.com/pine64/libch341-spi-userspace gitBranch=main
|
https://github.com/pine64/libch341-spi-userspace#a9b17e3452f7fb747000d9b4ad4409155b39f6ef
|
||||||
https://github.com/pine64/libch341-spi-userspace/archive/af9bc27c9c30fa90772279925b7c5913dff789b4.zip
|
|
||||||
# renovate: datasource=custom.pio depName=adafruit/Adafruit seesaw Library packageName=adafruit/library/Adafruit seesaw Library
|
|
||||||
adafruit/Adafruit seesaw Library@1.7.9
|
|
||||||
# renovate: datasource=git-refs depName=RAK12034-BMX160 packageName=https://github.com/RAKWireless/RAK12034-BMX160 gitBranch=main
|
|
||||||
https://github.com/RAKWireless/RAK12034-BMX160/archive/dcead07ffa267d3c906e9ca4a1330ab989e957e2.zip
|
|
||||||
|
|
||||||
build_flags =
|
build_flags =
|
||||||
${arduino_base.build_flags}
|
${arduino_base.build_flags}
|
||||||
-D ARCH_PORTDUINO
|
|
||||||
-fPIC
|
-fPIC
|
||||||
-Isrc/platform/portduino
|
-Isrc/platform/portduino
|
||||||
-DRADIOLIB_EEPROM_UNSUPPORTED
|
-DRADIOLIB_EEPROM_UNSUPPORTED
|
||||||
-DPORTDUINO_LINUX_HARDWARE
|
-DPORTDUINO_LINUX_HARDWARE
|
||||||
-DHAS_UDP_MULTICAST=1
|
|
||||||
-lpthread
|
-lpthread
|
||||||
-lstdc++fs
|
-lstdc++fs
|
||||||
-lbluetooth
|
-lbluetooth
|
||||||
-lgpiod
|
-lgpiod
|
||||||
-lyaml-cpp
|
-lyaml-cpp
|
||||||
-li2c
|
-li2c
|
||||||
-luv
|
|
||||||
-std=gnu17
|
|
||||||
-std=c++17
|
-std=c++17
|
||||||
|
|
||||||
lib_ignore =
|
|
||||||
Adafruit NeoPixel
|
|
||||||
Adafruit ST7735 and ST7789 Library
|
|
||||||
SD
|
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
; Common settings for rp2040 Processor based targets
|
; Common settings for rp2040 Processor based targets
|
||||||
[rp2040_base]
|
[rp2040_base]
|
||||||
platform =
|
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#19e30129fb1428b823be585c787dcb4ac0d9014c ; For arduino-pico >=4.2.1
|
||||||
# TODO renovate
|
|
||||||
https://github.com/maxgerhardt/platform-raspberrypi#76ecf3c7e9dd4503af0331154c4ca1cddc4b03e5
|
|
||||||
; For arduino-pico >= 4.4.3
|
|
||||||
extends = arduino_base
|
extends = arduino_base
|
||||||
platform_packages =
|
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#6024e9a7e82a72e38dd90f42029ba3748835eb2e ; 4.3.0 with fix MDNS
|
||||||
# TODO renovate
|
|
||||||
framework-arduinopico@https://github.com/earlephilhower/arduino-pico#4.4.3
|
|
||||||
|
|
||||||
board_build.core = earlephilhower
|
board_build.core = earlephilhower
|
||||||
board_build.filesystem_size = 0.5m
|
board_build.filesystem_size = 0.5m
|
||||||
@@ -23,12 +18,9 @@ build_src_filter =
|
|||||||
|
|
||||||
lib_ignore =
|
lib_ignore =
|
||||||
BluetoothOTA
|
BluetoothOTA
|
||||||
lvgl
|
|
||||||
|
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${arduino_base.lib_deps}
|
${arduino_base.lib_deps}
|
||||||
${environmental_base.lib_deps}
|
${environmental_base.lib_deps}
|
||||||
${environmental_extra.lib_deps}
|
|
||||||
${radiolib_base.lib_deps}
|
${radiolib_base.lib_deps}
|
||||||
# renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto
|
rweather/Crypto
|
||||||
rweather/Crypto@0.4.0
|
|
||||||
@@ -1,13 +1,8 @@
|
|||||||
; Common settings for rp2350 Processor based targets
|
; Common settings for rp2040 Processor based targets
|
||||||
[rp2350_base]
|
[rp2350_base]
|
||||||
platform =
|
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#19e30129fb1428b823be585c787dcb4ac0d9014c ; For arduino-pico >=4.2.1
|
||||||
# TODO renovate
|
|
||||||
https://github.com/maxgerhardt/platform-raspberrypi#76ecf3c7e9dd4503af0331154c4ca1cddc4b03e5
|
|
||||||
; For arduino-pico >= 4.4.3
|
|
||||||
extends = arduino_base
|
extends = arduino_base
|
||||||
platform_packages =
|
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#6024e9a7e82a72e38dd90f42029ba3748835eb2e ; 4.3.0 with fix MDNS
|
||||||
# TODO renovate
|
|
||||||
framework-arduinopico@https://github.com/earlephilhower/arduino-pico#4.4.3
|
|
||||||
|
|
||||||
board_build.core = earlephilhower
|
board_build.core = earlephilhower
|
||||||
board_build.filesystem_size = 0.5m
|
board_build.filesystem_size = 0.5m
|
||||||
@@ -15,6 +10,7 @@ build_flags =
|
|||||||
${arduino_base.build_flags} -Wno-unused-variable -Wcast-align
|
${arduino_base.build_flags} -Wno-unused-variable -Wcast-align
|
||||||
-Isrc/platform/rp2xx0
|
-Isrc/platform/rp2xx0
|
||||||
-D__PLAT_RP2350__
|
-D__PLAT_RP2350__
|
||||||
|
# -D _POSIX_THREADS
|
||||||
build_src_filter =
|
build_src_filter =
|
||||||
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<modules/esp32> -<platform/nrf52/> -<platform/stm32wl> -<mesh/eth/> -<mesh/wifi/> -<mesh/http/> -<mesh/raspihttp> -<platform/rp2xx0/pico_sleep> -<platform/rp2xx0/hardware_rosc>
|
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<modules/esp32> -<platform/nrf52/> -<platform/stm32wl> -<mesh/eth/> -<mesh/wifi/> -<mesh/http/> -<mesh/raspihttp> -<platform/rp2xx0/pico_sleep> -<platform/rp2xx0/hardware_rosc>
|
||||||
|
|
||||||
@@ -25,7 +21,5 @@ lib_ignore =
|
|||||||
lib_deps =
|
lib_deps =
|
||||||
${arduino_base.lib_deps}
|
${arduino_base.lib_deps}
|
||||||
${environmental_base.lib_deps}
|
${environmental_base.lib_deps}
|
||||||
${environmental_extra.lib_deps}
|
|
||||||
${radiolib_base.lib_deps}
|
${radiolib_base.lib_deps}
|
||||||
# renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto
|
rweather/Crypto
|
||||||
rweather/Crypto@0.4.0
|
|
||||||
@@ -1,56 +1,38 @@
|
|||||||
[stm32_base]
|
[stm32_base]
|
||||||
extends = arduino_base
|
extends = arduino_base
|
||||||
platform =
|
platform = ststm32
|
||||||
# renovate: datasource=custom.pio depName=platformio/ststm32 packageName=platformio/platform/ststm32
|
platform_packages = platformio/framework-arduinoststm32@https://github.com/stm32duino/Arduino_Core_STM32.git#ea74156acd823b6d14739f389e6cdc648f8ee36e
|
||||||
platformio/ststm32@19.3.0
|
|
||||||
platform_packages =
|
|
||||||
# TODO renovate
|
|
||||||
platformio/framework-arduinoststm32@https://github.com/stm32duino/Arduino_Core_STM32/archive/2.10.1.zip
|
|
||||||
extra_scripts =
|
|
||||||
${env.extra_scripts}
|
|
||||||
post:extra_scripts/extra_stm32.py
|
|
||||||
|
|
||||||
build_type = release
|
build_type = release
|
||||||
|
|
||||||
build_flags =
|
;board_build.flash_offset = 0x08000000
|
||||||
|
|
||||||
|
build_flags =
|
||||||
${arduino_base.build_flags}
|
${arduino_base.build_flags}
|
||||||
-flto
|
-flto
|
||||||
-Isrc/platform/stm32wl -g
|
-Isrc/platform/stm32wl -g
|
||||||
-DMESHTASTIC_EXCLUDE_AUDIO=1
|
-DMESHTASTIC_MINIMIZE_BUILD
|
||||||
-DMESHTASTIC_EXCLUDE_ATAK=1 ; ATAK is quite big, disable it for big flash savings.
|
-DMESHTASTIC_EXCLUDE_GPS
|
||||||
-DMESHTASTIC_EXCLUDE_INPUTBROKER=1
|
-DDEBUG_MUTE
|
||||||
-DMESHTASTIC_EXCLUDE_POWERMON=1
|
; -DVECT_TAB_OFFSET=0x08000000
|
||||||
-DMESHTASTIC_EXCLUDE_SCREEN=1
|
-DconfigUSE_CMSIS_RTOS_V2=1
|
||||||
-DMESHTASTIC_EXCLUDE_MQTT=1
|
; -DSPI_MODE_0=SPI_MODE0
|
||||||
-DMESHTASTIC_EXCLUDE_BLUETOOTH=1
|
|
||||||
-DMESHTASTIC_EXCLUDE_WIFI=1
|
|
||||||
-DMESHTASTIC_EXCLUDE_TZ=1 ; Exclude TZ to save some flash space.
|
|
||||||
-DSERIAL_RX_BUFFER_SIZE=256 ; For GPS - the default of 64 is too small.
|
|
||||||
-DHAS_SCREEN=0 ; Always disable screen for STM32, it is not supported.
|
|
||||||
-DPIO_FRAMEWORK_ARDUINO_NANOLIB_FLOAT_PRINTF ; This is REQUIRED for at least traceroute debug prints - without it the length ends up uninitialized.
|
|
||||||
-DDEBUG_MUTE ; You can #undef DEBUG_MUTE in certain source files if you need the logs.
|
|
||||||
-fmerge-all-constants
|
-fmerge-all-constants
|
||||||
-ffunction-sections
|
-ffunction-sections
|
||||||
-fdata-sections
|
-fdata-sections
|
||||||
-DRADIOLIB_EXCLUDE_SX128X=1
|
|
||||||
-DRADIOLIB_EXCLUDE_SX127X=1
|
build_src_filter =
|
||||||
-DRADIOLIB_EXCLUDE_LR11X0=1
|
|
||||||
-DHAL_DAC_MODULE_ONLY
|
|
||||||
-DHAL_RNG_MODULE_ENABLED
|
|
||||||
|
|
||||||
build_src_filter =
|
|
||||||
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<mesh/api/> -<mesh/wifi/> -<mesh/http/> -<modules/esp32> -<mesh/eth/> -<input> -<buzz> -<modules/RemoteHardwareModule.cpp> -<platform/nrf52> -<platform/portduino> -<platform/rp2xx0> -<mesh/raspihttp>
|
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<mesh/api/> -<mesh/wifi/> -<mesh/http/> -<modules/esp32> -<mesh/eth/> -<input> -<buzz> -<modules/RemoteHardwareModule.cpp> -<platform/nrf52> -<platform/portduino> -<platform/rp2xx0> -<mesh/raspihttp>
|
||||||
|
|
||||||
board_upload.offset_address = 0x08000000
|
board_upload.offset_address = 0x08000000
|
||||||
upload_protocol = stlink
|
upload_protocol = stlink
|
||||||
debug_tool = stlink
|
|
||||||
|
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${env.lib_deps}
|
${env.lib_deps}
|
||||||
${radiolib_base.lib_deps}
|
charlesbaynham/OSFS@^1.2.3
|
||||||
|
jgromes/RadioLib@7.0.2
|
||||||
# renovate: datasource=git-refs depName=caveman99-stm32-Crypto packageName=https://github.com/caveman99/Crypto gitBranch=main
|
https://github.com/caveman99/Crypto.git#f61ae26a53f7a2d0ba5511625b8bf8eff3a35d5e
|
||||||
https://github.com/caveman99/Crypto/archive/1aa30eb536bd52a576fde6dfa393bf7349cf102d.zip
|
|
||||||
|
|
||||||
lib_ignore =
|
lib_ignore =
|
||||||
OneButton
|
mathertel/OneButton@2.6.1
|
||||||
|
Wire
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# Set spidev ownership to 'spi' group
|
|
||||||
SUBSYSTEM=="spidev", KERNEL=="spidev*", GROUP="spi", MODE="0660"
|
|
||||||
# Allow access to USB CH341 devices
|
|
||||||
SUBSYSTEM=="usb", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="5512", MODE="0666"
|
|
||||||
# Set gpio ownership to 'gpio' group
|
|
||||||
SUBSYSTEM=="*gpiomem*", GROUP="gpio", MODE="0660"
|
|
||||||
SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660"
|
|
||||||
@@ -11,7 +11,7 @@ rm -f $OUTDIR/firmware*
|
|||||||
rm -r $OUTDIR/* || true
|
rm -r $OUTDIR/* || true
|
||||||
|
|
||||||
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
|
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
|
||||||
platformio pkg install -e $1
|
platformio pkg update -e $1
|
||||||
|
|
||||||
echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS"
|
echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS"
|
||||||
rm -f .pio/build/$1/firmware.*
|
rm -f .pio/build/$1/firmware.*
|
||||||
@@ -34,13 +34,12 @@ SRCBIN=.pio/build/$1/firmware.bin
|
|||||||
cp $SRCBIN $OUTDIR/$basename-update.bin
|
cp $SRCBIN $OUTDIR/$basename-update.bin
|
||||||
|
|
||||||
echo "Building Filesystem for ESP32 targets"
|
echo "Building Filesystem for ESP32 targets"
|
||||||
# If you want to build the webui, uncomment the following lines
|
|
||||||
# pio run --environment $1 -t buildfs
|
|
||||||
# cp .pio/build/$1/littlefs.bin $OUTDIR/littlefswebui-$1-$VERSION.bin
|
|
||||||
# # Remove webserver files from the filesystem and rebuild
|
|
||||||
# ls -l data/static # Diagnostic list of files
|
|
||||||
# rm -rf data/static
|
|
||||||
pio run --environment $1 -t buildfs
|
pio run --environment $1 -t buildfs
|
||||||
cp .pio/build/$1/littlefs.bin $OUTDIR/littlefs-$1-$VERSION.bin
|
cp .pio/build/$1/littlefs.bin $OUTDIR/littlefswebui-$VERSION.bin
|
||||||
|
# Remove webserver files from the filesystem and rebuild
|
||||||
|
ls -l data/static # Diagnostic list of files
|
||||||
|
rm -rf data/static
|
||||||
|
pio run --environment $1 -t buildfs
|
||||||
|
cp .pio/build/$1/littlefs.bin $OUTDIR/littlefs-$VERSION.bin
|
||||||
cp bin/device-install.* $OUTDIR
|
cp bin/device-install.* $OUTDIR
|
||||||
cp bin/device-update.* $OUTDIR
|
cp bin/device-update.* $OUTDIR
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
sed -i 's/#-DBUILD_EPOCH=$UNIX_TIME/-DBUILD_EPOCH=$UNIX_TIME/' platformio.ini
|
||||||
|
|
||||||
export PIP_BREAK_SYSTEM_PACKAGES=1
|
export PIP_BREAK_SYSTEM_PACKAGES=1
|
||||||
|
|
||||||
if (echo $2 | grep -q "esp32"); then
|
if (echo $2 | grep -q "esp32"); then
|
||||||
@@ -9,7 +11,7 @@ elif (echo $2 | grep -q "nrf52"); then
|
|||||||
elif (echo $2 | grep -q "stm32"); then
|
elif (echo $2 | grep -q "stm32"); then
|
||||||
bin/build-stm32.sh $1
|
bin/build-stm32.sh $1
|
||||||
elif (echo $2 | grep -q "rpi2040"); then
|
elif (echo $2 | grep -q "rpi2040"); then
|
||||||
bin/build-rp2xx0.sh $1
|
bin/build-rpi2040.sh $1
|
||||||
else
|
else
|
||||||
echo "Unknown target $2"
|
echo "Unknown target $2"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ platformioFailed() {
|
|||||||
|
|
||||||
VERSION=$(bin/buildinfo.py long)
|
VERSION=$(bin/buildinfo.py long)
|
||||||
SHORT_VERSION=$(bin/buildinfo.py short)
|
SHORT_VERSION=$(bin/buildinfo.py short)
|
||||||
PIO_ENV=${1:-native}
|
|
||||||
|
|
||||||
OUTDIR=release/
|
OUTDIR=release/
|
||||||
|
|
||||||
@@ -25,7 +24,7 @@ mkdir -p $OUTDIR/
|
|||||||
rm -r $OUTDIR/* || true
|
rm -r $OUTDIR/* || true
|
||||||
|
|
||||||
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
|
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
|
||||||
pio pkg install --environment "$PIO_ENV" || platformioFailed
|
platformio pkg update --environment native || platformioFailed
|
||||||
pio run --environment "$PIO_ENV" || platformioFailed
|
pio run --environment native || platformioFailed
|
||||||
cp ".pio/build/$PIO_ENV/program" "$OUTDIR/meshtasticd_linux_$(uname -m)"
|
cp .pio/build/native/program "$OUTDIR/meshtasticd_linux_$(uname -m)"
|
||||||
cp bin/native-install.* $OUTDIR
|
cp bin/native-install.* $OUTDIR
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ rm -f $OUTDIR/firmware*
|
|||||||
rm -r $OUTDIR/* || true
|
rm -r $OUTDIR/* || true
|
||||||
|
|
||||||
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
|
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
|
||||||
platformio pkg install -e $1
|
platformio pkg update -e $1
|
||||||
|
|
||||||
echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS"
|
echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS"
|
||||||
rm -f .pio/build/$1/firmware.*
|
rm -f .pio/build/$1/firmware.*
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ rm -f $OUTDIR/firmware*
|
|||||||
rm -r $OUTDIR/* || true
|
rm -r $OUTDIR/* || true
|
||||||
|
|
||||||
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
|
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
|
||||||
platformio pkg install -e $1
|
platformio pkg update -e $1
|
||||||
|
|
||||||
echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS"
|
echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS"
|
||||||
rm -f .pio/build/$1/firmware.*
|
rm -f .pio/build/$1/firmware.*
|
||||||
@@ -11,7 +11,7 @@ rm -f $OUTDIR/firmware*
|
|||||||
rm -r $OUTDIR/* || true
|
rm -r $OUTDIR/* || true
|
||||||
|
|
||||||
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
|
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
|
||||||
platformio pkg install -e $1
|
platformio pkg update -e $1
|
||||||
|
|
||||||
echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS"
|
echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS"
|
||||||
rm -f .pio/build/$1/firmware.*
|
rm -f .pio/build/$1/firmware.*
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
import argparse
|
|
||||||
import xml.etree.ElementTree as ET
|
|
||||||
from defusedxml.ElementTree import parse
|
|
||||||
from datetime import datetime, timezone
|
|
||||||
|
|
||||||
|
|
||||||
# Indent by 2 spaces to align with xml formatting.
|
|
||||||
def indent(elem, level=0):
|
|
||||||
i = "\n" + level * " "
|
|
||||||
if len(elem):
|
|
||||||
if not elem.text or not elem.text.strip():
|
|
||||||
elem.text = i + " "
|
|
||||||
for child in elem:
|
|
||||||
indent(child, level + 1)
|
|
||||||
if not child.tail or not child.tail.strip():
|
|
||||||
child.tail = i
|
|
||||||
if level and (not elem.tail or not elem.tail.strip()):
|
|
||||||
elem.tail = i
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
parser = argparse.ArgumentParser(
|
|
||||||
description="Prepend new release entry to metainfo.xml file.")
|
|
||||||
parser.add_argument("--file", help="Path to the metainfo.xml file",
|
|
||||||
default="org.meshtastic.meshtasticd.metainfo.xml")
|
|
||||||
parser.add_argument("version", help="Version string (e.g. 2.6.4)")
|
|
||||||
parser.add_argument("--date", help="Release date (YYYY-MM-DD), defaults to today",
|
|
||||||
default=datetime.now(timezone.utc).date().isoformat())
|
|
||||||
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
tree = parse(args.file)
|
|
||||||
root = tree.getroot()
|
|
||||||
|
|
||||||
releases = root.find('releases')
|
|
||||||
if releases is None:
|
|
||||||
raise RuntimeError("<releases> element not found in XML.")
|
|
||||||
|
|
||||||
existing_versions = {
|
|
||||||
release.get('version'): release
|
|
||||||
for release in releases.findall('release')
|
|
||||||
}
|
|
||||||
existing_release = existing_versions.get(args.version)
|
|
||||||
|
|
||||||
if existing_release is not None:
|
|
||||||
if not existing_release.get('date'):
|
|
||||||
print(f"Version {args.version} found without date. Adding date...")
|
|
||||||
existing_release.set('date', args.date)
|
|
||||||
else:
|
|
||||||
print(
|
|
||||||
f"Version {args.version} is already present with date, skipping insertion.")
|
|
||||||
else:
|
|
||||||
new_release = ET.Element('release', {
|
|
||||||
'version': args.version,
|
|
||||||
'date': args.date
|
|
||||||
})
|
|
||||||
url = ET.SubElement(new_release, 'url', {'type': 'details'})
|
|
||||||
url.text = f"https://github.com/meshtastic/firmware/releases?q=tag%3Av{args.version}"
|
|
||||||
|
|
||||||
releases.insert(0, new_release)
|
|
||||||
|
|
||||||
indent(releases, level=1)
|
|
||||||
releases.tail = "\n"
|
|
||||||
|
|
||||||
print(f"Inserted new release: {args.version}")
|
|
||||||
|
|
||||||
tree.write(args.file, encoding='UTF-8', xml_declaration=True)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
defusedxml==0.7.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" $CHECK --skip-packages --pattern="src/" --fail-on-defect=medium --fail-on-defect=high
|
||||||
|
|||||||
@@ -6,12 +6,6 @@
|
|||||||
### Including the "Module:" line!
|
### Including the "Module:" line!
|
||||||
---
|
---
|
||||||
Lora:
|
Lora:
|
||||||
# Default to auto-detecting the module type
|
|
||||||
# This will be overridden by configs from config.d
|
|
||||||
Module: auto
|
|
||||||
|
|
||||||
# # Uncomment to enable Simulation mode, or use --sim
|
|
||||||
# Module: sim
|
|
||||||
|
|
||||||
# Module: sx1262 # Waveshare SX1302 LISTEN ONLY AT THIS TIME!
|
# Module: sx1262 # Waveshare SX1302 LISTEN ONLY AT THIS TIME!
|
||||||
# CS: 7
|
# CS: 7
|
||||||
@@ -96,9 +90,9 @@ Lora:
|
|||||||
### Some devices, like the pinedio, may require spidev0.1 as a workaround.
|
### Some devices, like the pinedio, may require spidev0.1 as a workaround.
|
||||||
# spidev: spidev0.0
|
# spidev: spidev0.0
|
||||||
|
|
||||||
### Deprecated location for User Button:
|
### Define GPIO buttons here:
|
||||||
|
|
||||||
#GPIO:
|
GPIO:
|
||||||
# User: 6
|
# User: 6
|
||||||
|
|
||||||
### Define GPS
|
### Define GPS
|
||||||
@@ -115,6 +109,17 @@ I2C:
|
|||||||
|
|
||||||
Display:
|
Display:
|
||||||
|
|
||||||
|
### Waveshare 1.44inch LCD HAT
|
||||||
|
# Panel: ST7735S
|
||||||
|
# CS: 8 #Chip Select
|
||||||
|
# DC: 25 # Data/Command pin
|
||||||
|
# Backlight: 24
|
||||||
|
# Width: 128
|
||||||
|
# Height: 128
|
||||||
|
# Reset: 27
|
||||||
|
# OffsetX: 0
|
||||||
|
# OffsetY: 0
|
||||||
|
|
||||||
### Adafruit PiTFT 2.8 TFT+Touchscreen
|
### Adafruit PiTFT 2.8 TFT+Touchscreen
|
||||||
# Panel: ILI9341
|
# Panel: ILI9341
|
||||||
# CS: 8
|
# CS: 8
|
||||||
@@ -169,16 +174,6 @@ Input:
|
|||||||
|
|
||||||
# KeyboardDevice: /dev/input/by-id/usb-_Raspberry_Pi_Internal_Keyboard-event-kbd
|
# KeyboardDevice: /dev/input/by-id/usb-_Raspberry_Pi_Internal_Keyboard-event-kbd
|
||||||
|
|
||||||
### Standard User Button Config
|
|
||||||
# UserButton: 6
|
|
||||||
|
|
||||||
### Trackball/Joystick input
|
|
||||||
# TrackballUp: 6
|
|
||||||
# TrackballDown: 19
|
|
||||||
# TrackballLeft: 5
|
|
||||||
# TrackballRight: 26
|
|
||||||
# TrackballPress: 13
|
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|
||||||
Logging:
|
Logging:
|
||||||
@@ -187,26 +182,14 @@ Logging:
|
|||||||
# AsciiLogs: true # default if not specified is !isatty() on stdout
|
# AsciiLogs: true # default if not specified is !isatty() on stdout
|
||||||
|
|
||||||
Webserver:
|
Webserver:
|
||||||
# Port: 9443 # Port for Webserver & Webservices
|
# Port: 443 # Port for Webserver & Webservices
|
||||||
# RootPath: /usr/share/meshtasticd/web # Root Dir of WebServer
|
# RootPath: /usr/share/meshtasticd/web # Root Dir of WebServer
|
||||||
# SSLKey: /etc/meshtasticd/ssl/private_key.pem # Path to SSL Key, generated if not present
|
# SSLKey: /etc/meshtasticd/ssl/private_key.pem # Path to SSL Key, generated if not present
|
||||||
# SSLCert: /etc/meshtasticd/ssl/certificate.pem # Path to SSL Certificate, generated if not present
|
# SSLCert: /etc/meshtasticd/ssl/certificate.pem # Path to SSL Certificate, generated if not present
|
||||||
|
|
||||||
|
|
||||||
HostMetrics:
|
|
||||||
# ReportInterval: 30 # Interval in minutes between HostMetrics report packets, or 0 for disabled
|
|
||||||
# Channel: 0 # channel to send Host Metrics over. Defaults to the primary channel.
|
|
||||||
# UserStringCommand: cat /sys/firmware/devicetree/base/serial-number # Command to execute, to send the results as the userString
|
|
||||||
|
|
||||||
|
|
||||||
Config:
|
|
||||||
# DisplayMode: TWOCOLOR # uncomment to force BaseUI
|
|
||||||
# DisplayMode: COLOR # uncomment to force MUI
|
|
||||||
|
|
||||||
General:
|
General:
|
||||||
MaxNodes: 200
|
MaxNodes: 200
|
||||||
MaxMessageQueue: 100
|
MaxMessageQueue: 100
|
||||||
ConfigDirectory: /etc/meshtasticd/config.d/
|
ConfigDirectory: /etc/meshtasticd/config.d/
|
||||||
AvailableDirectory: /etc/meshtasticd/available.d/
|
|
||||||
# MACAddress: AA:BB:CC:DD:EE:FF
|
# MACAddress: AA:BB:CC:DD:EE:FF
|
||||||
# MACAddressSource: eth0
|
# MACAddressSource: eth0
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
Display:
|
|
||||||
Panel: X11
|
|
||||||
Width: 480
|
|
||||||
Height: 480
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
### Waveshare 1.44inch LCD HAT
|
|
||||||
Display:
|
|
||||||
Panel: ST7735S
|
|
||||||
spidev: spidev0.0 # Specify either the spidev here, or the CS below
|
|
||||||
# CS: 8 #Chip Select # Optional, as this is the default pin for spidev0.0
|
|
||||||
DC: 25 # Data/Command pin
|
|
||||||
Backlight: 24
|
|
||||||
Width: 128
|
|
||||||
Height: 128
|
|
||||||
Reset: 27
|
|
||||||
OffsetX: 2
|
|
||||||
OffsetY: 1
|
|
||||||
|
|
||||||
|
|
||||||
# OffsetY: 31 # These two options are used to properly flip the screen 180 degrees
|
|
||||||
# OffsetRotate: 3
|
|
||||||
|
|
||||||
|
|
||||||
Input:
|
|
||||||
TrackballUp: 6
|
|
||||||
TrackballDown: 19
|
|
||||||
TrackballLeft: 5
|
|
||||||
TrackballRight: 26
|
|
||||||
TrackballPress: 13
|
|
||||||
TrackballDirection: FALLING
|
|
||||||
# User: 21
|
|
||||||
5
bin/config.d/lora-Adafruit-RFM9x
Normal file
5
bin/config.d/lora-Adafruit-RFM9x
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# Module: RF95 # Adafruit RFM9x
|
||||||
|
# Reset: 25
|
||||||
|
# CS: 7
|
||||||
|
# IRQ: 22
|
||||||
|
# Busy: 23
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
Lora:
|
|
||||||
Module: RF95 # Adafruit RFM9x
|
|
||||||
Reset: 25
|
|
||||||
CS: 7
|
|
||||||
IRQ: 22
|
|
||||||
# Busy: 23
|
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
# MeshAdv-Pi E22-900M30S
|
|
||||||
# https://github.com/chrismyers2000/MeshAdv-Pi-Hat
|
|
||||||
Lora:
|
Lora:
|
||||||
Module: sx1262
|
Module: sx1262
|
||||||
CS: 21
|
CS: 21
|
||||||
@@ -11,4 +9,4 @@ Lora:
|
|||||||
DIO3_TCXO_VOLTAGE: true
|
DIO3_TCXO_VOLTAGE: true
|
||||||
# Only for E22-900M33S:
|
# Only for E22-900M33S:
|
||||||
# Limit the output power to 8 dBm
|
# Limit the output power to 8 dBm
|
||||||
# SX126X_MAX_POWER: 8
|
# SX126X_MAX_POWER: 8
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
# MeshAdv Mini E22-900M22S
|
|
||||||
# https://github.com/chrismyers2000/MeshAdv-Mini
|
|
||||||
Lora:
|
|
||||||
Module: sx1262 # Ebyte E22-900M22S
|
|
||||||
CS: 8
|
|
||||||
IRQ: 16
|
|
||||||
Busy: 20
|
|
||||||
Reset: 24
|
|
||||||
RXen: 12
|
|
||||||
DIO2_AS_RF_SWITCH: true
|
|
||||||
DIO3_TCXO_VOLTAGE: true
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
Lora:
|
|
||||||
|
|
||||||
### RAK13300in Slot 1
|
|
||||||
Module: sx1262
|
|
||||||
IRQ: 22 #IO6
|
|
||||||
Reset: 16 # IO4
|
|
||||||
Busy: 24 # IO5
|
|
||||||
# Ant_sw: 13 # IO3
|
|
||||||
DIO3_TCXO_VOLTAGE: true
|
|
||||||
DIO2_AS_RF_SWITCH: true
|
|
||||||
spidev: spidev0.0
|
|
||||||
# CS: 8
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
Lora:
|
|
||||||
### RAK13300in Slot 2 pins
|
|
||||||
IRQ: 18 #IO6
|
|
||||||
Reset: 24 # IO4
|
|
||||||
Busy: 19 # IO5
|
|
||||||
# Ant_sw: 23 # IO3
|
|
||||||
spidev: spidev0.1
|
|
||||||
# CS: 7
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
Lora:
|
|
||||||
Module: sx1262
|
|
||||||
DIO2_AS_RF_SWITCH: true
|
|
||||||
DIO3_TCXO_VOLTAGE: true
|
|
||||||
gpiochip: 0
|
|
||||||
MOSI: 12
|
|
||||||
MISO: 13
|
|
||||||
IRQ: 1
|
|
||||||
Busy: 23
|
|
||||||
Reset: 22
|
|
||||||
RXen: 0
|
|
||||||
gpiochip: 1
|
|
||||||
CS: 9
|
|
||||||
SCK: 11
|
|
||||||
# TXen: bridge to DIO2 on E22 module
|
|
||||||
SX126X_MAX_POWER: 22
|
|
||||||
spidev: spidev1.0
|
|
||||||
spiSpeed: 2000000
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
Lora:
|
|
||||||
Module: lr1121
|
|
||||||
CS: 0
|
|
||||||
IRQ: 6
|
|
||||||
Reset: 2
|
|
||||||
Busy: 4
|
|
||||||
spidev: ch341
|
|
||||||
DIO3_TCXO_VOLTAGE: 1.8
|
|
||||||
# USB_Serialnum: 12345678
|
|
||||||
USB_PID: 0x5512
|
|
||||||
USB_VID: 0x1A86
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
Lora:
|
|
||||||
|
|
||||||
### Raxda Rock 2F running Armbian Linux 6.1.99-vendor-rk35xx
|
|
||||||
### https://github.com/markbirss/rock-2f
|
|
||||||
### https://github.com/markbirss/lora-starter-edition-sx1262-i2c
|
|
||||||
### https://github.com/radxa-pkg/radxa-overlays/blob/main/arch/arm64/boot/dts/rockchip/overlays/rk3528-spi0-cs1-spidev.dts
|
|
||||||
### Require install of https://github.com/radxa-pkg/radxa-overlays and rk3528-spi0-cs1-spidev.dtbo copied to /boot/dtb/rockchip/overlay and enabled
|
|
||||||
### in /boot/armbianEnv.txt - overlays=rk3528-spi0-cs1-spidev
|
|
||||||
### The Radxa Rock 2F employs multiple gpio chips.
|
|
||||||
### Each gpio pin must be unique, but can be assigned to a specific gpio chip and line.
|
|
||||||
### In case solely a no. is given, the default gpio chip and pin == line will be employed.
|
|
||||||
###
|
|
||||||
Module: sx1262 # Radxa Rock 2F + Starter Edition SX1262 HAT by Mark Birss
|
|
||||||
DIO2_AS_RF_SWITCH: true
|
|
||||||
DIO3_TCXO_VOLTAGE: 1.8
|
|
||||||
spidev: spidev0.1
|
|
||||||
CS: # NSS PIN_24 -> chip 4, line 14
|
|
||||||
pin: 24
|
|
||||||
gpiochip: 4
|
|
||||||
line: 14
|
|
||||||
SCK: # SCK PIN_23 -> chip 4, line 12
|
|
||||||
pin: 23
|
|
||||||
gpiochip: 4
|
|
||||||
line: 12
|
|
||||||
Busy: # BUSY PIN_7 -> chip 4, line 6
|
|
||||||
pin: 7
|
|
||||||
gpiochip: 4
|
|
||||||
line: 6
|
|
||||||
MOSI: # MOSI PIN_19 -> chip 4, line 10
|
|
||||||
pin: 19
|
|
||||||
gpiochip: 4
|
|
||||||
line: 10
|
|
||||||
MISO: # MISO PIN_21 -> chip 4, line 11
|
|
||||||
pin: 21
|
|
||||||
gpiochip: 4
|
|
||||||
line: 11
|
|
||||||
Reset: # NRST PIN_12 -> chip 1, line 13
|
|
||||||
pin: 12
|
|
||||||
gpiochip: 1
|
|
||||||
line: 13
|
|
||||||
IRQ: # DIO1 PIN_15 -> chip 4, line 22
|
|
||||||
pin: 15
|
|
||||||
gpiochip: 4
|
|
||||||
line: 22
|
|
||||||
# RXen: # RXEN PIN_22 -> chip 3!, line 17
|
|
||||||
# pin: 22
|
|
||||||
# gpiochip: 3
|
|
||||||
# line: 17
|
|
||||||
# TXen: RADIOLIB_NC # TXEN no PIN, no line, fallback to default gpio chip
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
# https://www.waveshare.com/core1262-868m.htm
|
|
||||||
# https://github.com/markbirss/lora-starter-edition-sx1262-i2c
|
|
||||||
Lora:
|
|
||||||
Module: sx1262 # Starter Edition SX1262 I2C Raspberry Pi HAT
|
|
||||||
DIO2_AS_RF_SWITCH: true
|
|
||||||
DIO3_TCXO_VOLTAGE: true
|
|
||||||
CS: 8
|
|
||||||
IRQ: 22
|
|
||||||
Busy: 4
|
|
||||||
Reset: 18
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
Lora:
|
|
||||||
Module: sx1262
|
|
||||||
CS: 0
|
|
||||||
IRQ: 6
|
|
||||||
Reset: 2
|
|
||||||
Busy: 4
|
|
||||||
RXen: 1
|
|
||||||
DIO2_AS_RF_SWITCH: true
|
|
||||||
DIO3_TCXO_VOLTAGE: true
|
|
||||||
spidev: ch341
|
|
||||||
USB_PID: 0x5512
|
|
||||||
USB_VID: 0x1A86
|
|
||||||
# Optional: Reduce power to 10 dBm to
|
|
||||||
# avoid over-drawing the USB port
|
|
||||||
# SX126X_MAX_POWER: 10
|
|
||||||
# Optional: Set the serial number for multi-radio support
|
|
||||||
# USB_Serialnum: 13374201
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
# https://www.waveshare.com/pico-lora-sx1262-868m.htm
|
|
||||||
# https://github.com/markbirss/lora-ws-raspberry-pi-pico-to-rpi-adapter
|
|
||||||
Lora:
|
|
||||||
Module: sx1262 # Waveshare Raspberry Pi Pico to Raspberry Pi HAT Adapter
|
|
||||||
DIO2_AS_RF_SWITCH: true
|
|
||||||
DIO3_TCXO_VOLTAGE: true
|
|
||||||
CS: 21
|
|
||||||
IRQ: 16
|
|
||||||
Busy: 20
|
|
||||||
Reset: 18
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
# https://www.waveshare.com/pico-lora-sx1262-868m.htm
|
|
||||||
# http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-Zero-3.html
|
|
||||||
#
|
|
||||||
# See Orange Pi Zero3 manual, chapter 3.16, page 124 for 26-pin header pinout
|
|
||||||
#
|
|
||||||
# Pin Connection
|
|
||||||
# Waveshare Orange Pi Zero3
|
|
||||||
# 36 3.3V 17
|
|
||||||
# 15 MOSI 19
|
|
||||||
# 16 MISO 21
|
|
||||||
# 14 CLK 23
|
|
||||||
# 38 GND 25
|
|
||||||
# 4 BUSY 18
|
|
||||||
# 20 RESET 22
|
|
||||||
# 5 CS 24
|
|
||||||
# 26 DIO1/IRQ 26
|
|
||||||
|
|
||||||
Lora:
|
|
||||||
Module: sx1262 # Waveshare Raspberry Pico Lora module
|
|
||||||
DIO2_AS_RF_SWITCH: true
|
|
||||||
DIO3_TCXO_VOLTAGE: true
|
|
||||||
# Specify either the spidev1_1 or the CS below, not both!
|
|
||||||
# On DietPi Linux, when using the user overlay dietpi-spi1_1.dtbo, CS will be configured with spidev1.1
|
|
||||||
spidev: spidev1.1 # See Orange Pi Zero3 manual, chapter 3.18.3, page 130
|
|
||||||
# CS: # CS PIN_24 -> chip 1, line 233
|
|
||||||
# pin: 24
|
|
||||||
# gpiochip: 1
|
|
||||||
# line: 233
|
|
||||||
SCK: # SCK PIN_23 -> chip 1, line 230
|
|
||||||
pin: 23
|
|
||||||
gpiochip: 1
|
|
||||||
line: 230
|
|
||||||
Busy: # BUSY PIN_18 -> chip 1, line 78
|
|
||||||
pin: 18
|
|
||||||
gpiochip: 1
|
|
||||||
line: 78
|
|
||||||
MOSI: # MOSI PIN_19 -> chip 1, line 231
|
|
||||||
pin: 19
|
|
||||||
gpiochip: 1
|
|
||||||
line: 231
|
|
||||||
MISO: # MISO PIN_21 -> chip 1, line 232
|
|
||||||
pin: 21
|
|
||||||
gpiochip: 1
|
|
||||||
line: 232
|
|
||||||
Reset: # NRST PIN_22 -> chip 1, line 71
|
|
||||||
pin: 22
|
|
||||||
gpiochip: 1
|
|
||||||
line: 71
|
|
||||||
IRQ: # DIO1 PIN_26 -> chip 1, line 74
|
|
||||||
pin: 26
|
|
||||||
gpiochip: 1
|
|
||||||
line: 74
|
|
||||||
@@ -1,317 +1,72 @@
|
|||||||
@ECHO OFF
|
@ECHO OFF
|
||||||
SETLOCAL EnableDelayedExpansion
|
|
||||||
TITLE Meshtastic device-install
|
|
||||||
|
|
||||||
SET "SCRIPT_NAME=%~nx0"
|
set PYTHON=python
|
||||||
SET "DEBUG=0"
|
set WEB_APP=0
|
||||||
SET "PYTHON="
|
|
||||||
SET "TFT_BUILD=0"
|
|
||||||
SET "BIGDB8=0"
|
|
||||||
SET "MUIDB8=0"
|
|
||||||
SET "BIGDB16=0"
|
|
||||||
SET "ESPTOOL_BAUD=115200"
|
|
||||||
SET "ESPTOOL_CMD="
|
|
||||||
SET "LOGCOUNTER=0"
|
|
||||||
SET "BPS_RESET=0"
|
|
||||||
|
|
||||||
@REM FIXME: Determine mcu from PlatformIO variant, this is unmaintainable.
|
:: Determine the correct esptool command to use
|
||||||
SET "S3=s3 v3 t-deck wireless-paper wireless-tracker station-g2 unphone t-eth-elite tlora-pager mesh-tab dreamcatcher ESP32-S3-Pico seeed-sensecap-indicator heltec_capsule_sensor_v3 vision-master icarus tracksenger elecrow-adv"
|
where esptool >nul 2>&1
|
||||||
SET "C3=esp32c3"
|
if %ERRORLEVEL% EQU 0 (
|
||||||
@REM FIXME: Determine flash size from PlatformIO variant, this is unmaintainable.
|
set "ESPTOOL_CMD=esptool"
|
||||||
SET "BIGDB_8MB=crowpanel-esp32s3 heltec_capsule_sensor_v3 heltec-v3 heltec-vision-master-e213 heltec-vision-master-e290 heltec-vision-master-t190 heltec-wireless-paper heltec-wireless-tracker heltec-wsl-v3 icarus seeed-xiao-s3 tbeam-s3-core tracksenger"
|
) else (
|
||||||
SET "MUIDB_8MB=picomputer-s3 unphone seeed-sensecap-indicator"
|
set "ESPTOOL_CMD=%PYTHON% -m esptool"
|
||||||
SET "BIGDB_16MB=t-deck mesh-tab t-energy-s3 dreamcatcher ESP32-S3-Pico m5stack-cores3 station-g2 t-eth-elite tlora-pager t-watch-s3 elecrow-adv"
|
)
|
||||||
|
|
||||||
GOTO getopts
|
goto GETOPTS
|
||||||
:help
|
:HELP
|
||||||
ECHO Flash image file to device, but first erasing and writing system information.
|
echo Usage: %~nx0 [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME^|FILENAME] [--web]
|
||||||
ECHO.
|
echo Flash image file to device, but first erasing and writing system information
|
||||||
ECHO Usage: %SCRIPT_NAME% -f filename [-p PORT] [-P python] [--1200bps-reset]
|
echo.
|
||||||
ECHO.
|
echo -h Display this help and exit
|
||||||
ECHO Options:
|
echo -p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerrous).
|
||||||
ECHO -f filename The firmware .bin file to flash. Custom to your device type and region. (required)
|
echo -P PYTHON Specify alternate python interpreter to use to invoke esptool. (Default: %PYTHON%)
|
||||||
ECHO The file must be located in this current directory.
|
echo -f FILENAME The .bin file to flash. Custom to your device type and region.
|
||||||
ECHO -p PORT Set the environment variable for ESPTOOL_PORT.
|
echo --web Flash WEB APP.
|
||||||
ECHO If not set, ESPTOOL iterates all ports (Dangerous).
|
goto EOF
|
||||||
ECHO -P python Specify alternate python interpreter to use to invoke esptool. (default: python)
|
|
||||||
ECHO If supplied the script will use python.
|
|
||||||
ECHO If not supplied the script will try to find esptool in Path.
|
|
||||||
ECHO --1200bps-reset Attempt to place the device in correct mode. (1200bps Reset)
|
|
||||||
ECHO Some hardware requires this twice.
|
|
||||||
ECHO.
|
|
||||||
ECHO Example: %SCRIPT_NAME% -p COM17 --1200bps-reset
|
|
||||||
ECHO Example: %SCRIPT_NAME% -f firmware-t-deck-tft-2.6.0.0b106d4.bin -p COM11
|
|
||||||
ECHO Example: %SCRIPT_NAME% -f firmware-unphone-2.6.0.0b106d4.bin -p COM11
|
|
||||||
GOTO eof
|
|
||||||
|
|
||||||
:version
|
:GETOPTS
|
||||||
ECHO %SCRIPT_NAME% [Version 2.6.2]
|
if /I "%1"=="-h" goto HELP
|
||||||
ECHO Meshtastic
|
if /I "%1"=="--help" goto HELP
|
||||||
GOTO eof
|
if /I "%1"=="-F" set "FILENAME=%2" & SHIFT
|
||||||
|
if /I "%1"=="-p" set ESPTOOL_PORT=%2 & SHIFT
|
||||||
:getopts
|
if /I "%1"=="-P" set PYTHON=%2 & SHIFT
|
||||||
IF "%~1"=="" GOTO endopts
|
if /I "%1"=="--web" set WEB_APP=1 & SHIFT
|
||||||
IF /I "%~1"=="-?" GOTO help
|
|
||||||
IF /I "%~1"=="-h" GOTO help
|
|
||||||
IF /I "%~1"=="--help" GOTO help
|
|
||||||
IF /I "%~1"=="-v" GOTO version
|
|
||||||
IF /I "%~1"=="--version" GOTO version
|
|
||||||
IF /I "%~1"=="--debug" SET "DEBUG=1" & CALL :LOG_MESSAGE DEBUG "DEBUG mode: enabled."
|
|
||||||
IF /I "%~1"=="-f" SET "FILENAME=%~2" & SHIFT
|
|
||||||
IF "%~1"=="-p" SET "ESPTOOL_PORT=%~2" & SHIFT
|
|
||||||
IF /I "%~1"=="--port" SET "ESPTOOL_PORT=%~2" & SHIFT
|
|
||||||
IF "%~1"=="-P" SET "PYTHON=%~2" & SHIFT
|
|
||||||
IF /I "%~1"=="--1200bps-reset" SET "BPS_RESET=1"
|
|
||||||
SHIFT
|
SHIFT
|
||||||
GOTO getopts
|
IF NOT "__%1__"=="____" goto GETOPTS
|
||||||
:endopts
|
|
||||||
|
|
||||||
IF %BPS_RESET% EQU 1 GOTO skip-filename
|
IF "__%FILENAME%__" == "____" (
|
||||||
|
echo "Missing FILENAME"
|
||||||
CALL :LOG_MESSAGE DEBUG "Checking FILENAME parameter..."
|
goto HELP
|
||||||
IF "__!FILENAME!__"=="____" (
|
)
|
||||||
CALL :LOG_MESSAGE DEBUG "Missing -f filename input."
|
IF EXIST %FILENAME% IF x%FILENAME:update=%==x%FILENAME% (
|
||||||
GOTO help
|
echo Trying to flash update %FILENAME%, but first erasing and writing system information"
|
||||||
) ELSE (
|
%ESPTOOL_CMD% --baud 115200 erase_flash
|
||||||
CALL :LOG_MESSAGE DEBUG "Filename: !FILENAME!"
|
%ESPTOOL_CMD% --baud 115200 write_flash 0x00 %FILENAME%
|
||||||
IF NOT "__!FILENAME: =!__"=="__!FILENAME!__" (
|
|
||||||
CALL :LOG_MESSAGE ERROR "Filename containing spaces are not supported."
|
@REM Account for S3 and C3 board's different OTA partition
|
||||||
GOTO help
|
IF x%FILENAME:s3=%==x%FILENAME% IF x%FILENAME:v3=%==x%FILENAME% IF x%FILENAME:t-deck=%==x%FILENAME% IF x%FILENAME:wireless-paper=%==x%FILENAME% IF x%FILENAME:wireless-tracker=%==x%FILENAME% IF x%FILENAME:station-g2=%==x%FILENAME% IF x%FILENAME:unphone=%==x%FILENAME% (
|
||||||
|
IF x%FILENAME:esp32c3=%==x%FILENAME% (
|
||||||
|
%ESPTOOL_CMD% --baud 115200 write_flash 0x260000 bleota.bin
|
||||||
|
) else (
|
||||||
|
%ESPTOOL_CMD% --baud 115200 write_flash 0x260000 bleota-c3.bin
|
||||||
|
)
|
||||||
|
) else (
|
||||||
|
%ESPTOOL_CMD% --baud 115200 write_flash 0x260000 bleota-s3.bin
|
||||||
)
|
)
|
||||||
IF "__!FILENAME:firmware-=!__"=="__!FILENAME!__" (
|
IF %WEB_APP%==1 (
|
||||||
CALL :LOG_MESSAGE ERROR "Filename must be a firmware-* file."
|
for %%f in (littlefswebui-*.bin) do (
|
||||||
GOTO help
|
%ESPTOOL_CMD% --baud 115200 write_flash 0x300000 %%f
|
||||||
|
)
|
||||||
|
) else (
|
||||||
|
for %%f in (littlefs-*.bin) do (
|
||||||
|
%ESPTOOL_CMD% --baud 115200 write_flash 0x300000 %%f
|
||||||
|
)
|
||||||
)
|
)
|
||||||
@REM Remove ".\" or "./" file prefix if present.
|
) else (
|
||||||
SET "FILENAME=!FILENAME:.\=!"
|
echo "Invalid file: %FILENAME%"
|
||||||
SET "FILENAME=!FILENAME:./=!"
|
goto HELP
|
||||||
|
) else (
|
||||||
|
echo "Invalid file: %FILENAME%"
|
||||||
|
goto HELP
|
||||||
)
|
)
|
||||||
|
|
||||||
CALL :LOG_MESSAGE DEBUG "Checking if !FILENAME! exists..."
|
:EOF
|
||||||
IF NOT EXIST !FILENAME! (
|
|
||||||
CALL :LOG_MESSAGE ERROR "File does not exist: !FILENAME!. Terminating."
|
|
||||||
GOTO eof
|
|
||||||
)
|
|
||||||
|
|
||||||
IF NOT "!FILENAME:update=!"=="!FILENAME!" (
|
|
||||||
CALL :LOG_MESSAGE DEBUG "We are working with a *update* file. !FILENAME!"
|
|
||||||
CALL :LOG_MESSAGE INFO "Use script device-update.bat to flash update !FILENAME!."
|
|
||||||
GOTO eof
|
|
||||||
) ELSE (
|
|
||||||
CALL :LOG_MESSAGE DEBUG "We are NOT working with a *update* file. !FILENAME!"
|
|
||||||
)
|
|
||||||
|
|
||||||
:skip-filename
|
|
||||||
|
|
||||||
CALL :LOG_MESSAGE DEBUG "Determine the correct esptool command to use..."
|
|
||||||
IF NOT "__%PYTHON%__"=="____" (
|
|
||||||
SET "ESPTOOL_CMD=!PYTHON! -m esptool"
|
|
||||||
CALL :LOG_MESSAGE DEBUG "Python interpreter supplied."
|
|
||||||
) ELSE (
|
|
||||||
CALL :LOG_MESSAGE DEBUG "Python interpreter NOT supplied. Looking for esptool...
|
|
||||||
WHERE esptool >nul 2>&1
|
|
||||||
IF %ERRORLEVEL% EQU 0 (
|
|
||||||
@REM WHERE exits with code 0 if esptool is found.
|
|
||||||
SET "ESPTOOL_CMD=esptool"
|
|
||||||
) ELSE (
|
|
||||||
SET "ESPTOOL_CMD=python -m esptool"
|
|
||||||
CALL :RESET_ERROR
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
CALL :LOG_MESSAGE DEBUG "Checking esptool command !ESPTOOL_CMD!..."
|
|
||||||
!ESPTOOL_CMD! >nul 2>&1
|
|
||||||
IF %ERRORLEVEL% EQU 9009 (
|
|
||||||
@REM 9009 = command not found on Windows
|
|
||||||
CALL :LOG_MESSAGE ERROR "esptool not found: !ESPTOOL_CMD!"
|
|
||||||
EXIT /B 1
|
|
||||||
)
|
|
||||||
IF %DEBUG% EQU 1 (
|
|
||||||
CALL :LOG_MESSAGE DEBUG "Skipping ESPTOOL_CMD steps."
|
|
||||||
SET "ESPTOOL_CMD=REM !ESPTOOL_CMD!"
|
|
||||||
)
|
|
||||||
|
|
||||||
CALL :LOG_MESSAGE DEBUG "Using esptool command: !ESPTOOL_CMD!"
|
|
||||||
IF "__!ESPTOOL_PORT!__" == "____" (
|
|
||||||
CALL :LOG_MESSAGE WARN "Using esptool port: UNSET."
|
|
||||||
) ELSE (
|
|
||||||
SET "ESPTOOL_CMD=!ESPTOOL_CMD! --port !ESPTOOL_PORT!"
|
|
||||||
CALL :LOG_MESSAGE INFO "Using esptool port: !ESPTOOL_PORT!."
|
|
||||||
)
|
|
||||||
CALL :LOG_MESSAGE INFO "Using esptool baud: !ESPTOOL_BAUD!."
|
|
||||||
|
|
||||||
IF %BPS_RESET% EQU 1 (
|
|
||||||
@REM Attempt to change mode via 1200bps Reset.
|
|
||||||
CALL :RUN_ESPTOOL 1200 --after no_reset read_flash_status
|
|
||||||
GOTO eof
|
|
||||||
)
|
|
||||||
|
|
||||||
@REM Check if FILENAME contains "-tft-" and set target partitionScheme accordingly.
|
|
||||||
@REM https://github.com/meshtastic/web-flasher/blob/main/types/resources.ts#L3
|
|
||||||
IF NOT "!FILENAME:-tft-=!"=="!FILENAME!" (
|
|
||||||
CALL :LOG_MESSAGE DEBUG "We are working with a *-tft-* file. !FILENAME!"
|
|
||||||
SET "TFT_BUILD=1"
|
|
||||||
) ELSE (
|
|
||||||
CALL :LOG_MESSAGE DEBUG "We are NOT working with a *-tft-* file. !FILENAME!"
|
|
||||||
)
|
|
||||||
|
|
||||||
FOR %%a IN (%BIGDB_8MB%) DO (
|
|
||||||
IF NOT "!FILENAME:%%a=!"=="!FILENAME!" (
|
|
||||||
@REM We are working with any of %BIGDB_8MB%.
|
|
||||||
SET "BIGDB8=1"
|
|
||||||
GOTO end_loop_bigdb_8mb
|
|
||||||
)
|
|
||||||
)
|
|
||||||
:end_loop_bigdb_8mb
|
|
||||||
|
|
||||||
FOR %%a IN (%MUIDB_8MB%) DO (
|
|
||||||
IF NOT "!FILENAME:%%a=!"=="!FILENAME!" (
|
|
||||||
@REM We are working with any of %MUIDB_8MB%.
|
|
||||||
SET "MUIDB8=1"
|
|
||||||
GOTO end_loop_muidb_8mb
|
|
||||||
)
|
|
||||||
)
|
|
||||||
:end_loop_muidb_8mb
|
|
||||||
|
|
||||||
FOR %%a IN (%BIGDB_16MB%) DO (
|
|
||||||
IF NOT "!FILENAME:%%a=!"=="!FILENAME!" (
|
|
||||||
@REM We are working with any of %BIGDB_16MB%.
|
|
||||||
SET "BIGDB16=1"
|
|
||||||
GOTO end_loop_bigdb_16mb
|
|
||||||
)
|
|
||||||
)
|
|
||||||
:end_loop_bigdb_16mb
|
|
||||||
|
|
||||||
IF %BIGDB8% EQU 1 CALL :LOG_MESSAGE INFO "BigDB 8mb partition selected."
|
|
||||||
IF %MUIDB8% EQU 1 CALL :LOG_MESSAGE INFO "MUIDB 8mb partition selected."
|
|
||||||
IF %BIGDB16% EQU 1 CALL :LOG_MESSAGE INFO "BigDB 16mb partition selected."
|
|
||||||
|
|
||||||
@REM Extract BASENAME from %FILENAME% for later use.
|
|
||||||
SET "BASENAME=!FILENAME:firmware-=!"
|
|
||||||
CALL :LOG_MESSAGE DEBUG "Computed firmware basename: !BASENAME!"
|
|
||||||
|
|
||||||
@REM Account for S3 and C3 board's different OTA partition.
|
|
||||||
FOR %%a IN (%S3%) DO (
|
|
||||||
IF NOT "!FILENAME:%%a=!"=="!FILENAME!" (
|
|
||||||
@REM We are working with any of %S3%.
|
|
||||||
SET "OTA_FILENAME=bleota-s3.bin"
|
|
||||||
GOTO :end_loop_s3
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
FOR %%a IN (%C3%) DO (
|
|
||||||
IF NOT "!FILENAME:%%a=!"=="!FILENAME!" (
|
|
||||||
@REM We are working with any of %C3%.
|
|
||||||
SET "OTA_FILENAME=bleota-c3.bin"
|
|
||||||
GOTO :end_loop_c3
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
@REM Everything else
|
|
||||||
SET "OTA_FILENAME=bleota.bin"
|
|
||||||
:end_loop_s3
|
|
||||||
:end_loop_c3
|
|
||||||
CALL :LOG_MESSAGE DEBUG "Set OTA_FILENAME to: !OTA_FILENAME!"
|
|
||||||
|
|
||||||
@REM Set SPIFFS filename with "littlefs-" prefix.
|
|
||||||
SET "SPIFFS_FILENAME=littlefs-%BASENAME%"
|
|
||||||
CALL :LOG_MESSAGE DEBUG "Set SPIFFS_FILENAME to: !SPIFFS_FILENAME!"
|
|
||||||
|
|
||||||
@REM Default offsets.
|
|
||||||
@REM https://github.com/meshtastic/web-flasher/blob/main/stores/firmwareStore.ts#L202
|
|
||||||
SET "OTA_OFFSET=0x260000"
|
|
||||||
SET "SPIFFS_OFFSET=0x300000"
|
|
||||||
|
|
||||||
@REM Offsets for BigDB 8mb.
|
|
||||||
IF %BIGDB8% EQU 1 (
|
|
||||||
SET "OTA_OFFSET=0x340000"
|
|
||||||
SET "SPIFFS_OFFSET=0x670000"
|
|
||||||
)
|
|
||||||
|
|
||||||
@REM Offsets for MUIDB 8mb.
|
|
||||||
IF %MUIDB8% EQU 1 (
|
|
||||||
SET "OTA_OFFSET=0x5D0000"
|
|
||||||
SET "SPIFFS_OFFSET=0x670000"
|
|
||||||
)
|
|
||||||
|
|
||||||
@REM Offsets for BigDB 16mb.
|
|
||||||
IF %BIGDB16% EQU 1 (
|
|
||||||
SET "OTA_OFFSET=0x650000"
|
|
||||||
SET "SPIFFS_OFFSET=0xc90000"
|
|
||||||
)
|
|
||||||
|
|
||||||
CALL :LOG_MESSAGE DEBUG "Set OTA_OFFSET to: !OTA_OFFSET!"
|
|
||||||
CALL :LOG_MESSAGE DEBUG "Set SPIFFS_OFFSET to: !SPIFFS_OFFSET!"
|
|
||||||
|
|
||||||
@REM Ensure target files exist before flashing operations.
|
|
||||||
IF NOT EXIST !FILENAME! CALL :LOG_MESSAGE ERROR "File does not exist: "!FILENAME!". Terminating." & EXIT /B 2 & GOTO eof
|
|
||||||
IF NOT EXIST !OTA_FILENAME! CALL :LOG_MESSAGE ERROR "File does not exist: "!OTA_FILENAME!". Terminating." & EXIT /B 2 & GOTO eof
|
|
||||||
IF NOT EXIST !SPIFFS_FILENAME! CALL :LOG_MESSAGE ERROR "File does not exist: "!SPIFFS_FILENAME!". Terminating." & EXIT /B 2 & GOTO eof
|
|
||||||
|
|
||||||
@REM Flashing operations.
|
|
||||||
CALL :LOG_MESSAGE INFO "Trying to flash "!FILENAME!", but first erasing and writing system information..."
|
|
||||||
CALL :RUN_ESPTOOL !ESPTOOL_BAUD! erase_flash || GOTO eof
|
|
||||||
CALL :RUN_ESPTOOL !ESPTOOL_BAUD! write_flash 0x00 "!FILENAME!" || GOTO eof
|
|
||||||
|
|
||||||
CALL :LOG_MESSAGE INFO "Trying to flash BLEOTA "!OTA_FILENAME!" at OTA_OFFSET !OTA_OFFSET!..."
|
|
||||||
CALL :RUN_ESPTOOL !ESPTOOL_BAUD! write_flash !OTA_OFFSET! "!OTA_FILENAME!" || GOTO eof
|
|
||||||
|
|
||||||
CALL :LOG_MESSAGE INFO "Trying to flash SPIFFS "!SPIFFS_FILENAME!" at SPIFFS_OFFSET !SPIFFS_OFFSET!..."
|
|
||||||
CALL :RUN_ESPTOOL !ESPTOOL_BAUD! write_flash !SPIFFS_OFFSET! "!SPIFFS_FILENAME!" || GOTO eof
|
|
||||||
|
|
||||||
CALL :LOG_MESSAGE INFO "Script complete!."
|
|
||||||
|
|
||||||
:eof
|
|
||||||
ENDLOCAL
|
|
||||||
EXIT /B %ERRORLEVEL%
|
|
||||||
|
|
||||||
|
|
||||||
:RUN_ESPTOOL
|
|
||||||
@REM Subroutine used to run ESPTOOL_CMD with arguments.
|
|
||||||
@REM Also handles %ERRORLEVEL%.
|
|
||||||
@REM CALL :RUN_ESPTOOL [Baud] [erase_flash|write_flash] [OFFSET] [Filename]
|
|
||||||
@REM.
|
|
||||||
@REM Example:: CALL :RUN_ESPTOOL 115200 write_flash 0x10000 "firmwarefile.bin"
|
|
||||||
IF %DEBUG% EQU 1 CALL :LOG_MESSAGE DEBUG "About to run command: !ESPTOOL_CMD! --baud %~1 %~2 %~3 %~4"
|
|
||||||
CALL :RESET_ERROR
|
|
||||||
!ESPTOOL_CMD! --baud %~1 %~2 %~3 %~4
|
|
||||||
IF %BPS_RESET% EQU 1 GOTO :eof
|
|
||||||
IF %ERRORLEVEL% NEQ 0 (
|
|
||||||
CALL :LOG_MESSAGE ERROR "Error running command: !ESPTOOL_CMD! --baud %~1 %~2 %~3 %~4"
|
|
||||||
EXIT /B %ERRORLEVEL%
|
|
||||||
)
|
|
||||||
GOTO :eof
|
|
||||||
|
|
||||||
:LOG_MESSAGE
|
|
||||||
@REM Subroutine used to print log messages in four different levels.
|
|
||||||
@REM DEBUG messages only get printed if [-d] flag is passed to script.
|
|
||||||
@REM CALL :LOG_MESSAGE [ERROR|INFO|WARN|DEBUG] "Message"
|
|
||||||
@REM.
|
|
||||||
@REM Example:: CALL :LOG_MESSAGE INFO "Message."
|
|
||||||
SET /A LOGCOUNTER=LOGCOUNTER+1
|
|
||||||
IF "%1" == "ERROR" CALL :GET_TIMESTAMP & ECHO [91m%1 [0m[37m^| !TIMESTAMP! !LOGCOUNTER! [0m[91m%~2[0m
|
|
||||||
IF "%1" == "INFO" CALL :GET_TIMESTAMP & ECHO [32m%1 [0m[37m^| !TIMESTAMP! !LOGCOUNTER! [0m[32m%~2[0m
|
|
||||||
IF "%1" == "WARN" CALL :GET_TIMESTAMP & ECHO [33m%1 [0m[37m^| !TIMESTAMP! !LOGCOUNTER! [0m[33m%~2[0m
|
|
||||||
IF "%1" == "DEBUG" IF %DEBUG% EQU 1 CALL :GET_TIMESTAMP & ECHO [34m%1 [0m[37m^| !TIMESTAMP! !LOGCOUNTER! [0m[34m%~2[0m
|
|
||||||
GOTO :eof
|
|
||||||
|
|
||||||
:GET_TIMESTAMP
|
|
||||||
@REM Subroutine used to set !TIMESTAMP! to HH:MM:ss.
|
|
||||||
@REM CALL :GET_TIMESTAMP
|
|
||||||
@REM.
|
|
||||||
@REM Updates: !TIMESTAMP!
|
|
||||||
FOR /F "tokens=1,2,3 delims=:,." %%a IN ("%TIME%") DO (
|
|
||||||
SET "HH=%%a"
|
|
||||||
SET "MM=%%b"
|
|
||||||
SET "ss=%%c"
|
|
||||||
)
|
|
||||||
SET "TIMESTAMP=!HH!:!MM!:!ss!"
|
|
||||||
GOTO :eof
|
|
||||||
|
|
||||||
:RESET_ERROR
|
|
||||||
@REM Subroutine to reset %ERRORLEVEL% to 0.
|
|
||||||
@REM CALL :RESET_ERROR
|
|
||||||
@REM.
|
|
||||||
@REM Updates: %ERRORLEVEL%
|
|
||||||
EXIT /B 0
|
|
||||||
GOTO :eof
|
|
||||||
|
|||||||
@@ -1,68 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
PYTHON=${PYTHON:-$(which python3 python | head -n 1)}
|
PYTHON=${PYTHON:-$(which python3 python | head -n 1)}
|
||||||
BPS_RESET=false
|
WEB_APP=false
|
||||||
TFT_BUILD=false
|
|
||||||
MCU=""
|
|
||||||
|
|
||||||
# Constants
|
|
||||||
RESET_BAUD=1200
|
|
||||||
FIRMWARE_OFFSET=0x00
|
|
||||||
|
|
||||||
# Variant groups
|
|
||||||
BIGDB_8MB=(
|
|
||||||
"crowpanel-esp32s3"
|
|
||||||
"heltec_capsule_sensor_v3"
|
|
||||||
"heltec-v3"
|
|
||||||
"heltec-vision-master-e213"
|
|
||||||
"heltec-vision-master-e290"
|
|
||||||
"heltec-vision-master-t190"
|
|
||||||
"heltec-wireless-paper"
|
|
||||||
"heltec-wireless-tracker"
|
|
||||||
"heltec-wsl-v3"
|
|
||||||
"icarus"
|
|
||||||
"seeed-xiao-s3"
|
|
||||||
"tbeam-s3-core"
|
|
||||||
"tracksenger"
|
|
||||||
)
|
|
||||||
MUIDB_8MB=(
|
|
||||||
"picomputer-s3"
|
|
||||||
"unphone"
|
|
||||||
"seeed-sensecap-indicator"
|
|
||||||
)
|
|
||||||
BIGDB_16MB=(
|
|
||||||
"t-deck"
|
|
||||||
"mesh-tab"
|
|
||||||
"t-energy-s3"
|
|
||||||
"dreamcatcher"
|
|
||||||
"ESP32-S3-Pico"
|
|
||||||
"m5stack-cores3"
|
|
||||||
"station-g2"
|
|
||||||
"t-eth-elite"
|
|
||||||
"tlora-pager"
|
|
||||||
"t-watch-s3"
|
|
||||||
"elecrow-adv"
|
|
||||||
)
|
|
||||||
S3_VARIANTS=(
|
|
||||||
"s3"
|
|
||||||
"-v3"
|
|
||||||
"t-deck"
|
|
||||||
"wireless-paper"
|
|
||||||
"wireless-tracker"
|
|
||||||
"station-g2"
|
|
||||||
"unphone"
|
|
||||||
"t-eth-elite"
|
|
||||||
"tlora-pager"
|
|
||||||
"mesh-tab"
|
|
||||||
"dreamcatcher"
|
|
||||||
"ESP32-S3-Pico"
|
|
||||||
"seeed-sensecap-indicator"
|
|
||||||
"heltec_capsule_sensor_v3"
|
|
||||||
"vision-master"
|
|
||||||
"icarus"
|
|
||||||
"tracksenger"
|
|
||||||
"elecrow-adv"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Determine the correct esptool command to use
|
# Determine the correct esptool command to use
|
||||||
if "$PYTHON" -m esptool version >/dev/null 2>&1; then
|
if "$PYTHON" -m esptool version >/dev/null 2>&1; then
|
||||||
@@ -80,150 +19,80 @@ set -e
|
|||||||
|
|
||||||
# Usage info
|
# Usage info
|
||||||
show_help() {
|
show_help() {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
Usage: $(basename "$0") [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME] [--1200bps-reset]
|
Usage: $(basename $0) [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME|FILENAME] [--web]
|
||||||
Flash image file to device, but first erasing and writing system information.
|
Flash image file to device, but first erasing and writing system information"
|
||||||
|
|
||||||
-h Display this help and exit.
|
-h Display this help and exit
|
||||||
-p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerous).
|
-p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerous).
|
||||||
-P PYTHON Specify alternate python interpreter to use to invoke esptool. (Default: "$PYTHON")
|
-P PYTHON Specify alternate python interpreter to use to invoke esptool. (Default: "$PYTHON")
|
||||||
-f FILENAME The firmware .bin file to flash. Custom to your device type and region.
|
-f FILENAME The .bin file to flash. Custom to your device type and region.
|
||||||
--1200bps-reset Attempt to place the device in correct mode. Some hardware requires this twice. (1200bps Reset)
|
--web Flash WEB APP.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
# Parse arguments using a single while loop
|
# Preprocess long options like --web
|
||||||
while [ $# -gt 0 ]; do
|
for arg in "$@"; do
|
||||||
case "$1" in
|
case "$arg" in
|
||||||
-h | --help)
|
--web)
|
||||||
show_help
|
WEB_APP=true
|
||||||
exit 0
|
shift # Remove this argument from the list
|
||||||
;;
|
;;
|
||||||
-p)
|
|
||||||
ESPTOOL_CMD="$ESPTOOL_CMD --port $2"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-P)
|
|
||||||
PYTHON="$2"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-f)
|
|
||||||
FILENAME="$2"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
--1200bps-reset)
|
|
||||||
BPS_RESET=true
|
|
||||||
;;
|
|
||||||
--) # Stop parsing options
|
|
||||||
shift
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Unknown argument: $1" >&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
shift # Move to the next argument
|
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ $BPS_RESET == true ]]; then
|
while getopts ":hp:P:f:" opt; do
|
||||||
$ESPTOOL_CMD --baud $RESET_BAUD --after no_reset read_flash_status
|
case "${opt}" in
|
||||||
exit 0
|
h)
|
||||||
fi
|
show_help
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
p)
|
||||||
|
export ESPTOOL_PORT=${OPTARG}
|
||||||
|
;;
|
||||||
|
P)
|
||||||
|
PYTHON=${OPTARG}
|
||||||
|
;;
|
||||||
|
f)
|
||||||
|
FILENAME=${OPTARG}
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Invalid flag."
|
||||||
|
show_help >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
shift "$((OPTIND - 1))"
|
||||||
|
|
||||||
[ -z "$FILENAME" ] && [ -n "$1" ] && {
|
[ -z "$FILENAME" -a -n "$1" ] && {
|
||||||
FILENAME="$1"
|
FILENAME=$1
|
||||||
shift
|
shift
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ "$FILENAME" != firmware-* ]]; then
|
|
||||||
echo "Filename must be a firmware-* file."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if FILENAME contains "-tft-" and set target partitionScheme accordingly.
|
|
||||||
if [[ "${FILENAME//-tft-/}" != "$FILENAME" ]]; then
|
|
||||||
TFT_BUILD=true
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Extract BASENAME from %FILENAME% for later use.
|
|
||||||
BASENAME="${FILENAME/firmware-/}"
|
|
||||||
|
|
||||||
if [ -f "${FILENAME}" ] && [ -n "${FILENAME##*"update"*}" ]; then
|
if [ -f "${FILENAME}" ] && [ -n "${FILENAME##*"update"*}" ]; then
|
||||||
# Default littlefs* offset.
|
echo "Trying to flash ${FILENAME}, but first erasing and writing system information"
|
||||||
OFFSET=0x300000
|
$ESPTOOL_CMD erase_flash
|
||||||
|
$ESPTOOL_CMD write_flash 0x00 "${FILENAME}"
|
||||||
# Default OTA Offset
|
# Account for S3 board's different OTA partition
|
||||||
OTA_OFFSET=0x260000
|
if [ -n "${FILENAME##*"s3"*}" ] && [ -n "${FILENAME##*"-v3"*}" ] && [ -n "${FILENAME##*"t-deck"*}" ] && [ -n "${FILENAME##*"wireless-paper"*}" ] && [ -n "${FILENAME##*"wireless-tracker"*}" ] && [ -n "${FILENAME##*"station-g2"*}" ] && [ -n "${FILENAME##*"unphone"*}" ]; then
|
||||||
|
if [ -n "${FILENAME##*"esp32c3"*}" ]; then
|
||||||
# littlefs* offset for BigDB 8mb and OTA OFFSET.
|
$ESPTOOL_CMD write_flash 0x260000 bleota.bin
|
||||||
for variant in "${BIGDB_8MB[@]}"; do
|
else
|
||||||
if [ -z "${FILENAME##*"$variant"*}" ]; then
|
$ESPTOOL_CMD write_flash 0x260000 bleota-c3.bin
|
||||||
OFFSET=0x670000
|
fi
|
||||||
OTA_OFFSET=0x340000
|
else
|
||||||
fi
|
$ESPTOOL_CMD write_flash 0x260000 bleota-s3.bin
|
||||||
done
|
fi
|
||||||
|
if [ "$WEB_APP" = true ]; then
|
||||||
for variant in "${MUIDB_8MB[@]}"; do
|
$ESPTOOL_CMD write_flash 0x300000 littlefswebui-*.bin
|
||||||
if [ -z "${FILENAME##*"$variant"*}" ]; then
|
else
|
||||||
OFFSET=0x670000
|
$ESPTOOL_CMD write_flash 0x300000 littlefs-*.bin
|
||||||
OTA_OFFSET=0x5D0000
|
fi
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# littlefs* offset for BigDB 16mb and OTA OFFSET.
|
|
||||||
for variant in "${BIGDB_16MB[@]}"; do
|
|
||||||
if [ -z "${FILENAME##*"$variant"*}" ]; then
|
|
||||||
OFFSET=0xc90000
|
|
||||||
OTA_OFFSET=0x650000
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Account for S3 board's different OTA partition
|
|
||||||
# FIXME: Use PlatformIO info to determine MCU type, this is unmaintainable
|
|
||||||
for variant in "${S3_VARIANTS[@]}"; do
|
|
||||||
if [ -z "${FILENAME##*"$variant"*}" ]; then
|
|
||||||
MCU="esp32s3"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ "$MCU" != "esp32s3" ]; then
|
|
||||||
if [ -n "${FILENAME##*"esp32c3"*}" ]; then
|
|
||||||
OTAFILE=bleota.bin
|
|
||||||
else
|
|
||||||
OTAFILE=bleota-c3.bin
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
OTAFILE=bleota-s3.bin
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set SPIFFS filename with "littlefs-" prefix.
|
|
||||||
SPIFFSFILE=littlefs-${BASENAME}
|
|
||||||
|
|
||||||
if [[ ! -f "$FILENAME" ]]; then
|
|
||||||
echo "Error: file ${FILENAME} wasn't found. Terminating."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ ! -f "$OTAFILE" ]]; then
|
|
||||||
echo "Error: file ${OTAFILE} wasn't found. Terminating."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ ! -f "$SPIFFSFILE" ]]; then
|
|
||||||
echo "Error: file ${SPIFFSFILE} wasn't found. Terminating."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Trying to flash ${FILENAME}, but first erasing and writing system information"
|
|
||||||
$ESPTOOL_CMD erase-flash
|
|
||||||
$ESPTOOL_CMD write-flash $FIRMWARE_OFFSET "${FILENAME}"
|
|
||||||
echo "Trying to flash ${OTAFILE} at offset ${OTA_OFFSET}"
|
|
||||||
$ESPTOOL_CMD write_flash $OTA_OFFSET "${OTAFILE}"
|
|
||||||
echo "Trying to flash ${SPIFFSFILE}, at offset ${OFFSET}"
|
|
||||||
$ESPTOOL_CMD write_flash $OFFSET "${SPIFFSFILE}"
|
|
||||||
|
|
||||||
else
|
else
|
||||||
show_help
|
show_help
|
||||||
echo "Invalid file: ${FILENAME}"
|
echo "Invalid file: ${FILENAME}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@@ -1,112 +0,0 @@
|
|||||||
<#
|
|
||||||
.SYNOPSIS
|
|
||||||
Unit-test for .\device-install.bat.
|
|
||||||
|
|
||||||
.DESCRIPTION
|
|
||||||
This script performs a positive unit-test on .\device-install.bat by creating the expected .bin
|
|
||||||
files for a device followed by running the .bat script without flashing the firmware (--debug).
|
|
||||||
If any errors are hit they are presented in the standard output. Investigate accordingly.
|
|
||||||
|
|
||||||
This script needs to be placed in the same directory as .\device-install.bat.
|
|
||||||
|
|
||||||
.EXAMPLE
|
|
||||||
.\device-install_test.ps1
|
|
||||||
|
|
||||||
.EXAMPLE
|
|
||||||
.\device-install_test.ps1 -Verbose
|
|
||||||
|
|
||||||
.LINK
|
|
||||||
.\device-install.bat --help
|
|
||||||
#>
|
|
||||||
|
|
||||||
[CmdletBinding()]
|
|
||||||
param()
|
|
||||||
|
|
||||||
function New-EmptyFile() {
|
|
||||||
[CmdletBinding()]
|
|
||||||
param (
|
|
||||||
[Parameter(Position = 0, Mandatory = $true)]
|
|
||||||
# Specifies the file name.
|
|
||||||
[string]$FileName,
|
|
||||||
[Parameter(Position = 1)]
|
|
||||||
# Specifies the target path. (Get-Location).Path is the default.
|
|
||||||
[string]$Directory = (Get-Location).Path
|
|
||||||
)
|
|
||||||
|
|
||||||
$filePath = Join-Path -Path $Directory -ChildPath $FileName
|
|
||||||
|
|
||||||
Write-Verbose -Message "Create empty test file if it doesn't exist: $($FileName)"
|
|
||||||
New-Item -Path "$filePath" -ItemType File -ErrorAction SilentlyContinue | Out-Null
|
|
||||||
}
|
|
||||||
|
|
||||||
function Remove-EmptyFile() {
|
|
||||||
[CmdletBinding()]
|
|
||||||
param (
|
|
||||||
[Parameter(Position = 0, Mandatory = $true)]
|
|
||||||
# Specifies the file name.
|
|
||||||
[string]$FileName,
|
|
||||||
[Parameter(Position = 1)]
|
|
||||||
# Specifies the target path. (Get-Location).Path is the default.
|
|
||||||
[string]$Directory = (Get-Location).Path
|
|
||||||
)
|
|
||||||
|
|
||||||
$filePath = Join-Path -Path $Directory -ChildPath $FileName
|
|
||||||
|
|
||||||
Write-Verbose -Message "Deleted empty test file: $($FileName)"
|
|
||||||
Remove-Item -Path "$filePath" | Out-Null
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$TestCases = New-Object -TypeName PSObject -Property @{
|
|
||||||
# Use this PSObject to define testcases according to this syntax:
|
|
||||||
# "testname" = @("firmware-testname","bleota","littlefs-testname","args")
|
|
||||||
"t-deck" = @("firmware-t-deck-2.6.0.0b106d4.bin", "bleota-s3.bin", "littlefs-t-deck-2.6.0.0b106d4.bin", "")
|
|
||||||
"t-deck_web" = @("firmware-t-deck-2.6.0.0b106d4.bin", "bleota-s3.bin", "littlefswebui-t-deck-2.6.0.0b106d4.bin", "--web")
|
|
||||||
"t-deck-tft" = @("firmware-t-deck-tft-2.6.0.0b106d4.bin", "bleota-s3.bin", "littlefs-t-deck-tft-2.6.0.0b106d4.bin", "")
|
|
||||||
"heltec-ht62-esp32c3" = @("firmware-heltec-ht62-esp32c3-sx1262-2.6.0.0b106d4.bin", "bleota-c3.bin", "littlefs-heltec-ht62-esp32c3-sx1262-2.6.0.0b106d4.bin", "")
|
|
||||||
"tlora-c6" = @("firmware-tlora-c6-2.6.0.0b106d4.bin", "bleota.bin", "littlefs-tlora-c6-2.6.0.0b106d4.bin", "")
|
|
||||||
"heltec-v3_web" = @("firmware-heltec-v3-2.6.0.0b106d4.bin", "bleota-s3.bin", "littlefswebui-heltec-v3-2.6.0.0b106d4.bin", "--web")
|
|
||||||
"seeed-sensecap-indicator-tft" = @("firmware-seeed-sensecap-indicator-tft-2.6.0.0b106d4.bin", "bleota.bin", "littlefs-seeed-sensecap-indicator-tft-2.6.0.0b106d4.bin", "")
|
|
||||||
"picomputer-s3-tft" = @("firmware-picomputer-s3-tft-2.6.0.0b106d4.bin", "bleota-s3.bin", "littlefs-picomputer-s3-tft-2.6.0.0b106d4.bin", "")
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($TestCase in $TestCases.PSObject.Properties) {
|
|
||||||
$Name = $TestCase.Name
|
|
||||||
$Files = $TestCase.Value
|
|
||||||
$Errors = $null
|
|
||||||
$Counter = 0
|
|
||||||
|
|
||||||
Write-Host -Object "Testcase: $Name`:" -ForegroundColor Green
|
|
||||||
foreach ($File in $Files) {
|
|
||||||
if ($File.EndsWith(".bin")) {
|
|
||||||
New-EmptyFile -FileName $File
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host -Object "Performing test on $Name..." -ForegroundColor Blue
|
|
||||||
$Test = Invoke-Expression -Command "cmd /c .\device-install.bat --debug -f $($TestCases."$Name"[0]) $($TestCases."$Name"[3])"
|
|
||||||
|
|
||||||
foreach ($Line in $Test) {
|
|
||||||
if ($Line -match "Set OTA_OFFSET to" -or `
|
|
||||||
$Line -match "Set SPIFFS_OFFSET to") {
|
|
||||||
Write-Host -Object "$($Line -replace "^.*?Set","Set")" -ForegroundColor Blue
|
|
||||||
}
|
|
||||||
elseif ($VerbosePreference -eq "Continue") {
|
|
||||||
Write-Host -Object $Line
|
|
||||||
}
|
|
||||||
if ($Line -match "ERROR") {
|
|
||||||
$Errors += $Line
|
|
||||||
$Counter++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($null -ne $Errors) {
|
|
||||||
Write-Host -Object "$Counter ERROR(s) detected!" -ForegroundColor Red
|
|
||||||
if (-not ($VerbosePreference -eq "Continue")) { Write-Host -Object $Errors }
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($File in $Files) {
|
|
||||||
if ($File.EndsWith(".bin")) {
|
|
||||||
Remove-EmptyFile -FileName $File
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,194 +1,48 @@
|
|||||||
@ECHO OFF
|
@ECHO OFF
|
||||||
SETLOCAL EnableDelayedExpansion
|
|
||||||
TITLE Meshtastic device-update
|
|
||||||
|
|
||||||
SET "SCRIPT_NAME=%~nx0"
|
set PYTHON=python
|
||||||
SET "DEBUG=0"
|
|
||||||
SET "PYTHON="
|
|
||||||
SET "ESPTOOL_BAUD=115200"
|
|
||||||
SET "RESET_BAUD=1200"
|
|
||||||
SET "UPDATE_OFFSET=0x10000"
|
|
||||||
SET "ESPTOOL_CMD="
|
|
||||||
SET "LOGCOUNTER=0"
|
|
||||||
SET "CHANGE_MODE=0"
|
|
||||||
|
|
||||||
GOTO getopts
|
:: Determine the correct esptool command to use
|
||||||
:help
|
where esptool >nul 2>&1
|
||||||
ECHO Flash image file to device, but leave existing system intact.
|
if %ERRORLEVEL% EQU 0 (
|
||||||
ECHO.
|
set "ESPTOOL_CMD=esptool"
|
||||||
ECHO Usage: %SCRIPT_NAME% -f filename [-p PORT] [-P python] [--change-mode]
|
) else (
|
||||||
ECHO.
|
set "ESPTOOL_CMD=%PYTHON% -m esptool"
|
||||||
ECHO Options:
|
)
|
||||||
ECHO -f filename The update .bin file to flash. Custom to your device type and region. (required)
|
|
||||||
ECHO The file must be located in this current directory.
|
|
||||||
ECHO -p PORT Set the environment variable for ESPTOOL_PORT.
|
|
||||||
ECHO If not set, ESPTOOL iterates all ports (Dangerous).
|
|
||||||
ECHO -P python Specify alternate python interpreter to use to invoke esptool. (default: python)
|
|
||||||
ECHO If supplied the script will use python.
|
|
||||||
ECHO If not supplied the script will try to find esptool in Path.
|
|
||||||
ECHO --change-mode Attempt to place the device in correct mode. (1200bps Reset)
|
|
||||||
ECHO Some hardware requires this twice.
|
|
||||||
ECHO.
|
|
||||||
ECHO Example: %SCRIPT_NAME% -p COM17 --change-mode
|
|
||||||
ECHO Example: %SCRIPT_NAME% -f firmware-t-deck-tft-2.6.0.0b106d4-update.bin -p COM11
|
|
||||||
GOTO eof
|
|
||||||
|
|
||||||
:version
|
goto GETOPTS
|
||||||
ECHO %SCRIPT_NAME% [Version 2.6.2]
|
:HELP
|
||||||
ECHO Meshtastic
|
echo Usage: %~nx0 [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME^|FILENAME]
|
||||||
GOTO eof
|
echo Flash image file to device, leave existing system intact.
|
||||||
|
echo.
|
||||||
|
echo -h Display this help and exit
|
||||||
|
echo -p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerrous).
|
||||||
|
echo -P PYTHON Specify alternate python interpreter to use to invoke esptool. (Default: %PYTHON%)
|
||||||
|
echo -f FILENAME The *update.bin file to flash. Custom to your device type.
|
||||||
|
goto EOF
|
||||||
|
|
||||||
:getopts
|
:GETOPTS
|
||||||
IF "%~1"=="" GOTO endopts
|
if /I "%1"=="-h" goto HELP
|
||||||
IF /I "%~1"=="-?" GOTO help
|
if /I "%1"=="--help" goto HELP
|
||||||
IF /I "%~1"=="-h" GOTO help
|
if /I "%1"=="-F" set "FILENAME=%2" & SHIFT
|
||||||
IF /I "%~1"=="--help" GOTO help
|
if /I "%1"=="-p" set ESPTOOL_PORT=%2 & SHIFT
|
||||||
IF /I "%~1"=="-v" GOTO version
|
if /I "%1"=="-P" set PYTHON=%2 & SHIFT
|
||||||
IF /I "%~1"=="--version" GOTO version
|
|
||||||
IF /I "%~1"=="--debug" SET "DEBUG=1" & CALL :LOG_MESSAGE DEBUG "DEBUG mode: enabled."
|
|
||||||
IF /I "%~1"=="-f" SET "FILENAME=%~2" & SHIFT
|
|
||||||
IF "%~1"=="-p" SET "ESPTOOL_PORT=%~2" & SHIFT
|
|
||||||
IF /I "%~1"=="--port" SET "ESPTOOL_PORT=%~2" & SHIFT
|
|
||||||
IF "%~1"=="-P" SET "PYTHON=%~2" & SHIFT
|
|
||||||
IF /I "%~1"=="--change-mode" SET "CHANGE_MODE=1"
|
|
||||||
SHIFT
|
SHIFT
|
||||||
GOTO getopts
|
IF NOT "__%1__"=="____" goto GETOPTS
|
||||||
:endopts
|
|
||||||
|
|
||||||
IF %CHANGE_MODE% EQU 1 GOTO skip-filename
|
IF "__%FILENAME%__" == "____" (
|
||||||
|
echo "Missing FILENAME"
|
||||||
CALL :LOG_MESSAGE DEBUG "Checking FILENAME parameter..."
|
goto HELP
|
||||||
IF "__!FILENAME!__"=="____" (
|
)
|
||||||
CALL :LOG_MESSAGE DEBUG "Missing -f filename input."
|
IF EXIST %FILENAME% IF NOT x%FILENAME:update=%==x%FILENAME% (
|
||||||
GOTO help
|
echo Trying to flash update %FILENAME%
|
||||||
) ELSE (
|
%ESPTOOL_CMD% --baud 115200 write_flash 0x10000 %FILENAME%
|
||||||
CALL :LOG_MESSAGE DEBUG "Filename: !FILENAME!"
|
) else (
|
||||||
IF NOT "__!FILENAME: =!__"=="__!FILENAME!__" (
|
echo "Invalid file: %FILENAME%"
|
||||||
CALL :LOG_MESSAGE ERROR "Filename containing spaces are not supported."
|
goto HELP
|
||||||
GOTO help
|
) else (
|
||||||
)
|
echo "Invalid file: %FILENAME%"
|
||||||
@REM Remove ".\" or "./" file prefix if present.
|
goto HELP
|
||||||
SET "FILENAME=!FILENAME:.\=!"
|
|
||||||
SET "FILENAME=!FILENAME:./=!"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
CALL :LOG_MESSAGE DEBUG "Checking if !FILENAME! exists..."
|
:EOF
|
||||||
IF NOT EXIST !FILENAME! (
|
|
||||||
CALL :LOG_MESSAGE ERROR "File does not exist: !FILENAME!. Terminating."
|
|
||||||
GOTO eof
|
|
||||||
)
|
|
||||||
|
|
||||||
IF "!FILENAME:update=!"=="!FILENAME!" (
|
|
||||||
CALL :LOG_MESSAGE DEBUG "We are NOT working with a *update* file. !FILENAME!"
|
|
||||||
CALL :LOG_MESSAGE INFO "Use script device-install.bat to flash !FILENAME!."
|
|
||||||
GOTO eof
|
|
||||||
) ELSE (
|
|
||||||
CALL :LOG_MESSAGE DEBUG "We are working with a *update* file. !FILENAME!"
|
|
||||||
)
|
|
||||||
|
|
||||||
:skip-filename
|
|
||||||
|
|
||||||
CALL :LOG_MESSAGE DEBUG "Determine the correct esptool command to use..."
|
|
||||||
IF NOT "__%PYTHON%__"=="____" (
|
|
||||||
SET "ESPTOOL_CMD=""!PYTHON!"" -m esptool"
|
|
||||||
CALL :LOG_MESSAGE DEBUG "Python interpreter supplied."
|
|
||||||
) ELSE (
|
|
||||||
CALL :LOG_MESSAGE DEBUG "Python interpreter NOT supplied. Looking for esptool..."
|
|
||||||
WHERE esptool >nul 2>&1
|
|
||||||
IF %ERRORLEVEL% EQU 0 (
|
|
||||||
@REM WHERE exits with code 0 if esptool is found.
|
|
||||||
SET "ESPTOOL_CMD=esptool"
|
|
||||||
) ELSE (
|
|
||||||
SET "ESPTOOL_CMD=python -m esptool"
|
|
||||||
CALL :RESET_ERROR
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
CALL :LOG_MESSAGE DEBUG "Checking esptool command !ESPTOOL_CMD!..."
|
|
||||||
!ESPTOOL_CMD! >nul 2>&1
|
|
||||||
CALL :LOG_MESSAGE DEBUG "esptool exit code: %ERRORLEVEL%"
|
|
||||||
IF %ERRORLEVEL% EQU 9009 (
|
|
||||||
@REM 9009 = command not found on Windows
|
|
||||||
CALL :LOG_MESSAGE ERROR "esptool not found: !ESPTOOL_CMD!"
|
|
||||||
EXIT /B 1
|
|
||||||
)
|
|
||||||
IF %DEBUG% EQU 1 (
|
|
||||||
CALL :LOG_MESSAGE DEBUG "Skipping ESPTOOL_CMD steps."
|
|
||||||
SET "ESPTOOL_CMD=REM !ESPTOOL_CMD!"
|
|
||||||
)
|
|
||||||
|
|
||||||
CALL :LOG_MESSAGE DEBUG "Using esptool command: !ESPTOOL_CMD!"
|
|
||||||
IF "__!ESPTOOL_PORT!__" == "____" (
|
|
||||||
CALL :LOG_MESSAGE WARN "Using esptool port: UNSET."
|
|
||||||
) ELSE (
|
|
||||||
SET "ESPTOOL_CMD=!ESPTOOL_CMD! --port !ESPTOOL_PORT!"
|
|
||||||
CALL :LOG_MESSAGE INFO "Using esptool port: !ESPTOOL_PORT!."
|
|
||||||
)
|
|
||||||
CALL :LOG_MESSAGE INFO "Using esptool baud: !ESPTOOL_BAUD!."
|
|
||||||
|
|
||||||
IF %CHANGE_MODE% EQU 1 (
|
|
||||||
@REM Attempt to change mode via 1200bps Reset.
|
|
||||||
CALL :RUN_ESPTOOL !RESET_BAUD! --after no_reset read_flash_status
|
|
||||||
GOTO eof
|
|
||||||
)
|
|
||||||
|
|
||||||
@REM Flashing operations.
|
|
||||||
CALL :LOG_MESSAGE INFO "Trying to flash update "!FILENAME!" at OFFSET !UPDATE_OFFSET!..."
|
|
||||||
CALL :RUN_ESPTOOL !ESPTOOL_BAUD! write-flash !UPDATE_OFFSET! "!FILENAME!" || GOTO eof
|
|
||||||
|
|
||||||
CALL :LOG_MESSAGE INFO "Script complete!."
|
|
||||||
|
|
||||||
:eof
|
|
||||||
ENDLOCAL
|
|
||||||
EXIT /B %ERRORLEVEL%
|
|
||||||
|
|
||||||
|
|
||||||
:RUN_ESPTOOL
|
|
||||||
@REM Subroutine used to run ESPTOOL_CMD with arguments.
|
|
||||||
@REM Also handles %ERRORLEVEL%.
|
|
||||||
@REM CALL :RUN_ESPTOOL [Baud] [erase-flash|write-flash] [OFFSET] [Filename]
|
|
||||||
@REM.
|
|
||||||
@REM Example:: CALL :RUN_ESPTOOL 115200 write-flash 0x10000 "firmwarefile.bin"
|
|
||||||
IF %DEBUG% EQU 1 CALL :LOG_MESSAGE DEBUG "About to run command: !ESPTOOL_CMD! --baud %~1 %~2 %~3 %~4"
|
|
||||||
CALL :RESET_ERROR
|
|
||||||
!ESPTOOL_CMD! --baud %~1 %~2 %~3 %~4
|
|
||||||
IF %CHANGE_MODE% EQU 1 GOTO :eof
|
|
||||||
IF %ERRORLEVEL% NEQ 0 (
|
|
||||||
CALL :LOG_MESSAGE ERROR "Error running command: !ESPTOOL_CMD! --baud %~1 %~2 %~3 %~4"
|
|
||||||
EXIT /B %ERRORLEVEL%
|
|
||||||
)
|
|
||||||
GOTO :eof
|
|
||||||
|
|
||||||
:LOG_MESSAGE
|
|
||||||
@REM Subroutine used to print log messages in four different levels.
|
|
||||||
@REM DEBUG messages only get printed if [-d] flag is passed to script.
|
|
||||||
@REM CALL :LOG_MESSAGE [ERROR|INFO|WARN|DEBUG] "Message"
|
|
||||||
@REM.
|
|
||||||
@REM Example:: CALL :LOG_MESSAGE INFO "Message."
|
|
||||||
SET /A LOGCOUNTER=LOGCOUNTER+1
|
|
||||||
IF "%1" == "ERROR" CALL :GET_TIMESTAMP & ECHO [91m%1 [0m[37m^| !TIMESTAMP! !LOGCOUNTER! [0m[91m%~2[0m
|
|
||||||
IF "%1" == "INFO" CALL :GET_TIMESTAMP & ECHO [32m%1 [0m[37m^| !TIMESTAMP! !LOGCOUNTER! [0m[32m%~2[0m
|
|
||||||
IF "%1" == "WARN" CALL :GET_TIMESTAMP & ECHO [33m%1 [0m[37m^| !TIMESTAMP! !LOGCOUNTER! [0m[33m%~2[0m
|
|
||||||
IF "%1" == "DEBUG" IF %DEBUG% EQU 1 CALL :GET_TIMESTAMP & ECHO [34m%1 [0m[37m^| !TIMESTAMP! !LOGCOUNTER! [0m[34m%~2[0m
|
|
||||||
GOTO :eof
|
|
||||||
|
|
||||||
:GET_TIMESTAMP
|
|
||||||
@REM Subroutine used to set !TIMESTAMP! to HH:MM:ss.
|
|
||||||
@REM CALL :GET_TIMESTAMP
|
|
||||||
@REM.
|
|
||||||
@REM Updates: !TIMESTAMP!
|
|
||||||
FOR /F "tokens=1,2,3 delims=:,." %%a IN ("%TIME%") DO (
|
|
||||||
SET "HH=%%a"
|
|
||||||
SET "MM=%%b"
|
|
||||||
SET "ss=%%c"
|
|
||||||
)
|
|
||||||
SET "TIMESTAMP=!HH!:!MM!:!ss!"
|
|
||||||
GOTO :eof
|
|
||||||
|
|
||||||
:RESET_ERROR
|
|
||||||
@REM Subroutine to reset %ERRORLEVEL% to 0.
|
|
||||||
@REM CALL :RESET_ERROR
|
|
||||||
@REM.
|
|
||||||
@REM Updates: %ERRORLEVEL%
|
|
||||||
EXIT /B 0
|
|
||||||
GOTO :eof
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user