Python application to connect to a Leica DISTO D1/D110 laser distance meter via Bluetooth Low Energy (BLE) and retrieve distance measurements.
- ✅ Automatic BLE connection to DISTO distance meter
- ✅ Smart timer mode: automatic measurement 1 second after button press (for stabilization)
- ✅ Automatic laser activation for aiming during delay
- ✅ Auto-type: automatic input of measurements into spreadsheets
- ✅ Configurable delay
- ✅ Support for different units (m, ft, in, mm, yd, etc.)
- ✅ Active mode to trigger measurements from PC
- Python 3.7+
- Linux with Bluetooth LE (BlueZ)
- Bluetooth enabled
pip install -r requirements.txtOr with a virtual environment:
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtThe auto-type feature uses pynput for keyboard simulation. It works out of the box on most systems.
Compatibility:
- ✅ Works perfectly on X11 systems
- ✅ Works with XWayland apps (VS Code, many Electron apps)
⚠️ Limited support for Wayland native apps (LibreOffice, Chromium under Wayland)
Note: If you need full Wayland native support, consider using X11 mode for your desktop environment.
# Clone or download the project
git clone <repo-url>
cd leica
# Install dependencies
pip install -r requirements.txt
# Make script executable (optional)
chmod +x disto_reader.pyListens for measurements when you press the physical button on the distance meter:
python disto_reader.pyWorkflow:
- Script connects to DISTO
- You press the button on the distance meter
- Laser turns on automatically
- After 1 second, an automatic measurement is taken
- Result is displayed
Measurements are automatically typed into the active application:
python disto_reader.py --auto-typeUsage with spreadsheets:
- Open your spreadsheet (LibreOffice Calc, Excel, Google Sheets...)
- Click on the first cell
- Launch the script with
--auto-type - Switch back to spreadsheet (Alt+Tab)
- Take your measurements!
Each measurement will be automatically typed and validated with Enter.
Adjust the delay before the final measurement:
python disto_reader.py --delay 2.0 # 2 seconds
python disto_reader.py -d 0.5 # 0.5 secondChoose between dot or comma for decimal separator:
python disto_reader.py --separator . # 1.234 (default)
python disto_reader.py --separator , # 1,234 (European format)
python disto_reader.py -s , # Short formUseful for European locales where comma is the standard decimal separator.
Trigger measurements from PC (interactive interface):
python disto_reader.py --activeAvailable commands:
m: Measure distancea: Measure distance + anglel: Turn laser ono: Turn laser offq: Quit
python disto_reader.py --help# Standard passive mode (1s)
python disto_reader.py
# More time to aim (3s)
python disto_reader.py --delay 3# Auto-type with 2s delay
python disto_reader.py --auto-type --delay 2
# Auto-type with comma separator (European format)
python disto_reader.py -t -s ,
# Combine all options: auto-type, 2s delay, comma separator
python disto_reader.py -t -d 2 -s ,python disto_reader.py --active- Format: Number with 3 decimals (e.g.,
1.234or1,234) - Supported units: m, ft, in, mm, yd, ft+in
- Decimal separator: Configurable via
--separator(dot or comma)
- Typed format:
X.XXXorX,XXX(no unit, based on separator setting) - Default separator: Decimal point
.(use-s ,for comma) - Validation: Automatic Enter key press
The script implements Leica's proprietary BLE protocol:
- Service UUID:
3ab10100-f831-4395-b29d-570977d5bf94 - Characteristics:
- Distance:
3ab10101-...(Float 4 bytes, Little Endian) - Unit:
3ab10102-...(Integer 1 byte) - Command:
3ab10109-...(ASCII strings)
- Distance:
For more details, see CLAUDE.md.
- Check that DISTO is powered on
- Check that Bluetooth is enabled:
bluetoothctl power on - Make sure DISTO is not connected to another device
- Try with sudo (may fix some permission issues)
Check your environment:
echo $XDG_SESSION_TYPE # x11 or waylandAuto-type should work perfectly. ✅
- XWayland apps: Auto-type works normally (VS Code, many Electron apps, older applications)
- Wayland native apps: Limited support - may not work in LibreOffice, Chromium, etc.
Solutions for Wayland:
-
Use X11 mode (recommended if you need full auto-type support):
# Log out and select "GNOME on Xorg" or "KDE Plasma (X11)" at login screen -
Use XWayland apps when possible (many apps use XWayland by default)
-
Manual entry: If auto-type doesn't work, measurements are still displayed on screen for manual entry
# Option 1: Run with sudo (temporary)
sudo python disto_reader.py
# Option 2: Add user to bluetooth group (permanent)
sudo usermod -aG bluetooth $USER
# Then logout and login- Increase delay:
--delay 2 - Check distance between PC and DISTO (Bluetooth range ~10m)
- Avoid metal obstacles between them
disto_reader.py
├── BLE Scan (DISTO discovery)
├── GATT Connection
├── Notification setup (critical timing: 950ms + 100ms)
├── Passive Mode (automatic timer)
│ ├── Button press detection → Measurement ignored
│ ├── Immediate laser activation
│ ├── Configurable wait (default: 1s)
│ └── Automatic measurement → Display + auto-type
└── Active Mode (manual commands)
└── Interactive interface
This project was developed by analyzing the official Leica DISTO Android APK through decompilation (jadx).
Personal and educational use.
Developed with assistance from Claude (Anthropic) by analyzing the BLE protocol from the official Android application.
- CLAUDE.md - Detailed BLE protocol documentation
- Official Android app:
leica.disto.transferBLE(version 1.20) - Protocol: BLE GATT with Leica proprietary service