mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-08 14:12:05 +00:00
Merge remote-tracking branch 'upstream/master' into StandaloneAddons
This commit is contained in:
commit
2a6944fe12
1
.github/workflows/main_matrix.yml
vendored
1
.github/workflows/main_matrix.yml
vendored
@ -149,6 +149,7 @@ jobs:
|
|||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
test-native:
|
test-native:
|
||||||
|
if: ${{ !contains(github.ref_name, 'event/') }}
|
||||||
uses: ./.github/workflows/test_native.yml
|
uses: ./.github/workflows/test_native.yml
|
||||||
|
|
||||||
docker-deb-amd64:
|
docker-deb-amd64:
|
||||||
|
16
.github/workflows/release_channels.yml
vendored
16
.github/workflows/release_channels.yml
vendored
@ -63,21 +63,17 @@ jobs:
|
|||||||
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 "short=$(./bin/buildinfo.py short)" >> $GITHUB_OUTPUT
|
|
||||||
echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT
|
|
||||||
id: version
|
|
||||||
env:
|
|
||||||
BUILD_LOCATION: local
|
|
||||||
|
|
||||||
- name: Bump version.properties
|
- name: Bump version.properties
|
||||||
run: |
|
run: |
|
||||||
# Bump version.properties
|
# Bump version.properties
|
||||||
chmod +x ./bin/bump_version.py
|
chmod +x ./bin/bump_version.py
|
||||||
./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
|
- name: Ensure debian deps are installed
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update -y --fix-missing
|
sudo apt-get update -y --fix-missing
|
||||||
@ -94,7 +90,7 @@ jobs:
|
|||||||
# Bump org.meshtastic.meshtasticd.metainfo.xml
|
# Bump org.meshtastic.meshtasticd.metainfo.xml
|
||||||
pip install -r bin/bump_metainfo/requirements.txt -q
|
pip install -r bin/bump_metainfo/requirements.txt -q
|
||||||
chmod +x ./bin/bump_metainfo/bump_metainfo.py
|
chmod +x ./bin/bump_metainfo/bump_metainfo.py
|
||||||
./bin/bump_metainfo/bump_metainfo.py --file bin/org.meshtastic.meshtasticd.metainfo.xml "${{ steps.version.outputs.short }}"
|
./bin/bump_metainfo/bump_metainfo.py --file bin/org.meshtastic.meshtasticd.metainfo.xml "${{ steps.new_version.outputs.short }}"
|
||||||
env:
|
env:
|
||||||
PIP_DISABLE_PIP_VERSION_CHECK: 1
|
PIP_DISABLE_PIP_VERSION_CHECK: 1
|
||||||
|
|
||||||
|
7
.github/workflows/tests.yml
vendored
7
.github/workflows/tests.yml
vendored
@ -5,7 +5,10 @@ on:
|
|||||||
- cron: 0 0 * * * # Run every day at midnight
|
- cron: 0 0 * * * # Run every day at midnight
|
||||||
workflow_dispatch: {}
|
workflow_dispatch: {}
|
||||||
|
|
||||||
permissions: read-all
|
permissions:
|
||||||
|
contents: read
|
||||||
|
actions: read
|
||||||
|
checks: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
native-tests:
|
native-tests:
|
||||||
@ -44,7 +47,7 @@ jobs:
|
|||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 22
|
||||||
|
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
|
1
.trunk/configs/.prettierignore
Normal file
1
.trunk/configs/.prettierignore
Normal file
@ -0,0 +1 @@
|
|||||||
|
renovate.json
|
@ -1,6 +1,6 @@
|
|||||||
version: 0.1
|
version: 0.1
|
||||||
cli:
|
cli:
|
||||||
version: 1.22.12
|
version: 1.22.15
|
||||||
plugins:
|
plugins:
|
||||||
sources:
|
sources:
|
||||||
- id: trunk
|
- id: trunk
|
||||||
@ -8,18 +8,17 @@ plugins:
|
|||||||
uri: https://github.com/trunk-io/plugins
|
uri: https://github.com/trunk-io/plugins
|
||||||
lint:
|
lint:
|
||||||
enabled:
|
enabled:
|
||||||
- renovate@39.243.0
|
- renovate@40.0.6
|
||||||
- prettier@3.5.3
|
- prettier@3.5.3
|
||||||
- trufflehog@3.88.23
|
- trufflehog@3.88.29
|
||||||
- yamllint@1.37.0
|
- yamllint@1.37.1
|
||||||
- bandit@1.8.3
|
- bandit@1.8.3
|
||||||
- terrascan@1.19.9
|
- trivy@0.62.1
|
||||||
- trivy@0.61.0
|
|
||||||
- taplo@0.9.3
|
- taplo@0.9.3
|
||||||
- ruff@0.11.5
|
- ruff@0.11.9
|
||||||
- isort@6.0.1
|
- isort@6.0.1
|
||||||
- markdownlint@0.44.0
|
- markdownlint@0.44.0
|
||||||
- oxipng@9.1.4
|
- oxipng@9.1.5
|
||||||
- svgo@3.3.2
|
- svgo@3.3.2
|
||||||
- actionlint@1.7.7
|
- actionlint@1.7.7
|
||||||
- flake8@7.2.0
|
- flake8@7.2.0
|
||||||
@ -28,7 +27,7 @@ lint:
|
|||||||
- shellcheck@0.10.0
|
- shellcheck@0.10.0
|
||||||
- black@25.1.0
|
- black@25.1.0
|
||||||
- git-diff-check
|
- git-diff-check
|
||||||
- gitleaks@8.24.3
|
- gitleaks@8.26.0
|
||||||
- clang-format@16.0.3
|
- clang-format@16.0.3
|
||||||
ignore:
|
ignore:
|
||||||
- linters: [ALL]
|
- linters: [ALL]
|
||||||
|
14
Dockerfile
14
Dockerfile
@ -1,4 +1,3 @@
|
|||||||
# trunk-ignore-all(terrascan/AC_DOCKER_0002): Known terrascan issue
|
|
||||||
# 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(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/DL3008): Do not pin apt package versions
|
||||||
@ -38,6 +37,13 @@ RUN curl -L "https://github.com/meshtastic/web/releases/download/v$(cat /tmp/fir
|
|||||||
##### PRODUCTION BUILD #############
|
##### PRODUCTION BUILD #############
|
||||||
|
|
||||||
FROM debian:bookworm-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
|
||||||
|
|
||||||
@ -54,7 +60,7 @@ RUN apt-get update && apt-get --no-install-recommends -y install \
|
|||||||
&& 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/sbin/
|
COPY --from=builder /tmp/firmware/release/meshtasticd /usr/bin/
|
||||||
COPY --from=builder /tmp/web /usr/share/meshtasticd/
|
COPY --from=builder /tmp/web /usr/share/meshtasticd/
|
||||||
# Copy config templates
|
# Copy config templates
|
||||||
COPY ./bin/config.d /etc/meshtasticd/available.d
|
COPY ./bin/config.d /etc/meshtasticd/available.d
|
||||||
@ -65,8 +71,8 @@ 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 Meshtastic Web UI port from the host
|
||||||
EXPOSE 443
|
EXPOSE 9443
|
||||||
|
|
||||||
CMD [ "sh", "-cx", "meshtasticd -d /var/lib/meshtasticd" ]
|
CMD [ "sh", "-cx", "meshtasticd --fsdir=/var/lib/meshtasticd" ]
|
||||||
|
|
||||||
HEALTHCHECK NONE
|
HEALTHCHECK NONE
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
| Firmware Version | Supported |
|
| Firmware Version | Supported |
|
||||||
| ---------------- | ------------------ |
|
| ---------------- | ------------------ |
|
||||||
| 2.5.x | :white_check_mark: |
|
| 2.6.x | :white_check_mark: |
|
||||||
| <= 2.4.x | :x: |
|
| <= 2.5.x | :x: |
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
@ -28,12 +28,19 @@ RUN bash ./bin/build-native.sh "$PIO_ENV" && \
|
|||||||
# ##### PRODUCTION BUILD #############
|
# ##### PRODUCTION BUILD #############
|
||||||
|
|
||||||
FROM alpine:3.21
|
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 --no-cache add \
|
||||||
libstdc++ libgpiod yaml-cpp libusb i2c-tools libuv \
|
shadow libstdc++ libgpiod yaml-cpp libusb i2c-tools libuv \
|
||||||
libx11 libinput libxkbcommon \
|
libx11 libinput libxkbcommon \
|
||||||
&& rm -rf /var/cache/apk/* \
|
&& rm -rf /var/cache/apk/* \
|
||||||
&& mkdir -p /var/lib/meshtasticd \
|
&& mkdir -p /var/lib/meshtasticd \
|
||||||
@ -41,7 +48,7 @@ RUN apk --no-cache add \
|
|||||||
&& 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/sbin/
|
COPY --from=builder /tmp/firmware/release/meshtasticd /usr/bin/
|
||||||
# Copy config templates
|
# Copy config templates
|
||||||
COPY ./bin/config.d /etc/meshtasticd/available.d
|
COPY ./bin/config.d /etc/meshtasticd/available.d
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ lib_deps =
|
|||||||
# renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master
|
# 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
|
https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip
|
||||||
# renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto
|
# 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 =
|
||||||
segger_rtt
|
segger_rtt
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[esp32c6_base]
|
[esp32c6_base]
|
||||||
extends = esp32_base
|
extends = esp32_base
|
||||||
platform =
|
platform =
|
||||||
# renovate: datasource=git-refs depName=ESP32c6 platform-espressif32 packageName=https://github.com/Jason2866/platform-espressif32 gitBranch=Arduino/IDF5
|
# Do not renovate until we have switched to pioarduino tagged builds
|
||||||
https://github.com/Jason2866/platform-espressif32/archive/22faa566df8c789000f8136cd8d0aca49617af55.zip
|
https://github.com/Jason2866/platform-espressif32/archive/22faa566df8c789000f8136cd8d0aca49617af55.zip
|
||||||
build_flags =
|
build_flags =
|
||||||
${arduino_base.build_flags}
|
${arduino_base.build_flags}
|
||||||
@ -32,7 +32,7 @@ lib_deps =
|
|||||||
# renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master
|
# 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
|
https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip
|
||||||
# renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto
|
# renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto
|
||||||
rweather/Crypto@^0.4.0
|
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>
|
||||||
|
@ -28,7 +28,8 @@ build_src_filter =
|
|||||||
lib_deps=
|
lib_deps=
|
||||||
${arduino_base.lib_deps}
|
${arduino_base.lib_deps}
|
||||||
${radiolib_base.lib_deps}
|
${radiolib_base.lib_deps}
|
||||||
rweather/Crypto@^0.4.0
|
# renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto
|
||||||
|
rweather/Crypto@0.4.0
|
||||||
|
|
||||||
lib_ignore =
|
lib_ignore =
|
||||||
BluetoothOTA
|
BluetoothOTA
|
||||||
|
@ -25,7 +25,7 @@ lib_deps =
|
|||||||
${radiolib_base.lib_deps}
|
${radiolib_base.lib_deps}
|
||||||
${environmental_base.lib_deps}
|
${environmental_base.lib_deps}
|
||||||
# renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto
|
# renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto
|
||||||
rweather/Crypto@^0.4.0
|
rweather/Crypto@0.4.0
|
||||||
# renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX
|
# 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
|
# renovate: datasource=git-refs depName=libch341-spi-userspace packageName=https://github.com/pine64/libch341-spi-userspace gitBranch=main
|
||||||
|
4
bin/99-meshtasticd-udev.rules
Normal file
4
bin/99-meshtasticd-udev.rules
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# 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"
|
@ -188,11 +188,17 @@ Logging:
|
|||||||
# AsciiLogs: true # default if not specified is !isatty() on stdout
|
# AsciiLogs: true # default if not specified is !isatty() on stdout
|
||||||
|
|
||||||
Webserver:
|
Webserver:
|
||||||
# Port: 443 # Port for Webserver & Webservices
|
# Port: 9443 # 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.
|
||||||
|
|
||||||
|
|
||||||
General:
|
General:
|
||||||
MaxNodes: 200
|
MaxNodes: 200
|
||||||
MaxMessageQueue: 100
|
MaxMessageQueue: 100
|
||||||
|
@ -43,6 +43,16 @@ S3_VARIANTS=(
|
|||||||
"wireless-tracker"
|
"wireless-tracker"
|
||||||
"station-g2"
|
"station-g2"
|
||||||
"unphone"
|
"unphone"
|
||||||
|
"t-eth-elite"
|
||||||
|
"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
|
||||||
|
@ -5,10 +5,11 @@ StartLimitInterval=200
|
|||||||
StartLimitBurst=5
|
StartLimitBurst=5
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
User=root
|
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
||||||
Group=root
|
User=meshtasticd
|
||||||
|
Group=meshtasticd
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=/usr/sbin/meshtasticd
|
ExecStart=/usr/bin/meshtasticd
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=3
|
RestartSec=3
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
cp "release/meshtasticd_linux_$(uname -m)" /usr/sbin/meshtasticd
|
cp "release/meshtasticd_linux_$(uname -m)" /usr/bin/meshtasticd
|
||||||
mkdir -p /etc/meshtasticd
|
mkdir -p /etc/meshtasticd
|
||||||
if [[ -f "/etc/meshtasticd/config.yaml" ]]; then
|
if [[ -f "/etc/meshtasticd/config.yaml" ]]; then
|
||||||
cp bin/config-dist.yaml /etc/meshtasticd/config-upgrade.yaml
|
cp bin/config-dist.yaml /etc/meshtasticd/config-upgrade.yaml
|
||||||
|
@ -87,6 +87,12 @@
|
|||||||
</screenshots>
|
</screenshots>
|
||||||
|
|
||||||
<releases>
|
<releases>
|
||||||
|
<release version="2.6.9" date="2025-05-15">
|
||||||
|
<url type="details">https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.9</url>
|
||||||
|
</release>
|
||||||
|
<release version="2.6.8" date="2025-05-05">
|
||||||
|
<url type="details">https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.8</url>
|
||||||
|
</release>
|
||||||
<release version="2.6.7" date="2025-04-28">
|
<release version="2.6.7" date="2025-04-28">
|
||||||
<url type="details">https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.7</url>
|
<url type="details">https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.7</url>
|
||||||
</release>
|
</release>
|
||||||
|
@ -8,8 +8,8 @@
|
|||||||
"core": "esp32",
|
"core": "esp32",
|
||||||
"extra_flags": [
|
"extra_flags": [
|
||||||
"-DBOARD_HAS_PSRAM",
|
"-DBOARD_HAS_PSRAM",
|
||||||
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
"-DARDUINO_USB_CDC_ON_BOOT=0",
|
||||||
"-DARDUINO_USB_MODE=0",
|
"-DARDUINO_USB_MODE=1",
|
||||||
"-DARDUINO_RUNNING_CORE=1",
|
"-DARDUINO_RUNNING_CORE=1",
|
||||||
"-DARDUINO_EVENT_RUNNING_CORE=0"
|
"-DARDUINO_EVENT_RUNNING_CORE=0"
|
||||||
],
|
],
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
"hwids": [["0x2886", "0x0059"]],
|
"hwids": [["0x2886", "0x0059"]],
|
||||||
"usb_product": "XIAO-BOOT",
|
"usb_product": "XIAO-BOOT",
|
||||||
"mcu": "nrf52840",
|
"mcu": "nrf52840",
|
||||||
"variant": "Seeed_Solar_Node",
|
"variant": "seeed_solar_node",
|
||||||
"bsp": {
|
"bsp": {
|
||||||
"name": "adafruit"
|
"name": "adafruit"
|
||||||
},
|
},
|
||||||
@ -31,7 +31,7 @@
|
|||||||
"openocd_target": "nrf52840-mdk-rs"
|
"openocd_target": "nrf52840-mdk-rs"
|
||||||
},
|
},
|
||||||
"frameworks": ["arduino"],
|
"frameworks": ["arduino"],
|
||||||
"name": "Seeed_Solar_Node",
|
"name": "seeed_solar_node",
|
||||||
"upload": {
|
"upload": {
|
||||||
"maximum_ram_size": 248832,
|
"maximum_ram_size": 248832,
|
||||||
"maximum_size": 815104,
|
"maximum_size": 815104,
|
11
debian/changelog
vendored
11
debian/changelog
vendored
@ -1,9 +1,16 @@
|
|||||||
meshtasticd (2.5.22.0) UNRELEASED; urgency=medium
|
meshtasticd (2.6.9.0) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
|
[ Austin Lane ]
|
||||||
* Initial packaging
|
* Initial packaging
|
||||||
* GitHub Actions Automatic version bump
|
* GitHub Actions Automatic version bump
|
||||||
* GitHub Actions Automatic version bump
|
* GitHub Actions Automatic version bump
|
||||||
* GitHub Actions Automatic version bump
|
* GitHub Actions Automatic version bump
|
||||||
* GitHub Actions Automatic version bump
|
* GitHub Actions Automatic version bump
|
||||||
|
|
||||||
-- Austin Lane <github-actions[bot]@users.noreply.github.com> Wed, 05 Feb 2025 01:10:33 +0000
|
[ ]
|
||||||
|
* GitHub Actions Automatic version bump
|
||||||
|
|
||||||
|
[ ]
|
||||||
|
* GitHub Actions Automatic version bump
|
||||||
|
|
||||||
|
-- <github-actions[bot]@users.noreply.github.com> Thu, 15 May 2025 11:13:30 +0000
|
||||||
|
4
debian/control
vendored
4
debian/control
vendored
@ -31,7 +31,9 @@ Rules-Requires-Root: no
|
|||||||
|
|
||||||
Package: meshtasticd
|
Package: meshtasticd
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
Depends: adduser,
|
||||||
|
${misc:Depends},
|
||||||
|
${shlibs:Depends}
|
||||||
Description: Meshtastic daemon for communicating with Meshtastic devices
|
Description: Meshtastic daemon for communicating with Meshtastic devices
|
||||||
Meshtastic is an off-grid text communication platform that uses inexpensive
|
Meshtastic is an off-grid text communication platform that uses inexpensive
|
||||||
LoRa radios.
|
LoRa radios.
|
1
debian/meshtasticd.dirs
vendored
1
debian/meshtasticd.dirs
vendored
@ -1,3 +1,4 @@
|
|||||||
|
var/lib/meshtasticd
|
||||||
etc/meshtasticd
|
etc/meshtasticd
|
||||||
etc/meshtasticd/config.d
|
etc/meshtasticd/config.d
|
||||||
etc/meshtasticd/available.d
|
etc/meshtasticd/available.d
|
||||||
|
2
debian/meshtasticd.install
vendored
2
debian/meshtasticd.install
vendored
@ -1,4 +1,4 @@
|
|||||||
.pio/build/native-tft/meshtasticd usr/sbin
|
.pio/build/native-tft/meshtasticd usr/bin
|
||||||
|
|
||||||
bin/config.yaml etc/meshtasticd
|
bin/config.yaml etc/meshtasticd
|
||||||
bin/config.d/* etc/meshtasticd/available.d
|
bin/config.d/* etc/meshtasticd/available.d
|
||||||
|
79
debian/meshtasticd.postinst
vendored
Executable file
79
debian/meshtasticd.postinst
vendored
Executable file
@ -0,0 +1,79 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# postinst script for meshtasticd
|
||||||
|
#
|
||||||
|
# see: dh_installdeb(1)
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# summary of how this script can be called:
|
||||||
|
# * <postinst> `configure' <most-recently-configured-version>
|
||||||
|
# * <old-postinst> `abort-upgrade' <new version>
|
||||||
|
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
|
||||||
|
# <new-version>
|
||||||
|
# * <postinst> `abort-remove'
|
||||||
|
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
|
||||||
|
# <failed-install-package> <version> `removing'
|
||||||
|
# <conflicting-package> <version>
|
||||||
|
# for details, see http://www.debian.org/doc/debian-policy/ or
|
||||||
|
# the debian-policy package
|
||||||
|
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
configure|reconfigure)
|
||||||
|
# create spi group (for udev rules)
|
||||||
|
# this group already exists on Raspberry Pi OS
|
||||||
|
getent group spi >/dev/null 2>/dev/null || addgroup --system spi
|
||||||
|
# create a meshtasticd group and user
|
||||||
|
getent passwd meshtasticd >/dev/null 2>/dev/null || adduser --system --home /var/lib/meshtasticd --no-create-home meshtasticd
|
||||||
|
getent group meshtasticd >/dev/null 2>/dev/null || addgroup --system meshtasticd
|
||||||
|
adduser meshtasticd meshtasticd >/dev/null 2>/dev/null
|
||||||
|
adduser meshtasticd spi >/dev/null 2>/dev/null
|
||||||
|
# add meshtasticd user to appropriate groups (if they exist)
|
||||||
|
getent group gpio >/dev/null 2>/dev/null && adduser meshtasticd gpio >/dev/null 2>/dev/null
|
||||||
|
getent group plugdev >/dev/null 2>/dev/null && adduser meshtasticd plugdev >/dev/null 2>/dev/null
|
||||||
|
getent group dialout >/dev/null 2>/dev/null && adduser meshtasticd dialout >/dev/null 2>/dev/null
|
||||||
|
getent group i2c >/dev/null 2>/dev/null && adduser meshtasticd i2c >/dev/null 2>/dev/null
|
||||||
|
getent group video >/dev/null 2>/dev/null && adduser meshtasticd video >/dev/null 2>/dev/null
|
||||||
|
getent group audio >/dev/null 2>/dev/null && adduser meshtasticd audio >/dev/null 2>/dev/null
|
||||||
|
getent group input >/dev/null 2>/dev/null && adduser meshtasticd input >/dev/null 2>/dev/null
|
||||||
|
|
||||||
|
|
||||||
|
# migrate /root/.portduino to /var/lib/meshtasticd/.portduino
|
||||||
|
# should only run once, upon upgrade from < 2.6.9
|
||||||
|
if [ -n "$2" ] && dpkg --compare-versions "$2" lt 2.6.9; then
|
||||||
|
if [ -d /root/.portduino ] && [ ! -e /var/lib/meshtasticd/.portduino ]; then
|
||||||
|
cp -r /root/.portduino /var/lib/meshtasticd/.portduino
|
||||||
|
echo "Migrated meshtasticd VFS from /root/.portduino to /var/lib/meshtasticd/.portduino"
|
||||||
|
echo "meshtasticd now runs as the 'meshtasticd' user, not 'root'."
|
||||||
|
echo "See https://github.com/meshtastic/firmware/pull/6718 for details"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d /var/lib/meshtasticd ]; then
|
||||||
|
chown -R meshtasticd:meshtasticd /var/lib/meshtasticd
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d /etc/meshtasticd ]; then
|
||||||
|
chown -R meshtasticd:meshtasticd /etc/meshtasticd
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d /usr/share/meshtasticd ]; then
|
||||||
|
chown -R meshtasticd:meshtasticd /usr/share/meshtasticd
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
abort-upgrade|abort-remove|abort-deconfigure)
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo "postinst called with unknown argument \`$1'" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# dh_installdeb will replace this with shell code automatically
|
||||||
|
# generated by other debhelper scripts.
|
||||||
|
|
||||||
|
#DEBHELPER#
|
||||||
|
|
||||||
|
exit 0
|
41
debian/meshtasticd.postrm
vendored
Executable file
41
debian/meshtasticd.postrm
vendored
Executable file
@ -0,0 +1,41 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# postrm script for meshtasticd
|
||||||
|
#
|
||||||
|
# see: dh_installdeb(1)
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# summary of how this script can be called:
|
||||||
|
# * <postrm> `remove'
|
||||||
|
# * <postrm> `purge'
|
||||||
|
# * <old-postrm> `upgrade' <new-version>
|
||||||
|
# * <new-postrm> `failed-upgrade' <old-version>
|
||||||
|
# * <new-postrm> `abort-install'
|
||||||
|
# * <new-postrm> `abort-install' <old-version>
|
||||||
|
# * <new-postrm> `abort-upgrade' <old-version>
|
||||||
|
# * <disappearer's-postrm> `disappear' <overwriter>
|
||||||
|
# <overwriter-version>
|
||||||
|
# for details, see http://www.debian.org/doc/debian-policy/ or
|
||||||
|
# the debian-policy package
|
||||||
|
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
|
||||||
|
# Only remove /var/lib/meshtasticd on purge
|
||||||
|
if [ "${1}" = "purge" ] ; then
|
||||||
|
rm -rf /var/lib/meshtasticd
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo "postrm called with unknown argument \`$1'" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# dh_installdeb will replace this with shell code automatically
|
||||||
|
# generated by other debhelper scripts.
|
||||||
|
|
||||||
|
#DEBHELPER#
|
||||||
|
|
||||||
|
exit 0
|
4
debian/meshtasticd.udev
vendored
Normal file
4
debian/meshtasticd.udev
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# 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"
|
@ -10,6 +10,8 @@
|
|||||||
# - https://docs.pagure.org/rpkg-util/v3/index.html
|
# - https://docs.pagure.org/rpkg-util/v3/index.html
|
||||||
# - https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/
|
# - https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/
|
||||||
|
|
||||||
|
%global meshtasticd_user meshtasticd
|
||||||
|
|
||||||
Name: meshtasticd
|
Name: meshtasticd
|
||||||
# Version Ex: 2.5.19
|
# Version Ex: 2.5.19
|
||||||
Version: {{{ meshtastic_version }}}
|
Version: {{{ meshtastic_version }}}
|
||||||
@ -47,6 +49,8 @@ BuildRequires: pkgconfig(x11)
|
|||||||
BuildRequires: pkgconfig(libinput)
|
BuildRequires: pkgconfig(libinput)
|
||||||
BuildRequires: pkgconfig(xkbcommon-x11)
|
BuildRequires: pkgconfig(xkbcommon-x11)
|
||||||
|
|
||||||
|
Requires: systemd-udev
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Meshtastic daemon for controlling Meshtastic devices. Meshtastic is an off-grid
|
Meshtastic daemon for controlling Meshtastic devices. Meshtastic is an off-grid
|
||||||
text communication platform that uses inexpensive LoRa radios.
|
text communication platform that uses inexpensive LoRa radios.
|
||||||
@ -63,15 +67,25 @@ gzip -dr web
|
|||||||
platformio run -e native-tft
|
platformio run -e native-tft
|
||||||
|
|
||||||
%install
|
%install
|
||||||
mkdir -p %{buildroot}%{_sbindir}
|
# Install meshtasticd binary
|
||||||
install -m 0755 .pio/build/native-tft/program %{buildroot}%{_sbindir}/meshtasticd
|
mkdir -p %{buildroot}%{_bindir}
|
||||||
|
install -m 0755 .pio/build/native-tft/program %{buildroot}%{_bindir}/meshtasticd
|
||||||
|
|
||||||
|
# Install portduino VFS dir
|
||||||
|
install -p -d -m 0770 %{buildroot}%{_localstatedir}/lib/meshtasticd
|
||||||
|
|
||||||
|
# Install udev rules
|
||||||
|
mkdir -p %{buildroot}%{_udevrulesdir}
|
||||||
|
install -m 0644 bin/99-meshtasticd-udev.rules %{buildroot}%{_udevrulesdir}/99-meshtasticd-udev.rules
|
||||||
|
|
||||||
|
# Install config dirs
|
||||||
mkdir -p %{buildroot}%{_sysconfdir}/meshtasticd
|
mkdir -p %{buildroot}%{_sysconfdir}/meshtasticd
|
||||||
install -m 0644 bin/config-dist.yaml %{buildroot}%{_sysconfdir}/meshtasticd/config.yaml
|
install -m 0644 bin/config-dist.yaml %{buildroot}%{_sysconfdir}/meshtasticd/config.yaml
|
||||||
mkdir -p %{buildroot}%{_sysconfdir}/meshtasticd/config.d
|
mkdir -p %{buildroot}%{_sysconfdir}/meshtasticd/config.d
|
||||||
mkdir -p %{buildroot}%{_sysconfdir}/meshtasticd/available.d
|
mkdir -p %{buildroot}%{_sysconfdir}/meshtasticd/available.d
|
||||||
cp -r bin/config.d/* %{buildroot}%{_sysconfdir}/meshtasticd/available.d
|
cp -r bin/config.d/* %{buildroot}%{_sysconfdir}/meshtasticd/available.d
|
||||||
|
|
||||||
|
# Install systemd service
|
||||||
install -D -m 0644 bin/meshtasticd.service %{buildroot}%{_unitdir}/meshtasticd.service
|
install -D -m 0644 bin/meshtasticd.service %{buildroot}%{_unitdir}/meshtasticd.service
|
||||||
|
|
||||||
# Install the web files under /usr/share/meshtasticd/web
|
# Install the web files under /usr/share/meshtasticd/web
|
||||||
@ -80,10 +94,54 @@ cp -r web/* %{buildroot}%{_datadir}/meshtasticd/web
|
|||||||
# Install default SSL storage directory (for web)
|
# Install default SSL storage directory (for web)
|
||||||
mkdir -p %{buildroot}%{_sysconfdir}/meshtasticd/ssl
|
mkdir -p %{buildroot}%{_sysconfdir}/meshtasticd/ssl
|
||||||
|
|
||||||
|
%pre
|
||||||
|
# create spi group (for udev rules)
|
||||||
|
getent group spi > /dev/null || groupadd -r spi
|
||||||
|
# create a meshtasticd group and user
|
||||||
|
getent group %{meshtasticd_user} > /dev/null || groupadd -r %{meshtasticd_user}
|
||||||
|
getent passwd %{meshtasticd_user} > /dev/null || \
|
||||||
|
useradd -r -d %{_localstatedir}/lib/meshtasticd -g %{meshtasticd_user} -G spi \
|
||||||
|
-s /sbin/nologin -c "Meshtastic Daemon" %{meshtasticd_user}
|
||||||
|
# add meshtasticd user to appropriate groups (if they exist)
|
||||||
|
getent group gpio > /dev/null && usermod -a -G gpio %{meshtasticd_user} > /dev/null
|
||||||
|
getent group plugdev > /dev/null && usermod -a -G plugdev %{meshtasticd_user} > /dev/null
|
||||||
|
getent group dialout > /dev/null && usermod -a -G dialout %{meshtasticd_user} > /dev/null
|
||||||
|
getent group i2c > /dev/null && usermod -a -G i2c %{meshtasticd_user} > /dev/null
|
||||||
|
getent group video > /dev/null && usermod -a -G video %{meshtasticd_user} > /dev/null
|
||||||
|
getent group audio > /dev/null && usermod -a -G audio %{meshtasticd_user} > /dev/null
|
||||||
|
getent group input > /dev/null && usermod -a -G input %{meshtasticd_user} > /dev/null
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
%triggerin -- meshtasticd < 2.6.9
|
||||||
|
# migrate .portduino (if it exists and hasn’t already been copied)
|
||||||
|
if [ -d /root/.portduino ] && [ ! -e /var/lib/meshtasticd/.portduino ]; then
|
||||||
|
mkdir -p /var/lib/meshtasticd
|
||||||
|
cp -r /root/.portduino /var/lib/meshtasticd/.portduino
|
||||||
|
chown -R %{meshtasticd_user}:%{meshtasticd_user} \
|
||||||
|
%{_localstatedir}/lib/meshtasticd || :
|
||||||
|
# Fix SELinux labels if present (no-op on non-SELinux systems)
|
||||||
|
restorecon -R /var/lib/meshtasticd/.portduino 2>/dev/null || :
|
||||||
|
echo "Migrated meshtasticd VFS from /root/.portduino to /var/lib/meshtasticd/.portduino"
|
||||||
|
echo "meshtasticd now runs as the 'meshtasticd' user, not 'root'."
|
||||||
|
echo "See https://github.com/meshtastic/firmware/pull/6718 for details"
|
||||||
|
fi
|
||||||
|
|
||||||
|
%post
|
||||||
|
%systemd_post meshtasticd.service
|
||||||
|
|
||||||
|
%preun
|
||||||
|
%systemd_preun meshtasticd.service
|
||||||
|
|
||||||
|
%postun
|
||||||
|
%systemd_postun_with_restart meshtasticd.service
|
||||||
|
|
||||||
%files
|
%files
|
||||||
|
%defattr(-,%{meshtasticd_user},%{meshtasticd_user})
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc README.md
|
%doc README.md
|
||||||
%{_sbindir}/meshtasticd
|
%{_bindir}/meshtasticd
|
||||||
|
%dir %{_localstatedir}/lib/meshtasticd
|
||||||
|
%{_udevrulesdir}/99-meshtasticd-udev.rules
|
||||||
%dir %{_sysconfdir}/meshtasticd
|
%dir %{_sysconfdir}/meshtasticd
|
||||||
%dir %{_sysconfdir}/meshtasticd/config.d
|
%dir %{_sysconfdir}/meshtasticd/config.d
|
||||||
%dir %{_sysconfdir}/meshtasticd/available.d
|
%dir %{_sysconfdir}/meshtasticd/available.d
|
||||||
|
@ -107,8 +107,8 @@ lib_deps =
|
|||||||
|
|
||||||
[device-ui_base]
|
[device-ui_base]
|
||||||
lib_deps =
|
lib_deps =
|
||||||
# renovate: datasource=git-refs depName=meshtastic-device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master
|
# renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master
|
||||||
https://github.com/meshtastic/device-ui/archive/33aa6890f7862d81c2bc1658f43eeea7a8081c6e.zip
|
https://github.com/meshtastic/device-ui/archive/7dee10ad31a0c6ea04880cba399e240be743d752.zip
|
||||||
|
|
||||||
; Common libs for environmental measurements in telemetry module
|
; Common libs for environmental measurements in telemetry module
|
||||||
[environmental_base]
|
[environmental_base]
|
||||||
@ -122,7 +122,7 @@ lib_deps =
|
|||||||
# renovate: datasource=custom.pio depName=Adafruit BMP085 packageName=adafruit/library/Adafruit BMP085 Library
|
# renovate: datasource=custom.pio depName=Adafruit BMP085 packageName=adafruit/library/Adafruit BMP085 Library
|
||||||
adafruit/Adafruit BMP085 Library@1.2.4
|
adafruit/Adafruit BMP085 Library@1.2.4
|
||||||
# renovate: datasource=custom.pio depName=Adafruit BME280 packageName=adafruit/library/Adafruit BME280 Library
|
# renovate: datasource=custom.pio depName=Adafruit BME280 packageName=adafruit/library/Adafruit BME280 Library
|
||||||
adafruit/Adafruit BME280 Library@2.2.4
|
adafruit/Adafruit BME280 Library@2.3.0
|
||||||
# renovate: datasource=custom.pio depName=Adafruit DPS310 packageName=adafruit/library/Adafruit DPS310
|
# renovate: datasource=custom.pio depName=Adafruit DPS310 packageName=adafruit/library/Adafruit DPS310
|
||||||
adafruit/Adafruit DPS310@1.1.5
|
adafruit/Adafruit DPS310@1.1.5
|
||||||
# renovate: datasource=custom.pio depName=Adafruit MCP9808 packageName=adafruit/library/Adafruit MCP9808 Library
|
# renovate: datasource=custom.pio depName=Adafruit MCP9808 packageName=adafruit/library/Adafruit MCP9808 Library
|
||||||
@ -148,7 +148,7 @@ lib_deps =
|
|||||||
# renovate: datasource=custom.pio depName=Adafruit MLX90614 packageName=adafruit/library/Adafruit MLX90614 Library
|
# renovate: datasource=custom.pio depName=Adafruit MLX90614 packageName=adafruit/library/Adafruit MLX90614 Library
|
||||||
adafruit/Adafruit MLX90614 Library@2.1.5
|
adafruit/Adafruit MLX90614 Library@2.1.5
|
||||||
# renovate: datasource=custom.pio depName=Bosch BME68x packageName=boschsensortec/library/BME68x Sensor Library
|
# renovate: datasource=custom.pio depName=Bosch BME68x packageName=boschsensortec/library/BME68x Sensor Library
|
||||||
boschsensortec/BME68x Sensor Library@1.1.40407
|
boschsensortec/BME68x Sensor Library@1.2.40408
|
||||||
# renovate: datasource=github-tags depName=INA3221 packageName=KodinLanewave/INA3221
|
# renovate: datasource=github-tags depName=INA3221 packageName=KodinLanewave/INA3221
|
||||||
https://github.com/KodinLanewave/INA3221/archive/1.0.1.zip
|
https://github.com/KodinLanewave/INA3221/archive/1.0.1.zip
|
||||||
# renovate: datasource=custom.pio depName=QMC5883L Compass packageName=mprograms/library/QMC5883LCompass
|
# renovate: datasource=custom.pio depName=QMC5883L Compass packageName=mprograms/library/QMC5883LCompass
|
||||||
@ -161,6 +161,8 @@ lib_deps =
|
|||||||
robtillaart/INA226@0.6.4
|
robtillaart/INA226@0.6.4
|
||||||
# renovate: datasource=custom.pio depName=SparkFun MAX3010x packageName=sparkfun/library/SparkFun MAX3010x Pulse and Proximity Sensor Library
|
# renovate: datasource=custom.pio depName=SparkFun MAX3010x packageName=sparkfun/library/SparkFun MAX3010x Pulse and Proximity Sensor Library
|
||||||
sparkfun/SparkFun MAX3010x Pulse and Proximity Sensor Library@1.1.2
|
sparkfun/SparkFun MAX3010x Pulse and Proximity Sensor Library@1.1.2
|
||||||
|
# renovate: datasource=custom.pio depName=SparkFun 9DoF IMU Breakout ICM 20948 packageName=sparkfun/library/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library
|
||||||
|
sparkfun/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library@1.3.2
|
||||||
|
|
||||||
; (not included in native / portduino)
|
; (not included in native / portduino)
|
||||||
[environmental_extra]
|
[environmental_extra]
|
||||||
@ -181,11 +183,9 @@ lib_deps =
|
|||||||
adafruit/Adafruit SHT4x Library@1.0.5
|
adafruit/Adafruit SHT4x Library@1.0.5
|
||||||
# renovate: datasource=custom.pio depName=SparkFun Qwiic Scale NAU7802 packageName=sparkfun/library/SparkFun Qwiic Scale NAU7802 Arduino Library
|
# renovate: datasource=custom.pio depName=SparkFun Qwiic Scale NAU7802 packageName=sparkfun/library/SparkFun Qwiic Scale NAU7802 Arduino Library
|
||||||
sparkfun/SparkFun Qwiic Scale NAU7802 Arduino Library@1.0.6
|
sparkfun/SparkFun Qwiic Scale NAU7802 Arduino Library@1.0.6
|
||||||
# renovate: datasource=custom.pio depName=SparkFun 9DoF IMU Breakout ICM 20948 packageName=sparkfun/library/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library
|
|
||||||
sparkfun/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library@1.3.0
|
|
||||||
# renovate: datasource=custom.pio depName=ClosedCube OPT3001 packageName=closedcube/library/ClosedCube OPT3001
|
# renovate: datasource=custom.pio depName=ClosedCube OPT3001 packageName=closedcube/library/ClosedCube OPT3001
|
||||||
ClosedCube OPT3001@1.1.2
|
ClosedCube OPT3001@1.1.2
|
||||||
# renovate: datasource=github-tags depName=Bosch BSEC2 packageName=boschsensortec/Bosch-BSEC2-Library
|
# renovate: datasource=git-refs depName=Bosch BSEC2 packageName=https://github.com/meshtastic/Bosch-BSEC2-Library gitBranch=extra_script
|
||||||
https://github.com/boschsensortec/Bosch-BSEC2-Library/archive/v1.7.2502.zip
|
https://github.com/meshtastic/Bosch-BSEC2-Library/archive/e16952dfe5addd4287e1eb8c4f6ecac0fa3dd3de.zip
|
||||||
# renovate: datasource=git-refs depName=meshtastic-DFRobot_LarkWeatherStation packageName=https://github.com/meshtastic/DFRobot_LarkWeatherStation gitBranch=master
|
# renovate: datasource=git-refs depName=meshtastic-DFRobot_LarkWeatherStation packageName=https://github.com/meshtastic/DFRobot_LarkWeatherStation gitBranch=master
|
||||||
https://github.com/meshtastic/DFRobot_LarkWeatherStation/archive/4de3a9cadef0f6a5220a8a906cf9775b02b0040d.zip
|
https://github.com/meshtastic/DFRobot_LarkWeatherStation/archive/4de3a9cadef0f6a5220a8a906cf9775b02b0040d.zip
|
@ -1 +1 @@
|
|||||||
Subproject commit 27fac39141d99fe727a0a1824c5397409b1aea75
|
Subproject commit 4eb0aebaef1304a5516b6fa864cb4c55daed9147
|
@ -9,15 +9,21 @@
|
|||||||
"workarounds:all"
|
"workarounds:all"
|
||||||
],
|
],
|
||||||
"forkProcessing": "enabled",
|
"forkProcessing": "enabled",
|
||||||
"ignoreDeps": ["protobufs"],
|
"ignoreDeps": [
|
||||||
|
"protobufs"
|
||||||
|
],
|
||||||
"git-submodules": {
|
"git-submodules": {
|
||||||
"enabled": true
|
"enabled": true
|
||||||
},
|
},
|
||||||
"pip_requirements": {
|
"pip_requirements": {
|
||||||
"fileMatch": ["bin/bump_metainfo/requirements.txt"]
|
"managerFilePatterns": [
|
||||||
|
"/bin/bump_metainfo/requirements.txt/"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"commitMessageTopic": "{{depName}}",
|
"commitMessageTopic": "{{depName}}",
|
||||||
"labels": ["dependencies"],
|
"labels": [
|
||||||
|
"dependencies"
|
||||||
|
],
|
||||||
"customDatasources": {
|
"customDatasources": {
|
||||||
"pio": {
|
"pio": {
|
||||||
"description": "PlatformIO Registry",
|
"description": "PlatformIO Registry",
|
||||||
@ -32,8 +38,12 @@
|
|||||||
{
|
{
|
||||||
"customType": "regex",
|
"customType": "regex",
|
||||||
"description": "Match meshtastic/web version",
|
"description": "Match meshtastic/web version",
|
||||||
"fileMatch": ["bin/web.version"],
|
"managerFilePatterns": [
|
||||||
"matchStrings": ["(?<currentValue>.+)$"],
|
"/bin/web.version/"
|
||||||
|
],
|
||||||
|
"matchStrings": [
|
||||||
|
"(?<currentValue>.+)$"
|
||||||
|
],
|
||||||
"datasourceTemplate": "github-releases",
|
"datasourceTemplate": "github-releases",
|
||||||
"depNameTemplate": "meshtastic/web",
|
"depNameTemplate": "meshtastic/web",
|
||||||
"versioningTemplate": "semver-coerced"
|
"versioningTemplate": "semver-coerced"
|
||||||
@ -41,7 +51,9 @@
|
|||||||
{
|
{
|
||||||
"customType": "regex",
|
"customType": "regex",
|
||||||
"description": "Match normal PIO dependencies",
|
"description": "Match normal PIO dependencies",
|
||||||
"fileMatch": [".*\\.ini$"],
|
"managerFilePatterns": [
|
||||||
|
"/.*\\.ini$/"
|
||||||
|
],
|
||||||
"matchStrings": [
|
"matchStrings": [
|
||||||
"# renovate: datasource=(?<datasource>.*?)(?: depName=(?<depName>.+?))? packageName=(?<packageName>.+?)(?: versioning=(?<versioning>[a-z-]+?))?\\s+?.+?@(?<currentValue>.+?)\\s"
|
"# renovate: datasource=(?<datasource>.*?)(?: depName=(?<depName>.+?))? packageName=(?<packageName>.+?)(?: versioning=(?<versioning>[a-z-]+?))?\\s+?.+?@(?<currentValue>.+?)\\s"
|
||||||
],
|
],
|
||||||
@ -50,9 +62,11 @@
|
|||||||
{
|
{
|
||||||
"customType": "regex",
|
"customType": "regex",
|
||||||
"description": "Match PIO zipped dependencies with github tag ref",
|
"description": "Match PIO zipped dependencies with github tag ref",
|
||||||
"fileMatch": [".*\\.ini$"],
|
"managerFilePatterns": [
|
||||||
|
"/.*\\.ini$/"
|
||||||
|
],
|
||||||
"matchStrings": [
|
"matchStrings": [
|
||||||
"# renovate: datasource=github-tags(?: depName=(?<depName>.+?))? packageName=(?<packageName>.+?)(?: versioning=(?<versioning>[a-z-]+?))?\\s+?https:\/\/.+?archive\/(?<currentValue>.+?).zip\\s"
|
"# renovate: datasource=github-tags(?: depName=(?<depName>.+?))? packageName=(?<packageName>.+?)(?: versioning=(?<versioning>[a-z-]+?))?\\s+?https://.+?archive/(?<currentValue>.+?).zip\\s"
|
||||||
],
|
],
|
||||||
"datasourceTemplate": "github-tags",
|
"datasourceTemplate": "github-tags",
|
||||||
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver-coerced{{/if}}"
|
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver-coerced{{/if}}"
|
||||||
@ -60,14 +74,26 @@
|
|||||||
{
|
{
|
||||||
"customType": "regex",
|
"customType": "regex",
|
||||||
"description": "Match PIO zipped dependencies with git commit ref",
|
"description": "Match PIO zipped dependencies with git commit ref",
|
||||||
"fileMatch": [".*\\.ini$"],
|
"managerFilePatterns": [
|
||||||
|
"/.*\\.ini$/"
|
||||||
|
],
|
||||||
"matchStrings": [
|
"matchStrings": [
|
||||||
"# renovate: datasource=git-refs(?: depName=(?<depName>.+?))? packageName=(?<packageName>.+?)(?: versioning=(?<versioning>[a-z-]+?))?\\sgitBranch=(?<gitBranch>.+?)\\s+?https:\/\/.+?archive\/(?<currentDigest>.+?).zip\\s"
|
"# renovate: datasource=git-refs(?: depName=(?<depName>.+?))? packageName=(?<packageName>.+?)(?: versioning=(?<versioning>[a-z-]+?))?\\sgitBranch=(?<gitBranch>.+?)\\s+?https://.+?archive/(?<currentDigest>.+?).zip\\s"
|
||||||
],
|
],
|
||||||
"datasourceTemplate": "git-refs",
|
"datasourceTemplate": "git-refs",
|
||||||
"currentValueTemplate": "{{{gitBranch}}}",
|
"currentValueTemplate": "{{{gitBranch}}}",
|
||||||
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}git{{/if}}"
|
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}git{{/if}}"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"packageRules": []
|
"packageRules": [
|
||||||
|
{
|
||||||
|
"matchDepNames": [
|
||||||
|
"meshtastic/device-ui"
|
||||||
|
],
|
||||||
|
"reviewers": [
|
||||||
|
"mverch67"
|
||||||
|
],
|
||||||
|
"changelogUrl": "https://github.com/meshtastic/device-ui/compare/{{currentDigest}}...{{newDigest}}"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
@ -268,7 +268,7 @@ int32_t ButtonThread::runOnce()
|
|||||||
digitalWrite(PIN_EINK_EN, digitalRead(PIN_EINK_EN) == LOW);
|
digitalWrite(PIN_EINK_EN, digitalRead(PIN_EINK_EN) == LOW);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if defined(RAK_4631)
|
#if !MESHTASTIC_EXCLUDE_SCREEN && HAS_SCREEN
|
||||||
// 5 clicks: start accelerometer/magenetometer calibration for 30 seconds
|
// 5 clicks: start accelerometer/magenetometer calibration for 30 seconds
|
||||||
case 5:
|
case 5:
|
||||||
if (accelerometerThread) {
|
if (accelerometerThread) {
|
||||||
@ -316,14 +316,23 @@ int32_t ButtonThread::runOnce()
|
|||||||
#ifdef BUTTON_PIN_TOUCH
|
#ifdef BUTTON_PIN_TOUCH
|
||||||
case BUTTON_EVENT_TOUCH_LONG_PRESSED: {
|
case BUTTON_EVENT_TOUCH_LONG_PRESSED: {
|
||||||
LOG_BUTTON("Touch press!");
|
LOG_BUTTON("Touch press!");
|
||||||
if (screen) {
|
// Ignore if: no screen
|
||||||
|
if (!screen)
|
||||||
|
break;
|
||||||
|
|
||||||
|
#ifdef TTGO_T_ECHO
|
||||||
|
// Ignore if: TX in progress
|
||||||
|
// Uncommon T-Echo hardware bug, LoRa TX triggers touch button
|
||||||
|
if (!RadioLibInterface::instance || RadioLibInterface::instance->isSending())
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Wake if asleep
|
// Wake if asleep
|
||||||
if (powerFSM.getState() == &stateDARK)
|
if (powerFSM.getState() == &stateDARK)
|
||||||
powerFSM.trigger(EVENT_PRESS);
|
powerFSM.trigger(EVENT_PRESS);
|
||||||
|
|
||||||
// Update display (legacy behaviour)
|
// Update display (legacy behaviour)
|
||||||
screen->forceDisplay();
|
screen->forceDisplay();
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif // BUTTON_PIN_TOUCH
|
#endif // BUTTON_PIN_TOUCH
|
||||||
|
@ -570,6 +570,19 @@ bool GPS::setup()
|
|||||||
// Switch to Fitness Mode, for running and walking purpose with low speed (<5 m/s)
|
// Switch to Fitness Mode, for running and walking purpose with low speed (<5 m/s)
|
||||||
_serial_gps->write("$PMTK886,1*29\r\n");
|
_serial_gps->write("$PMTK886,1*29\r\n");
|
||||||
delay(250);
|
delay(250);
|
||||||
|
} else if (gnssModel == GNSS_MODEL_MTK_PA1010D) {
|
||||||
|
// PA1010D is used in the Pimoroni GPS board.
|
||||||
|
|
||||||
|
// Enable all constellations.
|
||||||
|
_serial_gps->write("$PMTK353,1,1,1,1,1*2A\r\n");
|
||||||
|
// Above command will reset the GPS and takes longer before it will accept new commands
|
||||||
|
delay(1000);
|
||||||
|
// Only ask for RMC and GGA (GNRMC and GNGGA)
|
||||||
|
_serial_gps->write("$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n");
|
||||||
|
delay(250);
|
||||||
|
// Enable SBAS / WAAS
|
||||||
|
_serial_gps->write("$PMTK301,2*2E\r\n");
|
||||||
|
delay(250);
|
||||||
} else if (gnssModel == GNSS_MODEL_MTK_PA1616S) {
|
} else if (gnssModel == GNSS_MODEL_MTK_PA1616S) {
|
||||||
// PA1616S is used in some GPS breakout boards from Adafruit
|
// PA1616S is used in some GPS breakout boards from Adafruit
|
||||||
// PA1616S does not have GLONASS capability. PA1616D does, but is not implemented here.
|
// PA1616S does not have GLONASS capability. PA1616D does, but is not implemented here.
|
||||||
@ -1237,10 +1250,11 @@ GnssModel_t GPS::probe(int serialSpeed)
|
|||||||
// Close all NMEA sentences, valid for MTK3333 and MTK3339 platforms
|
// Close all NMEA sentences, valid for MTK3333 and MTK3339 platforms
|
||||||
_serial_gps->write("$PMTK514,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*2E\r\n");
|
_serial_gps->write("$PMTK514,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*2E\r\n");
|
||||||
delay(20);
|
delay(20);
|
||||||
std::vector<ChipInfo> mtk = {{"L76B", "Quectel-L76B", GNSS_MODEL_MTK_L76B},
|
std::vector<ChipInfo> mtk = {{"L76B", "Quectel-L76B", GNSS_MODEL_MTK_L76B}, {"PA1010D", "1010D", GNSS_MODEL_MTK_PA1010D},
|
||||||
{"PA1616S", "1616S", GNSS_MODEL_MTK_PA1616S},
|
{"PA1616S", "1616S", GNSS_MODEL_MTK_PA1616S}, {"LS20031", "MC-1513", GNSS_MODEL_MTK_L76B},
|
||||||
{"LS20031", "MC-1513", GNSS_MODEL_MTK_L76B},
|
{"L96", "Quectel-L96", GNSS_MODEL_MTK_L76B}, {"L80-R", "_3337_", GNSS_MODEL_MTK_L76B},
|
||||||
{"L96", "Quectel-L96", GNSS_MODEL_MTK_L76B}};
|
{"L80", "_3339_", GNSS_MODEL_MTK_L76B}};
|
||||||
|
|
||||||
PROBE_FAMILY("MTK Family", "$PMTK605*31", mtk, 500);
|
PROBE_FAMILY("MTK Family", "$PMTK605*31", mtk, 500);
|
||||||
|
|
||||||
uint8_t cfg_rate[] = {0xB5, 0x62, 0x06, 0x08, 0x00, 0x00, 0x00, 0x00};
|
uint8_t cfg_rate[] = {0xB5, 0x62, 0x06, 0x08, 0x00, 0x00, 0x00, 0x00};
|
||||||
|
@ -27,6 +27,7 @@ typedef enum {
|
|||||||
GNSS_MODEL_UC6580,
|
GNSS_MODEL_UC6580,
|
||||||
GNSS_MODEL_UNKNOWN,
|
GNSS_MODEL_UNKNOWN,
|
||||||
GNSS_MODEL_MTK_L76B,
|
GNSS_MODEL_MTK_L76B,
|
||||||
|
GNSS_MODEL_MTK_PA1010D,
|
||||||
GNSS_MODEL_MTK_PA1616S,
|
GNSS_MODEL_MTK_PA1616S,
|
||||||
GNSS_MODEL_AG3335,
|
GNSS_MODEL_AG3335,
|
||||||
GNSS_MODEL_AG3352,
|
GNSS_MODEL_AG3352,
|
||||||
|
@ -3148,6 +3148,9 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver)
|
|||||||
#ifdef T_WATCH_S3
|
#ifdef T_WATCH_S3
|
||||||
PMU->enablePowerOutput(XPOWERS_ALDO2);
|
PMU->enablePowerOutput(XPOWERS_ALDO2);
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HELTEC_TRACKER_V1_X
|
||||||
|
uint8_t tft_vext_enabled = digitalRead(VEXT_ENABLE);
|
||||||
|
#endif
|
||||||
#if !ARCH_PORTDUINO
|
#if !ARCH_PORTDUINO
|
||||||
dispdev->displayOn();
|
dispdev->displayOn();
|
||||||
#endif
|
#endif
|
||||||
@ -3158,6 +3161,12 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
dispdev->displayOn();
|
dispdev->displayOn();
|
||||||
|
#ifdef HELTEC_TRACKER_V1_X
|
||||||
|
// If the TFT VEXT power is not enabled, initialize the UI.
|
||||||
|
if (!tft_vext_enabled) {
|
||||||
|
ui->init();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#ifdef USE_ST7789
|
#ifdef USE_ST7789
|
||||||
pinMode(VTFT_CTRL, OUTPUT);
|
pinMode(VTFT_CTRL, OUTPUT);
|
||||||
digitalWrite(VTFT_CTRL, LOW);
|
digitalWrite(VTFT_CTRL, LOW);
|
||||||
@ -4509,9 +4518,6 @@ int Screen::handleInputEvent(const InputEvent *event)
|
|||||||
|
|
||||||
int Screen::handleAdminMessage(const meshtastic_AdminMessage *arg)
|
int Screen::handleAdminMessage(const meshtastic_AdminMessage *arg)
|
||||||
{
|
{
|
||||||
// Note: only selected admin messages notify this observer
|
|
||||||
// If you wish to handle a new type of message, you should modify AdminModule.cpp first
|
|
||||||
|
|
||||||
switch (arg->which_payload_variant) {
|
switch (arg->which_payload_variant) {
|
||||||
// Node removed manually (i.e. via app)
|
// Node removed manually (i.e. via app)
|
||||||
case meshtastic_AdminMessage_remove_by_nodenum_tag:
|
case meshtastic_AdminMessage_remove_by_nodenum_tag:
|
||||||
|
@ -65,8 +65,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \
|
#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \
|
||||||
defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS)) || \
|
defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS) || defined(ILI9488_CS)) && \
|
||||||
defined(ILI9488_CS) && !defined(DISPLAY_FORCE_SMALL_FONTS)
|
!defined(DISPLAY_FORCE_SMALL_FONTS)
|
||||||
// The screen is bigger so use bigger fonts
|
// The screen is bigger so use bigger fonts
|
||||||
#define FONT_SMALL FONT_MEDIUM_LOCAL // Height: 19
|
#define FONT_SMALL FONT_MEDIUM_LOCAL // Height: 19
|
||||||
#define FONT_MEDIUM FONT_LARGE_LOCAL // Height: 28
|
#define FONT_MEDIUM FONT_LARGE_LOCAL // Height: 28
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
#include "./LCMEN2R13EFC1.h"
|
|
||||||
|
|
||||||
#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS
|
#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS
|
||||||
|
|
||||||
|
#include "./LCMEN2R13EFC1.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
#include "SPILock.h"
|
||||||
|
|
||||||
using namespace NicheGraphics::Drivers;
|
using namespace NicheGraphics::Drivers;
|
||||||
|
|
||||||
// Look up table: fast refresh, common electrode
|
// Look up table: fast refresh, common electrode
|
||||||
@ -150,6 +152,9 @@ void LCMEN213EFC1::reset()
|
|||||||
|
|
||||||
void LCMEN213EFC1::sendCommand(const uint8_t command)
|
void LCMEN213EFC1::sendCommand(const uint8_t command)
|
||||||
{
|
{
|
||||||
|
// Take firmware's SPI lock
|
||||||
|
spiLock->lock();
|
||||||
|
|
||||||
spi->beginTransaction(spiSettings);
|
spi->beginTransaction(spiSettings);
|
||||||
digitalWrite(pin_dc, LOW); // DC pin low indicates command
|
digitalWrite(pin_dc, LOW); // DC pin low indicates command
|
||||||
digitalWrite(pin_cs, LOW);
|
digitalWrite(pin_cs, LOW);
|
||||||
@ -157,6 +162,8 @@ void LCMEN213EFC1::sendCommand(const uint8_t command)
|
|||||||
digitalWrite(pin_cs, HIGH);
|
digitalWrite(pin_cs, HIGH);
|
||||||
digitalWrite(pin_dc, HIGH);
|
digitalWrite(pin_dc, HIGH);
|
||||||
spi->endTransaction();
|
spi->endTransaction();
|
||||||
|
|
||||||
|
spiLock->unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LCMEN213EFC1::sendData(uint8_t data)
|
void LCMEN213EFC1::sendData(uint8_t data)
|
||||||
@ -166,6 +173,9 @@ void LCMEN213EFC1::sendData(uint8_t data)
|
|||||||
|
|
||||||
void LCMEN213EFC1::sendData(const uint8_t *data, uint32_t size)
|
void LCMEN213EFC1::sendData(const uint8_t *data, uint32_t size)
|
||||||
{
|
{
|
||||||
|
// Take firmware's SPI lock
|
||||||
|
spiLock->lock();
|
||||||
|
|
||||||
spi->beginTransaction(spiSettings);
|
spi->beginTransaction(spiSettings);
|
||||||
digitalWrite(pin_dc, HIGH); // DC pin HIGH indicates data, instead of command
|
digitalWrite(pin_dc, HIGH); // DC pin HIGH indicates data, instead of command
|
||||||
digitalWrite(pin_cs, LOW);
|
digitalWrite(pin_cs, LOW);
|
||||||
@ -183,6 +193,8 @@ void LCMEN213EFC1::sendData(const uint8_t *data, uint32_t size)
|
|||||||
digitalWrite(pin_cs, HIGH);
|
digitalWrite(pin_cs, HIGH);
|
||||||
digitalWrite(pin_dc, HIGH);
|
digitalWrite(pin_dc, HIGH);
|
||||||
spi->endTransaction();
|
spi->endTransaction();
|
||||||
|
|
||||||
|
spiLock->unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LCMEN213EFC1::configFull()
|
void LCMEN213EFC1::configFull()
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
|
#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS
|
||||||
|
|
||||||
#include "./SSD16XX.h"
|
#include "./SSD16XX.h"
|
||||||
|
|
||||||
#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS
|
#include "SPILock.h"
|
||||||
|
|
||||||
using namespace NicheGraphics::Drivers;
|
using namespace NicheGraphics::Drivers;
|
||||||
|
|
||||||
SSD16XX::SSD16XX(uint16_t width, uint16_t height, UpdateTypes supported, uint8_t bufferOffsetX)
|
SSD16XX::SSD16XX(uint16_t width, uint16_t height, UpdateTypes supported, uint8_t bufferOffsetX)
|
||||||
@ -82,6 +85,9 @@ void SSD16XX::sendCommand(const uint8_t command)
|
|||||||
if (failed)
|
if (failed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Take firmware's SPI lock
|
||||||
|
spiLock->lock();
|
||||||
|
|
||||||
spi->beginTransaction(spiSettings);
|
spi->beginTransaction(spiSettings);
|
||||||
digitalWrite(pin_dc, LOW); // DC pin low indicates command
|
digitalWrite(pin_dc, LOW); // DC pin low indicates command
|
||||||
digitalWrite(pin_cs, LOW);
|
digitalWrite(pin_cs, LOW);
|
||||||
@ -89,6 +95,8 @@ void SSD16XX::sendCommand(const uint8_t command)
|
|||||||
digitalWrite(pin_cs, HIGH);
|
digitalWrite(pin_cs, HIGH);
|
||||||
digitalWrite(pin_dc, HIGH);
|
digitalWrite(pin_dc, HIGH);
|
||||||
spi->endTransaction();
|
spi->endTransaction();
|
||||||
|
|
||||||
|
spiLock->unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SSD16XX::sendData(uint8_t data)
|
void SSD16XX::sendData(uint8_t data)
|
||||||
@ -103,6 +111,9 @@ void SSD16XX::sendData(const uint8_t *data, uint32_t size)
|
|||||||
if (failed)
|
if (failed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Take firmware's SPI lock
|
||||||
|
spiLock->lock();
|
||||||
|
|
||||||
spi->beginTransaction(spiSettings);
|
spi->beginTransaction(spiSettings);
|
||||||
digitalWrite(pin_dc, HIGH); // DC pin HIGH indicates data, instead of command
|
digitalWrite(pin_dc, HIGH); // DC pin HIGH indicates data, instead of command
|
||||||
digitalWrite(pin_cs, LOW);
|
digitalWrite(pin_cs, LOW);
|
||||||
@ -119,6 +130,8 @@ void SSD16XX::sendData(const uint8_t *data, uint32_t size)
|
|||||||
digitalWrite(pin_cs, HIGH);
|
digitalWrite(pin_cs, HIGH);
|
||||||
digitalWrite(pin_dc, HIGH);
|
digitalWrite(pin_dc, HIGH);
|
||||||
spi->endTransaction();
|
spi->endTransaction();
|
||||||
|
|
||||||
|
spiLock->unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SSD16XX::configFullscreen()
|
void SSD16XX::configFullscreen()
|
||||||
|
@ -13,6 +13,7 @@ Avoid bloating everyone's protobuf code for our one-off UI implementations
|
|||||||
|
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
|
||||||
|
#include "SPILock.h"
|
||||||
#include "SafeFile.h"
|
#include "SafeFile.h"
|
||||||
|
|
||||||
namespace NicheGraphics
|
namespace NicheGraphics
|
||||||
@ -46,6 +47,9 @@ template <typename T> class FlashData
|
|||||||
public:
|
public:
|
||||||
static bool load(T *data, const char *label)
|
static bool load(T *data, const char *label)
|
||||||
{
|
{
|
||||||
|
// Take firmware's SPI lock
|
||||||
|
concurrency::LockGuard guard(spiLock);
|
||||||
|
|
||||||
// Set false if we run into issues
|
// Set false if we run into issues
|
||||||
bool okay = true;
|
bool okay = true;
|
||||||
|
|
||||||
@ -103,14 +107,18 @@ template <typename T> class FlashData
|
|||||||
return okay;
|
return okay;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save module's custom data (settings?) to flash. Does use protobufs
|
// Save module's custom data (settings?) to flash. Doesn't use protobufs
|
||||||
|
// Takes the firmware's SPI lock, in case the files are stored on SD card
|
||||||
|
// Need to lock and unlock around specific FS methods, as the SafeFile class takes the lock for itself internally.
|
||||||
static void save(T *data, const char *label)
|
static void save(T *data, const char *label)
|
||||||
{
|
{
|
||||||
// Get a filename based on the label
|
// Get a filename based on the label
|
||||||
std::string filename = getFilename(label);
|
std::string filename = getFilename(label);
|
||||||
|
|
||||||
#ifdef FSCom
|
#ifdef FSCom
|
||||||
|
spiLock->lock();
|
||||||
FSCom.mkdir("/NicheGraphics");
|
FSCom.mkdir("/NicheGraphics");
|
||||||
|
spiLock->unlock();
|
||||||
|
|
||||||
auto f = SafeFile(filename.c_str(), true); // "true": full atomic. Write new data to temp file, then rename.
|
auto f = SafeFile(filename.c_str(), true); // "true": full atomic. Write new data to temp file, then rename.
|
||||||
|
|
||||||
@ -119,10 +127,10 @@ template <typename T> class FlashData
|
|||||||
// Calculate a hash of the data
|
// Calculate a hash of the data
|
||||||
uint32_t hash = getHash(data);
|
uint32_t hash = getHash(data);
|
||||||
|
|
||||||
|
spiLock->lock();
|
||||||
f.write((uint8_t *)data, sizeof(T)); // Write the actual data
|
f.write((uint8_t *)data, sizeof(T)); // Write the actual data
|
||||||
f.write((uint8_t *)&hash, sizeof(hash)); // Append the hash
|
f.write((uint8_t *)&hash, sizeof(hash)); // Append the hash
|
||||||
|
spiLock->unlock();
|
||||||
// f.flush();
|
|
||||||
|
|
||||||
bool writeSucceeded = f.close();
|
bool writeSucceeded = f.close();
|
||||||
|
|
||||||
@ -135,6 +143,32 @@ template <typename T> class FlashData
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Erase contents of the NicheGraphics data directory
|
||||||
|
inline void clearFlashData()
|
||||||
|
{
|
||||||
|
|
||||||
|
// Take firmware's SPI lock, in case the files are stored on SD card
|
||||||
|
concurrency::LockGuard guard(spiLock);
|
||||||
|
|
||||||
|
#ifdef FSCom
|
||||||
|
File dir = FSCom.open("/NicheGraphics"); // Open the directory
|
||||||
|
File file = dir.openNextFile(); // Attempt to open the first file in the directory
|
||||||
|
|
||||||
|
// While the directory still contains files
|
||||||
|
while (file) {
|
||||||
|
std::string path = "/NicheGraphics/";
|
||||||
|
path += file.name();
|
||||||
|
LOG_DEBUG("Erasing %s", path.c_str());
|
||||||
|
file.close();
|
||||||
|
FSCom.remove(path.c_str());
|
||||||
|
|
||||||
|
file = dir.openNextFile();
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
LOG_ERROR("ERROR: Filesystem not implemented\n");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace NicheGraphics
|
} // namespace NicheGraphics
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -3,11 +3,13 @@
|
|||||||
#include "./Events.h"
|
#include "./Events.h"
|
||||||
|
|
||||||
#include "RTC.h"
|
#include "RTC.h"
|
||||||
|
#include "modules/AdminModule.h"
|
||||||
#include "modules/TextMessageModule.h"
|
#include "modules/TextMessageModule.h"
|
||||||
#include "sleep.h"
|
#include "sleep.h"
|
||||||
|
|
||||||
#include "./Applet.h"
|
#include "./Applet.h"
|
||||||
#include "./SystemApplet.h"
|
#include "./SystemApplet.h"
|
||||||
|
#include "graphics/niche/FlashData.h"
|
||||||
|
|
||||||
using namespace NicheGraphics;
|
using namespace NicheGraphics;
|
||||||
|
|
||||||
@ -25,6 +27,9 @@ void InkHUD::Events::begin()
|
|||||||
deepSleepObserver.observe(¬ifyDeepSleep);
|
deepSleepObserver.observe(¬ifyDeepSleep);
|
||||||
rebootObserver.observe(¬ifyReboot);
|
rebootObserver.observe(¬ifyReboot);
|
||||||
textMessageObserver.observe(textMessageModule);
|
textMessageObserver.observe(textMessageModule);
|
||||||
|
#if !MESHTASTIC_EXCLUDE_ADMIN
|
||||||
|
adminMessageObserver.observe(adminModule);
|
||||||
|
#endif
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
lightSleepObserver.observe(¬ifyLightSleep);
|
lightSleepObserver.observe(¬ifyLightSleep);
|
||||||
#endif
|
#endif
|
||||||
@ -117,8 +122,13 @@ int InkHUD::Events::beforeReboot(void *unused)
|
|||||||
sa->onReboot();
|
sa->onReboot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Save settings to flash, or erase if factory reset in progress
|
||||||
|
if (!eraseOnReboot) {
|
||||||
inkhud->persistence->saveSettings();
|
inkhud->persistence->saveSettings();
|
||||||
inkhud->persistence->saveLatestMessage();
|
inkhud->persistence->saveLatestMessage();
|
||||||
|
} else {
|
||||||
|
NicheGraphics::clearFlashData();
|
||||||
|
}
|
||||||
|
|
||||||
// Note: no forceUpdate call here
|
// Note: no forceUpdate call here
|
||||||
// We don't have any final screen to draw, although LogoApplet::onReboot did already display a "rebooting" screen
|
// We don't have any final screen to draw, although LogoApplet::onReboot did already display a "rebooting" screen
|
||||||
@ -171,6 +181,23 @@ int InkHUD::Events::onReceiveTextMessage(const meshtastic_MeshPacket *packet)
|
|||||||
return 0; // Tell caller to continue notifying other observers. (No reason to abort this event)
|
return 0; // Tell caller to continue notifying other observers. (No reason to abort this event)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int InkHUD::Events::onAdminMessage(const meshtastic_AdminMessage *message)
|
||||||
|
{
|
||||||
|
switch (message->which_payload_variant) {
|
||||||
|
// Factory reset
|
||||||
|
// Two possible messages. One preserves BLE bonds, other wipes. Both should clear InkHUD data.
|
||||||
|
case meshtastic_AdminMessage_factory_reset_device_tag:
|
||||||
|
case meshtastic_AdminMessage_factory_reset_config_tag:
|
||||||
|
eraseOnReboot = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0; // Tell caller to continue notifying other observers. (No reason to abort this event)
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
// Callback for lightSleepObserver
|
// Callback for lightSleepObserver
|
||||||
// Make sure the display is not partway through an update when we begin light sleep
|
// Make sure the display is not partway through an update when we begin light sleep
|
||||||
|
@ -33,6 +33,7 @@ class Events
|
|||||||
int beforeDeepSleep(void *unused); // Prepare for shutdown
|
int beforeDeepSleep(void *unused); // Prepare for shutdown
|
||||||
int beforeReboot(void *unused); // Prepare for reboot
|
int beforeReboot(void *unused); // Prepare for reboot
|
||||||
int onReceiveTextMessage(const meshtastic_MeshPacket *packet); // Store most recent text message
|
int onReceiveTextMessage(const meshtastic_MeshPacket *packet); // Store most recent text message
|
||||||
|
int onAdminMessage(const meshtastic_AdminMessage *message); // Handle incoming admin messages
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
int beforeLightSleep(void *unused); // Prepare for light sleep
|
int beforeLightSleep(void *unused); // Prepare for light sleep
|
||||||
#endif
|
#endif
|
||||||
@ -52,10 +53,17 @@ class Events
|
|||||||
CallbackObserver<Events, const meshtastic_MeshPacket *> textMessageObserver =
|
CallbackObserver<Events, const meshtastic_MeshPacket *> textMessageObserver =
|
||||||
CallbackObserver<Events, const meshtastic_MeshPacket *>(this, &Events::onReceiveTextMessage);
|
CallbackObserver<Events, const meshtastic_MeshPacket *>(this, &Events::onReceiveTextMessage);
|
||||||
|
|
||||||
|
// Get notified of incoming admin messages, and handle any which are relevant to InkHUD
|
||||||
|
CallbackObserver<Events, const meshtastic_AdminMessage *> adminMessageObserver =
|
||||||
|
CallbackObserver<Events, const meshtastic_AdminMessage *>(this, &Events::onAdminMessage);
|
||||||
|
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
// Get notified when the system is entering light sleep
|
// Get notified when the system is entering light sleep
|
||||||
CallbackObserver<Events, void *> lightSleepObserver = CallbackObserver<Events, void *>(this, &Events::beforeLightSleep);
|
CallbackObserver<Events, void *> lightSleepObserver = CallbackObserver<Events, void *>(this, &Events::beforeLightSleep);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// If set, InkHUD's data will be erased during onReboot
|
||||||
|
bool eraseOnReboot = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace NicheGraphics::InkHUD
|
} // namespace NicheGraphics::InkHUD
|
||||||
|
@ -22,6 +22,8 @@ InkHUD::MessageStore::MessageStore(std::string label)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Write the contents of the MessageStore::messages object to flash
|
// Write the contents of the MessageStore::messages object to flash
|
||||||
|
// Takes the firmware's SPI lock during FS operations. Implemented for consistency, but only relevant when using SD card.
|
||||||
|
// Need to lock and unlock around specific FS methods, as the SafeFile class takes the lock for itself internally
|
||||||
void InkHUD::MessageStore::saveToFlash()
|
void InkHUD::MessageStore::saveToFlash()
|
||||||
{
|
{
|
||||||
assert(!filename.empty());
|
assert(!filename.empty());
|
||||||
@ -29,7 +31,9 @@ void InkHUD::MessageStore::saveToFlash()
|
|||||||
#ifdef FSCom
|
#ifdef FSCom
|
||||||
// Make the directory, if doesn't already exist
|
// Make the directory, if doesn't already exist
|
||||||
// This is the same directory accessed by NicheGraphics::FlashData
|
// This is the same directory accessed by NicheGraphics::FlashData
|
||||||
|
spiLock->lock();
|
||||||
FSCom.mkdir("/NicheGraphics");
|
FSCom.mkdir("/NicheGraphics");
|
||||||
|
spiLock->unlock();
|
||||||
|
|
||||||
// Open or create the file
|
// Open or create the file
|
||||||
// No "full atomic": don't save then rename
|
// No "full atomic": don't save then rename
|
||||||
@ -37,6 +41,9 @@ void InkHUD::MessageStore::saveToFlash()
|
|||||||
|
|
||||||
LOG_INFO("Saving messages in %s", filename.c_str());
|
LOG_INFO("Saving messages in %s", filename.c_str());
|
||||||
|
|
||||||
|
// Take firmware's SPI Lock while writing
|
||||||
|
spiLock->lock();
|
||||||
|
|
||||||
// 1st byte: how many messages will be written to store
|
// 1st byte: how many messages will be written to store
|
||||||
f.write(messages.size());
|
f.write(messages.size());
|
||||||
|
|
||||||
@ -51,6 +58,9 @@ void InkHUD::MessageStore::saveToFlash()
|
|||||||
LOG_DEBUG("Wrote message %u, length %u, text \"%s\"", (uint32_t)i, min(MAX_MESSAGE_SIZE, m.text.size()), m.text.c_str());
|
LOG_DEBUG("Wrote message %u, length %u, text \"%s\"", (uint32_t)i, min(MAX_MESSAGE_SIZE, m.text.size()), m.text.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Release firmware's SPI lock, because SafeFile::close needs it
|
||||||
|
spiLock->unlock();
|
||||||
|
|
||||||
bool writeSucceeded = f.close();
|
bool writeSucceeded = f.close();
|
||||||
|
|
||||||
if (!writeSucceeded) {
|
if (!writeSucceeded) {
|
||||||
@ -63,6 +73,7 @@ void InkHUD::MessageStore::saveToFlash()
|
|||||||
|
|
||||||
// Attempt to load the previous contents of the MessageStore:message deque from flash.
|
// Attempt to load the previous contents of the MessageStore:message deque from flash.
|
||||||
// Filename is controlled by the "label" parameter
|
// Filename is controlled by the "label" parameter
|
||||||
|
// Takes the firmware's SPI lock during FS operations. Implemented for consistency, but only relevant when using SD card.
|
||||||
void InkHUD::MessageStore::loadFromFlash()
|
void InkHUD::MessageStore::loadFromFlash()
|
||||||
{
|
{
|
||||||
// Hopefully redundant. Initial intention is to only load / save once per boot.
|
// Hopefully redundant. Initial intention is to only load / save once per boot.
|
||||||
@ -70,6 +81,9 @@ void InkHUD::MessageStore::loadFromFlash()
|
|||||||
|
|
||||||
#ifdef FSCom
|
#ifdef FSCom
|
||||||
|
|
||||||
|
// Take the firmware's SPI Lock, in case filesystem is on SD card
|
||||||
|
concurrency::LockGuard guard(spiLock);
|
||||||
|
|
||||||
// Check that the file *does* actually exist
|
// Check that the file *does* actually exist
|
||||||
if (!FSCom.exists(filename.c_str())) {
|
if (!FSCom.exists(filename.c_str())) {
|
||||||
LOG_WARN("'%s' not found. Using default values", filename.c_str());
|
LOG_WARN("'%s' not found. Using default values", filename.c_str());
|
||||||
|
@ -502,6 +502,10 @@ Applets themselves do also listen separately for various events, but for the pur
|
|||||||
|
|
||||||
Button input is sometimes handled by a system applet. `InkHUD::Events` determines whether the button should be handled by a specific system applet, or should instead trigger a default behavior
|
Button input is sometimes handled by a system applet. `InkHUD::Events` determines whether the button should be handled by a specific system applet, or should instead trigger a default behavior
|
||||||
|
|
||||||
|
#### Factory Reset
|
||||||
|
|
||||||
|
The Events class handles the admin messages(s) which trigger factory reset. We set `Events::eraseOnReboot = true`, which causes `Events::onReboot` to erase the contents of InkHUD's data directory. We do this because some applets (e.g. ThreadedMessageApplet) save their own data to flash, so if we erased earlier, that data would get re-written during reboot.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### `InkHUD::Applet`
|
### `InkHUD::Applet`
|
||||||
|
@ -43,10 +43,10 @@ void tftSetup(void)
|
|||||||
#else
|
#else
|
||||||
if (settingsMap[displayPanel] != no_screen) {
|
if (settingsMap[displayPanel] != no_screen) {
|
||||||
DisplayDriverConfig displayConfig;
|
DisplayDriverConfig displayConfig;
|
||||||
static char *panels[] = {"NOSCREEN", "X11", "ST7789", "ST7735", "ST7735S", "ST7796",
|
static char *panels[] = {"NOSCREEN", "X11", "FB", "ST7789", "ST7735", "ST7735S",
|
||||||
"ILI9341", "ILI9342", "ILI9486", "ILI9488", "HX8357D"};
|
"ST7796", "ILI9341", "ILI9342", "ILI9486", "ILI9488", "HX8357D"};
|
||||||
static char *touch[] = {"NOTOUCH", "XPT2046", "STMPE610", "GT911", "FT5x06"};
|
static char *touch[] = {"NOTOUCH", "XPT2046", "STMPE610", "GT911", "FT5x06"};
|
||||||
#ifdef USE_X11
|
#if defined(USE_X11)
|
||||||
if (settingsMap[displayPanel] == x11) {
|
if (settingsMap[displayPanel] == x11) {
|
||||||
if (settingsMap[displayWidth] && settingsMap[displayHeight])
|
if (settingsMap[displayWidth] && settingsMap[displayHeight])
|
||||||
displayConfig = DisplayDriverConfig(DisplayDriverConfig::device_t::X11, (uint16_t)settingsMap[displayWidth],
|
displayConfig = DisplayDriverConfig(DisplayDriverConfig::device_t::X11, (uint16_t)settingsMap[displayWidth],
|
||||||
@ -54,6 +54,14 @@ void tftSetup(void)
|
|||||||
else
|
else
|
||||||
displayConfig.device(DisplayDriverConfig::device_t::X11);
|
displayConfig.device(DisplayDriverConfig::device_t::X11);
|
||||||
} else
|
} else
|
||||||
|
#elif defined(USE_FRAMEBUFFER)
|
||||||
|
if (settingsMap[displayPanel] == fb) {
|
||||||
|
if (settingsMap[displayWidth] && settingsMap[displayHeight])
|
||||||
|
displayConfig = DisplayDriverConfig(DisplayDriverConfig::device_t::FB, (uint16_t)settingsMap[displayWidth],
|
||||||
|
(uint16_t)settingsMap[displayHeight]);
|
||||||
|
else
|
||||||
|
displayConfig.device(DisplayDriverConfig::device_t::FB);
|
||||||
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
displayConfig.device(DisplayDriverConfig::device_t::CUSTOM_TFT)
|
displayConfig.device(DisplayDriverConfig::device_t::CUSTOM_TFT)
|
||||||
|
11
src/main.cpp
11
src/main.cpp
@ -105,7 +105,7 @@ NRF52Bluetooth *nrf52Bluetooth = nullptr;
|
|||||||
#include "AmbientLightingThread.h"
|
#include "AmbientLightingThread.h"
|
||||||
#include "PowerFSMThread.h"
|
#include "PowerFSMThread.h"
|
||||||
|
|
||||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C
|
#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C
|
||||||
#include "motion/AccelerometerThread.h"
|
#include "motion/AccelerometerThread.h"
|
||||||
AccelerometerThread *accelerometerThread = nullptr;
|
AccelerometerThread *accelerometerThread = nullptr;
|
||||||
#endif
|
#endif
|
||||||
@ -692,7 +692,7 @@ void setup()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
#if !defined(ARCH_STM32WL)
|
||||||
auto acc_info = i2cScanner->firstAccelerometer();
|
auto acc_info = i2cScanner->firstAccelerometer();
|
||||||
accelerometer_found = acc_info.type != ScanI2C::DeviceType::NONE ? acc_info.address : accelerometer_found;
|
accelerometer_found = acc_info.type != ScanI2C::DeviceType::NONE ? acc_info.address : accelerometer_found;
|
||||||
LOG_DEBUG("acc_info = %i", acc_info.type);
|
LOG_DEBUG("acc_info = %i", acc_info.type);
|
||||||
@ -807,7 +807,7 @@ void setup()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !MESHTASTIC_EXCLUDE_I2C
|
#if !MESHTASTIC_EXCLUDE_I2C
|
||||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
#if !defined(ARCH_STM32WL)
|
||||||
if (acc_info.type != ScanI2C::DeviceType::NONE) {
|
if (acc_info.type != ScanI2C::DeviceType::NONE) {
|
||||||
accelerometerThread = new AccelerometerThread(acc_info.type);
|
accelerometerThread = new AccelerometerThread(acc_info.type);
|
||||||
}
|
}
|
||||||
@ -1303,7 +1303,12 @@ void setup()
|
|||||||
LOG_DEBUG("Free heap : %7d bytes", ESP.getFreeHeap());
|
LOG_DEBUG("Free heap : %7d bytes", ESP.getFreeHeap());
|
||||||
LOG_DEBUG("Free PSRAM : %7d bytes", ESP.getFreePsram());
|
LOG_DEBUG("Free PSRAM : %7d bytes", ESP.getFreePsram());
|
||||||
#endif
|
#endif
|
||||||
|
#if !defined(ARCH_STM32WL)
|
||||||
|
if (accelerometerThread)
|
||||||
|
accelerometerThread->calibrate(30);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
uint32_t rebootAtMsec; // If not zero we will reboot at this time (used to reboot shortly after the update completes)
|
uint32_t rebootAtMsec; // If not zero we will reboot at this time (used to reboot shortly after the update completes)
|
||||||
uint32_t shutdownAtMsec; // If not zero we will shutdown at this time (used to shutdown from python or mobile client)
|
uint32_t shutdownAtMsec; // If not zero we will shutdown at this time (used to shutdown from python or mobile client)
|
||||||
|
@ -58,7 +58,7 @@ extern UdpMulticastHandler *udpHandler;
|
|||||||
// Global Screen singleton.
|
// Global Screen singleton.
|
||||||
extern graphics::Screen *screen;
|
extern graphics::Screen *screen;
|
||||||
|
|
||||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C
|
#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C
|
||||||
#include "motion/AccelerometerThread.h"
|
#include "motion/AccelerometerThread.h"
|
||||||
extern AccelerometerThread *accelerometerThread;
|
extern AccelerometerThread *accelerometerThread;
|
||||||
#endif
|
#endif
|
||||||
|
@ -345,9 +345,9 @@ void Channels::setChannel(const meshtastic_Channel &c)
|
|||||||
|
|
||||||
bool Channels::anyMqttEnabled()
|
bool Channels::anyMqttEnabled()
|
||||||
{
|
{
|
||||||
#if USERPREFS_EVENT_MODE
|
#if USERPREFS_EVENT_MODE && !MESHTASTIC_EXCLUDE_MQTT
|
||||||
// Don't publish messages on the public MQTT broker if we are in event mode
|
// Don't publish messages on the public MQTT broker if we are in event mode
|
||||||
if (mqtt && mqtt->isUsingDefaultServer()) {
|
if (mqtt && mqtt->isUsingDefaultServer() && mqtt->isUsingDefaultRootTopic()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -21,11 +21,14 @@
|
|||||||
#define default_neighbor_info_broadcast_secs 6 * 60 * 60
|
#define default_neighbor_info_broadcast_secs 6 * 60 * 60
|
||||||
#define min_node_info_broadcast_secs 60 * 60 // No regular broadcasts of more than once an hour
|
#define min_node_info_broadcast_secs 60 * 60 // No regular broadcasts of more than once an hour
|
||||||
#define min_neighbor_info_broadcast_secs 4 * 60 * 60
|
#define min_neighbor_info_broadcast_secs 4 * 60 * 60
|
||||||
|
#define default_map_publish_interval_secs 60 * 60
|
||||||
|
|
||||||
#define default_mqtt_address "mqtt.meshtastic.org"
|
#define default_mqtt_address "mqtt.meshtastic.org"
|
||||||
#define default_mqtt_username "meshdev"
|
#define default_mqtt_username "meshdev"
|
||||||
#define default_mqtt_password "large4cats"
|
#define default_mqtt_password "large4cats"
|
||||||
#define default_mqtt_root "msh"
|
#define default_mqtt_root "msh"
|
||||||
|
#define default_mqtt_encryption_enabled true
|
||||||
|
#define default_mqtt_tls_enabled false
|
||||||
|
|
||||||
#define IF_ROUTER(routerVal, normalVal) \
|
#define IF_ROUTER(routerVal, normalVal) \
|
||||||
((config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER) ? (routerVal) : (normalVal))
|
((config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER) ? (routerVal) : (normalVal))
|
||||||
|
@ -328,6 +328,11 @@ NodeDB::NodeDB()
|
|||||||
moduleConfig.telemetry.health_update_interval = Default::getConfiguredOrMinimumValue(
|
moduleConfig.telemetry.health_update_interval = Default::getConfiguredOrMinimumValue(
|
||||||
moduleConfig.telemetry.health_update_interval, min_default_telemetry_interval_secs);
|
moduleConfig.telemetry.health_update_interval, min_default_telemetry_interval_secs);
|
||||||
}
|
}
|
||||||
|
if (moduleConfig.mqtt.has_map_report_settings &&
|
||||||
|
moduleConfig.mqtt.map_report_settings.publish_interval_secs < default_map_publish_interval_secs) {
|
||||||
|
moduleConfig.mqtt.map_report_settings.publish_interval_secs = default_map_publish_interval_secs;
|
||||||
|
}
|
||||||
|
|
||||||
// Ensure that the neighbor info update interval is coerced to the minimum
|
// Ensure that the neighbor info update interval is coerced to the minimum
|
||||||
moduleConfig.neighbor_info.update_interval =
|
moduleConfig.neighbor_info.update_interval =
|
||||||
Default::getConfiguredOrMinimumValue(moduleConfig.neighbor_info.update_interval, min_neighbor_info_broadcast_secs);
|
Default::getConfiguredOrMinimumValue(moduleConfig.neighbor_info.update_interval, min_neighbor_info_broadcast_secs);
|
||||||
@ -584,7 +589,7 @@ void NodeDB::installDefaultConfig(bool preserveKey = false)
|
|||||||
strncpy(config.network.ntp_server, "meshtastic.pool.ntp.org", 32);
|
strncpy(config.network.ntp_server, "meshtastic.pool.ntp.org", 32);
|
||||||
|
|
||||||
#if (defined(T_DECK) || defined(T_WATCH_S3) || defined(UNPHONE) || defined(PICOMPUTER_S3) || defined(SENSECAP_INDICATOR) || \
|
#if (defined(T_DECK) || defined(T_WATCH_S3) || defined(UNPHONE) || defined(PICOMPUTER_S3) || defined(SENSECAP_INDICATOR) || \
|
||||||
defined(ELECROW)) && \
|
defined(ELECROW_PANEL)) && \
|
||||||
HAS_TFT
|
HAS_TFT
|
||||||
// switch BT off by default; use TFT programming mode or hotkey to enable
|
// switch BT off by default; use TFT programming mode or hotkey to enable
|
||||||
config.bluetooth.enabled = false;
|
config.bluetooth.enabled = false;
|
||||||
@ -689,7 +694,7 @@ void NodeDB::initConfigIntervals()
|
|||||||
|
|
||||||
config.display.screen_on_secs = default_screen_on_secs;
|
config.display.screen_on_secs = default_screen_on_secs;
|
||||||
|
|
||||||
#if defined(T_WATCH_S3) || defined(T_DECK) || defined(UNPHONE) || defined(MESH_TAB) || defined(RAK14014) || defined(ELECROW)
|
#if defined(USE_POWERSAVE)
|
||||||
config.power.is_power_saving = true;
|
config.power.is_power_saving = true;
|
||||||
config.display.screen_on_secs = 30;
|
config.display.screen_on_secs = 30;
|
||||||
config.power.wait_bluetooth_secs = 30;
|
config.power.wait_bluetooth_secs = 30;
|
||||||
@ -761,11 +766,39 @@ void NodeDB::installDefaultModuleConfig()
|
|||||||
|
|
||||||
moduleConfig.has_canned_message = true;
|
moduleConfig.has_canned_message = true;
|
||||||
|
|
||||||
|
#if USERPREFS_MQTT_ENABLED && !MESHTASTIC_EXCLUDE_MQTT
|
||||||
|
moduleConfig.mqtt.enabled = true;
|
||||||
|
#endif
|
||||||
|
#ifdef USERPREFS_MQTT_ADDRESS
|
||||||
|
strncpy(moduleConfig.mqtt.address, USERPREFS_MQTT_ADDRESS, sizeof(moduleConfig.mqtt.address));
|
||||||
|
#else
|
||||||
strncpy(moduleConfig.mqtt.address, default_mqtt_address, sizeof(moduleConfig.mqtt.address));
|
strncpy(moduleConfig.mqtt.address, default_mqtt_address, sizeof(moduleConfig.mqtt.address));
|
||||||
|
#endif
|
||||||
|
#ifdef USERPREFS_MQTT_USERNAME
|
||||||
|
strncpy(moduleConfig.mqtt.username, USERPREFS_MQTT_USERNAME, sizeof(moduleConfig.mqtt.username));
|
||||||
|
#else
|
||||||
strncpy(moduleConfig.mqtt.username, default_mqtt_username, sizeof(moduleConfig.mqtt.username));
|
strncpy(moduleConfig.mqtt.username, default_mqtt_username, sizeof(moduleConfig.mqtt.username));
|
||||||
|
#endif
|
||||||
|
#ifdef USERPREFS_MQTT_PASSWORD
|
||||||
|
strncpy(moduleConfig.mqtt.password, USERPREFS_MQTT_PASSWORD, sizeof(moduleConfig.mqtt.password));
|
||||||
|
#else
|
||||||
strncpy(moduleConfig.mqtt.password, default_mqtt_password, sizeof(moduleConfig.mqtt.password));
|
strncpy(moduleConfig.mqtt.password, default_mqtt_password, sizeof(moduleConfig.mqtt.password));
|
||||||
|
#endif
|
||||||
|
#ifdef USERPREFS_MQTT_ROOT_TOPIC
|
||||||
|
strncpy(moduleConfig.mqtt.root, USERPREFS_MQTT_ROOT_TOPIC, sizeof(moduleConfig.mqtt.root));
|
||||||
|
#else
|
||||||
strncpy(moduleConfig.mqtt.root, default_mqtt_root, sizeof(moduleConfig.mqtt.root));
|
strncpy(moduleConfig.mqtt.root, default_mqtt_root, sizeof(moduleConfig.mqtt.root));
|
||||||
moduleConfig.mqtt.encryption_enabled = true;
|
#endif
|
||||||
|
#ifdef USERPREFS_MQTT_ENCRYPTION_ENABLED
|
||||||
|
moduleConfig.mqtt.encryption_enabled = USERPREFS_MQTT_ENCRYPTION_ENABLED;
|
||||||
|
#else
|
||||||
|
moduleConfig.mqtt.encryption_enabled = default_mqtt_encryption_enabled;
|
||||||
|
#endif
|
||||||
|
#ifdef USERPREFS_MQTT_TLS_ENABLED
|
||||||
|
moduleConfig.mqtt.tls_enabled = USERPREFS_MQTT_TLS_ENABLED;
|
||||||
|
#else
|
||||||
|
moduleConfig.mqtt.tls_enabled = default_mqtt_tls_enabled;
|
||||||
|
#endif
|
||||||
|
|
||||||
moduleConfig.has_neighbor_info = true;
|
moduleConfig.has_neighbor_info = true;
|
||||||
moduleConfig.neighbor_info.enabled = false;
|
moduleConfig.neighbor_info.enabled = false;
|
||||||
@ -791,10 +824,19 @@ void NodeDB::installRoleDefaults(meshtastic_Config_DeviceConfig_Role role)
|
|||||||
initConfigIntervals();
|
initConfigIntervals();
|
||||||
initModuleConfigIntervals();
|
initModuleConfigIntervals();
|
||||||
config.device.rebroadcast_mode = meshtastic_Config_DeviceConfig_RebroadcastMode_CORE_PORTNUMS_ONLY;
|
config.device.rebroadcast_mode = meshtastic_Config_DeviceConfig_RebroadcastMode_CORE_PORTNUMS_ONLY;
|
||||||
|
owner.has_is_unmessagable = true;
|
||||||
|
owner.is_unmessagable = true;
|
||||||
|
} else if (role == meshtastic_Config_DeviceConfig_Role_ROUTER_LATE) {
|
||||||
|
owner.has_is_unmessagable = true;
|
||||||
|
owner.is_unmessagable = true;
|
||||||
} else if (role == meshtastic_Config_DeviceConfig_Role_REPEATER) {
|
} else if (role == meshtastic_Config_DeviceConfig_Role_REPEATER) {
|
||||||
|
owner.has_is_unmessagable = true;
|
||||||
|
owner.is_unmessagable = true;
|
||||||
config.display.screen_on_secs = 1;
|
config.display.screen_on_secs = 1;
|
||||||
config.device.rebroadcast_mode = meshtastic_Config_DeviceConfig_RebroadcastMode_CORE_PORTNUMS_ONLY;
|
config.device.rebroadcast_mode = meshtastic_Config_DeviceConfig_RebroadcastMode_CORE_PORTNUMS_ONLY;
|
||||||
} else if (role == meshtastic_Config_DeviceConfig_Role_SENSOR) {
|
} else if (role == meshtastic_Config_DeviceConfig_Role_SENSOR) {
|
||||||
|
owner.has_is_unmessagable = true;
|
||||||
|
owner.is_unmessagable = true;
|
||||||
moduleConfig.telemetry.environment_measurement_enabled = true;
|
moduleConfig.telemetry.environment_measurement_enabled = true;
|
||||||
moduleConfig.telemetry.environment_update_interval = 300;
|
moduleConfig.telemetry.environment_update_interval = 300;
|
||||||
} else if (role == meshtastic_Config_DeviceConfig_Role_LOST_AND_FOUND) {
|
} else if (role == meshtastic_Config_DeviceConfig_Role_LOST_AND_FOUND) {
|
||||||
@ -809,7 +851,12 @@ void NodeDB::installRoleDefaults(meshtastic_Config_DeviceConfig_Role role)
|
|||||||
(meshtastic_Config_PositionConfig_PositionFlags_ALTITUDE | meshtastic_Config_PositionConfig_PositionFlags_SPEED |
|
(meshtastic_Config_PositionConfig_PositionFlags_ALTITUDE | meshtastic_Config_PositionConfig_PositionFlags_SPEED |
|
||||||
meshtastic_Config_PositionConfig_PositionFlags_HEADING | meshtastic_Config_PositionConfig_PositionFlags_DOP);
|
meshtastic_Config_PositionConfig_PositionFlags_HEADING | meshtastic_Config_PositionConfig_PositionFlags_DOP);
|
||||||
moduleConfig.telemetry.device_update_interval = ONE_DAY;
|
moduleConfig.telemetry.device_update_interval = ONE_DAY;
|
||||||
|
} else if (role == meshtastic_Config_DeviceConfig_Role_TRACKER) {
|
||||||
|
owner.has_is_unmessagable = true;
|
||||||
|
owner.is_unmessagable = true;
|
||||||
} else if (role == meshtastic_Config_DeviceConfig_Role_TAK_TRACKER) {
|
} else if (role == meshtastic_Config_DeviceConfig_Role_TAK_TRACKER) {
|
||||||
|
owner.has_is_unmessagable = true;
|
||||||
|
owner.is_unmessagable = true;
|
||||||
config.device.node_info_broadcast_secs = ONE_DAY;
|
config.device.node_info_broadcast_secs = ONE_DAY;
|
||||||
config.position.position_broadcast_smart_enabled = true;
|
config.position.position_broadcast_smart_enabled = true;
|
||||||
config.position.position_broadcast_secs = 3 * 60; // Every 3 minutes
|
config.position.position_broadcast_secs = 3 * 60; // Every 3 minutes
|
||||||
@ -942,6 +989,8 @@ void NodeDB::installDefaultDeviceState()
|
|||||||
#endif
|
#endif
|
||||||
snprintf(owner.id, sizeof(owner.id), "!%08x", getNodeNum()); // Default node ID now based on nodenum
|
snprintf(owner.id, sizeof(owner.id), "!%08x", getNodeNum()); // Default node ID now based on nodenum
|
||||||
memcpy(owner.macaddr, ourMacAddr, sizeof(owner.macaddr));
|
memcpy(owner.macaddr, ourMacAddr, sizeof(owner.macaddr));
|
||||||
|
owner.has_is_unmessagable = true;
|
||||||
|
owner.is_unmessagable = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We reserve a few nodenums for future use
|
// We reserve a few nodenums for future use
|
||||||
@ -1455,6 +1504,26 @@ void NodeDB::updateTelemetry(uint32_t nodeId, const meshtastic_Telemetry &t, RxS
|
|||||||
notifyObservers(true); // Force an update whether or not our node counts have changed
|
notifyObservers(true); // Force an update whether or not our node counts have changed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the node database with a new contact
|
||||||
|
*/
|
||||||
|
void NodeDB::addFromContact(meshtastic_SharedContact contact)
|
||||||
|
{
|
||||||
|
meshtastic_NodeInfoLite *info = getOrCreateMeshNode(contact.node_num);
|
||||||
|
if (!info) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
info->num = contact.node_num;
|
||||||
|
info->last_heard = getValidTime(RTCQualityNTP);
|
||||||
|
info->has_user = true;
|
||||||
|
info->user = TypeConversions::ConvertToUserLite(contact.user);
|
||||||
|
info->is_favorite = true;
|
||||||
|
updateGUIforNode = info;
|
||||||
|
powerFSM.trigger(EVENT_NODEDB_UPDATED);
|
||||||
|
notifyObservers(true); // Force an update whether or not our node counts have changed
|
||||||
|
saveNodeDatabaseToDisk();
|
||||||
|
}
|
||||||
|
|
||||||
/** Update user info and channel for this node based on received user data
|
/** Update user info and channel for this node based on received user data
|
||||||
*/
|
*/
|
||||||
bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelIndex)
|
bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelIndex)
|
||||||
|
@ -110,6 +110,8 @@ class NodeDB
|
|||||||
/// we updateGUI and updateGUIforNode if we think our this change is big enough for a redraw
|
/// we updateGUI and updateGUIforNode if we think our this change is big enough for a redraw
|
||||||
void updateFrom(const meshtastic_MeshPacket &p);
|
void updateFrom(const meshtastic_MeshPacket &p);
|
||||||
|
|
||||||
|
void addFromContact(const meshtastic_SharedContact);
|
||||||
|
|
||||||
/** Update position info for this node based on received position data
|
/** Update position info for this node based on received position data
|
||||||
*/
|
*/
|
||||||
void updatePosition(uint32_t nodeId, const meshtastic_Position &p, RxSource src = RX_SRC_RADIO);
|
void updatePosition(uint32_t nodeId, const meshtastic_Position &p, RxSource src = RX_SRC_RADIO);
|
||||||
|
@ -54,7 +54,13 @@ void PhoneAPI::handleStartConfig()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// even if we were already connected - restart our state machine
|
// even if we were already connected - restart our state machine
|
||||||
|
if (config_nonce == SPECIAL_NONCE_ONLY_NODES) {
|
||||||
|
// If client only wants node info, jump directly to sending nodes
|
||||||
|
state = STATE_SEND_OWN_NODEINFO;
|
||||||
|
LOG_INFO("Client only wants node info, skipping other config");
|
||||||
|
} else {
|
||||||
state = STATE_SEND_MY_INFO;
|
state = STATE_SEND_MY_INFO;
|
||||||
|
}
|
||||||
pauseBluetoothLogging = true;
|
pauseBluetoothLogging = true;
|
||||||
spiLock->lock();
|
spiLock->lock();
|
||||||
filesManifest = getFiles("/", 10);
|
filesManifest = getFiles("/", 10);
|
||||||
@ -224,7 +230,12 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
|
|||||||
// Should allow us to resume sending NodeInfo in STATE_SEND_OTHER_NODEINFOS
|
// Should allow us to resume sending NodeInfo in STATE_SEND_OTHER_NODEINFOS
|
||||||
nodeInfoForPhone.num = 0;
|
nodeInfoForPhone.num = 0;
|
||||||
}
|
}
|
||||||
|
if (config_nonce == SPECIAL_NONCE_ONLY_NODES) {
|
||||||
|
// If client only wants node info, jump directly to sending nodes
|
||||||
|
state = STATE_SEND_OTHER_NODEINFOS;
|
||||||
|
} else {
|
||||||
state = STATE_SEND_METADATA;
|
state = STATE_SEND_METADATA;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -388,8 +399,14 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
|
|||||||
config_state++;
|
config_state++;
|
||||||
// Advance when we have sent all of our ModuleConfig objects
|
// Advance when we have sent all of our ModuleConfig objects
|
||||||
if (config_state > (_meshtastic_AdminMessage_ModuleConfigType_MAX + 1)) {
|
if (config_state > (_meshtastic_AdminMessage_ModuleConfigType_MAX + 1)) {
|
||||||
// Clients sending special nonce don't want to see other nodeinfos
|
// Handle special nonce behaviors:
|
||||||
state = config_nonce == SPECIAL_NONCE ? STATE_SEND_FILEMANIFEST : STATE_SEND_OTHER_NODEINFOS;
|
// - SPECIAL_NONCE_ONLY_CONFIG: Skip node info, go directly to file manifest
|
||||||
|
// - SPECIAL_NONCE_ONLY_NODES: After sending nodes, skip to complete
|
||||||
|
if (config_nonce == SPECIAL_NONCE_ONLY_CONFIG) {
|
||||||
|
state = STATE_SEND_FILEMANIFEST;
|
||||||
|
} else {
|
||||||
|
state = STATE_SEND_OTHER_NODEINFOS;
|
||||||
|
}
|
||||||
config_state = 0;
|
config_state = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -415,7 +432,8 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
|
|||||||
case STATE_SEND_FILEMANIFEST: {
|
case STATE_SEND_FILEMANIFEST: {
|
||||||
LOG_DEBUG("FromRadio=STATE_SEND_FILEMANIFEST");
|
LOG_DEBUG("FromRadio=STATE_SEND_FILEMANIFEST");
|
||||||
// last element
|
// last element
|
||||||
if (config_state == filesManifest.size()) { // also handles an empty filesManifest
|
if (config_state == filesManifest.size() ||
|
||||||
|
config_nonce == SPECIAL_NONCE_ONLY_NODES) { // also handles an empty filesManifest
|
||||||
config_state = 0;
|
config_state = 0;
|
||||||
filesManifest.clear();
|
filesManifest.clear();
|
||||||
// Skip to complete packet
|
// Skip to complete packet
|
||||||
@ -547,9 +565,12 @@ bool PhoneAPI::available()
|
|||||||
auto nextNode = nodeDB->readNextMeshNode(readIndex);
|
auto nextNode = nodeDB->readNextMeshNode(readIndex);
|
||||||
if (nextNode) {
|
if (nextNode) {
|
||||||
nodeInfoForPhone = TypeConversions::ConvertToNodeInfo(nextNode);
|
nodeInfoForPhone = TypeConversions::ConvertToNodeInfo(nextNode);
|
||||||
nodeInfoForPhone.hops_away = nodeInfoForPhone.num == nodeDB->getNodeNum() ? 0 : nodeInfoForPhone.hops_away;
|
bool isUs = nodeInfoForPhone.num == nodeDB->getNodeNum();
|
||||||
nodeInfoForPhone.is_favorite =
|
nodeInfoForPhone.hops_away = isUs ? 0 : nodeInfoForPhone.hops_away;
|
||||||
nodeInfoForPhone.is_favorite || nodeInfoForPhone.num == nodeDB->getNodeNum(); // Our node is always a favorite
|
nodeInfoForPhone.last_heard = isUs ? getValidTime(RTCQualityFromNet) : nodeInfoForPhone.last_heard;
|
||||||
|
nodeInfoForPhone.snr = isUs ? 0 : nodeInfoForPhone.snr;
|
||||||
|
nodeInfoForPhone.via_mqtt = isUs ? false : nodeInfoForPhone.via_mqtt;
|
||||||
|
nodeInfoForPhone.is_favorite = nodeInfoForPhone.is_favorite || isUs; // Our node is always a favorite
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true; // Always say we have something, because we might need to advance our state machine
|
return true; // Always say we have something, because we might need to advance our state machine
|
||||||
|
@ -18,7 +18,8 @@
|
|||||||
#error "meshtastic_ToRadio_size is too large for our BLE packets"
|
#error "meshtastic_ToRadio_size is too large for our BLE packets"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SPECIAL_NONCE 69420
|
#define SPECIAL_NONCE_ONLY_CONFIG 69420
|
||||||
|
#define SPECIAL_NONCE_ONLY_NODES 69421 // ( ͡° ͜ʖ ͡°)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides our protobuf based API which phone/PC clients can use to talk to our device
|
* Provides our protobuf based API which phone/PC clients can use to talk to our device
|
||||||
|
@ -15,6 +15,9 @@ PB_BIND(meshtastic_HamParameters, meshtastic_HamParameters, AUTO)
|
|||||||
PB_BIND(meshtastic_NodeRemoteHardwarePinsResponse, meshtastic_NodeRemoteHardwarePinsResponse, 2)
|
PB_BIND(meshtastic_NodeRemoteHardwarePinsResponse, meshtastic_NodeRemoteHardwarePinsResponse, 2)
|
||||||
|
|
||||||
|
|
||||||
|
PB_BIND(meshtastic_SharedContact, meshtastic_SharedContact, AUTO)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,6 +99,14 @@ typedef struct _meshtastic_NodeRemoteHardwarePinsResponse {
|
|||||||
meshtastic_NodeRemoteHardwarePin node_remote_hardware_pins[16];
|
meshtastic_NodeRemoteHardwarePin node_remote_hardware_pins[16];
|
||||||
} meshtastic_NodeRemoteHardwarePinsResponse;
|
} meshtastic_NodeRemoteHardwarePinsResponse;
|
||||||
|
|
||||||
|
typedef struct _meshtastic_SharedContact {
|
||||||
|
/* The node number of the contact */
|
||||||
|
uint32_t node_num;
|
||||||
|
/* The User of the contact */
|
||||||
|
bool has_user;
|
||||||
|
meshtastic_User user;
|
||||||
|
} meshtastic_SharedContact;
|
||||||
|
|
||||||
typedef PB_BYTES_ARRAY_T(8) meshtastic_AdminMessage_session_passkey_t;
|
typedef PB_BYTES_ARRAY_T(8) meshtastic_AdminMessage_session_passkey_t;
|
||||||
/* This message is handled by the Admin module and is responsible for all settings/channel read/write operations.
|
/* This message is handled by the Admin module and is responsible for all settings/channel read/write operations.
|
||||||
This message is used to do settings operations to both remote AND local nodes.
|
This message is used to do settings operations to both remote AND local nodes.
|
||||||
@ -202,6 +210,8 @@ typedef struct _meshtastic_AdminMessage {
|
|||||||
bool begin_edit_settings;
|
bool begin_edit_settings;
|
||||||
/* Commits an open transaction for any edits made to config, module config, owner, and channel settings */
|
/* Commits an open transaction for any edits made to config, module config, owner, and channel settings */
|
||||||
bool commit_edit_settings;
|
bool commit_edit_settings;
|
||||||
|
/* Add a contact (User) to the nodedb */
|
||||||
|
meshtastic_SharedContact add_contact;
|
||||||
/* Tell the node to factory reset config everything; all device state and configuration will be returned to factory defaults and BLE bonds will be cleared. */
|
/* Tell the node to factory reset config everything; all device state and configuration will be returned to factory defaults and BLE bonds will be cleared. */
|
||||||
int32_t factory_reset_device;
|
int32_t factory_reset_device;
|
||||||
/* Tell the node to reboot into the OTA Firmware in this many seconds (or <0 to cancel reboot)
|
/* Tell the node to reboot into the OTA Firmware in this many seconds (or <0 to cancel reboot)
|
||||||
@ -252,13 +262,16 @@ extern "C" {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Initializer values for message structs */
|
/* Initializer values for message structs */
|
||||||
#define meshtastic_AdminMessage_init_default {0, {0}, {0, {0}}}
|
#define meshtastic_AdminMessage_init_default {0, {0}, {0, {0}}}
|
||||||
#define meshtastic_HamParameters_init_default {"", 0, 0, ""}
|
#define meshtastic_HamParameters_init_default {"", 0, 0, ""}
|
||||||
#define meshtastic_NodeRemoteHardwarePinsResponse_init_default {0, {meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default}}
|
#define meshtastic_NodeRemoteHardwarePinsResponse_init_default {0, {meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default}}
|
||||||
|
#define meshtastic_SharedContact_init_default {0, false, meshtastic_User_init_default}
|
||||||
#define meshtastic_AdminMessage_init_zero {0, {0}, {0, {0}}}
|
#define meshtastic_AdminMessage_init_zero {0, {0}, {0, {0}}}
|
||||||
#define meshtastic_HamParameters_init_zero {"", 0, 0, ""}
|
#define meshtastic_HamParameters_init_zero {"", 0, 0, ""}
|
||||||
#define meshtastic_NodeRemoteHardwarePinsResponse_init_zero {0, {meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero}}
|
#define meshtastic_NodeRemoteHardwarePinsResponse_init_zero {0, {meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero}}
|
||||||
|
#define meshtastic_SharedContact_init_zero {0, false, meshtastic_User_init_zero}
|
||||||
|
|
||||||
/* Field tags (for use in manual encoding/decoding) */
|
/* Field tags (for use in manual encoding/decoding) */
|
||||||
#define meshtastic_HamParameters_call_sign_tag 1
|
#define meshtastic_HamParameters_call_sign_tag 1
|
||||||
@ -266,6 +279,8 @@ extern "C" {
|
|||||||
#define meshtastic_HamParameters_frequency_tag 3
|
#define meshtastic_HamParameters_frequency_tag 3
|
||||||
#define meshtastic_HamParameters_short_name_tag 4
|
#define meshtastic_HamParameters_short_name_tag 4
|
||||||
#define meshtastic_NodeRemoteHardwarePinsResponse_node_remote_hardware_pins_tag 1
|
#define meshtastic_NodeRemoteHardwarePinsResponse_node_remote_hardware_pins_tag 1
|
||||||
|
#define meshtastic_SharedContact_node_num_tag 1
|
||||||
|
#define meshtastic_SharedContact_user_tag 2
|
||||||
#define meshtastic_AdminMessage_get_channel_request_tag 1
|
#define meshtastic_AdminMessage_get_channel_request_tag 1
|
||||||
#define meshtastic_AdminMessage_get_channel_response_tag 2
|
#define meshtastic_AdminMessage_get_channel_response_tag 2
|
||||||
#define meshtastic_AdminMessage_get_owner_request_tag 3
|
#define meshtastic_AdminMessage_get_owner_request_tag 3
|
||||||
@ -310,6 +325,7 @@ extern "C" {
|
|||||||
#define meshtastic_AdminMessage_remove_ignored_node_tag 48
|
#define meshtastic_AdminMessage_remove_ignored_node_tag 48
|
||||||
#define meshtastic_AdminMessage_begin_edit_settings_tag 64
|
#define meshtastic_AdminMessage_begin_edit_settings_tag 64
|
||||||
#define meshtastic_AdminMessage_commit_edit_settings_tag 65
|
#define meshtastic_AdminMessage_commit_edit_settings_tag 65
|
||||||
|
#define meshtastic_AdminMessage_add_contact_tag 66
|
||||||
#define meshtastic_AdminMessage_factory_reset_device_tag 94
|
#define meshtastic_AdminMessage_factory_reset_device_tag 94
|
||||||
#define meshtastic_AdminMessage_reboot_ota_seconds_tag 95
|
#define meshtastic_AdminMessage_reboot_ota_seconds_tag 95
|
||||||
#define meshtastic_AdminMessage_exit_simulator_tag 96
|
#define meshtastic_AdminMessage_exit_simulator_tag 96
|
||||||
@ -365,6 +381,7 @@ X(a, STATIC, ONEOF, UINT32, (payload_variant,set_ignored_node,set_ignored
|
|||||||
X(a, STATIC, ONEOF, UINT32, (payload_variant,remove_ignored_node,remove_ignored_node), 48) \
|
X(a, STATIC, ONEOF, UINT32, (payload_variant,remove_ignored_node,remove_ignored_node), 48) \
|
||||||
X(a, STATIC, ONEOF, BOOL, (payload_variant,begin_edit_settings,begin_edit_settings), 64) \
|
X(a, STATIC, ONEOF, BOOL, (payload_variant,begin_edit_settings,begin_edit_settings), 64) \
|
||||||
X(a, STATIC, ONEOF, BOOL, (payload_variant,commit_edit_settings,commit_edit_settings), 65) \
|
X(a, STATIC, ONEOF, BOOL, (payload_variant,commit_edit_settings,commit_edit_settings), 65) \
|
||||||
|
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,add_contact,add_contact), 66) \
|
||||||
X(a, STATIC, ONEOF, INT32, (payload_variant,factory_reset_device,factory_reset_device), 94) \
|
X(a, STATIC, ONEOF, INT32, (payload_variant,factory_reset_device,factory_reset_device), 94) \
|
||||||
X(a, STATIC, ONEOF, INT32, (payload_variant,reboot_ota_seconds,reboot_ota_seconds), 95) \
|
X(a, STATIC, ONEOF, INT32, (payload_variant,reboot_ota_seconds,reboot_ota_seconds), 95) \
|
||||||
X(a, STATIC, ONEOF, BOOL, (payload_variant,exit_simulator,exit_simulator), 96) \
|
X(a, STATIC, ONEOF, BOOL, (payload_variant,exit_simulator,exit_simulator), 96) \
|
||||||
@ -390,6 +407,7 @@ X(a, STATIC, SINGULAR, BYTES, session_passkey, 101)
|
|||||||
#define meshtastic_AdminMessage_payload_variant_set_fixed_position_MSGTYPE meshtastic_Position
|
#define meshtastic_AdminMessage_payload_variant_set_fixed_position_MSGTYPE meshtastic_Position
|
||||||
#define meshtastic_AdminMessage_payload_variant_get_ui_config_response_MSGTYPE meshtastic_DeviceUIConfig
|
#define meshtastic_AdminMessage_payload_variant_get_ui_config_response_MSGTYPE meshtastic_DeviceUIConfig
|
||||||
#define meshtastic_AdminMessage_payload_variant_store_ui_config_MSGTYPE meshtastic_DeviceUIConfig
|
#define meshtastic_AdminMessage_payload_variant_store_ui_config_MSGTYPE meshtastic_DeviceUIConfig
|
||||||
|
#define meshtastic_AdminMessage_payload_variant_add_contact_MSGTYPE meshtastic_SharedContact
|
||||||
|
|
||||||
#define meshtastic_HamParameters_FIELDLIST(X, a) \
|
#define meshtastic_HamParameters_FIELDLIST(X, a) \
|
||||||
X(a, STATIC, SINGULAR, STRING, call_sign, 1) \
|
X(a, STATIC, SINGULAR, STRING, call_sign, 1) \
|
||||||
@ -405,20 +423,30 @@ X(a, STATIC, REPEATED, MESSAGE, node_remote_hardware_pins, 1)
|
|||||||
#define meshtastic_NodeRemoteHardwarePinsResponse_DEFAULT NULL
|
#define meshtastic_NodeRemoteHardwarePinsResponse_DEFAULT NULL
|
||||||
#define meshtastic_NodeRemoteHardwarePinsResponse_node_remote_hardware_pins_MSGTYPE meshtastic_NodeRemoteHardwarePin
|
#define meshtastic_NodeRemoteHardwarePinsResponse_node_remote_hardware_pins_MSGTYPE meshtastic_NodeRemoteHardwarePin
|
||||||
|
|
||||||
|
#define meshtastic_SharedContact_FIELDLIST(X, a) \
|
||||||
|
X(a, STATIC, SINGULAR, UINT32, node_num, 1) \
|
||||||
|
X(a, STATIC, OPTIONAL, MESSAGE, user, 2)
|
||||||
|
#define meshtastic_SharedContact_CALLBACK NULL
|
||||||
|
#define meshtastic_SharedContact_DEFAULT NULL
|
||||||
|
#define meshtastic_SharedContact_user_MSGTYPE meshtastic_User
|
||||||
|
|
||||||
extern const pb_msgdesc_t meshtastic_AdminMessage_msg;
|
extern const pb_msgdesc_t meshtastic_AdminMessage_msg;
|
||||||
extern const pb_msgdesc_t meshtastic_HamParameters_msg;
|
extern const pb_msgdesc_t meshtastic_HamParameters_msg;
|
||||||
extern const pb_msgdesc_t meshtastic_NodeRemoteHardwarePinsResponse_msg;
|
extern const pb_msgdesc_t meshtastic_NodeRemoteHardwarePinsResponse_msg;
|
||||||
|
extern const pb_msgdesc_t meshtastic_SharedContact_msg;
|
||||||
|
|
||||||
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
|
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
|
||||||
#define meshtastic_AdminMessage_fields &meshtastic_AdminMessage_msg
|
#define meshtastic_AdminMessage_fields &meshtastic_AdminMessage_msg
|
||||||
#define meshtastic_HamParameters_fields &meshtastic_HamParameters_msg
|
#define meshtastic_HamParameters_fields &meshtastic_HamParameters_msg
|
||||||
#define meshtastic_NodeRemoteHardwarePinsResponse_fields &meshtastic_NodeRemoteHardwarePinsResponse_msg
|
#define meshtastic_NodeRemoteHardwarePinsResponse_fields &meshtastic_NodeRemoteHardwarePinsResponse_msg
|
||||||
|
#define meshtastic_SharedContact_fields &meshtastic_SharedContact_msg
|
||||||
|
|
||||||
/* Maximum encoded size of messages (where known) */
|
/* Maximum encoded size of messages (where known) */
|
||||||
#define MESHTASTIC_MESHTASTIC_ADMIN_PB_H_MAX_SIZE meshtastic_AdminMessage_size
|
#define MESHTASTIC_MESHTASTIC_ADMIN_PB_H_MAX_SIZE meshtastic_AdminMessage_size
|
||||||
#define meshtastic_AdminMessage_size 511
|
#define meshtastic_AdminMessage_size 511
|
||||||
#define meshtastic_HamParameters_size 31
|
#define meshtastic_HamParameters_size 31
|
||||||
#define meshtastic_NodeRemoteHardwarePinsResponse_size 496
|
#define meshtastic_NodeRemoteHardwarePinsResponse_size 496
|
||||||
|
#define meshtastic_SharedContact_size 123
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
|
@ -58,6 +58,9 @@ typedef struct _meshtastic_UserLite {
|
|||||||
/* The public key of the user's device.
|
/* The public key of the user's device.
|
||||||
This is sent out to other nodes on the mesh to allow them to compute a shared secret key. */
|
This is sent out to other nodes on the mesh to allow them to compute a shared secret key. */
|
||||||
meshtastic_UserLite_public_key_t public_key;
|
meshtastic_UserLite_public_key_t public_key;
|
||||||
|
/* Whether or not the node can be messaged */
|
||||||
|
bool has_is_unmessagable;
|
||||||
|
bool is_unmessagable;
|
||||||
} meshtastic_UserLite;
|
} meshtastic_UserLite;
|
||||||
|
|
||||||
typedef struct _meshtastic_NodeInfoLite {
|
typedef struct _meshtastic_NodeInfoLite {
|
||||||
@ -183,14 +186,14 @@ extern "C" {
|
|||||||
|
|
||||||
/* Initializer values for message structs */
|
/* Initializer values for message structs */
|
||||||
#define meshtastic_PositionLite_init_default {0, 0, 0, 0, _meshtastic_Position_LocSource_MIN}
|
#define meshtastic_PositionLite_init_default {0, 0, 0, 0, _meshtastic_Position_LocSource_MIN}
|
||||||
#define meshtastic_UserLite_init_default {{0}, "", "", _meshtastic_HardwareModel_MIN, 0, _meshtastic_Config_DeviceConfig_Role_MIN, {0, {0}}}
|
#define meshtastic_UserLite_init_default {{0}, "", "", _meshtastic_HardwareModel_MIN, 0, _meshtastic_Config_DeviceConfig_Role_MIN, {0, {0}}, false, 0}
|
||||||
#define meshtastic_NodeInfoLite_init_default {0, false, meshtastic_UserLite_init_default, false, meshtastic_PositionLite_init_default, 0, 0, false, meshtastic_DeviceMetrics_init_default, 0, 0, false, 0, 0, 0, 0}
|
#define meshtastic_NodeInfoLite_init_default {0, false, meshtastic_UserLite_init_default, false, meshtastic_PositionLite_init_default, 0, 0, false, meshtastic_DeviceMetrics_init_default, 0, 0, false, 0, 0, 0, 0}
|
||||||
#define meshtastic_DeviceState_init_default {false, meshtastic_MyNodeInfo_init_default, false, meshtastic_User_init_default, 0, {meshtastic_MeshPacket_init_default}, false, meshtastic_MeshPacket_init_default, 0, 0, 0, false, meshtastic_MeshPacket_init_default, 0, {meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default}}
|
#define meshtastic_DeviceState_init_default {false, meshtastic_MyNodeInfo_init_default, false, meshtastic_User_init_default, 0, {meshtastic_MeshPacket_init_default}, false, meshtastic_MeshPacket_init_default, 0, 0, 0, false, meshtastic_MeshPacket_init_default, 0, {meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default}}
|
||||||
#define meshtastic_NodeDatabase_init_default {0, {0}}
|
#define meshtastic_NodeDatabase_init_default {0, {0}}
|
||||||
#define meshtastic_ChannelFile_init_default {0, {meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default}, 0}
|
#define meshtastic_ChannelFile_init_default {0, {meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default}, 0}
|
||||||
#define meshtastic_BackupPreferences_init_default {0, 0, false, meshtastic_LocalConfig_init_default, false, meshtastic_LocalModuleConfig_init_default, false, meshtastic_ChannelFile_init_default, false, meshtastic_User_init_default}
|
#define meshtastic_BackupPreferences_init_default {0, 0, false, meshtastic_LocalConfig_init_default, false, meshtastic_LocalModuleConfig_init_default, false, meshtastic_ChannelFile_init_default, false, meshtastic_User_init_default}
|
||||||
#define meshtastic_PositionLite_init_zero {0, 0, 0, 0, _meshtastic_Position_LocSource_MIN}
|
#define meshtastic_PositionLite_init_zero {0, 0, 0, 0, _meshtastic_Position_LocSource_MIN}
|
||||||
#define meshtastic_UserLite_init_zero {{0}, "", "", _meshtastic_HardwareModel_MIN, 0, _meshtastic_Config_DeviceConfig_Role_MIN, {0, {0}}}
|
#define meshtastic_UserLite_init_zero {{0}, "", "", _meshtastic_HardwareModel_MIN, 0, _meshtastic_Config_DeviceConfig_Role_MIN, {0, {0}}, false, 0}
|
||||||
#define meshtastic_NodeInfoLite_init_zero {0, false, meshtastic_UserLite_init_zero, false, meshtastic_PositionLite_init_zero, 0, 0, false, meshtastic_DeviceMetrics_init_zero, 0, 0, false, 0, 0, 0, 0}
|
#define meshtastic_NodeInfoLite_init_zero {0, false, meshtastic_UserLite_init_zero, false, meshtastic_PositionLite_init_zero, 0, 0, false, meshtastic_DeviceMetrics_init_zero, 0, 0, false, 0, 0, 0, 0}
|
||||||
#define meshtastic_DeviceState_init_zero {false, meshtastic_MyNodeInfo_init_zero, false, meshtastic_User_init_zero, 0, {meshtastic_MeshPacket_init_zero}, false, meshtastic_MeshPacket_init_zero, 0, 0, 0, false, meshtastic_MeshPacket_init_zero, 0, {meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero}}
|
#define meshtastic_DeviceState_init_zero {false, meshtastic_MyNodeInfo_init_zero, false, meshtastic_User_init_zero, 0, {meshtastic_MeshPacket_init_zero}, false, meshtastic_MeshPacket_init_zero, 0, 0, 0, false, meshtastic_MeshPacket_init_zero, 0, {meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero}}
|
||||||
#define meshtastic_NodeDatabase_init_zero {0, {0}}
|
#define meshtastic_NodeDatabase_init_zero {0, {0}}
|
||||||
@ -210,6 +213,7 @@ extern "C" {
|
|||||||
#define meshtastic_UserLite_is_licensed_tag 5
|
#define meshtastic_UserLite_is_licensed_tag 5
|
||||||
#define meshtastic_UserLite_role_tag 6
|
#define meshtastic_UserLite_role_tag 6
|
||||||
#define meshtastic_UserLite_public_key_tag 7
|
#define meshtastic_UserLite_public_key_tag 7
|
||||||
|
#define meshtastic_UserLite_is_unmessagable_tag 9
|
||||||
#define meshtastic_NodeInfoLite_num_tag 1
|
#define meshtastic_NodeInfoLite_num_tag 1
|
||||||
#define meshtastic_NodeInfoLite_user_tag 2
|
#define meshtastic_NodeInfoLite_user_tag 2
|
||||||
#define meshtastic_NodeInfoLite_position_tag 3
|
#define meshtastic_NodeInfoLite_position_tag 3
|
||||||
@ -259,7 +263,8 @@ X(a, STATIC, SINGULAR, STRING, short_name, 3) \
|
|||||||
X(a, STATIC, SINGULAR, UENUM, hw_model, 4) \
|
X(a, STATIC, SINGULAR, UENUM, hw_model, 4) \
|
||||||
X(a, STATIC, SINGULAR, BOOL, is_licensed, 5) \
|
X(a, STATIC, SINGULAR, BOOL, is_licensed, 5) \
|
||||||
X(a, STATIC, SINGULAR, UENUM, role, 6) \
|
X(a, STATIC, SINGULAR, UENUM, role, 6) \
|
||||||
X(a, STATIC, SINGULAR, BYTES, public_key, 7)
|
X(a, STATIC, SINGULAR, BYTES, public_key, 7) \
|
||||||
|
X(a, STATIC, OPTIONAL, BOOL, is_unmessagable, 9)
|
||||||
#define meshtastic_UserLite_CALLBACK NULL
|
#define meshtastic_UserLite_CALLBACK NULL
|
||||||
#define meshtastic_UserLite_DEFAULT NULL
|
#define meshtastic_UserLite_DEFAULT NULL
|
||||||
|
|
||||||
@ -350,12 +355,12 @@ extern const pb_msgdesc_t meshtastic_BackupPreferences_msg;
|
|||||||
/* Maximum encoded size of messages (where known) */
|
/* Maximum encoded size of messages (where known) */
|
||||||
/* meshtastic_NodeDatabase_size depends on runtime parameters */
|
/* meshtastic_NodeDatabase_size depends on runtime parameters */
|
||||||
#define MESHTASTIC_MESHTASTIC_DEVICEONLY_PB_H_MAX_SIZE meshtastic_BackupPreferences_size
|
#define MESHTASTIC_MESHTASTIC_DEVICEONLY_PB_H_MAX_SIZE meshtastic_BackupPreferences_size
|
||||||
#define meshtastic_BackupPreferences_size 2263
|
#define meshtastic_BackupPreferences_size 2267
|
||||||
#define meshtastic_ChannelFile_size 718
|
#define meshtastic_ChannelFile_size 718
|
||||||
#define meshtastic_DeviceState_size 1720
|
#define meshtastic_DeviceState_size 1722
|
||||||
#define meshtastic_NodeInfoLite_size 188
|
#define meshtastic_NodeInfoLite_size 190
|
||||||
#define meshtastic_PositionLite_size 28
|
#define meshtastic_PositionLite_size 28
|
||||||
#define meshtastic_UserLite_size 96
|
#define meshtastic_UserLite_size 98
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
|
@ -188,7 +188,7 @@ extern const pb_msgdesc_t meshtastic_LocalModuleConfig_msg;
|
|||||||
/* Maximum encoded size of messages (where known) */
|
/* Maximum encoded size of messages (where known) */
|
||||||
#define MESHTASTIC_MESHTASTIC_LOCALONLY_PB_H_MAX_SIZE meshtastic_LocalConfig_size
|
#define MESHTASTIC_MESHTASTIC_LOCALONLY_PB_H_MAX_SIZE meshtastic_LocalConfig_size
|
||||||
#define meshtastic_LocalConfig_size 743
|
#define meshtastic_LocalConfig_size 743
|
||||||
#define meshtastic_LocalModuleConfig_size 667
|
#define meshtastic_LocalModuleConfig_size 669
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
|
@ -609,6 +609,9 @@ typedef struct _meshtastic_User {
|
|||||||
/* The public key of the user's device.
|
/* The public key of the user's device.
|
||||||
This is sent out to other nodes on the mesh to allow them to compute a shared secret key. */
|
This is sent out to other nodes on the mesh to allow them to compute a shared secret key. */
|
||||||
meshtastic_User_public_key_t public_key;
|
meshtastic_User_public_key_t public_key;
|
||||||
|
/* Whether or not the node can be messaged */
|
||||||
|
bool has_is_unmessagable;
|
||||||
|
bool is_unmessagable;
|
||||||
} meshtastic_User;
|
} meshtastic_User;
|
||||||
|
|
||||||
/* A message used in a traceroute */
|
/* A message used in a traceroute */
|
||||||
@ -1204,7 +1207,7 @@ extern "C" {
|
|||||||
|
|
||||||
/* Initializer values for message structs */
|
/* Initializer values for message structs */
|
||||||
#define meshtastic_Position_init_default {false, 0, false, 0, false, 0, 0, _meshtastic_Position_LocSource_MIN, _meshtastic_Position_AltSource_MIN, 0, 0, false, 0, false, 0, 0, 0, 0, 0, false, 0, false, 0, 0, 0, 0, 0, 0, 0, 0}
|
#define meshtastic_Position_init_default {false, 0, false, 0, false, 0, 0, _meshtastic_Position_LocSource_MIN, _meshtastic_Position_AltSource_MIN, 0, 0, false, 0, false, 0, 0, 0, 0, 0, false, 0, false, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||||
#define meshtastic_User_init_default {"", "", "", {0}, _meshtastic_HardwareModel_MIN, 0, _meshtastic_Config_DeviceConfig_Role_MIN, {0, {0}}}
|
#define meshtastic_User_init_default {"", "", "", {0}, _meshtastic_HardwareModel_MIN, 0, _meshtastic_Config_DeviceConfig_Role_MIN, {0, {0}}, false, 0}
|
||||||
#define meshtastic_RouteDiscovery_init_default {0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}}
|
#define meshtastic_RouteDiscovery_init_default {0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}}
|
||||||
#define meshtastic_Routing_init_default {0, {meshtastic_RouteDiscovery_init_default}}
|
#define meshtastic_Routing_init_default {0, {meshtastic_RouteDiscovery_init_default}}
|
||||||
#define meshtastic_Data_init_default {_meshtastic_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0, false, 0}
|
#define meshtastic_Data_init_default {_meshtastic_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0, false, 0}
|
||||||
@ -1229,7 +1232,7 @@ extern "C" {
|
|||||||
#define meshtastic_resend_chunks_init_default {{{NULL}, NULL}}
|
#define meshtastic_resend_chunks_init_default {{{NULL}, NULL}}
|
||||||
#define meshtastic_ChunkedPayloadResponse_init_default {0, 0, {0}}
|
#define meshtastic_ChunkedPayloadResponse_init_default {0, 0, {0}}
|
||||||
#define meshtastic_Position_init_zero {false, 0, false, 0, false, 0, 0, _meshtastic_Position_LocSource_MIN, _meshtastic_Position_AltSource_MIN, 0, 0, false, 0, false, 0, 0, 0, 0, 0, false, 0, false, 0, 0, 0, 0, 0, 0, 0, 0}
|
#define meshtastic_Position_init_zero {false, 0, false, 0, false, 0, 0, _meshtastic_Position_LocSource_MIN, _meshtastic_Position_AltSource_MIN, 0, 0, false, 0, false, 0, 0, 0, 0, 0, false, 0, false, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||||
#define meshtastic_User_init_zero {"", "", "", {0}, _meshtastic_HardwareModel_MIN, 0, _meshtastic_Config_DeviceConfig_Role_MIN, {0, {0}}}
|
#define meshtastic_User_init_zero {"", "", "", {0}, _meshtastic_HardwareModel_MIN, 0, _meshtastic_Config_DeviceConfig_Role_MIN, {0, {0}}, false, 0}
|
||||||
#define meshtastic_RouteDiscovery_init_zero {0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}}
|
#define meshtastic_RouteDiscovery_init_zero {0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}}
|
||||||
#define meshtastic_Routing_init_zero {0, {meshtastic_RouteDiscovery_init_zero}}
|
#define meshtastic_Routing_init_zero {0, {meshtastic_RouteDiscovery_init_zero}}
|
||||||
#define meshtastic_Data_init_zero {_meshtastic_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0, false, 0}
|
#define meshtastic_Data_init_zero {_meshtastic_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0, false, 0}
|
||||||
@ -1286,6 +1289,7 @@ extern "C" {
|
|||||||
#define meshtastic_User_is_licensed_tag 6
|
#define meshtastic_User_is_licensed_tag 6
|
||||||
#define meshtastic_User_role_tag 7
|
#define meshtastic_User_role_tag 7
|
||||||
#define meshtastic_User_public_key_tag 8
|
#define meshtastic_User_public_key_tag 8
|
||||||
|
#define meshtastic_User_is_unmessagable_tag 9
|
||||||
#define meshtastic_RouteDiscovery_route_tag 1
|
#define meshtastic_RouteDiscovery_route_tag 1
|
||||||
#define meshtastic_RouteDiscovery_snr_towards_tag 2
|
#define meshtastic_RouteDiscovery_snr_towards_tag 2
|
||||||
#define meshtastic_RouteDiscovery_route_back_tag 3
|
#define meshtastic_RouteDiscovery_route_back_tag 3
|
||||||
@ -1457,7 +1461,8 @@ X(a, STATIC, SINGULAR, FIXED_LENGTH_BYTES, macaddr, 4) \
|
|||||||
X(a, STATIC, SINGULAR, UENUM, hw_model, 5) \
|
X(a, STATIC, SINGULAR, UENUM, hw_model, 5) \
|
||||||
X(a, STATIC, SINGULAR, BOOL, is_licensed, 6) \
|
X(a, STATIC, SINGULAR, BOOL, is_licensed, 6) \
|
||||||
X(a, STATIC, SINGULAR, UENUM, role, 7) \
|
X(a, STATIC, SINGULAR, UENUM, role, 7) \
|
||||||
X(a, STATIC, SINGULAR, BYTES, public_key, 8)
|
X(a, STATIC, SINGULAR, BYTES, public_key, 8) \
|
||||||
|
X(a, STATIC, OPTIONAL, BOOL, is_unmessagable, 9)
|
||||||
#define meshtastic_User_CALLBACK NULL
|
#define meshtastic_User_CALLBACK NULL
|
||||||
#define meshtastic_User_DEFAULT NULL
|
#define meshtastic_User_DEFAULT NULL
|
||||||
|
|
||||||
@ -1786,14 +1791,14 @@ extern const pb_msgdesc_t meshtastic_ChunkedPayloadResponse_msg;
|
|||||||
#define meshtastic_MyNodeInfo_size 77
|
#define meshtastic_MyNodeInfo_size 77
|
||||||
#define meshtastic_NeighborInfo_size 258
|
#define meshtastic_NeighborInfo_size 258
|
||||||
#define meshtastic_Neighbor_size 22
|
#define meshtastic_Neighbor_size 22
|
||||||
#define meshtastic_NodeInfo_size 319
|
#define meshtastic_NodeInfo_size 321
|
||||||
#define meshtastic_NodeRemoteHardwarePin_size 29
|
#define meshtastic_NodeRemoteHardwarePin_size 29
|
||||||
#define meshtastic_Position_size 144
|
#define meshtastic_Position_size 144
|
||||||
#define meshtastic_QueueStatus_size 23
|
#define meshtastic_QueueStatus_size 23
|
||||||
#define meshtastic_RouteDiscovery_size 256
|
#define meshtastic_RouteDiscovery_size 256
|
||||||
#define meshtastic_Routing_size 259
|
#define meshtastic_Routing_size 259
|
||||||
#define meshtastic_ToRadio_size 504
|
#define meshtastic_ToRadio_size 504
|
||||||
#define meshtastic_User_size 113
|
#define meshtastic_User_size 115
|
||||||
#define meshtastic_Waypoint_size 165
|
#define meshtastic_Waypoint_size 165
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -79,7 +79,10 @@ typedef enum _meshtastic_ModuleConfig_SerialConfig_Serial_Mode {
|
|||||||
/* NMEA messages specifically tailored for CalTopo */
|
/* NMEA messages specifically tailored for CalTopo */
|
||||||
meshtastic_ModuleConfig_SerialConfig_Serial_Mode_CALTOPO = 5,
|
meshtastic_ModuleConfig_SerialConfig_Serial_Mode_CALTOPO = 5,
|
||||||
/* Ecowitt WS85 weather station */
|
/* Ecowitt WS85 weather station */
|
||||||
meshtastic_ModuleConfig_SerialConfig_Serial_Mode_WS85 = 6
|
meshtastic_ModuleConfig_SerialConfig_Serial_Mode_WS85 = 6,
|
||||||
|
/* VE.Direct is a serial protocol used by Victron Energy products
|
||||||
|
https://beta.ivc.no/wiki/index.php/Victron_VE_Direct_DIY_Cable */
|
||||||
|
meshtastic_ModuleConfig_SerialConfig_Serial_Mode_VE_DIRECT = 7
|
||||||
} meshtastic_ModuleConfig_SerialConfig_Serial_Mode;
|
} meshtastic_ModuleConfig_SerialConfig_Serial_Mode;
|
||||||
|
|
||||||
/* TODO: REPLACE */
|
/* TODO: REPLACE */
|
||||||
@ -109,6 +112,8 @@ typedef struct _meshtastic_ModuleConfig_MapReportSettings {
|
|||||||
uint32_t publish_interval_secs;
|
uint32_t publish_interval_secs;
|
||||||
/* Bits of precision for the location sent (default of 32 is full precision). */
|
/* Bits of precision for the location sent (default of 32 is full precision). */
|
||||||
uint32_t position_precision;
|
uint32_t position_precision;
|
||||||
|
/* Whether we have opted-in to report our location to the map */
|
||||||
|
bool should_report_location;
|
||||||
} meshtastic_ModuleConfig_MapReportSettings;
|
} meshtastic_ModuleConfig_MapReportSettings;
|
||||||
|
|
||||||
/* MQTT Client Config */
|
/* MQTT Client Config */
|
||||||
@ -467,8 +472,8 @@ extern "C" {
|
|||||||
#define _meshtastic_ModuleConfig_SerialConfig_Serial_Baud_ARRAYSIZE ((meshtastic_ModuleConfig_SerialConfig_Serial_Baud)(meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_921600+1))
|
#define _meshtastic_ModuleConfig_SerialConfig_Serial_Baud_ARRAYSIZE ((meshtastic_ModuleConfig_SerialConfig_Serial_Baud)(meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_921600+1))
|
||||||
|
|
||||||
#define _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MIN meshtastic_ModuleConfig_SerialConfig_Serial_Mode_DEFAULT
|
#define _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MIN meshtastic_ModuleConfig_SerialConfig_Serial_Mode_DEFAULT
|
||||||
#define _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MAX meshtastic_ModuleConfig_SerialConfig_Serial_Mode_WS85
|
#define _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MAX meshtastic_ModuleConfig_SerialConfig_Serial_Mode_VE_DIRECT
|
||||||
#define _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_ARRAYSIZE ((meshtastic_ModuleConfig_SerialConfig_Serial_Mode)(meshtastic_ModuleConfig_SerialConfig_Serial_Mode_WS85+1))
|
#define _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_ARRAYSIZE ((meshtastic_ModuleConfig_SerialConfig_Serial_Mode)(meshtastic_ModuleConfig_SerialConfig_Serial_Mode_VE_DIRECT+1))
|
||||||
|
|
||||||
#define _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE
|
#define _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE
|
||||||
#define _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MAX meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_BACK
|
#define _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MAX meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_BACK
|
||||||
@ -502,7 +507,7 @@ extern "C" {
|
|||||||
/* Initializer values for message structs */
|
/* Initializer values for message structs */
|
||||||
#define meshtastic_ModuleConfig_init_default {0, {meshtastic_ModuleConfig_MQTTConfig_init_default}}
|
#define meshtastic_ModuleConfig_init_default {0, {meshtastic_ModuleConfig_MQTTConfig_init_default}}
|
||||||
#define meshtastic_ModuleConfig_MQTTConfig_init_default {0, "", "", "", 0, 0, 0, "", 0, 0, false, meshtastic_ModuleConfig_MapReportSettings_init_default}
|
#define meshtastic_ModuleConfig_MQTTConfig_init_default {0, "", "", "", 0, 0, 0, "", 0, 0, false, meshtastic_ModuleConfig_MapReportSettings_init_default}
|
||||||
#define meshtastic_ModuleConfig_MapReportSettings_init_default {0, 0}
|
#define meshtastic_ModuleConfig_MapReportSettings_init_default {0, 0, 0}
|
||||||
#define meshtastic_ModuleConfig_RemoteHardwareConfig_init_default {0, 0, 0, {meshtastic_RemoteHardwarePin_init_default, meshtastic_RemoteHardwarePin_init_default, meshtastic_RemoteHardwarePin_init_default, meshtastic_RemoteHardwarePin_init_default}}
|
#define meshtastic_ModuleConfig_RemoteHardwareConfig_init_default {0, 0, 0, {meshtastic_RemoteHardwarePin_init_default, meshtastic_RemoteHardwarePin_init_default, meshtastic_RemoteHardwarePin_init_default, meshtastic_RemoteHardwarePin_init_default}}
|
||||||
#define meshtastic_ModuleConfig_NeighborInfoConfig_init_default {0, 0, 0}
|
#define meshtastic_ModuleConfig_NeighborInfoConfig_init_default {0, 0, 0}
|
||||||
#define meshtastic_ModuleConfig_DetectionSensorConfig_init_default {0, 0, 0, 0, "", 0, _meshtastic_ModuleConfig_DetectionSensorConfig_TriggerType_MIN, 0}
|
#define meshtastic_ModuleConfig_DetectionSensorConfig_init_default {0, 0, 0, 0, "", 0, _meshtastic_ModuleConfig_DetectionSensorConfig_TriggerType_MIN, 0}
|
||||||
@ -518,7 +523,7 @@ extern "C" {
|
|||||||
#define meshtastic_RemoteHardwarePin_init_default {0, "", _meshtastic_RemoteHardwarePinType_MIN}
|
#define meshtastic_RemoteHardwarePin_init_default {0, "", _meshtastic_RemoteHardwarePinType_MIN}
|
||||||
#define meshtastic_ModuleConfig_init_zero {0, {meshtastic_ModuleConfig_MQTTConfig_init_zero}}
|
#define meshtastic_ModuleConfig_init_zero {0, {meshtastic_ModuleConfig_MQTTConfig_init_zero}}
|
||||||
#define meshtastic_ModuleConfig_MQTTConfig_init_zero {0, "", "", "", 0, 0, 0, "", 0, 0, false, meshtastic_ModuleConfig_MapReportSettings_init_zero}
|
#define meshtastic_ModuleConfig_MQTTConfig_init_zero {0, "", "", "", 0, 0, 0, "", 0, 0, false, meshtastic_ModuleConfig_MapReportSettings_init_zero}
|
||||||
#define meshtastic_ModuleConfig_MapReportSettings_init_zero {0, 0}
|
#define meshtastic_ModuleConfig_MapReportSettings_init_zero {0, 0, 0}
|
||||||
#define meshtastic_ModuleConfig_RemoteHardwareConfig_init_zero {0, 0, 0, {meshtastic_RemoteHardwarePin_init_zero, meshtastic_RemoteHardwarePin_init_zero, meshtastic_RemoteHardwarePin_init_zero, meshtastic_RemoteHardwarePin_init_zero}}
|
#define meshtastic_ModuleConfig_RemoteHardwareConfig_init_zero {0, 0, 0, {meshtastic_RemoteHardwarePin_init_zero, meshtastic_RemoteHardwarePin_init_zero, meshtastic_RemoteHardwarePin_init_zero, meshtastic_RemoteHardwarePin_init_zero}}
|
||||||
#define meshtastic_ModuleConfig_NeighborInfoConfig_init_zero {0, 0, 0}
|
#define meshtastic_ModuleConfig_NeighborInfoConfig_init_zero {0, 0, 0}
|
||||||
#define meshtastic_ModuleConfig_DetectionSensorConfig_init_zero {0, 0, 0, 0, "", 0, _meshtastic_ModuleConfig_DetectionSensorConfig_TriggerType_MIN, 0}
|
#define meshtastic_ModuleConfig_DetectionSensorConfig_init_zero {0, 0, 0, 0, "", 0, _meshtastic_ModuleConfig_DetectionSensorConfig_TriggerType_MIN, 0}
|
||||||
@ -536,6 +541,7 @@ extern "C" {
|
|||||||
/* Field tags (for use in manual encoding/decoding) */
|
/* Field tags (for use in manual encoding/decoding) */
|
||||||
#define meshtastic_ModuleConfig_MapReportSettings_publish_interval_secs_tag 1
|
#define meshtastic_ModuleConfig_MapReportSettings_publish_interval_secs_tag 1
|
||||||
#define meshtastic_ModuleConfig_MapReportSettings_position_precision_tag 2
|
#define meshtastic_ModuleConfig_MapReportSettings_position_precision_tag 2
|
||||||
|
#define meshtastic_ModuleConfig_MapReportSettings_should_report_location_tag 3
|
||||||
#define meshtastic_ModuleConfig_MQTTConfig_enabled_tag 1
|
#define meshtastic_ModuleConfig_MQTTConfig_enabled_tag 1
|
||||||
#define meshtastic_ModuleConfig_MQTTConfig_address_tag 2
|
#define meshtastic_ModuleConfig_MQTTConfig_address_tag 2
|
||||||
#define meshtastic_ModuleConfig_MQTTConfig_username_tag 3
|
#define meshtastic_ModuleConfig_MQTTConfig_username_tag 3
|
||||||
@ -699,7 +705,8 @@ X(a, STATIC, OPTIONAL, MESSAGE, map_report_settings, 11)
|
|||||||
|
|
||||||
#define meshtastic_ModuleConfig_MapReportSettings_FIELDLIST(X, a) \
|
#define meshtastic_ModuleConfig_MapReportSettings_FIELDLIST(X, a) \
|
||||||
X(a, STATIC, SINGULAR, UINT32, publish_interval_secs, 1) \
|
X(a, STATIC, SINGULAR, UINT32, publish_interval_secs, 1) \
|
||||||
X(a, STATIC, SINGULAR, UINT32, position_precision, 2)
|
X(a, STATIC, SINGULAR, UINT32, position_precision, 2) \
|
||||||
|
X(a, STATIC, SINGULAR, BOOL, should_report_location, 3)
|
||||||
#define meshtastic_ModuleConfig_MapReportSettings_CALLBACK NULL
|
#define meshtastic_ModuleConfig_MapReportSettings_CALLBACK NULL
|
||||||
#define meshtastic_ModuleConfig_MapReportSettings_DEFAULT NULL
|
#define meshtastic_ModuleConfig_MapReportSettings_DEFAULT NULL
|
||||||
|
|
||||||
@ -887,8 +894,8 @@ extern const pb_msgdesc_t meshtastic_RemoteHardwarePin_msg;
|
|||||||
#define meshtastic_ModuleConfig_CannedMessageConfig_size 49
|
#define meshtastic_ModuleConfig_CannedMessageConfig_size 49
|
||||||
#define meshtastic_ModuleConfig_DetectionSensorConfig_size 44
|
#define meshtastic_ModuleConfig_DetectionSensorConfig_size 44
|
||||||
#define meshtastic_ModuleConfig_ExternalNotificationConfig_size 42
|
#define meshtastic_ModuleConfig_ExternalNotificationConfig_size 42
|
||||||
#define meshtastic_ModuleConfig_MQTTConfig_size 222
|
#define meshtastic_ModuleConfig_MQTTConfig_size 224
|
||||||
#define meshtastic_ModuleConfig_MapReportSettings_size 12
|
#define meshtastic_ModuleConfig_MapReportSettings_size 14
|
||||||
#define meshtastic_ModuleConfig_NeighborInfoConfig_size 10
|
#define meshtastic_ModuleConfig_NeighborInfoConfig_size 10
|
||||||
#define meshtastic_ModuleConfig_PaxcounterConfig_size 30
|
#define meshtastic_ModuleConfig_PaxcounterConfig_size 30
|
||||||
#define meshtastic_ModuleConfig_RangeTestConfig_size 10
|
#define meshtastic_ModuleConfig_RangeTestConfig_size 10
|
||||||
@ -896,7 +903,7 @@ extern const pb_msgdesc_t meshtastic_RemoteHardwarePin_msg;
|
|||||||
#define meshtastic_ModuleConfig_SerialConfig_size 28
|
#define meshtastic_ModuleConfig_SerialConfig_size 28
|
||||||
#define meshtastic_ModuleConfig_StoreForwardConfig_size 24
|
#define meshtastic_ModuleConfig_StoreForwardConfig_size 24
|
||||||
#define meshtastic_ModuleConfig_TelemetryConfig_size 46
|
#define meshtastic_ModuleConfig_TelemetryConfig_size 46
|
||||||
#define meshtastic_ModuleConfig_size 225
|
#define meshtastic_ModuleConfig_size 227
|
||||||
#define meshtastic_RemoteHardwarePin_size 21
|
#define meshtastic_RemoteHardwarePin_size 21
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -54,6 +54,9 @@ typedef struct _meshtastic_MapReport {
|
|||||||
uint32_t position_precision;
|
uint32_t position_precision;
|
||||||
/* Number of online nodes (heard in the last 2 hours) this node has in its list that were received locally (not via MQTT) */
|
/* Number of online nodes (heard in the last 2 hours) this node has in its list that were received locally (not via MQTT) */
|
||||||
uint16_t num_online_local_nodes;
|
uint16_t num_online_local_nodes;
|
||||||
|
/* User has opted in to share their location (map report) with the mqtt server
|
||||||
|
Controlled by map_report.should_report_location */
|
||||||
|
bool has_opted_report_location;
|
||||||
} meshtastic_MapReport;
|
} meshtastic_MapReport;
|
||||||
|
|
||||||
|
|
||||||
@ -63,9 +66,9 @@ extern "C" {
|
|||||||
|
|
||||||
/* Initializer values for message structs */
|
/* Initializer values for message structs */
|
||||||
#define meshtastic_ServiceEnvelope_init_default {NULL, NULL, NULL}
|
#define meshtastic_ServiceEnvelope_init_default {NULL, NULL, NULL}
|
||||||
#define meshtastic_MapReport_init_default {"", "", _meshtastic_Config_DeviceConfig_Role_MIN, _meshtastic_HardwareModel_MIN, "", _meshtastic_Config_LoRaConfig_RegionCode_MIN, _meshtastic_Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, 0, 0}
|
#define meshtastic_MapReport_init_default {"", "", _meshtastic_Config_DeviceConfig_Role_MIN, _meshtastic_HardwareModel_MIN, "", _meshtastic_Config_LoRaConfig_RegionCode_MIN, _meshtastic_Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, 0, 0, 0}
|
||||||
#define meshtastic_ServiceEnvelope_init_zero {NULL, NULL, NULL}
|
#define meshtastic_ServiceEnvelope_init_zero {NULL, NULL, NULL}
|
||||||
#define meshtastic_MapReport_init_zero {"", "", _meshtastic_Config_DeviceConfig_Role_MIN, _meshtastic_HardwareModel_MIN, "", _meshtastic_Config_LoRaConfig_RegionCode_MIN, _meshtastic_Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, 0, 0}
|
#define meshtastic_MapReport_init_zero {"", "", _meshtastic_Config_DeviceConfig_Role_MIN, _meshtastic_HardwareModel_MIN, "", _meshtastic_Config_LoRaConfig_RegionCode_MIN, _meshtastic_Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, 0, 0, 0}
|
||||||
|
|
||||||
/* Field tags (for use in manual encoding/decoding) */
|
/* Field tags (for use in manual encoding/decoding) */
|
||||||
#define meshtastic_ServiceEnvelope_packet_tag 1
|
#define meshtastic_ServiceEnvelope_packet_tag 1
|
||||||
@ -84,6 +87,7 @@ extern "C" {
|
|||||||
#define meshtastic_MapReport_altitude_tag 11
|
#define meshtastic_MapReport_altitude_tag 11
|
||||||
#define meshtastic_MapReport_position_precision_tag 12
|
#define meshtastic_MapReport_position_precision_tag 12
|
||||||
#define meshtastic_MapReport_num_online_local_nodes_tag 13
|
#define meshtastic_MapReport_num_online_local_nodes_tag 13
|
||||||
|
#define meshtastic_MapReport_has_opted_report_location_tag 14
|
||||||
|
|
||||||
/* Struct field encoding specification for nanopb */
|
/* Struct field encoding specification for nanopb */
|
||||||
#define meshtastic_ServiceEnvelope_FIELDLIST(X, a) \
|
#define meshtastic_ServiceEnvelope_FIELDLIST(X, a) \
|
||||||
@ -107,7 +111,8 @@ X(a, STATIC, SINGULAR, SFIXED32, latitude_i, 9) \
|
|||||||
X(a, STATIC, SINGULAR, SFIXED32, longitude_i, 10) \
|
X(a, STATIC, SINGULAR, SFIXED32, longitude_i, 10) \
|
||||||
X(a, STATIC, SINGULAR, INT32, altitude, 11) \
|
X(a, STATIC, SINGULAR, INT32, altitude, 11) \
|
||||||
X(a, STATIC, SINGULAR, UINT32, position_precision, 12) \
|
X(a, STATIC, SINGULAR, UINT32, position_precision, 12) \
|
||||||
X(a, STATIC, SINGULAR, UINT32, num_online_local_nodes, 13)
|
X(a, STATIC, SINGULAR, UINT32, num_online_local_nodes, 13) \
|
||||||
|
X(a, STATIC, SINGULAR, BOOL, has_opted_report_location, 14)
|
||||||
#define meshtastic_MapReport_CALLBACK NULL
|
#define meshtastic_MapReport_CALLBACK NULL
|
||||||
#define meshtastic_MapReport_DEFAULT NULL
|
#define meshtastic_MapReport_DEFAULT NULL
|
||||||
|
|
||||||
@ -121,7 +126,7 @@ extern const pb_msgdesc_t meshtastic_MapReport_msg;
|
|||||||
/* Maximum encoded size of messages (where known) */
|
/* Maximum encoded size of messages (where known) */
|
||||||
/* meshtastic_ServiceEnvelope_size depends on runtime parameters */
|
/* meshtastic_ServiceEnvelope_size depends on runtime parameters */
|
||||||
#define MESHTASTIC_MESHTASTIC_MQTT_PB_H_MAX_SIZE meshtastic_MapReport_size
|
#define MESHTASTIC_MESHTASTIC_MQTT_PB_H_MAX_SIZE meshtastic_MapReport_size
|
||||||
#define meshtastic_MapReport_size 108
|
#define meshtastic_MapReport_size 110
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
|
@ -24,6 +24,9 @@ PB_BIND(meshtastic_LocalStats, meshtastic_LocalStats, AUTO)
|
|||||||
PB_BIND(meshtastic_HealthMetrics, meshtastic_HealthMetrics, AUTO)
|
PB_BIND(meshtastic_HealthMetrics, meshtastic_HealthMetrics, AUTO)
|
||||||
|
|
||||||
|
|
||||||
|
PB_BIND(meshtastic_HostMetrics, meshtastic_HostMetrics, AUTO)
|
||||||
|
|
||||||
|
|
||||||
PB_BIND(meshtastic_Telemetry, meshtastic_Telemetry, AUTO)
|
PB_BIND(meshtastic_Telemetry, meshtastic_Telemetry, AUTO)
|
||||||
|
|
||||||
|
|
||||||
|
@ -87,7 +87,9 @@ typedef enum _meshtastic_TelemetrySensorType {
|
|||||||
/* Infineon DPS310 High accuracy pressure and temperature */
|
/* Infineon DPS310 High accuracy pressure and temperature */
|
||||||
meshtastic_TelemetrySensorType_DPS310 = 36,
|
meshtastic_TelemetrySensorType_DPS310 = 36,
|
||||||
/* RAKWireless RAK12035 Soil Moisture Sensor Module */
|
/* RAKWireless RAK12035 Soil Moisture Sensor Module */
|
||||||
meshtastic_TelemetrySensorType_RAK12035 = 37
|
meshtastic_TelemetrySensorType_RAK12035 = 37,
|
||||||
|
/* MAX17261 lipo battery gauge */
|
||||||
|
meshtastic_TelemetrySensorType_MAX17261 = 38
|
||||||
} meshtastic_TelemetrySensorType;
|
} meshtastic_TelemetrySensorType;
|
||||||
|
|
||||||
/* Struct definitions */
|
/* Struct definitions */
|
||||||
@ -288,6 +290,28 @@ typedef struct _meshtastic_HealthMetrics {
|
|||||||
float temperature;
|
float temperature;
|
||||||
} meshtastic_HealthMetrics;
|
} meshtastic_HealthMetrics;
|
||||||
|
|
||||||
|
/* Linux host metrics */
|
||||||
|
typedef struct _meshtastic_HostMetrics {
|
||||||
|
/* Host system uptime */
|
||||||
|
uint32_t uptime_seconds;
|
||||||
|
/* Host system free memory */
|
||||||
|
uint64_t freemem_bytes;
|
||||||
|
/* Host system disk space free for / */
|
||||||
|
uint64_t diskfree1_bytes;
|
||||||
|
/* Secondary system disk space free */
|
||||||
|
bool has_diskfree2_bytes;
|
||||||
|
uint64_t diskfree2_bytes;
|
||||||
|
/* Tertiary disk space free */
|
||||||
|
bool has_diskfree3_bytes;
|
||||||
|
uint64_t diskfree3_bytes;
|
||||||
|
/* Host system one minute load in 1/100ths */
|
||||||
|
uint16_t load1;
|
||||||
|
/* Host system five minute load in 1/100ths */
|
||||||
|
uint16_t load5;
|
||||||
|
/* Host system fifteen minute load in 1/100ths */
|
||||||
|
uint16_t load15;
|
||||||
|
} meshtastic_HostMetrics;
|
||||||
|
|
||||||
/* Types of Measurements the telemetry module is equipped to handle */
|
/* Types of Measurements the telemetry module is equipped to handle */
|
||||||
typedef struct _meshtastic_Telemetry {
|
typedef struct _meshtastic_Telemetry {
|
||||||
/* Seconds since 1970 - or 0 for unknown/unset */
|
/* Seconds since 1970 - or 0 for unknown/unset */
|
||||||
@ -306,6 +330,8 @@ typedef struct _meshtastic_Telemetry {
|
|||||||
meshtastic_LocalStats local_stats;
|
meshtastic_LocalStats local_stats;
|
||||||
/* Health telemetry metrics */
|
/* Health telemetry metrics */
|
||||||
meshtastic_HealthMetrics health_metrics;
|
meshtastic_HealthMetrics health_metrics;
|
||||||
|
/* Linux host metrics */
|
||||||
|
meshtastic_HostMetrics host_metrics;
|
||||||
} variant;
|
} variant;
|
||||||
} meshtastic_Telemetry;
|
} meshtastic_Telemetry;
|
||||||
|
|
||||||
@ -324,8 +350,9 @@ extern "C" {
|
|||||||
|
|
||||||
/* Helper constants for enums */
|
/* Helper constants for enums */
|
||||||
#define _meshtastic_TelemetrySensorType_MIN meshtastic_TelemetrySensorType_SENSOR_UNSET
|
#define _meshtastic_TelemetrySensorType_MIN meshtastic_TelemetrySensorType_SENSOR_UNSET
|
||||||
#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_RAK12035
|
#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_MAX17261
|
||||||
#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_RAK12035+1))
|
#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_MAX17261+1))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -343,6 +370,7 @@ extern "C" {
|
|||||||
#define meshtastic_AirQualityMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0}
|
#define meshtastic_AirQualityMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0}
|
||||||
#define meshtastic_LocalStats_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
#define meshtastic_LocalStats_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||||
#define meshtastic_HealthMetrics_init_default {false, 0, false, 0, false, 0}
|
#define meshtastic_HealthMetrics_init_default {false, 0, false, 0, false, 0}
|
||||||
|
#define meshtastic_HostMetrics_init_default {0, 0, 0, false, 0, false, 0, 0, 0, 0}
|
||||||
#define meshtastic_Telemetry_init_default {0, 0, {meshtastic_DeviceMetrics_init_default}}
|
#define meshtastic_Telemetry_init_default {0, 0, {meshtastic_DeviceMetrics_init_default}}
|
||||||
#define meshtastic_Nau7802Config_init_default {0, 0}
|
#define meshtastic_Nau7802Config_init_default {0, 0}
|
||||||
#define meshtastic_DeviceMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0}
|
#define meshtastic_DeviceMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0}
|
||||||
@ -351,6 +379,7 @@ extern "C" {
|
|||||||
#define meshtastic_AirQualityMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0}
|
#define meshtastic_AirQualityMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0}
|
||||||
#define meshtastic_LocalStats_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
#define meshtastic_LocalStats_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||||
#define meshtastic_HealthMetrics_init_zero {false, 0, false, 0, false, 0}
|
#define meshtastic_HealthMetrics_init_zero {false, 0, false, 0, false, 0}
|
||||||
|
#define meshtastic_HostMetrics_init_zero {0, 0, 0, false, 0, false, 0, 0, 0, 0}
|
||||||
#define meshtastic_Telemetry_init_zero {0, 0, {meshtastic_DeviceMetrics_init_zero}}
|
#define meshtastic_Telemetry_init_zero {0, 0, {meshtastic_DeviceMetrics_init_zero}}
|
||||||
#define meshtastic_Nau7802Config_init_zero {0, 0}
|
#define meshtastic_Nau7802Config_init_zero {0, 0}
|
||||||
|
|
||||||
@ -415,6 +444,14 @@ extern "C" {
|
|||||||
#define meshtastic_HealthMetrics_heart_bpm_tag 1
|
#define meshtastic_HealthMetrics_heart_bpm_tag 1
|
||||||
#define meshtastic_HealthMetrics_spO2_tag 2
|
#define meshtastic_HealthMetrics_spO2_tag 2
|
||||||
#define meshtastic_HealthMetrics_temperature_tag 3
|
#define meshtastic_HealthMetrics_temperature_tag 3
|
||||||
|
#define meshtastic_HostMetrics_uptime_seconds_tag 1
|
||||||
|
#define meshtastic_HostMetrics_freemem_bytes_tag 2
|
||||||
|
#define meshtastic_HostMetrics_diskfree1_bytes_tag 3
|
||||||
|
#define meshtastic_HostMetrics_diskfree2_bytes_tag 4
|
||||||
|
#define meshtastic_HostMetrics_diskfree3_bytes_tag 5
|
||||||
|
#define meshtastic_HostMetrics_load1_tag 6
|
||||||
|
#define meshtastic_HostMetrics_load5_tag 7
|
||||||
|
#define meshtastic_HostMetrics_load15_tag 8
|
||||||
#define meshtastic_Telemetry_time_tag 1
|
#define meshtastic_Telemetry_time_tag 1
|
||||||
#define meshtastic_Telemetry_device_metrics_tag 2
|
#define meshtastic_Telemetry_device_metrics_tag 2
|
||||||
#define meshtastic_Telemetry_environment_metrics_tag 3
|
#define meshtastic_Telemetry_environment_metrics_tag 3
|
||||||
@ -422,6 +459,7 @@ extern "C" {
|
|||||||
#define meshtastic_Telemetry_power_metrics_tag 5
|
#define meshtastic_Telemetry_power_metrics_tag 5
|
||||||
#define meshtastic_Telemetry_local_stats_tag 6
|
#define meshtastic_Telemetry_local_stats_tag 6
|
||||||
#define meshtastic_Telemetry_health_metrics_tag 7
|
#define meshtastic_Telemetry_health_metrics_tag 7
|
||||||
|
#define meshtastic_Telemetry_host_metrics_tag 8
|
||||||
#define meshtastic_Nau7802Config_zeroOffset_tag 1
|
#define meshtastic_Nau7802Config_zeroOffset_tag 1
|
||||||
#define meshtastic_Nau7802Config_calibrationFactor_tag 2
|
#define meshtastic_Nau7802Config_calibrationFactor_tag 2
|
||||||
|
|
||||||
@ -510,6 +548,18 @@ X(a, STATIC, OPTIONAL, FLOAT, temperature, 3)
|
|||||||
#define meshtastic_HealthMetrics_CALLBACK NULL
|
#define meshtastic_HealthMetrics_CALLBACK NULL
|
||||||
#define meshtastic_HealthMetrics_DEFAULT NULL
|
#define meshtastic_HealthMetrics_DEFAULT NULL
|
||||||
|
|
||||||
|
#define meshtastic_HostMetrics_FIELDLIST(X, a) \
|
||||||
|
X(a, STATIC, SINGULAR, UINT32, uptime_seconds, 1) \
|
||||||
|
X(a, STATIC, SINGULAR, UINT64, freemem_bytes, 2) \
|
||||||
|
X(a, STATIC, SINGULAR, UINT64, diskfree1_bytes, 3) \
|
||||||
|
X(a, STATIC, OPTIONAL, UINT64, diskfree2_bytes, 4) \
|
||||||
|
X(a, STATIC, OPTIONAL, UINT64, diskfree3_bytes, 5) \
|
||||||
|
X(a, STATIC, SINGULAR, UINT32, load1, 6) \
|
||||||
|
X(a, STATIC, SINGULAR, UINT32, load5, 7) \
|
||||||
|
X(a, STATIC, SINGULAR, UINT32, load15, 8)
|
||||||
|
#define meshtastic_HostMetrics_CALLBACK NULL
|
||||||
|
#define meshtastic_HostMetrics_DEFAULT NULL
|
||||||
|
|
||||||
#define meshtastic_Telemetry_FIELDLIST(X, a) \
|
#define meshtastic_Telemetry_FIELDLIST(X, a) \
|
||||||
X(a, STATIC, SINGULAR, FIXED32, time, 1) \
|
X(a, STATIC, SINGULAR, FIXED32, time, 1) \
|
||||||
X(a, STATIC, ONEOF, MESSAGE, (variant,device_metrics,variant.device_metrics), 2) \
|
X(a, STATIC, ONEOF, MESSAGE, (variant,device_metrics,variant.device_metrics), 2) \
|
||||||
@ -517,7 +567,8 @@ X(a, STATIC, ONEOF, MESSAGE, (variant,environment_metrics,variant.environm
|
|||||||
X(a, STATIC, ONEOF, MESSAGE, (variant,air_quality_metrics,variant.air_quality_metrics), 4) \
|
X(a, STATIC, ONEOF, MESSAGE, (variant,air_quality_metrics,variant.air_quality_metrics), 4) \
|
||||||
X(a, STATIC, ONEOF, MESSAGE, (variant,power_metrics,variant.power_metrics), 5) \
|
X(a, STATIC, ONEOF, MESSAGE, (variant,power_metrics,variant.power_metrics), 5) \
|
||||||
X(a, STATIC, ONEOF, MESSAGE, (variant,local_stats,variant.local_stats), 6) \
|
X(a, STATIC, ONEOF, MESSAGE, (variant,local_stats,variant.local_stats), 6) \
|
||||||
X(a, STATIC, ONEOF, MESSAGE, (variant,health_metrics,variant.health_metrics), 7)
|
X(a, STATIC, ONEOF, MESSAGE, (variant,health_metrics,variant.health_metrics), 7) \
|
||||||
|
X(a, STATIC, ONEOF, MESSAGE, (variant,host_metrics,variant.host_metrics), 8)
|
||||||
#define meshtastic_Telemetry_CALLBACK NULL
|
#define meshtastic_Telemetry_CALLBACK NULL
|
||||||
#define meshtastic_Telemetry_DEFAULT NULL
|
#define meshtastic_Telemetry_DEFAULT NULL
|
||||||
#define meshtastic_Telemetry_variant_device_metrics_MSGTYPE meshtastic_DeviceMetrics
|
#define meshtastic_Telemetry_variant_device_metrics_MSGTYPE meshtastic_DeviceMetrics
|
||||||
@ -526,6 +577,7 @@ X(a, STATIC, ONEOF, MESSAGE, (variant,health_metrics,variant.health_metric
|
|||||||
#define meshtastic_Telemetry_variant_power_metrics_MSGTYPE meshtastic_PowerMetrics
|
#define meshtastic_Telemetry_variant_power_metrics_MSGTYPE meshtastic_PowerMetrics
|
||||||
#define meshtastic_Telemetry_variant_local_stats_MSGTYPE meshtastic_LocalStats
|
#define meshtastic_Telemetry_variant_local_stats_MSGTYPE meshtastic_LocalStats
|
||||||
#define meshtastic_Telemetry_variant_health_metrics_MSGTYPE meshtastic_HealthMetrics
|
#define meshtastic_Telemetry_variant_health_metrics_MSGTYPE meshtastic_HealthMetrics
|
||||||
|
#define meshtastic_Telemetry_variant_host_metrics_MSGTYPE meshtastic_HostMetrics
|
||||||
|
|
||||||
#define meshtastic_Nau7802Config_FIELDLIST(X, a) \
|
#define meshtastic_Nau7802Config_FIELDLIST(X, a) \
|
||||||
X(a, STATIC, SINGULAR, INT32, zeroOffset, 1) \
|
X(a, STATIC, SINGULAR, INT32, zeroOffset, 1) \
|
||||||
@ -539,6 +591,7 @@ extern const pb_msgdesc_t meshtastic_PowerMetrics_msg;
|
|||||||
extern const pb_msgdesc_t meshtastic_AirQualityMetrics_msg;
|
extern const pb_msgdesc_t meshtastic_AirQualityMetrics_msg;
|
||||||
extern const pb_msgdesc_t meshtastic_LocalStats_msg;
|
extern const pb_msgdesc_t meshtastic_LocalStats_msg;
|
||||||
extern const pb_msgdesc_t meshtastic_HealthMetrics_msg;
|
extern const pb_msgdesc_t meshtastic_HealthMetrics_msg;
|
||||||
|
extern const pb_msgdesc_t meshtastic_HostMetrics_msg;
|
||||||
extern const pb_msgdesc_t meshtastic_Telemetry_msg;
|
extern const pb_msgdesc_t meshtastic_Telemetry_msg;
|
||||||
extern const pb_msgdesc_t meshtastic_Nau7802Config_msg;
|
extern const pb_msgdesc_t meshtastic_Nau7802Config_msg;
|
||||||
|
|
||||||
@ -549,6 +602,7 @@ extern const pb_msgdesc_t meshtastic_Nau7802Config_msg;
|
|||||||
#define meshtastic_AirQualityMetrics_fields &meshtastic_AirQualityMetrics_msg
|
#define meshtastic_AirQualityMetrics_fields &meshtastic_AirQualityMetrics_msg
|
||||||
#define meshtastic_LocalStats_fields &meshtastic_LocalStats_msg
|
#define meshtastic_LocalStats_fields &meshtastic_LocalStats_msg
|
||||||
#define meshtastic_HealthMetrics_fields &meshtastic_HealthMetrics_msg
|
#define meshtastic_HealthMetrics_fields &meshtastic_HealthMetrics_msg
|
||||||
|
#define meshtastic_HostMetrics_fields &meshtastic_HostMetrics_msg
|
||||||
#define meshtastic_Telemetry_fields &meshtastic_Telemetry_msg
|
#define meshtastic_Telemetry_fields &meshtastic_Telemetry_msg
|
||||||
#define meshtastic_Nau7802Config_fields &meshtastic_Nau7802Config_msg
|
#define meshtastic_Nau7802Config_fields &meshtastic_Nau7802Config_msg
|
||||||
|
|
||||||
@ -558,6 +612,7 @@ extern const pb_msgdesc_t meshtastic_Nau7802Config_msg;
|
|||||||
#define meshtastic_DeviceMetrics_size 27
|
#define meshtastic_DeviceMetrics_size 27
|
||||||
#define meshtastic_EnvironmentMetrics_size 113
|
#define meshtastic_EnvironmentMetrics_size 113
|
||||||
#define meshtastic_HealthMetrics_size 11
|
#define meshtastic_HealthMetrics_size 11
|
||||||
|
#define meshtastic_HostMetrics_size 62
|
||||||
#define meshtastic_LocalStats_size 60
|
#define meshtastic_LocalStats_size 60
|
||||||
#define meshtastic_Nau7802Config_size 16
|
#define meshtastic_Nau7802Config_size 16
|
||||||
#define meshtastic_PowerMetrics_size 30
|
#define meshtastic_PowerMetrics_size 30
|
||||||
|
@ -462,8 +462,8 @@ PiWebServerThread::PiWebServerThread()
|
|||||||
webservport = settingsMap[webserverport];
|
webservport = settingsMap[webserverport];
|
||||||
LOG_INFO("Use webserver port from yaml config %i ", webservport);
|
LOG_INFO("Use webserver port from yaml config %i ", webservport);
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO("Webserver port in yaml config set to 0, defaulting to port 443");
|
LOG_INFO("Webserver port in yaml config set to 0, defaulting to port 9443");
|
||||||
webservport = 443;
|
webservport = 9443;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Web Content Service Instance
|
// Web Content Service Instance
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
#include "modules/PositionModule.h"
|
#include "modules/PositionModule.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C
|
#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C
|
||||||
#include "motion/AccelerometerThread.h"
|
#include "motion/AccelerometerThread.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -284,7 +284,11 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
|||||||
case meshtastic_AdminMessage_remove_by_nodenum_tag: {
|
case meshtastic_AdminMessage_remove_by_nodenum_tag: {
|
||||||
LOG_INFO("Client received remove_nodenum command");
|
LOG_INFO("Client received remove_nodenum command");
|
||||||
nodeDB->removeNodeByNum(r->remove_by_nodenum);
|
nodeDB->removeNodeByNum(r->remove_by_nodenum);
|
||||||
this->notifyObservers(r); // Observed by screen
|
break;
|
||||||
|
}
|
||||||
|
case meshtastic_AdminMessage_add_contact_tag: {
|
||||||
|
LOG_INFO("Client received add_contact command");
|
||||||
|
nodeDB->addFromContact(r->add_contact);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case meshtastic_AdminMessage_set_favorite_node_tag: {
|
case meshtastic_AdminMessage_set_favorite_node_tag: {
|
||||||
@ -444,6 +448,9 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
|||||||
myReply = allocErrorResponse(meshtastic_Routing_Error_NONE, &mp);
|
myReply = allocErrorResponse(meshtastic_Routing_Error_NONE, &mp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Allow any observers (e.g. the UI) to respond to this event
|
||||||
|
notifyObservers(r);
|
||||||
|
|
||||||
return handled;
|
return handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -497,6 +504,12 @@ void AdminModule::handleSetOwner(const meshtastic_User &o)
|
|||||||
sendWarning(licensedModeMessage);
|
sendWarning(licensedModeMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (owner.has_is_unmessagable != o.has_is_unmessagable ||
|
||||||
|
(o.has_is_unmessagable && owner.is_unmessagable != o.is_unmessagable)) {
|
||||||
|
changed = 1;
|
||||||
|
owner.has_is_unmessagable = o.has_is_unmessagable || o.has_is_unmessagable;
|
||||||
|
owner.is_unmessagable = o.is_unmessagable;
|
||||||
|
}
|
||||||
|
|
||||||
if (changed) { // If nothing really changed, don't broadcast on the network or write to flash
|
if (changed) { // If nothing really changed, don't broadcast on the network or write to flash
|
||||||
service->reloadOwner(!hasOpenEditTransaction);
|
service->reloadOwner(!hasOpenEditTransaction);
|
||||||
@ -546,8 +559,10 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c)
|
|||||||
sendWarning(warning);
|
sendWarning(warning);
|
||||||
}
|
}
|
||||||
// If we're setting router role for the first time, install its intervals
|
// If we're setting router role for the first time, install its intervals
|
||||||
if (existingRole != c.payload_variant.device.role)
|
if (existingRole != c.payload_variant.device.role) {
|
||||||
nodeDB->installRoleDefaults(c.payload_variant.device.role);
|
nodeDB->installRoleDefaults(c.payload_variant.device.role);
|
||||||
|
changes |= SEGMENT_NODEDATABASE | SEGMENT_DEVICESTATE; // Some role defaults affect owner
|
||||||
|
}
|
||||||
if (config.device.node_info_broadcast_secs < min_node_info_broadcast_secs) {
|
if (config.device.node_info_broadcast_secs < min_node_info_broadcast_secs) {
|
||||||
LOG_DEBUG("Tried to set node_info_broadcast_secs too low, setting to %d", min_node_info_broadcast_secs);
|
LOG_DEBUG("Tried to set node_info_broadcast_secs too low, setting to %d", min_node_info_broadcast_secs);
|
||||||
config.device.node_info_broadcast_secs = min_node_info_broadcast_secs;
|
config.device.node_info_broadcast_secs = min_node_info_broadcast_secs;
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#if ARCH_PORTDUINO
|
#if ARCH_PORTDUINO
|
||||||
#include "input/LinuxInputImpl.h"
|
#include "input/LinuxInputImpl.h"
|
||||||
|
#include "modules/Telemetry/HostMetrics.h"
|
||||||
#if !MESHTASTIC_EXCLUDE_STOREFORWARD
|
#if !MESHTASTIC_EXCLUDE_STOREFORWARD
|
||||||
#include "modules/StoreForwardModule.h"
|
#include "modules/StoreForwardModule.h"
|
||||||
#endif
|
#endif
|
||||||
@ -196,6 +197,9 @@ void setupModules()
|
|||||||
#if HAS_SCREEN && !MESHTASTIC_EXCLUDE_CANNEDMESSAGES
|
#if HAS_SCREEN && !MESHTASTIC_EXCLUDE_CANNEDMESSAGES
|
||||||
cannedMessageModule = new CannedMessageModule();
|
cannedMessageModule = new CannedMessageModule();
|
||||||
#endif
|
#endif
|
||||||
|
#if ARCH_PORTDUINO
|
||||||
|
new HostMetricsModule();
|
||||||
|
#endif
|
||||||
#if HAS_TELEMETRY
|
#if HAS_TELEMETRY
|
||||||
new DeviceTelemetryModule();
|
new DeviceTelemetryModule();
|
||||||
#endif
|
#endif
|
||||||
|
@ -79,6 +79,11 @@ meshtastic_MeshPacket *NodeInfoModule::allocReply()
|
|||||||
u.public_key.bytes[0] = 0;
|
u.public_key.bytes[0] = 0;
|
||||||
u.public_key.size = 0;
|
u.public_key.size = 0;
|
||||||
}
|
}
|
||||||
|
// Coerce unmessagable for Repeater role
|
||||||
|
if (u.role == meshtastic_Config_DeviceConfig_Role_REPEATER) {
|
||||||
|
u.has_is_unmessagable = true;
|
||||||
|
u.is_unmessagable = true;
|
||||||
|
}
|
||||||
|
|
||||||
LOG_INFO("Send owner %s/%s/%s", u.id, u.long_name, u.short_name);
|
LOG_INFO("Send owner %s/%s/%s", u.id, u.long_name, u.short_name);
|
||||||
lastSentToMesh = millis();
|
lastSentToMesh = millis();
|
||||||
|
@ -370,9 +370,16 @@ void PositionModule::sendOurPosition(NodeNum dest, bool wantReplies, uint8_t cha
|
|||||||
if (IS_ONE_OF(config.device.role, meshtastic_Config_DeviceConfig_Role_TRACKER,
|
if (IS_ONE_OF(config.device.role, meshtastic_Config_DeviceConfig_Role_TRACKER,
|
||||||
meshtastic_Config_DeviceConfig_Role_TAK_TRACKER) &&
|
meshtastic_Config_DeviceConfig_Role_TAK_TRACKER) &&
|
||||||
config.power.is_power_saving) {
|
config.power.is_power_saving) {
|
||||||
LOG_DEBUG("Start next execution in 5s, then sleep");
|
meshtastic_ClientNotification *notification = clientNotificationPool.allocZeroed();
|
||||||
|
notification->level = meshtastic_LogRecord_Level_INFO;
|
||||||
|
notification->time = getValidTime(RTCQualityFromNet);
|
||||||
|
sprintf(notification->message, "Sending position and sleeping for %us interval in a moment",
|
||||||
|
Default::getConfiguredOrDefaultMs(config.position.position_broadcast_secs, default_broadcast_interval_secs) /
|
||||||
|
1000U);
|
||||||
|
service->sendClientNotification(notification);
|
||||||
sleepOnNextExecution = true;
|
sleepOnNextExecution = true;
|
||||||
setIntervalFromNow(5000);
|
LOG_DEBUG("Start next execution in 5s, then sleep");
|
||||||
|
setIntervalFromNow(FIVE_SECONDS_MS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -513,7 +513,7 @@ void SerialModule::processWXSerial()
|
|||||||
// Extract the current line
|
// Extract the current line
|
||||||
char line[meshtastic_Constants_DATA_PAYLOAD_LEN];
|
char line[meshtastic_Constants_DATA_PAYLOAD_LEN];
|
||||||
memset(line, '\0', sizeof(line));
|
memset(line, '\0', sizeof(line));
|
||||||
if (lineEnd - lineStart < sizeof(line) - 1) {
|
if ((size_t)(lineEnd - lineStart) < sizeof(line) - 1) {
|
||||||
memcpy(line, &serialBytes[lineStart], lineEnd - lineStart);
|
memcpy(line, &serialBytes[lineStart], lineEnd - lineStart);
|
||||||
|
|
||||||
ParsedLine parsed = parseLine(line);
|
ParsedLine parsed = parseLine(line);
|
||||||
|
@ -729,9 +729,17 @@ bool EnvironmentTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly)
|
|||||||
service->sendToMesh(p, RX_SRC_LOCAL, true);
|
service->sendToMesh(p, RX_SRC_LOCAL, true);
|
||||||
|
|
||||||
if (config.device.role == meshtastic_Config_DeviceConfig_Role_SENSOR && config.power.is_power_saving) {
|
if (config.device.role == meshtastic_Config_DeviceConfig_Role_SENSOR && config.power.is_power_saving) {
|
||||||
LOG_DEBUG("Start next execution in 5s, then sleep");
|
meshtastic_ClientNotification *notification = clientNotificationPool.allocZeroed();
|
||||||
|
notification->level = meshtastic_LogRecord_Level_INFO;
|
||||||
|
notification->time = getValidTime(RTCQualityFromNet);
|
||||||
|
sprintf(notification->message, "Sending telemetry and sleeping for %us interval in a moment",
|
||||||
|
Default::getConfiguredOrDefaultMs(moduleConfig.telemetry.environment_update_interval,
|
||||||
|
default_telemetry_broadcast_interval_secs) /
|
||||||
|
1000U);
|
||||||
|
service->sendClientNotification(notification);
|
||||||
sleepOnNextExecution = true;
|
sleepOnNextExecution = true;
|
||||||
setIntervalFromNow(5000);
|
LOG_DEBUG("Start next execution in 5s, then sleep");
|
||||||
|
setIntervalFromNow(FIVE_SECONDS_MS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
131
src/modules/Telemetry/HostMetrics.cpp
Normal file
131
src/modules/Telemetry/HostMetrics.cpp
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
#include "HostMetrics.h"
|
||||||
|
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
||||||
|
#include "MeshService.h"
|
||||||
|
#if ARCH_PORTDUINO
|
||||||
|
#include "PortduinoGlue.h"
|
||||||
|
#include <filesystem>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int32_t HostMetricsModule::runOnce()
|
||||||
|
{
|
||||||
|
#if ARCH_PORTDUINO
|
||||||
|
if (settingsMap[hostMetrics_interval] == 0) {
|
||||||
|
return disable();
|
||||||
|
} else {
|
||||||
|
sendMetrics();
|
||||||
|
return 60 * 1000 * settingsMap[hostMetrics_interval];
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
return disable();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
bool HostMetricsModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_Telemetry *t)
|
||||||
|
{
|
||||||
|
// Don't worry about storing telemetry in NodeDB if we're a repeater
|
||||||
|
if (config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (t->which_variant == meshtastic_Telemetry_host_metrics_tag) {
|
||||||
|
#ifdef DEBUG_PORT
|
||||||
|
const char *sender = getSenderShortName(mp);
|
||||||
|
|
||||||
|
LOG_INFO("(Received Host Metrics from %s): uptime=%u, diskfree=%lu, memory free=%lu, load=%04.2f, %04.2f, %04.2f", sender,
|
||||||
|
t->variant.host_metrics.uptime_seconds, t->variant.host_metrics.diskfree1_bytes,
|
||||||
|
t->variant.host_metrics.freemem_bytes, static_cast<float>(t->variant.host_metrics.load1) / 100,
|
||||||
|
static_cast<float>(t->variant.host_metrics.load5) / 100,
|
||||||
|
static_cast<float>(t->variant.host_metrics.load15) / 100);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
return false; // Let others look at this message also if they want
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
meshtastic_MeshPacket *HostMetricsModule::allocReply()
|
||||||
|
{
|
||||||
|
if (currentRequest) {
|
||||||
|
auto req = *currentRequest;
|
||||||
|
const auto &p = req.decoded;
|
||||||
|
meshtastic_Telemetry scratch;
|
||||||
|
meshtastic_Telemetry *decoded = NULL;
|
||||||
|
memset(&scratch, 0, sizeof(scratch));
|
||||||
|
if (pb_decode_from_bytes(p.payload.bytes, p.payload.size, &meshtastic_HostMetrics_msg, &scratch)) {
|
||||||
|
decoded = &scratch;
|
||||||
|
} else {
|
||||||
|
LOG_ERROR("Error decoding HostMetrics module!");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
// Check for a request for device metrics
|
||||||
|
if (decoded->which_variant == meshtastic_Telemetry_host_metrics_tag) {
|
||||||
|
LOG_INFO("Device telemetry reply to request");
|
||||||
|
return allocDataProtobuf(getHostMetrics());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if ARCH_PORTDUINO
|
||||||
|
meshtastic_Telemetry HostMetricsModule::getHostMetrics()
|
||||||
|
{
|
||||||
|
std::string file_line;
|
||||||
|
meshtastic_Telemetry t = meshtastic_HostMetrics_init_zero;
|
||||||
|
t.which_variant = meshtastic_Telemetry_host_metrics_tag;
|
||||||
|
|
||||||
|
if (access("/proc/uptime", R_OK) == 0) {
|
||||||
|
std::ifstream proc_uptime("/proc/uptime");
|
||||||
|
if (proc_uptime.is_open()) {
|
||||||
|
std::getline(proc_uptime, file_line, ' ');
|
||||||
|
proc_uptime.close();
|
||||||
|
t.variant.host_metrics.uptime_seconds = stoul(file_line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::filesystem::space_info root = std::filesystem::space("/");
|
||||||
|
t.variant.host_metrics.diskfree1_bytes = root.available;
|
||||||
|
|
||||||
|
if (access("/proc/meminfo", R_OK) == 0) {
|
||||||
|
std::ifstream proc_meminfo("/proc/meminfo");
|
||||||
|
if (proc_meminfo.is_open()) {
|
||||||
|
do {
|
||||||
|
std::getline(proc_meminfo, file_line);
|
||||||
|
} while (file_line.find("MemAvailable") == std::string::npos);
|
||||||
|
proc_meminfo.close();
|
||||||
|
t.variant.host_metrics.freemem_bytes = stoull(file_line.substr(file_line.find_first_of("0123456789"))) * 1024;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (access("/proc/loadavg", R_OK) == 0) {
|
||||||
|
std::ifstream proc_loadavg("/proc/loadavg");
|
||||||
|
if (proc_loadavg.is_open()) {
|
||||||
|
std::getline(proc_loadavg, file_line, ' ');
|
||||||
|
t.variant.host_metrics.load1 = stof(file_line) * 100;
|
||||||
|
std::getline(proc_loadavg, file_line, ' ');
|
||||||
|
t.variant.host_metrics.load5 = stof(file_line) * 100;
|
||||||
|
std::getline(proc_loadavg, file_line, ' ');
|
||||||
|
t.variant.host_metrics.load15 = stof(file_line) * 100;
|
||||||
|
proc_loadavg.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool HostMetricsModule::sendMetrics()
|
||||||
|
{
|
||||||
|
meshtastic_Telemetry telemetry = getHostMetrics();
|
||||||
|
LOG_INFO("Send: uptime=%u, diskfree=%lu, memory free=%lu, load=%04.2f, %04.2f, %04.2f",
|
||||||
|
telemetry.variant.host_metrics.uptime_seconds, telemetry.variant.host_metrics.diskfree1_bytes,
|
||||||
|
telemetry.variant.host_metrics.freemem_bytes, static_cast<float>(telemetry.variant.host_metrics.load1) / 100,
|
||||||
|
static_cast<float>(telemetry.variant.host_metrics.load5) / 100,
|
||||||
|
static_cast<float>(telemetry.variant.host_metrics.load15) / 100);
|
||||||
|
|
||||||
|
meshtastic_MeshPacket *p = allocDataProtobuf(telemetry);
|
||||||
|
p->to = NODENUM_BROADCAST;
|
||||||
|
p->decoded.want_response = false;
|
||||||
|
p->priority = meshtastic_MeshPacket_Priority_BACKGROUND;
|
||||||
|
p->channel = settingsMap[hostMetrics_channel];
|
||||||
|
LOG_INFO("Send packet to mesh");
|
||||||
|
service->sendToMesh(p, RX_SRC_LOCAL, true);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
40
src/modules/Telemetry/HostMetrics.h
Normal file
40
src/modules/Telemetry/HostMetrics.h
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
||||||
|
#include "ProtobufModule.h"
|
||||||
|
|
||||||
|
class HostMetricsModule : private concurrency::OSThread, public ProtobufModule<meshtastic_Telemetry>
|
||||||
|
{
|
||||||
|
CallbackObserver<HostMetricsModule, const meshtastic::Status *> nodeStatusObserver =
|
||||||
|
CallbackObserver<HostMetricsModule, const meshtastic::Status *>(this, &HostMetricsModule::handleStatusUpdate);
|
||||||
|
|
||||||
|
public:
|
||||||
|
HostMetricsModule()
|
||||||
|
: concurrency::OSThread("HostMetrics"),
|
||||||
|
ProtobufModule("HostMetrics", meshtastic_PortNum_TELEMETRY_APP, &meshtastic_Telemetry_msg)
|
||||||
|
{
|
||||||
|
uptimeWrapCount = 0;
|
||||||
|
uptimeLastMs = millis();
|
||||||
|
nodeStatusObserver.observe(&nodeStatus->onNewStatus);
|
||||||
|
setIntervalFromNow(setStartDelay()); // Wait until NodeInfo is sent
|
||||||
|
}
|
||||||
|
virtual bool wantUIFrame() { return false; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/** Called to handle a particular incoming message
|
||||||
|
@return true if you've guaranteed you've handled this message and no other handlers should be considered for it
|
||||||
|
*/
|
||||||
|
virtual bool handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_Telemetry *p) override;
|
||||||
|
// virtual meshtastic_MeshPacket *allocReply() override;
|
||||||
|
virtual int32_t runOnce() override;
|
||||||
|
/**
|
||||||
|
* Send our Telemetry into the mesh
|
||||||
|
*/
|
||||||
|
bool sendMetrics();
|
||||||
|
|
||||||
|
private:
|
||||||
|
meshtastic_Telemetry getHostMetrics();
|
||||||
|
|
||||||
|
uint32_t lastSentToMesh = 0;
|
||||||
|
uint32_t uptimeWrapCount;
|
||||||
|
uint32_t uptimeLastMs;
|
||||||
|
};
|
@ -1,3 +1,7 @@
|
|||||||
|
/*
|
||||||
|
* Worth noting that both the AHT10 and AHT20 are supported without alteration.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
|
||||||
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include(<Adafruit_AHTX0.h>)
|
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include(<Adafruit_AHTX0.h>)
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
/*
|
||||||
|
* Worth noting that both the AHT10 and AHT20 are supported without alteration.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
|
||||||
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include(<Adafruit_AHTX0.h>)
|
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include(<Adafruit_AHTX0.h>)
|
||||||
|
@ -15,7 +15,7 @@ int32_t SHTC3Sensor::runOnce()
|
|||||||
if (!hasSensor()) {
|
if (!hasSensor()) {
|
||||||
return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS;
|
return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS;
|
||||||
}
|
}
|
||||||
status = shtc3.begin();
|
status = shtc3.begin(nodeTelemetrySensorsMap[sensorType].second);
|
||||||
return initI2CSensor();
|
return initI2CSensor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
|
||||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C
|
#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C
|
||||||
|
|
||||||
#include "../concurrency/OSThread.h"
|
#include "../concurrency/OSThread.h"
|
||||||
#ifdef HAS_BMA423
|
#ifdef HAS_BMA423
|
||||||
@ -81,14 +81,6 @@ class AccelerometerThread : public concurrency::OSThread
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef RAK_4631
|
|
||||||
if (!config.display.wake_on_tap_or_motion && !config.device.double_tap_as_button_press) {
|
|
||||||
LOG_DEBUG("AccelerometerThread Disable due to no interested configurations");
|
|
||||||
disable();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
switch (device.type) {
|
switch (device.type) {
|
||||||
#ifdef HAS_BMA423
|
#ifdef HAS_BMA423
|
||||||
case ScanI2C::DeviceType::BMA423:
|
case ScanI2C::DeviceType::BMA423:
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
BMX160Sensor::BMX160Sensor(ScanI2C::FoundDevice foundDevice) : MotionSensor::MotionSensor(foundDevice) {}
|
BMX160Sensor::BMX160Sensor(ScanI2C::FoundDevice foundDevice) : MotionSensor::MotionSensor(foundDevice) {}
|
||||||
|
|
||||||
#if defined(RAK_4631) && !defined(RAK2560) && __has_include(<Rak_BMX160.h>)
|
#if !defined(RAK2560) && __has_include(<Rak_BMX160.h>)
|
||||||
#if !defined(MESHTASTIC_EXCLUDE_SCREEN)
|
#if !defined(MESHTASTIC_EXCLUDE_SCREEN)
|
||||||
|
|
||||||
// screen is defined in main.cpp
|
// screen is defined in main.cpp
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
#include "ICM20948Sensor.h"
|
#include "ICM20948Sensor.h"
|
||||||
|
|
||||||
#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && __has_include(<ICM_20948.h>)
|
#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && __has_include(<ICM_20948.h>)
|
||||||
|
#if !defined(MESHTASTIC_EXCLUDE_SCREEN)
|
||||||
|
|
||||||
|
// screen is defined in main.cpp
|
||||||
|
extern graphics::Screen *screen;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Flag when an interrupt has been detected
|
// Flag when an interrupt has been detected
|
||||||
volatile static bool ICM20948_IRQ = false;
|
volatile static bool ICM20948_IRQ = false;
|
||||||
@ -41,6 +46,88 @@ int32_t ICM20948Sensor::runOnce()
|
|||||||
|
|
||||||
int32_t ICM20948Sensor::runOnce()
|
int32_t ICM20948Sensor::runOnce()
|
||||||
{
|
{
|
||||||
|
#if !defined(MESHTASTIC_EXCLUDE_SCREEN) && HAS_SCREEN
|
||||||
|
float magX = 0, magY = 0, magZ = 0;
|
||||||
|
if (sensor->dataReady()) {
|
||||||
|
sensor->getAGMT();
|
||||||
|
magX = sensor->agmt.mag.axes.x;
|
||||||
|
magY = sensor->agmt.mag.axes.y;
|
||||||
|
magZ = sensor->agmt.mag.axes.z;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (doCalibration) {
|
||||||
|
|
||||||
|
if (!showingScreen) {
|
||||||
|
powerFSM.trigger(EVENT_PRESS); // keep screen alive during calibration
|
||||||
|
showingScreen = true;
|
||||||
|
screen->startAlert((FrameCallback)drawFrameCalibration);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (magX > highestX)
|
||||||
|
highestX = magX;
|
||||||
|
if (magX < lowestX)
|
||||||
|
lowestX = magX;
|
||||||
|
if (magY > highestY)
|
||||||
|
highestY = magY;
|
||||||
|
if (magY < lowestY)
|
||||||
|
lowestY = magY;
|
||||||
|
if (magZ > highestZ)
|
||||||
|
highestZ = magZ;
|
||||||
|
if (magZ < lowestZ)
|
||||||
|
lowestZ = magZ;
|
||||||
|
|
||||||
|
uint32_t now = millis();
|
||||||
|
if (now > endCalibrationAt) {
|
||||||
|
doCalibration = false;
|
||||||
|
endCalibrationAt = 0;
|
||||||
|
showingScreen = false;
|
||||||
|
screen->endAlert();
|
||||||
|
}
|
||||||
|
|
||||||
|
// LOG_DEBUG("ICM20948 min_x: %.4f, max_X: %.4f, min_Y: %.4f, max_Y: %.4f, min_Z: %.4f, max_Z: %.4f", lowestX, highestX,
|
||||||
|
// lowestY, highestY, lowestZ, highestZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
magX -= (highestX + lowestX) / 2;
|
||||||
|
magY -= (highestY + lowestY) / 2;
|
||||||
|
magZ -= (highestZ + lowestZ) / 2;
|
||||||
|
FusionVector ga, ma;
|
||||||
|
ga.axis.x = (sensor->agmt.acc.axes.x);
|
||||||
|
ga.axis.y = -(sensor->agmt.acc.axes.y);
|
||||||
|
ga.axis.z = -(sensor->agmt.acc.axes.z);
|
||||||
|
ma.axis.x = magX;
|
||||||
|
ma.axis.y = magY;
|
||||||
|
ma.axis.z = magZ;
|
||||||
|
|
||||||
|
// If we're set to one of the inverted positions
|
||||||
|
if (config.display.compass_orientation > meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_270) {
|
||||||
|
ma = FusionAxesSwap(ma, FusionAxesAlignmentNXNYPZ);
|
||||||
|
ga = FusionAxesSwap(ga, FusionAxesAlignmentNXNYPZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
float heading = FusionCompassCalculateHeading(FusionConventionNed, ga, ma);
|
||||||
|
|
||||||
|
switch (config.display.compass_orientation) {
|
||||||
|
case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_0_INVERTED:
|
||||||
|
case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_0:
|
||||||
|
break;
|
||||||
|
case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_90:
|
||||||
|
case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_90_INVERTED:
|
||||||
|
heading += 90;
|
||||||
|
break;
|
||||||
|
case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_180:
|
||||||
|
case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_180_INVERTED:
|
||||||
|
heading += 180;
|
||||||
|
break;
|
||||||
|
case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_270:
|
||||||
|
case meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_270_INVERTED:
|
||||||
|
heading += 270;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
screen->setHeading(heading);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Wake on motion using polling - this is not as efficient as using hardware interrupt pin (see above)
|
// Wake on motion using polling - this is not as efficient as using hardware interrupt pin (see above)
|
||||||
auto status = sensor->setBank(0);
|
auto status = sensor->setBank(0);
|
||||||
if (sensor->status != ICM_20948_Stat_Ok) {
|
if (sensor->status != ICM_20948_Stat_Ok) {
|
||||||
@ -64,6 +151,17 @@ int32_t ICM20948Sensor::runOnce()
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void ICM20948Sensor::calibrate(uint16_t forSeconds)
|
||||||
|
{
|
||||||
|
#if !defined(MESHTASTIC_EXCLUDE_SCREEN) && HAS_SCREEN
|
||||||
|
LOG_DEBUG("BMX160 calibration started for %is", forSeconds);
|
||||||
|
|
||||||
|
doCalibration = true;
|
||||||
|
uint16_t calibrateFor = forSeconds * 1000; // calibrate for seconds provided
|
||||||
|
endCalibrationAt = millis() + calibrateFor;
|
||||||
|
screen->setEndCalibration(endCalibrationAt);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
// ICM20948Singleton
|
// ICM20948Singleton
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
@ -121,6 +219,11 @@ bool ICM20948Singleton::init(ScanI2C::FoundDevice device)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (startupMagnetometer(false) != ICM_20948_Stat_Ok) {
|
||||||
|
LOG_DEBUG("ICM20948 init magnetometer - %s", statusString());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef ICM_20948_INT_PIN
|
#ifdef ICM_20948_INT_PIN
|
||||||
|
|
||||||
// Active low
|
// Active low
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && __has_include(<ICM_20948.h>)
|
#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && __has_include(<ICM_20948.h>)
|
||||||
|
|
||||||
|
#include "Fusion/Fusion.h"
|
||||||
#include <ICM_20948.h>
|
#include <ICM_20948.h>
|
||||||
|
|
||||||
// Set the default gyro scale - dps250, dps500, dps1000, dps2000
|
// Set the default gyro scale - dps250, dps500, dps1000, dps2000
|
||||||
@ -80,6 +81,8 @@ class ICM20948Sensor : public MotionSensor
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
ICM20948Singleton *sensor = nullptr;
|
ICM20948Singleton *sensor = nullptr;
|
||||||
|
bool showingScreen = false;
|
||||||
|
float highestX = 0, lowestX = 0, highestY = 0, lowestY = 0, highestZ = 0, lowestZ = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ICM20948Sensor(ScanI2C::FoundDevice foundDevice);
|
explicit ICM20948Sensor(ScanI2C::FoundDevice foundDevice);
|
||||||
@ -89,6 +92,7 @@ class ICM20948Sensor : public MotionSensor
|
|||||||
|
|
||||||
// Called each time our sensor gets a chance to run
|
// Called each time our sensor gets a chance to run
|
||||||
virtual int32_t runOnce() override;
|
virtual int32_t runOnce() override;
|
||||||
|
virtual void calibrate(uint16_t forSeconds) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -31,7 +31,7 @@ ScanI2C::I2CPort MotionSensor::devicePort()
|
|||||||
return device.address.port;
|
return device.address.port;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(RAK_4631) & !MESHTASTIC_EXCLUDE_SCREEN
|
#if !defined(MESHTASTIC_EXCLUDE_SCREEN) && HAS_SCREEN
|
||||||
void MotionSensor::drawFrameCalibration(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
void MotionSensor::drawFrameCalibration(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
||||||
{
|
{
|
||||||
// int x_offset = display->width() / 2;
|
// int x_offset = display->width() / 2;
|
||||||
|
@ -49,7 +49,7 @@ class MotionSensor
|
|||||||
// Register a button press when a double-tap is detected
|
// Register a button press when a double-tap is detected
|
||||||
virtual void buttonPress();
|
virtual void buttonPress();
|
||||||
|
|
||||||
#if defined(RAK_4631) & !MESHTASTIC_EXCLUDE_SCREEN
|
#if !defined(MESHTASTIC_EXCLUDE_SCREEN) && HAS_SCREEN
|
||||||
// draw an OLED frame (currently only used by the RAK4631 BMX160 sensor)
|
// draw an OLED frame (currently only used by the RAK4631 BMX160 sensor)
|
||||||
static void drawFrameCalibration(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
static void drawFrameCalibration(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
||||||
#endif
|
#endif
|
||||||
|
@ -256,6 +256,11 @@ bool isDefaultServer(const String &host)
|
|||||||
return host.length() == 0 || host == default_mqtt_address;
|
return host.length() == 0 || host == default_mqtt_address;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isDefaultRootTopic(const String &root)
|
||||||
|
{
|
||||||
|
return root.length() == 0 || root == default_mqtt_root;
|
||||||
|
}
|
||||||
|
|
||||||
struct PubSubConfig {
|
struct PubSubConfig {
|
||||||
explicit PubSubConfig(const meshtastic_ModuleConfig_MQTTConfig &config)
|
explicit PubSubConfig(const meshtastic_ModuleConfig_MQTTConfig &config)
|
||||||
{
|
{
|
||||||
@ -387,10 +392,12 @@ MQTT::MQTT() : concurrency::OSThread("mqtt"), mqttQueue(MAX_MQTT_QUEUE)
|
|||||||
cryptTopic = moduleConfig.mqtt.root + cryptTopic;
|
cryptTopic = moduleConfig.mqtt.root + cryptTopic;
|
||||||
jsonTopic = moduleConfig.mqtt.root + jsonTopic;
|
jsonTopic = moduleConfig.mqtt.root + jsonTopic;
|
||||||
mapTopic = moduleConfig.mqtt.root + mapTopic;
|
mapTopic = moduleConfig.mqtt.root + mapTopic;
|
||||||
|
isConfiguredForDefaultRootTopic = isDefaultRootTopic(moduleConfig.mqtt.root);
|
||||||
} else {
|
} else {
|
||||||
cryptTopic = "msh" + cryptTopic;
|
cryptTopic = "msh" + cryptTopic;
|
||||||
jsonTopic = "msh" + jsonTopic;
|
jsonTopic = "msh" + jsonTopic;
|
||||||
mapTopic = "msh" + mapTopic;
|
mapTopic = "msh" + mapTopic;
|
||||||
|
isConfiguredForDefaultRootTopic = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (moduleConfig.mqtt.map_reporting_enabled && moduleConfig.mqtt.has_map_report_settings) {
|
if (moduleConfig.mqtt.map_reporting_enabled && moduleConfig.mqtt.has_map_report_settings) {
|
||||||
@ -762,7 +769,8 @@ void MQTT::onSend(const meshtastic_MeshPacket &mp_encrypted, const meshtastic_Me
|
|||||||
|
|
||||||
void MQTT::perhapsReportToMap()
|
void MQTT::perhapsReportToMap()
|
||||||
{
|
{
|
||||||
if (!moduleConfig.mqtt.map_reporting_enabled || !(moduleConfig.mqtt.proxy_to_client_enabled || isConnectedDirectly()))
|
if (!moduleConfig.mqtt.map_reporting_enabled || !moduleConfig.mqtt.map_report_settings.should_report_location ||
|
||||||
|
!(moduleConfig.mqtt.proxy_to_client_enabled || isConnectedDirectly()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Throttle::isWithinTimespanMs(last_report_to_map, map_publish_interval_msecs))
|
if (Throttle::isWithinTimespanMs(last_report_to_map, map_publish_interval_msecs))
|
||||||
@ -794,6 +802,7 @@ void MQTT::perhapsReportToMap()
|
|||||||
mapReport.region = config.lora.region;
|
mapReport.region = config.lora.region;
|
||||||
mapReport.modem_preset = config.lora.modem_preset;
|
mapReport.modem_preset = config.lora.modem_preset;
|
||||||
mapReport.has_default_channel = channels.hasDefaultChannel();
|
mapReport.has_default_channel = channels.hasDefaultChannel();
|
||||||
|
mapReport.has_opted_report_location = true;
|
||||||
|
|
||||||
// Set position with precision (same as in PositionModule)
|
// Set position with precision (same as in PositionModule)
|
||||||
if (map_position_precision < 32 && map_position_precision > 0) {
|
if (map_position_precision < 32 && map_position_precision > 0) {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "Default.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
|
||||||
#include "concurrency/OSThread.h"
|
#include "concurrency/OSThread.h"
|
||||||
@ -58,6 +59,7 @@ class MQTT : private concurrency::OSThread
|
|||||||
void start() { setIntervalFromNow(0); };
|
void start() { setIntervalFromNow(0); };
|
||||||
|
|
||||||
bool isUsingDefaultServer() { return isConfiguredForDefaultServer; }
|
bool isUsingDefaultServer() { return isConfiguredForDefaultServer; }
|
||||||
|
bool isUsingDefaultRootTopic() { return isConfiguredForDefaultRootTopic; }
|
||||||
|
|
||||||
/// Validate the meshtastic_ModuleConfig_MQTTConfig.
|
/// Validate the meshtastic_ModuleConfig_MQTTConfig.
|
||||||
static bool isValidConfig(const meshtastic_ModuleConfig_MQTTConfig &config) { return isValidConfig(config, nullptr); }
|
static bool isValidConfig(const meshtastic_ModuleConfig_MQTTConfig &config) { return isValidConfig(config, nullptr); }
|
||||||
@ -71,6 +73,7 @@ class MQTT : private concurrency::OSThread
|
|||||||
|
|
||||||
int reconnectCount = 0;
|
int reconnectCount = 0;
|
||||||
bool isConfiguredForDefaultServer = true;
|
bool isConfiguredForDefaultServer = true;
|
||||||
|
bool isConfiguredForDefaultRootTopic = true;
|
||||||
|
|
||||||
virtual int32_t runOnce() override;
|
virtual int32_t runOnce() override;
|
||||||
|
|
||||||
@ -104,7 +107,6 @@ class MQTT : private concurrency::OSThread
|
|||||||
|
|
||||||
// For map reporting (only applies when enabled)
|
// For map reporting (only applies when enabled)
|
||||||
const uint32_t default_map_position_precision = 14; // defaults to max. offset of ~1459m
|
const uint32_t default_map_position_precision = 14; // defaults to max. offset of ~1459m
|
||||||
const uint32_t default_map_publish_interval_secs = 60 * 15; // defaults to 15 minutes
|
|
||||||
uint32_t last_report_to_map = 0;
|
uint32_t last_report_to_map = 0;
|
||||||
uint32_t map_position_precision = default_map_position_precision;
|
uint32_t map_position_precision = default_map_position_precision;
|
||||||
uint32_t map_publish_interval_msecs = default_map_publish_interval_secs * 1000;
|
uint32_t map_publish_interval_msecs = default_map_publish_interval_secs * 1000;
|
||||||
|
@ -531,6 +531,8 @@ bool loadConfig(const char *configPath)
|
|||||||
settingsMap[displayPanel] = hx8357d;
|
settingsMap[displayPanel] = hx8357d;
|
||||||
else if (yamlConfig["Display"]["Panel"].as<std::string>("") == "X11")
|
else if (yamlConfig["Display"]["Panel"].as<std::string>("") == "X11")
|
||||||
settingsMap[displayPanel] = x11;
|
settingsMap[displayPanel] = x11;
|
||||||
|
else if (yamlConfig["Display"]["Panel"].as<std::string>("") == "FB")
|
||||||
|
settingsMap[displayPanel] = fb;
|
||||||
settingsMap[displayHeight] = yamlConfig["Display"]["Height"].as<int>(0);
|
settingsMap[displayHeight] = yamlConfig["Display"]["Height"].as<int>(0);
|
||||||
settingsMap[displayWidth] = yamlConfig["Display"]["Width"].as<int>(0);
|
settingsMap[displayWidth] = yamlConfig["Display"]["Width"].as<int>(0);
|
||||||
settingsMap[displayDC] = yamlConfig["Display"]["DC"].as<int>(-1);
|
settingsMap[displayDC] = yamlConfig["Display"]["DC"].as<int>(-1);
|
||||||
@ -598,6 +600,11 @@ bool loadConfig(const char *configPath)
|
|||||||
(yamlConfig["Webserver"]["SSLCert"]).as<std::string>("/etc/meshtasticd/ssl/certificate.pem");
|
(yamlConfig["Webserver"]["SSLCert"]).as<std::string>("/etc/meshtasticd/ssl/certificate.pem");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (yamlConfig["HostMetrics"]) {
|
||||||
|
settingsMap[hostMetrics_channel] = (yamlConfig["HostMetrics"]["Channel"]).as<int>(0);
|
||||||
|
settingsMap[hostMetrics_interval] = (yamlConfig["HostMetrics"]["ReportInterval"]).as<int>(0);
|
||||||
|
}
|
||||||
|
|
||||||
if (yamlConfig["General"]) {
|
if (yamlConfig["General"]) {
|
||||||
settingsMap[maxnodes] = (yamlConfig["General"]["MaxNodes"]).as<int>(200);
|
settingsMap[maxnodes] = (yamlConfig["General"]["MaxNodes"]).as<int>(200);
|
||||||
settingsMap[maxtophone] = (yamlConfig["General"]["MaxMessageQueue"]).as<int>(100);
|
settingsMap[maxtophone] = (yamlConfig["General"]["MaxMessageQueue"]).as<int>(100);
|
||||||
@ -649,3 +656,17 @@ bool MAC_from_string(std::string mac_str, uint8_t *dmac)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string exec(const char *cmd)
|
||||||
|
{ // https://stackoverflow.com/a/478960
|
||||||
|
std::array<char, 128> buffer;
|
||||||
|
std::string result;
|
||||||
|
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd, "r"), pclose);
|
||||||
|
if (!pipe) {
|
||||||
|
throw std::runtime_error("popen() failed!");
|
||||||
|
}
|
||||||
|
while (fgets(buffer.data(), static_cast<int>(buffer.size()), pipe.get()) != nullptr) {
|
||||||
|
result += buffer.data();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
@ -100,9 +100,11 @@ enum configNames {
|
|||||||
ascii_logs,
|
ascii_logs,
|
||||||
config_directory,
|
config_directory,
|
||||||
available_directory,
|
available_directory,
|
||||||
mac_address
|
mac_address,
|
||||||
|
hostMetrics_interval,
|
||||||
|
hostMetrics_channel
|
||||||
};
|
};
|
||||||
enum { no_screen, x11, st7789, st7735, st7735s, st7796, ili9341, ili9342, ili9486, ili9488, hx8357d };
|
enum { no_screen, x11, fb, st7789, st7735, st7735s, st7796, ili9341, ili9342, ili9486, ili9488, hx8357d };
|
||||||
enum { no_touchscreen, xpt2046, stmpe610, gt911, ft5x06 };
|
enum { no_touchscreen, xpt2046, stmpe610, gt911, ft5x06 };
|
||||||
enum { level_error, level_warn, level_info, level_debug, level_trace };
|
enum { level_error, level_warn, level_info, level_debug, level_trace };
|
||||||
|
|
||||||
@ -115,3 +117,4 @@ bool loadConfig(const char *configPath);
|
|||||||
static bool ends_with(std::string_view str, std::string_view suffix);
|
static bool ends_with(std::string_view str, std::string_view suffix);
|
||||||
void getMacAddr(uint8_t *dmac);
|
void getMacAddr(uint8_t *dmac);
|
||||||
bool MAC_from_string(std::string mac_str, uint8_t *dmac);
|
bool MAC_from_string(std::string mac_str, uint8_t *dmac);
|
||||||
|
std::string exec(const char *cmd);
|
@ -24,6 +24,7 @@
|
|||||||
#include "mesh/wifi/WiFiAPClient.h"
|
#include "mesh/wifi/WiFiAPClient.h"
|
||||||
#endif
|
#endif
|
||||||
#include "rom/rtc.h"
|
#include "rom/rtc.h"
|
||||||
|
#include <RadioLib.h>
|
||||||
#include <driver/rtc_io.h>
|
#include <driver/rtc_io.h>
|
||||||
#include <driver/uart.h>
|
#include <driver/uart.h>
|
||||||
|
|
||||||
@ -284,6 +285,8 @@ void doDeepSleep(uint32_t msecToWake, bool skipPreflight = false, bool skipSaveN
|
|||||||
pinMode(LORA_CS, OUTPUT);
|
pinMode(LORA_CS, OUTPUT);
|
||||||
digitalWrite(LORA_CS, HIGH);
|
digitalWrite(LORA_CS, HIGH);
|
||||||
gpio_hold_en((gpio_num_t)LORA_CS);
|
gpio_hold_en((gpio_num_t)LORA_CS);
|
||||||
|
#elif defined(ELECROW_PANEL)
|
||||||
|
// Elecrow panels do not use LORA_CS, do nothing
|
||||||
#else
|
#else
|
||||||
if (GPIO_IS_VALID_OUTPUT_GPIO(LORA_CS)) {
|
if (GPIO_IS_VALID_OUTPUT_GPIO(LORA_CS)) {
|
||||||
// LoRa CS (RADIO_NSS) needs to stay HIGH, even during deep sleep
|
// LoRa CS (RADIO_NSS) needs to stay HIGH, even during deep sleep
|
||||||
@ -400,7 +403,7 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r
|
|||||||
#ifdef INPUTDRIVER_ENCODER_BTN
|
#ifdef INPUTDRIVER_ENCODER_BTN
|
||||||
gpio_wakeup_enable((gpio_num_t)INPUTDRIVER_ENCODER_BTN, GPIO_INTR_LOW_LEVEL);
|
gpio_wakeup_enable((gpio_num_t)INPUTDRIVER_ENCODER_BTN, GPIO_INTR_LOW_LEVEL);
|
||||||
#endif
|
#endif
|
||||||
#if defined(T_WATCH_S3) || defined(ELECROW)
|
#if defined(WAKE_ON_TOUCH)
|
||||||
gpio_wakeup_enable((gpio_num_t)SCREEN_TOUCH_INT, GPIO_INTR_LOW_LEVEL);
|
gpio_wakeup_enable((gpio_num_t)SCREEN_TOUCH_INT, GPIO_INTR_LOW_LEVEL);
|
||||||
#endif
|
#endif
|
||||||
enableLoraInterrupt();
|
enableLoraInterrupt();
|
||||||
@ -433,11 +436,12 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r
|
|||||||
// Disable wake-on-button interrupt. Re-attach normal button-interrupts
|
// Disable wake-on-button interrupt. Re-attach normal button-interrupts
|
||||||
gpio_wakeup_disable(pin);
|
gpio_wakeup_disable(pin);
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(INPUTDRIVER_ENCODER_BTN)
|
||||||
#if defined(T_WATCH_S3) || defined(ELECROW)
|
gpio_wakeup_disable((gpio_num_t)INPUTDRIVER_ENCODER_BTN);
|
||||||
|
#endif
|
||||||
|
#if defined(WAKE_ON_TOUCH)
|
||||||
gpio_wakeup_disable((gpio_num_t)SCREEN_TOUCH_INT);
|
gpio_wakeup_disable((gpio_num_t)SCREEN_TOUCH_INT);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(SOC_PM_SUPPORT_EXT_WAKEUP) && defined(LORA_DIO1) && (LORA_DIO1 != RADIOLIB_NC)
|
#if !defined(SOC_PM_SUPPORT_EXT_WAKEUP) && defined(LORA_DIO1) && (LORA_DIO1 != RADIOLIB_NC)
|
||||||
if (radioType != RF95_RADIO) {
|
if (radioType != RF95_RADIO) {
|
||||||
gpio_wakeup_disable((gpio_num_t)LORA_DIO1);
|
gpio_wakeup_disable((gpio_num_t)LORA_DIO1);
|
||||||
@ -506,23 +510,24 @@ bool shouldLoraWake(uint32_t msecToWake)
|
|||||||
|
|
||||||
void enableLoraInterrupt()
|
void enableLoraInterrupt()
|
||||||
{
|
{
|
||||||
|
esp_err_t res;
|
||||||
#if SOC_PM_SUPPORT_EXT_WAKEUP && defined(LORA_DIO1) && (LORA_DIO1 != RADIOLIB_NC)
|
#if SOC_PM_SUPPORT_EXT_WAKEUP && defined(LORA_DIO1) && (LORA_DIO1 != RADIOLIB_NC)
|
||||||
gpio_pulldown_en((gpio_num_t)LORA_DIO1);
|
res = gpio_pulldown_en((gpio_num_t)LORA_DIO1);
|
||||||
|
if (res != ESP_OK) {
|
||||||
|
LOG_ERROR("gpio_pulldown_en(LORA_DIO1) result %d", res);
|
||||||
|
}
|
||||||
#if defined(LORA_RESET) && (LORA_RESET != RADIOLIB_NC)
|
#if defined(LORA_RESET) && (LORA_RESET != RADIOLIB_NC)
|
||||||
gpio_pullup_en((gpio_num_t)LORA_RESET);
|
res = gpio_pullup_en((gpio_num_t)LORA_RESET);
|
||||||
|
if (res != ESP_OK) {
|
||||||
|
LOG_ERROR("gpio_pullup_en(LORA_RESET) result %d", res);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(LORA_CS) && (LORA_CS != RADIOLIB_NC)
|
#if defined(LORA_CS) && (LORA_CS != RADIOLIB_NC) && !defined(ELECROW_PANEL)
|
||||||
gpio_pullup_en((gpio_num_t)LORA_CS);
|
gpio_pullup_en((gpio_num_t)LORA_CS);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (rtc_gpio_is_valid_gpio((gpio_num_t)LORA_DIO1)) {
|
|
||||||
// Setup light/deep sleep with wakeup by external source
|
|
||||||
LOG_INFO("setup LORA_DIO1 (GPIO%02d) with wakeup by external source", LORA_DIO1);
|
|
||||||
esp_sleep_enable_ext0_wakeup((gpio_num_t)LORA_DIO1, HIGH);
|
|
||||||
} else {
|
|
||||||
LOG_INFO("setup LORA_DIO1 (GPIO%02d) with wakeup by gpio interrupt", LORA_DIO1);
|
LOG_INFO("setup LORA_DIO1 (GPIO%02d) with wakeup by gpio interrupt", LORA_DIO1);
|
||||||
gpio_wakeup_enable((gpio_num_t)LORA_DIO1, GPIO_INTR_HIGH_LEVEL);
|
gpio_wakeup_enable((gpio_num_t)LORA_DIO1, GPIO_INTR_HIGH_LEVEL);
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined(LORA_DIO1) && (LORA_DIO1 != RADIOLIB_NC)
|
#elif defined(LORA_DIO1) && (LORA_DIO1 != RADIOLIB_NC)
|
||||||
if (radioType != RF95_RADIO) {
|
if (radioType != RF95_RADIO) {
|
||||||
|
@ -310,6 +310,8 @@ void setUp(void)
|
|||||||
{
|
{
|
||||||
moduleConfig.mqtt =
|
moduleConfig.mqtt =
|
||||||
meshtastic_ModuleConfig_MQTTConfig{.enabled = true, .map_reporting_enabled = true, .has_map_report_settings = true};
|
meshtastic_ModuleConfig_MQTTConfig{.enabled = true, .map_reporting_enabled = true, .has_map_report_settings = true};
|
||||||
|
moduleConfig.mqtt.map_report_settings = meshtastic_ModuleConfig_MapReportSettings{
|
||||||
|
.publish_interval_secs = 0, .position_precision = 14, .should_report_location = true};
|
||||||
channelFile.channels[0] = meshtastic_Channel{
|
channelFile.channels[0] = meshtastic_Channel{
|
||||||
.index = 0,
|
.index = 0,
|
||||||
.has_settings = true,
|
.has_settings = true,
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
{
|
{
|
||||||
// "USERPREFS_BUTTON_PIN": "36",
|
// "USERPREFS_BUTTON_PIN": "36",
|
||||||
// "USERPREFS_CHANNELS_TO_WRITE": "3",
|
// "USERPREFS_CHANNELS_TO_WRITE": "3",
|
||||||
// "USERPREFS_CHANNEL_0_DOWNLINK_ENABLED": "true",
|
// "USERPREFS_CHANNEL_0_DOWNLINK_ENABLED": "false",
|
||||||
// "USERPREFS_CHANNEL_0_NAME": "DEFCONnect",
|
// "USERPREFS_CHANNEL_0_NAME": "REPLACEME",
|
||||||
// "USERPREFS_CHANNEL_0_PRECISION": "14",
|
// "USERPREFS_CHANNEL_0_PRECISION": "14",
|
||||||
// "USERPREFS_CHANNEL_0_PSK": "{ 0x38, 0x4b, 0xbc, 0xc0, 0x1d, 0xc0, 0x22, 0xd1, 0x81, 0xbf, 0x36, 0xb8, 0x61, 0x21, 0xe1, 0xfb, 0x96, 0xb7, 0x2e, 0x55, 0xbf, 0x74, 0x22, 0x7e, 0x9d, 0x6a, 0xfb, 0x48, 0xd6, 0x4c, 0xb1, 0xa1 }",
|
// "USERPREFS_CHANNEL_0_PSK": "{ 0x38, 0x4b, 0xbc, 0xc0, 0x1d, 0xc0, 0x22, 0xd1, 0x81, 0xbf, 0x36, 0xb8, 0x61, 0x21, 0xe1, 0xfb, 0x96, 0xb7, 0x2e, 0x55, 0xbf, 0x74, 0x22, 0x7e, 0x9d, 0x6a, 0xfb, 0x48, 0xd6, 0x4c, 0xb1, 0xa1 }",
|
||||||
// "USERPREFS_CHANNEL_0_UPLINK_ENABLED": "true",
|
// "USERPREFS_CHANNEL_0_UPLINK_ENABLED": "true",
|
||||||
// "USERPREFS_CHANNEL_1_DOWNLINK_ENABLED": "true",
|
// "USERPREFS_CHANNEL_1_DOWNLINK_ENABLED": "false",
|
||||||
// "USERPREFS_CHANNEL_1_NAME": "REPLACEME",
|
// "USERPREFS_CHANNEL_1_NAME": "NodeChat",
|
||||||
// "USERPREFS_CHANNEL_1_PRECISION": "14",
|
// "USERPREFS_CHANNEL_1_PRECISION": "14",
|
||||||
// "USERPREFS_CHANNEL_1_PSK": "{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }",
|
// "USERPREFS_CHANNEL_1_PSK": "{ 0x4e, 0x22, 0x1d, 0x8b, 0xc3, 0x09, 0x1b, 0xe2, 0x11, 0x9c, 0x89, 0x12, 0xf2, 0x25, 0x19, 0x5d, 0x15, 0x3e, 0x30, 0x7b, 0x86, 0xb6, 0xec, 0xc4, 0x6a, 0xc3, 0x96, 0x5e, 0x9e, 0x10, 0x9d, 0xd5 }",
|
||||||
// "USERPREFS_CHANNEL_1_UPLINK_ENABLED": "true",
|
// "USERPREFS_CHANNEL_1_UPLINK_ENABLED": "false",
|
||||||
// "USERPREFS_CHANNEL_2_DOWNLINK_ENABLED": "true",
|
// "USERPREFS_CHANNEL_2_DOWNLINK_ENABLED": "false",
|
||||||
// "USERPREFS_CHANNEL_2_NAME": "REPLACEME",
|
// "USERPREFS_CHANNEL_2_NAME": "YardSale",
|
||||||
// "USERPREFS_CHANNEL_2_PRECISION": "14",
|
// "USERPREFS_CHANNEL_2_PRECISION": "14",
|
||||||
// "USERPREFS_CHANNEL_2_PSK": "{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }",
|
// "USERPREFS_CHANNEL_2_PSK": "{ 0x15, 0x6f, 0xfe, 0x46, 0xd4, 0x56, 0x63, 0x8a, 0x54, 0x43, 0x13, 0xf2, 0xef, 0x6c, 0x63, 0x89, 0xf0, 0x06, 0x30, 0x52, 0xce, 0x36, 0x5e, 0xb1, 0xe8, 0xbb, 0x86, 0xe6, 0x26, 0x5b, 0x1d, 0x58 }",
|
||||||
// "USERPREFS_CHANNEL_2_UPLINK_ENABLED": "true",
|
// "USERPREFS_CHANNEL_2_UPLINK_ENABLED": "false",
|
||||||
// "USERPREFS_CONFIG_GPS_MODE": "meshtastic_Config_PositionConfig_GpsMode_ENABLED",
|
// "USERPREFS_CONFIG_GPS_MODE": "meshtastic_Config_PositionConfig_GpsMode_ENABLED",
|
||||||
// "USERPREFS_CONFIG_LORA_IGNORE_MQTT": "true",
|
// "USERPREFS_CONFIG_LORA_IGNORE_MQTT": "true",
|
||||||
// "USERPREFS_CONFIG_LORA_REGION": "meshtastic_Config_LoRaConfig_RegionCode_US",
|
// "USERPREFS_CONFIG_LORA_REGION": "meshtastic_Config_LoRaConfig_RegionCode_US",
|
||||||
@ -44,5 +44,12 @@
|
|||||||
// "USERPREFS_NETWORK_WIFI_ENABLED": "true",
|
// "USERPREFS_NETWORK_WIFI_ENABLED": "true",
|
||||||
// "USERPREFS_NETWORK_WIFI_SSID": "wifi_ssid",
|
// "USERPREFS_NETWORK_WIFI_SSID": "wifi_ssid",
|
||||||
// "USERPREFS_NETWORK_WIFI_PSK": "wifi_psk",
|
// "USERPREFS_NETWORK_WIFI_PSK": "wifi_psk",
|
||||||
|
// "USERPREFS_MQTT_ENABLED": "1",
|
||||||
|
// "USERPREFS_MQTT_ADDRESS": "'mqtt.meshtastic.org'",
|
||||||
|
// "USERPREFS_MQTT_USERNAME": "meshdev",
|
||||||
|
// "USERPREFS_MQTT_PASSWORD": "large4cats",
|
||||||
|
// "USERPREFS_MQTT_ENCRYPTION_ENABLED": "true",
|
||||||
|
// "USERPREFS_MQTT_TLS_ENABLED": "false",
|
||||||
|
// "USERPREFS_MQTT_ROOT_TOPIC": "event/REPLACEME",
|
||||||
"USERPREFS_TZ_STRING": "tzplaceholder "
|
"USERPREFS_TZ_STRING": "tzplaceholder "
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ board_level = extra
|
|||||||
extends = nrf52840_base
|
extends = nrf52840_base
|
||||||
board = nordic_pca10059
|
board = nordic_pca10059
|
||||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/Dongle_nRF52840-pca10059-v1 -D NORDIC_PCA10059
|
build_flags = ${nrf52840_base.build_flags} -Ivariants/Dongle_nRF52840-pca10059-v1 -D NORDIC_PCA10059
|
||||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
|
||||||
-DEINK_DISPLAY_MODEL=GxEPD2_420_M01
|
-DEINK_DISPLAY_MODEL=GxEPD2_420_M01
|
||||||
-DEINK_WIDTH=300
|
-DEINK_WIDTH=300
|
||||||
-DEINK_HEIGHT=400
|
-DEINK_HEIGHT=400
|
||||||
|
@ -9,7 +9,6 @@ debug_tool = jlink
|
|||||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/ELECROW-ThinkNode-M1
|
build_flags = ${nrf52840_base.build_flags} -Ivariants/ELECROW-ThinkNode-M1
|
||||||
-DELECROW_ThinkNode_M1
|
-DELECROW_ThinkNode_M1
|
||||||
-DGPS_POWER_TOGGLE
|
-DGPS_POWER_TOGGLE
|
||||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
|
||||||
-DUSE_EINK
|
-DUSE_EINK
|
||||||
-DEINK_DISPLAY_MODEL=GxEPD2_154_D67
|
-DEINK_DISPLAY_MODEL=GxEPD2_154_D67
|
||||||
-DEINK_WIDTH=200
|
-DEINK_WIDTH=200
|
||||||
@ -39,7 +38,6 @@ build_flags =
|
|||||||
${inkhud.build_flags}
|
${inkhud.build_flags}
|
||||||
-I variants/ELECROW-ThinkNode-M1
|
-I variants/ELECROW-ThinkNode-M1
|
||||||
-D ELECROW_ThinkNode_M1
|
-D ELECROW_ThinkNode_M1
|
||||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
|
||||||
build_src_filter =
|
build_src_filter =
|
||||||
${nrf52_base.build_src_filter}
|
${nrf52_base.build_src_filter}
|
||||||
${inkhud.build_src_filter}
|
${inkhud.build_src_filter}
|
||||||
|
@ -4,7 +4,6 @@ board = me25ls01-4y10td
|
|||||||
board_level = extra
|
board_level = extra
|
||||||
; platform = https://github.com/maxgerhardt/platform-nordicnrf52#cac6fcf943a41accd2aeb4f3659ae297a73f422e
|
; platform = https://github.com/maxgerhardt/platform-nordicnrf52#cac6fcf943a41accd2aeb4f3659ae297a73f422e
|
||||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/ME25LS01-4Y10TD -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DME25LS01_4Y10TD
|
build_flags = ${nrf52840_base.build_flags} -Ivariants/ME25LS01-4Y10TD -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DME25LS01_4Y10TD
|
||||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
|
||||||
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||||
board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld
|
board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld
|
||||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/ME25LS01-4Y10TD>
|
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/ME25LS01-4Y10TD>
|
||||||
|
@ -4,7 +4,6 @@ board = me25ls01-4y10td
|
|||||||
board_level = extra
|
board_level = extra
|
||||||
; platform = https://github.com/maxgerhardt/platform-nordicnrf52#cac6fcf943a41accd2aeb4f3659ae297a73f422e
|
; platform = https://github.com/maxgerhardt/platform-nordicnrf52#cac6fcf943a41accd2aeb4f3659ae297a73f422e
|
||||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/ME25LS01-4Y10TD_e-ink -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DME25LS01_4Y10TD
|
build_flags = ${nrf52840_base.build_flags} -Ivariants/ME25LS01-4Y10TD_e-ink -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DME25LS01_4Y10TD
|
||||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
|
||||||
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||||
-DEINK_DISPLAY_MODEL=GxEPD2_420_GDEY042T81
|
-DEINK_DISPLAY_MODEL=GxEPD2_420_GDEY042T81
|
||||||
-DEINK_WIDTH=400
|
-DEINK_WIDTH=400
|
||||||
|
@ -4,7 +4,6 @@ board = ms24sf1
|
|||||||
board_level = extra
|
board_level = extra
|
||||||
; platform = https://github.com/maxgerhardt/platform-nordicnrf52#cac6fcf943a41accd2aeb4f3659ae297a73f422e
|
; platform = https://github.com/maxgerhardt/platform-nordicnrf52#cac6fcf943a41accd2aeb4f3659ae297a73f422e
|
||||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/MS24SF1 -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52
|
build_flags = ${nrf52840_base.build_flags} -Ivariants/MS24SF1 -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52
|
||||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
|
||||||
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||||
board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld
|
board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld
|
||||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/MS24SF1>
|
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/MS24SF1>
|
||||||
|
@ -3,7 +3,6 @@ board_level = extra
|
|||||||
extends = nrf52840_base
|
extends = nrf52840_base
|
||||||
board = nordic_pca10059
|
board = nordic_pca10059
|
||||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/MakePython_nRF52840_eink -D PRIVATE_HW
|
build_flags = ${nrf52840_base.build_flags} -Ivariants/MakePython_nRF52840_eink -D PRIVATE_HW
|
||||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
|
||||||
-D PIN_EINK_EN
|
-D PIN_EINK_EN
|
||||||
-DEINK_DISPLAY_MODEL=GxEPD2_290_T5D
|
-DEINK_DISPLAY_MODEL=GxEPD2_290_T5D
|
||||||
-DEINK_WIDTH=296
|
-DEINK_WIDTH=296
|
||||||
|
@ -3,7 +3,6 @@ board_level = extra
|
|||||||
extends = nrf52840_base
|
extends = nrf52840_base
|
||||||
board = nordic_pca10059
|
board = nordic_pca10059
|
||||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/MakePython_nRF52840_oled -D PRIVATE_HW
|
build_flags = ${nrf52840_base.build_flags} -Ivariants/MakePython_nRF52840_oled -D PRIVATE_HW
|
||||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
|
||||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/MakePython_nRF52840_oled>
|
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/MakePython_nRF52840_oled>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${nrf52840_base.lib_deps}
|
${nrf52840_base.lib_deps}
|
||||||
|
@ -6,7 +6,6 @@ debug_tool = jlink
|
|||||||
|
|
||||||
# add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling.
|
# add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling.
|
||||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/canaryone
|
build_flags = ${nrf52840_base.build_flags} -Ivariants/canaryone
|
||||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
|
||||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/canaryone>
|
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/canaryone>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${nrf52840_base.lib_deps}
|
${nrf52840_base.lib_deps}
|
||||||
|
@ -50,7 +50,6 @@ board_level = extra
|
|||||||
build_flags = ${nrf52840_base.build_flags}
|
build_flags = ${nrf52840_base.build_flags}
|
||||||
-I variants/diy/nrf52_promicro_diy_xtal
|
-I variants/diy/nrf52_promicro_diy_xtal
|
||||||
-D NRF52_PROMICRO_DIY
|
-D NRF52_PROMICRO_DIY
|
||||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
|
||||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/diy/nrf52_promicro_diy_xtal>
|
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/diy/nrf52_promicro_diy_xtal>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${nrf52840_base.lib_deps}
|
${nrf52840_base.lib_deps}
|
||||||
@ -64,7 +63,6 @@ board = promicro-nrf52840
|
|||||||
build_flags = ${nrf52840_base.build_flags}
|
build_flags = ${nrf52840_base.build_flags}
|
||||||
-I variants/diy/nrf52_promicro_diy_tcxo
|
-I variants/diy/nrf52_promicro_diy_tcxo
|
||||||
-D NRF52_PROMICRO_DIY
|
-D NRF52_PROMICRO_DIY
|
||||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
|
||||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/diy/nrf52_promicro_diy_tcxo>
|
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/diy/nrf52_promicro_diy_tcxo>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${nrf52840_base.lib_deps}
|
${nrf52840_base.lib_deps}
|
||||||
@ -77,7 +75,6 @@ extends = nrf52840_base
|
|||||||
board_level = extra
|
board_level = extra
|
||||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/diy/seeed-xiao-nrf52840-wio-sx1262 -D PRIVATE_HW
|
build_flags = ${nrf52840_base.build_flags} -Ivariants/diy/seeed-xiao-nrf52840-wio-sx1262 -D PRIVATE_HW
|
||||||
-Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52
|
-Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52
|
||||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
|
||||||
board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld
|
board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld
|
||||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/diy/seeed-xiao-nrf52840-wio-sx1262>
|
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/diy/seeed-xiao-nrf52840-wio-sx1262>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
|
@ -8,7 +8,6 @@ build_flags = ${rp2040_base.build_flags}
|
|||||||
-Ivariants/ec_catsniffer
|
-Ivariants/ec_catsniffer
|
||||||
-DDEBUG_RP2040_PORT=Serial
|
-DDEBUG_RP2040_PORT=Serial
|
||||||
# -DHW_SPI1_DEVICE
|
# -DHW_SPI1_DEVICE
|
||||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus"
|
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${rp2040_base.lib_deps}
|
${rp2040_base.lib_deps}
|
||||||
debug_build_flags = ${rp2040_base.build_flags}, -g
|
debug_build_flags = ${rp2040_base.build_flags}, -g
|
||||||
|
@ -3,13 +3,11 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
// static const uint8_t LED_BUILTIN = -1;
|
static const uint8_t TX = 43;
|
||||||
|
static const uint8_t RX = 44;
|
||||||
|
|
||||||
// static const uint8_t TX = 43;
|
static const uint8_t SDA = 15;
|
||||||
// static const uint8_t RX = 44;
|
static const uint8_t SCL = 16;
|
||||||
|
|
||||||
static const uint8_t SDA = 39;
|
|
||||||
static const uint8_t SCL = 40;
|
|
||||||
|
|
||||||
// Default SPI will be mapped to Radio
|
// Default SPI will be mapped to Radio
|
||||||
static const uint8_t SS = -1;
|
static const uint8_t SS = -1;
|
||||||
@ -17,13 +15,9 @@ static const uint8_t MOSI = 48;
|
|||||||
static const uint8_t MISO = 47;
|
static const uint8_t MISO = 47;
|
||||||
static const uint8_t SCK = 41;
|
static const uint8_t SCK = 41;
|
||||||
|
|
||||||
#ifndef CROW_SELECT
|
|
||||||
static const uint8_t SPI_MOSI = 6;
|
static const uint8_t SPI_MOSI = 6;
|
||||||
static const uint8_t SPI_SCK = 5;
|
static const uint8_t SPI_SCK = 5;
|
||||||
static const uint8_t SPI_MISO = 4;
|
static const uint8_t SPI_MISO = 4;
|
||||||
static const uint8_t SPI_CS = 7; // SD does not support -1
|
|
||||||
static const uint8_t SDCARD_CS = SPI_CS;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static const uint8_t A0 = 1;
|
static const uint8_t A0 = 1;
|
||||||
static const uint8_t A1 = 2;
|
static const uint8_t A1 = 2;
|
||||||
|
@ -4,10 +4,8 @@ board = crowpanel
|
|||||||
board_check = true
|
board_check = true
|
||||||
upload_protocol = esptool
|
upload_protocol = esptool
|
||||||
board_build.partitions = default_16MB.csv ; must be here for some reason, board.json is not enough !?
|
board_build.partitions = default_16MB.csv ; must be here for some reason, board.json is not enough !?
|
||||||
|
|
||||||
build_flags = ${esp32s3_base.build_flags} -Os
|
build_flags = ${esp32s3_base.build_flags} -Os
|
||||||
-I variants/elecrow_panel
|
-I variants/elecrow_panel
|
||||||
-D ELECROW
|
|
||||||
-D ELECROW_PANEL
|
-D ELECROW_PANEL
|
||||||
-D CONFIG_ARDUHAL_LOG_COLORS
|
-D CONFIG_ARDUHAL_LOG_COLORS
|
||||||
-D RADIOLIB_DEBUG_SPI=0
|
-D RADIOLIB_DEBUG_SPI=0
|
||||||
@ -22,9 +20,9 @@ build_flags = ${esp32s3_base.build_flags} -Os
|
|||||||
-D MESHTASTIC_EXCLUDE_SOCKETAPI=1
|
-D MESHTASTIC_EXCLUDE_SOCKETAPI=1
|
||||||
-D MESHTASTIC_EXCLUDE_SCREEN=1
|
-D MESHTASTIC_EXCLUDE_SCREEN=1
|
||||||
-D MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1
|
-D MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1
|
||||||
; -D INPUTDRIVER_BUTTON_TYPE=0
|
|
||||||
-D HAS_TELEMETRY=0
|
-D HAS_TELEMETRY=0
|
||||||
-D CONFIG_DISABLE_HAL_LOCKS=1
|
-D CONFIG_DISABLE_HAL_LOCKS=1
|
||||||
|
-D USE_PIN_BUZZER
|
||||||
-D HAS_SCREEN=0
|
-D HAS_SCREEN=0
|
||||||
-D HAS_TFT=1
|
-D HAS_TFT=1
|
||||||
-D RAM_SIZE=6144
|
-D RAM_SIZE=6144
|
||||||
@ -40,29 +38,44 @@ build_flags = ${esp32s3_base.build_flags} -Os
|
|||||||
-D USE_LOG_DEBUG
|
-D USE_LOG_DEBUG
|
||||||
-D LOG_DEBUG_INC=\"DebugConfiguration.h\"
|
-D LOG_DEBUG_INC=\"DebugConfiguration.h\"
|
||||||
-D USE_PACKET_API
|
-D USE_PACKET_API
|
||||||
|
-D HAS_SDCARD
|
||||||
|
-D SD_SPI_FREQUENCY=75000000
|
||||||
|
|
||||||
lib_deps = ${esp32s3_base.lib_deps}
|
lib_deps = ${esp32s3_base.lib_deps}
|
||||||
${device-ui_base.lib_deps}
|
${device-ui_base.lib_deps}
|
||||||
earlephilhower/ESP8266Audio@^1.9.9
|
earlephilhower/ESP8266Audio@1.9.9
|
||||||
earlephilhower/ESP8266SAM@^1.0.1
|
earlephilhower/ESP8266SAM@1.0.1
|
||||||
lovyan03/LovyanGFX@^1.2.0
|
lovyan03/LovyanGFX@1.2.0 ; note: v1.2.7 breaks the elecrow 7" display functionality
|
||||||
hideakitai/TCA9534@^0.1.1
|
hideakitai/TCA9534@0.1.1
|
||||||
|
|
||||||
[env:elecrow-24-28-tft]
|
[crowpanel_small] ; 2.4, 2.8, 3.5 inch
|
||||||
extends = crowpanel_base
|
extends = crowpanel_base
|
||||||
|
|
||||||
build_flags =
|
build_flags =
|
||||||
${crowpanel_base.build_flags}
|
${crowpanel_base.build_flags}
|
||||||
-D TFT_HEIGHT=320 ; needed in variant.h
|
-D CROW_SELECT=1
|
||||||
-D HAS_SDCARD
|
|
||||||
-D SDCARD_USE_SOFT_SPI
|
-D SDCARD_USE_SOFT_SPI
|
||||||
|
-D SDCARD_CS=7
|
||||||
-D SPI_DRIVER_SELECT=2
|
-D SPI_DRIVER_SELECT=2
|
||||||
-D USE_PIN_BUZZER
|
|
||||||
; -D INPUTDRIVER_BUTTON_TYPE=0 ; no button as this pin is assigned to LoRa cs!
|
|
||||||
-D SCREEN_TOUCH_INT=47 ; used to wake up the MCU by touch
|
|
||||||
-D LGFX_DRIVER_TEMPLATE
|
-D LGFX_DRIVER_TEMPLATE
|
||||||
-D LGFX_DRIVER=LGFX_GENERIC
|
-D LGFX_DRIVER=LGFX_GENERIC
|
||||||
-D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_GENERIC.h\"
|
-D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_GENERIC.h\"
|
||||||
|
-D VIEW_320x240
|
||||||
|
-D MAP_FULL_REDRAW
|
||||||
|
|
||||||
|
[crowpanel_large] ; 4.3, 5.0, 7.0 inch
|
||||||
|
extends = crowpanel_base
|
||||||
|
build_flags =
|
||||||
|
${crowpanel_base.build_flags}
|
||||||
|
-D CROW_SELECT=2
|
||||||
|
-D SDCARD_CS=7
|
||||||
|
-D LGFX_DRIVER=LGFX_ELECROW70
|
||||||
|
-D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_ELECROW70.h\"
|
||||||
|
-D DISPLAY_SET_RESOLUTION
|
||||||
|
|
||||||
|
[env:elecrow-adv-24-28-tft]
|
||||||
|
extends = crowpanel_small
|
||||||
|
build_flags =
|
||||||
|
${crowpanel_small.build_flags}
|
||||||
-D SPI_FREQUENCY=80000000
|
-D SPI_FREQUENCY=80000000
|
||||||
-D LGFX_SCREEN_WIDTH=240
|
-D LGFX_SCREEN_WIDTH=240
|
||||||
-D LGFX_SCREEN_HEIGHT=320
|
-D LGFX_SCREEN_HEIGHT=320
|
||||||
@ -81,25 +94,12 @@ build_flags =
|
|||||||
-D LGFX_TOUCH_INT=47
|
-D LGFX_TOUCH_INT=47
|
||||||
-D LGFX_TOUCH_RST=48
|
-D LGFX_TOUCH_RST=48
|
||||||
-D LGFX_TOUCH_ROTATION=0
|
-D LGFX_TOUCH_ROTATION=0
|
||||||
-D VIEW_320x240
|
|
||||||
-D MAP_FULL_REDRAW
|
|
||||||
|
|
||||||
[env:elecrow-35-tft]
|
|
||||||
extends = crowpanel_base
|
|
||||||
|
|
||||||
|
[env:elecrow-adv-35-tft]
|
||||||
|
extends = crowpanel_small
|
||||||
build_flags =
|
build_flags =
|
||||||
${crowpanel_base.build_flags}
|
${crowpanel_small.build_flags}
|
||||||
-D TFT_HEIGHT=480 ; needed in variant.h
|
|
||||||
-D HAS_SDCARD
|
|
||||||
-D SDCARD_USE_SOFT_SPI
|
|
||||||
-D SPI_DRIVER_SELECT=2
|
|
||||||
-D USE_PIN_BUZZER
|
|
||||||
; -D INPUTDRIVER_BUTTON_TYPE=0 ; no button as this pin is assigned to LoRa cs!
|
|
||||||
-D SCREEN_TOUCH_INT=47 ; used to wake up the MCU by touch
|
|
||||||
-D LV_CACHE_DEF_SIZE=2097152
|
-D LV_CACHE_DEF_SIZE=2097152
|
||||||
-D LGFX_DRIVER_TEMPLATE
|
|
||||||
-D LGFX_DRIVER=LGFX_GENERIC
|
|
||||||
-D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_GENERIC.h\"
|
|
||||||
-D SPI_FREQUENCY=60000000
|
-D SPI_FREQUENCY=60000000
|
||||||
-D LGFX_SCREEN_WIDTH=320
|
-D LGFX_SCREEN_WIDTH=320
|
||||||
-D LGFX_SCREEN_HEIGHT=480
|
-D LGFX_SCREEN_HEIGHT=480
|
||||||
@ -119,5 +119,10 @@ build_flags =
|
|||||||
-D LGFX_TOUCH_RST=48
|
-D LGFX_TOUCH_RST=48
|
||||||
-D LGFX_TOUCH_ROTATION=0
|
-D LGFX_TOUCH_ROTATION=0
|
||||||
-D DISPLAY_SET_RESOLUTION
|
-D DISPLAY_SET_RESOLUTION
|
||||||
|
|
||||||
|
; 4.3, 5.0, 7.0 inch 800x480 IPS (V1)
|
||||||
|
[env:elecrow-adv1-43-50-70-tft]
|
||||||
|
extends = crowpanel_large
|
||||||
|
build_flags =
|
||||||
|
${crowpanel_large.build_flags}
|
||||||
-D VIEW_320x240
|
-D VIEW_320x240
|
||||||
-D MAP_FULL_REDRAW
|
|
||||||
|
@ -1,124 +1,14 @@
|
|||||||
#define I2C_SDA 15
|
#define I2C_SDA 15
|
||||||
#define I2C_SCL 16
|
#define I2C_SCL 16
|
||||||
|
|
||||||
#if TFT_HEIGHT == 320 && not defined(HAS_TFT) // 2.4 and 2.8 TFT
|
#if CROW_SELECT == 1
|
||||||
// ST7789 TFT LCD
|
#define WAKE_ON_TOUCH
|
||||||
#define ST7789_CS 40
|
|
||||||
#define ST7789_RS 41 // DC
|
|
||||||
#define ST7789_SDA 39 // MOSI
|
|
||||||
#define ST7789_SCK 42
|
|
||||||
#define ST7789_RESET -1
|
|
||||||
#define ST7789_MISO 38
|
|
||||||
#define ST7789_BUSY -1
|
|
||||||
#define ST7789_BL 38
|
|
||||||
#define ST7789_SPI_HOST SPI2_HOST
|
|
||||||
#define TFT_BL 38
|
|
||||||
#define SPI_FREQUENCY 60000000
|
|
||||||
#define SPI_READ_FREQUENCY 16000000
|
|
||||||
#define TFT_OFFSET_ROTATION 0
|
|
||||||
#define SCREEN_ROTATE
|
|
||||||
#define TFT_DUMMY_READ_PIXELS 8
|
|
||||||
#define SCREEN_TRANSITION_FRAMERATE 5
|
|
||||||
#define BRIGHTNESS_DEFAULT 130 // Medium Low Brightness
|
|
||||||
|
|
||||||
#define HAS_TOUCHSCREEN 1
|
|
||||||
#define SCREEN_TOUCH_INT 47
|
#define SCREEN_TOUCH_INT 47
|
||||||
#define SCREEN_TOUCH_RST 48
|
#define USE_POWERSAVE
|
||||||
#define TOUCH_I2C_PORT 0
|
#define SLEEP_TIME 180
|
||||||
#define TOUCH_SLAVE_ADDRESS 0x38 // FT5x06
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TFT_HEIGHT == 480 && not defined(HAS_TFT) // 3.5 TFT
|
#if CROW_SELECT == 1
|
||||||
// ILI9488 TFT LCD
|
|
||||||
#define ILI9488_CS 40
|
|
||||||
#define ILI9488_RS 41 // DC
|
|
||||||
#define ILI9488_SDA 39 // MOSI
|
|
||||||
#define ILI9488_SCK 42
|
|
||||||
#define ILI9488_RESET -1
|
|
||||||
#define ILI9488_MISO 38
|
|
||||||
#define ILI9488_BUSY -1
|
|
||||||
#define ILI9488_BL 38
|
|
||||||
#define ILI9488_SPI_HOST SPI2_HOST
|
|
||||||
#define TFT_BL 38
|
|
||||||
#define SPI_FREQUENCY 40000000
|
|
||||||
#define SPI_READ_FREQUENCY 16000000
|
|
||||||
#define TFT_OFFSET_ROTATION 0
|
|
||||||
#define SCREEN_ROTATE
|
|
||||||
#define TFT_DUMMY_READ_PIXELS 8
|
|
||||||
#define SCREEN_TRANSITION_FRAMERATE 5
|
|
||||||
#define BRIGHTNESS_DEFAULT 130 // Medium Low Brightness
|
|
||||||
|
|
||||||
#define HAS_TOUCHSCREEN 1
|
|
||||||
#define SCREEN_TOUCH_INT 47
|
|
||||||
#define SCREEN_TOUCH_RST 48
|
|
||||||
#define TOUCH_I2C_PORT 0
|
|
||||||
#define TOUCH_SLAVE_ADDRESS 0x5D // GT911
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CROW_SELECT
|
|
||||||
#define ST72xx_DE 42
|
|
||||||
#define ST72xx_VSYNC 41
|
|
||||||
#define ST72xx_HSYNC 40
|
|
||||||
#define ST72xx_PCLK 39
|
|
||||||
#define ST72xx_R0 7
|
|
||||||
#define ST72xx_R1 17
|
|
||||||
#define ST72xx_R2 18
|
|
||||||
#define ST72xx_R3 3
|
|
||||||
#define ST72xx_R4 46
|
|
||||||
#define ST72xx_G0 9
|
|
||||||
#define ST72xx_G1 10
|
|
||||||
#define ST72xx_G2 11
|
|
||||||
#define ST72xx_G3 12
|
|
||||||
#define ST72xx_G4 13
|
|
||||||
#define ST72xx_G5 14
|
|
||||||
#define ST72xx_B0 21
|
|
||||||
#define ST72xx_B1 47
|
|
||||||
#define ST72xx_B2 48
|
|
||||||
#define ST72xx_B3 45
|
|
||||||
#define ST72xx_B4 38
|
|
||||||
|
|
||||||
#define HAS_TOUCHSCREEN 1
|
|
||||||
#define TOUCH_I2C_PORT 0
|
|
||||||
#define TOUCH_SLAVE_ADDRESS 0x5D // GT911
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CROW_SELECT) && CROW_SELECT == 1 // 4.3 TFT 800x480
|
|
||||||
#define ST7265_HSYNC_POLARITY 0
|
|
||||||
#define ST7265_HSYNC_FRONT_PORCH 24
|
|
||||||
#define ST7265_HSYNC_PULSE_WIDTH 8
|
|
||||||
#define ST7265_HSYNC_BACK_PORCH 24
|
|
||||||
#define ST7265_VSYNC_POLARITY 1
|
|
||||||
#define ST7265_VSYNC_FRONT_PORCH 24
|
|
||||||
#define ST7265_VSYNC_PULSE_WIDTH 8
|
|
||||||
#define ST7265_VSYNC_BACK_PORCH 24
|
|
||||||
#define ST7265_PCLK_ACTIVE_NEG 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CROW_SELECT) && CROW_SELECT == 2 // 5.0 TFT 800x480
|
|
||||||
#define ST7262_HSYNC_POLARITY 0
|
|
||||||
#define ST7262_HSYNC_FRONT_PORCH 8
|
|
||||||
#define ST7262_HSYNC_PULSE_WIDTH 4
|
|
||||||
#define ST7262_HSYNC_BACK_PORCH 8
|
|
||||||
#define ST7262_VSYNC_POLARITY 0
|
|
||||||
#define ST7262_VSYNC_FRONT_PORCH 8
|
|
||||||
#define ST7262_VSYNC_PULSE_WIDTH 4
|
|
||||||
#define ST7262_VSYNC_BACK_PORCH 8
|
|
||||||
#define ST7262_PCLK_ACTIVE_NEG 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CROW_SELECT) && CROW_SELECT == 3 // 7.0 TFT 800x480
|
|
||||||
#define SC7277_HSYNC_POLARITY 0
|
|
||||||
#define SC7277_HSYNC_FRONT_PORCH 8
|
|
||||||
#define SC7277_HSYNC_PULSE_WIDTH 4
|
|
||||||
#define SC7277_HSYNC_BACK_PORCH 8
|
|
||||||
#define SC7277_VSYNC_POLARITY 0
|
|
||||||
#define SC7277_VSYNC_FRONT_PORCH 8
|
|
||||||
#define SC7277_VSYNC_PULSE_WIDTH 4
|
|
||||||
#define SC7277_VSYNC_BACK_PORCH 8
|
|
||||||
#define SC7277_PCLK_ACTIVE_NEG 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if TFT_HEIGHT == 320 // 2.4-2.8 have I2S audio
|
|
||||||
// dac / amp
|
// dac / amp
|
||||||
// #define HAS_I2S // didn't get I2S sound working
|
// #define HAS_I2S // didn't get I2S sound working
|
||||||
#define PIN_BUZZER 8 // using pwm buzzer instead (nobody will notice, lol)
|
#define PIN_BUZZER 8 // using pwm buzzer instead (nobody will notice, lol)
|
||||||
@ -131,10 +21,16 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// GPS via UART1 connector
|
// GPS via UART1 connector
|
||||||
#define HAS_GPS 1
|
|
||||||
#define GPS_DEFAULT_NOT_PRESENT 1
|
#define GPS_DEFAULT_NOT_PRESENT 1
|
||||||
|
#define HAS_GPS 1
|
||||||
|
#if CROW_SELECT == 1
|
||||||
#define GPS_RX_PIN 18
|
#define GPS_RX_PIN 18
|
||||||
#define GPS_TX_PIN 17
|
#define GPS_TX_PIN 17
|
||||||
|
#else
|
||||||
|
// GPIOs shared with LoRa or MIC module
|
||||||
|
#define GPS_RX_PIN 19
|
||||||
|
#define GPS_TX_PIN 20
|
||||||
|
#endif
|
||||||
|
|
||||||
// Extension Slot Layout, viewed from above (2.4-3.5)
|
// Extension Slot Layout, viewed from above (2.4-3.5)
|
||||||
// DIO1/IO1 o o IO2/NRESET
|
// DIO1/IO1 o o IO2/NRESET
|
||||||
@ -158,9 +54,11 @@
|
|||||||
|
|
||||||
// LoRa
|
// LoRa
|
||||||
#define USE_SX1262
|
#define USE_SX1262
|
||||||
#define LORA_CS 0 // GND
|
|
||||||
|
|
||||||
#if TFT_HEIGHT == 320 || TFT_HEIGHT == 480 // 2.4 - 3.5 TFT
|
#if CROW_SELECT == 1
|
||||||
|
// 2.4", 2.8, 3.5"""
|
||||||
|
#define HW_SPI1_DEVICE
|
||||||
|
#define LORA_CS 0
|
||||||
#define LORA_SCK 10
|
#define LORA_SCK 10
|
||||||
#define LORA_MISO 9
|
#define LORA_MISO 9
|
||||||
#define LORA_MOSI 3
|
#define LORA_MOSI 3
|
||||||
@ -173,6 +71,8 @@
|
|||||||
#define SENSOR_POWER_CTRL_PIN 45
|
#define SENSOR_POWER_CTRL_PIN 45
|
||||||
#define SENSOR_POWER_ON LOW
|
#define SENSOR_POWER_ON LOW
|
||||||
#else
|
#else
|
||||||
|
// 4.3", 5.0", 7.0"
|
||||||
|
#define LORA_CS 0
|
||||||
#define LORA_SCK 5
|
#define LORA_SCK 5
|
||||||
#define LORA_MISO 4
|
#define LORA_MISO 4
|
||||||
#define LORA_MOSI 6
|
#define LORA_MOSI 6
|
||||||
@ -182,14 +82,9 @@
|
|||||||
#define LORA_DIO2 2 // SX1262 BUSY
|
#define LORA_DIO2 2 // SX1262 BUSY
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define HW_SPI1_DEVICE
|
|
||||||
#define SX126X_CS LORA_CS
|
#define SX126X_CS LORA_CS
|
||||||
#define SX126X_DIO1 LORA_DIO1
|
#define SX126X_DIO1 LORA_DIO1
|
||||||
#define SX126X_BUSY LORA_DIO2
|
#define SX126X_BUSY LORA_DIO2
|
||||||
#define SX126X_RESET LORA_RESET
|
#define SX126X_RESET LORA_RESET
|
||||||
#define SX126X_DIO2_AS_RF_SWITCH
|
#define SX126X_DIO2_AS_RF_SWITCH
|
||||||
|
|
||||||
#define SX126X_DIO3_TCXO_VOLTAGE 3.3
|
#define SX126X_DIO3_TCXO_VOLTAGE 3.3
|
||||||
|
|
||||||
#define USE_VIRTUAL_KEYBOARD 1
|
|
||||||
#define DISPLAY_CLOCK_FRAME 1
|
|
@ -3,7 +3,6 @@
|
|||||||
extends = nrf52840_base
|
extends = nrf52840_base
|
||||||
board = adafruit_feather_nrf52840
|
board = adafruit_feather_nrf52840
|
||||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/feather_diy -Dfeather_diy
|
build_flags = ${nrf52840_base.build_flags} -Ivariants/feather_diy -Dfeather_diy
|
||||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
|
||||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/feather_diy>
|
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/feather_diy>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${nrf52840_base.lib_deps}
|
${nrf52840_base.lib_deps}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user