Using the BLE Bridge with Bluetooth Meshtastic Devices β
The MeshMonitor BLE Bridge is a specialized gateway that enables MeshMonitor to communicate with Bluetooth Low Energy (BLE) Meshtastic devices by translating between BLE and TCP protocols.
What is the BLE Bridge? β
The BLE Bridge is a lightweight application that:
- Connects to Meshtastic devices via Bluetooth Low Energy (BLE)
- Exposes a TCP interface on port 4403 compatible with MeshMonitor
- Translates between BLE's raw protobuf format and TCP's framed protocol
- Available as a native Windows application or Docker container for Linux
- Provides automatic reconnection and error recovery
When to Use the BLE Bridge β
Use the BLE Bridge when:
- β Your Meshtastic device only has Bluetooth connectivity (no WiFi/Ethernet)
- β You want to monitor a portable/mobile Meshtastic device
- β Your device is nearby (within Bluetooth range, typically 10-30 meters)
- β You're running MeshMonitor on a system with Bluetooth hardware (Linux with BlueZ)
Do NOT use the BLE Bridge if:
- β Your device has WiFi/Ethernet - connect directly via TCP instead
- β Your device is USB/Serial connected - use the Meshtastic Serial Bridge instead
- β Your system doesn't have Bluetooth hardware
Prerequisites β
Before setting up the BLE Bridge, ensure you have:
For Windows:
- Windows 10/11 with Bluetooth hardware
- BLE MAC address of your Meshtastic device
- Find it using the scan feature in the app
- Usually visible in Android/iOS Bluetooth settings
For Linux (Docker):
Linux system with Bluetooth support
- BlueZ Bluetooth stack installed
- D-Bus system bus running
- Bluetooth adapter enabled
Docker and Docker Compose
- Docker Engine 20.10+
- Docker Compose v2
BLE MAC address of your Meshtastic device
- Find it using the scan command (see below)
- Usually visible in Android/iOS Bluetooth settings
Windows Quick Start β
For Windows users, a native GUI application is available that runs in the system tray.
1. Download the Windows Application β
Download the latest meshtastic-ble-bridge.exe from the GitHub Releases page.
2. Pair Your Meshtastic Device β
Before the BLE Bridge can connect, you must pair your Meshtastic device with Windows:
- Open Windows Settings β Bluetooth & devices
- Click Add device β Bluetooth
- Put your Meshtastic device in pairing mode (if required)
- Select your Meshtastic device from the list (usually named
Meshtastic_XXXX) - Complete the pairing process
- Note the device's MAC address from the Bluetooth settings (you'll need this)
Finding the MAC Address
After pairing, go to Bluetooth & devices β Devices, click on your Meshtastic device, and scroll down to find the Bluetooth address (MAC address) in the format AA:BB:CC:DD:EE:FF.
3. Run the Application β
Double-click the executable to launch. The application will appear in your system tray with a gray icon (disconnected state).
4. Configure the Bridge β
Right-click the system tray icon and select Settings to open the configuration dialog:
- BLE Address: Enter your Meshtastic device's Bluetooth MAC address (e.g.,
AA:BB:CC:DD:EE:FF) - TCP Port: Default is
4403(standard Meshtastic port) - Auto-start: Enable to automatically connect when the application launches
- Config Caching: Optional performance optimization
5. Connect to Your Device β
Click Connect in the settings dialog or right-click the tray icon and select Connect.
The tray icon provides visual feedback:
- π’ Green: Connected to BLE device
- βͺ Gray: Disconnected
- π΄ Red: Connection failed after retry attempts
6. View Statistics β
Right-click the tray icon and select Statistics to view:
- Connection status
- Packet counts (sent/received)
- Connected TCP clients
- Cache performance (if enabled)
7. Configure MeshMonitor β
Point MeshMonitor to your Windows machine's IP address on port 4403:
MESHTASTIC_NODE_IP=192.168.1.100 # Your Windows PC's IP
MESHTASTIC_NODE_PORT=4403Windows Firewall
You may need to allow the BLE Bridge through Windows Firewall to accept connections from MeshMonitor on port 4403.
Linux Quick Start (Docker) β
For Linux users, the BLE Bridge runs as a Docker container alongside MeshMonitor.
1. Find Your Device's BLE MAC Address β
Run the BLE bridge in scan mode to discover nearby Meshtastic devices:
docker run --rm --privileged \
-v /var/run/dbus:/var/run/dbus \
ghcr.io/yeraze/meshtastic-ble-bridge:latest --scanLook for output like:
Found Meshtastic device: Meshtastic_1a2b (AA:BB:CC:DD:EE:FF)The MAC address is AA:BB:CC:DD:EE:FF.
2. Create Environment File β
Create a .env file in your MeshMonitor directory:
# .env file
BLE_ADDRESS=AA:BB:CC:DD:EE:FF # Replace with your device's MAC address3. Start MeshMonitor with BLE Bridge β
Use the docker-compose overlay to add the BLE bridge:
docker compose -f docker-compose.yml -f docker-compose.ble.yml up -d4. Verify Connection β
Check the logs to confirm the BLE bridge is connected:
# Check BLE bridge logs
docker compose -f docker-compose.ble.yml logs ble-bridge
# Look for:
# "Connected to BLE device AA:BB:CC:DD:EE:FF"
# "TCP server listening on 0.0.0.0:4403"
# Check MeshMonitor logs
docker compose logs meshmonitor
# Look for:
# "Connected to Meshtastic node at localhost:4403"Configuration Details β
Docker Compose Overlay β
The docker-compose.ble.yml file adds the BLE bridge service:
services:
ble-bridge:
image: ghcr.io/yeraze/meshtastic-ble-bridge:latest
container_name: meshmonitor-ble-bridge
privileged: true # Required for BLE hardware access
restart: unless-stopped
volumes:
- /var/run/dbus:/var/run/dbus # Required for D-Bus/Bluetooth
- /var/lib/bluetooth:/var/lib/bluetooth:ro # Pairing information
environment:
- BLE_ADDRESS=${BLE_ADDRESS:-}
- HEALTH_FILE=/tmp/ble-bridge.health
command: ${BLE_ADDRESS:-}
healthcheck:
test: ["CMD", "python3", "-c", "import os, sys, time; f = '/tmp/ble-bridge.health'; sys.exit(0 if os.path.exists(f) and time.time() - os.path.getmtime(f) < 60 else 1)"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60sHealth check and recovery β
The bridge touches the file named by HEALTH_FILE every 10 seconds while the BLE link is up and data is flowing. The health check reports the container healthy only while that file is fresh, so docker ps shows unhealthy when the link is down, even though port 4403 still accepts connections.
When the bridge cannot reconnect after 10 attempts, it exits with code 1 and restart: unless-stopped starts it again. Docker does not restart a container just because it is unhealthy; recovery comes from the exit.
MeshMonitor depends on the bridge with condition: service_started, so MeshMonitor still starts when the node is out of range, and reconnects once the bridge is up.
Key Configuration Options β
Privileged Mode β
The BLE bridge requires privileged: true to access Bluetooth hardware. This grants the container direct access to the host's Bluetooth adapter.
Security Note: Privileged mode should only be used on trusted systems. For production, consider using device-specific capabilities instead.
Docker Networking β
The BLE bridge and MeshMonitor communicate using Docker's internal networking. MeshMonitor connects to the BLE bridge using its container name (meshmonitor-ble-bridge) as the hostname.
Volume Mounts β
Two volumes are required for Bluetooth access:
- D-Bus socket (
/var/run/dbus): Communication with BlueZ daemon - Bluetooth config (
/var/lib/bluetooth): Access to pairing database
MeshMonitor Configuration β
When using the overlay, MeshMonitor automatically configures itself:
environment:
- MESHTASTIC_NODE_IP=meshmonitor-ble-bridge
- MESHTASTIC_NODE_PORT=4403The BLE bridge acts as a transparent TCP proxy on port 4403. MeshMonitor connects to it using Docker's internal DNS, which resolves the container name to the correct IP.
Pairing Your Device β
Some Meshtastic devices require Bluetooth pairing before the bridge can connect.
Pairing on Linux Host β
If the device requires pairing, use bluetoothctl on your host system:
# Start bluetoothctl
bluetoothctl
# Enable scanning
scan on
# Wait for your device to appear
# You'll see: Device AA:BB:CC:DD:EE:FF Meshtastic_1234
# Pair with the device
pair AA:BB:CC:DD:EE:FF
# Trust the device
trust AA:BB:CC:DD:EE:FF
# Exit
exitAfter pairing on the host, the BLE bridge container can access the paired device through the /var/lib/bluetooth mount.
Troubleshooting β
Device Not Found During Scan β
Problem: --scan doesn't show your Meshtastic device.
Solutions:
Ensure Bluetooth is enabled on the device:
- Check Meshtastic app settings
- Verify BLE is not disabled in device configuration
Check host Bluetooth adapter:
bash# Verify adapter is up hciconfig # Should show: hci0 UP RUNNING # If down, bring it up: sudo hciconfig hci0 upVerify BlueZ is running:
bashsystemctl status bluetooth
Connection Refused or Timeout β
Problem: BLE bridge can't connect to the device even though scan finds it.
Solutions:
Pair the device (see Pairing section)
Ensure device is in range:
- BLE typically works within 10-30 meters
- Move device closer to the host system
Check for interference:
- WiFi routers and other 2.4GHz devices can interfere
- Try moving away from interference sources
MeshMonitor Can't Connect to BLE Bridge β
Problem: BLE bridge starts but MeshMonitor shows "Connection failed".
Solutions:
Verify TCP server is listening:
bash# From host netstat -tln | grep 4403 # Should show: tcp 0.0.0.0:4403 LISTENCheck BLE bridge logs:
bashdocker compose -f docker-compose.ble.yml logs ble-bridgeVerify environment variables:
bashdocker compose -f docker-compose.ble.yml config
BLE Bridge Keeps Disconnecting β
Problem: Connection drops frequently or BLE bridge restarts.
Solutions:
Check Bluetooth signal strength:
- Move device closer to host
- Remove obstacles between device and host
Review BLE bridge logs for errors:
bashdocker compose -f docker-compose.ble.yml logs -f ble-bridgeVerify power management isn't disabling Bluetooth:
bash# Disable USB autosuspend for Bluetooth adapter echo 'on' | sudo tee /sys/bus/usb/devices/*/power/level
Advanced Networking β
Using Bridge Network Instead of Host Network β
For better container isolation, you can use a bridge network instead of host networking:
services:
ble-bridge:
image: ghcr.io/yeraze/meshtastic-ble-bridge:latest
privileged: true
networks:
- mesh-network
volumes:
- /var/run/dbus:/var/run/dbus
- /var/lib/bluetooth:/var/lib/bluetooth:ro
environment:
- BLE_ADDRESS=${BLE_ADDRESS}
meshmonitor:
image: ghcr.io/yeraze/meshmonitor:latest
networks:
- mesh-network
environment:
- MESHTASTIC_NODE_IP=ble-bridge
- MESHTASTIC_NODE_PORT=4403
depends_on:
- ble-bridge
networks:
mesh-network:
driver: bridgeRunning BLE Bridge on Separate Host β
If your MeshMonitor server doesn't have Bluetooth hardware, run the BLE bridge on a separate machine:
On Bluetooth-enabled host:
services:
ble-bridge:
image: ghcr.io/yeraze/meshtastic-ble-bridge:latest
privileged: true
network_mode: host
volumes:
- /var/run/dbus:/var/run/dbus
- /var/lib/bluetooth:/var/lib/bluetooth:ro
environment:
- BLE_ADDRESS=AA:BB:CC:DD:EE:FFOn MeshMonitor host:
services:
meshmonitor:
image: ghcr.io/yeraze/meshmonitor:latest
environment:
- MESHTASTIC_NODE_IP=192.168.1.50 # IP of BLE bridge host
- MESHTASTIC_NODE_PORT=4403Note: Ensure port 4403 is accessible between hosts (check firewalls).
Building from Source β
Linux (Docker) β
To build the Docker image from source:
# Clone the repository
git clone https://github.com/Yeraze/meshtastic-ble-bridge.git
cd meshtastic-ble-bridge
# Build the image
docker build -t meshtastic-ble-bridge:local .
# Update docker-compose.ble.yml to use local build
# Uncomment the 'build' section and comment out 'image'Windows (Executable) β
To build the Windows executable from source:
# Clone the repository
git clone https://github.com/Yeraze/meshtastic-ble-bridge.git
cd meshtastic-ble-bridge
# Create virtual environment
python -m venv venv
venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
pip install pyinstaller
# Build the executable
pyinstaller --onefile --windowed --name meshtastic-ble-bridge gui.pyThe executable will be created in the dist folder.
Performance and Resource Usage β
The BLE bridge is lightweight:
- Memory: ~50-100 MB
- CPU: Minimal (< 5% on idle)
- Network: ~1-5 KB/s (depends on mesh activity)
- Bluetooth: Standard BLE power consumption
Security Considerations β
Linux: Privileged containers have full access to host hardware
- Only run on trusted systems
- Consider using specific device capabilities in production
Windows: Firewall configuration
- Allow only trusted IPs to connect to port 4403
- Consider running MeshMonitor and BLE Bridge on the same machine
Bluetooth security:
- Use pairing when possible
- Keep Bluetooth firmware updated
- Monitor for unauthorized connections
Network security:
- The TCP interface is unencrypted
- Use firewall rules to restrict access to port 4403
- Consider running on isolated network segment
Protocol Details β
For developers and advanced users:
BLE Protocol β
- Service UUID:
6ba1b218-15a8-461f-9fa8-5dcae273eafd - ToRadio (Write):
f75c76d2-129e-4dad-a1dd-7866124401e7 - FromRadio (Read/Notify):
2c55e69e-4993-11ed-b878-0242ac120002 - Format: Raw protobuf bytes (no framing)
TCP Protocol β
- Frame Structure:
[0x94][0xC3][LENGTH_MSB][LENGTH_LSB][PROTOBUF_DATA] - Port: 4403 (Meshtastic standard)
- Format: 4-byte header + protobuf payload
The BLE bridge handles translation between these protocols automatically.
Next Steps β
- Configure notifications for real-time alerts
- Set up a reverse proxy for remote access
- Deploy to production with monitoring
- BLE Bridge GitHub Repository for source code and updates
Alternative Solutions β
If the BLE bridge doesn't meet your needs:
- WiFi/Ethernet devices: Connect directly via TCP (no bridge needed)
- Serial/USB devices: Use the Meshtastic Serial Bridge instead
- Virtual nodes: Use meshtasticd for testing without hardware
- HomeAssistant users: Connect through HomeAssistant's Meshtastic integration
- Long-range BLE: Consider using a BLE-to-WiFi bridge device