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 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 rf95modem
if __name__ == '__main__':
ser = serial.serial_for_url('/dev/ttyUSB1', 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.FAST_SHORT_RANGE)
rf95.frequency(868.23)
rf95.transmit(b"hello world")
print(rf95.fetch_status())
while True:
# Wait for incoming messages to be printed by our handler.
try:
time.sleep(0.1)
except KeyboardInterrupt:
sys.exit(0)
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.1.1.tar.gz
.
File metadata
- Download URL: rf95modem-0.1.1.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 700ded7bf922c6744c45437c348ef9c7356190b9c72c250a2f3a3fdee8b99d24 |
|
MD5 | 5bd168500999d40666a70f058b7f3ede |
|
BLAKE2b-256 | 07683baa4dc2565a2c1aa8753c8d7395837856f01b47413268c46dea86666ae0 |
File details
Details for the file rf95modem-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: rf95modem-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.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 | 5b49a53982480c940f0ece758a8853225e8c7bb6e5deafd186013fd0367fdde5 |
|
MD5 | 2116bd687b8174895e3124bfd91071dd |
|
BLAKE2b-256 | 37455b8f3adc7949a40937c00d8b56f16b7c85e4642c9fe2407406283a8c34ee |