Page 1 of 1

LoRaWAN Packet Configuration?

PostPosted: Thu Mar 08, 2018 1:35 pm
by dino.saw
Hi, I'm currently using a HAT-LRGW-915 together with a Raspi to forward my device data to The Things Network, things are working well so far. :D

I was wondering, is there a way to configure the Raspi shield so that I can forward the device data to my own server instead of to The Things Network?

Thanks.

Re: LoRaWAN Packet Configuration?

PostPosted: Thu Mar 08, 2018 11:37 pm
by peterchua93
hi, LoRaWan is just a protocol for you to send the data to the TTN, you can directly send the data to the server you want with just the raspberry pi.
here is an examplehttp://help.ubidots.com/iot-projects-tutorials/diy-raspberry-pi-temperature-system-with-ubidots

Re: LoRaWAN Packet Configuration?

PostPosted: Mon Mar 12, 2018 6:28 pm
by bengchet
Hi,

Yes it is possible. Just login into Raspberry pi LoRa Gateway via USB or SSH, look for local_conf.json at /opt/ttn-gateway/bin.

CODE: SELECT_ALL_CODE
cd /opt/ttn-gateway/bin
sudo nano local_conf.json


Edit the address and port under servers section inside the JSON file and save. Another alternative you can add your own server to servers section because the gateway supports sending JSON to multiple servers via UDP.

Example editing server:
CODE: SELECT_ALL_CODE
{
  "gateway_conf": {
    "gateway_ID": "xxxxxxxxxxxxxxxxxxxx",
    "servers": [
      {
        "server_address": "your own network server",
        "serv_port_up": your own UDP port,
        "serv_port_down": your own UDP port,
        "serv_enabled": true
      }
    ],
    "ref_latitude": xxx,
    "ref_longitude": xxx,
    "ref_altitude": xxx,
    "contact_email": "xxx",
    "description": "xxx"
  }
}


Example adding server:
CODE: SELECT_ALL_CODE
{
  "gateway_conf": {
    "gateway_ID": "xxxxxxxxxxxxxxxxxxxx",
    "servers": [
      {
        "server_address": "router.eu.thethings.network",
        "serv_port_up": 1700,
        "serv_port_down": 1700,
        "serv_enabled": true
      },
      {
        "server_address": "your own network server", <--
        "serv_port_up": your own UDP port, <--
        "serv_port_down": your own UDP port, <--
        "serv_enabled": true
      }
    ],
    "ref_latitude": xxx,
    "ref_longitude": xxx,
    "ref_altitude": xxx,
    "contact_email": "xxx",
    "description": "xxx"
  }
}


After editing and saving, restart the gateway.