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.
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.0.tar.gz
.
File metadata
- Download URL: rf95modem-0.1.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | acc76ba6f67f64c6d21133988c83502cc0421e64dcdc28b63f2851080a4ba192 |
|
MD5 | 57191e172c22242f0769e299903959f1 |
|
BLAKE2b-256 | 392b5f33f248abffcd876ba22c97c928a4b01a967ecb8d81b91d4cf90d859754 |
File details
Details for the file rf95modem-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: rf95modem-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.4 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 | 09a9a5b61a013e0148e37123ee13615d1b45cb8cb67bd2d10efaebf0be38c8e8 |
|
MD5 | 4bcd44a9e862f12ae38cef4b9f2f769c |
|
BLAKE2b-256 | de42c77390305e12f7607153a90c4f27b3f34a8bf323bcba8739535e0008a109 |