Advanced Configuration Options
Learn about the advanced configuration options available in Meshtastic and how to customize your device for specific use cases.
Updated January 15, 2024
Advanced Configuration Options
This guide covers advanced configuration options for Meshtastic devices, allowing you to customize your setup for specific use cases.
Prerequisites
Before diving into advanced configurations, ensure you have:
- A working Meshtastic device already set up
- The latest Meshtastic software installed
- Basic familiarity with Meshtastic operations
Advanced Channel Settings
Multiple Channels
Meshtastic devices support multiple channels (up to 8), which can be useful for different communication purposes:
# Add a secondary channel
meshtastic --ch-add name="EmergencyChannel" --ch-index 1
# Configure channel settings
meshtastic --ch-set name="EmergencyChannel" --ch-index 1 --ch-longslow
Channel Modem Configuration
Modem settings affect range, bandwidth, and battery life. Use these parameters to optimize for your specific needs:
# Long-range, slow data rate
meshtastic --ch-set modem-config="Bw125Cr48Sf4096" --ch-index 0
# Short-range, fast data rate
meshtastic --ch-set modem-config="Bw500Cr45Sf128" --ch-index 0
Power Management
Power Saving Modes
Configure power saving to extend battery life:
# Configure sleep settings
meshtastic --set ls_secs=300 # Sleep after 5 minutes of inactivity
# Configure screen timeout
meshtastic --set screen_on_secs=60 # Screen turns off after 60 seconds
GPS Power Management
The GPS module consumes significant power. Configure its behavior with:
# Set GPS update interval
meshtastic --set gps_update_interval=60 # GPS position update every 60 seconds
# Configure GPS mode
meshtastic --set gps_mode=0 # 0=disabled, 1=enabled, 2=enabled_no_power_save, 3=enabled_pin_wakeup
Device Role Configuration
Router Mode
Configure a device to act as a dedicated router:
# Set device as a router
meshtastic --set is_router=1
# Disable router mode
meshtastic --set is_router=0
Relay Mode
Relay nodes rebroadcast messages to extend the network:
# Enable relay mode
meshtastic --set is_repeater=1
Advanced MQTT Integration
Custom MQTT Server
Configure a device to connect to a custom MQTT server:
# Set MQTT server
meshtastic --set mqtt_server="mqtt.example.com" --set mqtt_username="user" --set mqtt_password="pass"
MQTT Topics Configuration
# Set custom MQTT topic prefix
meshtastic --set mqtt_topic_prefix="meshtastic/mynetwork"
Encryption and Security
Custom Encryption Keys
Set custom encryption keys for enhanced security:
# Set a custom PSK
meshtastic --set-channel-psk "MySecretKey1234567890123456"
Disabling Serial Console
For security-sensitive applications, disable the serial console:
# Disable serial console
meshtastic --set serial_disabled=1
Custom JavaScript Applications
Meshtastic supports custom JavaScript applications that run on the device:
# Install a custom app
meshtastic --write-app /path/to/your/app.js
Example simple application:
function onGPSUpdate(gps) {
console.log('Position update: ' + gps.latitude + ', ' + gps.longitude)
}
// Register for GPS updates
GPS.onUpdate(onGPSUpdate)
Troubleshooting Advanced Configurations
Factory Reset
If your configuration causes issues, reset the device:
# Factory reset
meshtastic --factory-reset
Debug Logging
Enable debug logging for troubleshooting:
# Enable debug logs
meshtastic --set debug_log_enabled=1
Next Steps
After mastering these advanced configurations, you may want to explore:
These advanced configurations allow you to tailor Meshtastic to your specific needs, whether for emergency communications, IoT applications, or specialized networking requirements.