Skip to content

Commit

Permalink
Merge branch 'master' into chatter-keypad-support
Browse files Browse the repository at this point in the history
  • Loading branch information
thebentern authored Jul 30, 2024
2 parents 952c5bb + 302caa8 commit b529d67
Show file tree
Hide file tree
Showing 288 changed files with 18,070 additions and 3,111 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/Bug Report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ body:
- Raspberry Pi Pico (W)
- Relay v1
- Relay v2
- Seeed Wio Tracker 1110
- DIY
- Other
validations:
Expand Down
21 changes: 11 additions & 10 deletions .github/actions/setup-base/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,31 @@ runs:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}

- name: Install dependencies
- name: Install dependencies
shell: bash
run: |
sudo apt-get -y update
sudo apt-get -y update --fix-missing
sudo apt-get install -y cppcheck libbluetooth-dev libgpiod-dev libyaml-cpp-dev
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.x

- name: Cache python libs
uses: actions/cache@v4
id: cache-pip # needed in if test
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
# - name: Cache python libs
# uses: actions/cache@v4
# id: cache-pip # needed in if test
# with:
# path: ~/.cache/pip
# key: ${{ runner.os }}-pip

- name: Upgrade python tools
shell: bash
run: |
python -m pip install --upgrade pip
pip install -U platformio adafruit-nrfutil
pip install -U meshtastic --pre
pip install -U --no-build-isolation --no-cache-dir "setuptools<72"
pip install -U platformio adafruit-nrfutil --no-build-isolation
pip install -U meshtastic --pre --no-build-isolation
- name: Upgrade platformio
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Install libbluetooth
shell: bash
run: |
sudo apt-get update
sudo apt-get update --fix-missing
sudo apt-get install -y libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev libulfius-dev liborcania-dev
- name: Checkout code
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build_nrf52.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
name: firmware-${{ inputs.board }}-${{ steps.version.outputs.version }}.zip
overwrite: true
path: |
release/*.hex
release/*.uf2
release/*.elf
release/*.zip
1 change: 1 addition & 0 deletions .github/workflows/build_raspbian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
- name: Install libbluetooth
shell: bash
run: |
apt-get update -y --fix-missing
apt-get install -y libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev libulfius-dev liborcania-dev
- name: Checkout code
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build_raspbian_armv7l.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
- name: Install libbluetooth
shell: bash
run: |
apt-get update -y --fix-missing
apt-get install -y libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev libulfius-dev liborcania-dev
- name: Checkout code
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/build_stm32.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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 base
id: base
uses: ./.github/actions/setup-base

- name: Build STM32
run: bin/build-stm32.sh ${{ inputs.board }}

- name: Get release version string
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
id: version

- name: Store binaries as an artifact
uses: actions/upload-artifact@v4
with:
name: firmware-${{ inputs.board }}-${{ steps.version.outputs.version }}.zip
overwrite: true
path: |
release/*.hex
release/*.bin
18 changes: 15 additions & 3 deletions .github/workflows/main_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
arch: [esp32, esp32s3, esp32c3, nrf52840, rp2040, check]
arch: [esp32, esp32s3, esp32c3, nrf52840, rp2040, stm32, check]
runs-on: ubuntu-latest
steps:
- id: checkout
Expand All @@ -41,6 +41,7 @@ jobs:
esp32c3: ${{ steps.jsonStep.outputs.esp32c3 }}
nrf52840: ${{ steps.jsonStep.outputs.nrf52840 }}
rp2040: ${{ steps.jsonStep.outputs.rp2040 }}
stm32: ${{ steps.jsonStep.outputs.stm32 }}
check: ${{ steps.jsonStep.outputs.check }}

check:
Expand Down Expand Up @@ -103,6 +104,15 @@ jobs:
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 }}

package-raspbian:
uses: ./.github/workflows/package_raspbian.yml

Expand Down Expand Up @@ -134,9 +144,10 @@ jobs:
build-esp32-c3,
build-nrf52,
build-rpi2040,
build-stm32,
package-raspbian,
package-raspbian-armv7l,
package-native
package-native,
]
steps:
- name: Checkout code
Expand Down Expand Up @@ -168,6 +179,7 @@ jobs:
path: |
./firmware-*.bin
./firmware-*.uf2
./firmware-*.hex
./firmware-*-ota.zip
./device-*.sh
./device-*.bat
Expand Down Expand Up @@ -254,7 +266,7 @@ jobs:
chmod +x ./output/device-update.sh
- name: Zip firmware
run: zip -j -9 -r ./firmware-${{ steps.version.outputs.version }}.zip ./output
run: zip -j -9 -r ./firmware-${{ steps.version.outputs.version }}.zip ./output -x *.deb

- uses: actions/download-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .semgrepignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.github/workflows/main_matrix.yml
src/mesh/compression/unishox2.c
src/mesh/compression/unishox2.cpp
2 changes: 2 additions & 0 deletions .trunk/configs/.bandit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[bandit]
skips = B101
6 changes: 5 additions & 1 deletion .trunk/trunk.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 0.1
cli:
version: 1.22.1
version: 1.22.2
plugins:
sources:
- id: trunk
Expand Down Expand Up @@ -31,6 +31,10 @@ lint:
- [email protected]
- [email protected]
- [email protected]
ignore:
- linters: [ALL]
paths:
- bin/**
runtimes:
enabled:
- [email protected]
Expand Down
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"ms-vscode.cpptools",
"ms-vscode.cpptools",
"platformio.platformio-ide",
"trunk.io"
],
Expand Down
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@
"editor.defaultFormatter": "trunk.io",
"trunk.enableWindows": true,
"files.insertFinalNewline": false,
"files.trimFinalNewlines": false
"files.trimFinalNewlines": false,
"cmake.configureOnOpen": false,
"[cpp]": {
"editor.defaultFormatter": "trunk.io"
}
}
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ ENV TZ=Etc/UTC
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
ENV LANG C.UTF-8

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Install build deps
USER root

Expand All @@ -24,10 +22,10 @@ USER mesh

WORKDIR /tmp/firmware
RUN python3 -m venv /tmp/firmware
RUN source ./bin/activate && pip3 install --no-cache-dir -U platformio==6.1.14
RUN bash -o pipefail -c "source bin/activate; pip3 install --no-cache-dir -U platformio==6.1.15"
# trunk-ignore(terrascan/AC_DOCKER_00024): We would actually like these files to be owned by mesh tyvm
COPY --chown=mesh:mesh . /tmp/firmware
RUN source ./bin/activate && chmod +x /tmp/firmware/bin/build-native.sh && ./bin/build-native.sh
RUN bash -o pipefail -c "source ./bin/activate && bash ./bin/build-native.sh"
RUN cp "/tmp/firmware/release/meshtasticd_linux_$(uname -m)" "/tmp/firmware/release/meshtasticd"


Expand All @@ -48,6 +46,7 @@ USER mesh
WORKDIR /home/mesh
COPY --from=builder /tmp/firmware/release/meshtasticd /home/mesh/

RUN mkdir data
VOLUME /home/mesh/data

CMD [ "sh", "-cx", "./meshtasticd -d /home/mesh/data --hwid=${HWID:-$RANDOM}" ]
Expand Down
2 changes: 1 addition & 1 deletion arch/esp32/esp32.ini
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ lib_deps =
${networking_base.lib_deps}
${environmental_base.lib_deps}
https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2
h2zero/NimBLE-Arduino@^1.4.1
h2zero/NimBLE-Arduino@^1.4.2
https://github.com/dbSuS/libpax.git#7bcd3fcab75037505be9b122ab2b24cc5176b587
https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f
Expand Down
2 changes: 1 addition & 1 deletion arch/nrf52/nrf52.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[nrf52_base]
; Instead of the standard nordicnrf52 platform, we use our fork which has our added variant files
platform = platformio/nordicnrf52@^10.4.0
platform = platformio/nordicnrf52@^10.5.0
extends = arduino_base

build_type = debug
Expand Down
36 changes: 36 additions & 0 deletions arch/stm32/stm32.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[stm32_base]
extends = arduino_base
platform = ststm32
platform_packages = platformio/framework-arduinoststm32@https://github.com/stm32duino/Arduino_Core_STM32.git#361a7fdb67e2a7104e99b4f42a802469eef8b129

build_type = release

;board_build.flash_offset = 0x08000000

build_flags =
${arduino_base.build_flags}
-flto
-Isrc/platform/stm32wl -g
-DMESHTASTIC_MINIMIZE_BUILD
-DDEBUG_MUTE
; -DVECT_TAB_OFFSET=0x08000000
-DconfigUSE_CMSIS_RTOS_V2=1
; -DSPI_MODE_0=SPI_MODE0
-fmerge-all-constants
-ffunction-sections
-fdata-sections

build_src_filter =
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<mesh/api/> -<mesh/wifi/> -<mesh/http/> -<modules/esp32> -<mesh/eth/> -<input> -<buzz> -<modules/Telemetry> -<platform/nrf52> -<platform/portduino> -<platform/rp2040> -<mesh/raspihttp>

board_upload.offset_address = 0x08000000
upload_protocol = stlink

lib_deps =
${env.lib_deps}
charlesbaynham/OSFS@^1.2.3
https://github.com/caveman99/Crypto.git#f61ae26a53f7a2d0ba5511625b8bf8eff3a35d5e

lib_ignore =
mathertel/OneButton
Wire
28 changes: 0 additions & 28 deletions arch/stm32/stm32wl5e.ini

This file was deleted.

2 changes: 1 addition & 1 deletion bin/build-esp32.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ rm -f $OUTDIR/firmware*
rm -r $OUTDIR/* || true

# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
platformio pkg update
platformio pkg update -e $1

echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS"
rm -f .pio/build/$1/firmware.*
Expand Down
Loading

0 comments on commit b529d67

Please sign in to comment.