Skip to content

Commit e81e782

Browse files
jcampanell-cablelabsbrocaar
authored andcommitted
Updates to Multitech docs (#57)
1 parent 4f8cb09 commit e81e782

File tree

5 files changed

+140
-11
lines changed

5 files changed

+140
-11
lines changed
Loading

docs/content/install/gateway/kerlink.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ menu:
55
parent: gateway
66
---
77

8-
## Kerlink
98

109
### Kerlink IOT station
1110

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#!/bin/bash
2+
#
3+
# A SysV init script for the lora-gateway-bridge
4+
#
5+
### BEGIN INIT INFO
6+
# Provides: lora-gateway-bridge
7+
# Required-Start: $syslog $network
8+
# Required-Stop: $syslog $network
9+
# Should-Start: $local_fs
10+
# Should-Stop: $local_fs
11+
# Default-Start: 2 3 4 5
12+
# Default-Stop: 0 1 6
13+
# Short-Description: lora-gateway-bridge
14+
# Description: Sends lora messages from the gateway to the open source server..
15+
### END INIT INFO
16+
#
17+
PIDFILE=/var/run/lora-gateway-bridge.pid
18+
NAME=lora-gateway-bridge
19+
STARTSCRIPT=/opt/lora-gateway-bridge/bin/runGateway.sh
20+
RETVAL=0
21+
22+
start() {
23+
if [ -f $PIDFILE ]; then
24+
echo "$NAME is already running"
25+
else
26+
echo "Starting $NAME"
27+
# Start the server, passing in the file to get the PID
28+
$STARTSCRIPT $PIDFILE
29+
RETVAL=$?
30+
fi
31+
}
32+
33+
stop() {
34+
if [ -f $PIDFILE ]; then
35+
echo "Shutting down $NAME"
36+
kill `cat $PIDFILE`
37+
# Get rid of the pidfile so we don't assume it's running any more.
38+
rm -f $PIDFILE
39+
RETVAL=$?
40+
else
41+
echo "$NAME is not running."
42+
fi
43+
}
44+
45+
restart() {
46+
echo "Restarting $NAME"
47+
stop
48+
start
49+
}
50+
51+
status() {
52+
if [ -f $PIDFILE ]; then
53+
echo "Status for $NAME:"
54+
ps -ef `cat $PIDFILE`
55+
RETVAL=$?
56+
else
57+
echo "$NAME is not running"
58+
fi
59+
}
60+
61+
case "$1" in
62+
start)
63+
start
64+
;;
65+
stop)
66+
stop
67+
;;
68+
status)
69+
status
70+
;;
71+
restart)
72+
restart
73+
;;
74+
*)
75+
echo "Usage: {start|stop|status|restart}"
76+
exit 1
77+
;;
78+
esac
79+
exit $RETVAL

docs/content/install/gateway/multitech.md

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ netmask by adding a “#” at the beginning of each line:
4545
Then reboot, and obtain the issued IP address as outlined above.
4646

4747
The basic setup steps are outlined below for the packet forwarder for each
48-
device, followed by `Install lora-gateway-bridge` below.
48+
device, followed by `Install lora-gateway-bridge` below. This image shows how
49+
the components connect to each other, and what some of the various settings
50+
represent:
51+
52+
![Gateway Pieces and Connections](../MultitechGatewaySettings.png)
4953

5054
#### Multitech Conduit AEP
5155

@@ -97,6 +101,9 @@ signed certificate. Accept the certificate to proceed.
97101
}
98102
}
99103
```
104+
Note that the serv_port_up and serv_port_down represent the ports used to
105+
communicate with the lora-gateway-bridge, usually on localhost (the
106+
server_address parameter). See the image above.
100107

101108
15. Select “Submit”.
102109
16. Select the “Save and Restart” option on the left menu.
@@ -128,12 +135,19 @@ Now you will want to set up the lora-gateway-bridge on the device. The
128135
following are suggested files and locations:
129136

130137
1. Download the arm build of the lora-gateway-bridge (see `Downloads` on the
131-
left), and extract it to `/opt/lora-gateway-bridge/bin/`
138+
left), and extract it to `/opt/lora-gateway-bridge/bin/`. Note that at the
139+
time of this writing, the Multitech boxes are all running 32-bit amd
140+
processors. This can be verified by issuing the command `uname -a`, where
141+
'armv7' or lower in the output represents 32-bit arm processors, and 'armv8'
142+
or higher represents 64-bit arm processors. Be sure to download the
143+
appropriate binary package for the system processor.
132144

133-
2. Create a script to run the application with the appropriate settings for your
134-
installation in /opt/lora-gateway-bridge/bin/runGateway.sh:
145+
2. Create a script (or download [here](../runGateway.sh)) to run the application
146+
with the appropriate settings for your installation in
147+
/opt/lora-gateway-bridge/bin/runGateway.sh (ensure that the script is
148+
executable `chmod +x /opt/lora-gateway-bridge/bin/runGateway.sh`):
135149

136-
```
150+
```
137151
#!/bin/bash
138152
# Starts the gateway code
139153

@@ -163,11 +177,17 @@ following are suggested files and locations:
163177
PID=$!
164178
if [[ $PIDFILE != "" ]]; then
165179
echo $PID > $PIDFILE
166-
fi```
167-
168-
3. Then create a startup script in /etc/init.d/lora-gateway-bridge:
180+
fi
181+
182+
```
183+
Modify the MQTT_* values to reflect the settings for your system.
184+
185+
3. Then create a startup script (or download [here](../lora-gateway-bridge)) in
186+
/etc/init.d/lora-gateway-bridge (ensure that the script is executable
187+
`chmod +x /etc/init.d/lora-gateway-bridge`):
188+
169189

170-
```
190+
```
171191
#!/bin/bash
172192
#
173193
# A SysV init script for the lora-gateway-bridge
@@ -246,7 +266,8 @@ following are suggested files and locations:
246266
exit 1
247267
;;
248268
esac
249-
exit $RETVAL```
269+
exit $RETVAL
270+
```
250271
251272
4. Make sure the script start on reboot:
252273
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
# Starts the gateway code
3+
4+
# Accept a single parameter of where to put the pid of the actual lora-app-server
5+
# process.
6+
if [ "$#" -ge 1 ]; then
7+
PIDFILE=$1
8+
else
9+
PIDFILE=
10+
fi
11+
12+
# These placeholder values will be replaced by the install script at startup.
13+
# A change in these values will require a manual change here or a reinstall of
14+
# the lora-gateway-bridge package.
15+
export MQTT_SERVER="ssl://some.server.net"
16+
export MQTT_USERNAME="username"
17+
export MQTT_PASSWORD="password"
18+
19+
# Start the log file by identifying the device. Just print it out, too,
20+
# so we can find it in the system startup output.
21+
export LORA_CARD_MAC=$(mts-io-sysfs show lora/eui)
22+
export LORA_CARD_MAC=${LORA_CARD_MAC//:/}
23+
echo "Lora Gateway Bridge running on device with MAC $LORA_CARD_MAC"
24+
echo "Lora Gateway Bridge running on device with MAC $LORA_CARD_MAC" > /var/log/lora-gateway-bridge.log
25+
26+
/opt/lora-gateway-bridge/bin/lora-gateway-bridge --log-level 5 >> /var/log/lora-gateway-bridge.log 2>&1 &
27+
PID=$!
28+
if [[ $PIDFILE != "" ]]; then
29+
echo $PID > $PIDFILE
30+
fi

0 commit comments

Comments
 (0)