Introduction
Unpacking
Hardware installation
System and network configuration
TTN configuration
Reference and pictures
Introduction
I ordered the new amazing Lorix One gateway and I was reading a little bit the documentation before I received this new toy on my desktop, Reading confirmed me that I could install and configure this GW with TTN in less than one hour, check this lab, it's done ;)
Unpacking
I ordered few days ago two Lorix One gateways from Wifx for testing. Shipped the day I ordered, even if it was 5PM, good point for you guys at Wifx, you're fast, very fast.
So, I ordered the outdoor version IP65. Since price is the same than indoor and with a better antenna gain, I didn't had any hesitation. This price policy looks strange but, never mind, I took the one that could be placed anywhere.
Unfortunately even if it was shipped with Intl Priority on Wednesday, I had it in hand only next Wednesday (Switzerland to France). Of course Monday was a day off in France and Tuesday, they tried to deliver it, but I need to pay duties taxes (220€) and they were not able to give me a invoice indicating VAT (20% in France). So I told them, I need an Invoice for what I pay. As I'm a company, I can get back VAT but need an invoice. So they gave me the packet with invoice on Wednesday (next day), thanks to French Postal service. always efficient, but let's be cool with them, this time the packed was not lost ...
Talking about the box, let's open it:
Good packaging, a place is left, may be the one for indoor 2dBi antenna, this outdoor version one has 4.15 dBi antenna. Package contains all you need to get started (except the network cable)
- 24V DC power (500mA Max)
- POE Injector
- 4.154 dBi Outdoor antenna
- the LORIX One Gateway
Once out of the box it looks like this, as you can see with power adapter, the gateway is really small.
If you need to have a better size vision, I took a picture with Raspberry PI and Lopy near, as you can see, in term of full LoRaWAN Gateway, it's the smallest I ever seen.
Hardware installation
It's so simple, nothing fancy, take a network cable (you have a spare one, I'm sure) use the POE injector as follow, all is indicated into the documentation that you can download [here](http://lorixone.io/telechargement.php)
Of course put the data side of the POE injector into your router/switch/wallplug and then put the power cable into POWER 9-50V DC of the POE injector. Last step, connect your network cable one side on the POE injector and the other into the gateway as the picture above.
Take care to default network configuration in the next step.
System and network configuration
When getting it out of the box, default LORIX One network static config is as follow:
- Static IP Address : 192.168.1.50
- Network Mask : 255.255.255.0
- Network Gateway : 192.168.1.1
So you guys, this means if your network is not in 192.168.1.x net you won't be able to connect to the device. I was lucky my net is 192.168.1.0 but my gateway is 192.168.1.254 so by default LORIX One was not able to go to Internet but don't worry, this is not needed to configure the device.
If you can't connect because your network is not the same, you have 2 options:
- Use a USB cable to connect from your computer to LORIX One and then use a terminal software (CoolTerm, Putty, ....) to connect using serial. (USB connector of LORIX One act as a USB Serial converter. It's like you're connected directly onto the console. See section 7 of user manual.
- Connect the LORIX One to a Hub/Switch with your computer Ethernet wired on the same switch and configure your computer IP address to be a static one like 192.168.1.10 for example. Then you'll be able to connect with SSH to 192.168.1.50 but your computer will not have Internet access anymore (except if you're connected to it over WiFi).
My 2 cents, avoid headache, use the 1st one of the option.
In case of network access (my case) once LORIX device is accessible (answer to ping 192.168.1.50) go connect with ssh (user name is admin, not root), the default password is lorix4u
ssh admin@192.168.1.50
Ok I'm in, let's look at some interesting things
Great filesystem is UBIFS, like this one, and still plenty (relative) flash available, Linux kernel is 4.4
First thing, change default password for admin user with the following command
admin@sama5d4-lorix-one:~ $ passwd
Changing password for admin
Old password:
Enter the new password (minimum of 5 characters)
Please use a combination of upper and lower case letters and numbers.
New password:
Re-enter new password:
passwd: password changed.
admin@sama5d4-lorix-one:~ $ sudo passwd
Then change the default root password
admin@sama5d4-lorix-one:~ $ sudo passwd
Password:
Changing password for root
Enter the new password (minimum of 5 characters)
Please use a combination of upper and lower case letters and numbers.
New password:
Re-enter new password:
passwd: password changed.
admin@sama5d4-lorix-one:~ $
admin@sama5d4-lorix-one:~ $ sudo nano /etc/hostname
I changed sama5d4-lorix-one by ttn-gw05 but name is your choice, exit editor with CTRL-X and answer yes to save.
Then I changed .bashrc file to have great colored prompt and some basic aliases
admin@sama5d4-lorix-one:~ $ nano ~/.bashrc
Here my new .bashrc file
# ~/.bashrc: executed by bash(1) for non-login shells.
#export PS1='\h:\w\$ '
export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w \$\[\033[00m\] '
umask 022
# You may uncomment the following lines if you want `ls' to be colorized:
export LS_OPTIONS='--color=auto'
eval `dircolors`
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'
# Some more alias to avoid making mistakes:
# alias rm='rm -i'
# alias cp='cp -i'
# alias mv='mv -i'
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface
auto lo
iface lo inet loopback
# Main wired interface
auto eth0
iface eth0 inet dhcp
#iface eth0 inet static
# address 192.168.1.50
# netmask 255.255.255.0
# gateway 192.168.1.1
# dns-nameservers 192.168.1.1
admin@sama5d4-lorix-one:~ $ sudo reboot; logout
admin@ttn-gw05:/usr/share/zoneinfo $ date Thu Jun 8 06:06:48 UTC 2017
admin@ttn-gw05:/etc $ sudo rm /etc/localtime
admin@ttn-gw05:/etc $ sudo ln -s /usr/share/zoneinfo/Europe/Paris /etc/localtime
admin@ttn-gw05:/etc $ date
Thu Jun 8 08:09:48 CEST 2017
admin@ttn-gw05:/etc $
admin@ttn-gw05:/etc $ date
Thu Jun 8 08:20:25 CEST 2017
admin@ttn-gw05:/etc $ sudo /etc/init.d/ntpd status
Password:
/usr/sbin/ntpd is stopped
admin@ttn-gw05:/etc $ sudo /etc/init.d/ntpd start
Starting ntpd: done
admin@ttn-gw05:/etc $ date
Thu Jun 8 09:34:30 CEST 2017
admin@ttn-gw05:/etc $ update-rc.d ntpd defaults
System startup links for /etc/init.d/ntpd already exist.
admin@ttn-gw05:/etc $ sudo reboot; logout
admin@ttn-gw05:~ $ date
Thu Jun 8 09:46:49 CEST 2017
admin@ttn-gw05:~ $ sudo /etc/init.d/ntpd status
Password:
/usr/sbin/ntpd (pid 936) is running...
admin@ttn-gw05:~ $ top
top - 09:50:29 up 4 min, 1 user, load average: 0.51, 0.34, 0.14
Tasks: 67 total, 1 running, 66 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.3 us, 0.7 sy, 0.0 ni, 99.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 123944 total, 99784 free, 9624 used, 14536 buff/cache
KiB Swap: 0 total, 0 free, 0 used. 106240 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
979 admin 20 0 3008 1428 1112 R 1.0 1.2 0:00.21 top
1 root 20 0 1712 704 636 S 0.0 0.6 0:01.35 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
3 root 20 0 0 0 0 S 0.0 0.0 0:00.13 ksoftirqd/0
4 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0
5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H
6 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/u2:0
7 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kdevtmpfs
8 root 20 0 0 0 0 S 0.0 0.0 0:00.03 kworker/u2:1
26 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 writeback
28 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kworker/u2:2
171 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 crypto
173 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset
175 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kblockd
245 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kworker/0:1
326 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 rpciod
333 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kswapd0
334 root 20 0 0 0 0 S 0.0 0.0 0:00.00 fsnotify_mark
335 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 nfsiod
381 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset
TTN configuration
Once your LORIX is connected to your network and Internet, it's time to get TTN backend configuration working.
For this just stop the current LORIX cloud manager (default Loriot) with provided script clouds-manager.sh
admin@ttn-gw05:~ $ sudo /etc/init.d/clouds-manager.sh stop
Password:
Stopping cloud ttn... stopped /opt/lorix/clouds/ttn/poly_pkt_fwd (pid 909)
timeout during wait for stop
stopped /opt/lorix/clouds/ttn/poly_pkt_fwd (pid 909)
done.
admin@ttn-gw05:~ $ /etc/init.d/clouds-manager.sh configure
==========================================
| LORIX One clouds manager configuration |
==========================================
Actual configuration:
autostart=true
cloud=ttn
Do you want to enable autostart at boot time?
[Yes|No]
> Yes
Which cloud app. do you want to use ?
[loriot|packet-forwarder|ttn]
> ttn
New configuration:
autostart=true
cloud=ttn
admin@ttn-gw05:~ $ ^C
cd /opt/lorix/clouds/ttn/
admin@ttn-gw05:/opt/lorix/clouds/ttn $ cp EU_global_conf_2dBi_indoor.json global_conf.json
admin@ttn-gw05:~ $ cp local_conf.json local_conf.json.org
admin@ttn-gw05:~ $ nano cp local_conf.json
{
/* Put there parameters that are different for each gateway (eg. pointing one gateway to a test server while the others stay in production) */
/* Settings defined in global_conf will be overwritten by those in local_conf */
"gateway_conf": {
"gateway_ID": "0005fcc23d0de8bd",
"servers": [
{
"server_address": "router.eu.thethings.network",
"serv_port_up": 1700,
"serv_port_down": 1700,
"serv_enabled": true
}
],
"fake_gps": false,
"ref_latitude": 10,
"ref_longitude": 20,
"ref_altitude": -1,
"contact_email": "contact@ch2i.eu",
"description": "ch2i-gw05-lorixone"
}
}
I just changed my gateway__ID, contact_mail and description. My gateway ID is always the GW number (remember my hostname, ttn-gw05 so GW number 5). So ID are nnnnMACADDRESS where first 4 digits is GW number, and the other the MAC Address. It's my convention, you can leave default one if you want. It's just a matter on knowing and identify my gateways.
Oh, save back your config file, because any command opkg upgrade will reset to default (trust me I've done the error) by downloading new config file.
admin@ttn-gw05:~ $ cp local_conf.json local_conf.json.ch2i
admin@ttn-gw05:/opt/lorix/clouds/ttn $ sudo ./poly_pkt_fwd
Password:
*** 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 -164.000000, tx enabled 1
INFO: radio 1 enabled (type SX1257), center frequency 868500000, RSSI offset -164.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 FCC23DFFFE0DE8BD
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: 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 "LORIX One"
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 0005FCC23D0DE8BD
INFO: Found 1 servers in array.
INFO: Server 0 configured to "router.eu.thethings.network", with port up "1700" and port down "1700"
INFO: downstream keep-alive interval is configured to 60 seconds
INFO: statistics display interval is configured to 3600 seconds
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 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: 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 "contact@ch2i.eu"
INFO: Description configured to "ch2i-gw05-lorixone"
INFO: Successfully contacted server router.eu.thethings.network
INFO: [main] Starting the concentrator
INFO: [main] concentrator started, radio packets can now be received.
INFO: [down] Thread activated for all server router.eu.thethings.network
INFO: [up] Thread activated for all servers.
INFO: [down] for server router.eu.thethings.network PULL_ACK received in 32 ms
INFO: [up] PUSH_ACK for server router.eu.thethings.network received in 32 ms
^C
##### 2017-06-07 14:02:25 GMT #####
### [UPSTREAM] ###
# RF packets received by concentrator: 1
# CRC_OK: 100.00%, CRC_FAIL: 0.00%, NO_CRC: 0.00%
# RF packets forwarded: 1 (16 bytes)
# PUSH_DATA datagrams sent: 1 (233 bytes)
# PUSH_DATA acknowledged: 100.00%
### [DOWNSTREAM] ###
# PULL_DATA sent: 1 (100.00% acknowledged)
# PULL_RESP(onse) datagrams received: 0 (0 bytes)
# RF packets sent to concentrator: 0 (0 bytes)
# TX errors: 0
### [GPS] ###
# Invalid gps time reference (age: 1496844145 sec)
# Manual GPS coordinates: latitude 10.00000, longitude 20.00000, altitude -1 m
##### END #####
INFO: End of upstream thread
INFO: End of downstream thread for server 0.
INFO: concentrator stopped successfully
INFO: Exiting packet forwarder program
admin@ttn-gw05:/opt/lorix/clouds/ttn $
admin@ttn-gw05:/opt/lorix/clouds/ttn $ sudo reboot ; logout
Reference and pictures
On this Lab, I've not created anything, I just used excellent documentation provided by Wifx for LORIX One and of course my knowledge of old life IT manager work.
I shake all with my new TTN knowledge that is increasing everyday. and here it is.
Here are some reference for LORIX One:
Thanks also to TTN team, console is becoming better and better every day, love it and so LoraWan
Hope you enjoyed this tutorial, if you need any information or any consulting/installation service about IoT, LoraWan or just IT, just drop me a mail, I love travelling to meet and works with people with same passion.
Why this picture is auto rotated in the editor ?!?!