Lorthon est un emballage Python pour le projet Lora Gateway de Lora-Net / Lora_gateway / Libloragw /
Raspberry Pi avec un RHF0M301 de SeedStudio.
BeagleboneBlack avec un RHF0M301 de SeedStudio.
- Transmit
- Receive
- Set TX and RX settings.
Prérequis: pip install cython Compilation: git clone https://github.com/galalmounir/lorthon.git Run make to Compile and Generate the Python Library.
Une fois compilée, la bibliothèque sera générée à l'intérieur du dossier output . Copiez le fichier lorthon.so dans votre répertoire de projet Python.
import lorthon
lorthon.py_LoRaInit("global_conf.json")
py_LoRaTx(freq: int, tx_mode: int, rf_chain: int, rf_power: int, bandwidth: int, datarate: int, coderate: int, preamble: int, no_crc: bool, no_header: bool, payload: bytes, size: int)
lorthon.py_LoRaTx(915000000, 0, 0, 22, 0x03, 0x02, 1, 15, False, False, "HELLO WORLD", 11)
La fonction py_LoRaRx() renvoie une liste de paquets reçus au format JSON. packets = lorthon.py_LoRaRx()
{
"packets" : [
{
"frequency" : 914800000 ,
"if_chain" : 1 ,
"status" : 16 ,
"count_us" : 2689979 ,
"rf_chain" : 0 ,
"modulation" : 16 ,
"bandwidth" : 3 ,
"datarate" : 2 ,
"coderate" : 1 ,
"rssi" : -66 ,
"snr" : 9.5 ,
"snr_min" : 7.75 ,
"snr_max" : 12.75 ,
"crc" : 34481 ,
"size" : 25 ,
"payload" : " 030020000048454C4C4F20574F524C4400140000380C002031 "
}
],
"number_of_pkts" : 1
} import lorthon
lorthon . py_LoRaInit ( "global_conf.json" )
lorthon . py_LoRaTx ( 915000000 , 0 , 0 , 22 , 0x03 , 0x02 , 1 , 15 , False , False , "HELLO WORLD" , 11 )
lorthon . py_LoRaStop (); J'améliore continuellement Lorthon. Je fusionnerai toujours les corrections de bugs de travail. Cependant, si vous souhaitez ajouter quelque chose de nouveau à la bibliothèque, veuillez créer un "problème" sur GitHub pour ce premier afin que nous puissions discuter si cela devrait se retrouver dans la bibliothèque avant de commencer à l'implémenter.