Skip to main content

Asynchonous library for the HiLink LD2410 presence detector module

Project description

licence version pyversions coverage docs openssf

aio-ld2410 is a python library that allows interacting with the Hi-Link LD2410 sensors using asyncio.

Such radar sensor would typically require an USB-UART adapter on most computers but is natively included on most embedded platforms such as the Raspberry Pi.

This library supports a wide range of variants in terms of models and firmware versions, but was mostly tested on LD2410C with firmware v2.04.23022511.

It features comprehensible methods to get and set various configuration parameters, as well as dataclasses for output results and sensor reports.

Installation

This package requires Python ≥ 3.9 and pulls a few other packages as dependencies.

To install aio-ld2410, simply run the following command:

python -m pip install aio-ld2410

Usage

Here’s how you can start reading sensor reports from a few lines of python:

#!/usr/bin/env python

import asyncio
from aio_ld2410 import LD2410

async def main():
    async with LD2410('/dev/ttyUSB0') as device:
        async with device.configure():
            ver = await device.get_firmware_version()
            print(f'[+] Running with firmware v{ver}')

        # Reports are typically generated every 100ms.
        async for report in device.get_reports():
            print(report)

asyncio.run(main())

For further details, please refer to the documentation.

Contributing

Contributions, bug reports and feedbacks are very welcome, feel free to open an issue, send a pull request. or start a discussion.

Participants must uphold the code of conduct.

aio-ld2410 is released under the MIT license.

Download files

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

Source Distribution

aio_ld2410-1.0.2.tar.gz (26.0 kB view details)

Uploaded Source

Built Distribution

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

aio_ld2410-1.0.2-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

Details for the file aio_ld2410-1.0.2.tar.gz.

File metadata

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

File hashes

Hashes for aio_ld2410-1.0.2.tar.gz
Algorithm Hash digest
SHA256 264f2e3547d50c1c8076926349b7a584cfa648fbd36f15111f1fe452250e848f
MD5 5f9e38350187898705dfa184727d60f3
BLAKE2b-256 d0b404f5ae3f094bbf339ab0ef7f3cf1cb64e1cad92710f282c56660b445909d

See more details on using hashes here.

Provenance

The following attestation bundles were made for aio_ld2410-1.0.2.tar.gz:

Publisher: release.yml on morian/aio-ld2410

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

File details

Details for the file aio_ld2410-1.0.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for aio_ld2410-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c927311b81fe0db4e6efd3b3adee181b8d6f4729ef15b8422c71abaee8425db7
MD5 4640d39cabe1fd8f4d367b4d5fdbdf4c
BLAKE2b-256 9627c3fadaa8c76b4be0a8a626d0a14cfe3505363252f755a4cfbcd5daca76ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for aio_ld2410-1.0.2-py3-none-any.whl:

Publisher: release.yml on morian/aio-ld2410

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