This guide will help you capture Bluetooth Low Energy (BLE) traffic from your unsupported LED device to analyze the protocol and add support for new devices in the elkbledom integration.
When we encounter a new LED device model that isn't supported by this integration, we need to understand how the official app communicates with the device. By capturing and analyzing the BLE packets, we can:
- Identify command structures (power on/off, colors, brightness, effects)
- Understand packet formats and checksums
- Map effect IDs and speed values
- Discover device-specific features
This is the most reliable and comprehensive method for capturing BLE traffic.
- nRF52840 USB Dongle (~$10-15 USD)
- Official: Nordic Semiconductor nRF52840 Dongle (PCA10059)
- Compatible alternatives available from various vendors (search "nRF52840 dongle")
- USB-A port on your computer (or USB-C adapter)
- Wireshark (latest version with BLE support)
- Download from wireshark.org
- nRF Sniffer for Bluetooth LE
- Download from Nordic's website
- nrfutil (for flashing the dongle)
- Install via pip:
pip install nrfutil
- Install via pip:
- Download the nRF Sniffer for Bluetooth LE package from Nordic
- Extract the package and locate the firmware hex file:
- Usually in
nrf_sniffer_for_bluetooth_le/hex/sniffer_nrf52840dongle_nrf52840_<version>.hex
- Usually in
- Put the dongle into DFU (Device Firmware Update) mode:
- Plug in the dongle
- Press and hold the small button on the side
- While holding, unplug and replug the USB dongle
- Release the button - the LED should pulse red
- Flash the firmware:
nrfutil dfu usb-serial -pkg sniffer_nrf52840dongle_nrf52840_<version>.zip -p /dev/ttyACM0
- On Windows, replace
/dev/ttyACM0with the appropriate COM port (e.g.,COM3) - On macOS, use
/dev/cu.usbmodem<number>
- On Windows, replace
- After successful flashing, unplug and replug the dongle
- Extract the nRF Sniffer package
- Locate the Wireshark extcap plugin:
nrf_sniffer_for_bluetooth_le/extcap/
- Copy the plugin files to Wireshark's extcap directory:
- Linux:
~/.config/wireshark/extcap/or/usr/lib/wireshark/extcap/ - Windows:
%APPDATA%\Wireshark\extcap\orC:\Program Files\Wireshark\extcap\ - macOS:
/Applications/Wireshark.app/Contents/MacOS/extcap/
- Linux:
- Make the plugin executable (Linux/macOS):
chmod +x ~/.config/wireshark/extcap/nrf_sniffer_ble.sh - Restart Wireshark
- Start Wireshark
- Select the nRF Sniffer interface:
- Look for "nRF Sniffer for Bluetooth LE" in the interface list
- Click the gear icon next to it to configure
- Configure the sniffer:
- Device: Select your nRF52840 dongle (e.g.,
/dev/ttyACM0orCOM3) - Advertising Channel: Leave as "All advertising channels" (37, 38, 39)
- BLE PHY: Leave as "Auto" or select "1M" for most devices
- Device: Select your nRF52840 dongle (e.g.,
- Start capture:
- Click "Start" to begin capturing
- The dongle LED should turn green
- Identify your device:
- Look for advertising packets in Wireshark
- Filter by device name or MAC address:
bluetooth.device_name contains "ELK" or bluetooth.device_name contains "MELK" or bluetooth.device_name contains "LEDBLE" or btle.advertising_address == aa:bb:cc:dd:ee:ff - Common device name patterns:
ELK-BLEDOM,ELK-BLEDOB,MELK-,LEDBLE-,XROCKER
- Follow the device:
- Right-click on an advertising packet from your device
- Select "Follow" → "Bluetooth LE Connection"
- This will track the connection automatically
- Control the device:
- Open the official app on your phone
- Connect to the LED device
- Perform various actions (see "What to Capture" section below)
- Stop and save:
- Stop the capture in Wireshark
- Save as
.pcapor.pcapngfile - File → Save As → choose location
- Distance matters: Keep the dongle relatively close to your LED device (within 1-2 meters)
- Reduce interference: Turn off other Bluetooth devices if possible
- Multiple captures: If you miss the connection, restart the capture and reconnect the app
- LED indicators:
- Green: Capturing
- Red pulsing: DFU mode
- Off: Not powered or not running
Once you have the capture:
- Filter for writes:
btatt.opcode == 0x52 || btatt.opcode == 0x120x52= Write Request0x12= Write Command
- Look for the control characteristic:
- Usually
0000fff3-0000-1000-8000-00805f9b34fb(write) for ELK/MELK devices - Or
0000ffe1-0000-1000-8000-00805f9b34fb(write) for LEDBLE/XROCKER devices - Notifications come from
0000fff4-0000-1000-8000-00805f9b34fb(read/notify) for ELK/MELK - Or
0000ffe2-0000-1000-8000-00805f9b34fb(read/notify) for LEDBLE/XROCKER
- Usually
- Export packet data:
- Right-click on a packet → Copy → "...as Hex Dump"
- Or use File → Export Packet Dissections → as JSON/CSV
This method uses Android's built-in Bluetooth HCI (Host Controller Interface) logging. It's easier to set up but requires an Android device.
- Android device (phone or tablet)
- USB cable for connecting to computer
- ADB (Android Debug Bridge) installed on your computer
- Download: Android SDK Platform Tools
- Your led strip app installed
- Open Settings on your Android device
- Navigate to About Phone (or About Device)
- Find Build Number
- Tap Build Number 7 times rapidly
- You should see a message: "You are now a developer!"
- Go back to main Settings
- Go to Settings → System → Developer Options
- On some devices: Settings → Developer Options
- Scroll down to the Debugging section
- Enable Bluetooth HCI snoop log
- Some devices show "Enable Bluetooth HCI snoop log"
- Others show "Bluetooth HCI snoop log" with On/Off toggle
- Some devices will ask you to restart - do so if prompted
- Ensure HCI logging is enabled (green/on)
- Forget the device in Bluetooth settings (if previously paired)
- Open the led strip app
- Connect to your LED device
- Perform actions (see "What to Capture" section below)
- Disconnect when done
The log file location varies by Android version and manufacturer:
Common locations:
/sdcard/btsnoop_hci.log(some Samsung, older Android)/sdcard/Android/data/btsnoop_hci.log/data/misc/bluetooth/logs/btsnoop_hci.log(requires root)/data/misc/bluedroid/btsnoop_hci.log(older Android)
Method A: Using ADB (Recommended)
- Connect your device to computer via USB
- Enable USB Debugging in Developer Options
- Authorize computer (popup on phone)
- Pull the log file:
# Try common locations adb pull /sdcard/btsnoop_hci.log btsnoop_hci.log adb pull /sdcard/Android/data/btsnoop_hci.log btsnoop_hci.log # If you have root access adb shell su -c "cp /data/misc/bluetooth/logs/btsnoop_hci.log /sdcard/" adb pull /sdcard/btsnoop_hci.log btsnoop_hci.log
- Disable HCI snoop after capturing (it can fill storage)
Method B: Using File Manager App
- Install a file manager app (e.g., Solid Explorer)
- Navigate to the log location
- Copy the file to a location you can access
- Transfer to your computer (USB, cloud, email, etc.)
Method C: Android Studio
- Open Android Studio
- Go to View → Tool Windows → Device File Explorer
- Navigate to log location
- Right-click file → Save As
- Launch Wireshark
- Open the log: File → Open → select
btsnoop_hci.log - Filter for your device:
Replace with your device's MAC address
bluetooth.addr == aa:bb:cc:dd:ee:ff - Filter for ATT writes:
btatt.opcode == 0x52 || btatt.opcode == 0x12
Problem: Can't find the log file
- Solution: Try all common locations listed above
- Solution: Check if HCI logging is actually enabled
- Solution: Some devices save to different locations - check XDA forums for your device model
Problem: Log file is empty
- Solution: Ensure you performed Bluetooth actions after enabling logging
- Solution: Restart Bluetooth or reboot device after enabling
- Solution: Some devices require Bluetooth to be turned off and on again
Problem: ADB not authorized
- Solution: Check phone for authorization popup
- Solution: Revoke USB debugging authorizations in Developer Options, then try again
- Solution: Run
adb kill-serverthenadb start-server
Problem: File too large
- Solution: The log captures ALL Bluetooth traffic - filter in Wireshark
- Solution: Clear the log before capturing: Turn HCI logging off, delete old log, turn back on
Note: iOS BLE sniffing is significantly more difficult than Android and generally not recommended unless you have specific expertise.
- iOS device
- macOS computer with Xcode installed
- Device must be in developer mode
- Connect iOS device to macOS
- Open Xcode → Window → Devices and Simulators
- Select your device
- Click gear icon → Start Logging
- Reproduce the actions
- Stop logging and save the file
- The log format is different from standard packet captures and requires parsing
Recommendation: Use the nRF52840 dongle method instead for iOS devices - it's much simpler and more reliable.
To help us analyze the protocol, please perform these actions in order and note what you're doing:
- Power ON - Turn the lights on
- Power OFF - Turn the lights off
- Power ON again - Turn back on
- Wait 2-3 seconds between each action
- Pure RED - RGB (255, 0, 0)
- Pure GREEN - RGB (0, 255, 0)
- Pure BLUE - RGB (0, 0, 255)
- Pure WHITE - RGB (255, 255, 255)
- Yellow - RGB (255, 255, 0)
- Cyan - RGB (0, 255, 255)
- Magenta - RGB (255, 0, 255)
- Brightness 100% - Maximum brightness
- Brightness 50% - Mid-level
- Brightness 25% - Low brightness
- Brightness 10% - Very dim
- Brightness 100% - Back to full
- Effect 1 - Select first effect
- Effect Speed Slow - Slowest speed setting
- Effect Speed Fast - Fastest speed setting
- Effect Speed Medium - Middle speed
- Effect 2 - Select second effect (if available)
- Effect 5 - Select fifth effect (if available)
- Effect OFF - Return to solid color mode
- White/Color Temperature mode (if separate from RGB)
- Segments (if device has multiple sections)
- Music reactive mode (if available)
- Custom effects or patterns
- Wait 2-3 seconds between each action so packets are clearly separated
- Make notes of the timestamp or packet number for each action
- Try edge cases:
- Brightness 0% (off vs. dim)
- Rapid changes
- Multiple quick color changes
- Disconnecting and reconnecting
Once you have the capture, here's what to look for:
Most LED strip devices in this integration follow this general structure:
[Byte 0] [Byte 1] [Byte 2] [Byte 3+] [Last Byte]
7e Variant Command Payload ef or bf
Examples from supported models:
ELK-BLEDOB Power ON: 7e 07 04 ff 00 01 02 01 ef
ELK-BLEDOB Power OFF: 7e 07 04 00 00 00 02 01 ef
ELK-BLEDOB Set RED: 7e 07 05 03 ff 00 00 0a ef
ELK-BLEDOB Set BLUE: 7e 07 05 03 00 00 ff 0a ef
LEDBLE Power ON: 7e 00 04 01 00 00 00 00 ef
LEDBLE Power OFF: 7e 00 04 00 00 00 ff 00 ef
LEDBLE Set GREEN: 7e 00 05 03 00 ff 00 00 ef
XROCKER Power ON: 7b ff 04 01 ff ff ff ff bf
XROCKER Power OFF: 7b ff 04 00 ff ff ff ff bf
- Start byte: Almost always
0x7e(126),0x7b(123) for XROCKER - Variant byte (byte 1): Model-specific identifier (0x00, 0x04, 0x05, 0x06, 0x07, 0xff)
- Command byte (byte 2): Indicates command type:
0x04= Power ON/OFF0x05= Color or Color Temperature0x01= White/Brightness0x02= Effect Speed0x03= Effect Mode
- Payload: Contains the actual data (RGB values, effect ID, speed, etc.)
- End byte: Usually
0xef(239),0xbf(191) for XROCKER
Power State (Command 0x04):
- ELK-BLEDOB:
0xff(byte 3) = ON,0x00= OFF - LEDBLE:
0x01(byte 3) = ON,0x00= OFF - Some models use
0xf0for ON
Color Mode (Command 0x05, Subcommand 0x03):
- Structure:
7e [variant] 05 03 [R] [G] [B] [modifier] ef - RGB values: 0-255 (0x00-0xFF)
- Modifier byte varies by model (0x00, 0x0a, etc.)
White/Brightness (Command 0x01):
- Structure:
7e [variant] 01 [intensity] ... - Intensity: 0-255 (0x00-0xFF)
Effects (Command 0x03):
- Structure:
7e [variant] 03 [effect_id] [mode] ... - Effect ID varies by model
- Speed set separately with Command 0x02
Color Temperature (Command 0x05, Subcommand 0x02):
- Structure:
7e [variant] 05 02 [warm] [cold] ... - Warm + Cold = 100 (percentage distribution)
Some devices send status updates back:
- Check packets on characteristic
0000fff4-0000-1000-8000-00805f9b34fb(ELK/MELK) - Or characteristic
0000ffe2-0000-1000-8000-00805f9b34fb(LEDBLE/XROCKER) - These echo back the current state
- Helpful for understanding the complete protocol
- Not all models support notifications (MELK models typically don't)
Once you have captured the traffic, please share:
- The capture file (
.pcap,.pcapng, orbtsnoop_hci.log) - Device information:
- Firmware version (from manufacturer data or app)
- Model number (0x??)
- Device name as advertised
- Where you bought it / brand name
- Link to product page if available
- Your notes:
- What action corresponds to which packets
- Timestamp or packet number for each action
- Any special features the device has
- App information:
- App name and version (e.g., "Lotus Lantern", "Happy Lighting", "Duoco Strip", etc.)
- Download link (Play Store / App Store)
- Package name for Android apps (helps identify protocol family)
Option 1: GitHub Issue
- Create a new issue at github.com/dave-code-ruiz/elkbledom/issues
- Title: "New device support: [Device Name] - [Model Number if known]"
- Attach the capture file (GitHub allows up to 25MB)
- Include output from BTScan.py or easyBTScan.py
- Include all the information listed above
Option 2: Cloud Storage
- Upload to Google Drive, Dropbox, WeTransfer, etc.
- Share the link in a GitHub issue
- Include your notes and device info in the issue
Option 3: Pull Request If you've already analyzed the protocol and created a working model:
- Fork the repository
- Add a new model entry in
custom_components/elkbledom/models.json - Follow the structure of existing models (ELK-BLEDOB, LEDBLE, etc.)
- Test thoroughly with your physical device
- Submit a pull request with your changes
- Include the capture file and notes in the PR description
BLE captures may contain:
- MAC addresses of your devices and phone
- Device names you've set
- WiFi credentials if the device does WiFi provisioning over BLE
- All Bluetooth traffic from your device during the capture period
- Filter the capture to only your LED device:
- In Wireshark:
bluetooth.addr == aa:bb:cc:dd:ee:ff - File → Export Specified Packets → Displayed
- In Wireshark:
- Check for sensitive data:
- Review the exported file
- Look for any data you don't want to share
- Anonymize if needed:
- You can change MAC addresses in the description
- Remove any personal device names from your notes
- Wireshark: wireshark.org
- nRF Sniffer: Nordic Semiconductor
- Android SDK Platform Tools: developer.android.com
- nrfutil:
pip install nrfutil
- nRF52840 Dongle: nordicsemi.com
- Generic nRF52840 dongles: Search Amazon, AliExpress, etc.
- Bluetooth Core Specification: bluetooth.com
- BLE Advertising: Understanding how devices announce themselves
- ATT Protocol: Attribute Protocol used for reading/writing characteristics
- GATT Services: Generic Attribute Profile for BLE services
- GitHub Issues: github.com/dave-code-ruiz/elkbledom/issues
- Home Assistant Community: community.home-assistant.io
- Reddit: r/homeassistant, r/bluetooth
Here's a real example of analyzing captures from supported devices:
7e 07 04 ff 00 01 02 01 ef
Breakdown:
7e- Start byte (always 126 decimal)07- Variant identifier for ELK-BLEDOB model04- Command: Power controlff- Power state: 0xff = ON (255 decimal)00 01 02 01- Additional parameters (model-specific)ef- End byte (always 239 decimal)
7e 07 05 03 ff 00 00 0a ef
Breakdown:
7e- Start byte07- Variant identifier05- Command: Color/Temperature control03- Subcommand: RGB color modeff- Red: 255 (full red)00- Green: 0 (no green)00- Blue: 0 (no blue)0a- Modifier byte (10 decimal, purpose varies)ef- End byte
7e 00 04 01 00 00 00 00 ef
Breakdown:
7e- Start byte00- Variant identifier for LEDBLE model04- Command: Power control01- Power state: 0x01 = ON (note: different from ELK-BLEDOB!)00 00 00 00- Padding/unused bytesef- End byte
7b ff 04 01 ff ff ff ff bf
Breakdown:
7b- Start byte (123 decimal - different from others!)ff- Variant identifier for XROCKER04- Command: Power control01- Power state: ONff ff ff ff- Padding (all 0xff)bf- End byte (191 decimal - different from others!)
Key Lessons:
- Start/End bytes are usually consistent per manufacturer
- Variant byte helps identify model family
- Same command number (0x04) used across models but payloads differ
- Always capture multiple commands to identify patterns
- Different manufacturers may use completely different structures
Q: How long should I capture for?
A: Just long enough to perform all the actions listed above - usually 2-5 minutes total.
Q: The capture file is huge (hundreds of MB)
A: Filter it in Wireshark to only your device's MAC address before exporting. Most of the data is probably from other Bluetooth devices.
Q: Can I capture from multiple devices at once?
A: Yes, but it's clearer to capture one device at a time to avoid confusion in analysis.
Q: My device uses WiFi, not Bluetooth
A: This integration is specifically for Bluetooth Low Energy (BLE) LED devices. WiFi-based devices require different integrations and are not supported here.
Q: The official app won't connect during capture
A: Try moving the sniffer dongle further away, or try the Android HCI method instead which doesn't interfere with connections.
Q: I already have Wireshark experience - any shortcuts?
A: Look for writes to UUID fff3 (ELK/MELK) or ffe1 (LEDBLE/XROCKER), extract just those packets, focus on the value field of ATT Write Request/Command packets. Use the BTScan.py or easyBTScan.py scripts in the repo to quickly identify device characteristics.
Q: Can I help even if I can't capture traffic?
A: Yes! If someone else provides a capture, you can help analyze it and create the model file. Programming knowledge of Python is helpful.
Once traffic is captured and analyzed:
- Create a model file based on an existing similar device
- Add the protocol commands from your analysis
- Test thoroughly with your physical device
- Submit a pull request with your changes
- Help others who have the same device model
Thank you for helping expand device support!