Meshtastic setup with DietPi running on OrangePi Zero3
How to setup the Meshtastic native service under DietPi Linux running on a OrangePi Zero3 SBC with Waveshare Pico LoRa module.
Waveshare LoRa module wiring connection #
The Waveshare SX1262 Pico LoRa module is used for building the Meshtastic native Linux node. This LoRa module includes a temperature stabilized TCXO oscillator and is working fine with Meshtastic.
Important:
DO NOT use the Waveshare SX1262/SX1268 LoRa hat for Raspberry Pi! The LoRa module on this hat uses a ordinary crystal oscillator that is sensitive to temperature drift and causes problems when transmitting long messages via Meshtastic.
The Waveshare Pico LoRa module is connected to the OrangePi Zero3 by its 26-pin header. The SPI1 interface is used in addition to 3 GPIO pins and 3.3V power supply.

See Orange Pi Zero3 manual, chapter 3.16, page 124 for 26-pin header pinout.
Waveshare Orange Pi Zero3
36 3.3V 17
15 MOSI 19
16 MISO 21
14 CLK 23
38 GND 25
4 BUSY 18
20 RESET 22
5 CS 24
26 DIO1/IRQ 26
The remaining pins on the OrangePi Zero3 26-pin header are free to use. The I2C-3 and UART5 interfaces will be enabled in DietPi Linux configuration.
DietPi Linux installation #
Download DietPi for the OrangePi Zero3 and follow the Installation instructions.
DietPi configuration #
Before first boot, right after flashing the SD card, you can configure a few things and save time with configuration later on.
On the SD card, open the DIETPISETUP partition and edit the text files as required.
My recommendations:
- Add your Wifi network credentials in dietpi-wifi.txt.
- In dietpi.txt set localization, keyboard layout, static network parameters, pre-installed software etc.
Mandatory configuration in dietpiEnv.txt that must done prior or after first boot:
- Enable device tree overlays for SPI1, I2C3 and UART5 as show below, don't change anything else:
# Multiple prefixes are supported separated by space
overlay_prefix=sun50i-h616
overlays=uart5 i2c3-ph
user_overlays=dietpi-spi1_1
Do not use one of the Allwinner overlays for SPI. The custom DietPi version will enable SPI1 on the 26-pin header including the CS1 pin!
The configuration in dietpiEnv.txt can be done after first boot. The files are located in /boot folder. In that case use:
sudo nano /boot/dietpiEnv.txt
sudo mkimage -C none -A arm64 -T script -d /boot/boot.cmd /boot/boot.scr
Use the included sudo dietpi-config tool for additional configuration of DietPi after first boot.
- Do not enable/disable/toggle SPI within dietpi-config under Advanced Options!
Meshtasticd package build #
Building the Meshtasticd native package for Debian is based on my Meshtastic firmware fork that is modified to build locally on a Debian installation. The original firmware is optimized to build on Github using workflows and build will fail locally.
Install dependencies #
Assuming in work folder dietpi user home and the package build runs under this user.
- Platformio
# You may reboot before you start building
# Download Platformio installer
curl -fsSL -o get-platformio.py https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py
# Install first batch of dependencies
sudo apt-get -y install python3.11-venv software-properties-common build-essential devscripts equivs
# Install Platformio
python3 get-platformio.py
# Create user links for Platformio environment
mkdir -p .local/bin
ln -s ~/.platformio/penv/bin/platformio ~/.local/bin/platformio
ln -s ~/.platformio/penv/bin/pio ~/.local/bin/pio
ln -s ~/.platformio/penv/bin/piodebuggdb ~/.local/bin/piodebuggdb
# Edit the dietpi users .bashrc and add the additional location to PATH
nano .bashrc
# add line:
export PATH=$PATH:$HOME/.local/bin
- Build dependencies
# Install second batch of dependencies
sudo apt-get -y install debhelper-compat lsb-release tar gzip python3-protobuf python3-grpcio git g++ pkg-config libyaml-cpp-dev libgpiod-dev libbluetooth-dev libusb-1.0-0-dev libi2c-dev libuv1-dev openssl libssl-dev libulfius-dev liborcania-dev libx11-dev libinput-dev libxkbcommon-x11-dev libdistro-info-perl
- Clone firmware repository
# Clone firmware
git clone https://github.com/Mictronics/meshtastic_firmware.git meshtasticd
# Use Mictronics branch
git checkout mictronics
# Change to local repository
cd meshtasticd
# Build a package satisfying a package's build-dependencies
sudo mk-build-deps --install --remove --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
The Mictronics branch in my firmware fork does not include the file userPrefs.jsonc for security reasons (avoid credential leakage on Github)!
You need to copy or create that file from the master branch or original firmware repository prior to the build process. The build will fail without userPrefs.jsonc!
- Build package
# Start the package build by running
bash debian/ci_pack_sdeb.sh
- [Optional] Rebuild package at anytime, e.g. after repository update
# Reset repository to HEAD as it is modified during package build
git reset --hard
# Get repository updates
git pull
# Remove old build files
dh_clean
# Start the package build
bash debian/ci_pack_sdeb.sh
Meshtasticd package installation #
The final Meshtasticd binary package is located in the dietpi user home folder and can be installed form there.
# Install Meshtasticd binary package (use your build package file name!)
sudo dpkg -i meshtasticd_2.7.2.0~local84f0c3e9~unstable_arm64.deb
# Disable Meshtasticd service prior configuration
sudo systemctl disable meshtasticd
Meshtasticd service configuration #
Some configuration work is required to run the Meshtasticd service. The configuration for Meshtasticd is located in /etc/meshtasticd.
# Copy and enable hardware configuration for the above Waveshare Pico LoRa module connection
sudo cp /etc/meshtasticd/available.d/lora-ws-raspberry-pico-to-orangepi-03.yaml /etc/meshtasticd/config.d/lora-ws-raspberry-pico-to-orangepi-03.yaml
# Edit Meshtasticd service configuration
sudo nano /etc/meshtasticd/config.yaml
# Keep unchanged:
Module: auto
# Uncomment and change:
I2C:
I2CDevice: /dev/i2c-2
# The Meshtasticd service will then find I2C devices on the 26-pin header I2C3 interface
# Enable webserver
Webserver:
Port: 9443 # Port for Webserver & Webservices
RootPath: /usr/share/meshtasticd/web # Root Dir of WebServer
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
# Set numbers as desired:
MaxNodes: 1000
MaxMessageQueue: 100
# Uncomment or set MAC address. The service will not run without.
MACAddressSource: eth0
# You may change the log level as desired:
LogLevel: debug # debug, info, warn, error
When you set the log level to debug make sure you also limit the journal size! Otherwise meshtasticd service log will eat up RAM or disk space in notime.
# Open the journal configuration
sudo nano /etc/systemd/journald.conf
# Recommentation is to change storage in volatile so the journal is stored in memory (RAM).
# In that case set RuntimeMaxUse as desired.
# When Storage is set to persistent or auto the journal is stored on disk.
# In that case set SystemMaxUse as desired.
[Journal]
Storage=volatile
SystemMaxUse=48M
RuntimeMaxUse=48M
# Reboot after change.
Meshtasticd service start #
After final configuration we can start the service.
# Enable Meshtasticd service
sudo systemctl enable meshtasticd
# Start service
sudo service meshtasticd start
# Check service status
sudo service meshtasticd status
Debug log #
The Meshtasticd service debug log can be find in the journal with sudo journalctl -u meshtasticd -b.
👈 Home
