diff --git a/.env.example b/.env.example index efbd61c..f8f04cf 100644 --- a/.env.example +++ b/.env.example @@ -2,17 +2,25 @@ # Copy this file to .env and adjust values for your setup # ============================================ -# MeshCore Device Configuration +# MeshCore Device Connection # ============================================ +# Two transport options: Serial (USB) or TCP (network). +# Set MC_TCP_HOST to use TCP; leave empty to use serial. -# Serial port path +# --- Option A: Serial (default) --- # Use "auto" for automatic detection (recommended if only one USB device) # Or specify manually: /dev/serial/by-id/usb-xxx or /dev/ttyUSB0 # Find available devices: ls /dev/serial/by-id/ MC_SERIAL_PORT=auto +# --- Option B: TCP (e.g. remote device via ser2net, meshcore-proxy) --- +# Set the IP/hostname of the device to connect via TCP instead of serial. +# When MC_TCP_HOST is set, MC_SERIAL_PORT is ignored. +# MC_TCP_HOST=192.168.1.100 +# MC_TCP_PORT=5555 + # Your MeshCore device name (used for .msgs file) -# Use "auto" for automatic detection from meshcli (recommended) +# Use "auto" for automatic detection from device (recommended) # Or specify manually: MarWoj, SP5XYZ, MyNode MC_DEVICE_NAME=auto diff --git a/app/config.py b/app/config.py index 3d2eec0..90f14bd 100644 --- a/app/config.py +++ b/app/config.py @@ -30,7 +30,7 @@ class Config: # v2: TCP connection (alternative to serial, e.g. meshcore-proxy) MC_TCP_HOST = os.getenv('MC_TCP_HOST', '') # empty = use serial - MC_TCP_PORT = int(os.getenv('MC_TCP_PORT', '5000')) + MC_TCP_PORT = int(os.getenv('MC_TCP_PORT', '5555')) # v2: Backup MC_BACKUP_ENABLED = os.getenv('MC_BACKUP_ENABLED', 'true').lower() == 'true' diff --git a/docker-compose.yml b/docker-compose.yml index 9dcc474..58cb072 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,9 +19,8 @@ services: - MC_DEVICE_NAME=${MC_DEVICE_NAME:-MeshCore} - MC_CONFIG_DIR=/data - MC_DB_PATH=/data/mc-webui.db - # TCP mode (uncomment to use meshcore-proxy instead of serial): - # - MC_TCP_HOST=192.168.1.100 - # - MC_TCP_PORT=5000 + - MC_TCP_HOST=${MC_TCP_HOST:-} + - MC_TCP_PORT=${MC_TCP_PORT:-5555} - MC_BACKUP_ENABLED=${MC_BACKUP_ENABLED:-true} - MC_BACKUP_HOUR=${MC_BACKUP_HOUR:-2} - MC_BACKUP_RETENTION_DAYS=${MC_BACKUP_RETENTION_DAYS:-7}