Fixed RSSI and SNR display

pull/3/head
Mark Qvist 2020-05-21 13:06:03 +02:00
parent f22bea522f
commit 7f6862c015
2 changed files with 17 additions and 15 deletions

View File

@ -4,7 +4,7 @@
This utility allows you to sniff LoRa networks with an [RNode](https://unsigned.io/projects/rnode/), and dump captured packets to the console or files. This utility allows you to sniff LoRa networks with an [RNode](https://unsigned.io/projects/rnode/), and dump captured packets to the console or files.
``` ```sh
usage: loramon [-h] [-C] [-W directory] [--freq Hz] [--bw Hz] [--txp dBm] usage: loramon [-h] [-C] [-W directory] [--freq Hz] [--bw Hz] [--txp dBm]
[--sf factor] [--cr rate] [--sf factor] [--cr rate]
[port] [port]
@ -25,20 +25,24 @@ optional arguments:
--cr rate Coding rate --cr rate Coding rate
``` ```
## Dependencies
The config utility requires Python 2.7 and pyserial. To install:
```
sudo apt install python python-pip
sudo pip install pyserial
```
## Installation ## Installation
Just clone or download this repository, place wherever you'd like and run loramon (remember to set executable permissions): If you already have Python3 and pip installed, you can easily install LoRaMon through pip:
```sh
pip3 install loramon
``` ```
If you want to install directly from this repository, first install the dependencies:
```sh
sudo apt install python3 python3-pip
sudo pip3 install pyserial
```
And then clone the repository and make LoRaMon executable:
```sh
git clone https://github.com/markqvist/LoRaMon.git git clone https://github.com/markqvist/LoRaMon.git
cd LoRaMon cd LoRaMon
chmod a+x loramon chmod a+x loramon
@ -51,7 +55,7 @@ chmod a+x loramon
Listens on a specified frequency and displays captured packets in the console. Listens on a specified frequency and displays captured packets in the console.
``` ```sh
./loramon /dev/ttyUSB0 --freq 868000000 --bw 125000 --sf 7 --cr 5 -C ./loramon /dev/ttyUSB0 --freq 868000000 --bw 125000 --sf 7 --cr 5 -C
``` ```
@ -59,6 +63,6 @@ Listens on a specified frequency and displays captured packets in the console.
Like above, but also writes all captured packets individually to a specified directory. Like above, but also writes all captured packets individually to a specified directory.
``` ```sh
./loramon /dev/ttyUSB0 --freq 868000000 --bw 125000 --sf 7 --cr 5 -C -W capturedir ./loramon /dev/ttyUSB0 --freq 868000000 --bw 125000 --sf 7 --cr 5 -C -W capturedir
``` ```

View File

@ -279,10 +279,8 @@ class RNode():
else: else:
self.detected = False self.detected = False
elif (command == KISS.CMD_STAT_RSSI): elif (command == KISS.CMD_STAT_RSSI):
RNS.log("RSSI BYTE: "+RNS.hexrep(byte))
self.r_stat_rssi = ctypes.c_int8(ord(byte)).value - self.rssi_offset self.r_stat_rssi = ctypes.c_int8(ord(byte)).value - self.rssi_offset
elif (command == KISS.CMD_STAT_SNR): elif (command == KISS.CMD_STAT_SNR):
RNS.log("SNR BYTE: "+RNS.hexrep(byte))
self.r_stat_snr = ctypes.c_int8(ord(byte)).value * 0.25 self.r_stat_snr = ctypes.c_int8(ord(byte)).value * 0.25
else: else: