Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
LoRaWAN devices are supported with SmartServer 4.0 and higher; beta for SmartServer 4.0 and 4.1.
Info

For SmartServer Pi 4.2, see (Optional) Add a LoRaWAN Interface for SmartServer Pi (Release 4.2).

For SmartServer 4.1 and prior, see (Optional) Add a LoRaWAN Interface (Beta) (Release 4.1 and Prior).

You can use the SmartServer to integrate and manage LoRaWAN (Long Range Wide Area Network) devices.  LoRaWAN is a low power, wide area (LPWA) networking protocol designed to wirelessly connect battery (class A) and line-powered (class C) devices to a network providing bi-directional communication, end-to-end security, mobility, and localization services. The SmartServer LoRaWAN driver sends and receives data to and from LoRaWAN devices via a LoRa Network Server (LNS), which in the case of SmartServer 4.0 and higher is ChirpStack 4.2.

This section describes how to get started using LoRaWAN devices and consists of the following:

...

To set up and use LoRaWAN with the SmartServer, follow these steps:

  1. Acquire and configure a LoRaWAN Gateway as described on this page.

  2. Enable LoRaWAN and ChirpStack on your SmartServer as described on this page. With SmartServer IoT 4.2 and higher, the LoRaWAN driver is enabled by default and ChirpStack is not installed. With SmartServer Pi 4.2 and higher, the LoRaWAN driver and ChirpStack are disabled by default. 

  3. Optionally, change the LoRaWAN frequency settings, which default to European frequencies, to the region that matches your LoRa gateway and actual LoRa devices as described on this page.

  4. Import, or create a LoRaWAN device interface (XIF) and device type definition as described on this page. 

  5. Discover devices as described in Site Provisioning.

  6. Optionally, provide a BACnet interface for your LoRaWAN device; see Setting up the BACnet Server. This capability allows you to use a BACnet workstation with your LoRaWAN device.

...

  1. Open the SmartServer Configuration page as described in Accessing the SmartServer IoT Configuration Page. The Network tab appears as the default SmartServer IoT Configuration page. Once the network settings are configured for the SmartServer system, then the System tab will appear as the default.


    SmartServer IoT Network tab



    SmartServer IoT System tab


    For SmartServer Pi, open the SmartServer Configuration page as described in Accessing the SmartServer Pi Configuration Page. The Configuration page view that appears depends on your cache data. As needed, click the SmartServer IoT tab. T
    he System tab (top) will appear as the default as shown below.


    SmartServer Pi System tab

  2. Ensure that the SmartServer can access the internet by using the following command in an SSH session:

    Code Block
    ping google.com

    You should see a response similar to the following:

    Code Block
    apollo@smartserver-17qdkkc:~$ ping google.com
    PING google.com (142.250.179.238) 56(84) bytes of data.
    64 bytes from 142.250.179.238 (142.250.179.238): icmp_seq=1 ttl=114 time=47.9 ms
    64 bytes from 142.250.179.238 (142.250.179.238): icmp_seq=2 ttl=114 time=45.1 ms
    64 bytes from 142.250.179.238 (142.250.179.238): icmp_seq=3 ttl=114 time=41.5 ms
    64 bytes from 142.250.179.238 (142.250.179.238): icmp_seq=4 ttl=114 time=54.7 ms

    Enter CTRL-C to stop pinging. You should then see a summary similar to the following:

    Code Block
    --- google.com ping statistics ---
    4 packets transmitted, 4 received, 0% packet loss, time 7054ms
    rtt min/avg/max/mdev = 41.503/47.285/54.658/4.825 ms

    If there is an issue with internet access, then correct the problem as needed.

  3. Click the LoRaWAN tab. With SmartServer IoT 4.2 and higher, the LoRaWAN driver is enabled by default and ChirpStack is not installed. With SmartServer Pi 4.2 and higher, the LoRaWAN driver and ChirpStack are disabled by default.


    SmartServer IoT LoRaWAN driver is enabled and ChirpStack is not installed


    SmartServer Pi LoRaWAN driver and ChirpStack are disabled


    For SmartServer IoT, if the LoRaWAN driver has been disabled, then it will appear as shown below.


    SmartServer IoT LoRaWAN driver is disabled

  4. Select LoRaWAN Enabled if needed, and then click Update to save the configuration.


    SmartServer IoT LoRaWAN driver is enabled


    SmartServer Pi LoRaWAN driver is enabled

  5. For SmartServer IoT, click Install ChirpStack. The ChirpStack installation starts. This process may take up to 15 minutes, depending on internet speed. The installation will also add a collection of Device Profiles.


    SmartServer IoT ChirpStack is installing

    When the installation finishes, ChirpStack is running. The ChirpStack settings change allowing you to disable/enable ChirpStack as shown below.


    SmartServer IoT ChirpStack is installed and enabled

  6. For SmartServer Pi, select ChirpStack Enabled, and then click Update to save the configuration.


    SmartServer IoT ChirpStack is enabled

  7. Optionally, change the LoRaWAN frequency settings as described in the Changing the LoRaWAN Frequency Settings section below

(Optional) Changing the LoRaWAN Frequency Settings

The SmartServer LoRaWAN frequency settings default to European frequencies. For non-European, SmartServer LoRaWAN implementations, the frequency settings need to be changed to the region that matches your LoRa gateway and actual LoRa devices. These settings need to be changed in the SmartServer chirpstack-gateway-bridge.toml file and in the Device Profiles that are defined in ChirpStack. 

To change the LoRaWAN frequency settings, perform the following steps:

  1. Use an SCP or SFTP client tool (e.g., WinSCP) to copy the chirpstack-gateway-bridge.toml file to your local PC and save a backup. The chirpstack-gateway-bridge.toml file is found at /var/apollo/conf.d/chirpstack/chirpstack-gateway-bridge/chirpstack-gateway-bridge.toml. 

  2. Copy the original chirpstack-gateway-bridge.toml file and keep the same name.

  3. Modify the three topic templates listed under the [integration.mqtt] section shown below by replacing the eu868 region references with the region that matches your LoRa gateway and actual LoRa devices.

    Code Block
    [integration.mqtt]
    event_topic_template="eu868/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
    state_topic_template="eu868/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
    command_topic_template="eu868/gateway/{{ .GatewayID }}/command/#"

    Some LoRa regions, like the United States, support multiple, uplink sub-bands (8). In these cases, the region must also reference the actual uplink sub-band that is in use by the LoRaWAN gateway and the devices. Example: if you are using the SmartServer to interface to a LoRaWAN gateway and sensors in the United States using the LoRa 8-channel, uplink sub-band 0 (902.3 - 903.7), modify the topic templates in the chirpstack-gateway-bridge.toml file by changing eu868 to us915_0 as shown in the example below: 



    Default European frequency settings


    Modified United States frequency settings

  4. Save the modified chirpstack-gateway-bridge.toml file.
     

  5. Replace the chirpstack-gateway-bridge.toml file on the SmartServer with the modified file.

  6. Reboot the SmartServer IoT or Reboot the SmartServer Pi, or restart the SmartServer LoRaWAN driver by disabling it and then re-enabling it using the LoRaWAN Configuration page (described in the Enabling the LoRaWAN Driver and ChirpStack section). 

  7. Log into the ChirpStack administration page by entering http://<SmartServer IP address>:8080 in a web browser URL.

    Code Block
    titleExample
    http://10.0.1.21:8080

    The ChirpStack administration login page appears.




  8. Enter the login username / email and password (default is admin admin), and click Submit.

    The ChirpStack Dashboard appears.



    The ChirpStack installer, launched from the SmartServer's LoRaWAN Configuration page, pre-installs a collection of Device Profiles for the supported device types found here. Most of these installed Device Profiles specify the eu868 region by default. In order to use these pre-installed Device Profiles and their matching LoRaWAN device type packages (.dtp), which are files available from the SmartServer GitHub Repository, the Device Profiles' Region field has to be updated in ChirpStack to specify the appropriate region. The next step describes how to modify the Region field.

  9. Click the Device profiles tab on the left-side contents.



  10. Select the Device Profile that you want to modify by clicking on the name (i.e., Netvox_R712 in the example below) and use the Region field pull-down menu to select the appropriate region for your implementation (i.e., EU868 is changed to US915 in the example below).



  11. Click Submit to save the Device Profile changes.

    The Device Profile region setting is updated as shown for Netvox_R712 in the example below.

...