Using meshtasticd ​
meshtasticd
is a virtual Meshtastic node daemon that runs on your computer without requiring physical hardware. It's perfect for development, testing, and running a node without a dedicated device.
What is meshtasticd? ​
meshtasticd
simulates a Meshtastic node in software, allowing you to:
- Test MeshMonitor without physical hardware
- Run a Meshtastic node on a server or Raspberry Pi
- Develop and test mesh applications
- Create virtual mesh networks
Installing meshtasticd ​
From Python Package ​
The easiest way to install meshtasticd
is via pip:
pip install meshtastic
This installs both the Meshtastic Python library and the meshtasticd
daemon.
From Source ​
To install from source:
git clone https://github.com/meshtastic/python.git
cd python
pip install -e .
Running meshtasticd ​
Basic Usage ​
Start meshtasticd
with a hardware model:
meshtasticd --hwmodel RAK4631
Available hardware models include:
RAK4631
- RAK WisBlock CoreTBEAM
- TTGO T-BeamTLORA_V2
- TTGO LoRa32 V2HELTEC_V3
- Heltec V3BETAFPV_2400_TX
- BetaFPV 2.4GHz TX
With Custom Port ​
By default, meshtasticd
listens on localhost:4403
. To specify a different port:
meshtasticd --hwmodel RAK4631 --port 4404
With Configuration File ​
You can specify a custom configuration file:
meshtasticd --hwmodel RAK4631 --config ./meshtastic-config.yaml
Configuring MeshMonitor ​
Point to localhost ​
When using meshtasticd
, set the node IP to localhost:
export MESHTASTIC_NODE_IP=localhost
Or in your .env
file:
MESHTASTIC_NODE_IP=localhost
Docker Compose Setup ​
When running both meshtasticd
and MeshMonitor in Docker, you need to ensure they can communicate:
version: '3.8'
services:
meshtasticd:
image: meshtastic/meshtasticd:latest
command: meshtasticd --hwmodel RAK4631
ports:
- "4403:4403"
networks:
- mesh-network
meshmonitor:
image: meshmonitor:latest
environment:
- MESHTASTIC_NODE_IP=meshtasticd
ports:
- "8080:8080"
networks:
- mesh-network
depends_on:
- meshtasticd
networks:
mesh-network:
driver: bridge
Using Docker Host Network ​
Alternatively, use host networking to simplify connectivity:
services:
meshmonitor:
image: meshmonitor:latest
network_mode: "host"
environment:
- MESHTASTIC_NODE_IP=localhost
Initial Configuration ​
After starting meshtasticd
, you may want to configure it using the Meshtastic CLI:
# Connect to the virtual node
meshtastic --host localhost
# Set your node name
meshtastic --set node.name "My Virtual Node"
# Configure LoRa region
meshtastic --set lora.region US
# Enable WiFi (if desired)
meshtastic --set network.wifi_enabled true
Testing the Connection ​
Verify MeshMonitor can connect to your meshtasticd
instance:
Start
meshtasticd
:bashmeshtasticd --hwmodel RAK4631
In another terminal, test connectivity:
bashmeshtastic --host localhost --info
Start MeshMonitor and check the logs for successful connection
Virtual Mesh Network ​
You can create a virtual mesh network by running multiple meshtasticd
instances:
# Terminal 1: First node
meshtasticd --hwmodel RAK4631 --port 4403
# Terminal 2: Second node
meshtasticd --hwmodel TBEAM --port 4404
# Terminal 3: Third node
meshtasticd --hwmodel HELTEC_V3 --port 4405
Connect MeshMonitor to any of these nodes, and configure them to communicate with each other using MQTT or other Meshtastic networking features.
Troubleshooting ​
Port Already in Use ​
If you see "Address already in use" errors:
# Find what's using port 4403
lsof -i :4403
# Kill the process or use a different port
meshtasticd --hwmodel RAK4631 --port 4404
Connection Refused ​
If MeshMonitor cannot connect:
Verify
meshtasticd
is running:bashps aux | grep meshtasticd
Check if the port is open:
bashnetstat -an | grep 4403
Test with the Meshtastic CLI:
bashmeshtastic --host localhost --info
Permission Denied ​
On Linux, you may need permissions for virtual serial ports:
sudo usermod -aG dialout $USER
# Log out and back in
Production Use ​
For production deployments of meshtasticd
:
Using systemd ​
Create a systemd service file /etc/systemd/system/meshtasticd.service
:
[Unit]
Description=Meshtastic Daemon
After=network.target
[Service]
Type=simple
User=meshtastic
ExecStart=/usr/local/bin/meshtasticd --hwmodel RAK4631
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
Enable and start the service:
sudo systemctl enable meshtasticd
sudo systemctl start meshtasticd
Using Docker ​
Run meshtasticd
as a Docker container:
docker run -d \
--name meshtasticd \
--restart unless-stopped \
-p 4403:4403 \
meshtastic/meshtasticd:latest \
meshtasticd --hwmodel RAK4631
Next Steps ​
- Configure SSO for authentication
- Set up a reverse proxy for external access
- Deploy to production with proper monitoring