RAK831 Developers Kit - howto connect as a gateway/forwarder to TTN



  • Hi All.

    I've spent a few (many. many) hours trying to get my RAK831 kit (preassembled Pi3, converter board, 915MHz RAK831 & antenna) connected to The Things Network with no success so far.

    Here's what I've done (many times over):

    1. Burn a raspberry pi image to a microSD card and create a ssh file in / as my setup is headless and I'll be using ssh to access.

    2. Update and upgrade the raspian image with sudo apt-get update and sudo apt-get upgrade.

    3. Install git with sudo apt-get install git

    4. Enable SPI in raspi-config and expand the file system.

    5. Reboot the pi and check SPI:

    pi@raspberrypi:~ $ ls /dev/spi
    /dev/spidev0.0 /dev/spidev0.1

    1. git clone -b spi https://github.com/ttn-zh/ic880a-gateway.git ~/ic880a-gateway

    2. The cd ~/ic880a-gateway and sudo ./install.sh spi

    3. Then I sudo nano /opt/ttn-gateway/bin/global_conf.json and change it for my country (Australia) based upon https://github.com/TheThingsNetwork/gateway-conf/blob/master/AU-global_conf.json

    4. I already created a file on https://github.com/ttn-zh/gateway-remote-config called B827EBFFFE0ADEE0.json and this will be automatically downloaded and updated at the next reboot and I have added my EUI gateway to the TTN console.

    5. reboot the pi

    So, this is what happens........

    The gateway starts up and I can see messages going between router.au.thethings.network and my pi. My gateway always shows as not connected on the TTN console and has never been seen. The following are logs from /var/log/syslog showing that while PUSH_DATA datagrams sent is 1, there is a 0.00% PUSH_DATA acknowledgement.

    Jan 14 15:14:52 ttn-gateway ttn-gateway[978]: ##### END #####
    Jan 14 15:14:52 ttn-gateway ttn-gateway[978]: INFO: [down] for server router.au.thethings.network PULL_ACK received in 75 ms
    Jan 14 15:14:52 ttn-gateway ttn-gateway[978]: INFO: [down] for server router.au.thethings.network PULL_ACK received in 85 ms
    Jan 14 15:14:52 ttn-gateway ttn-gateway[978]: INFO: [down] for server router.au.thethings.network PULL_ACK received in 87 ms
    Jan 14 15:14:52 ttn-gateway ttn-gateway[978]: INFO: [down] for server router.au.thethings.network PULL_ACK received in 76 ms
    Jan 14 15:14:52 ttn-gateway ttn-gateway[978]: INFO: [down] for server router.au.thethings.network PULL_ACK received in 76 ms
    Jan 14 15:14:52 ttn-gateway ttn-gateway[978]: INFO: [down] for server router.au.thethings.network PULL_ACK received in 76 ms
    Jan 14 15:14:52 ttn-gateway ttn-gateway[978]: ##### 2018-01-14 05:14:38 GMT #####
    Jan 14 15:14:52 ttn-gateway ttn-gateway[978]: ### [UPSTREAM] ###
    Jan 14 15:14:52 ttn-gateway ttn-gateway[978]: # RF packets received by concentrator: 1
    Jan 14 15:14:52 ttn-gateway ttn-gateway[978]: # CRC_OK: 0.00%, CRC_FAIL: 100.00%, NO_CRC: 0.00%
    Jan 14 15:14:52 ttn-gateway ttn-gateway[978]: # RF packets forwarded: 0 (0 bytes)
    Jan 14 15:14:52 ttn-gateway ttn-gateway[978]: # PUSH_DATA datagrams sent: 1 (248 bytes)
    Jan 14 15:14:52 ttn-gateway ttn-gateway[978]: # PUSH_DATA acknowledged: 0.00%
    Jan 14 15:14:52 ttn-gateway ttn-gateway[978]: ### [DOWNSTREAM] ###
    Jan 14 15:14:52 ttn-gateway ttn-gateway[978]: # PULL_DATA sent: 6 (100.00% acknowledged)
    Jan 14 15:14:52 ttn-gateway ttn-gateway[978]: # PULL_RESP(onse) datagrams received: 0 (0 bytes)
    Jan 14 15:14:52 ttn-gateway ttn-gateway[978]: # RF packets sent to concentrator: 0 (0 bytes)
    Jan 14 15:14:52 ttn-gateway ttn-gateway[978]: # TX errors: 0
    Jan 14 15:14:52 ttn-gateway ttn-gateway[978]: ### [GPS] ###
    Jan 14 15:14:52 ttn-gateway ttn-gateway[978]: # GPS sync is disabled
    Jan 14 15:14:52 ttn-gateway ttn-gateway[978]: ##### END #####
    Jan 14 15:14:52 ttn-gateway ttn-gateway[978]: INFO: [down] for server router.au.thethings.network PULL_ACK received in 75 ms
    Jan 14 15:14:52 ttn-gateway ttn-gateway[978]: INFO: [down] for server router.au.thethings.network PULL_ACK received in 85 ms

    A tcpdump shows data going both ways:

    pi@ttn-gateway:~ $ sudo tcpdump -AUq port 1700
    tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
    listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
    15:17:35.954526 IP 192.168.235.18.45492 > ec2-52-62-83-250.ap-southeast-2.compute.amazonaws.com.1700: UDP, length 12
    E..(..@.@.......4>S.......4......'...
    ..
    15:17:36.030883 IP ec2-52-62-83-250.ap-southeast-2.compute.amazonaws.com.1700 > 192.168.235.18.45492: UDP, length 4
    E.. Pg@.0..r4>S...............................
    15:17:38.823919 IP 192.168.235.18.34417 > ec2-52-62-83-250.ap-southeast-2.compute.amazonaws.com.1700: UDP, length 248
    E....t@.@..r....4>S..q....5...h..'...
    ..{"stat":{"time":"2018-01-14 05:17:38 GMT","rxnb":0,"rxok":0,"rxfw":0,"ackr":0.0,"dwnb":0,"txnb":0,"pfrm":"IMST + Rpi","mail":"smee@gmail.com","desc":"RAK831 gateway located at the Amateur Radio site at Mount Cotton.'...
    ..."}}
    15:17:41.064523 IP 192.168.235.18.45492 > ec2-52-62-83-250.ap-southeast-2.compute.amazonaws.com.1700: UDP, length 12
    E..(..@.@.......4>S.......4..K_..'...
    ..
    15:17:41.141100 IP ec2-52-62-83-250.ap-southeast-2.compute.amazonaws.com.1700 > 192.168.235.18.45492: UDP, length 4
    E.. R.@.0...4>S............:.K_...............
    15:17:46.174527 IP 192.168.235.18.45492 > ec2-52-62-83-250.ap-southeast-2.compute.amazonaws.com.1700: UDP, length 12
    E..(.P@.@.......4>S.......4..V...'...
    ..
    15:17:46.261140 IP ec2-52-62-83-250.ap-southeast-2.compute.amazonaws.com.1700 > 192.168.235.18.45492: UDP, length 4
    E.. UK@.0...4>S...........N/.V................
    ^C
    7 packets captured
    7 packets received by filter
    0 packets dropped by kernel
    pi@ttn-gateway:~ $

    So.... I'm sure I've missed something... any ideas what?


  • administrators

    The EUI may be wrong when you set up the gateway on the TTN platform.



  • I copied and pasted the address from the device to the TTN Console when setting it up, so it's not that.



  • Have you tried to reset the RAK831 when the forwarder has started?
    I have the same setup working here (Pi3, RAK831 and the converter board). I use a script to reset the rak831 after bootup and before the concentrator is started.

    #!/bin/bash
    #echo "25" > /sys/class/gpio/export
    echo "out" > /sys/class/gpio/gpio25/direction
    echo "1" > /sys/class/gpio/gpio25/value
    sleep 5
    echo "0" > /sys/class/gpio/gpio25/value
    sleep 1
    echo "0" > /sys/class/gpio/gpio25/value



  • @laef , yes, I have a script that I run to do this and the RX light comes on bright after running it.

    I'm thinking of using a different pi to generate a new EUI and see how it goes.

    I have a 30m tower on top of the highest mountain for about 20km around, so looking forward to getting the gateway up and running.



  • Ok.... installed converter and RAK831 onto a different Pi3 and got a new EUI which I setup on TTN console, but exactly the same result.

    I then changed my router from the Australian one to the ttn eu router...... and now it shows up.

    It seems that the Australian router might be the issue, so I'll update the EUI.json file on github and it'll hopefully be pushed out tonight.



  • look at my gateway in Perth (the only one that is RAK831); check you are using the same meshed router.
    The Pi is not the problem, but check the USB cable is OK.

    The RAK 831 was a real hassle to set up.

    some checks that I did wrong:
    Did you reverse the EUIs?
    delete the original global.conf file with this file
    also read this and fully
    I will have a check through my notes to see if I can find anything else
    Phil



  • it also took a while (a day or so from memory) from registering the Gateway with TTN to them actually showing it as 'connected' on TTN Console.



  • @philwilkinson

    Replying to "RAK831 Developers Kit - howto connect as a gateway/forwarder to TTN"

    @vk4lc said in RAK831 Developers Kit - howto connect as a gateway/forwarder to TTN:

    Ok.... installed converter and RAK831 onto a different Pi3 and got a new EUI which I setup on TTN console, but exactly the same result.

    I then changed my router from the Australian one to the ttn eu router...... and now it shows up.

    It seems that the Australian router might be the issue, so I'll update the EUI.json file on github and it'll hopefully be pushed out tonight.

    HIDE PREVIEW



Looks like your connection to RAK Support Center was lost, please wait while we try to reconnect.