Lorthon은 Lora-Net/Lora_gateway/Libloragw/의 Lora Gateway 프로젝트의 파이썬 래퍼입니다.
Seeedstudio의 RHF0M301이있는 Raspberry Pi.
Seeedstudio의 RHF0M301이있는 BeagleBoneblack.
- Transmit
- Receive
- Set TX and RX settings.
전제 조건 : pip install cython 컴파일 : git clone https://github.com/galalmounir/lorthon.git run은 Python 라이브러리를 컴파일하고 생성 make .
컴파일되면 라이브러리는 output 폴더 내부에서 생성됩니다. Lorthon.so 파일을 Python Project Directory에 복사하십시오.
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)
py_LoRaRx() 함수는 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 (); 나는 Lorthon을 지속적으로 개선하고 있습니다. 나는 항상 작동하는 버그 수정을 병합 할 것입니다. 그러나 라이브러리에 새로운 것을 추가하려면 Github에서 "문제"를 먼저 만들어서 구현을 시작하기 전에 도서관에서 끝나야하는지 논의 할 수 있습니다.