-
-
Notifications
You must be signed in to change notification settings - Fork 50
config file
Reference for configuring your pyMC Repeater using config.yaml.
- Repeater Configuration
- Identity Management β
- Mesh Network Settings
- Radio Configuration
- Hardware Configuration (SX1262)
- Timing and Delays
- Duty Cycle Management
- Storage and Data Management
- Local MQTT Publishing
- LetsMesh Integration
- Logging Configuration
- Web Interface Settings
Basic repeater identity and behavior settings.
Type: string
Default: "mesh-repeater-01"
Description: Friendly name for your repeater node. Used in adverts, web interface, and LetsMesh.
repeater:
node_name: "my-home-repeater"Type: float
Default: 0.0
Range: Latitude: -90 to 90, Longitude: -180 to 180
Description: Geographic coordinates for your repeater. Optional but recommended for sending adverts with location and rendering maps within the Web UI.
repeater:
latitude: 51.5074
longitude: -0.1278Type: string or null
Default: null
Description: Path to a file containing the private key (64 hex characters). If null, a new identity is generated on first run.
repeater:
identity_file: "/etc/pymc_repeater/identity.key"For information about identity management, key generation, and importing firmware keys, see the Identity Management Guide.
Type: integer (seconds)
Default: 3600
Description: How long duplicate packets are remembered to prevent re-forwarding the same packet.
repeater:
cache_ttl: 3600Type: boolean
Default: false
Description: Enable quality-based packet filtering and adaptive transmission delays based on packet SNR and size.
repeater:
use_score_for_tx: falseType: float
Default: 0.3
Description: Reserved for future features. Currently has no effect on packet processing.
Type: integer (hours)
Default: 10
Range: 0 (disabled) to 24+
Description: Automatic advertisement broadcast interval. Set to 0 to disable (manual only via web interface).
repeater:
send_advert_interval_hours: 10 # Advertise every 10 hoursType: boolean
Default: true
Description: When enabled, the repeater will automatically respond to discovery packets from other nodes with its node information (node type 2 - repeater).
repeater:
allow_discovery: trueSec
Type: string
Default: minimal
Options: off, minimal, moderate, strict
Description: Flood loop detection mode to prevent packet loops.
-
off: Disabled -
minimal: Allow up to 3 self-hashes (most lenient) -
moderate: Allow up to 1 self-hash -
strict: Allow 0 self-hashes (no loops allowed)
mesh:
loop_detect: minimalConfigure room servers and companions that operate as separate logical nodes on the mesh.
Room servers act as separate messaging spaces with their own identities.
identities:
room_servers:
- name: "TestBBS"
identity_key: "your_room_identity_key_hex_here"
type: "room_server"
settings:
node_name: "Test BBS Room"
latitude: 0.0
longitude: 0.0
admin_password: "room_admin_password"
guest_password: "room_guest_password"
- name: "SocialHub"
identity_key: "another_identity_key_hex_here"
type: "room_server"
settings:
node_name: "Social Hub"
latitude: 0.0
longitude: 0.0
admin_password: "social_admin_123"
guest_password: "social_guest_123"Companions expose the MeshCore frame protocol over TCP for standard clients. One TCP client per companion at a time.
identities:
companions:
- name: "RepeaterCompanion"
identity_key: "your_companion_identity_key_hex_here"
settings:
node_name: "RepeaterCompanion"
tcp_port: 5000
bind_address: "0.0.0.0"
- name: "BobCompanion"
identity_key: "another_companion_identity_key_hex"
settings:
node_name: "meshcore-bob"
tcp_port: 5001For detailed information about creating and managing identities, see the Identity Management Guide.urity settings for login/authentication and client sessions.
Type: integer
Default: 1
Description: Maximum number of authenticated clients allowed simultaneously (across all identities).
repeater:
security:
max_clients: 1Type: string
Default: "admin123"
Description: Admin password for full access to the repeater interface.
repeater:
security:
admin_password: "admin123"Type: string
Default: "guest123"
Description: Guest password for limited read-only access (if allow_read_only is enabled).
repeater:
security:
guest_password: "guest123"Type: boolean
Default: false
Description: Allow read-only access for clients without password or not in ACL list.
repeater:
security:
allow_read_only: falseType: string
Default: "" (auto-generated if empty)
Description: JWT secret key for signing authentication tokens. Auto-generated on first run if not provided. Generate manually with: python -c "import secrets; print(secrets.token_hex(32))"
repeater:
security:
jwt_secret: ""Type: integer (minutes)
Default: 60
Description: JWT token expiry time in minutes. Controls how long users stay logged in before needing to re-authenticate.
repeater:
security:
jwt_expiry_minutes: 60Control advertisement traffic using token bucket rate limiting (per public key).
Type: object
Description: Token bucket rate limiter for incoming adverts, smoothing burst traffic.
repeater:
advert_rate_limit:
enabled: false
bucket_capacity: 2 # Max burst size per pubkey
refill_tokens: 1 # Tokens added per refill interval
refill_interval_seconds: 36000 # Refill interval (10 hours)
min_interval_seconds: 0 # Hard minimum spacing (0 to disable)Escalating cooldown system for repeated advert rate limit violations.
Type: object
Description: Applies escalating penalties to nodes that repeatedly violate rate limits.
repeater:
advert_penalty_box:
enabled: false
violation_threshold: 2 # Violations before cooldown
violation_decay_seconds: 43200 # Reset count after 12 hours
base_penalty_seconds: 21600 # First penalty (6 hours)
penalty_multiplier: 2.0 # Double penalty each time
max_penalty_seconds: 86400 # Cap at 24 hoursDynamically scale rate limits based on mesh network activity level.
Type: object
Description: Adapts rate limits based on mesh busyness: quiet mesh = lenient, busy mesh = strict.
repeater:
advert_adaptive:
enabled: false
ewma_alpha: 0.1 # Smoothing factor (0.0-1.0, higher = faster)
hysteresis_seconds: 300 # Delay before tier change takes effect
thresholds:
quiet_max: 0.05 # Adverts per minute (no limiting)
normal_max: 0.20 # Normal tier (1x limits)
busy_max: 0.50 # Busy tier (0.5x capacity)
# Above busy_max = CONGESTED tier (0.25x capacity)Type: boolean
Default: true
Description: Global flood policy. Controls whether the repeater forwards flood packets by default.
-
true: Allow all flood packets -
false: Deny all flood packets (unless allowed by specific transport key)
mesh:
global_flood_allow: trueType: integer (Hz)
Default: 869618000 (869.618 MHz - EU)
Description: Radio frequency in Hz. Common frequencies:
- EU:
869618000(869.618 MHz) - US:
915000000(915 MHz) - AU:
923000000(923 MHz)
radio:
frequency: 869618000Type: integer (dBm)
Default: 14
Description: Transmit power. Higher = longer range but more power consumption.
radio:
tx_power: 14
``` # Enable DIO3 TCXO power supply
dio3_tcxo_voltage: 1.8 # TCXO voltage (1.6V, 1.7V, 1.8V, 2.7V, 3.0V, 3.3V)
use_dio2_rf: false # Use DIO2 for RF switching
is_waveshare: false
### `radio.bandwidth`
**Type:** `integer` (Hz)
**Default:** `62500` (62.5 kHz)
**Options:** `7800`, `10400`, `15600`, `20800`, `31250`, `41700`, `62500`, `125000`, `250000`, `500000`
**Description:** LoRa bandwidth. Lower = longer range, higher = faster data rate.
```yaml
radio:
bandwidth: 62500Type: integer
Default: 8
Range: 7 to 12
Description: LoRa spreading factor. Higher = longer range but slower data rate.
radio:
spreading_factor: 8Type: integer
Default: 8
Range: 5 to 8
Description: Forward error correction coding rate (4/5, 4/6, 4/7, or 4/8).
radio:
coding_rate: 8GPIO pin configuration for SX1262 LoRa module.
sx1262:
bus_id: 0 # SPI bus (usually 0)
cs_id: 0 # Chip select (usually 0)Important: Use BCM pin numbering, not physical pin numbers.
sx1262:
cs_pin: 21 # Chip select
reset_pin: 18 # Reset
busy_pin: 20 # Busy status
irq_pin: 16 # Interrupt requestsx1262:
txen_pin: -1 # TX enable (-1 to disable)
rxen_pin: -1 # RX enable (-1 to disable)
txled_pin: -1 # TX LED indicator (-1 to disable)
rxled_pin: -1 # RX LED indicator (-1 to disable)sx1262:
use_dio3_tcxo: false # Enable DIO3 TCXO power supply
dio3_tcxo_voltage: 1.8 # TCXO voltage (1.6V, 1.7V, 1.8V, 2.7V, 3.0V, 3.3V)
use_dio2_rf: false # Use DIO2 for RF switching
is_waveshare: false # Waveshare hardware compatibility modeTransmission delay configuration for different routing modes.
Type: float
Default: 1.0
Description: Multiplier for flood mode transmission delays. Higher values = more delay before forwarding.
delays:
tx_delay_factor: 1.0Type: float
Default: 0.5
Description: Multiplier for direct mode transmission delays. Lower = faster forwarding for direct packets.
delays:
direct_tx_delay_factor: 0.5Control radio airtime to comply with regulations (e.g., EU 1% duty cycle).
Type: boolean
Default: false
Description: Enable/disable duty cycle enforcement.
duty_cycle:
enforcement_enabled: falseType: integer (milliseconds)
Default: 3600
Description: Maximum transmission time per minute. Default of 3600ms = 6% duty cycle.
For EU 1% duty cycle:
duty_cycle:
enforcement_enabled: true
max_airtime_per_minute: 600 # 1% of 60000msType: string (path)
Default: "/var/lib/pymc_repeater"
Description: Directory for SQLite database and RRD files.
storage:
storage_dir: "/var/lib/pymc_repeater"storage:
retention:
sqlite_cleanup_days: 31RRD Archives (automatic):
- 1 minute resolution for 1 week
- 5 minute resolution for 1 month
- 1 hour resolution for 1 year
Publish packet data to a local MQTT broker (e.g., Mosquitto, Home Assistant).
Type: boolean
Default: false
Description: Enable/disable local MQTT publishing.
mqtt:
enabled: truemqtt:
broker: "localhost"
port: 1883
use_websockets: false # Use WebSocket transport (ports: 80, 443, 9001)
username: null # Optional authentication
password: nullmqtt:
tls:
enabled: false
ca_cert: null # Custom CA certificate (null for system default)
client_cert: null # Client certificate for mutual TLS
client_key: null # Client key for mutual TLS
insecure: false # Skip certificate verification (not recommended)mqtt:
base_topic: "meshcore/repeater"Messages published to:
-
{base_topic}/{node_name}/packet- Packet data -
{base_topic}/{node_name}/advert- Advertisement messages
Example: meshcore/repeater/my-home-repeater/packet
Publish data to LetsMesh service for network-wide monitoring.
Type: boolean
Default: false
Description: Enable/disable LetsMesh publishing.
letsmesh:
enabled: trueType: string
Default: "Test"
Description: Airport/location code for grouping nodes geographically (e.g., "SFO", "LHR", "NYC").
letsmesh:
iata_code: "NYC"Type: integer
Default: 0
Options:
-
0- Europe (mqtt-eu-v1.letsmesh.net) - single built-in broker -
1- US West (mqtt-us-v1.letsmesh.net) - single built-in broker -
-1ornull- All built-in brokers (maximum redundancy) -
-2- Only custom brokers (ignores built-in brokers)
letsmesh:
broker_index: 0 # Use EU brokerType: integer (seconds)
Default: 300
Description: Heartbeat interval for status updates (uptime, packet counts).
letsmesh:
status_interval: 300Type: string
Default: ""
Description: Owner name and email for identification on LetsMesh network.
letsmesh:
owner: "Your Name"
email: "your.email@example.com"Type: list of objects
Description: Additional custom MQTT brokers for private or backup connectivity.
letsmesh:
broker_index: 0 # EU primary
additional_brokers:
- name: "Backup Server"
host: "mqtt-backup.mydomain.com"
port: 8883
audience: "mqtt-backup.mydomain.com"
- name: "Custom Primary"
host: "mqtt-1.mydomain.com"
port: 443
audience: "mqtt-1.mydomain.com"Block specific packet types from being published to LetsMesh.
letsmesh:
disallowed_packet_types:
- TRACE # Don't publish trace packets
- ACK # Don't publish acknowledgmentsAvailable packet types:
-
REQ- Requests -
RESPONSE- Responses -
TXT_MSG- Text messages -
ACK- Acknowledgments -
ADVERT- Advertisements -
GRP_TXT- Group text messages -
GRP_DATA- Group data -
ANON_REQ- Anonymous requests -
PATH- Path packets -
TRACE- Trace packets -
RAW_CUSTOM- Custom raw packets
Type: string
Default: "INFO"
Options: DEBUG, INFO, WARNING, ERROR
Description: Logging verbosity level.
logging:
level: INFOType: string
Default: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
Description: Log message format (Python logging format).
Type: boolean
Default: false
Description: Enable CORS headers for web API. Required if accessing web interface from different domain.
web:
cors_enabled: falseType: string (path)
Default: Built-in path (null)
Description: Custom path to web frontend files. Allows overriding the default built-in web interface.
web:
web_path: null # Use default built-in interface
# web_path: "/opt/custom-web-ui" # Or use custom pathletsmesh: enabled: true
### `letsmesh.iata_code`
**Type:** `string`
**Default:** `"Test"`
**Description:** Airport/location code for grouping nodes geographically (e.g., "SFO", "LHR", "NYC").
```yaml
letsmesh:
iata_code: "NYC"
repeater:
node_name: "my-repeater"
latitude: 51.5074
longitude: -0.1278
mesh:
global_flood_allow: true
radio:
frequency: 869618000
tx_power: 14
bandwidth: 62500
spreading_factor: 8
coding_rate: 8
sx1262:
cs_pin: 21
reset_pin: 18
busy_pin: 20
irq_pin: 16repeater:
node_name: "rooftop-repeater-01"
latitude: 40.7128
longitude: -74.0060
send_advert_interval_hours: 10
mesh:
global_flood_allow: true
radio:
frequency: 915000000 # US frequency
tx_power: 20
bandwidth: 62500
spreading_factor: 8
coding_rate: 8
sx1262:
cs_pin: 21
reset_pin: 18
busy_pin: 20
irq_pin: 16
duty_cycle:
enforcement_enabled: false
letsmesh:
enabled: true
iata_code: "NYC"
broker_index: 1 # US broker
status_interval: 60
disallowed_packet_types:
- TRACE
- ACK
logging:
level: INFOrepeater:
node_name: "home-mesh-repeater"
radio:
frequency: 869618000
tx_power: 14
sx1262:
cs_pin: 21
reset_pin: 18
busy_pin: 20
irq_pin: 16
storage:
mqtt:
enabled: true
broker: "192.168.1.100" # Home Assistant IP
port: 1883
username: "mqtt_user"
password: "mqtt_password"
base_topic: "meshcore/repeater"
logging:
level: INFO- Verify GPIO pin numbers match your hardware (use BCM numbering)
- Ensure SPI is enabled:
sudo raspi-configβ Interface Options β SPI - Test radio connection before deploying
- All nodes must use identical radio settings
- Lower spreading factor = faster but shorter range
- Higher TX power = longer range but more power draw
- Balance bandwidth vs. range for your deployment
- Start with local MQTT disabled, enable after testing
- Use LetsMesh for cloud monitoring and analytics
- Filter unnecessary packet types to reduce bandwidth
- Keep your identity file secure (contains private key)
- Use strong passwords for MQTT authentication
- Consider firewall rules for web interface
- Use
INFOlevel for normal operation - Switch to
DEBUGwhen troubleshooting - Monitor SQLite database size and clean up old data
- Check duty cycle compliance in regulated regions
- Check GPIO pin configuration
- Verify SPI is enabled
- Check logs:
journalctl -u pymc-repeater -f
- Verify radio settings match network
- Check frequency is correct for region
- Ensure antenna is properly connected
- Verify internet connectivity
- Check
broker_index(0=EU, 1=US) - Ensure
iata_codeis set - Look for JWT token errors in logs
- Check if you can access https://analyzer.letsmesh.sh from the same network as the Pi
- Reduce
logging.levelfrom DEBUG to INFO - Check for excessive packet traffic
- Monitor duty cycle enforcement
Configuration Version: Compatible with pyMC Repeater v1.0.5+ (or current dev branch)