Skip to main content

CSRMesh protocol library

Project description

recsrmesh

A Python library for the CSRMesh Bluetooth mesh protocol. Provides MASP association, MCP mesh commands, and BLE transport over GATT.

Features

  • Device discovery -- find unprovisioned CSRMesh devices via a bridge
  • Association -- full MASP handshake (ECDH key exchange, device ID and network key distribution)
  • Mesh commands -- send and receive MCP packets (AES-OFB encrypted)
  • Disassociate -- remove devices from the mesh
  • Async API -- built on bleak for cross-platform BLE

Usage

from bleak import BleakClient
from recsrmesh import CSRMesh

async with BleakClient(bridge_mac) as client:
    async with CSRMesh(client, passphrase) as mesh:
        # Discover unprovisioned devices
        devices = await mesh.discover_unassociated(timeout=5.0)

        # Associate a device into the mesh
        device_id = await mesh.associate(devices[0]["uuid_hash"], device_id=100)

        # Send a mesh command
        await mesh.send(dest_id=100, opcode=0x73, payload=b"\x01\x80")

        # Receive responses
        responses = await mesh.receive(timeout=3.0)

        # Remove a device from the mesh
        await mesh.disassociate(device_id=100)

Installation

pip install recsrmesh

Requires Python 3.11+.

License

LGPL-3.0-or-later

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

recsrmesh-0.2.0.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

recsrmesh-0.2.0-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file recsrmesh-0.2.0.tar.gz.

File metadata

  • Download URL: recsrmesh-0.2.0.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for recsrmesh-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c34c9272ffdcb42978cf9cda8c795f81a58dbb2a13c4fd9e56dd0214ac9662a4
MD5 3a8231f73f11e8fd1ed6cd87c26cd6f4
BLAKE2b-256 7f8ba4b19a6e10e0cdf0417845a1ff5a4582017fee36e8edd333bb2311dfcce7

See more details on using hashes here.

Provenance

The following attestation bundles were made for recsrmesh-0.2.0.tar.gz:

Publisher: workflow.yml on oyvindkinsey/recsrmesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file recsrmesh-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: recsrmesh-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for recsrmesh-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f00c10b192e89f2d9889f21934e80f6e5e1020100c803fb9a2ae5b5bffb9d955
MD5 ca4230f8e35f20e7e52e139a1a42140d
BLAKE2b-256 c56d0d702f609a859ffde6a960a0478cefa639b5c13ea2f19e85ebbd8dc711a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for recsrmesh-0.2.0-py3-none-any.whl:

Publisher: workflow.yml on oyvindkinsey/recsrmesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page