Compare commits
21
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a8ec3710ac | ||
|
|
4891a799bb | ||
|
|
ddc5ab4bd7 | ||
|
|
0eef523201 | ||
|
|
b6c251d406 | ||
|
|
5ad3c606cc | ||
|
|
03d17d8863 | ||
|
|
77f4af1bbb | ||
|
|
de9c860081 | ||
|
|
ca4c8e6206 | ||
|
|
e5e56f4372 | ||
|
|
c32ba219dd | ||
|
|
7b2135412a | ||
|
|
0cc30308e9 | ||
|
|
7a7c894e2d | ||
|
|
22700192bd | ||
|
|
eb8fdb5e06 | ||
|
|
f88242f2a6 | ||
|
|
c2036b9502 | ||
|
|
716e76c731 | ||
|
|
82bf0782f6 |
No files matched your search
@@ -11,25 +11,20 @@ runs:
|
||||
~/.platformio/.cache
|
||||
key: ${{ runner.os }}-pio
|
||||
|
||||
# CUSTOM (TeTeHacko): no actions/setup-python (upstream: '3.13'). Its
|
||||
# Python for Ubuntu 26.04, the runner image, is built for x86-64-v3 and
|
||||
# grg-runner (Xeon E5-2630L v2) has only v2: "CPU ISA level is lower than
|
||||
# required" on every run. The image's own python3 runs anywhere and the
|
||||
# build needs no particular 3.x, so the build runs in a venv of it.
|
||||
- name: Install Python
|
||||
id: python
|
||||
continue-on-error: true
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.13'
|
||||
|
||||
# CUSTOM (TeTeHacko): setup-python's build for the runner OS can need a
|
||||
# newer CPU than the runner host has ("CPU ISA level is lower than
|
||||
# required"); fall back to the image's own python3 in a venv
|
||||
- name: Python fallback
|
||||
if: steps.python.outcome == 'failure'
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
SUDO="$(command -v sudo || true)"
|
||||
venv="$RUNNER_TEMP/pyenv"
|
||||
if ! python3 -m venv "$venv"; then
|
||||
apt-get update -qq
|
||||
apt-get install -y -qq python3 python3-venv
|
||||
$SUDO apt-get update -qq
|
||||
$SUDO apt-get install -y -qq python3 python3-venv
|
||||
python3 -m venv --clear "$venv"
|
||||
fi
|
||||
# The image's python is often newer than the wheels on PyPI (detools
|
||||
@@ -37,8 +32,8 @@ runs:
|
||||
# headers, which the image does not ship.
|
||||
inc="$("$venv/bin/python" -c 'import sysconfig; print(sysconfig.get_paths()["include"])')"
|
||||
if [ ! -e "$inc/Python.h" ]; then
|
||||
apt-get update -qq
|
||||
apt-get install -y -qq python3-dev
|
||||
$SUDO apt-get update -qq
|
||||
$SUDO apt-get install -y -qq python3-dev
|
||||
fi
|
||||
echo "$venv/bin" >>"$GITHUB_PATH"
|
||||
"$venv/bin/python" --version
|
||||
|
||||
@@ -36,10 +36,29 @@
|
||||
#
|
||||
# dry_run: the same build anywhere (the private repo too), no release -- the
|
||||
# result goes up as a workflow artifact. Delta bases always come from the
|
||||
# public repo's releases.
|
||||
# public repo's releases. A pull request that changes a dependency pin
|
||||
# (platformio.ini, platformio.lock -- Renovate's) runs as a dry run too, and is
|
||||
# what Renovate waits for before it merges.
|
||||
#
|
||||
# Libraries come from platformio.lock (tools/pio_lock.py): installed before
|
||||
# each env's first build, and the build fails when anything else resolved.
|
||||
# Platform and toolchain are pinned in platformio.ini. ~/.platformio keeps
|
||||
# every version it ever installed side by side (platforms/<name>@<version>,
|
||||
# packages likewise) and a build takes the pinned one, so the cache is one
|
||||
# growing store: the newest is restored, new versions are added and saved
|
||||
# under a new key only when a pin changed. Libraries are not cached: small,
|
||||
# and an old version in .pio/libdeps/<env> would fail the lock check.
|
||||
name: pub-release
|
||||
|
||||
"on":
|
||||
pull_request:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "platformio.ini"
|
||||
- "platformio.lock"
|
||||
- "variants/**/platformio.ini"
|
||||
- ".github/workflows/pub-release.yml"
|
||||
- ".github/fw-flags.sh"
|
||||
push:
|
||||
branches: [main]
|
||||
paths-ignore:
|
||||
@@ -70,8 +89,14 @@ name: pub-release
|
||||
required: false
|
||||
default: ""
|
||||
|
||||
# Releases queue one after another (tag numbering); a pull request's check
|
||||
# and a dry run each in their own group: Gitea keeps ONE pending run per
|
||||
# group, so a push to main (twice a day) would cancel a waiting PR check and
|
||||
# Renovate's automerge would never come.
|
||||
concurrency:
|
||||
group: pub-release
|
||||
group: >-
|
||||
pub-release-${{ github.event_name == 'pull_request' && github.ref
|
||||
|| (github.event.inputs.dry_run == 'true' && 'dry' || 'release') }}
|
||||
cancel-in-progress: false
|
||||
|
||||
env:
|
||||
@@ -86,6 +111,9 @@ env:
|
||||
Xiao_nrf52_repeater Xiao_nrf52_room_server Xiao_nrf52_sensor SenseCap_Solar_repeater
|
||||
RAK_4631_repeater RAK_4631_room_server t1000e_repeater Heltec_t114_repeater
|
||||
PUB_REPO: tth-pub/meshcore-tth # where delta bases come from, dry run or not
|
||||
# grg-runner: 24 cores, up to 8 jobs of its own; 6 builds x 6 compilers
|
||||
PARALLEL: 6
|
||||
PIO_JOBS: 6
|
||||
ENVS: >-
|
||||
Xiao_nrf52_repeater Xiao_nrf52_companion_radio_ble Xiao_nrf52_room_server Xiao_nrf52_sensor
|
||||
SenseCap_Solar_repeater SenseCap_Solar_companion_radio_ble
|
||||
@@ -96,8 +124,12 @@ env:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
if: github.repository == 'tth-pub/meshcore-tth' || github.event.inputs.dry_run == 'true'
|
||||
if: >-
|
||||
github.repository == 'tth-pub/meshcore-tth' || github.event.inputs.dry_run == 'true'
|
||||
|| github.event_name == 'pull_request'
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DRY: ${{ github.event.inputs.dry_run == 'true' || github.event_name == 'pull_request' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -109,7 +141,6 @@ jobs:
|
||||
env:
|
||||
TOKEN: ${{ secrets.GITEA_TOKEN || github.token }}
|
||||
REPLACE: ${{ github.event.inputs.replace }}
|
||||
DRY: ${{ github.event.inputs.dry_run }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
git fetch -q --tags
|
||||
@@ -157,6 +188,16 @@ jobs:
|
||||
echo "title=$title"
|
||||
} >>"$GITHUB_OUTPUT"
|
||||
|
||||
# one store of every platform/toolchain version (see the header)
|
||||
- name: PlatformIO platforms and packages
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
~/.platformio/platforms
|
||||
~/.platformio/packages
|
||||
key: pio-store-${{ hashFiles('platformio.ini', 'variants/**/platformio.ini') }}
|
||||
restore-keys: pio-store-
|
||||
|
||||
- name: Setup Build Environment
|
||||
uses: ./.github/actions/setup-build-environment
|
||||
|
||||
@@ -166,7 +207,6 @@ jobs:
|
||||
TAG: ${{ steps.src.outputs.tag }}
|
||||
OTA_SIGNING_KEY: ${{ secrets.OTA_SIGNING_KEY }}
|
||||
TOKEN: ${{ secrets.GITEA_TOKEN || github.token }}
|
||||
DRY: ${{ github.event.inputs.dry_run }}
|
||||
BASES_REPO: ${{ github.event.inputs.bases_repo }}
|
||||
ONLY: ${{ github.event.inputs.only }}
|
||||
run: |
|
||||
@@ -224,14 +264,107 @@ jobs:
|
||||
fi
|
||||
done <"$bases/releases.jsonl"
|
||||
}
|
||||
# build <env> <extra flags> <name suffix> [ota variant]; PlatformIO
|
||||
# appends PLATFORMIO_BUILD_FLAGS after each env's flags: last -D wins
|
||||
build() {
|
||||
local env=$1 suffix=$3 variant=${4:-} b v
|
||||
if [ -n "$ONLY" ] && [[ " $ONLY " != *" $env$suffix "* ]]; then return 0; fi
|
||||
echo "::group::$env$suffix"
|
||||
FW_OTA_VARIANT=$variant PLATFORMIO_BUILD_FLAGS="$PUB_FLAGS $2" pio run -e "$env"
|
||||
b=".pio/build/$env"
|
||||
# The artifacts: <env>|<extra flags>|<name suffix>|<ota variant>.
|
||||
# PlatformIO appends PLATFORMIO_BUILD_FLAGS after each env's flags:
|
||||
# last -D wins.
|
||||
arts=()
|
||||
declare -A spec=()
|
||||
add() {
|
||||
if [ -n "$ONLY" ] && [[ " $ONLY " != *" $1$3 "* ]]; then return 0; fi
|
||||
arts+=("$1$3")
|
||||
spec[$1$3]="$1|$2|$3|${4:-}"
|
||||
}
|
||||
for env in $ENVS; do add "$env" "" ""; done
|
||||
for env in $OBS_ENVS; do add "$env" "$OBS_FLAGS" "-observer"; done
|
||||
for env in $OTA_ENVS; do add "$env" "-D FW_OTA=1" "-ota" ota; done
|
||||
for env in $OBS_ENVS; do add "$env" "$OBS_FLAGS -D FW_OTA=1" "-observer-ota" observer-ota; done
|
||||
# Builds run PARALLEL at a time: one by one they took 38 of the run's
|
||||
# 40 minutes on a 24-core runner that sat mostly idle.
|
||||
bdir="$RUNNER_TEMP/build" logs="$RUNNER_TEMP/logs"
|
||||
mkdir -p "$bdir" "$logs"
|
||||
# par <function> <name>...: `<function> <name>` PARALLEL at a time,
|
||||
# output to $logs/<name>.log, exit code to $logs/<name>.rc
|
||||
par() {
|
||||
local fn=$1 n running=0
|
||||
shift
|
||||
for n in "$@"; do
|
||||
if [ "$running" -ge "$PARALLEL" ]; then wait -n || :; running=$((running - 1)); fi
|
||||
(set +e; "$fn" "$n"; echo $? >"$logs/$n.rc") >"$logs/$n.log" 2>&1 &
|
||||
running=$((running + 1))
|
||||
done
|
||||
wait
|
||||
}
|
||||
# report <title> <name>...: each log as a group, in this order; fails
|
||||
# the step, with the tails of the failed ones, if any failed
|
||||
report() {
|
||||
local title=$1 n rc failed=()
|
||||
shift
|
||||
for n in "$@"; do
|
||||
rc=$(cat "$logs/$n.rc" 2>/dev/null || echo "?")
|
||||
echo "::group::$n (rc $rc)"
|
||||
cat "$logs/$n.log"
|
||||
echo "::endgroup::"
|
||||
[ "$rc" = 0 ] || failed+=("$n")
|
||||
done
|
||||
[ ${#failed[@]} -eq 0 ] && return 0
|
||||
for n in "${failed[@]}"; do echo "== $n"; tail -n 30 "$logs/$n.log"; done
|
||||
echo "::error::$title failed: ${failed[*]}"
|
||||
exit 1
|
||||
}
|
||||
# 1) install the platforms. Nothing is cached here (reproducible),
|
||||
# so each run downloads platforms, toolchains and libraries: 8 min
|
||||
# env by env up front. One env per distinct platform (+
|
||||
# platform_packages) installs those first, one at a time -- they
|
||||
# are shared in ~/.platformio, concurrent installs would race.
|
||||
envs=$(printf '%s\n' "${arts[@]}" | while read -r a; do echo "${spec[$a]%%|*}"; done | sort -u)
|
||||
mapfile -t first < <(pio project config --json-output | python3 -c '
|
||||
import json, sys
|
||||
want, seen = set(sys.argv[1].split()), set()
|
||||
for name, opts in json.load(sys.stdin):
|
||||
o = dict(opts)
|
||||
key = (o.get("platform"), str(o.get("platform_packages")))
|
||||
if name[4:] in want and name.startswith("env:") and key not in seen:
|
||||
seen.add(key)
|
||||
print(name[4:])' "$envs")
|
||||
# deps <env>: the locked libraries first, then whatever lib_deps still
|
||||
# miss (platform, toolchain, git/file pins), then the lock check --
|
||||
# once per env: the flock keeps its other flag sets waiting
|
||||
locks="$RUNNER_TEMP/locks"
|
||||
mkdir -p "$locks"
|
||||
deps() {
|
||||
flock "$locks/$1" sh -c "python3 tools/pio_lock.py install -e '$1' && pio pkg install -e '$1' -s &&
|
||||
python3 tools/pio_lock.py check -e '$1'"
|
||||
}
|
||||
install() { deps "${1#install-}"; }
|
||||
t0=$SECONDS
|
||||
for env in "${first[@]}"; do par install "install-$env"; done
|
||||
report "install" "${first[@]/#/install-}"
|
||||
echo "installed ${#first[@]} platforms in $((SECONDS - t0)) s"
|
||||
# 2) compile, each artifact into its own build dir (one env comes in
|
||||
# up to four flag sets). An env's libraries come with its first
|
||||
# build (deps), into its own .pio/libdeps/<env>, while other envs
|
||||
# compile; the check fails the build when anything is not exactly
|
||||
# platformio.lock.
|
||||
compile() {
|
||||
local env flags suffix variant
|
||||
IFS='|' read -r env flags suffix variant <<<"${spec[$1]}"
|
||||
deps "$env" || return 1
|
||||
export FW_OTA_VARIANT=$variant PLATFORMIO_BUILD_DIR="$bdir/$1" PLATFORMIO_BUILD_FLAGS="$PUB_FLAGS $flags"
|
||||
pio run -j "$PIO_JOBS" -e "$env" || return 1
|
||||
[ -f "$bdir/$1/$env/firmware.zip" ] || pio run -j "$PIO_JOBS" -t mergebin -e "$env" # ESP32
|
||||
}
|
||||
t1=$SECONDS
|
||||
par compile "${arts[@]}"
|
||||
echo "compiled ${#arts[@]} artifacts in $((SECONDS - t1)) s ($PARALLEL at a time)"
|
||||
report "build" "${arts[@]}"
|
||||
# 3) package in order: manifest.json, deltas and the version are
|
||||
# written one artifact at a time. The OTA tools read .pio/build/<env>,
|
||||
# so that points at the artifact being packaged.
|
||||
mkdir -p .pio/build
|
||||
for a in "${arts[@]}"; do
|
||||
IFS='|' read -r env flags suffix variant <<<"${spec[$a]}"
|
||||
b="$bdir/$a/$env"
|
||||
echo "::group::package $env$suffix"
|
||||
if [ -f "$b/firmware.zip" ]; then # nRF52
|
||||
python3 bin/uf2conv/uf2conv.py "$b/firmware.hex" -c -o "$b/firmware.uf2" -f 0xADA52840
|
||||
cp "$b/firmware.uf2" "$dist/$env$suffix-$TAG.uf2"
|
||||
@@ -239,18 +372,19 @@ jobs:
|
||||
v=$(grep -m1 -aoE 'v[0-9]+\.[0-9]+\.[0-9]+-tth[0-9a-f]+\+?' "$b/firmware.elf" || true)
|
||||
case "$v" in *+) echo "::error::$env is dirty ($v)"; exit 1 ;; esac
|
||||
[ -n "$version" ] || version="$v"
|
||||
[ -z "$variant" ] || { unzip -p "$b/firmware.zip" firmware.bin >"$b/firmware.bin"; ota_package "$env" "$env$suffix"; }
|
||||
if [ -n "$variant" ]; then
|
||||
rm -rf ".pio/build/$env"
|
||||
ln -s "$b" ".pio/build/$env"
|
||||
unzip -p "$b/firmware.zip" firmware.bin >"$b/firmware.bin"
|
||||
ota_package "$env" "$env$suffix"
|
||||
fi
|
||||
else # ESP32
|
||||
PLATFORMIO_BUILD_FLAGS="$PUB_FLAGS $2" pio run -t mergebin -e "$env"
|
||||
cp "$b/firmware.bin" "$dist/$env$suffix-$TAG.bin"
|
||||
cp "$b/firmware-merged.bin" "$dist/$env$suffix-$TAG-merged.bin"
|
||||
fi
|
||||
echo "::endgroup::"
|
||||
}
|
||||
for env in $ENVS; do build "$env" "" ""; done
|
||||
for env in $OBS_ENVS; do build "$env" "$OBS_FLAGS" "-observer"; done
|
||||
for env in $OTA_ENVS; do build "$env" "-D FW_OTA=1" "-ota" ota; done
|
||||
for env in $OBS_ENVS; do build "$env" "$OBS_FLAGS -D FW_OTA=1" "-observer-ota" observer-ota; done
|
||||
done
|
||||
echo "installed, built and packaged in $((SECONDS - t0)) s"
|
||||
jq --arg c "$(git rev-parse HEAD)" --arg t "$TAG" '.commit = $c | .tag = $t' \
|
||||
"$dist/manifest.json" >"$dist/m.tmp" && mv "$dist/m.tmp" "$dist/manifest.json"
|
||||
cd "$dist"
|
||||
@@ -262,14 +396,14 @@ jobs:
|
||||
echo "version=${version:-tth-$sha}" >>"$GITHUB_OUTPUT"
|
||||
|
||||
- name: Dry run artifact
|
||||
if: github.event.inputs.dry_run == 'true'
|
||||
if: env.DRY == 'true'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: pub-release-dry-run
|
||||
path: dist/
|
||||
|
||||
- name: Release
|
||||
if: github.event.inputs.dry_run != 'true'
|
||||
if: env.DRY != 'true'
|
||||
env:
|
||||
TOKEN: ${{ secrets.GITEA_TOKEN || github.token }}
|
||||
SHA: ${{ steps.src.outputs.sha }}
|
||||
@@ -372,6 +506,14 @@ jobs:
|
||||
# upstream: the first-parent line of each merged upstream branch,
|
||||
# PR merges as their title, direct commits as their subject
|
||||
declare -A seen=()
|
||||
# A direct upstream commit (no PR) links to GitHub by its ORIGINAL
|
||||
# id: the public export (filter-repo) gives every upstream commit a
|
||||
# new one, which GitHub does not know (30. 11. 2026: "* sec patch"
|
||||
# linked to a 404). Author email + author time survive the rewrite.
|
||||
declare -A upid=()
|
||||
if git fetch -q --no-tags "$gh.git" '+refs/heads/main:refs/upstream/main' '+refs/heads/dev:refs/upstream/dev'; then
|
||||
while read -r h k; do upid[$k]=$h; done < <(git log --format='%H %ae/%at' refs/upstream/main refs/upstream/dev)
|
||||
fi
|
||||
ups=()
|
||||
for m in $(git log --first-parent --merges --grep='^Merge upstream' --format=%H "$base..$SHA"); do
|
||||
for c in $(git log --first-parent --format=%H "$m^1..$m^2"); do
|
||||
@@ -385,7 +527,12 @@ jobs:
|
||||
elif [[ $s != Merge* ]]; then
|
||||
[ -z "${seen[$c]:-}" ] || continue
|
||||
seen[$c]=1
|
||||
ups+=("- $s ([${c:0:7}]($gh/commit/$c))")
|
||||
u=${upid[$(git log -1 --format='%ae/%at' "$c")]:-}
|
||||
if [ -n "$u" ]; then
|
||||
ups+=("- $s ([${u:0:7}]($gh/commit/$u))")
|
||||
else
|
||||
ups+=("- $s ([${c:0:7}]($web/commit/$c))")
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
@@ -31,3 +31,6 @@ ether.pid
|
||||
|
||||
# data z pochůzkových testů (.tth/tools/walk.sh fetch) — polohy, necommitovat
|
||||
walk-data/
|
||||
|
||||
# raw bench data (measurement nights, watch logs): local only, results go to docs/
|
||||
/logs/
|
||||
@@ -6,6 +6,7 @@ This document provides an overview of CLI commands that can be sent to MeshCore
|
||||
|
||||
- [Operational](#operational)
|
||||
- [Neighbors](#neighbors-repeater-only)
|
||||
- [Posts](#posts-room-server-only)
|
||||
- [Statistics](#statistics)
|
||||
- [Logging](#logging)
|
||||
- [Information](#info)
|
||||
@@ -164,6 +165,19 @@ in order of preference:
|
||||
|
||||
---
|
||||
|
||||
## Posts (Room Server Only)
|
||||
|
||||
### Post a message as the room server
|
||||
**Usage:**
|
||||
- `room.post <message>`
|
||||
|
||||
**Parameters:**
|
||||
- `message`: The text of the post
|
||||
|
||||
**Note:** The post is stored and pushed to logged-in clients like a client's post, with the room server as its author.
|
||||
|
||||
---
|
||||
|
||||
## Statistics
|
||||
|
||||
### Clear Stats
|
||||
|
||||
@@ -171,6 +171,34 @@ a half-drained `rxlog`/`pktlog` page would otherwise wait for the next
|
||||
connection event — the bridge drains those on a 2-minute duty cycle, so a slower
|
||||
drain directly costs collected frames.
|
||||
|
||||
### CPU time per received packet (`PWR_DUTY_INSTRUMENT`)
|
||||
|
||||
A bench build with `-D PWR_DUTY_INSTRUMENT` (nRF52 only, nothing changes
|
||||
without the flag) prints one line to the USB console every ~10 s:
|
||||
|
||||
```
|
||||
PWRDUTY awake_ms=… asleep_ms=… wakes=… duty_permille=… pkt_us=… pkt_n=…
|
||||
```
|
||||
|
||||
- `awake_ms`, `asleep_ms` and `duty_permille` are the time between a return
|
||||
from `NRF52Board::sleep()` and the next entry into it, against the WFE span
|
||||
inside it. This needs `powersaving on`: without it `sleep()` is never called.
|
||||
- `wakes` counts the passes through `sleep()`. BLE and USB events wake the
|
||||
core too, so the duty is not packet cost alone.
|
||||
- `pkt_us` and `pkt_n` are the CPU time spent in
|
||||
`Dispatcher::processRecvPacket()` (dedup, crypto, routing) and the number of
|
||||
packets. They do not depend on background wakes. This is the work a filter
|
||||
on the radio side could skip for a packet that is dropped anyway.
|
||||
|
||||
All counters are cumulative since boot, so take the difference between two
|
||||
lines.
|
||||
|
||||
Measured on the XIAO x4, 24. 11. 2026, live mesh, about 440 packets/h (all
|
||||
flood adverts): about **6.8 ms CPU per received packet**, mostly the Ed25519
|
||||
check of the advert signature. The duty went from 0.05 % at rest to 0.13 %.
|
||||
The awake time is a small part of a node's current; the radio's RX and the
|
||||
SoftDevice dominate.
|
||||
|
||||
## A mast that runs flat: bootlock and cutoff
|
||||
|
||||
A panel that gets no direct sun in winter (remote-mast faces east, 11/2026:
|
||||
|
||||
@@ -210,6 +210,7 @@ The ones that change what a node does; set in `platformio.ini` /
|
||||
| `LOGIN_FAIL_MAX`, `LOGIN_FAIL_SECS` | `4`, `180` (s) | after that many wrong passwords in the window no password is checked until it ends (an admin already in the ACL always gets in) |
|
||||
| `NRF52_POWER_MANAGEMENT`, `PWRMGT_RUNTIME` | upstream: off; on in `SenseCap_Solar_repeater` (the masts) | boot protection, and with `PWRMGT_RUNTIME` the runtime `pwr.bootlock` / `pwr.cutoff` above |
|
||||
| `PWRMGT_BOOTLOCK_DEFAULT`, `PWRMGT_CUTOFF_DEFAULT` | `PWRMGT_VOLTAGE_BOOTLOCK` (SenseCAP 3300), `0` (mV) | thresholds for a node without `/pwr_guard` |
|
||||
| `PWR_DUTY_INSTRUMENT` | unset | bench only, nRF52: every ~10 s a `PWRDUTY` line on the USB console with the time the MCU was awake and asleep, its wakes, and the CPU time spent on received packets. See [power.md](power.md#cpu-time-per-received-packet-pwr_duty_instrument) |
|
||||
|
||||
Prefs saved on the node override the build defaults: a reflash keeps what a
|
||||
node already has; only a new node or one after `erase` takes them.
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "MyMesh.h"
|
||||
#include <algorithm>
|
||||
#include <helpers/sensors/LPPDataHelpers.h>
|
||||
#include <helpers/UTF8Helpers.h>
|
||||
|
||||
/* ------------------------------ Config -------------------------------- */
|
||||
|
||||
@@ -404,7 +405,6 @@ uint8_t MyMesh::handleLoginReq(const mesh::Identity& sender, const uint8_t* secr
|
||||
}
|
||||
MESH_DEBUG_PRINTLN("Login success!");
|
||||
client->last_timestamp = sender_timestamp;
|
||||
client->last_activity = getRTCClock()->getCurrentTime();
|
||||
client->permissions &= ~0x03;
|
||||
client->permissions |= perms;
|
||||
acl.persistTimestamp(client, sender_timestamp, getRTCClock()->getCurrentTime()); // CUSTOM (TeTeHacko): admin only, so after the role
|
||||
@@ -414,6 +414,7 @@ uint8_t MyMesh::handleLoginReq(const mesh::Identity& sender, const uint8_t* secr
|
||||
dirty_contacts_expiry = futureMillis(LAZY_CONTACTS_WRITE_DELAY);
|
||||
}
|
||||
}
|
||||
client->last_activity = getRTCClock()->getCurrentTime();
|
||||
|
||||
if (is_flood) {
|
||||
client->out_path_len = OUT_PATH_UNKNOWN; // need to rediscover out_path
|
||||
@@ -1252,12 +1253,12 @@ void MyMesh::onPeerDataRecv(mesh::Packet *packet, uint8_t type, int sender_idx,
|
||||
uint32_t timestamp;
|
||||
memcpy(×tamp, data, 4);
|
||||
|
||||
if (timestamp > client->last_timestamp) { // prevent replay attacks
|
||||
if (timestamp > client->last_req_timestamp) { // prevent replay attacks
|
||||
acl.persistTimestamp(client, timestamp, getRTCClock()->getCurrentTime()); // CUSTOM (TeTeHacko): before acting
|
||||
int reply_len = handleRequest(client, timestamp, &data[4], len - 4);
|
||||
if (reply_len == 0) return; // invalid command
|
||||
|
||||
client->last_timestamp = timestamp;
|
||||
client->last_req_timestamp = timestamp;
|
||||
client->last_activity = getRTCClock()->getCurrentTime();
|
||||
|
||||
if (packet->isRouteFlood()) {
|
||||
@@ -1286,6 +1287,11 @@ void MyMesh::onPeerDataRecv(mesh::Packet *packet, uint8_t type, int sender_idx,
|
||||
|
||||
if (!(flags == TXT_TYPE_PLAIN || flags == TXT_TYPE_CLI_DATA || flags == TXT_TYPE_CLI_COMMAND)) {
|
||||
MESH_DEBUG_PRINTLN("onPeerDataRecv: unsupported text type received: flags=%02x", (uint32_t)flags);
|
||||
} else if (!mesh::isValidUtf8TextAndPadding(&data[5], len - 5)) {
|
||||
MESH_DEBUG_PRINTLN("onPeerDataRecv: invalid text payload! (id prefix: %02X:%02X)", client->id.pub_key[0], client->id.pub_key[1]);
|
||||
_err_flags |= ERR_EVENT_DIAG1; // report in next Get Stats
|
||||
} else if (_reply_echo.matches(data, 5 + strnlen((const char *)&data[5], len - 5))) {
|
||||
MESH_DEBUG_PRINTLN("onPeerDataRecv: text is our own CLI reply");
|
||||
} else if (sender_timestamp >= client->last_timestamp) { // prevent replay attacks
|
||||
bool is_retry = (sender_timestamp == client->last_timestamp);
|
||||
acl.persistTimestamp(client, sender_timestamp, getRTCClock()->getCurrentTime()); // CUSTOM (TeTeHacko): before acting
|
||||
@@ -1329,6 +1335,7 @@ void MyMesh::onPeerDataRecv(mesh::Packet *packet, uint8_t type, int sender_idx,
|
||||
}
|
||||
memcpy(temp, ×tamp, 4); // mostly an extra blob to help make packet_hash unique
|
||||
temp[4] = (TXT_TYPE_CLI_DATA << 2); // NOTE: legacy was: TXT_TYPE_PLAIN
|
||||
_reply_echo.note(temp, 5 + text_len);
|
||||
|
||||
auto reply = createDatagram(PAYLOAD_TYPE_TXT_MSG, client->id, secret, temp, 5 + text_len);
|
||||
if (reply) {
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <helpers/ArduinoHelpers.h>
|
||||
#include <helpers/ClientACL.h>
|
||||
#include <helpers/LoginGuard.h> // CUSTOM (TeTeHacko)
|
||||
#include <helpers/ReplyEchoGuard.h>
|
||||
#include <helpers/CommonCLI.h>
|
||||
#include <helpers/IdentityStore.h>
|
||||
#include <helpers/SimpleMeshTables.h>
|
||||
@@ -197,6 +198,7 @@ class MyMesh : public mesh::Mesh, public CommonCLICallbacks {
|
||||
NodePrefs _prefs;
|
||||
ClientACL acl;
|
||||
LoginGuard login_guard; // CUSTOM (TeTeHacko)
|
||||
ReplyEchoGuard _reply_echo;
|
||||
CommonCLI _cli;
|
||||
uint8_t reply_data[MAX_PACKET_PAYLOAD];
|
||||
uint8_t reply_path[MAX_PATH_SIZE];
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "MyMesh.h"
|
||||
#include <helpers/UTF8Helpers.h>
|
||||
#include <algorithm>
|
||||
|
||||
#define REPLY_DELAY_MILLIS 1500
|
||||
@@ -390,7 +391,6 @@ void MyMesh::onAnonDataRecv(mesh::Packet *packet, const uint8_t *secret, const m
|
||||
client->extra.room.pending_ack = 0;
|
||||
client->extra.room.push_failures = 0;
|
||||
|
||||
client->last_activity = getRTCClock()->getCurrentTime();
|
||||
client->permissions &= ~0x03;
|
||||
client->permissions |= perm;
|
||||
acl.persistTimestamp(client, sender_timestamp, getRTCClock()->getCurrentTime()); // CUSTOM (TeTeHacko): admin only, so after the role
|
||||
@@ -398,6 +398,7 @@ void MyMesh::onAnonDataRecv(mesh::Packet *packet, const uint8_t *secret, const m
|
||||
|
||||
dirty_contacts_expiry = futureMillis(LAZY_CONTACTS_WRITE_DELAY);
|
||||
}
|
||||
client->last_activity = getRTCClock()->getCurrentTime();
|
||||
|
||||
if (packet->isRouteFlood()) {
|
||||
client->out_path_len = OUT_PATH_UNKNOWN; // need to rediscover out_path
|
||||
@@ -469,6 +470,11 @@ void MyMesh::onPeerDataRecv(mesh::Packet *packet, uint8_t type, int sender_idx,
|
||||
|
||||
if (!(flags == TXT_TYPE_PLAIN || flags == TXT_TYPE_CLI_DATA || flags == TXT_TYPE_CLI_COMMAND)) {
|
||||
MESH_DEBUG_PRINTLN("onPeerDataRecv: unsupported command flags received: flags=%02x", (uint32_t)flags);
|
||||
} else if (!mesh::isValidUtf8TextAndPadding(&data[5], len - 5)) {
|
||||
MESH_DEBUG_PRINTLN("onPeerDataRecv: invalid text payload! (id prefix: %02X:%02X)", client->id.pub_key[0], client->id.pub_key[1]);
|
||||
_err_flags |= ERR_EVENT_DIAG1; // report in next Get Stats
|
||||
} else if (_reply_echo.matches(data, 5 + strnlen((const char *)&data[5], len - 5))) {
|
||||
MESH_DEBUG_PRINTLN("onPeerDataRecv: text is our own CLI reply");
|
||||
} else if (sender_timestamp >= client->last_timestamp) { // prevent replay attacks, but send Acks for retries
|
||||
bool is_retry = (sender_timestamp == client->last_timestamp);
|
||||
acl.persistTimestamp(client, sender_timestamp, getRTCClock()->getCurrentTime()); // CUSTOM (TeTeHacko): before acting
|
||||
@@ -544,6 +550,7 @@ void MyMesh::onPeerDataRecv(mesh::Packet *packet, uint8_t type, int sender_idx,
|
||||
now++;
|
||||
}
|
||||
memcpy(temp, &now, 4); // mostly an extra blob to help make packet_hash unique
|
||||
_reply_echo.note(temp, 5 + text_len);
|
||||
|
||||
// calc expected ACK reply
|
||||
// mesh::Utils::sha256((uint8_t *)&expected_ack_crc, 4, temp, 5 + text_len, self_id.pub_key,
|
||||
@@ -564,11 +571,11 @@ void MyMesh::onPeerDataRecv(mesh::Packet *packet, uint8_t type, int sender_idx,
|
||||
} else if (type == PAYLOAD_TYPE_REQ && len >= 5) {
|
||||
uint32_t sender_timestamp;
|
||||
memcpy(&sender_timestamp, data, 4); // timestamp (by sender's RTC clock - which could be wrong)
|
||||
if (sender_timestamp < client->last_timestamp) { // prevent replay attacks
|
||||
if (sender_timestamp < client->last_req_timestamp) { // prevent replay attacks
|
||||
MESH_DEBUG_PRINTLN("onPeerDataRecv: possible replay attack detected");
|
||||
} else {
|
||||
acl.persistTimestamp(client, sender_timestamp, getRTCClock()->getCurrentTime()); // CUSTOM (TeTeHacko): before acting
|
||||
client->last_timestamp = sender_timestamp;
|
||||
client->last_req_timestamp = sender_timestamp;
|
||||
|
||||
uint32_t now = getRTCClock()->getCurrentTime();
|
||||
client->last_activity = now; // <-- THIS will keep client connection alive
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <helpers/StatsFormatHelper.h>
|
||||
#include <helpers/ClientACL.h>
|
||||
#include <helpers/LoginGuard.h> // CUSTOM (TeTeHacko)
|
||||
#include <helpers/ReplyEchoGuard.h>
|
||||
#include <helpers/RegionMap.h>
|
||||
#include <helpers/RoutingPolicy.h>
|
||||
#include <RTClib.h>
|
||||
@@ -100,6 +101,7 @@ class MyMesh : public mesh::Mesh, public CommonCLICallbacks {
|
||||
RegionMap region_map, temp_map;
|
||||
ClientACL acl;
|
||||
LoginGuard login_guard; // CUSTOM (TeTeHacko)
|
||||
ReplyEchoGuard _reply_echo;
|
||||
CommonCLI _cli;
|
||||
unsigned long dirty_contacts_expiry;
|
||||
uint8_t reply_data[MAX_PACKET_PAYLOAD];
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "SensorMesh.h"
|
||||
#include <helpers/RoutingPolicy.h>
|
||||
#include <helpers/sensors/LPPDataHelpers.h>
|
||||
#include <helpers/UTF8Helpers.h>
|
||||
|
||||
/* ------------------------------ Config -------------------------------- */
|
||||
|
||||
@@ -438,13 +439,13 @@ uint8_t SensorMesh::handleLoginReq(const mesh::Identity& sender, const uint8_t*
|
||||
}
|
||||
MESH_DEBUG_PRINTLN("Login success!");
|
||||
client->last_timestamp = sender_timestamp;
|
||||
client->last_activity = getRTCClock()->getCurrentTime();
|
||||
client->permissions |= PERM_ACL_ADMIN;
|
||||
acl.persistTimestamp(client, sender_timestamp, getRTCClock()->getCurrentTime()); // CUSTOM (TeTeHacko): admin only, so after the role
|
||||
memcpy(client->shared_secret, secret, PUB_KEY_SIZE);
|
||||
|
||||
dirty_contacts_expiry = futureMillis(LAZY_CONTACTS_WRITE_DELAY);
|
||||
}
|
||||
client->last_activity = getRTCClock()->getCurrentTime();
|
||||
|
||||
if (is_flood) {
|
||||
client->out_path_len = OUT_PATH_UNKNOWN; // need to rediscover out_path
|
||||
@@ -698,7 +699,12 @@ void SensorMesh::onPeerDataRecv(mesh::Packet* packet, uint8_t type, int sender_i
|
||||
memcpy(&sender_timestamp, data, 4); // timestamp (by sender's RTC clock - which could be wrong)
|
||||
uint8_t flags = (data[4] >> 2); // message attempt number, and other flags
|
||||
|
||||
if (sender_timestamp > from->last_timestamp) { // prevent replay attacks
|
||||
if (!mesh::isValidUtf8TextAndPadding(&data[5], len - 5)) {
|
||||
MESH_DEBUG_PRINTLN("onPeerDataRecv: invalid text payload! (id prefix: %02X:%02X)", from->id.pub_key[0], from->id.pub_key[1]);
|
||||
_err_flags |= ERR_EVENT_DIAG1; // report in next Get Stats
|
||||
} else if (_reply_echo.matches(data, 5 + strnlen((const char *)&data[5], len - 5))) {
|
||||
MESH_DEBUG_PRINTLN("onPeerDataRecv: text is our own CLI reply");
|
||||
} else if (sender_timestamp > from->last_timestamp) { // prevent replay attacks
|
||||
acl.persistTimestamp(from, sender_timestamp, getRTCClock()->getCurrentTime()); // CUSTOM (TeTeHacko): before acting
|
||||
if (flags == TXT_TYPE_PLAIN) {
|
||||
bool handled = handleIncomingMsg(*from, sender_timestamp, &data[5], flags, len - 5);
|
||||
@@ -737,6 +743,7 @@ void SensorMesh::onPeerDataRecv(mesh::Packet* packet, uint8_t type, int sender_i
|
||||
}
|
||||
memcpy(temp, ×tamp, 4); // mostly an extra blob to help make packet_hash unique
|
||||
temp[4] = (TXT_TYPE_CLI_DATA << 2);
|
||||
_reply_echo.note(temp, 5 + text_len);
|
||||
|
||||
auto reply = createDatagram(PAYLOAD_TYPE_TXT_MSG, from->id, secret, temp, 5 + text_len);
|
||||
if (reply) {
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <helpers/StatsFormatHelper.h>
|
||||
#include <helpers/ClientACL.h>
|
||||
#include <helpers/LoginGuard.h> // CUSTOM (TeTeHacko)
|
||||
#include <helpers/ReplyEchoGuard.h>
|
||||
#include <helpers/RegionMap.h>
|
||||
#include <RTClib.h>
|
||||
#include <target.h>
|
||||
@@ -149,6 +150,7 @@ private:
|
||||
NodePrefs _prefs;
|
||||
ClientACL acl;
|
||||
LoginGuard login_guard; // CUSTOM (TeTeHacko)
|
||||
ReplyEchoGuard _reply_echo;
|
||||
CommonCLI _cli;
|
||||
uint8_t reply_data[MAX_PACKET_PAYLOAD];
|
||||
unsigned long dirty_contacts_expiry;
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
stl/
|
||||
*.stl
|
||||
*.3mf
|
||||
+8
-2
@@ -124,10 +124,16 @@ pkg = https://github.com/meshcore-dev/Adafruit_nRF52_Arduino#d541301665b40959682
|
||||
|
||||
[nrf52_base]
|
||||
extends = arduino_base
|
||||
platform = nordicnrf52
|
||||
; CUSTOM (TeTeHacko): exact platform and toolchain (upstream: `nordicnrf52`,
|
||||
; `^1.140201.0`). Unpinned, every build took the newest: on 30. 11. 2026 the
|
||||
; public release went to platform 11.1.0, released that same day, while the
|
||||
; bench and the masts built on 10.12.0. Latest, but by a commit: Renovate
|
||||
; moves these two (.github/renovate.json), its PR builds every public image.
|
||||
; Libraries: platformio.lock (tools/pio_lock.py, moved by tth-lock-refresh).
|
||||
platform = platformio/nordicnrf52@11.1.0
|
||||
platform_packages =
|
||||
framework-arduinoadafruitnrf52 @ ${nrf52_fw.pkg}
|
||||
platformio/toolchain-gccarmnoneeabi@^1.140201.0
|
||||
platformio/toolchain-gccarmnoneeabi@1.140201.0
|
||||
; Stamping verze pro KAŽDÝ nRF52 env, ne po jednom: 19. 8. 2026 se ukázalo, že
|
||||
; z 585 envů v repu stampovaly DVA, takže `ver` na lavičních deskách hlásil
|
||||
; literál z upstream headeru a z uzlu nešlo poznat, který build na něm je.
|
||||
|
||||
+448
@@ -0,0 +1,448 @@
|
||||
; Library lock for PlatformIO (tools/pio_lock.py; PlatformIO has no lockfile).
|
||||
; Per env, every library in .pio/libdeps/<env>, transitive ones included:
|
||||
; `owner/name@version` from the registry, `<remote>#<commit>` of a git library
|
||||
; (pinned in platformio.ini, only checked here) or a file: URI.
|
||||
; CI installs these before building and fails when a build resolved anything
|
||||
; else. Renovate bumps the registry lines; tools/pio_lock.py freeze rewrites
|
||||
; an env from what it resolved.
|
||||
|
||||
[Heltec_t114_companion_radio_ble]
|
||||
adafruit/Adafruit AHTX0@2.0.6
|
||||
adafruit/Adafruit BME280 Library@2.3.0
|
||||
adafruit/Adafruit BME680 Library@2.0.6
|
||||
adafruit/Adafruit BMP085 Library@1.2.4
|
||||
adafruit/Adafruit BMP280 Library@2.6.8
|
||||
adafruit/Adafruit BusIO@1.17.4
|
||||
adafruit/Adafruit GFX Library@2.0.0
|
||||
adafruit/Adafruit INA219@1.2.3
|
||||
adafruit/Adafruit INA260 Library@1.5.4
|
||||
adafruit/Adafruit INA3221 Library@1.0.1
|
||||
adafruit/Adafruit MLX90614 Library@2.1.7
|
||||
adafruit/Adafruit NeoPixel@1.15.6
|
||||
adafruit/Adafruit SH110X@2.1.15
|
||||
adafruit/Adafruit SHTC3 Library@1.0.2
|
||||
adafruit/Adafruit SSD1306@2.5.18
|
||||
adafruit/Adafruit Unified Sensor@1.1.15
|
||||
adafruit/Adafruit_VL53L0X@1.2.5
|
||||
adafruit/RTClib@2.1.4
|
||||
arduino-libraries/Arduino_LPS22HB@1.0.3
|
||||
bblanchon/ArduinoJson@7.4.3
|
||||
densaugeo/base64@1.4.0
|
||||
electroniccats/CayenneLPP@1.6.1
|
||||
https://github.com/oltaco/CustomLFS#b3928ea2d0f46c2533e901c43f471a081c503a3c
|
||||
jgromes/RadioLib@7.8.1
|
||||
melopero/Melopero RV3028@1.2.0
|
||||
robtillaart/INA226@0.6.6
|
||||
rweather/Crypto@0.4.0
|
||||
sensirion/Sensirion Core@0.7.3
|
||||
sensirion/Sensirion I2C SHT4x@1.1.2
|
||||
stevemarple/MicroNMEA@2.0.6
|
||||
|
||||
[Heltec_t114_repeater]
|
||||
adafruit/Adafruit AHTX0@2.0.6
|
||||
adafruit/Adafruit BME280 Library@2.3.0
|
||||
adafruit/Adafruit BME680 Library@2.0.6
|
||||
adafruit/Adafruit BMP085 Library@1.2.4
|
||||
adafruit/Adafruit BMP280 Library@2.6.8
|
||||
adafruit/Adafruit BusIO@1.17.4
|
||||
adafruit/Adafruit GFX Library@2.0.0
|
||||
adafruit/Adafruit INA219@1.2.3
|
||||
adafruit/Adafruit INA260 Library@1.5.4
|
||||
adafruit/Adafruit INA3221 Library@1.0.1
|
||||
adafruit/Adafruit MLX90614 Library@2.1.7
|
||||
adafruit/Adafruit NeoPixel@1.15.6
|
||||
adafruit/Adafruit SH110X@2.1.15
|
||||
adafruit/Adafruit SHTC3 Library@1.0.2
|
||||
adafruit/Adafruit SSD1306@2.5.18
|
||||
adafruit/Adafruit Unified Sensor@1.1.15
|
||||
adafruit/Adafruit_VL53L0X@1.2.5
|
||||
adafruit/RTClib@2.1.4
|
||||
arduino-libraries/Arduino_LPS22HB@1.0.3
|
||||
bblanchon/ArduinoJson@7.4.3
|
||||
electroniccats/CayenneLPP@1.6.1
|
||||
https://github.com/oltaco/CustomLFS#b3928ea2d0f46c2533e901c43f471a081c503a3c
|
||||
jgromes/RadioLib@7.8.1
|
||||
melopero/Melopero RV3028@1.2.0
|
||||
robtillaart/INA226@0.6.6
|
||||
rweather/Crypto@0.4.0
|
||||
sensirion/Sensirion Core@0.7.3
|
||||
sensirion/Sensirion I2C SHT4x@1.1.2
|
||||
stevemarple/MicroNMEA@2.0.6
|
||||
|
||||
[Heltec_v3_companion_radio_ble]
|
||||
adafruit/Adafruit AHTX0@2.0.6
|
||||
adafruit/Adafruit BME280 Library@2.3.0
|
||||
adafruit/Adafruit BME680 Library@2.0.6
|
||||
adafruit/Adafruit BMP085 Library@1.2.4
|
||||
adafruit/Adafruit BMP280 Library@2.6.8
|
||||
adafruit/Adafruit BusIO@1.17.4
|
||||
adafruit/Adafruit GFX Library@2.0.0
|
||||
adafruit/Adafruit INA219@1.2.3
|
||||
adafruit/Adafruit INA260 Library@1.5.4
|
||||
adafruit/Adafruit INA3221 Library@1.0.1
|
||||
adafruit/Adafruit MLX90614 Library@2.1.7
|
||||
adafruit/Adafruit NeoPixel@1.15.6
|
||||
adafruit/Adafruit SH110X@2.1.15
|
||||
adafruit/Adafruit SHTC3 Library@1.0.2
|
||||
adafruit/Adafruit SSD1306@2.5.18
|
||||
adafruit/Adafruit Unified Sensor@1.1.15
|
||||
adafruit/Adafruit_VL53L0X@1.2.5
|
||||
adafruit/RTClib@2.1.4
|
||||
arduino-libraries/Arduino_LPS22HB@1.0.3
|
||||
bblanchon/ArduinoJson@7.4.3
|
||||
densaugeo/base64@1.4.0
|
||||
electroniccats/CayenneLPP@1.6.1
|
||||
jgromes/RadioLib@7.8.1
|
||||
melopero/Melopero RV3028@1.2.0
|
||||
robtillaart/INA226@0.6.6
|
||||
rweather/Crypto@0.4.0
|
||||
sensirion/Sensirion Core@0.7.3
|
||||
sensirion/Sensirion I2C SHT4x@1.1.2
|
||||
stevemarple/MicroNMEA@2.0.6
|
||||
|
||||
[Heltec_v3_repeater]
|
||||
adafruit/Adafruit AHTX0@2.0.6
|
||||
adafruit/Adafruit BME280 Library@2.3.0
|
||||
adafruit/Adafruit BME680 Library@2.0.6
|
||||
adafruit/Adafruit BMP085 Library@1.2.4
|
||||
adafruit/Adafruit BMP280 Library@2.6.8
|
||||
adafruit/Adafruit BusIO@1.17.4
|
||||
adafruit/Adafruit GFX Library@2.0.0
|
||||
adafruit/Adafruit INA219@1.2.3
|
||||
adafruit/Adafruit INA260 Library@1.5.4
|
||||
adafruit/Adafruit INA3221 Library@1.0.1
|
||||
adafruit/Adafruit MLX90614 Library@2.1.7
|
||||
adafruit/Adafruit NeoPixel@1.15.6
|
||||
adafruit/Adafruit SH110X@2.1.15
|
||||
adafruit/Adafruit SHTC3 Library@1.0.2
|
||||
adafruit/Adafruit SSD1306@2.5.18
|
||||
adafruit/Adafruit Unified Sensor@1.1.15
|
||||
adafruit/Adafruit_VL53L0X@1.2.5
|
||||
adafruit/RTClib@2.1.4
|
||||
arduino-libraries/Arduino_LPS22HB@1.0.3
|
||||
bakercp/CRC32@2.0.1
|
||||
bblanchon/ArduinoJson@7.4.3
|
||||
electroniccats/CayenneLPP@1.6.1
|
||||
esp32async/AsyncTCP@3.6.1
|
||||
esp32async/ESPAsyncWebServer@3.10.3
|
||||
file://arch/esp32/AsyncElegantOTA
|
||||
jgromes/RadioLib@7.8.1
|
||||
melopero/Melopero RV3028@1.2.0
|
||||
robtillaart/INA226@0.6.6
|
||||
rweather/Crypto@0.4.0
|
||||
sensirion/Sensirion Core@0.7.3
|
||||
sensirion/Sensirion I2C SHT4x@1.1.2
|
||||
stevemarple/MicroNMEA@2.0.6
|
||||
|
||||
[RAK_4631_companion_radio_ble]
|
||||
adafruit/Adafruit AHTX0@2.0.6
|
||||
adafruit/Adafruit BME280 Library@2.3.0
|
||||
adafruit/Adafruit BME680 Library@2.0.6
|
||||
adafruit/Adafruit BMP085 Library@1.2.4
|
||||
adafruit/Adafruit BMP280 Library@2.6.8
|
||||
adafruit/Adafruit BusIO@1.17.4
|
||||
adafruit/Adafruit GFX Library@2.0.0
|
||||
adafruit/Adafruit INA219@1.2.3
|
||||
adafruit/Adafruit INA260 Library@1.5.4
|
||||
adafruit/Adafruit INA3221 Library@1.0.1
|
||||
adafruit/Adafruit MLX90614 Library@2.1.7
|
||||
adafruit/Adafruit NeoPixel@1.15.6
|
||||
adafruit/Adafruit SH110X@2.1.15
|
||||
adafruit/Adafruit SHTC3 Library@1.0.2
|
||||
adafruit/Adafruit SSD1306@2.5.18
|
||||
adafruit/Adafruit Unified Sensor@1.1.15
|
||||
adafruit/Adafruit_VL53L0X@1.2.5
|
||||
adafruit/RTClib@2.1.4
|
||||
arduino-libraries/Arduino_LPS22HB@1.0.3
|
||||
bblanchon/ArduinoJson@7.4.3
|
||||
boschsensortec/BSEC Software Library@1.8.1492
|
||||
densaugeo/base64@1.4.0
|
||||
electroniccats/CayenneLPP@1.6.1
|
||||
https://github.com/oltaco/CustomLFS#b3928ea2d0f46c2533e901c43f471a081c503a3c
|
||||
jgromes/RadioLib@7.8.1
|
||||
melopero/Melopero RV3028@1.2.0
|
||||
robtillaart/INA226@0.6.6
|
||||
rweather/Crypto@0.4.0
|
||||
sensirion/Sensirion Core@0.7.3
|
||||
sensirion/Sensirion I2C SHT4x@1.1.2
|
||||
sparkfun/SparkFun u-blox GNSS Arduino Library@2.2.29
|
||||
stevemarple/MicroNMEA@2.0.6
|
||||
|
||||
[RAK_4631_repeater]
|
||||
adafruit/Adafruit AHTX0@2.0.6
|
||||
adafruit/Adafruit BME280 Library@2.3.0
|
||||
adafruit/Adafruit BME680 Library@2.0.6
|
||||
adafruit/Adafruit BMP085 Library@1.2.4
|
||||
adafruit/Adafruit BMP280 Library@2.6.8
|
||||
adafruit/Adafruit BusIO@1.17.4
|
||||
adafruit/Adafruit GFX Library@2.0.0
|
||||
adafruit/Adafruit INA219@1.2.3
|
||||
adafruit/Adafruit INA260 Library@1.5.4
|
||||
adafruit/Adafruit INA3221 Library@1.0.1
|
||||
adafruit/Adafruit MLX90614 Library@2.1.7
|
||||
adafruit/Adafruit NeoPixel@1.15.6
|
||||
adafruit/Adafruit SH110X@2.1.15
|
||||
adafruit/Adafruit SHTC3 Library@1.0.2
|
||||
adafruit/Adafruit SSD1306@2.5.18
|
||||
adafruit/Adafruit Unified Sensor@1.1.15
|
||||
adafruit/Adafruit_VL53L0X@1.2.5
|
||||
adafruit/RTClib@2.1.4
|
||||
arduino-libraries/Arduino_LPS22HB@1.0.3
|
||||
bblanchon/ArduinoJson@7.4.3
|
||||
boschsensortec/BSEC Software Library@1.8.1492
|
||||
electroniccats/CayenneLPP@1.6.1
|
||||
https://github.com/oltaco/CustomLFS#b3928ea2d0f46c2533e901c43f471a081c503a3c
|
||||
jgromes/RadioLib@7.8.1
|
||||
melopero/Melopero RV3028@1.2.0
|
||||
robtillaart/INA226@0.6.6
|
||||
rweather/Crypto@0.4.0
|
||||
sensirion/Sensirion Core@0.7.3
|
||||
sensirion/Sensirion I2C SHT4x@1.1.2
|
||||
sparkfun/SparkFun u-blox GNSS Arduino Library@2.2.29
|
||||
stevemarple/MicroNMEA@2.0.6
|
||||
|
||||
[RAK_4631_room_server]
|
||||
adafruit/Adafruit AHTX0@2.0.6
|
||||
adafruit/Adafruit BME280 Library@2.3.0
|
||||
adafruit/Adafruit BME680 Library@2.0.6
|
||||
adafruit/Adafruit BMP085 Library@1.2.4
|
||||
adafruit/Adafruit BMP280 Library@2.6.8
|
||||
adafruit/Adafruit BusIO@1.17.4
|
||||
adafruit/Adafruit GFX Library@2.0.0
|
||||
adafruit/Adafruit INA219@1.2.3
|
||||
adafruit/Adafruit INA260 Library@1.5.4
|
||||
adafruit/Adafruit INA3221 Library@1.0.1
|
||||
adafruit/Adafruit MLX90614 Library@2.1.7
|
||||
adafruit/Adafruit NeoPixel@1.15.6
|
||||
adafruit/Adafruit SH110X@2.1.15
|
||||
adafruit/Adafruit SHTC3 Library@1.0.2
|
||||
adafruit/Adafruit SSD1306@2.5.18
|
||||
adafruit/Adafruit Unified Sensor@1.1.15
|
||||
adafruit/Adafruit_VL53L0X@1.2.5
|
||||
adafruit/RTClib@2.1.4
|
||||
arduino-libraries/Arduino_LPS22HB@1.0.3
|
||||
bblanchon/ArduinoJson@7.4.3
|
||||
boschsensortec/BSEC Software Library@1.8.1492
|
||||
electroniccats/CayenneLPP@1.6.1
|
||||
https://github.com/oltaco/CustomLFS#b3928ea2d0f46c2533e901c43f471a081c503a3c
|
||||
jgromes/RadioLib@7.8.1
|
||||
melopero/Melopero RV3028@1.2.0
|
||||
robtillaart/INA226@0.6.6
|
||||
rweather/Crypto@0.4.0
|
||||
sensirion/Sensirion Core@0.7.3
|
||||
sensirion/Sensirion I2C SHT4x@1.1.2
|
||||
sparkfun/SparkFun u-blox GNSS Arduino Library@2.2.29
|
||||
stevemarple/MicroNMEA@2.0.6
|
||||
|
||||
[SenseCap_Solar_companion_radio_ble]
|
||||
adafruit/Adafruit AHTX0@2.0.6
|
||||
adafruit/Adafruit BME280 Library@2.3.0
|
||||
adafruit/Adafruit BME680 Library@2.0.6
|
||||
adafruit/Adafruit BMP085 Library@1.2.4
|
||||
adafruit/Adafruit BMP280 Library@2.6.8
|
||||
adafruit/Adafruit BusIO@1.17.4
|
||||
adafruit/Adafruit GFX Library@2.0.0
|
||||
adafruit/Adafruit INA219@1.2.3
|
||||
adafruit/Adafruit INA260 Library@1.5.4
|
||||
adafruit/Adafruit INA3221 Library@1.0.1
|
||||
adafruit/Adafruit MLX90614 Library@2.1.7
|
||||
adafruit/Adafruit NeoPixel@1.15.6
|
||||
adafruit/Adafruit SH110X@2.1.15
|
||||
adafruit/Adafruit SHTC3 Library@1.0.2
|
||||
adafruit/Adafruit SSD1306@2.5.18
|
||||
adafruit/Adafruit Unified Sensor@1.1.15
|
||||
adafruit/Adafruit_VL53L0X@1.2.5
|
||||
adafruit/RTClib@2.1.4
|
||||
arduino-libraries/Arduino_LPS22HB@1.0.3
|
||||
bblanchon/ArduinoJson@7.4.3
|
||||
densaugeo/base64@1.4.0
|
||||
electroniccats/CayenneLPP@1.6.1
|
||||
https://github.com/oltaco/CustomLFS#b3928ea2d0f46c2533e901c43f471a081c503a3c
|
||||
jgromes/RadioLib@7.8.1
|
||||
melopero/Melopero RV3028@1.2.0
|
||||
robtillaart/INA226@0.6.6
|
||||
rweather/Crypto@0.4.0
|
||||
sensirion/Sensirion Core@0.7.3
|
||||
sensirion/Sensirion I2C SHT4x@1.1.2
|
||||
stevemarple/MicroNMEA@2.0.6
|
||||
|
||||
[SenseCap_Solar_repeater]
|
||||
adafruit/Adafruit AHTX0@2.0.6
|
||||
adafruit/Adafruit BME280 Library@2.3.0
|
||||
adafruit/Adafruit BME680 Library@2.0.6
|
||||
adafruit/Adafruit BMP085 Library@1.2.4
|
||||
adafruit/Adafruit BMP280 Library@2.6.8
|
||||
adafruit/Adafruit BusIO@1.17.4
|
||||
adafruit/Adafruit GFX Library@1.13.0
|
||||
adafruit/Adafruit GFX Library@2.0.0
|
||||
adafruit/Adafruit INA219@1.2.3
|
||||
adafruit/Adafruit INA260 Library@1.5.4
|
||||
adafruit/Adafruit INA3221 Library@1.0.1
|
||||
adafruit/Adafruit MLX90614 Library@2.1.7
|
||||
adafruit/Adafruit NeoPixel@1.15.6
|
||||
adafruit/Adafruit SH110X@2.1.15
|
||||
adafruit/Adafruit SHTC3 Library@1.0.2
|
||||
adafruit/Adafruit SSD1306@2.5.18
|
||||
adafruit/Adafruit Unified Sensor@1.1.15
|
||||
adafruit/Adafruit_VL53L0X@1.2.5
|
||||
adafruit/RTClib@2.1.4
|
||||
arduino-libraries/Arduino_LPS22HB@1.0.3
|
||||
bblanchon/ArduinoJson@7.4.3
|
||||
electroniccats/CayenneLPP@1.6.1
|
||||
https://github.com/jgromes/RadioLib.git#6d8934836678d8894e3d556550475b37dce3e2b6
|
||||
https://github.com/oltaco/CustomLFS#b3928ea2d0f46c2533e901c43f471a081c503a3c
|
||||
melopero/Melopero RV3028@1.2.0
|
||||
robtillaart/INA226@0.6.6
|
||||
rweather/Crypto@0.4.0
|
||||
sensirion/Sensirion Core@0.7.3
|
||||
sensirion/Sensirion I2C SHT4x@1.1.2
|
||||
stevemarple/MicroNMEA@2.0.6
|
||||
|
||||
[Xiao_nrf52_companion_radio_ble]
|
||||
adafruit/Adafruit AHTX0@2.0.6
|
||||
adafruit/Adafruit BME280 Library@2.3.0
|
||||
adafruit/Adafruit BME680 Library@2.0.6
|
||||
adafruit/Adafruit BMP085 Library@1.2.4
|
||||
adafruit/Adafruit BMP280 Library@2.6.8
|
||||
adafruit/Adafruit BusIO@1.17.4
|
||||
adafruit/Adafruit GFX Library@2.0.0
|
||||
adafruit/Adafruit INA219@1.2.3
|
||||
adafruit/Adafruit INA260 Library@1.5.4
|
||||
adafruit/Adafruit INA3221 Library@1.0.1
|
||||
adafruit/Adafruit MLX90614 Library@2.1.7
|
||||
adafruit/Adafruit NeoPixel@1.15.6
|
||||
adafruit/Adafruit SH110X@2.1.15
|
||||
adafruit/Adafruit SHTC3 Library@1.0.2
|
||||
adafruit/Adafruit SSD1306@2.5.18
|
||||
adafruit/Adafruit Unified Sensor@1.1.15
|
||||
adafruit/Adafruit_VL53L0X@1.2.5
|
||||
adafruit/RTClib@2.1.4
|
||||
arduino-libraries/Arduino_LPS22HB@1.0.3
|
||||
bblanchon/ArduinoJson@7.4.3
|
||||
densaugeo/base64@1.4.0
|
||||
electroniccats/CayenneLPP@1.6.1
|
||||
https://github.com/oltaco/CustomLFS#b3928ea2d0f46c2533e901c43f471a081c503a3c
|
||||
jgromes/RadioLib@7.8.1
|
||||
melopero/Melopero RV3028@1.2.0
|
||||
robtillaart/INA226@0.6.6
|
||||
rweather/Crypto@0.4.0
|
||||
sensirion/Sensirion Core@0.7.3
|
||||
sensirion/Sensirion I2C SHT4x@1.1.2
|
||||
stevemarple/MicroNMEA@2.0.6
|
||||
|
||||
[Xiao_nrf52_repeater]
|
||||
adafruit/Adafruit AHTX0@2.0.6
|
||||
adafruit/Adafruit BME280 Library@2.3.0
|
||||
adafruit/Adafruit BME680 Library@2.0.6
|
||||
adafruit/Adafruit BMP085 Library@1.2.4
|
||||
adafruit/Adafruit BMP280 Library@2.6.8
|
||||
adafruit/Adafruit BusIO@1.17.4
|
||||
adafruit/Adafruit GFX Library@2.0.0
|
||||
adafruit/Adafruit INA219@1.2.3
|
||||
adafruit/Adafruit INA260 Library@1.5.4
|
||||
adafruit/Adafruit INA3221 Library@1.0.1
|
||||
adafruit/Adafruit MLX90614 Library@2.1.7
|
||||
adafruit/Adafruit NeoPixel@1.15.6
|
||||
adafruit/Adafruit SH110X@2.1.15
|
||||
adafruit/Adafruit SHTC3 Library@1.0.2
|
||||
adafruit/Adafruit SSD1306@2.5.18
|
||||
adafruit/Adafruit Unified Sensor@1.1.15
|
||||
adafruit/Adafruit_VL53L0X@1.2.5
|
||||
adafruit/RTClib@2.1.4
|
||||
arduino-libraries/Arduino_LPS22HB@1.0.3
|
||||
bblanchon/ArduinoJson@7.4.3
|
||||
electroniccats/CayenneLPP@1.6.1
|
||||
https://github.com/oltaco/CustomLFS#b3928ea2d0f46c2533e901c43f471a081c503a3c
|
||||
jgromes/RadioLib@7.8.1
|
||||
melopero/Melopero RV3028@1.2.0
|
||||
robtillaart/INA226@0.6.6
|
||||
rweather/Crypto@0.4.0
|
||||
sensirion/Sensirion Core@0.7.3
|
||||
sensirion/Sensirion I2C SHT4x@1.1.2
|
||||
stevemarple/MicroNMEA@2.0.6
|
||||
|
||||
[Xiao_nrf52_room_server]
|
||||
adafruit/Adafruit AHTX0@2.0.6
|
||||
adafruit/Adafruit BME280 Library@2.3.0
|
||||
adafruit/Adafruit BME680 Library@2.0.6
|
||||
adafruit/Adafruit BMP085 Library@1.2.4
|
||||
adafruit/Adafruit BMP280 Library@2.6.8
|
||||
adafruit/Adafruit BusIO@1.17.4
|
||||
adafruit/Adafruit GFX Library@2.0.0
|
||||
adafruit/Adafruit INA219@1.2.3
|
||||
adafruit/Adafruit INA260 Library@1.5.4
|
||||
adafruit/Adafruit INA3221 Library@1.0.1
|
||||
adafruit/Adafruit MLX90614 Library@2.1.7
|
||||
adafruit/Adafruit NeoPixel@1.15.6
|
||||
adafruit/Adafruit SH110X@2.1.15
|
||||
adafruit/Adafruit SHTC3 Library@1.0.2
|
||||
adafruit/Adafruit SSD1306@2.5.18
|
||||
adafruit/Adafruit Unified Sensor@1.1.15
|
||||
adafruit/Adafruit_VL53L0X@1.2.5
|
||||
adafruit/RTClib@2.1.4
|
||||
arduino-libraries/Arduino_LPS22HB@1.0.3
|
||||
bblanchon/ArduinoJson@7.4.3
|
||||
electroniccats/CayenneLPP@1.6.1
|
||||
https://github.com/oltaco/CustomLFS#b3928ea2d0f46c2533e901c43f471a081c503a3c
|
||||
jgromes/RadioLib@7.8.1
|
||||
melopero/Melopero RV3028@1.2.0
|
||||
robtillaart/INA226@0.6.6
|
||||
rweather/Crypto@0.4.0
|
||||
sensirion/Sensirion Core@0.7.3
|
||||
sensirion/Sensirion I2C SHT4x@1.1.2
|
||||
stevemarple/MicroNMEA@2.0.6
|
||||
|
||||
[Xiao_nrf52_sensor]
|
||||
adafruit/Adafruit AHTX0@2.0.6
|
||||
adafruit/Adafruit BME280 Library@2.3.0
|
||||
adafruit/Adafruit BME680 Library@2.0.6
|
||||
adafruit/Adafruit BMP085 Library@1.2.4
|
||||
adafruit/Adafruit BMP280 Library@2.6.8
|
||||
adafruit/Adafruit BusIO@1.17.4
|
||||
adafruit/Adafruit GFX Library@2.0.0
|
||||
adafruit/Adafruit INA219@1.2.3
|
||||
adafruit/Adafruit INA260 Library@1.5.4
|
||||
adafruit/Adafruit INA3221 Library@1.0.1
|
||||
adafruit/Adafruit MLX90614 Library@2.1.7
|
||||
adafruit/Adafruit NeoPixel@1.15.6
|
||||
adafruit/Adafruit SH110X@2.1.15
|
||||
adafruit/Adafruit SHTC3 Library@1.0.2
|
||||
adafruit/Adafruit SSD1306@2.5.18
|
||||
adafruit/Adafruit Unified Sensor@1.1.15
|
||||
adafruit/Adafruit_VL53L0X@1.2.5
|
||||
adafruit/RTClib@2.1.4
|
||||
arduino-libraries/Arduino_LPS22HB@1.0.3
|
||||
bblanchon/ArduinoJson@7.4.3
|
||||
electroniccats/CayenneLPP@1.6.1
|
||||
https://github.com/oltaco/CustomLFS#b3928ea2d0f46c2533e901c43f471a081c503a3c
|
||||
jgromes/RadioLib@7.8.1
|
||||
melopero/Melopero RV3028@1.2.0
|
||||
robtillaart/INA226@0.6.6
|
||||
rweather/Crypto@0.4.0
|
||||
sensirion/Sensirion Core@0.7.3
|
||||
sensirion/Sensirion I2C SHT4x@1.1.2
|
||||
stevemarple/MicroNMEA@2.0.6
|
||||
|
||||
[t1000e_companion_radio_ble]
|
||||
adafruit/Adafruit BusIO@1.17.4
|
||||
adafruit/RTClib@2.1.4
|
||||
bblanchon/ArduinoJson@7.4.3
|
||||
densaugeo/base64@1.4.0
|
||||
electroniccats/CayenneLPP@1.6.1
|
||||
end2endzone/NonBlockingRTTTL@1.4.0
|
||||
https://github.com/oltaco/CustomLFS#b3928ea2d0f46c2533e901c43f471a081c503a3c
|
||||
jgromes/RadioLib@7.8.1
|
||||
melopero/Melopero RV3028@1.2.0
|
||||
rweather/Crypto@0.4.0
|
||||
stevemarple/MicroNMEA@2.0.6
|
||||
|
||||
[t1000e_repeater]
|
||||
adafruit/Adafruit BusIO@1.17.4
|
||||
adafruit/RTClib@2.1.4
|
||||
bblanchon/ArduinoJson@7.4.3
|
||||
electroniccats/CayenneLPP@1.6.1
|
||||
https://github.com/oltaco/CustomLFS#b3928ea2d0f46c2533e901c43f471a081c503a3c
|
||||
jgromes/RadioLib@7.8.1
|
||||
melopero/Melopero RV3028@1.2.0
|
||||
rweather/Crypto@0.4.0
|
||||
stevemarple/MicroNMEA@2.0.6
|
||||
@@ -6,6 +6,16 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#ifdef PWR_DUTY_INSTRUMENT
|
||||
// CUSTOM (TeTeHacko): bench instrument. Pure CPU time spent processing a received
|
||||
// packet (dedup + crypto + routing), independent of BLE/USB background wakes --
|
||||
// unlike the sleep-duty measure. This is the work a radio-side filter could skip
|
||||
// for a dropped packet. Printed by NRF52Board::sleep() (extern below).
|
||||
#include <Arduino.h>
|
||||
uint64_t g_pkt_proc_us = 0;
|
||||
uint32_t g_pkt_proc_count = 0;
|
||||
#endif
|
||||
|
||||
namespace mesh {
|
||||
|
||||
#define MAX_RX_DELAY_MILLIS 32000 // 32 seconds
|
||||
@@ -273,6 +283,9 @@ void Dispatcher::checkRecv() {
|
||||
}
|
||||
|
||||
void Dispatcher::processRecvPacket(Packet* pkt) {
|
||||
#ifdef PWR_DUTY_INSTRUMENT
|
||||
uint32_t _pwr_t0 = micros();
|
||||
#endif
|
||||
DispatcherAction action = onRecvPacket(pkt);
|
||||
if (action == ACTION_RELEASE) {
|
||||
_mgr->free(pkt);
|
||||
@@ -284,6 +297,10 @@ void Dispatcher::processRecvPacket(Packet* pkt) {
|
||||
|
||||
_mgr->queueOutbound(pkt, priority, futureMillis(_delay));
|
||||
}
|
||||
#ifdef PWR_DUTY_INSTRUMENT
|
||||
g_pkt_proc_us += (uint32_t)(micros() - _pwr_t0);
|
||||
g_pkt_proc_count++;
|
||||
#endif
|
||||
}
|
||||
|
||||
void Dispatcher::checkSend() {
|
||||
|
||||
@@ -121,6 +121,7 @@ typedef uint32_t DispatcherAction;
|
||||
#ifndef MESH_TX_RETRIES
|
||||
#define MESH_TX_RETRIES 3
|
||||
#endif
|
||||
#define ERR_EVENT_DIAG1 (1 << 8) // role-specific error flag
|
||||
|
||||
/**
|
||||
* \brief The low-level task that manages detecting incoming Packets, and the queueing
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <helpers/BaseChatMesh.h>
|
||||
#include <Utils.h>
|
||||
#include <helpers/UTF8Helpers.h>
|
||||
|
||||
#ifndef SERVER_RESPONSE_DELAY
|
||||
#define SERVER_RESPONSE_DELAY 300
|
||||
@@ -247,7 +248,10 @@ void BaseChatMesh::onPeerDataRecv(mesh::Packet* packet, uint8_t type, int sender
|
||||
// len can be > original length, but 'text' will be padded with zeroes
|
||||
data[len] = 0; // need to make a C string again, with null terminator
|
||||
|
||||
if (flags == TXT_TYPE_PLAIN) {
|
||||
size_t text_ofs = (flags == TXT_TYPE_SIGNED_PLAIN) ? 9 : 5; // signed text starts after 4-byte sender prefix
|
||||
if (len < text_ofs || !mesh::isValidUtf8TextAndPadding(&data[text_ofs], len - text_ofs)) {
|
||||
MESH_DEBUG_PRINTLN("onPeerDataRecv: invalid text payload!");
|
||||
} else if (flags == TXT_TYPE_PLAIN) {
|
||||
from.lastmod = getRTCClock()->getCurrentTime(); // update last heard time
|
||||
onMessageRecv(from, packet, sender_timestamp, (const char *) &data[5]); // let UI know
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ void ClientACL::loadTimestamps() {
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < num_clients; i++) {
|
||||
clients[i].last_timestamp = clients[i].saved_timestamp;
|
||||
clients[i].last_timestamp = clients[i].last_req_timestamp = clients[i].saved_timestamp;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ ClientInfo* ClientACL::putClient(const mesh::Identity& id, uint8_t init_perms) {
|
||||
c->out_path_len = OUT_PATH_UNKNOWN;
|
||||
for (int i = 0; i < _num_ts_orphans; i++) { // known before: its replay floor comes back
|
||||
if (memcmp(_ts_orphans[i].prefix, id.pub_key, ACL_TS_PREFIX) == 0) {
|
||||
c->saved_timestamp = c->last_timestamp = _ts_orphans[i].ts;
|
||||
c->saved_timestamp = c->last_timestamp = c->last_req_timestamp = _ts_orphans[i].ts;
|
||||
_num_ts_orphans--;
|
||||
memmove(&_ts_orphans[i], &_ts_orphans[i + 1], (_num_ts_orphans - i) * sizeof(TsOrphan));
|
||||
break;
|
||||
|
||||
@@ -20,6 +20,7 @@ struct ClientInfo {
|
||||
uint8_t shared_secret[PUB_KEY_SIZE];
|
||||
uint32_t last_timestamp; // by THEIR clock (restored from /s_acl_ts* on boot)
|
||||
uint32_t saved_timestamp; // last_timestamp as last written to /s_acl_ts*
|
||||
uint32_t last_req_timestamp; // REQ only (upstream split); restored from saved_timestamp too
|
||||
uint32_t last_activity; // by OUR clock (transient)
|
||||
union {
|
||||
struct {
|
||||
|
||||
@@ -328,11 +328,27 @@ bool NRF52Board::isExternalPowered() {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PWR_DUTY_INSTRUMENT
|
||||
// CUSTOM (TeTeHacko): bench instrument (opt-in, -D PWR_DUTY_INSTRUMENT). Measures
|
||||
// what share of wall time the MCU is awake: the loop calls sleep() every pass, so
|
||||
// the gap between a sleep() return and the next sleep() entry is CPU-awake time,
|
||||
// and the WFE span inside is asleep. Combined with `recv` from stats-packets it
|
||||
// gives the CPU cost per received packet (the part a radio-side filter could cut).
|
||||
// Prints one line to Serial every ~10 s. No effect unless the flag is set.
|
||||
static uint64_t s_awake_us = 0, s_asleep_us = 0;
|
||||
static uint32_t s_last_exit_us = 0, s_wakes = 0, s_report_us = 0;
|
||||
static bool s_have_exit = false;
|
||||
// Pure per-packet CPU time, measured in Dispatcher::processRecvPacket (immune to
|
||||
// BLE/USB background wakes, unlike the awake/asleep duty above).
|
||||
extern uint64_t g_pkt_proc_us;
|
||||
extern uint32_t g_pkt_proc_count;
|
||||
#endif
|
||||
|
||||
void NRF52Board::sleep(uint32_t secs) {
|
||||
// Clear FPU interrupt flags to avoid insomnia
|
||||
// see errata 87 for details https://docs.nordicsemi.com/bundle/errata_nRF52840_Rev3/page/ERR/nRF52840/Rev3/latest/anomaly_840_87.html
|
||||
#if (__FPU_USED == 1)
|
||||
__set_FPSCR(__get_FPSCR() & ~(0x0000009F));
|
||||
__set_FPSCR(__get_FPSCR() & ~(0x0000009F));
|
||||
(void) __get_FPSCR();
|
||||
NVIC_ClearPendingIRQ(FPU_IRQn);
|
||||
#endif
|
||||
@@ -350,6 +366,11 @@ void NRF52Board::sleep(uint32_t secs) {
|
||||
uint8_t sd_enabled = 0;
|
||||
sd_softdevice_is_enabled(&sd_enabled);
|
||||
|
||||
#ifdef PWR_DUTY_INSTRUMENT
|
||||
uint32_t t_enter = micros();
|
||||
if (s_have_exit) s_awake_us += (uint32_t)(t_enter - s_last_exit_us);
|
||||
#endif
|
||||
|
||||
if (sd_enabled) {
|
||||
// first call processes pending softdevice events, second call sleeps.
|
||||
sd_app_evt_wait();
|
||||
@@ -360,6 +381,23 @@ void NRF52Board::sleep(uint32_t secs) {
|
||||
__WFE();
|
||||
__WFE();
|
||||
}
|
||||
|
||||
#ifdef PWR_DUTY_INSTRUMENT
|
||||
uint32_t t_exit = micros();
|
||||
s_asleep_us += (uint32_t)(t_exit - t_enter);
|
||||
s_last_exit_us = t_exit;
|
||||
s_have_exit = true;
|
||||
s_wakes++;
|
||||
if ((uint32_t)(t_exit - s_report_us) >= 10000000UL) {
|
||||
s_report_us = t_exit;
|
||||
uint64_t tot = s_awake_us + s_asleep_us;
|
||||
uint32_t permille = tot ? (uint32_t)((s_awake_us * 1000) / tot) : 0;
|
||||
Serial.printf("PWRDUTY awake_ms=%lu asleep_ms=%lu wakes=%lu duty_permille=%lu pkt_us=%lu pkt_n=%lu\r\n",
|
||||
(unsigned long)(s_awake_us / 1000), (unsigned long)(s_asleep_us / 1000),
|
||||
(unsigned long)s_wakes, (unsigned long)permille,
|
||||
(unsigned long)(g_pkt_proc_us), (unsigned long)g_pkt_proc_count);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Temperature from NRF52 MCU
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* \brief Remembers the last CLI replies sent, as a hash of each reply's plaintext (timestamp, flags, text),
|
||||
* so the same bytes coming back as a command (hash bytes swapped, same shared secret) are refused.
|
||||
*/
|
||||
class ReplyEchoGuard {
|
||||
static const int SLOTS = 16;
|
||||
uint32_t _hash[SLOTS] = {};
|
||||
int _next = 0;
|
||||
|
||||
static uint32_t hash(const uint8_t* p, size_t len) { // FNV-1a, never zero (zero marks an empty slot)
|
||||
uint32_t h = 2166136261u;
|
||||
for (size_t i = 0; i < len; i++) {
|
||||
h = (h ^ p[i]) * 16777619u;
|
||||
}
|
||||
return h ? h : 1;
|
||||
}
|
||||
|
||||
public:
|
||||
void note(const uint8_t* plain, size_t len) {
|
||||
_hash[_next] = hash(plain, len);
|
||||
_next = (_next + 1) % SLOTS;
|
||||
}
|
||||
|
||||
bool matches(const uint8_t* plain, size_t len) const {
|
||||
uint32_t h = hash(plain, len);
|
||||
for (int i = 0; i < SLOTS; i++) {
|
||||
if (_hash[i] == h) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
@@ -53,4 +53,50 @@ inline size_t validUtf8PrefixLength(const char* text, size_t max_bytes) {
|
||||
return offset;
|
||||
}
|
||||
|
||||
inline bool isValidUtf8TextAndPadding(const uint8_t* data, size_t len) {
|
||||
size_t offset = 0;
|
||||
bool seen_null = false;
|
||||
size_t null_pos = 0;
|
||||
while (offset < len) {
|
||||
const uint8_t first = static_cast<uint8_t>(data[offset]);
|
||||
if (seen_null) {
|
||||
if (first == 0) { // OK, is zero padding
|
||||
offset++;
|
||||
} else if (offset == null_pos + 1 && first >= 4 && first != 0xFF) { // OK, extended attempt byte (see composeMsgPacket)
|
||||
offset++;
|
||||
} else {
|
||||
return false; // Error, non-zero padding encountered
|
||||
}
|
||||
} else {
|
||||
if (first == 0) {
|
||||
seen_null = true;
|
||||
null_pos = offset;
|
||||
offset++;
|
||||
} else {
|
||||
size_t sequence_length = 0;
|
||||
|
||||
if (first < 0x20 && first != '\t' && first != '\n' && first != '\r') {
|
||||
return false; // control character
|
||||
} else if (first <= 0x7F) {
|
||||
sequence_length = 1;
|
||||
} else if (first >= 0xC2 && first <= 0xDF) {
|
||||
sequence_length = 2;
|
||||
} else if (first >= 0xE0 && first <= 0xEF) {
|
||||
sequence_length = 3;
|
||||
} else if (first >= 0xF0 && first <= 0xF4) {
|
||||
sequence_length = 4;
|
||||
} else {
|
||||
return false; // unsupported UTF-8 encoding
|
||||
}
|
||||
if (offset + sequence_length > len) return false; // invalid UTF-8 encoding
|
||||
for (size_t i = 1; i < sequence_length; i++) {
|
||||
if (!isUtf8Continuation(data[offset + i])) return false; // invalid UTF-8 encoding
|
||||
}
|
||||
offset += sequence_length;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true; // is OK
|
||||
}
|
||||
|
||||
} // namespace mesh
|
||||
@@ -392,7 +392,7 @@ public:
|
||||
} else if (_page == HomePage::RECENT) {
|
||||
display.setColor(UIColor::primary_txt);
|
||||
int y = 20;
|
||||
for (int i = 0, k = recent_next_idx; i < UI_RECENT_LIST_SIZE; i++, y += 11, k = (k + 1) % UI_RECENT_LIST_SIZE) {
|
||||
for (int i = 0, k = recent_next_idx; i < UI_RECENT_LIST_SIZE; i++, k = (k + 1) % UI_RECENT_LIST_SIZE) {
|
||||
auto a = &recent[k];
|
||||
if (a->name[0] == 0) continue; // empty slot
|
||||
int secs = _rtc->getCurrentTime() - a->recv_timestamp;
|
||||
@@ -412,6 +412,10 @@ public:
|
||||
display.drawTextEllipsized(0, y, max_name_width, filtered_recent_name);
|
||||
display.setCursor(display.width() - timestamp_width - 1, y);
|
||||
display.print(tmp);
|
||||
y += 11;
|
||||
}
|
||||
if (y == 20) {
|
||||
display.drawTextCentered(display.width() / 2, 32, "No recent adverts");
|
||||
}
|
||||
} else if (_page == HomePage::RADIO) {
|
||||
display.setColor(UIColor::primary_txt);
|
||||
@@ -513,6 +517,11 @@ public:
|
||||
} else if (_page == HomePage::SENSORS) {
|
||||
int y = 18;
|
||||
refresh_sensors();
|
||||
if (sensors_nb == 0) {
|
||||
display.setColor(UIColor::primary_txt);
|
||||
display.drawTextCentered(display.width() / 2, 32, "No sensor readings");
|
||||
return 5000;
|
||||
}
|
||||
char buf[30];
|
||||
char name[30];
|
||||
LPPReader r(sensors_lpp.getBuffer(), sensors_lpp.getSize());
|
||||
|
||||
@@ -183,6 +183,7 @@ TEST(AclReplayFloor, AlternatesSlotsAcrossReboots) {
|
||||
n.boot();
|
||||
c = n.acl->getClient(idFor(1).pub_key, PUB_KEY_SIZE);
|
||||
ASSERT_EQ(c->last_timestamp, ts) << "boot " << boot;
|
||||
ASSERT_EQ(c->last_req_timestamp, ts) << "boot " << boot; // REQ floor (upstream split) comes back too
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ a different board.
|
||||
| `ble_flash_node.sh` | BLE OTA of a node out of reach of a cable, with the checks around it (silence, services, version) |
|
||||
| `ble_dfu.py` | legacy Nordic DFU over BLE for the Adafruit nRF52 bootloader (buttonless, both phases) |
|
||||
| `build_version.py` | PlatformIO pre-script: real version and build time for `ver` |
|
||||
| `pio_lock.py` | library lock for PlatformIO (`platformio.lock`): `install` the locked versions before a build, `check` that nothing else resolved, `freeze` a resolution, `moved` against git |
|
||||
| `bl_sign_pkg.py` | DFU zip for a board with the signed (`SIGNED_FW`) Adafruit bootloader: `adafruit-nrfutil dfu genpkg --key-file` with its two Python 3 bugs on that path fixed |
|
||||
| `bl_verify_pkg.py` | checks a DFU zip the way the signed bootloader will (device type, ECDSA P-256 over the init packet, image length and hash) |
|
||||
| `bl_allowed_key` | the public key the signed bootloader carries (`SIGNED_FW_QX`/`QY`) |
|
||||
|
||||
@@ -0,0 +1,259 @@
|
||||
#!/usr/bin/env python3
|
||||
# SPDX-License-Identifier: MIT
|
||||
"""Library lock file for PlatformIO, which has none (platformio.lock).
|
||||
|
||||
Upstream's lib_deps are ranges (`^2.1.3`) and every library pulls in its own
|
||||
dependencies, so a build takes whatever is newest that day: the same commit
|
||||
built twice can differ. platformio.lock records, per env, the exact version of
|
||||
every library in .pio/libdeps/<env> (direct and transitive). The platform and
|
||||
the toolchain are pinned in platformio.ini itself.
|
||||
|
||||
pio_lock.py install -e ENV [-e ENV ...]
|
||||
install the locked registry versions into .pio/libdeps/<env> (no
|
||||
dependencies, nothing saved to platformio.ini). Run it before `pio
|
||||
run`: PlatformIO keeps an installed library that satisfies lib_deps.
|
||||
git and file libraries are pinned in platformio.ini and only checked.
|
||||
pio_lock.py check -e ENV [-e ENV ...]
|
||||
exit 1 when .pio/libdeps/<env> is not exactly the lock: a library
|
||||
missing, extra, or of another version (run it after the build).
|
||||
pio_lock.py freeze -e ENV [-e ENV ...]
|
||||
write what .pio/libdeps/<env> holds into the lock (replaces those
|
||||
envs' sections). After `pio pkg install -e ENV` in a clean libdeps
|
||||
dir this locks today's resolution.
|
||||
pio_lock.py envs
|
||||
the envs the lock has a section for, one per line.
|
||||
pio_lock.py moved [--base REV]
|
||||
what changed against the lock in git REV (default HEAD), one
|
||||
`name old -> new` line per registry library (any env).
|
||||
|
||||
Lock format: `[env]` sections; one library per line, `owner/name@version`
|
||||
from the registry, `<remote>#<commit>` of a git library, or a file: URI.
|
||||
--lock FILE (default: platformio.lock next to platformio.ini);
|
||||
PLATFORMIO_LIBDEPS_DIR is honoured as by PlatformIO.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
REPO = Path(__file__).resolve().parent.parent
|
||||
HEADER = """\
|
||||
; Library lock for PlatformIO (tools/pio_lock.py; PlatformIO has no lockfile).
|
||||
; Per env, every library in .pio/libdeps/<env>, transitive ones included:
|
||||
; `owner/name@version` from the registry, `<remote>#<commit>` of a git library
|
||||
; (pinned in platformio.ini, only checked here) or a file: URI.
|
||||
; CI installs these before building and fails when a build resolved anything
|
||||
; else. Renovate bumps the registry lines; tools/pio_lock.py freeze rewrites
|
||||
; an env from what it resolved.
|
||||
"""
|
||||
|
||||
|
||||
# PlatformIO puts the test framework into an env's libdeps (`pio pkg install`
|
||||
# in CI did, a local one did not); it is never linked into the firmware.
|
||||
IGNORED = {"throwtheswitch/Unity"}
|
||||
|
||||
|
||||
def libdeps_dir() -> Path:
|
||||
d = os.environ.get("PLATFORMIO_LIBDEPS_DIR")
|
||||
return Path(d) if d else REPO / ".pio" / "libdeps"
|
||||
|
||||
|
||||
def read_lock(path: Path) -> dict[str, list[str]]:
|
||||
envs: dict[str, list[str]] = {}
|
||||
cur: list[str] | None = None
|
||||
if not path.exists():
|
||||
return envs
|
||||
for raw in path.read_text().splitlines():
|
||||
line = raw.strip()
|
||||
if not line or line.startswith((";", "#")):
|
||||
continue
|
||||
if line.startswith("[") and line.endswith("]"):
|
||||
cur = envs.setdefault(line[1:-1], [])
|
||||
elif cur is None:
|
||||
raise SystemExit(f"{path}: library line before any [env]: {line}")
|
||||
else:
|
||||
cur.append(line)
|
||||
return envs
|
||||
|
||||
|
||||
def write_lock(path: Path, envs: dict[str, list[str]]) -> None:
|
||||
out = [HEADER]
|
||||
for env in sorted(envs):
|
||||
out.append(f"[{env}]")
|
||||
out.extend(sorted(envs[env], key=str.lower))
|
||||
out.append("")
|
||||
path.write_text("\n".join(out))
|
||||
|
||||
|
||||
def git_uri(lib: Path) -> str:
|
||||
"""`<remote>#<commit>` of a library PlatformIO cloned (it leaves no .piopm)."""
|
||||
|
||||
def git(*args: str) -> str:
|
||||
return subprocess.run(
|
||||
["git", "-C", str(lib), *args], check=True, capture_output=True, text=True
|
||||
).stdout.strip()
|
||||
|
||||
return f"{git('remote', 'get-url', 'origin')}#{git('rev-parse', 'HEAD')}"
|
||||
|
||||
|
||||
def installed(env: str) -> list[str]:
|
||||
"""Lock lines for what .pio/libdeps/<env> holds."""
|
||||
d = libdeps_dir() / env
|
||||
if not d.is_dir():
|
||||
raise SystemExit(
|
||||
f"{d}: no such libdeps dir (run `pio pkg install -e {env}` first)"
|
||||
)
|
||||
lines = []
|
||||
for lib in sorted(p for p in d.iterdir() if p.is_dir()):
|
||||
pm = lib / ".piopm"
|
||||
if not pm.exists():
|
||||
if (lib / ".git").exists():
|
||||
lines.append(git_uri(lib))
|
||||
continue
|
||||
raise SystemExit(f"{lib}: neither .piopm nor .git")
|
||||
meta = json.loads(pm.read_text())
|
||||
if meta.get("type") != "library":
|
||||
continue
|
||||
spec = meta.get("spec") or {}
|
||||
if spec.get("uri"):
|
||||
lines.append(spec["uri"])
|
||||
elif spec.get("owner"):
|
||||
if f"{spec['owner']}/{spec['name']}" in IGNORED:
|
||||
continue
|
||||
lines.append(f"{spec['owner']}/{spec['name']}@{meta['version']}")
|
||||
else:
|
||||
raise SystemExit(f"{pm}: neither a registry owner nor a URI")
|
||||
return lines
|
||||
|
||||
|
||||
def pio() -> str:
|
||||
exe = shutil.which("pio") or str(Path.home() / ".platformio/penv/bin/pio")
|
||||
if not Path(exe).exists():
|
||||
raise SystemExit("pio not found (PATH, ~/.platformio/penv/bin)")
|
||||
return exe
|
||||
|
||||
|
||||
def cmd_install(lock: dict[str, list[str]], envs: list[str]) -> int:
|
||||
for env in envs:
|
||||
if env not in lock:
|
||||
print(f"{env}: not in the lock", file=sys.stderr)
|
||||
return 1
|
||||
# URI libraries (git, file) are pinned in platformio.ini itself and
|
||||
# come from there; the lock only checks them
|
||||
reg = [line for line in lock[env] if "://" not in line]
|
||||
args = [
|
||||
pio(),
|
||||
"pkg",
|
||||
"install",
|
||||
"-d",
|
||||
str(REPO),
|
||||
"-e",
|
||||
env,
|
||||
"--no-save",
|
||||
"--skip-dependencies",
|
||||
"-s",
|
||||
]
|
||||
for line in reg:
|
||||
args += ["-l", line]
|
||||
print(f"{env}: installing {len(reg)} locked libraries", flush=True)
|
||||
subprocess.run(args, check=True)
|
||||
return 0
|
||||
|
||||
|
||||
def cmd_check(lock: dict[str, list[str]], envs: list[str]) -> int:
|
||||
bad = 0
|
||||
for env in envs:
|
||||
want, have = set(lock.get(env, [])), set(installed(env))
|
||||
if env not in lock:
|
||||
print(f"{env}: not in the lock", file=sys.stderr)
|
||||
bad = 1
|
||||
continue
|
||||
if want == have:
|
||||
print(f"{env}: {len(have)} libraries as locked")
|
||||
continue
|
||||
bad = 1
|
||||
for line in sorted(want - have):
|
||||
print(f"{env}: locked but not installed: {line}", file=sys.stderr)
|
||||
for line in sorted(have - want):
|
||||
print(f"{env}: installed but not locked: {line}", file=sys.stderr)
|
||||
if bad:
|
||||
print(
|
||||
"fix: tools/pio_lock.py freeze -e <env> after a clean `pio pkg install -e <env>`",
|
||||
file=sys.stderr,
|
||||
)
|
||||
return bad
|
||||
|
||||
|
||||
def moved(base: dict[str, list[str]], lock: dict[str, list[str]]) -> list[str]:
|
||||
def versions(envs: dict[str, list[str]]) -> dict[str, set[str]]:
|
||||
out: dict[str, set[str]] = {}
|
||||
for lines in envs.values():
|
||||
for line in lines:
|
||||
if "://" not in line:
|
||||
name, _, ver = line.rpartition("@")
|
||||
out.setdefault(name, set()).add(ver)
|
||||
return out
|
||||
|
||||
old, new = versions(base), versions(lock)
|
||||
res = []
|
||||
for name in sorted(set(old) | set(new), key=str.lower):
|
||||
o, n = sorted(old.get(name, set())), sorted(new.get(name, set()))
|
||||
if o != n:
|
||||
res.append(
|
||||
f"{name.split('/', 1)[-1]} {', '.join(o) or '-'} -> {', '.join(n) or '-'}"
|
||||
)
|
||||
return res
|
||||
|
||||
|
||||
def main() -> None:
|
||||
ap = argparse.ArgumentParser(
|
||||
description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter
|
||||
)
|
||||
ap.add_argument("command", choices=["install", "check", "freeze", "envs", "moved"])
|
||||
ap.add_argument(
|
||||
"-e", "--env", action="append", default=[], help="PlatformIO env (repeat)"
|
||||
)
|
||||
ap.add_argument("--lock", type=Path, default=REPO / "platformio.lock")
|
||||
ap.add_argument(
|
||||
"--base", default="HEAD", help="moved: git revision to compare with"
|
||||
)
|
||||
a = ap.parse_args()
|
||||
lock = read_lock(a.lock)
|
||||
if a.command == "envs":
|
||||
print("\n".join(sorted(lock)))
|
||||
return
|
||||
if a.command == "moved":
|
||||
rel = a.lock.resolve().relative_to(REPO)
|
||||
old = subprocess.run(
|
||||
["git", "-C", str(REPO), "show", f"{a.base}:{rel}"],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
check=False,
|
||||
).stdout
|
||||
tmp = Path(os.environ.get("TMPDIR", "/tmp")) / f"pio-lock-base-{os.getpid()}"
|
||||
tmp.write_text(old)
|
||||
try:
|
||||
print("\n".join(moved(read_lock(tmp), lock)))
|
||||
finally:
|
||||
tmp.unlink()
|
||||
return
|
||||
if not a.env:
|
||||
ap.error("at least one -e ENV")
|
||||
if a.command == "install":
|
||||
sys.exit(cmd_install(lock, a.env))
|
||||
if a.command == "check":
|
||||
sys.exit(cmd_check(lock, a.env))
|
||||
for env in a.env:
|
||||
lock[env] = installed(env)
|
||||
print(f"{env}: {len(lock[env])} libraries locked")
|
||||
write_lock(a.lock, lock)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -137,50 +137,45 @@ build_src_filter = ${SenseCap_Solar.build_src_filter}
|
||||
+<../examples/kiss_modem/>
|
||||
|
||||
; CUSTOM (TeTeHacko): EXACT dependency set of the SenseCap Solar repeater --
|
||||
; PlatformIO has no lockfile, and upstream inherits ranges (`^2.1.5`) and an
|
||||
; unpinned `platform = nordicnrf52`, so every build resolves whatever is newest
|
||||
; that day: on 23. 10. 2026 one commit built 271 kB differently from the image
|
||||
; that had run in the field for a week (platform 11.0.0 instead of 10.12.0,
|
||||
; Adafruit GFX / INA260 / MLX90614 a patch or minor newer). These are the
|
||||
; versions proven in the field; the public release builds them too.
|
||||
;
|
||||
; RadioLib, CustomLFS and the framework are git pins upstream and copied as is.
|
||||
; ORDER MATTERS: it is the link order -- same as upstream's inheritance
|
||||
; (arduino_base, nrf52_base, sensor_base), or the layout of the image changes.
|
||||
; Moving to a newer upstream: if its platformio.ini changed lib_deps or the
|
||||
; platform, refresh this list from a clean `pio run` (`.pio/libdeps/<env>`) and
|
||||
; check the result on the bench before releasing it.
|
||||
; The masts' dependency set, in upstream's inheritance order (arduino_base,
|
||||
; nrf52_base, sensor_base) -- ORDER MATTERS, it is the link order -- with the
|
||||
; transitive libraries listed too. 23. 10. 2026 one commit built 271 kB
|
||||
; differently from the image in the field because everything floated; since
|
||||
; 30. 11. 2026 the exact versions are platformio.lock's job (tools/pio_lock.py,
|
||||
; checked by every CI build) and the daily lock refresh moves them, so the
|
||||
; versions here are ranges from the ones proven in the field. RadioLib and
|
||||
; CustomLFS stay git pins.
|
||||
[sensecap_pinned]
|
||||
platform = nordicnrf52@10.12.0
|
||||
platform = ${nrf52_base.platform}
|
||||
lib_deps =
|
||||
SPI
|
||||
Wire
|
||||
https://github.com/jgromes/RadioLib.git#6d8934836678d8894e3d556550475b37dce3e2b6
|
||||
rweather/Crypto @ 0.4.0
|
||||
adafruit/RTClib @ 2.1.4
|
||||
melopero/Melopero RV3028 @ 1.2.0
|
||||
electroniccats/CayenneLPP @ 1.6.1
|
||||
rweather/Crypto @ ^0.4.0
|
||||
adafruit/RTClib @ ^2.1.4
|
||||
melopero/Melopero RV3028 @ ^1.2.0
|
||||
electroniccats/CayenneLPP @ ^1.6.1
|
||||
https://github.com/oltaco/CustomLFS#0.2.3
|
||||
adafruit/Adafruit INA3221 Library @ 1.0.1
|
||||
adafruit/Adafruit INA219 @ 1.2.3
|
||||
robtillaart/INA226 @ 0.6.6
|
||||
adafruit/Adafruit INA260 Library @ 1.5.3
|
||||
adafruit/Adafruit AHTX0 @ 2.0.6
|
||||
adafruit/Adafruit BME280 Library @ 2.3.0
|
||||
adafruit/Adafruit BMP280 Library @ 2.6.8
|
||||
adafruit/Adafruit SHTC3 Library @ 1.0.2
|
||||
sensirion/Sensirion I2C SHT4x @ 1.1.2
|
||||
arduino-libraries/Arduino_LPS22HB @ 1.0.3
|
||||
adafruit/Adafruit MLX90614 Library @ 2.1.6
|
||||
adafruit/Adafruit_VL53L0X @ 1.2.5
|
||||
stevemarple/MicroNMEA @ 2.0.6
|
||||
adafruit/Adafruit BME680 Library @ 2.0.6
|
||||
adafruit/Adafruit BMP085 Library @ 1.2.4
|
||||
; transitive (pulled in by the sensor libraries), pinned so they cannot float
|
||||
adafruit/Adafruit BusIO @ 1.17.4
|
||||
adafruit/Adafruit Unified Sensor @ 1.1.15
|
||||
adafruit/Adafruit GFX Library @ 1.12.6
|
||||
adafruit/Adafruit SSD1306 @ 2.5.17
|
||||
adafruit/Adafruit SH110X @ 2.1.15
|
||||
adafruit/Adafruit NeoPixel @ 1.15.5
|
||||
sensirion/Sensirion Core @ 0.7.3
|
||||
adafruit/Adafruit INA3221 Library @ ^1.0.1
|
||||
adafruit/Adafruit INA219 @ ^1.2.3
|
||||
robtillaart/INA226 @ ^0.6.6
|
||||
adafruit/Adafruit INA260 Library @ ^1.5.3
|
||||
adafruit/Adafruit AHTX0 @ ^2.0.6
|
||||
adafruit/Adafruit BME280 Library @ ^2.3.0
|
||||
adafruit/Adafruit BMP280 Library @ ^2.6.8
|
||||
adafruit/Adafruit SHTC3 Library @ ^1.0.2
|
||||
sensirion/Sensirion I2C SHT4x @ ^1.1.2
|
||||
arduino-libraries/Arduino_LPS22HB @ ^1.0.3
|
||||
adafruit/Adafruit MLX90614 Library @ ^2.1.6
|
||||
adafruit/Adafruit_VL53L0X @ ^1.2.5
|
||||
stevemarple/MicroNMEA @ ^2.0.6
|
||||
adafruit/Adafruit BME680 Library @ ^2.0.6
|
||||
adafruit/Adafruit BMP085 Library @ ^1.2.4
|
||||
; transitive (pulled in by the sensor libraries), listed for the link order
|
||||
adafruit/Adafruit BusIO @ ^1.17.4
|
||||
adafruit/Adafruit Unified Sensor @ ^1.1.15
|
||||
adafruit/Adafruit GFX Library @ ^1.12.6
|
||||
adafruit/Adafruit SSD1306 @ ^2.5.17
|
||||
adafruit/Adafruit SH110X @ ^2.1.15
|
||||
adafruit/Adafruit NeoPixel @ ^1.15.5
|
||||
sensirion/Sensirion Core @ ^0.7.3
|
||||
@@ -32,11 +32,25 @@
|
||||
#define PIN_BUTTON5 (28) // Joystick Right
|
||||
#define PIN_BUTTON6 (29) // Joystick Press
|
||||
#define PIN_BACK_BTN PIN_BUTTON1
|
||||
// Joystick pins can be overridden from build_flags, e.g. for an enclosure
|
||||
// that mounts the display rotated 90 degrees relative to the joystick:
|
||||
// -D JOYSTICK_UP=PIN_BUTTON4 -D JOYSTICK_DOWN=PIN_BUTTON5
|
||||
// -D JOYSTICK_LEFT=PIN_BUTTON3 -D JOYSTICK_RIGHT=PIN_BUTTON2
|
||||
#ifndef JOYSTICK_UP
|
||||
#define JOYSTICK_UP PIN_BUTTON2
|
||||
#endif
|
||||
#ifndef JOYSTICK_DOWN
|
||||
#define JOYSTICK_DOWN PIN_BUTTON3
|
||||
#endif
|
||||
#ifndef JOYSTICK_LEFT
|
||||
#define JOYSTICK_LEFT PIN_BUTTON4
|
||||
#endif
|
||||
#ifndef JOYSTICK_RIGHT
|
||||
#define JOYSTICK_RIGHT PIN_BUTTON5
|
||||
#endif
|
||||
#ifndef JOYSTICK_PRESS
|
||||
#define JOYSTICK_PRESS PIN_BUTTON6
|
||||
#endif
|
||||
#define PIN_USER_BTN PIN_BUTTON6
|
||||
|
||||
// Buzzer
|
||||
|
||||
Reference in new issue
Block a user