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.0.tar.gz (93.1 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.0-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: donglora-1.0.0.tar.gz
  • Upload date:
  • Size: 93.1 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.0.tar.gz
Algorithm Hash digest
SHA256 6203ff8239a9d8a8e572d677dcd7783b457c2dd6e3dd1ae1b43eac670c7a86a9
MD5 64713d00a762d613b664a284778cde3f
BLAKE2b-256 a2f104a6befb8dac4e0d4b5be15f9589ac7800e15e5cf415fbf268e320a43aa3

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: donglora-1.0.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b2cae03149b54a7676c0c8e4850bcbd99d36edd6a4606aeb1980d50a0f5d94fe
MD5 173d33647adc146cd4946320dbd2c0d8
BLAKE2b-256 a653982d9ef76efae11c56ccaa4f92096d9849addb78111399d4c02d46cd3515

See more details on using hashes here.

Provenance

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