Raspi/iC880 won't start pkt fwder


(Duineuk) #1

Evening all,

I’ve set up a Raspi gateway using the iC880A and following the instructions from what seems to be the canonical guide: https://github.com/ttn-zh/ic880a-gateway/wiki

All pretty straightforward, apart from I’m getting the same error I’ve seen a few others report:

INFO: Monitor is disabled
INFO: Successfully contacted server 127.0.0.1
INFO: Successfully contacted server iot.semtech.com
INFO: [main] Starting the concentrator
ERROR: [main] failed to start the concentrator

I used latest Stretch build and followed the instructions per the wiki. The service is clearly trying to start and failing:

● ttn-gateway.service - The Things Network Gateway
Loaded: loaded (/lib/systemd/system/ttn-gateway.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Mon 2018-02-19 22:41:02 UTC; 3s ago
Process: 7482 ExecStart=/opt/ttn-gateway/bin/start.sh (code=exited, status=1/FAILURE)
Main PID: 7482 (code=exited, status=1/FAILURE)

…then I’ll get this as it tries again:

● ttn-gateway.service - The Things Network Gateway
Loaded: loaded (/lib/systemd/system/ttn-gateway.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2018-02-19 22:41:13 UTC; 550ms ago
Main PID: 7547 (start.sh)
CGroup: /system.slice/ttn-gateway.service
├─7547 /bin/bash /opt/ttn-gateway/bin/start.sh
└─7567 ./poly_pkt_fwd

None of the previous cases seem to point me in the right direction. It’s not registering with the gateway,which I’m assuming is because it can’t get the packet forwarder running.

Any suggestions/pointers? I’ve pinned the full startup logs below.

Thanks
Mark

*** Poly Packet Forwarder for Lora Gateway ***
Version: 2.1.0
*** Lora concentrator HAL library version info ***
Version: 3.1.0; Options: native;


INFO: Little endian host
INFO: found global configuration file global_conf.json, parsing it
INFO: global_conf.json does contain a JSON object named SX1301_conf, parsing SX1301 parameters
INFO: lorawan_public 1, clksrc 1
INFO: Configuring TX LUT with 16 indexes
INFO: radio 0 enabled (type SX1257), center frequency 867500000, RSSI offset -166.000000, tx enabled 1
INFO: radio 1 enabled (type SX1257), center frequency 868500000, RSSI offset -166.000000, tx enabled 0
INFO: Lora multi-SF channel 0> radio 1, IF -400000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 1> radio 1, IF -200000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 2> radio 1, IF 0 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 3> radio 0, IF -400000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 4> radio 0, IF -200000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 5> radio 0, IF 0 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 6> radio 0, IF 200000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 7> radio 0, IF 400000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora std channel> radio 1, IF -200000 Hz, 250000 Hz bw, SF 7
INFO: FSK channel> radio 1, IF 300000 Hz, 125000 Hz bw, 50000 bps datarate
INFO: global_conf.json does contain a JSON object named gateway_conf, parsing gateway parameters
INFO: gateway MAC address is configured to AA555A0000000000
INFO: Found 2 servers in array.
INFO: Server 0 configured to “127.0.0.1”, with port up “1680” and port down "1681"
INFO: Server 1 configured to “iot.semtech.com”, with port up “1680” and port down "1680"
INFO: Found 5 system calls in array.
INFO: System command 0: "df -m"
INFO: System command 1: "free -h"
INFO: System command 2: "uptime"
INFO: System command 3: "who -a"
INFO: System command 4: "uname -a"
INFO: monitor hostname or IP address is configured to "127.0.0.1"
INFO: monitor port is configured to "2008"
INFO: ghost hostname or IP address is configured to "127.0.0.1"
INFO: ghost port is configured to "1918"
INFO: downstream keep-alive interval is configured to 10 seconds
INFO: statistics display interval is configured to 30 seconds
INFO: upstream PUSH_DATA time-out is configured to 100 ms
INFO: packets received with a valid CRC will be forwarded
INFO: packets received with a CRC error will NOT be forwarded
INFO: packets received with no CRC will NOT be forwarded
INFO: GPS serial port path is configured to "/dev/ttyAMA0"
INFO: SSH path is configured to "/usr/bin/ssh"
INFO: SSH port is configured to 22
INFO: HTTP port is configured to 80
INFO: NGROK path is configured to "/usr/bin/ngrok"
INFO: Reference latitude is configured to 10.000000 deg
INFO: Reference longitude is configured to 20.000000 deg
INFO: Reference altitude is configured to -1 meters
INFO: GPS is enabled
INFO: Using fake GPS coordinates instead of real.
INFO: antenna_gain 0 dBi
INFO: Upstream data is enabled
INFO: Downstream data is enabled
INFO: Ghoststream data is disabled
INFO: Radiostream data is enabled
INFO: Statusstream data is enabled
INFO: Beacon is disabled
INFO: Monitor is disabled
INFO: Platform configured to "IMST + Rpi"
INFO: Contact email configured to "operator@gateway.tst"
INFO: Description configured to "Update me"
INFO: found local configuration file local_conf.json, parsing it
INFO: redefined parameters will overwrite global parameters
INFO: local_conf.json does not contain a JSON object named SX1301_conf
INFO: local_conf.json does contain a JSON object named gateway_conf, parsing gateway parameters
INFO: gateway MAC address is configured to AA555A000004BABA
INFO: packets received with a valid CRC will be forwarded
INFO: packets received with a CRC error will NOT be forwarded
INFO: packets received with no CRC will NOT be forwarded
INFO: GPS is enabled
INFO: antenna_gain 0 dBi
INFO: Upstream data is enabled
INFO: Downstream data is enabled
INFO: Ghoststream data is disabled
INFO: Radiostream data is enabled
INFO: Statusstream data is enabled
INFO: Beacon is disabled
INFO: Monitor is disabled
INFO: Successfully contacted server 127.0.0.1
INFO: Successfully contacted server iot.semtech.com
INFO: [main] Starting the concentrator
ERROR: [main] failed to start the concentrator


#2

seems to me that you didn’t edit the config file for the TTN network


(Jac Kersing) #3

Let me guess, you are using a RPi3. These messages are ‘normal’ due to SPI timing issues with the RPi3. If you wait for a few minutes the gateway should start. However, as Borroz correctly observed, you need to update the configuration (create an applicable local_conf.json) as your current configuration does not point to TTN.


(Tim Everitt) #4

Hi @duineuk, it looks like your local_conf.json may be wrong as reported by @BoRRoZ and @kersing. I’m running RPi3 gateways with iC880a cards and the Semtech packet forwarder.

Here’s an example of a local_conf.json from one of my systems:

bs-ops@nes-acc-002:/opt/ttn-gateway/bin $ pwd
/opt/ttn-gateway/bin
bs-ops@nes-acc-002:/opt/ttn-gateway/bin $ ls -l
total 16
-rw-r–r-- 1 root root 7440 Oct 13 10:45 global_conf.json
-rw-r–r-- 1 root root 426 Jan 30 10:26 local_conf.json
lrwxrwxrwx 1 root root 59 Oct 13 10:45 poly_pkt_fwd -> /opt/ttn-gateway/packet_forwarder/poly_pkt_fwd/poly_pkt_fwd
-rwxr-xr-x 1 root root 1789 Oct 13 10:45 start.sh
bs-ops@nes-acc-002:/opt/ttn-gateway/bin $ cat local_conf.json
{
“gateway_conf”: {
“gateway_ID”: “B827EBFFFE031022”,
“servers”: [ { “server_address”: “router.eu.thethings.network”, “serv_port_up”: 1700, “serv_port_down”: 1700, “serv_enabled”: true } ],
“ref_latitude”: 0,
“ref_longitude”: 0,
“ref_altitude”: 0,
“contact_email”: "cults.telecom@gmail.com",
“description”: “LW base station”,
“stat_interval”: 300,
“keepalive_interval”: 120
}
}
bs-ops@nes-acc-002:/opt/ttn-gateway/bin $

Note: I have manually added the stat_interval and keepalive_interval timers to test for cellular backhaul.


(Cliff Albert) #5

This also might be a reset that is not being sent to the board. Check if the start script correctly has the SX1301_RESET_BCM_PIN set and that the pin is actually connected to the reset pin on the IC880A


(Duineuk) #6

Thanks all, I’ll look at these today. Pretty sure the reset is being sent, the latest start.sh has the GPIO toggling at the start of the script.

Thanks again.
Mark


(Duineuk) #7

Thanks all,

Combination of updating the conf, setting the RESET pin correctly, and triple-checking the jumpers (/facepalm) got it up.

Mark


(Duineuk) #8

So I have another gateway I can’t get started :slight_smile:

ic880A, Raspi3, same as above. Only physical difference is that I’m using the GNZ backplane (https://www.tindie.com/products/gnz/imst-ic880a-lorawan-backplane-kit/) rather than point to point wiring in the first one.

I copied the SD card, changed network settings, did a fresh install.sh, copied over the local_conf.json and edited the EUI address. I wondered if perhaps the RST pin was different; it’s still RasPi pin 22, and I physically buzzed through to check that it does indeed go through to pin 13 on the iC880a.

Same failure mode at the same place as before - fails to start the concentrator. Log below - I’d be very grateful if someone could give me a hint!

Mark

Resetting…
SX1301 reset sent
/opt/ttn-gateway/packet_forwarder/poly_pkt_fwd
*** Poly Packet Forwarder for Lora Gateway ***
Version: 2.1.0
*** Lora concentrator HAL library version info ***
Version: 3.1.0; Options: native;


INFO: Little endian host
INFO: found global configuration file global_conf.json, parsing it
INFO: global_conf.json does contain a JSON object named SX1301_conf, parsing SX1301 parameters
INFO: lorawan_public 1, clksrc 1
INFO: Configuring TX LUT with 16 indexes
INFO: radio 0 enabled (type SX1257), center frequency 867500000, RSSI offset -166.000000, tx enabled 1
INFO: radio 1 enabled (type SX1257), center frequency 868500000, RSSI offset -166.000000, tx enabled 0
INFO: Lora multi-SF channel 0> radio 1, IF -400000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 1> radio 1, IF -200000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 2> radio 1, IF 0 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 3> radio 0, IF -400000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 4> radio 0, IF -200000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 5> radio 0, IF 0 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 6> radio 0, IF 200000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 7> radio 0, IF 400000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora std channel> radio 1, IF -200000 Hz, 250000 Hz bw, SF 7
INFO: FSK channel> radio 1, IF 300000 Hz, 125000 Hz bw, 50000 bps datarate
INFO: global_conf.json does contain a JSON object named gateway_conf, parsing gateway parameters
INFO: gateway MAC address is configured to AA555A0000000000
INFO: Found 2 servers in array.
INFO: Server 0 configured to “127.0.0.1”, with port up “1680” and port down "1681"
INFO: Server 1 configured to “iot.semtech.com”, with port up “1680” and port down "1680"
INFO: Found 5 system calls in array.
INFO: System command 0: "df -m"
INFO: System command 1: "free -h"
INFO: System command 2: "uptime"
INFO: System command 3: "who -a"
INFO: System command 4: "uname -a"
INFO: monitor hostname or IP address is configured to "127.0.0.1"
INFO: monitor port is configured to "2008"
INFO: ghost hostname or IP address is configured to "127.0.0.1"
INFO: ghost port is configured to "1918"
INFO: downstream keep-alive interval is configured to 10 seconds
INFO: statistics display interval is configured to 30 seconds
INFO: upstream PUSH_DATA time-out is configured to 100 ms
INFO: packets received with a valid CRC will be forwarded
INFO: packets received with a CRC error will NOT be forwarded
INFO: packets received with no CRC will NOT be forwarded
INFO: GPS serial port path is configured to "/dev/ttyAMA0"
INFO: SSH path is configured to "/usr/bin/ssh"
INFO: SSH port is configured to 22
INFO: HTTP port is configured to 80
INFO: NGROK path is configured to "/usr/bin/ngrok"
INFO: Reference latitude is configured to 10.000000 deg
INFO: Reference longitude is configured to 20.000000 deg
INFO: Reference altitude is configured to -1 meters
INFO: GPS is enabled
INFO: Using fake GPS coordinates instead of real.
INFO: antenna_gain 0 dBi
INFO: Upstream data is enabled
INFO: Downstream data is enabled
INFO: Ghoststream data is disabled
INFO: Radiostream data is enabled
INFO: Statusstream data is enabled
INFO: Beacon is disabled
INFO: Monitor is disabled
INFO: Platform configured to "IMST + Rpi"
INFO: Contact email configured to "operator@gateway.tst"
INFO: Description configured to "Update me"
INFO: found local configuration file local_conf.json, parsing it
INFO: redefined parameters will overwrite global parameters
INFO: local_conf.json does not contain a JSON object named SX1301_conf
INFO: local_conf.json does contain a JSON object named gateway_conf, parsing gateway parameters
INFO: gateway MAC address is configured to B827EBFFFE329883
INFO: Found 1 servers in array.
INFO: Server 0 configured to “router.eu.thethings.network”, with port up “1700” and port down "1700"
INFO: packets received with a valid CRC will be forwarded
INFO: packets received with a CRC error will NOT be forwarded
INFO: packets received with no CRC will NOT be forwarded
INFO: Reference latitude is configured to 51.489900 deg
INFO: Reference longitude is configured to 0.304300 deg
INFO: Reference altitude is configured to 12 meters
INFO: GPS is enabled
INFO: antenna_gain 0 dBi
INFO: Upstream data is enabled
INFO: Downstream data is enabled
INFO: Ghoststream data is disabled
INFO: Radiostream data is enabled
INFO: Statusstream data is enabled
INFO: Beacon is disabled
INFO: Monitor is disabled
INFO: Contact email configured to "mark@annasach.net"
INFO: Description configured to "LoRaWAN Brentford"
INFO: Successfully contacted server router.eu.thethings.network
INFO: [main] Starting the concentrator
ERROR: [main] failed to start the concentrator


(Jac Kersing) #9

SPI is enabled? If so, give it a couple of tries starting the packet forwarder. I run several RPi 3 with iC880a boards, SPI timing makes it fail a number of times at startup however once started it is rock solid. (I’m using @jpmeijers resin.io scripts from github)


(Duineuk) #10

/facepalm

Yup, forgot to enable SPI in config. Thank you!

Mark


(Theo Boomsma) #11

Dont waste ur time trying to alter the local_conf.json. For some reason It seems to be locked and simply doesnt save after editing on RPI3.
Do all your config in the global_conf.json …
We did it for the RisingHF board … https://youtu.be/VFklGUGuw6I


(Duineuk) #12

Nonsense. No issue with it at all, that problem was just because I forgot to enable SPI in raspi-config.


(Tim Everitt) #13

Hi @thboomsma, that’s not how I do configs for the Semtech poly_pkt_fwd on RPi.

I never change the global_conf.json file. I put all gateway-specific information into the local_conf.json file. No problems editing the local file as long as I use sudo as it’s owned by root with 644 access permissions. The configs all work correctly for me with a vanilla global file and a changed local file and persist correctly through restarts and reboots.


(Jac Kersing) #14

@thboomsma the example of editing the global config is bad as is, adding multiple TTN servers to it is worse. This basically sends each packet to the backend twice for processing. If you want redundancy you need to send it to another server only if the primary server does not respond (ACK), something that is not supported by the software at the moment.

The reason editing the local_conf fails is because for the setup used it assumes the configuration can be pulled from github to replace whatever is on the system. Simply remove the directory called gateway-remote-config and your file will not be replaced when starting the software.
So please examine things before spreading FUD.

Note: please add a warning to attach the antenna before installing the software. Because the software attempts to auto start after reboot and the concentrator board may be damaged if the startup succeeds without an antenna connected.

For the next tutorial, nodes do not connect to a gateway, as mentioned at the start of the video, LoRaWAN uses broadcast. So any gateway within range will receive the data and forward it to a backend, might even be the TTN backend. :slightly_smiling_face:


(Theo Boomsma) #15

Thanks for your pointers!
It was really a rocky road to get the setup working as there is not much information around about the RisingHF board with TTN and yes we also torched a LoPy test unit due to the antenna issue. We will add the “notice” to the video.

Redundancy was a key issue as we found the TTN us router to be not accessible at times so i assume the poly_packet was the way to go. I don’t see why it will send the packets twice? Do explain that part.
If you typically follow the normal instructions for Poly you will have server settings in both local and global conf files so we just used the one we could change.

Thanks


(Theo Boomsma) #16

i stand corrected in that case!


(Ebreyit) #17

The Resin.io setup by @jpmeijers is definitely a good alternative setup method

Details for the RAK831 here
https://www.thethingsnetwork.org/docs/gateways/rak831/

But as stated on the Git Page, it works with multiple boards to get you up and running very quickly, mentions the RPi 3 SPI issues and specifies the Reset Pins needed

Also very repeatable once setup and working

I setup my resin.io image on a spare RPi 3 whilst waiting for my RAK831 to arrive, then just popped it in and it worked straight away including the GPS.

Also easy to update the software in the field once deployed (stuffed in the rafters) as they continue to evolve and improve.


(Duineuk) #18

That’s the instructions I used. Very clear and straightforward.


(Jac Kersing) #19

In the video there are two destinations configured in the global_conf. Poly forwarder will send all received data to all destinations. So the setup sends the same data packet to two TTN routers for simultaneous processing. If everyone starts doing that the load on the backend doubles.


(Duineuk) #20

It’s pretty straightforward really; gateway-independent stuff in global, gateway-specific stuff in local.

I don’t understand why you’d want to do anything else?