/web/COM0 Afri Blanck, Engineer
Blog / 2025-10-03

Running Meshtastic Daemon on Raspberry Pi 4B

#meshtastic #raspberry-pi #linux

This is a minimal, no-frills write-up of how I built and ran the Linux-native Meshtastic daemon (meshtasticd) on a Raspberry Pi 4 Model B running ArchLinuxARM, using a Waveshare SX1268 (433/443 MHz) LoRa HAT mounted on the 40-pin header (SPI). It captures exactly what worked for me, with the versions I used.


Hardware

Assumptions


1) Install dependencies

pacman -S --needed git vim base-devel python python-pipx bluez bluez-libs bluez-utils libgpiod yaml-cpp fmt clang openssl cmake pkgconf

2) Install PlatformIO and Meshtastic Python CLI

pipx install platformio meshtastic

3) Clone firmware and build the native target

I pinned to the tag I tested:

git clone https://github.com/meshtastic/firmware
cd firmware
git checkout v2.7.11.ee68575
pio run -e native

4) Check and install the binary

cd .pio/build/native
./program --version
install -m 0755 program /usr/local/bin/meshtasticd
meshtasticd --version

5) Configure Meshtastic daemon for the Waveshare HAT

Create the config directory and file:

mkdir -p /etc/meshtasticd
vim /etc/meshtasticd/config.yaml

My working /etc/meshtasticd/config.yaml (GPIOs are BCM numbers):

Module: Radio
Lora:
  Module: SX126x
  Region: EU_433
  SPI:
    Device: /dev/spidev0.0
  Pins:
    NSS: 8
    RESET: 25
    DIO1: 24
    BUSY: 23

6) Enable SPI in the boot firmware

Edit the Pi’s boot config:

vim /boot/config.txt

Add:

dtparam=spi=on
dtoverlay=spi0-0cs

Note: some notes used idtoverlay by typo; the correct key is dtoverlay.

7) Load SPI module and reboot

echo spi_bcm2835 | sudo tee /etc/modules-load.d/spi.conf
reboot
ls -l /dev/spidev0.0

8) Create a systemd service

vim /etc/systemd/system/meshtasticd.service

Service file contents:

# /etc/systemd/system/meshtasticd.service
[Unit]
Description=Meshtastic Daemon (Linux-native)
After=network.target

[Service]
ExecStart=/usr/local/bin/meshtasticd -c /etc/meshtasticd/config.yaml
Restart=always

# Start as root unless you've set udev rules for /dev/spidev0.0 and gpio

User=root
Group=root

[Install]
WantedBy=multi-user.target

Enable and start:

systemctl enable --now meshtasticd

9) Verify

Use the Meshtastic CLI to confirm the daemon is up and reachable:

meshtastic --info

Notes / Pin mapping

Different Waveshare revisions may wire RESET/DIO/BUSY differently; adjust the YAML if initialization fails.

Optional: run non-root

If you want to drop root, add udev rules for /dev/gpiochip* and /dev/spidev0.0, put your service user in the corresponding group(s), and switch User=/Group= in the service file.


Appendix: Full command list (copy-paste)

# install dependencies
pacman -S --needed git vim base-devel python python-pipx bluez bluez-libs bluez-utils libgpiod yaml-cpp fmt clang openssl cmake pkgconf

# install platformio and meshtastic python lib

pipx install platformio meshtastic

# install native firmware on latest available tag

git clone https://github.com/meshtastic/firmware
cd firmware
git checkout v2.7.11.ee68575
pio run -e native

# check and install binaries

cd .pio/build/native
./program --version
install -m 0755 program /usr/local/bin/meshtasticd
meshtasticd --version

# configure meshtastic daemon for waveshare hat

mkdir -p /etc/meshtasticd
vim /etc/meshtasticd/config.yaml

# /etc/meshtasticd/config.yaml

Module: Radio
Lora:
Module: SX126x
Region: EU_433
SPI:
Device: /dev/spidev0.0
Pins:
NSS: 8
RESET: 25
DIO1: 24
BUSY: 23

# configure boot config to enable spi

vim /boot/config.txt

# /boot/config.txt

dtparam=spi=on
dtoverlay=spi0-0cs

# enable spi module and reboot

echo spi_bcm2835 | sudo tee /etc/modules-load.d/spi.conf
reboot
ls -l /dev/spidev0.0

# create systemd service and enable

vim /etc/systemd/system/meshtasticd.service

# /etc/systemd/system/meshtasticd.service

[Unit]
Description=Meshtastic Daemon (Linux-native)
After=network.target

[Service]
ExecStart=/usr/local/bin/meshtasticd -c /etc/meshtasticd/config.yaml
Restart=always
User=root
Group=root

[Install]
WantedBy=multi-user.target

systemctl enable --now meshtasticd

# check daemon

meshtastic --info