Search Results

Keyword: ‘packet forwarder’

Conduit AEP: Convert to Basic Packet Forwarder

January 22nd, 2016 Comments off

This section describes using LoRa Packet Forwarder Mode.

When forwarding packets to another Conduit be sure the receiving end has the firewall opened to receive incoming connections.

On the LoRaWAN > Network Settings page select PACKET FORWARDER Mode. Then click the Manual Configuration link to show the Config Card text boxes to enter global_conf.json file contents. Use the links to examples found below as a staring point for the manually configuring the Packet Forwarder.

MTAC-003 Packet Forwarder with mPower = 6.0.4

Be sure to include indenting spaces in your JSON file.

  • AP1
            "com_type": "SPI",
            "com_path": "/dev/spidev0.0",
            "tmp102": 72,
            "sx1261_conf": {
                "spi_path": "/dev/spidev0.1",
    
  • AP2
            "com_type": "SPI",
            "com_path": "/dev/spidev1.0",
            "tmp102": 73,
            "sx1261_conf": {
                "spi_path": "/dev/spidev1.1",
    
Dual Packet Forwarder with mPower = 6.0

The work-around used below must be removed. The proper links will be added by the init script.

Dual Packet Forwarder with mPower = 5.2.1

Dual packet forwarder with two MTAC-LORA-H cards is possible in the 5.2.1 update. Different Channel Plans and Network Servers can be configured for each card.
There was an error found in the script to add the spi_device path, adding a “gateway” object as shown with the correct path for each accessory port is the current workaround.

  • In the Config Card 1 and 2 text boxes replace the JSON line
    "gateway_conf": {
  • AP1
        "gateway": { "spi_device": "" },
        "gateway_conf": {
            "spi_device" : "/dev/spidev32766.2",
  • AP2
        "gateway": { "spi_device": "" },
        "gateway_conf": {
            "spi_device" : "/dev/spidev32765.2",

 

Global Config Examples

If you are using Cellular as WAN:

  • Before activating this mode, change the keep alive interval to 1 second within the Packet Forwarder application (keepalive_interval in the config file). This decreases the latency of packets over the radio enough to allow the return packet from the network server to get to the lora radio before its timestamp expires.
  • Excellent signal strength is also required to keep latency low enough for this mode to work.

To activate LoRa Packet Forwarder Mode:

  1. Under LoRaWAN > Network Settings,  select PACKET FORWARDER  under Mode. For details, see LoRaWAN Network Settings in the mPower Conduit Software Guide.
  2.  In the Config text field, enter the contents of your custom global_conf.json file.
  3. Verify that the text field contents match the proper json format. Click Submit.
    •  The GUI passes the .json file to the packet forwarder application.
    •  If successful, a message displays LoRa settings successfully updated.
    •  If the format is incorrect, a message displays Invalid JSON input.
Additional Examples

More settings are available to the packet forwarder configuration files. Settings for beaconing and LBT are not included in the above examples but are shown in the reference code repo. Please see these examples for addition reference.
Semtech Packet Forwarder Examples

 

AS923-Japan Settings for Packet Forwarder GUI
  • Enable LBT: checked
  • LBT RSSI Offset: -4 dB
  • LBT RSSI Target: -80 dBm
  • ScanTime: 5000 us
  • Auto LBT Channels: checked

 

For Conduits with GNSS module installed
AEP >= 1.7.4
  1. Using the GUI configuration gps will be enabled in packet forwarder modes if the hardware supports it
  2. Using manual mode configuration, set “gps”: true in global_conf.json “gateway_conf” section
AEP < 1.7.4

gpsd usage of the GPS is not compatible with lora-packet-forwarder. It is not possible to use the Multitech supplied Lora-Packet-Forwarder with the GNSS port, and GPSD at the same time.

  1. Edit /etc/default/gpsd
  2. Set Enabled=”no” and Save
  3. ntpd must be disabled or configured to not use gpsd
    • Edit /etc/default/ntpd, set Enabled=”no” and Save

    Or

    • Edit /etc/default/ntpd, set GPSD_REQUIRED=0 and Save
    • Configure NTP time server in /etc/ntp.conf
  4. Set “gps_tty_path”: “/dev/ttyXRUSB2” in global_conf.json “gateway_conf” section
  5. Reboot
For Geolocation v2.1 Conduits IP67
  • GPS data is available on /dev/gps0 and /dev/ttyXRUSB0
  • GPS antenna should be connected to port 3
  • Using UI configuration does not require setting the AES key, if MANUAL configuration is used follow the next steps
  • Generate AES key to unlock the fine timestamp using the hardware chip-id
    • $ sudo /opt/lora/lora-v21-keygen $(sudo /opt/lora/gateway-utils-geo/chip_id | grep -oe '0x.*' | sed -r 's/0x//g' | sed 'N;s/\\n/ /')
    • When running on command line be sure to use -g option to enable GPS
      $ ./pkt_forwarder -g

 

Packet Forwarder Configuration Options

Two sections are available in the configuration: radio settings (SX1301_conf) and server settings (gateway_conf).

SX1301_conf

  • lorawan_public – set sync word to false: 0x12 or true: 0x34
  • clksrc – must be 0 for Multitech gateway hardware
  • antenna_gain – configure the installed antenna gain if the network server sends EIRP value with downlinks. The Multitech network server will account for antenna gain before sending tx power to the forwarder.

Radios

The radio_0 and radio_1 settings configure the two front-end radios on the MTAC cards.
enable – true if radio is enabled for use

  • type – type of radio chip installed SX1257 or SX1255, frequency range differs
  • freq – center frequency the radio is configured to listen for packets
  • tx_enable – true if radio can be used for transmissions
  • tx_freq_min – minimum frequency to be allowed for transmissions
  • tx_freq_max – maximum frequency to be allowed for transmissions
  • rssi_offset – offset in dBm to adjust the radio RSSI reading

Channels

Eight channels can be configured to receive LoRa packets using 125 kHz bandwith. These channels are configured in the chan_multiSF_x settings. Each channel has an enable boolean, a selected radio and an intermediate frequency. The channel frequency will freq setting of the radio plus the if setting of the channel.

  • enable – true if this channel is enabled for use
  • radio – selected radio to listen for packets
  • if – intermediate frequency offset applied to the selected radio “freq” setting

Two additional channels can be configured with the chan_Lora_std and chan_FSK settings.

  • enable – true if this channel is enabled for use
  • radio – selected radio to listen for packets
  • if – intermediate frequency offset applied to the selected radio “freq” setting
  • bandwidth – channel bandwidth
  • spread_factor (LoRa) – channel spreading factor (7-12)
  • datarate (FSK) – channel datarate in bps

Look-up-table (LUT)

There are sixteen power settings that can be configured, these settings have been selected during calibration for each hardware. The power sent from the network server is looked up in this table by the rf_power setting. The corresponding pa_gain, mix_gain and dig_gain settings are then input into the radio for the transmission. These settings should not be adjusted.

gateway_conf

  • gateway_ID – gateway identifier sent in each message to the network server
  • server_address – address of the network server
  • serv_port_up – port for sending uplink packets to the network server
  • serv_port_down – port to communicate to receive downlink packet from the network server
  • keepalive_interval – interval to ping the network server
  • stat_interval – interval to send stat messages to the network server
  • push_timeout_ms – socket timeout when publishing messages to the network server
  • autoquit_threshold – number of keepalive messages without response to wait before quitting
  • forward_crc_valid – enable to forward valid packets to the network server, default: true
  • forward_crc_error – enable to forward CRC failed packets to the network server, default: true. The network server will reject packets with failed CRC, it may not be necessary to forward the packets except for a statistic of local RF quality or to monitor the gateway performance over time. Some random CRC failed packets are expected to be received from random noise.
  • forward_crc_disabled – enable to forward packets without CRC enabled to the network server, default: false. LoRaWAN protocol expects uplink packets to have CRC enabled.

Listen Before Talk configuration

Categories: Tags:

Conduit mLinux: Convert to Basic Packet Forwarder

October 13th, 2015 Comments off

For Conduit mLinux models

WARNING: This is only for people who need to disable the on-board LoRa network server for gateway only functionality. Most people should follow the general getting started guide.
When forwarding packets to another Conduit be sure the receiving end has the firewall opened to receive incoming connections.
A process monitor such as monit should be used to ensure the packet forwarder remains running in case of error. See Monit Instructions
SPI device paths with mPower >= 6.0.0
  • In the global_conf.json
  • AP1
        
        "gateway_conf": {
            "spi_device" : "/dev/spidev0.2",
  • AP2
        
        "gateway_conf": {
            "spi_device" : "/dev/spidev1.2",
SPI device paths with mPower = 5.2.1
  • In the global_conf.json
  • AP1
        
        "gateway_conf": {
            "spi_device" : "/dev/spidev32766.2",
  • AP2
        
        "gateway_conf": {
            "spi_device" : "/dev/spidev32765.2",

Links

Troubleshooting Help

Examples of global_conf.json

Copy one of the following to the /var/config/lora/ directory renamed as global_conf.json.

Enabling start-up on boot

$ update-rc.d lora-packet-forwarder defaults 80 30

Setting up the Conduit

mLinux >= 3.2.4

  1. /etc/init.d/lora-network-server stop
  2. Edit /etc/default/lora-network-server
  3. ENABLED=”no”
  4. Edit /etc/default/lora-packet-forwarder
  5. ENABLED=”yes”
  6. Copy global_conf.json to /var/config/lora/ directory
  7. Be sure to set “gateway_id” and server settings.
  8. If you need a value for “gateway_id” the lora card value can be used
    $ mts-io-sysfs show lora/eui
    00:80:00:00:00:00:00:97
  9. The colon separators must be removed 00:80:00:00:00:00:00:97 => 0080000000000097
  10. /etc/init.d/lora-packet-forwarder start
For Conduits with GNSS module installed

As of mLinux 4.1.6 the packet forwarder will get GPS data via libgpsd, set gps property to true.

  1. mLinux >= 4.1.6
    1. Set “gps”: “true” in global_conf.json “gateway_conf” section
    2. Reboot
  2. mLinux < 4.1.6
    gpsd usage of the GPS is not compatible with lora-packet-forwarder. It is not possible to use the Multitech supplied Lora-Packet-Forwarder with the GNSS port, and GPSD at the same time.

    1. Edit /etc/default/gpsd
    2. Set Enabled=”no” and Save
    3. ntpd must be disabled or configured to not use gpsd
      • Edit /etc/default/ntpd, set Enabled=”no” and Save

      Or

      • Edit /etc/default/ntpd, set GPSD_REQUIRED=0 and Save
      • Configure NTP time server in /etc/ntp.conf
    4. Set “gps_tty_path”: “/dev/ttyXRUSB2” in global_conf.json “gateway_conf” section
    5. Reboot
For Geolocation v2.1 Conduits IP67
  • GPS data is available on /dev/gps0 and /dev/ttyXRUSB0
  • GPS antenna should be connected to port 3
  • Generate AES key to unlock the fine timestamp using the hardware chip-id
    • $ sudo /opt/lora/lora-v21-keygen $(sudo /opt/lora/gateway-utils-geo/chip_id | grep -oe '0x.*' | sed -r 's/0x//g' | sed 'N;s/\\n/ /')

mLinux < 3.2.4

  1. Install the LoRa mCard. Refer to Installing an mCard Accessory Card.
  2. Attach the LoRa antenna to the LoRa mCard.
  3. Use the power cable to connect power to the Conduit and wait for the Conduit to boot up.
  4. Login to the console and configure the Conduit for internet access over Ethernet or cellular. Refer to Getting Started with mLinux if needed.
  5. Issue these commands on the Conduit:
    $ mkdir /var/config/lora
    $ cp /opt/lora/lora-network-server.conf.sample /var/config/lora/lora-network-server.conf
  6. Edit /var/config/lora/lora-network-server.conf and modify these settings as needed (use vi or nano).
    Field MTAC-LORA-915 (NA) MTAC-LORA-868 (EU)
    lora[“frequencyBand”]: “915” “868”
    lora[“channelPlan”]: “US915” or “AU915” “EU868”
    lora[“frequencySubBand”]: (integer: 1 to 8) Not applicable
    lora[“frequencyEU”]: Not applicable default: 869500000
    range: [863500000 – 867500000]
    and [869100000 – 869500000]
    network[“public”]: true
  7. Restart the network server. This will generate a configuration file for the packet forwarder.
    $ /etc/init.d/lora-network-server restart
  8. Copy the generated packet forwarder configuration to the config partition.
    $ cp /var/run/lora/1/global_conf.json /var/config/lora/global_conf.json
  9. Edit /var/config/lora/global_conf.json and modify these settings.
    Field Description Example
    gateway_conf[“server_address”]: Network IP or URL of your LoRa network server “lora.mydomain.com”
    gateway_conf[“serv_port_down”]: The LoRa network server’s downstream UDP port 1700
    gateway_conf[“serv_port_up”]: The LoRa network server’s upstream UDP port 1700

    *If you have mLinux firmware version 3.2.4 or greater, skip steps 10-12, and see below for further instructions.

  10. Edit /etc/init.d/lora-network-server as follows :
    • Comment out the Lora network server start code
      # start network server                  
      #start-stop-daemon --start --background --make-pidfile \
      #    --pidfile $net_server_pidfile --exec $net_server -- \
      #    -c $conf_file --lora-eui $lora_eui --lora-path $run_dir --db $conf_db \
      #    --noconsole -l $net_server_log                      
      #sleep 1
    • On line 65, change the -c option for packet forwarder from -c $run_dir to -c $conf_dir
      # start packet forwarder            
      start-stop-daemon --start --background --make-pidfile \
           --pidfile $pkt_fwd_pidfile --exec $pkt_fwd -- \
           -c $conf_dir -l $pkt_fwd_log           
      echo "OK"
    • Comment out the Lora network server stop code
      #start-stop-daemon --stop --quiet --oknodo --pidfile $net_server_pidfile --retry 15
      start-stop-daemon --stop --quiet --oknodo --pidfile $pkt_fwd_pidfile --retry 5
  11. Restart the packet forwarder.
    $ /etc/init.d/lora-network-server restart
  12. For debugging, you can view the packet forwarder log with this command:
    $ tail -f /var/log/lora-pkt-fwd.log

*If you have mLinux firmware version 3.2.4 or greater, continue with steps 13-16 after step 9  from above (If not, stop here after step #12. You are done.)

13. Stop the network server using this command:


nbsp;/etc/init.d/lora-network-server stop

14. Edit /etc/default/lora-network-server:

ENABLED ="no"

15. Edit /etc/default/lora-packet-forwarder:

ENABLED = "yes"

16. Start packet forwarder using this command:


nbsp;/etc/init.d/lora-packet-forwarder start

Setting Up the mDot Using Manual Join

  1. Establish a serial connection to the mDot
    1. Connect your PC to the DB9 serial connector on the UDK
    2. Open a terminal session using an application such as TeraTerm with baud rate 115,200
  2. Issue these commands:
    • AT+NJM=0 (manual join mode)
    • AT+PN=1 (public network mode)
    • AT+FSB=value (915 NA only | value = frequencySubBand from your Conduit)
    • AT+NSK=value (value = Network session key given by your network server operator)
    • AT+DSK=value (value = Data (application) session key for your application)
    • AT+NA=value (value = 4-byte device address)
    • AT&W (save settings)
    • ATZ (restart)
  3. Send data without requesting an ACK:
    • AT+ACK=0
    • AT+SEND=hello world

Troubleshooting

  • The packet forwarder starts but immediately stops
    • If /var/config/lora/global_conf.json is not in proper json format (extra or missing comma), the packet forwarder cannot run.

Packet Forwarder Configuration Options

Two sections are available in the configuration: radio settings (SX1301_conf) and server settings (gateway_conf).

SX1301_conf

  • lorawan_public – set sync word to false: 0x12 or true: 0x34
  • clksrc – must be 0 for Multitech gateway hardware
  • antenna_gain – configure the installed antenna gain if the network server sends EIRP value with downlinks. The Multitech network server will account for antenna gain before sending tx power to the forwarder.

Radios

The radio_0 and radio_1 settings configure the two front-end radios on the MTAC cards.
enable – true if radio is enabled for use

  • type – type of radio chip installed SX1257 or SX1255, frequency range differs
  • freq – center frequency the radio is configured to listen for packets
  • tx_enable – true if radio can be used for transmissions
  • tx_freq_min – minimum frequency to be allowed for transmissions
  • tx_freq_max – maximum frequency to be allowed for transmissions
  • rssi_offset – offset in dBm to adjust the radio RSSI reading

Channels

Eight channels can be configured to receive LoRa packets using 125 kHz bandwith. These channels are configured in the chan_multiSF_x settings. Each channel has an enable boolean, a selected radio and an intermediate frequency. The channel frequency will freq setting of the radio plus the if setting of the channel.

  • enable – true if this channel is enabled for use
  • radio – selected radio to listen for packets
  • if – intermediate frequency offset applied to the selected radio “freq” setting

Two additional channels can be configured with the chan_Lora_std and chan_FSK settings.

  • enable – true if this channel is enabled for use
  • radio – selected radio to listen for packets
  • if – intermediate frequency offset applied to the selected radio “freq” setting
  • bandwidth – channel bandwidth
  • spread_factor (LoRa) – channel spreading factor (7-12)
  • datarate (FSK) – channel datarate in bps

Look-up-table (LUT)

There are sixteen power settings that can be configured, these settings have been selected during calibration for each hardware. The power sent from the network server is looked up in this table by the rf_power setting. The corresponding pa_gain, mix_gain and dig_gain settings are then input into the radio for the transmission. These settings should not be adjusted.

gateway_conf

  • gateway_ID – gateway identifier sent in each message to the network server
  • server_address – address of the network server
  • serv_port_up – port for sending uplink packets to the network server
  • serv_port_down – port to communicate to receive downlink packet from the network server
  • keepalive_interval – interval to ping the network server
  • stat_interval – interval to send stat messages to the network server
  • push_timeout_ms – socket timeout when publishing messages to the network server
  • autoquit_threshold – number of keepalive messages without response to wait before quitting
  • forward_crc_valid – enable to forward valid packets to the network server, default: true
  • forward_crc_error – enable to forward CRC failed packets to the network server, default: true. The network server will reject packets with failed CRC, it may not be necessary to forward the packets except for a statistic of local RF quality or to monitor the gateway performance over time. Some random CRC failed packets are expected to be received from random noise.
  • forward_crc_disabled – enable to forward packets without CRC enabled to the network server, default: false. LoRaWAN protocol expects uplink packets to have CRC enabled.

Listen Before Talk configuration

Categories: Tags:

Upgrade LoRa Server & Packet Forwarder

August 11th, 2015 Comments off
The following procedure applies only to the MTCDT-xx-210L model.

 

Upgrade Instructions

  1. Download the latest packages from the Downloads page
  2. Copy both packages to the Conduit® using SCP or an alternative
  3. Install using the opkg package manager (be sure to use the downloaded package names)
    $ opkg install lora-packet-forwarder_*.ipk
    $ opkg install lora-network-server_*.ipk
  4. Compare /var/config/lora/lora-network-server.conf to the new sample conf at /opt/lora/lora-network-server.conf.sample and update your configuration as needed

 

View Installed Versions

$ opkg list | grep lora
Categories: Tags:

Configure monit for pppd and lora-packet-forwarder

September 12th, 2017 Comments off

NOTE: With regards to ppp connections and lora-packet-forwarder, carriers can log off PPP at any time. Monit reconnects PPP and restarts lora-packet-forwarder for you automatically.

Install monit

If you have an internet connection:

# opkg install monit
Package monit (5.12.2-r1.0) installed in root is up to date.

Otherwise download monit, and install it on your system:

# opkg install monit_5.12.2-r1.0_arm926ejste.ipk

General configuration of monit

Set up monit to start on boot:

# sed -i 's/="no"/="yes"/' /etc/default/monit
# grep ENA monit 
ENABLED="yes"

Configure status monitor

You do not need to set up the addresses for monit, if you do not wish to monitor anything manually. This may be helpful in testing and setting up monit. Operating a web browser on Conduit® is not supported. Using localhost is not helpful without some kind of IP forwarding (not covered here). In file /etc/monitrc, you  configure a userid and password for monit:

# cd /etc
# sed -i 's/admin:monit/admin:mtech2205/' monitrc
# grep mtech monitrc
    allow admin:mtech2205      # require user 'admin' with password 'monit'

Now listen on all local addresses (or it could be the address range of the PC’s running a web browser):

# sed -i 's?allow localhost?allow 0.0.0.0/0.0.0.0?' monitrc
# grep -B4  admin monitrc
#
set httpd port 2812 and
    use address localhost  # only accept connection from localhost
    allow 0.0.0.0/0.0.0.0        # allow localhost to connect to the server and
    allow admin:mtech2205      # require user 'admin' with password 'monit'

Now set the local address for the bind. This could be a fixed address used by the device:

# ip addr show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:08:00:4a:1a:30 brd ff:ff:ff:ff:ff:ff
    inet 172.16.1.130/16 brd 172.16.255.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::208:ff:fe4a:1a30/64 scope link 
       valid_lft forever preferred_lft forever
#

Use the 172.16.1.130 above or the address 0.0.0.0 if there are multiple home addresses (for instance ethernet and ppp).

# sed -i 's/use address localhost/use address 0.0.0.0/' monitrc 
# grep -B4  admin monitrc
#
set httpd port 2812 and
    use address 0.0.0.0  # only accept connection from localhost
    0.0.0.0/0.0.0.0        # allow localhost to connect to the server and
    allow admin:mtech2205      # require user 'admin' with password 'monit'

This may be tested with monit -t:

# monit -t
Cannot translate 'jaktest1' to FQDN name -- Name or service not known
Control file syntax OK

The error occurs because the hostname is not in the /etc/hosts file. Add the hostname as follows (substituting your own IP address):

# echo 172.16.1.130  $(uname -n) >>/etc/hosts

Now create the configuration for the services. To make it easier, start a service to be monitored.

Stop and Start Monit

# /etc/init.d/monit stop
Stopping monit
No daemon process found
# /etc/init.d/monit start
Starting monit
Starting Monit 5.12.2 daemon with http interface at [0.0.0.0]:2812

Verify Monit is Running

Connect to the device by using a browser. Use the following:

http://[Conduit IP address]:2812

In this example:

http://172.16.1.130:2812/

At the login screen, enter the userid and password that was configured earlier in file monitrc.

Note that you are logged in until you exit the browser. There is no logout. This is what you see after you log in.

Configure the status monitor

Normally you will configure the status monitor based on a PID file found in the /run directory. For ppp there are two identical pid files. You may create the configuration file with an editor of your choice.

# cd /run
# ls *ppp*.pid
ppp-ppp0.pid  ppp0.pid

Configure ppp as follows:

# cd /etc/monit.d
# cat >ppp
check process ppp0 with pidfile /run/ppp0.pid
program start = "/etc/init.d/ppp start"
program stop = "/etc/init.d/ppp stop"
<ctrl-d>
# monit -t
Control file syntax OK

To set up lora-packet-forwarder:

# cd /run/lora
# ls
1                       lora-network-server.db  lora-pkt-fwd-1.pid

We must now use the packet forwarder PID in the monit configuration file:

# cd /etc/monit.d
# cat >lora-packet-forwarder
check process lora-pkt-fwd-1 with pidfile /run/lora/lora-pkt-fwd-1.pid
program start = "/etc/init.d/lora-packet-forwarder start"
program stop = "/etc/init.d/lora-packet-forwarder stop"
<ctrl-d>
# monit -t                                                                                                                                                                    
Control file syntax OK
Now restart monit
# /etc/init.d/monit stop
Stopping monit
Monit daemon with pid [730] killed
# /etc/init.d/monit start
Starting monit
Starting Monit 5.12.2 daemon with http interface at [0.0.0.0]:2812

Check status from a web browser

Use the following:

http://[Conduit IP addreess]:2812

Here is an example monitor screen:

Example /var/log/messages after PPP failure and Restart

Sep 12 08:05:01 jaktest1 authpriv.info CROND[1636]: pam_unix(crond:session): session closed for user root                                                            
Sep 12 08:09:56 jaktest1 daemon.info pppd[1590]: Hangup (SIGHUP)                                                                                                     
Sep 12 08:09:56 jaktest1 daemon.notice pppd[1590]: Modem hangup                                                                                                      
Sep 12 08:09:56 jaktest1 daemon.info pppd[1590]: Connect time 60.7 minutes.                                                                                          
Sep 12 08:09:56 jaktest1 daemon.info pppd[1590]: Sent 0 bytes, received 0 bytes.                                                                                     
Sep 12 08:09:56 jaktest1 daemon.notice pppd[1590]: restoring old default route to eth0 [172.16.0.1]                                                                  
Sep 12 08:09:56 jaktest1 daemon.notice pppd[1590]: Connection terminated.                                                                                            
Sep 12 08:09:56 jaktest1 daemon.info pppd[1590]: Exit.                                                                                                               
Sep 12 08:09:58 jaktest1 daemon.info ntpd[787]: Deleting interface #18 ppp0, 100.179.160.4#123, interface stats: received=0, sent=0, dropped=0, active_time=3638 secs
Sep 12 08:09:58 jaktest1 daemon.info ntpd[787]: peers refreshed                                                     
Sep 12 08:10:00 jaktest1 daemon.err monit[743]: 'ppp0' process is not running                                       
Sep 12 08:10:00 jaktest1 daemon.info monit[743]: 'ppp0' trying to restart                                           
Sep 12 08:10:00 jaktest1 daemon.info monit[743]: 'ppp0' start: /etc/init.d/ppp                                      
Sep 12 08:10:00 jaktest1 user.notice root: timeout is 60                                                            
Sep 12 08:10:00 jaktest1 user.notice root: Starting up PPP link: pppd                                               
Sep 12 08:10:00 jaktest1 user.notice root: ppp_on_boot                                                              
Sep 12 08:10:00 jaktest1 daemon.notice pppd[1657]: pppd 2.4.7 started by root, uid 0
Categories: Tags:

Update to lora-packet-forwarder

May 24th, 2017 Comments off

An updated package is available for download.
This package includes an new init.d script to create symlinks to the correct packet forwarder binary based off installed MTAC-LORA hardware product and version information.

Note: Installing this packet will reset the /etc/default/lora-packet-forwarder setting to disabled.
This update is needed for mLinux 3.3.6+ installations configured in packet forwarder mode.
https://www.multitech.net/developer/software/lora/conduit-mlinux-convert-to-basic-packet-forwarder/

AEP packet forwarder mode configured through the GUI is not affected.

http://www.multitech.net/downloads/lora-packet-forwarder_3.1.0-r9.1_mtcdt.ipk

MTAC-003 (LoRa 3) Card

June 23rd, 2022 Comments off

The MTAC-003 gateway accessory card enables long range connectivity to distributed assets and sensors using the latest RF spread spectrum (LoRa) technology by Semtech®.

The accessory card features include:

  • Network-based geolocation using time difference of arrival (TDOA) and fine timestamping (requires gateway with GPS receiver and GPS antenna)
  • Improved coverage in dense LoRa networks
  • ISM band scanning and asset management range with LoRa of up to 10 miles/15 km line of sight or 1-3 miles/2 km through buildings
  • Listen Before Talk (LBT) capability
  • Bi-directional communications from thousands of MultiTech RevealTM LoRaWAN Wireless IoT Sensors or mDotTM or xDotTM long-range RF modules to a single Conduit®

SPI Paths for MTAC-003

  • AP1
    • Sx1303: /dev/spidev0.0
    • Sx1262: /dev/spidev0.1
  • AP2
    • Sx1303: /dev/spidev1.0
    • Sx1262: /dev/spidev1.1

Links

Categories: Tags:

MTAC-LORA-2G4-3

June 9th, 2020 Comments off

The MTAC-LORA-2G4-3 card provides support for 2.4G LoRa devices.

Since mPower 5.2.1 the MTAC-LORA-2G4-3 card can be used in Network Server and Packet forwarder modes.

mPower 5.2.1 Update

The final release from Semtech was shortly after our mPower 5.2.1 release.

    1. MCU version needs to be 1.0.1
      https://github.com/Lora-net/gateway_2g4_hal
      https://github.com/Lora-net/gateway_2g4_hal/mcu_bin
    2. To update the MCU firmware download the MCU 1.0.1 firmware from the above repo and copy the file to the conduit.
      $ sudo /etc/init.d/lora-network-server stop 
      $ wget https://github.com/Lora-net/gateway_2g4_hal/raw/master/mcu_bin/rlz_fwm_gtw_2g4_01.00.01.bin
      $ sudo /opt/lora/mcu-2g4-boot ON 
      $ sudo dfu-util -a 0 -s 0x08000000:leave -t 0 -D rlz_fwm_gtw_2g4_01.00.01.bin
    3. Packet forwarder should be updated to 1.0.1
      https://www.multitech.net/developer/downloads/
      http://www.multitech.net/downloads/lora-gateway-2g4_1.0.1-r2.0_arm926ejste.ipk
    4. To update the packet forwarder copy the ipk from the link above to the conduit
$ wget http://www.multitech.net/downloads/lora-gateway-2g4_1.0.1-r2.0_arm926ejste.ipk
$ sudo opkg install lora-gateway-2g4_1.0.1-r2.0_arm926ejste.ipk
$ cd /var/run/lora/1/
$ sudo ./lora_pkt_fwd
*** Packet Forwarder 2.4Ghz***
Version: 1.0.0
*** HAL library version info ***
Version: 1.0.0;
***
INFO: Little endian host
INFO: found configuration file global_conf.json, parsing it
INFO: global_conf.json does contain a JSON object named radio_conf, parsing radio parameters
INFO: tty_path /dev/ttyACM0
INFO: antenna_gain 0 dBi
INFO: LoRa sync_word 0x21 (public)
INFO: channel 0 enabled: frequency 2403000000, bandwidth 812000Hz, SF12, RSSI offset 0.0
INFO: channel 1 enabled: frequency 2425000000, bandwidth 812000Hz, SF12, RSSI offset 0.0
INFO: channel 2 enabled: frequency 2479000000, bandwidth 812000Hz, SF12, RSSI offset 0.0
INFO: TX enabled, freq min 2400000000Hz, freq max 2500000000Hz
INFO: global_conf.json does contain a JSON object named gateway_conf, parsing gateway parameters
INFO: gateway MAC address is configured to 0008000000000206
INFO: server hostname or IP address is configured to "127.0.0.1"
INFO: upstream port is configured to "1780"
INFO: downstream port is configured to "1782"
INFO: downstream keep-alive interval is configured to 10 seconds
INFO: statistics display interval is configured to 20 seconds
INFO: upstream PUSH_DATA time-out is configured to 120 ms
INFO: packets received with a valid CRC will be forwarded
INFO: packets received with a CRC error will be forwarded
INFO: packets received with no CRC will NOT be forwarded
INFO: Auto-quit after 10 non-acknowledged PULL_DATA
INFO: Concentrator MCU version is V01.00.01
INFO: Configuring RX channel 1 => freq:2425000000 sf:12 bw:800khz
INFO: Configuring RX channel 2 => freq:2479000000 sf:12 bw:800khz
INFO: Configuring RX channel 0 => freq:2403000000 sf:12 bw:800khz
INFO: [main] concentrator started, packet can now be received
INFO: concentrator EUI: 0x6f347a3917513834

CTRL-C to stop
$ sudo /etc/init.d/lora-network-server start

Channel Configuration

The MTAC-LORA-2G4-3 supports three channels using a single datarate at 812 kHz bandwidth . A new coding rate, “4/7LI”, is used.

Packet Forwarder Global Config

global_conf.json.2g4

Uplink JSON

{
	"rxpk": [{
		"jver": 1,
		"tmst": 402866437,
		"chan": 2,
		"freq": 2425.000000,
		"foff": 265,
		"stat": 1,
		"modu": "LORA",
		"datr": "SF12BW812",
		"codr": "4/7LI",
		"lsnr": -3.0,
		"rssi": -105,
		"size": 23,
		"data": "AAAAANB+1bNwExGZEQAAgAARAMLVDq4="
	}]
}

Downlink JSON

{
	"txpk": {
		"codr": "4/7LI",
		"data": "IMw+Dwc9QaSJi7Mfi7ns2TIbutmOSs1r22RedVkreJFz",
		"datr": "SF12BW812",
		"freq": 2425,
		"ipol": true,
		"modu": "LORA",
		"ncrc": true,
		"powe": 7,
		"rfch": 0,
		"size": 33,
		"tmst": 38604060
	}
}
Categories: Tags:

Running Basic Station on Conduit

February 26th, 2020 Comments off

Code base and documentation

 

Hardware Requirements

To use basic station an MTCAP or MTCDT with MTAC-LORA-H mCard is required. The Basic Station does not support the MTAC-LORA-1.0 USB cards.
mPower 5.3 includes UI configuration and basic station packages

 

Connecting to Actility

TLS certs and keys will be downloaded from Actility when Basic Station connects. These files need to be stored in persistent FLASH to be restored after reboot. The firmware mPower 6.3.2 or greater is needed to persist these files. There is a known issue with mPower 6.3.1 where some of these files were being overwritten on reboot.

 

Connecting to TTN

TTN Basic Station Instructions for Conduit

Logging

The JSON station configuration file has options to enable logging files, level and rotation

https://doc.sm.tc/station/conf.html#logging-setup

The following settings can be used for maximum debugging and rely on the system logrotate process to correctly rotate and gzip files. The Basic Station built-in rotate mechanism does not keep a chronological record over multiple rotate files or compress rotated logs.

 “log_file”: “/var/log/lora-station.log”,
“log_level”: “XDEBUG”,
“log_size”: 1000000,
“log_rotate”: 0,

GPS PPS Settings

On MTCDT, MTCAP and MTCAP3 units without GPS hardware can disable PPS sync to reduce log messages for failed timesync with PPS.

{
“SX1301_conf”: {
“lorawan_public”: true,
“clksrc”: 0,
“pps”: false,

Beaconing Settings

Beaconing parameters should come from the LNS. Since the gateway is configured at the LNS for a specific channel plan, the LNS should be setting the gateway beacon.

TTN supports basic station beaconing since 2022.
https://www.thethingsnetwork.org/forum/t/upgrade-to-the-things-network-v3-21-2-completed/58810

 

Beacon settings can be provided by the LNS in the router_config or default settings can be provided in the station.conf file place the bcning field into the station_conf section.

The bcning field is either None or a BCNCONF object with the following layout:

{
  "DR"    : INT
  "layout": [INT,INT,INT]
  "freqs":  [ INT, .. ]
}

The layout field specifies the octet offsets for insertion of the message fields Time and GwSpecific, followed by the length of the beacom PDU.

// Pack parameters into a BEACON pdu with the following layout:
//    | 0-n |       4    |  2  |     1    |  3  |  3  | 0-n |  2  |   bytes – all fields little endian
//    | RFU | epoch_secs | CRC | infoDesc | lat | lon | RFU | CRC |
//
void s2e_make_beacon (uint8_t* layout, sL_t epoch_secs, int infodesc, double lat, double lon, uint8_t* pdu) {
    int time_off     = layout[0];
    int infodesc_off = layout[1];
    int bcn_len      = layout[2];

Beacon Frame Format is found in the LoRaWAN 1.0.4 Specification

LoRaWAN® 1.0.4 Specification Package

Layout settings for each spreading factor:

  • SF8 – [ 1, 7, 19 ]
  • SF9 – [ 2, 8, 17 ]
  • SF10 – [ 3, 9, 19 ]
  • SF11 – [ 4, 10, 21 ]
  • SF12 – [ 5, 11, 23 ]

Credentials

Select LNS or CUPS depending on server requirements. The LNS protocol will downlink the channel plan from a server. The CUPS protocol and redirect the station process to a network server end-point.

Connecting to TTN Community v3

TTN Instructions

https://nam1.cloud.thethings.network/console
https://eu1.cloud.thethings.network/console
https://au1.cloud.thethings.network/console

https://www.thethingsindustries.com/docs/gateways/lora-basics-station/cups/
https://thethingsindustries.com/docs/gateways/multitechconduit/lbs/

Certificate Information

https://www.thethingsindustries.com/docs/reference/root-certificates/

CUPS

https://nam1.cloud.thethings.network:443
https://eu1.cloud.thethings.network:443
https://au1.cloud.thethings.network:443

Use the following command to view the certificate used by the server.

openssl s_client -showcerts -servername eu1.cloud.thethings.industries -connect eu1.cloud.thethings.industries:443
-----BEGIN CERTIFICATE-----
MIIEZTCCA02gAwIBAgIQQAF1BIMUpMghjISpDBbN3zANBgkqhkiG9w0BAQsFADA/
MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT
DkRTVCBSb290IENBIFgzMB4XDTIwMTAwNzE5MjE0MFoXDTIxMDkyOTE5MjE0MFow
MjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUxldCdzIEVuY3J5cHQxCzAJBgNVBAMT
AlIzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuwIVKMz2oJTTDxLs
jVWSw/iC8ZmmekKIp10mqrUrucVMsa+Oa/l1yKPXD0eUFFU1V4yeqKI5GfWCPEKp
Tm71O8Mu243AsFzzWTjn7c9p8FoLG77AlCQlh/o3cbMT5xys4Zvv2+Q7RVJFlqnB
U840yFLuta7tj95gcOKlVKu2bQ6XpUA0ayvTvGbrZjR8+muLj1cpmfgwF126cm/7
gcWt0oZYPRfH5wm78Sv3htzB2nFd1EbjzK0lwYi8YGd1ZrPxGPeiXOZT/zqItkel
/xMY6pgJdz+dU/nPAeX1pnAXFK9jpP+Zs5Od3FOnBv5IhR2haa4ldbsTzFID9e1R
oYvbFQIDAQABo4IBaDCCAWQwEgYDVR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8E
BAMCAYYwSwYIKwYBBQUHAQEEPzA9MDsGCCsGAQUFBzAChi9odHRwOi8vYXBwcy5p
ZGVudHJ1c3QuY29tL3Jvb3RzL2RzdHJvb3RjYXgzLnA3YzAfBgNVHSMEGDAWgBTE
p7Gkeyxx+tvhS5B1/8QVYIWJEDBUBgNVHSAETTBLMAgGBmeBDAECATA/BgsrBgEE
AYLfEwEBATAwMC4GCCsGAQUFBwIBFiJodHRwOi8vY3BzLnJvb3QteDEubGV0c2Vu
Y3J5cHQub3JnMDwGA1UdHwQ1MDMwMaAvoC2GK2h0dHA6Ly9jcmwuaWRlbnRydXN0
LmNvbS9EU1RST09UQ0FYM0NSTC5jcmwwHQYDVR0OBBYEFBQusxe3WFbLrlAJQOYf
r52LFMLGMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjANBgkqhkiG9w0B
AQsFAAOCAQEA2UzgyfWEiDcx27sT4rP8i2tiEmxYt0l+PAK3qB8oYevO4C5z70kH
ejWEHx2taPDY/laBL21/WKZuNTYQHHPD5b1tXgHXbnL7KqC401dk5VvCadTQsvd8
S8MXjohyc9z9/G2948kLjmE6Flh9dDYrVYA9x2O+hEPGOaEOa1eePynBgPayvUfL
qjBstzLhWVQLGAkXXmNs+5ZnPBxzDJOLxhF2JIbeQAcH5H0tZrUlo5ZYyOqA7s9p
O5b85o3AM/OJ+CktFBQtfvBhcJVd9wvlwPsk+uyOy2HI7mNxKKgsBTt375teA2Tw
UdHkhVNcsAKX1H7GNNLOEADksd86wuoXvg==
-----END CERTIFICATE-----

Using CUPS requires creating two API keys for your gateway. The LNS lbs-lns-secret key will be sent to the gateway over the CUPS protocol. The CUPS key will authenticate the gateway when negotiating the CUPS connection.

Creating API keys for CUPS

URI

Set the URI field to point to a network, in this example a TTI private instance is used.

Connecting to TTN Community

Replace “nam1” with “au1”, “eu1” for the desired region.

wss://nam1.cloud.thethings.network:8887

Station Conf

The default station configuration can be used as the network will configure the channels based on the selected channel plan in the TTI configuration.

Server Certificate

TTN Community certificates

https://www.thethingsindustries.com/docs/reference/root-certificates/

Replace “nam1” with “au1” or “eu1” for the desired region.

openssl s_client -showcerts -servername nam1.cloud.thethings.network -connect nam1.cloud.thethings.network:8887

Use the second certificate output by the open ssl command

-----BEGIN CERTIFICATE-----
MIIFFjCCAv6gAwIBAgIRAJErCErPDBinU/bWLiWnX1owDQYJKoZIhvcNAQELBQAw
TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMjAwOTA0MDAwMDAw
WhcNMjUwOTE1MTYwMDAwWjAyMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNTGV0J3Mg
RW5jcnlwdDELMAkGA1UEAxMCUjMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
AoIBAQC7AhUozPaglNMPEuyNVZLD+ILxmaZ6QoinXSaqtSu5xUyxr45r+XXIo9cP
R5QUVTVXjJ6oojkZ9YI8QqlObvU7wy7bjcCwXPNZOOftz2nwWgsbvsCUJCWH+jdx
sxPnHKzhm+/b5DtFUkWWqcFTzjTIUu61ru2P3mBw4qVUq7ZtDpelQDRrK9O8Zutm
NHz6a4uPVymZ+DAXXbpyb/uBxa3Shlg9F8fnCbvxK/eG3MHacV3URuPMrSXBiLxg
Z3Vms/EY96Jc5lP/Ooi2R6X/ExjqmAl3P51T+c8B5fWmcBcUr2Ok/5mzk53cU6cG
/kiFHaFpriV1uxPMUgP17VGhi9sVAgMBAAGjggEIMIIBBDAOBgNVHQ8BAf8EBAMC
AYYwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMBMBIGA1UdEwEB/wQIMAYB
Af8CAQAwHQYDVR0OBBYEFBQusxe3WFbLrlAJQOYfr52LFMLGMB8GA1UdIwQYMBaA
FHm0WeZ7tuXkAXOACIjIGlj26ZtuMDIGCCsGAQUFBwEBBCYwJDAiBggrBgEFBQcw
AoYWaHR0cDovL3gxLmkubGVuY3Iub3JnLzAnBgNVHR8EIDAeMBygGqAYhhZodHRw
Oi8veDEuYy5sZW5jci5vcmcvMCIGA1UdIAQbMBkwCAYGZ4EMAQIBMA0GCysGAQQB
gt8TAQEBMA0GCSqGSIb3DQEBCwUAA4ICAQCFyk5HPqP3hUSFvNVneLKYY611TR6W
PTNlclQtgaDqw+34IL9fzLdwALduO/ZelN7kIJ+m74uyA+eitRY8kc607TkC53wl
ikfmZW4/RvTZ8M6UK+5UzhK8jCdLuMGYL6KvzXGRSgi3yLgjewQtCPkIVz6D2QQz
CkcheAmCJ8MqyJu5zlzyZMjAvnnAT45tRAxekrsu94sQ4egdRCnbWSDtY7kh+BIm
lJNXoB1lBMEKIq4QDUOXoRgffuDghje1WrG9ML+Hbisq/yFOGwXD9RiX8F6sw6W4
avAuvDszue5L3sz85K+EC4Y/wFVDNvZo4TYXao6Z0f+lQKc0t8DQYzk1OXVu8rp2
yJMC6alLbBfODALZvYH7n7do1AZls4I9d1P4jnkDrQoxB3UqQ9hVl3LEKQ73xF1O
yK5GhDDX8oVfGKF5u+decIsH4YaTw7mP3GFxJSqv3+0lUFJoi5Lc5da149p90Ids
hCExroL1+7mryIkXPeFM5TgO9r0rvZaBFOvV2z0gp35Z0+L4WPlbuEjN/lxPFin+
HlUjr8gRsI3qfJOQFy/9rKIJR0Y/8Omwt/8oTWgy1mdeHmmjk7j1nYsvC9JSQ6Zv
MldlTTKB3zhThV1+XWYp6rjd5JW1zbVWEkLNxE7GJThEUG3szgBVGP7pSWTUTsqX
nLRbwHOoq7hHwg==
-----END CERTIFICATE-----

Gateway Certificate

If a TLS client cert is required to connect to the server provide a certificate. Otherwise leave this field blank for connecting to TTN v3.

Gateway Key

The Gateway Key can be used to populate the authorization header field or be a TLS client key depending on connection method. The Gateway Key needs to be formatted correctly to be used. In The Things Industries v3 GUI, create an API Key with Link as Gateway permissions and copy the key to the text box preceded by “Authorization: ”

Creating the Gateway key for LNS

Authorization: NNSXS.XXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

TTN Community gateway key

Currently the TTN Community servers to not authenticate the gateway key. Any value can be set, the file needs have proper contents to allow parsing by the basic station daemon.

Authorization: NNSXS.XXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Click Save and Apply and the station will be started.

Troubleshooting

If there are issues and the station needs to be run manually, you can ssh into the gateway and issue these commands to see output. The station.conf logging feature can also be used to get messages to find any issue details.

$ /etc/init.d/lora-networks-server stop
$ cd /var/run/lora/1
$ sudo ./station

 

Installation on MTCDT/MTCAP

Install the Basic Station from downloads.

$ sudo -s
# wget http://www.multitech.net/downloads/lora-basic-station_2.0.3-r1.0_arm926ejste.ipk
# opkg install lora-basic-station_2.0.3-r1.0_arm926ejste.ipk

The /opt/lora/station binary will be installed.

Basic Station to Packet Forwarder

This example python script shows how to send a channel configuration to the connection basic station gateway. It is useful for getting started and ensuring the gateway is functioning.
Basic Station Examples

TTI Configuration

The Things Industries provide private server instances that Basic Station can connect to. Visit TTI for details.

tc.uri

wss://<ORG>.<REGION>.cloud.thethings.industries:8887
wss://multitech.eu1.cloud.thethings.industries:8887

tc.key – Gateway Token

The tc.key file needs to be formatted correctly to be used and can be created with this command. In The Things Industries v3 GUI, create an API Key with Link as Gateway permissions and copy the key to the tc.key file.

echo -en "Authorization: NNSXS.XXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\r\n" > tc.key

tc.trust

Use the following command to view the certificate used by the server.

openssl s_client -showcerts -servername multitech.eu1.cloud.thethings.industries -connect multitech.eu1.cloud.thethings.industries:8887
-----BEGIN CERTIFICATE-----
MIIEkjCCA3qgAwIBAgIQCgFBQgAAAVOFc2oLheynCDANBgkqhkiG9w0BAQsFADA/
MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT
DkRTVCBSb290IENBIFgzMB4XDTE2MDMxNzE2NDA0NloXDTIxMDMxNzE2NDA0Nlow
SjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUxldCdzIEVuY3J5cHQxIzAhBgNVBAMT
GkxldCdzIEVuY3J5cHQgQXV0aG9yaXR5IFgzMIIBIjANBgkqhkiG9w0BAQEFAAOC
AQ8AMIIBCgKCAQEAnNMM8FrlLke3cl03g7NoYzDq1zUmGSXhvb418XCSL7e4S0EF
q6meNQhY7LEqxGiHC6PjdeTm86dicbp5gWAf15Gan/PQeGdxyGkOlZHP/uaZ6WA8
SMx+yk13EiSdRxta67nsHjcAHJyse6cF6s5K671B5TaYucv9bTyWaN8jKkKQDIZ0
Z8h/pZq4UmEUEz9l6YKHy9v6Dlb2honzhT+Xhq+w3Brvaw2VFn3EK6BlspkENnWA
a6xK8xuQSXgvopZPKiAlKQTGdMDQMc2PMTiVFrqoM7hD8bEfwzB/onkxEz0tNvjj
/PIzark5McWvxI0NHWQWM6r6hCm21AvA2H3DkwIDAQABo4IBfTCCAXkwEgYDVR0T
AQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAYYwfwYIKwYBBQUHAQEEczBxMDIG
CCsGAQUFBzABhiZodHRwOi8vaXNyZy50cnVzdGlkLm9jc3AuaWRlbnRydXN0LmNv
bTA7BggrBgEFBQcwAoYvaHR0cDovL2FwcHMuaWRlbnRydXN0LmNvbS9yb290cy9k
c3Ryb290Y2F4My5wN2MwHwYDVR0jBBgwFoAUxKexpHsscfrb4UuQdf/EFWCFiRAw
VAYDVR0gBE0wSzAIBgZngQwBAgEwPwYLKwYBBAGC3xMBAQEwMDAuBggrBgEFBQcC
ARYiaHR0cDovL2Nwcy5yb290LXgxLmxldHNlbmNyeXB0Lm9yZzA8BgNVHR8ENTAz
MDGgL6AthitodHRwOi8vY3JsLmlkZW50cnVzdC5jb20vRFNUUk9PVENBWDNDUkwu
Y3JsMB0GA1UdDgQWBBSoSmpjBH3duubRObemRWXv86jsoTANBgkqhkiG9w0BAQsF
AAOCAQEA3TPXEfNjWDjdGBX7CVW+dla5cEilaUcne8IkCJLxWh9KEik3JHRRHGJo
uM2VcGfl96S8TihRzZvoroed6ti6WqEBmtzw3Wodatg+VyOeph4EYpr/1wXKtx8/
wApIvJSwtmVi4MFU5aMqrSDE6ea73Mj2tcMyo5jMd6jmeWUHK8so/joWUoHOUgwu
X4Po1QYz+3dszkDqMp4fklxBwXRsW10KXzPMTZ+sOPAveyxindmjkW8lGy+QsRlG
PfZ+G6Z6h7mjem0Y+iWlkYcV4PIWL1iwBi8saCbGS5jN2p8M+X+Q7UNKEkROb3N6
KOqkqm57TH2H3eDJAkSnh6/DNFu0Qg==
-----END CERTIFICATE-----

 

Configuration files

  • Adjust the station.conf file for the desired frequencies, see examples.Download station.confUse the routerid and euiprefix fields to assign the Gateway EUI.
    See Basic Station Doc for EUI.
  • Configure tc.uri to point to the network server web socket port
    ws://192.168.52.72:6090
  • For secure web sockets use wss and provide tc.key or tc.trust and tc.crt files
    wss://192.168.52.72:6090

 

Running the Basic Station

root@mtcdt:/opt/lora$ sudo ./station 
2020-02-26 16:56:02.698 [SYS:WARN] Ignoring field: region
2020-02-26 16:56:02.700 [SYS:INFO] Logging     : stderr (maxsize=10000000, rotate=3)
2020-02-26 16:56:02.700 [SYS:INFO] Station Ver : 2.0.3(mlinux/std) 2020-01-24 16:54:44
2020-02-26 16:56:02.700 [SYS:INFO] Package Ver : (null)
2020-02-26 16:56:02.701 [SYS:INFO] proto EUI   : ::1    (station.conf)
2020-02-26 16:56:02.701 [SYS:INFO] prefix EUI  : ::0    (station.conf)
2020-02-26 16:56:02.701 [SYS:INFO] Station EUI : ::1
2020-02-26 16:56:02.701 [SYS:INFO] Station home: ./     (builtin)
2020-02-26 16:56:02.701 [SYS:INFO] Station temp: /var/tmp/      (builtin)
2020-02-26 16:56:02.701 [SYS:WARN] Station in NO-CUPS mode
2020-02-26 16:56:02.903 [TCE:INFO] Starting TC engine
2020-02-26 16:56:02.908 [TCE:INFO] Connecting to INFOS: ws://192.168.52.72:6090
2020-02-26 16:56:02.912 [TCE:INFO] Infos: ::1 muxs-::0 ws://192.168.52.72:6092/router-::1
2020-02-26 16:56:02.912 [AIO:DEBU] [3] ws_close reason=1000
2020-02-26 16:56:02.913 [AIO:DEBU] [3] Server sent close: reason=1000
2020-02-26 16:56:02.913 [AIO:DEBU] [3] WS connection shutdown...
2020-02-26 16:56:02.916 [TCE:VERB] Connecting to MUXS...
2020-02-26 16:56:02.917 [TCE:VERB] Connected to MUXS.
INFO: FPGA supported features: [TX filter]  [Spectral Scan]  [LBT] 
2020-02-26 16:56:03.219 [S2E:WARN] Unknown field in router_config - ignored: bcning (0x1EE5E245)
2020-02-26 16:56:03.219 [S2E:WARN] Unknown field in router_config - ignored: config (0xF7A3E35F)
2020-02-26 16:56:03.219 [S2E:WARN] Unknown field in router_config - ignored: protocol (0xFD309030)
2020-02-26 16:56:03.220 [S2E:WARN] Unknown field in router_config - ignored: regionid (0xE6FFB211)
2020-02-26 16:56:03.220 [S2E:WARN] Unknown field in router_config - ignored: upchannels (0x7FCAA9EB)
2020-02-26 23:08:46.995 [RAL:WARN] Ignoring unsupported/unknown field: lbt_conf
2020-02-26 23:08:47.049 [RAL:INFO] Lora gateway library version: Version: 5.0.1-mts-1;
2020-02-26 23:08:47.049 [RAL:DEBU] SX1301 txlut table (2 entries)
2020-02-26 23:08:47.049 [RAL:VERB] SX1301 txlut  0:  dig_gain=0 pa_gain=0 dac_gain=3 mix_gain=11 rf_power=-6
2020-02-26 23:08:47.049 [RAL:VERB] SX1301 txlut  1:  dig_gain=0 pa_gain=0 dac_gain=3 mix_gain=13 rf_power=-3
2020-02-26 23:08:47.049 [RAL:VERB] SX1301 rxrfchain 0: enable=1 freq=868475000 rssi_offset=-162.000000 type=2 tx_enable=1 tx_notch_freq=0
2020-02-26 23:08:47.049 [RAL:VERB] SX1301 rxrfchain 1: enable=1 freq=869287500 rssi_offset=-162.000000 type=2 tx_enable=0 tx_notch_freq=0
2020-02-26 23:08:47.049 [RAL:VERB] SX1301 ifchain  0: enable=1 rf_chain=0 freq=-375000 bandwidth=0 datarate=0 sync_word=0/0
2020-02-26 23:08:47.050 [RAL:VERB] SX1301 ifchain  1: enable=1 rf_chain=0 freq=-175000 bandwidth=0 datarate=0 sync_word=0/0
2020-02-26 23:08:47.050 [RAL:VERB] SX1301 ifchain  2: enable=1 rf_chain=0 freq=25000 bandwidth=0 datarate=0 sync_word=0/0
2020-02-26 23:08:47.050 [RAL:VERB] SX1301 ifchain  3: enable=1 rf_chain=0 freq=375000 bandwidth=0 datarate=0 sync_word=0/0
2020-02-26 23:08:47.050 [RAL:VERB] SX1301 ifchain  4: enable=1 rf_chain=1 freq=-237500 bandwidth=0 datarate=0 sync_word=0/0
2020-02-26 23:08:47.050 [RAL:VERB] SX1301 ifchain  5: enable=1 rf_chain=1 freq=237500 bandwidth=0 datarate=0 sync_word=0/0
2020-02-26 23:08:47.050 [RAL:VERB] SX1301 ifchain  6: enable=0 rf_chain=1 freq=200000 bandwidth=0 datarate=0 sync_word=0/0
2020-02-26 23:08:47.050 [RAL:VERB] SX1301 ifchain  7: enable=0 rf_chain=1 freq=400000 bandwidth=0 datarate=0 sync_word=0/0
2020-02-26 23:08:47.050 [RAL:VERB] SX1301 ifchain  8: enable=0 rf_chain=0 freq=-200000 bandwidth=2 datarate=2 sync_word=0/0
2020-02-26 23:08:47.051 [RAL:VERB] SX1301 ifchain  9: enable=0 rf_chain=0 freq=300000 bandwidth=3 datarate=50000 sync_word=0/0
2020-02-26 23:08:47.051 [RAL:VERB] SX1301 LBT not enabled
2020-02-26 23:08:47.051 [RAL:INFO] Station device: /dev/spidev0.0 (PPS capture enabled)
2020-02-26 23:08:50.049 [S2E:INFO] Configuring for region: EU863 -- 863.0MHz..870.0MHz
2020-02-26 23:08:50.049 [S2E:VERB]   DR0  SF12/BW125 
2020-02-26 23:08:50.049 [S2E:VERB]   DR1  SF11/BW125 
2020-02-26 23:08:50.049 [S2E:VERB]   DR2  SF10/BW125 
2020-02-26 23:08:50.049 [S2E:VERB]   DR3  SF9/BW125 
2020-02-26 23:08:50.049 [S2E:VERB]   DR4  SF8/BW125 
2020-02-26 23:08:50.049 [S2E:VERB]   DR5  SF7/BW125 
2020-02-26 23:08:50.049 [S2E:VERB]   DR6  SF7/BW250 
2020-02-26 23:08:50.049 [S2E:VERB]   DR7  FSK 
2020-02-26 23:08:50.049 [S2E:VERB]   DR8  undefined
2020-02-26 23:08:50.049 [S2E:VERB]   DR9  undefined
2020-02-26 23:08:50.049 [S2E:VERB]   DR10 undefined
2020-02-26 23:08:50.049 [S2E:VERB]   DR11 undefined
2020-02-26 23:08:50.050 [S2E:VERB]   DR12 undefined
2020-02-26 23:08:50.050 [S2E:VERB]   DR13 undefined
2020-02-26 23:08:50.050 [S2E:VERB]   DR14 undefined
2020-02-26 23:08:50.050 [S2E:VERB]   DR15 undefined
2020-02-26 23:08:50.050 [S2E:VERB]   TX power: 16.0 dBm EIRP
2020-02-26 23:08:50.050 [S2E:VERB]             27.0 dBm EIRP for 869.4MHz..869.65MHz
2020-02-26 23:08:50.050 [S2E:VERB]   JoinEui list: 0 entries
2020-02-26 23:08:50.050 [S2E:VERB]   NetID filter: FFFFFFFF-FFFFFFFF-FFFFFFFF-FFFFFFFF
2020-02-26 23:08:50.050 [S2E:VERB]   Dev/test settings: nocca=0 nodc=0 nodwell=0
Categories: Tags:

loraNetwork

May 15th, 2019 Comments off

Description: lora network interface settings : OBJECT (not available on MTR)

 

 

Element Type Description
__v UINT version of model [20] (automatic)
addressRange OBJECT address range settings
  end STRING end of range for assigned addresses, four groups of two hexadecimal digits, separated by colons
  start STRING start of range for assigned addresses, four groups of two hexadecimal digits, separated by colons
backupInterval
basicStation Support basic station connections to remote network servers
  cert
  cert2
  conf
  conf2
  credentials
  credentials2
  key
  key2
  trust
  trust2
  uri
  uri2
  sign
  sign2
db
defaultApp
  enabled
  eui
  module
  options
     apikey
     check_hostname
     client_cert
     password
     server_cert
     username
     clean_session
     cloudService
     downlinkTopic
     overrideTopicsForAllApps
     uplinkTopic
  url
  backhaulDetect
     enabled
     payload
     port
     timeout
  encodeHex
  requestOptions
     api
     log
     lora
log OBJECT log settings
  console BOOL console
  level UINT log level
  path STRING path
  syslog BOOL syslog
lora OBJECT lora settings
  ADRStep UINT Step in cB between SNR based datarate assignment for ADR
  aesKey
  antennaGain INT Gain of external antenna in dBi
  basicStationMode
  beaconFreqHop
  beaconFrequency
  beaconInfoDesc
  beaconInterval
  beaconLatitude
  beaconLongitude
  beaconPower
  calAD9361
  calTempRoom
  channelMask
  channelPlan
  classCAckTimeout
  deviceQueueSize UINT device queue size for pending downlink packets
  diversity
  dspStatInterval
  dutyCyclePeriod UINT Length of duty-cycle sliding window in minutes
  dwelltimeDown UINT max dwelltime for downlink packets default: 0 – no limit, 1 – 400 ms
  dwelltimeUp UINT max dwelltime for uplink packets, default: 0 – no limit, 1 – 400 ms
  enableStrictCounterValidation
    enabled BOOL check to enable lora network support
    fineTimestampEnable BOOL
    fineTimestampMode STRING
    frequencyAS UINT center freq for extra AS channels (Hz)
    frequencyAS2
    frequencyBand UINT frequency band
    frequencyBand2
    frequencyEU UINT center freq for extra EU channels (Hz)
    frequencyEU2
    frequencyIN
    frequencyIN2
    frequencyISM2400 center freq for ISM band
    frequencyISM2400_2
    frequencyISM2400_2_1
    frequencyISM2400_2_2
    frequencyISM2400_3_3
    frequencyKR UINT center freq for extra KR channels (Hz)
    frequencyKR2
    frequencyRU
    frequencyRU2
    frequencySubBand UINT frequency sub-band
    frequencySubBand2
    fskSYNC
    ftsMatchCRCError
    ftsVersion
    gpsReceiver
    joinDelay UINT Rx1 delay in seconds between end of tx and opening of first rx window for join accept message
   lbtEnabled
  maxDatarate UINT Max datarate for ADR
  maxEIRP UINT AS923 max device TX power
  maxTxPower UINT maximum tx power
  maxRx2PacketSize
  minDatarate UINT Min datarate for ADR
  nbDSP
  netID STRING LoraWAN network ID : 3 bytes HEX
  networkLeadTime
  packetForwarderConfig STRING contents to be used for global_conf.json file
  packetForwarderConfig2 STRING contents of configuration file for secondary Packet Forwarder (in Dual Packet Forwarder mode)
  packetForwarderMode BOOL enable packet forwarder mode
  pingSlotDatarate
  pingSlotFreqHop
  pingSlotFrequency
  reducedPacketUpdates
  rx1DatarateOffset UINT offset used for datarate on first RX window
  rx1Delay UINT Rx1 delay in seconds between end of tx and opening of first rx window
  rx2Datarate UINT datarate to be used in second RX window
  skipPacketForwarderFieldCheck
  spi_device
  spi_device1261 STRING
  adrNBTrans
  enabledAdr
  locked
  locking
mqtt OBJECT mqtt settings
  enabled BOOL check to enable MQTT protocol
  host STRING hostname
  password
  port UINT port
  username
network OBJECT network settings
  baseKey STRING Key used for zero touch provisioning : 16 bytes HEX
  defaultProfile
  eui STRING extended unique identifier
  joinServer
  key STRING key : 16 bytes HEX
  leasetime UINT lease time
  lensCheckinInterval
  lensDeviceHQ
  lensEnabled
  lensGatewayStats
  lensLocalJoinMetadata
  lensNetworkStats
  lensPacketData
  lensPacketMetadata
  lensPacketPayloadData
  lensServer
  localJoinServerEnabled
  name STRING name
  passphrase STRING passphrase
  public UINT set network mode 0:Private MTS, 1:Public LoRaWAN, 2:Private LoRaWAN
  salt STRING Salt used for zero touch provisioning
  joinServerAppEUI
  joinServerCert
 joinServerCertFile
 joinServerCertUseFile
 joinServerCheck
 joinServerClientCert
 joinServerClientKey
packetForwarder
  aesKey
  antennaGain
  autoquitThreshold
  beaconFreqHop
  beaconFrequency
  beaconInfoDesc
  beaconInterval
  beaconLatitude
  beaconLongitude
  beaconPower
  calAD9361
  calTempRoom
  channelPlan
  diversity
  downstreamPort
  dspStatInterval
  frequencyAS
  frequencyAS2
  frequencyEU
  frequencyEU2
  frequencyIN
  frequencyIN2
  frequencyISM2400
  frequencyISM2400_2
  frequencyISM2400_3
  frequencyKR
  frequencyKR2
  frequencyRU
  frequencyRU2
  frequencySubBand
  frequencySubBand2
  fskSYNC
  ftsMatchCRCError
  ftsVersion
  fwdCrcDisabled
  fwdCrcError
  fwdCrcValid
  gpsReceiver
  gwID
  gwID2
  gwSource
  keepAliveInterval
  lbtDefaultChannels
  lbtEnabled
  lbtFrequency0
  lbtFrequency1
  lbtFrequency2
  lbtFrequency3
  lbtFrequency4
  lbtFrequency5
  lbtFrequency6
  lbtFrequency7
  lbtRssiOffset
  lbtRssiTarget
  lbtScanTime
  manualMode
  nbDSP
  path
  pathGeo
  public
  pushTimeout
  serverAddress
  statInterval
  upstreamPort
  downstreamPort2
  locked
  locking
  maxTxPower
  serverAddress2
  upstreamPort2
redundancy
  defaultInterval
  enabled
  failoverInterval
  primaryAddress
  role
  secondaryAddress
spectralScan
  bandwidth
  duration
  enabled
  floor
  imme
  interval
  limit
  offset
  ranges
    start
    stop
  samples
  startAt
  step
  stopCriteria
test
  disableDutyCycle BOOL disable duty cycle. FOR TESTING PURPOSES ONLY!!!
  disableGPS
  disableRxJoin1 BOOL disable join downlink packet in first Rx window
  disableRxJoin2 BOOL disable join downlink packet in second Rx window
  disableRxWindow1 BOOL disable downlink packet in first Rx window
  disableRxWindow2 BOOL disable downlink packet in second Rx window
trimInterval
trimRows
udp OBJECT udp settings
  allowPublic
  appPortDown UINT application port down
  appPortUp UINT application port up
  downstreamPort UINT downstream port
  upstreamPort UINT upstream port
whitelist OBJECT white list settings
  devices ARRAY local unique appkey store
    appeui STRING application id attached to received packets : 8 bytes HEX
    appkey STRING device key used to authenticate join request and generate session keys : 16 bytes HEX
    class STRING operating class of end-device : A, B or C
    deveui STRING device id : 8 bytes HEX
  enabled BOOL check to provide an access to the devices from the White List only
  chirpstack
       configs
            backend
                basicStation
                      bind
                      caCert
      concentrators
  fsk
      frequency
      lora_std
      bandwidth
      frequency
      spreading_factor
      multi_sf
      frequencies
frequencyAS
frequencyEU
frequencyIN
       frequencyKR
     frequencyMax
     frequencyMin
       frequencyRU
     frequencySubBand
 pingInterval
  readTimeout
  region
  statInterval
      timesyncInternal
                                  tlsCert
                                  tlsKey
      writeTimeout
                     semtechUdp
                                  fakeRxTime
      skipCrcCheck
                                  udpBind
                     type
            filters
                      joinEuis
                      netlds
            general
                      logLevel
                      logToSyslog
            integration
                      marshaler
                      mqtt
                                   auth
            azureIotHub
            deviceConnectionString
            deviceId
            hostname
            sasTokenExpiration
            tlsCert
            tlsKey
            generic
            caCert
            cleanSession
            clientId
            password
            qos
            servers
            tlsCert
            tlsKey
            username
            type
            commandTopicTemplate
            eventTopicTemplate
                                    keepAlive
            maxReconnectInterval
            stateRetained
           stateTopicTemplate
          terminateOnConnectError
          enabled
          mode
  radiobridgeConsole
         enabled
         name
         region
         token
          validated
  trafficManager
         dev_eui_filters List of EUI values or Min/Max ranges of EUI values.
i.e. [ [ “00-00-00-00-00-00-00-01”, “00-00-00-00-00-00-00-04” ], “00-00-00-00-00-00-00-05” ]
         enabled
        join_eui_filters List of EUI values or Min/Max ranges of EUI values.
i.e. [ [ “00-00-00-00-00-00-00-01”, “00-00-00-00-00-00-00-04” ], “00-00-00-00-00-00-00-05” ]
Categories: Tags:

Networking Conduits

April 19th, 2018 Comments off

Server/Gateway Deployments using Multiple Conduits

 

A network of Conduits or Conduit 300s can be created with several setup as packet forwarders (Gateway) and one as a central network server (Server). This Server/Gateway deployment allows a basic limit of 10 gateways as 10 external packet forwarders. Local forwarders for LoRa cards installed on the network server unit do not count against this limit.

This configuration can be used to increase the area of the network or the number of channels supported. The capacity of the network will still be limited to a single instance of the network server, 2000 end-devices in default configuration.

NOTE: If you are using LENS®, there is no limit on the number of gateways or devices. But we recommend no more than 2000 end-devices for MTCDT/MTCAP in most circumstances.

The /var/config directory is limited to 8 MB. Custom applications may also be installed in the /var/config directory reducing the space available for the database. To reach 2000 connected end-devices it may be necessary to install an SD card to hold the custom application or network server database.

LoRaWAN-Network

AEP Configuration

On Network Server Conduit

The central network server will handle all end-device session information, authenticate uplinks and author downlink packets.

Configure Network Server to accept connections from remote packet forwarders

  1. Go to LoRaWAN > Network Settings on Conduit
  2. Set Public LoRaWAN under Network section, if a private setting is selected all packet forwarders should also be set to private
  3. Click Show Advanced Settings
  4. Under Server Ports verify Local Only is unchecked to allow incoming connections from the packet forwarder Conduits.
  5. Click Submit
  6. Go to Firewall > Settings
  7. Enable Allow Inbound Input Filter Rule, change allowed ports to 1780 and 1782
  8. Save and Restart Conduit

Configure Forwarding Conduit to send packets to the Network Server

  1. Go to LoRaWAN > Network Settings
  2. Enable Packet Forwarder mode
  3. Set Public under Basics section, or match setting selected on Network Server config above.
  4. In Server section, settings must match those of Master Conduit
    1. Set Server Address to IP address
    2. Set Upstream Port to 1780
    3. Set Downstream Port to 1782
  5. Click Submit
  6. Save and Restart Conduit

After the Conduits have rebooted, navigate to the LoRaWAN > Gateways page on the first Conduit. The Forwarding Gateway should now be shown in the list. The IP address of the forwarding Conduit will be listed. Packet forwarders running on the same Conduit as the Network Server will have a local address (127.0.0.1).

Extending Supported Channels for US915 and AU915 Channel Plans

 

Additional channels can be supported by the network by enabled different Frequency Sub-Band settings on each forwarding Gateway. The supported channels must be relayed to the Network Server using the Channel Mask setting. This will allow the full set of channels to be enabled on the end-device following that OTAA join.

LoRaWAN-Network-USAU

On a Forwarding Conduit

  1. Go to LoRaWAN > Network Settings
  2. Set the Frequency Sub-Band to the desired setting
  3. Click Submit
  4. Save and Restart the Conduit
  5. Configure the other forwarding Conduits likewise

Configure Network Server to support additional channels

  1. 1. Go to LoRaWAN > Network Settings on Conduit
  2. Set channel mask to enable the additional channels
    • FSB 1, 2 and 3 – 00070000000000FFFFFF
    • FSB 1, 2, 3 and 4 – 000F00000000FFFFFFFF
    • FSB 5, 6, 7 and 8 – 00F0FFFFFFFF00000000
    • FSB 1 and 8 – 0081FF000000000000FF
  3. Click Submit
  4. Save and Restart the Conduit

mLinux Configuration

 

mLinux installations running the Network Server can be configured as well. Note: The mLinux images do not have a firewall enabled by default.

Allow the Network Server to accept incoming connections

    1. Edit the configuration page
      # vi /var/config/lora/lora-network-server.conf
    2. Configure “udp” => “allowPublic” to true
    3. Save the file, enter ‘:x’
    4. Restart the network server,
      # /etc/init.d/lora-network-server restart

Now the UDP ports are set to listen on the external IP interfaces.

Configure the packet forwarding Conduits

      1. Setup the packet fowarder to send packets to the Network Server Conduit IP address and Ports
      2. See Convert to Basic Packet Forwarder
Categories: Tags: