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.
This library is available on PyPI as rf95modem
.
pip install --upgrade rf95modem
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()
pip install --upgrade pdoc3
cd src
pdoc --http 127.0.0.1:8080 rf95modem
xdg-open http://127.0.0.1:8080/
- Bump the
project.version
in thepyproject.toml
file. python3 -m build
twine upload --verbose dist/rf95modem-__VERSION__*
where__VERSION__
should be your new version.git tag -s v__VERSION__
where__VERSION__
should be substituted again.git push -u origin v__VERSION__