Cisco LoRaWAN Gateway

Any support questions you might have can be asked here:
https://www.thethingsnetwork.org/marketplace/product/cisco-lorawan-gateway
image

Hi,

I am trying to configure this gateway with TTN. I updated the firmware, however i cannot manage to configure the packet forwarder. When i get to the step where i need to edit the configuration file at: “cd /etc/pktfw”, I get stuck since there is no such configuration file on the gateway.

Any ideas? :slight_smile:

Regards,
Szabolcs

Same for me.
Looks like no packet-forwarder is installed. :frowning:

A-08-LoRa01#show packet-forwarder status
packet-forwarder firmware is not installed

Version 2.0.32

Here is the guide on how to install a packet-forwarder.

But I don’t know where to download the forwarder and if there are different forwarder, which one I need. :confused:

I think I found what we need.

Instead of /etc/pktfwd the packet forwarder configuration is located in /tools/templates

bash-3.2# cd /tools/templates/
bash-3.2# ls -al
total 144
drwxr-xr-x    2 65534    65534         4096 Aug  6  2016 .
drwxr-xr-x    3 65534    65534         4096 Aug  6  2016 ..
-rwxr-xr-x    1 65534    65534        11323 Aug  6  2016 config_loc_dual_antenna_8ch_full_diversity_EU868.json
-rwxr-xr-x    1 65534    65534        11248 Aug  6  2016 config_loc_dual_antenna_8ch_full_diversity_JP920.json
-rwxr-xr-x    1 65534    65534        11323 Aug  6  2016 config_loc_dual_antenna_8ch_partial_diversity_EU868.json
-rwxr-xr-x    1 65534    65534         7993 Aug  6  2016 config_loc_single_antenna_16ch_EU868.json
-rwxr-xr-x    1 65534    65534         7080 Aug  6  2016 config_loc_single_antenna_16ch_US915.json
-rwxr-xr-x    1 65534    65534        13519 Aug  6  2016 config_loc_single_antenna_64ch_US915.json
-rwxr-xr-x    1 65534    65534        13635 Aug  6  2016 config_loc_single_antenna_full_duplex_64ch_US915.json
-rwxr-xr-x    1 65534    65534        17478 Aug  6  2016 config_test_dual_antenna_56ch_partial_diversity_EU868.json
-rwxr-xr-x    1 65534    65534        14148 Aug  6  2016 config_test_single_antenna_64ch_64x1_EU868.json
-rwxr-xr-x    1 65534    65534        14148 Aug  6  2016 config_test_single_antenna_64ch_8x8_EU868.json

Copy a template to your config file.
Use /tmp because it is not allowed to create files in /tools

cp /tools/templates/config_loc_dual_antenna_8ch_full_diversity_EU868.json /tmp/config.json

edit the config.json, change some parameters like gateway_ID.

vi /tmp/config.json

[…]

Start the packet-forwarder.

/tools/pkt_forwarder -c /tmp/config.json -g/dev/ttyS1

In short: Combine the ttn documentation and the latest latest cisco documentation.

My gateway is working at the moment. :tada:
But gps still throws warning.

WARNING: GPS time reference is invalid. Check GPS configuration (UBX: NAV-TIMEGPS)
2 Likes

Indeed, CWempe! I have found the same and got it to work, just didn’t get to post it here as well :slight_smile:

1 Like

Do you use the gps module?
How did you solve the warnings?
Or do you just ignore them? :smile:

Yes, we got the warnings as well.
It also says so in the CISCO documentation /tools/How_to_use_pkt_forwarder:
"A GPS warning might be thrown when running the binary: “WARNING: GPS time reference is invalid. Check GPS configuration (UBX: NAV-TIMEGPS)”

However, I have noticed that the gateway packet forwarder is not started automatically when the gateway is power cycled. I can see that the script file is called from init.d, however it is not running when i check up on it, consequently the gateway is not online.

Any ideas? :slight_smile:

Regarding the init-script, I followed the instructions and it works.
But I think I did something a little different.
Anyway, it works for me.

I can post my init script tomorrow, if I find the time.

Regarding GPS warning.
The Cisco documentation also says:

Please run the following CLI to check the GPS status and make sure to well receive GPS signal on the IXM.

I did that and everything looks good.
So, should we just ignore the warnings?
Or can we fix something if the paket forwarder does not get a gps signal, but gps is working in general?

So just to clarify, the script does work when i start it manually.
The issue is that it won’t start automatically when i restart the gateway, even though i have placed it in the init.d directory. I have done some debugging and i can see that the script is being started, but it is not kept alive.

I put a screenshot of my script in case that helps :slight_smile:

image

Here is my script.

#!/bin/sh

SCRIPT_DIR=/tmp
SCRIPT=/tools/pkt_forwarder
RUNAS=root

PIDFILE=$SCRIPT_DIR/pkt_forwarder.pid

start() {
  if [ -f /var/run/$PIDNAME ] && kill -0 $(cat /var/run/$PIDNAME); then
    echo 'Service already running' >&2
    return 1
  fi
  echo 'Starting service<E2><80><A6>' >&2
  cd $SCRIPT_DIR
  start-stop-daemon -S -q -b -p "$PIDFILE" --exec "$SCRIPT" -- -c $SCRIPT_DIR/config.json -g/dev/ttyS1
  echo 'Service started' >&2
}

stop() {
  if [ ! -f "$PIDFILE" ] || ! kill -0 $(cat "$PIDFILE"); then
    echo 'Service not running' >&2
    return 1
  fi
  echo 'Stopping service<E2><80><A6>' >&2
  kill -15 $(cat "$PIDFILE") && rm -f "$PIDFILE"
  echo 'Service stopped' >&2
}

uninstall() {
  echo -n "Are you really sure you want to uninstall this service? That cannot be undone. [yes|No] "
  local SURE
  read SURE
  if [ "$SURE" = "yes" ]; then
    stop
    rm -f "$PIDFILE"
    echo "Notice: log file is not be removed: '$LOGFILE'" >&2
    update-rc.d -f <NAME> remove
    rm -fv "$0"
  fi
}

case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  uninstall)
    uninstall
    ;;
  restart)
    stop
    start
    ;;
  *)
    echo "Usage: $0 {start|stop|restart|uninstall}"
esac

I added $SCRIPT_DIR/ to the start command. Thats the difference.
Sorry I didn’t remeber earlier. :smile:

I guess you need that too.
Without this modification the script will not find config.json when it is started from /etc/init.d.
It works, if you start the script while you are in the directory where the config,json is located.

Hi again,

Thanks a lot for posting your script. I have tried it, but it is not working unfortunately.

The script i had i could start manually, even when i wasn’t in the same directory, in yours i see that you are using /tmp as the SCRIPT dir.

Did you copy something over there? Or how is this supposed to work?
Also considering that temp is normally cleared when the device is power cycled.

Using /tmp to store my config would not be my first choice either.
But the Cisco documentation suggests to use it.

If you want to create files (e.g. customized config file) in LXC, please create in /tmp. It's not allowed to do it in /tools directory.

I copied the config.json to /tmp.

I suggest you add some debug output to the script that writes information to /tmp/debug.log so you may find errors after the script gets executed.

So just to verify, does your script and the LoRaWAN gateway still work after you power cycle the gateway, or do you need to start the script manually?

I tried debugging it, but couldn’t see any errors. It just showed that the script was started during start-up, but when i checked there was no process running with the pkt forwarder.

Yes, it autimatically starts after reboot.

Did you do a firmware update on the CISCO gateway as well, in the beginning?

Hello

At first lets have a check on the on the version you have on your box.

from the cisco CLI yourbox# show inventory
You should get some thing like this
image
then we can see on what kind off release your are working, and check if everything up to date.
then we go futher
May if you missing files you could start over with a update, but check every time if fit in the memory flash:

johan

Hi Johan,

Here you go:

Name : Gateway
ImageVer : 2.0.32
BootloaderVer : 20180130_cisco
SerialNumber : FOC21028RCX
PID : IXM-LPWA-800-16-K9
UTCTime : 16:44:21.105 UTC Sun Aug 27 2023
FPGAVersion : 61
FPGAStatus : Ready
ChipID : LSB = 0x28780806 MSB = 0x00f14212
TimeZone : UTC
LocalTime : Sun Aug 27 16:44:21 UTC 2023
ACT2 Authentication: PASS

Hi jwijngaard, any updates? :slight_smile:

I noticed something interesting. If i reset the gateway from the reset switch, then it starts the script automatically and everything works fine, if however i do a hard reset, by removing the power it no longer starts up.

Does this give you any ideas into what the issue could be?
I started from factory default settings and i am using the same script as you are.

Thanks,
Szabolcs

Sorry, I have no idea.
And I cannot test this, because your gateway is mounted on the roof already.

But I guess I had to remove the power before we installed the gateway on the roof.
And we had ne issue. The script started without problem.