Asynchonous library for the HiLink LD2410 presence detector module
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file aio_ld2410-1.0.1.tar.gz
.
File metadata
- Download URL: aio_ld2410-1.0.1.tar.gz
- Upload date:
- Size: 25.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b067ec4aea34dd4ced4068caec6e34462c24f9ff6918047e1cecb767eeeeb3d1 |
|
MD5 | b50d79b641733c63a181a26b883c0978 |
|
BLAKE2b-256 | e1693ddc57ae5ded4123364ac6af43a7f106cbe45925ff61ec45ab3fa24d85e0 |
File details
Details for the file aio_ld2410-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: aio_ld2410-1.0.1-py3-none-any.whl
- Upload date:
- Size: 20.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2169423644b2d2cfef59d267f4a4a76b793a74e802fa5bf9807e0588b8f1ebd2 |
|
MD5 | c12e853a949c5fa9d8e4d73794e7c19a |
|
BLAKE2b-256 | 0aee559640ddd39d8ce1ea1b818cd42c2a0d4586b028acd9c8e489e1d268921d |