mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-08 14:12:05 +00:00
Merge branch 'meshtastic:master' into use_detected_ina_addr
This commit is contained in:
commit
6e89d6bcb7
2
.github/workflows/test_native.yml
vendored
2
.github/workflows/test_native.yml
vendored
@ -143,7 +143,7 @@ jobs:
|
|||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|
||||||
- name: Test Report
|
- name: Test Report
|
||||||
uses: dorny/test-reporter@v2.0.0
|
uses: dorny/test-reporter@v2.1.0
|
||||||
with:
|
with:
|
||||||
name: PlatformIO Tests
|
name: PlatformIO Tests
|
||||||
path: testreport.xml
|
path: testreport.xml
|
||||||
|
@ -10,13 +10,12 @@ lint:
|
|||||||
enabled:
|
enabled:
|
||||||
- renovate@40.0.6
|
- renovate@40.0.6
|
||||||
- prettier@3.5.3
|
- prettier@3.5.3
|
||||||
- trufflehog@3.88.28
|
- trufflehog@3.88.29
|
||||||
- yamllint@1.37.1
|
- yamllint@1.37.1
|
||||||
- bandit@1.8.3
|
- bandit@1.8.3
|
||||||
- terrascan@1.19.9
|
|
||||||
- trivy@0.62.1
|
- trivy@0.62.1
|
||||||
- taplo@0.9.3
|
- taplo@0.9.3
|
||||||
- ruff@0.11.8
|
- ruff@0.11.9
|
||||||
- isort@6.0.1
|
- isort@6.0.1
|
||||||
- markdownlint@0.44.0
|
- markdownlint@0.44.0
|
||||||
- oxipng@9.1.5
|
- oxipng@9.1.5
|
||||||
@ -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.25.1
|
- 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
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
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
|
||||||
|
@ -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,9 @@
|
|||||||
</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">
|
<release version="2.6.8" date="2025-05-05">
|
||||||
<url type="details">https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.8</url>
|
<url type="details">https://github.com/meshtastic/firmware/releases?q=tag%3Av2.6.8</url>
|
||||||
</release>
|
</release>
|
||||||
|
7
debian/changelog
vendored
7
debian/changelog
vendored
@ -1,4 +1,4 @@
|
|||||||
meshtasticd (2.6.8.0) UNRELEASED; urgency=medium
|
meshtasticd (2.6.9.0) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
[ Austin Lane ]
|
[ Austin Lane ]
|
||||||
* Initial packaging
|
* Initial packaging
|
||||||
@ -10,4 +10,7 @@ meshtasticd (2.6.8.0) UNRELEASED; urgency=medium
|
|||||||
[ ]
|
[ ]
|
||||||
* GitHub Actions Automatic version bump
|
* GitHub Actions Automatic version bump
|
||||||
|
|
||||||
-- <github-actions[bot]@users.noreply.github.com> Tue, 06 May 2025 01:32:49 +0000
|
[ ]
|
||||||
|
* GitHub Actions Automatic version bump
|
||||||
|
|
||||||
|
-- <github-actions[bot]@users.noreply.github.com> Thu, 15 May 2025 11:13:30 +0000
|
||||||
|
6
debian/control
vendored
6
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.
|
||||||
|
3
debian/meshtasticd.dirs
vendored
3
debian/meshtasticd.dirs
vendored
@ -1,5 +1,6 @@
|
|||||||
|
var/lib/meshtasticd
|
||||||
etc/meshtasticd
|
etc/meshtasticd
|
||||||
etc/meshtasticd/config.d
|
etc/meshtasticd/config.d
|
||||||
etc/meshtasticd/available.d
|
etc/meshtasticd/available.d
|
||||||
usr/share/meshtasticd/web
|
usr/share/meshtasticd/web
|
||||||
etc/meshtasticd/ssl
|
etc/meshtasticd/ssl
|
||||||
|
4
debian/meshtasticd.install
vendored
4
debian/meshtasticd.install
vendored
@ -1,8 +1,8 @@
|
|||||||
.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
|
||||||
|
|
||||||
bin/meshtasticd.service lib/systemd/system
|
bin/meshtasticd.service lib/systemd/system
|
||||||
|
|
||||||
web/* usr/share/meshtasticd/web
|
web/* usr/share/meshtasticd/web
|
||||||
|
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
|
||||||
@ -96,4 +154,4 @@ mkdir -p %{buildroot}%{_sysconfdir}/meshtasticd/ssl
|
|||||||
%dir %{_sysconfdir}/meshtasticd/ssl
|
%dir %{_sysconfdir}/meshtasticd/ssl
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
%autochangelog
|
%autochangelog
|
||||||
|
@ -108,7 +108,7 @@ 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/7dee10ad31a0c6ea04880cba399e240be743d752.zip
|
https://github.com/meshtastic/device-ui/archive/55f71527f3137ed4eabc258498d5c6ad9f610674.zip
|
||||||
|
|
||||||
; Common libs for environmental measurements in telemetry module
|
; Common libs for environmental measurements in telemetry module
|
||||||
[environmental_base]
|
[environmental_base]
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 816595c8bbdfc3b4388e11348ccd043294d58705
|
Subproject commit d8b709aa5da85959a80a06a6624761678a96f9c0
|
@ -1250,11 +1250,10 @@ 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},
|
||||||
{"PA1010D", "1010D", GNSS_MODEL_MTK_PA1010D},
|
{"PA1616S", "1616S", GNSS_MODEL_MTK_PA1616S}, {"LS20031", "MC-1513", GNSS_MODEL_MTK_L76B},
|
||||||
{"PA1616S", "1616S", GNSS_MODEL_MTK_PA1616S},
|
{"L96", "Quectel-L96", GNSS_MODEL_MTK_L76B}, {"L80-R", "_3337_", GNSS_MODEL_MTK_L76B},
|
||||||
{"LS20031", "MC-1513", GNSS_MODEL_MTK_L76B},
|
{"L80", "_3339_", GNSS_MODEL_MTK_L76B}};
|
||||||
{"L96", "Quectel-L96", GNSS_MODEL_MTK_L76B}};
|
|
||||||
|
|
||||||
PROBE_FAMILY("MTK Family", "$PMTK605*31", mtk, 500);
|
PROBE_FAMILY("MTK Family", "$PMTK605*31", mtk, 500);
|
||||||
|
|
||||||
|
@ -1309,10 +1309,6 @@ 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
|
||||||
|
@ -347,7 +347,7 @@ bool Channels::anyMqttEnabled()
|
|||||||
{
|
{
|
||||||
#if USERPREFS_EVENT_MODE && !MESHTASTIC_EXCLUDE_MQTT
|
#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);
|
||||||
@ -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
|
||||||
|
@ -446,7 +446,7 @@ extern const pb_msgdesc_t meshtastic_SharedContact_msg;
|
|||||||
#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 121
|
#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
|
||||||
|
@ -112,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 */
|
||||||
@ -505,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}
|
||||||
@ -521,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}
|
||||||
@ -539,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
|
||||||
@ -702,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
|
||||||
|
|
||||||
@ -890,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
|
||||||
@ -899,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,7 +24,10 @@ PB_BIND(meshtastic_LocalStats, meshtastic_LocalStats, AUTO)
|
|||||||
PB_BIND(meshtastic_HealthMetrics, meshtastic_HealthMetrics, AUTO)
|
PB_BIND(meshtastic_HealthMetrics, meshtastic_HealthMetrics, AUTO)
|
||||||
|
|
||||||
|
|
||||||
PB_BIND(meshtastic_Telemetry, meshtastic_Telemetry, AUTO)
|
PB_BIND(meshtastic_HostMetrics, meshtastic_HostMetrics, 2)
|
||||||
|
|
||||||
|
|
||||||
|
PB_BIND(meshtastic_Telemetry, meshtastic_Telemetry, 2)
|
||||||
|
|
||||||
|
|
||||||
PB_BIND(meshtastic_Nau7802Config, meshtastic_Nau7802Config, AUTO)
|
PB_BIND(meshtastic_Nau7802Config, meshtastic_Nau7802Config, AUTO)
|
||||||
|
@ -87,7 +87,11 @@ 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,
|
||||||
|
/* PCT2075 Temperature Sensor */
|
||||||
|
meshtastic_TelemetrySensorType_PCT2075 = 39
|
||||||
} meshtastic_TelemetrySensorType;
|
} meshtastic_TelemetrySensorType;
|
||||||
|
|
||||||
/* Struct definitions */
|
/* Struct definitions */
|
||||||
@ -288,6 +292,32 @@ 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;
|
||||||
|
/* Optional User-provided string for arbitrary host system information
|
||||||
|
that doesn't make sense as a dedicated entry. */
|
||||||
|
bool has_user_string;
|
||||||
|
char user_string[200];
|
||||||
|
} 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 +336,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 +356,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_PCT2075
|
||||||
#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_RAK12035+1))
|
#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_PCT2075+1))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -343,6 +376,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, false, ""}
|
||||||
#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 +385,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, false, ""}
|
||||||
#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 +450,15 @@ 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_HostMetrics_user_string_tag 9
|
||||||
#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 +466,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 +555,19 @@ 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) \
|
||||||
|
X(a, STATIC, OPTIONAL, STRING, user_string, 9)
|
||||||
|
#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 +575,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 +585,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 +599,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 +610,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,10 +620,11 @@ 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 264
|
||||||
#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
|
||||||
#define meshtastic_Telemetry_size 120
|
#define meshtastic_Telemetry_size 272
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
|
@ -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
|
||||||
|
@ -504,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);
|
||||||
@ -553,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
|
||||||
|
@ -86,6 +86,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();
|
||||||
|
132
src/modules/Telemetry/HostMetrics.cpp
Normal file
132
src/modules/Telemetry/HostMetrics.cpp
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
#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_Telemetry_init_zero;
|
||||||
|
t.which_variant = meshtastic_Telemetry_host_metrics_tag;
|
||||||
|
t.variant.host_metrics = meshtastic_HostMetrics_init_zero;
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
@ -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;
|
||||||
|
|
||||||
@ -103,8 +106,7 @@ class MQTT : private concurrency::OSThread
|
|||||||
std::string mapTopic = "/2/map/"; // For protobuf-encoded MapReport messages
|
std::string mapTopic = "/2/map/"; // For protobuf-encoded MapReport messages
|
||||||
|
|
||||||
// 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;
|
||||||
|
@ -600,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);
|
||||||
@ -650,4 +655,18 @@ bool MAC_from_string(std::string mac_str, uint8_t *dmac)
|
|||||||
} else {
|
} else {
|
||||||
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,7 +100,9 @@ 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, fb, 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 };
|
||||||
@ -114,4 +116,5 @@ int initGPIOPin(int pinNum, std::string gpioChipname, int line);
|
|||||||
bool loadConfig(const char *configPath);
|
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);
|
@ -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,
|
||||||
|
@ -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 "
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
[VERSION]
|
[VERSION]
|
||||||
major = 2
|
major = 2
|
||||||
minor = 6
|
minor = 6
|
||||||
build = 8
|
build = 9
|
||||||
|
Loading…
Reference in New Issue
Block a user