# Reverse-Engineer BLE Device Protocols (Python + bleak)

> Map the Bluetooth Low Energy protocol of a gadget you own: capture it, diff it, decode it, check it on the device, and keep notes that say what is proven.

Reverse-Engineer BLE Device Protocols (Python + bleak) is a paid AI agent skill on Agensi by Nate Freed. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $7 (one-time purchase)
- Creator: [Nate Freed](https://www.agensi.io/creators/nate-freed)
- Version: 1.0
- Last updated: 2026-11-28
- Security: scan passed (2026-11-28); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/reverse-engineer-ble-device-protocols-python-bleak
- Tags: testing-debugging, research-analysis

## About this skill

A step-by-step workflow and a toolkit for working out how your own BLE gadget talks: a smart bulb, fitness band, plug or sensor.

**What you get**
- **Live helpers (bleak):** scan, dump the GATT table, log every notification with timestamped markers, and run probe files (write, read, expect) that log all traffic.
- **Offline tools (standard library):** convert an Android HCI snoop log of the vendor app into a capture. Group frames by message type and highlight the bytes that change between actions. Get hints for headers, length fields, 8-bit checksums and counters. Test a JSON frame spec against every packet you have captured.
- **Evidence discipline:** a notes template and a linter. Every claim is tagged VERIFIED, INFERRED, UNKNOWN or RETRACTED, and every VERIFIED claim must cite a capture file and a date.
- **Safety:** refuses writes to standard firmware-update services, lets you deny reset opcodes, dry-runs every probe and asks before sending it. Device addresses, serial numbers and revision strings are kept out of files, and a redact tool cleans files before you share them.

For devices you own or are authorized to test.

## Requires

- Python 3.8+ (offline tools)
- bleak in a virtualenv (live capture)
- Optional: Android phone with HCI snoop log

## Known limitations

The live helpers (scan, GATT dump, listen, write) were tested only against a simulated device standing in for bleak, never against real hardware. They need bleak 0.19 or newer, and behaviour can vary by OS, adapter and bleak version. The checksum hints cover simple 8-bit sums and XORs only; CRCs, encryption and authenticated sessions are not detected or handled. The btsnoop converter reads datalink types 1001 and 1002 and plain ATT on L2CAP channel 4 (not Enhanced ATT), and was tested on synthetic files only. Handle-to-UUID mapping from a saved GATT table can be off by one on some platforms; the tool warns and has an offset flag. Typed markers need ble_listen run in an interactive terminal; otherwise use a timed marks file. The skill cannot see what a phone app sends unless you supply a phone HCI log. Getting that log on iOS needs Apple's own logging tools. Bluetooth Classic, firmware dumping or flashing, and over-the-air sniffing of other people's devices are out of scope. Hints are only candidates: deciding what a byte means still takes a person watching the device.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Reverse-Engineer BLE Device Protocols (Python + bleak) skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### Do I need the device next to me?

Not for analysis. The offline tools work on capture logs and phone HCI snoop logs. You need the device, a Bluetooth adapter and bleak only to capture live or to run a verification probe.

### Can this brick my device?

It refuses writes to the standard firmware-update services (and to anything named DFU or OTA). It can also refuse payloads you list, such as a factory-reset opcode. Every probe is dry-run and shown to you before it is sent. Even so, any write to an undocumented device carries some risk, so only test devices you own and could live without.

### Will it crack encrypted or paired-only protocols?

No. It does not bypass pairing, bonding or encryption, and it detects only simple 8-bit checksums. It is meant for the many gadgets that send plain frames.

### Which operating systems work?

The offline tools run anywhere Python 3.8+ runs. The live helpers use bleak, which supports macOS, Linux and Windows. They have been tested against a simulated device, not every OS and adapter combination.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
