Skip to main content

DongLoRa host library — talk LoRa from Python over USB

Project description

DongLoRa Python Client

Python client library for talking to a DongLoRa device — either directly over USB or through the mux daemon.

Install

pip install donglora

Or with uv:

uv add donglora

Quick Start

import donglora as dl

ser = dl.connect()
dl.send(ser, "SetConfig", config=dl.DEFAULT_CONFIG)
dl.send(ser, "StartRx")

while True:
    pkt = dl.recv(ser)
    if pkt:
        print(pkt["rssi"], pkt["payload"].hex())

Connection Functions

Function Description
connect() Auto-detect: TCP mux, Unix socket mux, then USB serial
connect_default() Convenience wrapper with default timeout
try_connect() Like connect() but non-blocking — raises if no device found
connect_mux_auto() Mux only — never falls back to USB serial
mux_connect() Connect via Unix domain socket
mux_tcp_connect() Connect via TCP

Module Structure

Module Contents
donglora.protocol Wire types, RadioConfig, encode/decode, constants
donglora.codec COBS framing
donglora.discovery USB device discovery by VID:PID
donglora.transport MuxConnection (socket wrapper)
donglora.connect Connection auto-detection and mux helpers
donglora.client High-level send/recv/validate

Everything is re-exported from the top-level donglora package.

Dependencies

  • cobs — COBS framing
  • pyserial — USB serial communication

Optional extras: meshcore (crypto), orac (AI bot).

Development

just check    # fmt + lint + test
just fmt      # format code
just test     # run tests

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

donglora-1.0.1.tar.gz (93.4 kB view details)

Uploaded Source

Built Distribution

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

donglora-1.0.1-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

Details for the file donglora-1.0.1.tar.gz.

File metadata

  • Download URL: donglora-1.0.1.tar.gz
  • Upload date:
  • Size: 93.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for donglora-1.0.1.tar.gz
Algorithm Hash digest
SHA256 4fa7432bb712654212308cbcfe146a1c6df8a4f49ebd11847f5e7350e5a96b38
MD5 d0916b8e31f6f0d3e7abd113e8c0567f
BLAKE2b-256 957b18a9aae5c4f264df9a7a5f0fbb4ed460f82082b241e974e162ffd91cffcf

See more details on using hashes here.

Provenance

The following attestation bundles were made for donglora-1.0.1.tar.gz:

Publisher: ci.yml on donglora/client-py

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

File details

Details for the file donglora-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: donglora-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 30.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for donglora-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2415d1429510f028d67ddd247bf9d01a2ce6639d363382f3504772db9a7b9b1f
MD5 99b629927c92a23a9822cd283fe4a392
BLAKE2b-256 0ab248f1c320bc64cd7c10239dba5f8dd2c6486a5cef14d4daa3a27622daee1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for donglora-1.0.1-py3-none-any.whl:

Publisher: ci.yml on donglora/client-py

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