Python library to send and receive data over LoRa via a rf95modem
Project description
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 thepyproject.toml
file. python3 -m build
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 rf95modem-0.2.0.tar.gz
.
File metadata
- Download URL: rf95modem-0.2.0.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70df03f69ca474cb019bf156fbf9049e69d08857732e1e948621916d30139572 |
|
MD5 | 5578d8ad211e38f754ca2af4aeaec83c |
|
BLAKE2b-256 | e992de41c5c1dddc4c4da2f4b89cbd682874591fdfc083339ec62775d8eb2475 |
File details
Details for the file rf95modem-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: rf95modem-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ada30652918f293a4fdf5117a9f956ee0bb0c38375dc8e8f15bde255e17e76e |
|
MD5 | ca70735c515201a911770ff210c79c3d |
|
BLAKE2b-256 | 9c8cf46a6b761cd51757e9f5a8519beb5c1c1f3f5fbeac94e7b6afb00470599c |