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-0.2.0.tar.gz (71.5 kB view details)

Uploaded Source

Built Distribution

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

donglora-0.2.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for donglora-0.2.0.tar.gz
Algorithm Hash digest
SHA256 56ca1d11fefa5b1bb787d0dabb735e4cb729200ce0b2c9a09b716ed225c47e4a
MD5 3eef2d66530680a248c78133641ec709
BLAKE2b-256 9f866c1cf368749bb0be78ea92abf4a701a8487e8e927f8a288230ec08ba89c6

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for donglora-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3a3d75113279efde48227b2fc02b218854f67c0d4ff5f52b670c51d2dbce95e9
MD5 4d5b7acb71a1f6e2d978ab559d36300b
BLAKE2b-256 9c9b4d6b7cca7284e690fa283e8dbc551955a120722954527fde7bef4bef1969

See more details on using hashes here.

Provenance

The following attestation bundles were made for donglora-0.2.0-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