Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNR and RSSI of raspberry pi LoRa Gateway #3

Closed
ukritkh opened this issue Jun 23, 2018 · 1 comment
Closed

SNR and RSSI of raspberry pi LoRa Gateway #3

ukritkh opened this issue Jun 23, 2018 · 1 comment

Comments

@ukritkh
Copy link

ukritkh commented Jun 23, 2018

Hi, I was trying to read out both SNR and RSSI values to display on the OLED display from oled.py script and it was unsuccessful. I did add "lora_snr" variable in both global and UDPhandler method.

So I am wondering if I want to get the SNR value, is it to do with oled.py or other files?

Thanks!

@hallard
Copy link
Contributor

hallard commented Jul 2, 2018

@ukritkh
did you tried the latest push (26 days ago)?
I should detect what packet forwarder you are using, because mp_pkt_fwd (new one) and poly_pkt_fwd (legacy) handle UDP message format not the same way.
What packet forwarder are you using?
Would you mind sharing your /opt/loragw/global_conf.json that should contain also the local gwtraf server on port 1688 (the one where oled.py is listening)

    "gateway_conf": {
        "gateway_ID": "yourGWID",
        "description": "CH2i TTN GW For testing  purpose",
        "servers": [
            {
                "server_fallbacks": [
                    "mqtts://bridge.asia-se.thethings.network",
                    "mqtts://bridge.us-west.thethings.network",
                    "mqtts://bridge.brazil.thethings.network"
                ],
                "server_address": "bridge.eu.thethings.network",
                "serv_gw_id": "loragw-17dd",
                "serv_type": "ttn",
                "serv_gw_key": "ttn-account-v2.yourTTNkey",
                "serv_enabled": true
            },
            {
                "serv_port_up": 1688,
                "serv_type": "gwtraf",
                "serv_enabled": true,
                "server_address": "127.0.0.1",
                "serv_port_down": 1689
            }
        ],
        "contact_email": "",
        "fake_gps": false,
        "gps": false
    }
}

If you're using the poly_pkt_fwd the field is lsnr

lora_snr = js_data["rxpk"][0]["lsnr"]

I don't know for mp_pkt_fwd (may be lora_snr = js_data["lsnr"] since I'm not using it because it does not works with downlink other than from TTN backend. Buy you can see JSON frame uncommenting this lines in oled.py and launching it by hand

loragw@loragw-17dd:/opt/loragw $ sudo service oled stop
loragw@loragw-17dd:/opt/loragw $ sudo ./oled.py
{"rxpk":[{"tmst":481511819,"time":"2018-07-02T12:58:04.352688Z","chan":0,"rfch":1,"freq":868.100000,"stat":1,"modu":"LORA","datr":"SF7BW125","codr":"4/5","lsnr":10.5,"rssi":-29,"size":27,"data":"QPh5zR4AyAYLp9tSQPOzsIW6TwtqxHVEL0HC"}]}

@hallard hallard closed this as completed May 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants