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.3.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.3.0-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: recsrmesh-0.3.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.3.0.tar.gz
Algorithm Hash digest
SHA256 f73bb257780dadb5438619d6440d5119a828aa8d9353967c3da0b95d406d4109
MD5 19fc37b4b403fb796aad6f7a5d737d53
BLAKE2b-256 cfed942eb637133cb38a2b9b24fe49707037346feb54e9e3feba70ffd9d1e065

See more details on using hashes here.

Provenance

The following attestation bundles were made for recsrmesh-0.3.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.3.0-py3-none-any.whl.

File metadata

  • Download URL: recsrmesh-0.3.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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 546658625b361dfce35589a4ad6f184cd3cf6db006680bbe9ce13545ae6172c9
MD5 6be59d3fd664de183f7d600f88fed233
BLAKE2b-256 a44538c6c0c840697a7655fab77d5e3db05dc051952b630e42fec6af1a4ebb5d

See more details on using hashes here.

Provenance

The following attestation bundles were made for recsrmesh-0.3.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