LorixOne Gateway lora bridge


#1

Hi,

Is there someone who succesfully installed the lora bridge on the LorixOne gateway?

@brocaar do you have an installation package for this gateway?
yocto 2.1.2 / opkg

Regards,
Jan


#2

I don’t have experience with this gateway (yet), but I’m currently doing to testing with the Multitech Conduit, which also uses Yocto. The recipe below successfully builds a .ipk file

lora-gateway-bridge/lora-gateway-bridge_2.1.5.bb:

DESCRIPTION = "LoRa Gateway Bridge"
HOMEPAGE = "https://www.loraserver.io/"
PRIORITY = "optional"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "https://dl.loraserver.io/tar/lora-gateway-bridge_${PV}_linux_arm.tar.gz \
           file://lora-gateway-bridge.default \
           file://lora-gateway-bridge.init \
"
SRC_URI[md5sum] = "635722696bca80f1c5c426c286590405"
SRC_URI[sha256sum] = "aa4052d4787e999958598901215422fd2e4044acd5eeceafbccfb0af9740c321"
PR = "r0"

LORA_GATEWAY_BRIDGE_DIR = "/opt/lora-gateway-bridge"
LORA_GATEWAY_BRIDGE_USER = "gatewaybridge"

S = "${WORKDIR}"

do_install() {
    install -d ${D}${LORA_GATEWAY_BRIDGE_DIR}
    install -m 755 lora-gateway-bridge ${D}${LORA_GATEWAY_BRIDGE_DIR}/

    install -d ${D}${sysconfdir}/default
    install -m 0640 ${WORKDIR}/lora-gateway-bridge.default ${D}${sysconfdir}/default/lora-gateway-bridge

    install -d ${D}${sysconfdir}/init.d
    install -m 0755 ${WORKDIR}/lora-gateway-bridge.init ${D}${sysconfdir}/init.d/lora-gateway-bridge
}

FILES_${PN} += "${LORA_GATEWAY_BRIDGE_DIR}"
FILES_${PN}-dbg += "${LORA_GATEWAY_BRIDGE_DIR}/.debug"

CONFFILES_${PN} += "${sysconfdir}/default/lora-gateway-bridge"

lora-gateway-bridge/lora-gateway-bridge/lora-gateway-bridge.default:

# ip:port to bind the UDP listener to (default: "0.0.0.0:1700")
UDP_BIND=0.0.0.0:1700

# mqtt server (e.g. scheme://host:port where scheme is tcp, ssl or ws) (default: "tcp://127.0.0.1:1883")
MQTT_SERVER=tcp://127.0.0.1:1883

# mqtt server username (optional) 
MQTT_USERNAME=

# mqtt server password (optional)
MQTT_PASSWORD=

# debug=5, info=4, warning=3, error=2, fatal=1, panic=0 (default: 4)
LOG_LEVEL=4

# skip the CRC status-check of received packets
# SKIP_CRC_CHECK=true

lora-gateway-bridge/lora-gateway-bridge/lora-gateway-bridge.init:

#!/usr/bin/env bash
### BEGIN INIT INFO
# Provides:          lora-gateway-bridge
# Required-Start:    $all
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: LoRa Gateway Bridge abstracts the packet_forwarder protocol into JSON over MQTT
### END INIT INFO

# set variables for exporting (needed for DEFAULT_FILE)
set -a

NAME=lora-gateway-bridge
DESC="LoRa Gateway Bridge"
DAEMON_USER=root
DAEMON_GROUP=root
DAEMON=/opt/lora-gateway-bridge/$NAME
PID_FILE=/var/run/$NAME.pid
DEFAULT_FILE=/etc/default/$NAME

# check root
if [ "$UID" != "0" ]; then
    echo "You must be root to run this script"
    exit 1
fi

# check daemon
if [ ! -x $DAEMON ]; then
    echo "Executable $DAEMON does not exist"
    exit 5
fi

if [ -r /etc/default/rcS ]; then
	. /etc/default/rcS
fi

if [ -f "$DEFAULT_FILE" ]; then
	. "$DEFAULT_FILE"
fi

function do_start {
	start-stop-daemon --start --background --chuid "$DAEMON_USER:$DAEMON_GROUP" --make-pidfile --pidfile "$PID_FILE" --startas /bin/bash -- -c "exec $DAEMON"
}

function do_stop {
	start-stop-daemon --stop --retry=TERM/30/KILL/5 --pidfile "$PID_FILE" --exec "$DAEMON"
	retval="$?"
	sleep 1
	return "$retval"
}

case "$1" in
	start)
		echo "Starting $DESC"
		do_start
		;;
	stop)
		echo "Stopping $DESC"
		do_stop
		;;
	restart)
		echo "Restarting $DESC"
		do_stop
		case "$?" in
			0|1)
				do_start
				;;
		esac
		;;
	*)
		echo "Usage: $NAME {start|stop|restart}" >&2
		exit 3
		;;
esac

Let me know if this also works for the LorixOne / which modifications you needed to make.


#3

Hi
I have istalled the gateway bridge on a LorixOne. No problem and it works fine.
Let me know if you need more informations


#4

Please let me know how you did it.
I didn’t had time to check the steps from Brocaar yet.

If you have a ready to install .ipk file that would save me alot of time :slight_smile:


#5

Hello,
Can anyone share the steps to install the gateway bridge on LorixOne.


#6

Hi, can you please share more information on how you installed the gateway bridge on LorixOne.
Thanks