Skip to main content

rf95modem-py

Python library to send and receive data over LoRa PHY via a serial connection to a rf95modem.

This library was tested against the rf95modem commit 8f163aa, slightly after version 0.7.3.

Install

This library is available on PyPI as rf95modem.

pip install --upgrade rf95modem

Library

The primary focus of this library is to send and receive data via LoRa's physical layer, LoRa PHY, with the help of a rf95modem.

Therefore the rf95modem.reader.Rf95Reader. allows direct interaction with a connected rf95modem, including configuration changes, sending, and receiving raw LoRa PHY messages. This Rf95Reader extends serial.threaded.LineReader from pySerial.

The following short code example demonstrates how to use this library.

import serial
import serial.threaded
import sys
import time
import threading

import rf95modem


if __name__ == "__main__":
    ser = serial.serial_for_url("/dev/ttyUSB0", baudrate=115200, timeout=1)
    with serial.threaded.ReaderThread(ser, rf95modem.Rf95Reader) as rf95:
        rf95.rx_handlers.append(lambda rx: print(rx))

        rf95.mode(rf95modem.ModemMode.MEDIUM_RANGE)
        rf95.frequency(868.1)

        print(rf95.status_fetch())

        try:
            rf95.gps_mode(True)
            print(rf95.gps_fetch())
        except rf95modem.Rf95UnknownCommandException:
            print("Seems like there is no GPS support")

        rf95.transmit(b"hello world")

        threading.Event().wait()

Documentation

pip install --upgrade pdoc3

cd src
pdoc --http 127.0.0.1:8080 rf95modem
xdg-open http://127.0.0.1:8080/

Build a Release

  • Bump the project.version in the pyproject.toml file.
  • python3 -m build

Metadata

Release files for rf95modem 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rf95modem 0.2.0
File Size Uploaded
rf95modem-0.2.0.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rf95modem 0.2.0
File Interpreter ABI Platform
rf95modem-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.3 kB

Release files / rf95modem-0.2.0.tar.gz

Download URL rf95modem-0.2.0.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
70df03f69ca474cb019bf156fbf9049e69d08857732e1e948621916d30139572
BLAKE2b-256 checksum
How to use checksums
e992de41c5c1dddc4c4da2f4b89cbd682874591fdfc083339ec62775d8eb2475
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release files / rf95modem-0.2.0-py3-none-any.whl

Download URL rf95modem-0.2.0-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ada30652918f293a4fdf5117a9f956ee0bb0c38375dc8e8f15bde255e17e76e
BLAKE2b-256 checksum
How to use checksums
9c8cf46a6b761cd51757e9f5a8519beb5c1c1f3f5fbeac94e7b6afb00470599c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page