image-20231127105359-1.png

  

 

Table of Contents:

1. Introduction

1.1 What is MS48-LR

The MS48-LR  is an open-source LoRaWAN gateway that can convert LoRaWAN to Modbus RTU/TCP. It lets you bridge LoRa wireless network to an IP network via WiFi , Ethernet or Cellular Network (via Optional 4G module). The LoRa wireless allows users to send data and reach extremely long ranges at low data rates.

The MS48-LR is fully compatible with LoRaWAN protocol. MS48-LR includes a built-in LoRaWAN Server and IoT server, User can connect virous LoRaWAN devices to MS48-LR, and use PLC to access these devices via Modbus network, MS48-LR eliminates the need to add additional lorawan gateways to implement LoRaWAN to Modbus RTU/TCP.

Different countries use different LoRaWAN frequency bands. MS48-LR has these bands pre-configured. Users can also customize the frequency bands to use in their own LoRa network.

MS48-LR supports remote management. System Integrator can easy to remote monitor the gateway and maintain it.

1.2 How does it work?

The MS48-LR can run as a Modbus RS485-RTU slave, which converts the LoRaWAN sensor upstream data into modbus data and writes it into the register of the 03 function code

image-20231111103753-1.png

 

1.3 Specifications

Hardware System:

  • CPU: Quad-core Cortex-A7 1.2Ghz
  • RAM: 512MB
  • eMMC: 4GB

Interface:

  • 10M/100M RJ45 Ports x 1
  • Multi-Channel LoRaWAN Wireless
  • WiFi 802.11 b/g/n
  • USB 2.0 host connector x 1
  • Mini-PCI E connector x 1
  • RS485 Interface x 1
  • RS232 Interface x 1

LoRa Spec:

  • Up to -140 dBm sensitivity with SX1250 Tx/Rx front-end
  • 70 dB CW interferer rejection at 1 MHz offset
  • Able to operate with negative SNR, CCR up to 9dB
  • 8 x 8 channels LoRa  packet detectors,8 x SF5-SF12 LoRa demodulators,8 x SF5-SF10 LoRa demodulators,125/250/500 kHz LoRa demodulator and 1 x (G)FSK demodulator
  • Dual digital TX & RX radio front-end interfaces
  • 10 programmable parallel demodulation paths
  • Dynamic data-rate (DDR) adaptation
  • True antenna diversity or simultaneous dual-band operation

Cellular 4G LTE (optional):

  • Quectel: EC25 LTE module 
  • Standard Size SIM Slot
  • 2 x 4G Sticker Antenna.
  • Up to 150Mbps downlink and 50Mbps uplink data rates
  • Worldwide LTE,UMTS/HSPA+ and GSM/GPRS/EDGE coverage
  • MIMO technology meets demands for data rate and link reliability in modem wireless communication systems

Operating Condition:

  • Work Temperature: -20 ~ 70°C
  • Storage Temperature: -20 ~ 70°C
  • Power Input: 12V, 2A, DC

1.4 Features

  • Open Source Debian system
  • Managed by Web GUI, SSH via WAN or WiFi
  • Remote Management
  • Auto-provisioning for batch deployment and management
  • LoRaWAN Gateway
  • 10 programmable parallel demodulation paths
  • Pre-configured to support different LoRaWAN regional settings.
  • Allow customizing LoRaWAN regional parameters.
  • Different kinds of LoRaWAN Connections such as
    • Semtech UDP Packet Forwarder
    • LoRaWAN Basic Station
    • ChirpStack-Gateway-Bridge (MQTT)
  • Built-in ChirpStack local LoRaWAN server 
  • Built-in  Node-Red local Application server
  • Act as Modbus Slave mode

1.5 LED Indicators

MS48-LR has totally four LEDs, They are:

➢ LED 1 (ETH LED): This GREEN LED will blink GREEN when the ETH port is connecting

➢ LED 2 (RET LED): This GREEN LED will show different colors in different states:

                     ✓   SOLID GREEN: When the Long press 4-5s Toggle button,the device will reload the Network and Initialize wifi configuration,This GREEN LED will SOLID GREEN Until the reload is finished.

                     ✓   BLINKING GREEN: When the Long press 10s Toggle button,the device will restore the factory settings,This GREEN LED will BLINKIND GREEN Until the restore is finished.

➢ LED 3: This GREEN LED is undefined

➢ LED 4 (Power LED): This GREEN LED will be solid if the device is properly powered

➢ LED 5 (WIFI LED): This LED shows the WIFI interface connection status.

                     ✓   SOLID GREEN: The device enables the WiFi WAN Client and connects to the WiFi successfully.

                     ✓   BLINKING GREEN: The device's WiFi WAN Client connection is unsuccessful.

                     ✓   OFF: The device WiFi WAN Client is not enabled.

➢ LED 6 (SYS LED): This GREEN LED will show different colors in different states:

                     ✓   SOLID GREEN: The device is alive with a LoRaWAN server connection.

                     ✓   BLINKING GREEN: a)  no LoRaWAN Connection. or b) Device is in booting stage, in this stage, it will BLINKING GREEN for several seconds and then with BLINKING GREEN together

                     ✓   OFF: Device doesn't have an Internet connection.

1.6 RS485 & RS232 interface

image-20240108150505-1.png

1.7 Button Instruction

The MS48-LR has two black buttons, which are:

RST: Press and release, and the gateway will restart

LED status:  All LEDs are off except for the LED 4 (Power LED).

Toggle:

➢ Long press 4-5s :                     the gateway will reload the Network and Initialize wifi configuration

                                                      LED status:  LED 2 (RET LED) will SOLID GREEN Until the reload is finished.

➢ Long press more than 10s:    the gateway will restore the factory settings.

                                                      LED status:  LED 2 (RET LED) will BLINKIND GREEN Until the restore is finished.

1.8 Installation

image-20240122115220-1.png

2. Quick Start

The MS48-LR supports network access via Ethernet or Wi-Fi connection and runs without a network.

In most cases, the first thing you need to do is make the MS48-LR accessible to the network.

2.1 Access and Configure MS48-LR

2.1.1 Find IP address of MS48-LR

Method 1:  Connect via MS48-LR WiFi

At the first boot of MS48-LR, it will auto generate a WiFi network called dragino-xxxxxx with password:

dragino+dragino

User can use a PC to connect to this WiFi network. The PC will get an IP address 10.130.1.xxx and the MS48-LR has the default IP 10.130.1.1

image-20240119093621-1.png

image-20230527085250-2.png

Method 2:  Connect via Ethernet with DHCP IP from the router

Connect the MS48-LR Ethernet port to your router and MS48-LR can obtain an IP address from your router. In the router's management portal, you should be able to find what IP address the router has assigned to the MS48-LR.

You can also use this IP to connect.

image-20240119093637-2.png

Method 3:  Connect via MS48-LR Fallback IP

image-20240119093652-3.png

Steps to connect via fallback IP:

1. Connect the PC's Ethernet port to MS48-LR's WAN port

2. Configure PC's Ethernet port has IP: 172.31.255.253 and Netmask: 255.255.255.252

Settings --> Network & Internet --> Ethernet --> Change advanced sharing options --> Double-click"Ethernet" --> Internet Protocol Version 4 (TCP/IPv4)

As in the below photo:

image-20230413172038-1.png

Configure computer Ethernet port steps video: fallback ip.mp4

If you still can't access the MS48-LR fallback ip, follow this connection to debug : Trouble Shooting

3. In the PC, use IP address 172.31.255.254 to access the MS48-LR via Web or Console.

image-20240119093803-4.png

Method 4:  Connect via WiFi with DHCP IP from the router

image-20240119093834-5.png

Fill in the WiFi information by checking the box and clicking Save&Apply

image-20240119093902-6.png

Wi-Fi configuration successful

image-20240119093944-7.png

2.1.2 Access Configure Web UI

Web Interface

Open a browser on the PC and type the MS48-LR ip address (depends on your connect method)

http://IP_ADDRESS  or http://172.31.255.254(Fallback IP)

You will see the login interface of MS48-LR as shown below.

The account details for Web Login are:

User Name: root

Password:   dragino

image-20240320134426-1.png

2.2  Typical Network Setup

2.2.1  Overview

MS48-LR supports flexible network set up for different environment. This section describes the typical network topology can be set in MS48-LR. The typical network set up includes:

  • WAN Port Internet Mode
  • WiFi Client Mode
  • Cellular Mode

2.2.2  Use the WAN port to access the Internet

By default, the MS48-LR is set to use the WAN port to connect to an upstream network. When you connect the MS48-LR's WAN port to an upstream router, MS48-LR will get an IP address from the router and have Internet access via the upstream router. The network status can be checked on the home page:

image-20240108114745-4.png

2.2.3  Access the Internet as a WiFi Client

In the WiFi Client Mode, MS48-LR acts as a WiFi client and gets DHCP from an upstream router via WiFi.

The settings for WiFi Client is under page Network -->  Wi-Fi

image-20230411095739-1.png

In the WiFi Survey Choose the WiFi AP, and input the Passphrase then click Save & Apply to connect.

image-20240108114602-3.png

2.2.4  Use built-in 4G modem for internet access

Users can see whether MS48-LR has EC25 on the label of the gateway to determine whether there is 3G/4G Cellular modem.

If the MS48-LR has 3G/4G Cellular modem, user can use it as main internet connection or back up.

First, install the Micro SIM card as below direction

Second, Power off/ ON MS48-LR to let it detect the SIM card.

image-20240320134750-2.png

The set up page is Network --> Cellular

While use the cellular as Backup WAN, device will use Cellular for internet connection while WAN port or WiFi is not valid and switch back to WAN port or WiFi after they recover.

1657090932270-444.png

2.2.5  Check Internet connection

In the Home page, we can check the Internet connection.

  • GREEN Tick 1652436675869-206.png  : This interface has Internet connection.
  • Yellow  Tick 1652436705761-420.png  : This interface has IP address but don't use it for internet connection.
  • RED Cross   1652436787176-950.png  : This interface doesn't connected or no internet.

image-20240108115101-6.png

2.3 Bridge LoRaWAN network to Modbus network

By following the steps below in the configuration example, Users can convert the uplink data of the lorawan sensor to modbus RTU/TCP data

MS48-LR eliminates the need to add additional lorawan gateways to implement LoRaWAN to Modbus RTU/TCP

Step 1: Configure the LoRa Radio to your area Frequency Plan

The Frequency Plan has to be set the same as the Sensor node Frequency Plan.

image-20231108164616-1.png

Step 2: Copy the unique Gateway EUI & Configure the LoRaWAN Server address

Users need to connect the MS48-LR configuration to the built-in lorawan server.

Every MS48-LR has a unique gateway EUI. The ID can be found on the LoRaWAN Semtech page:

image-20231110160659-1.png

Step 3: Enable the Built-in LoRaWAN Network Server

image-20231110163133-2.png

Step 4: Logging to the Built-in LoRaWAN Network Server

image-20231110170323-4.png

Step 5: Register the gateway to the built-in ChirpStack

Copy Gateway EUI from the previous step to the following interface:

image-20231110170802-5.png

Step 6: Register the Sensor-node to the built-in ChirpStack

The MS48-LR gateway is already set up to connect to the built-in ChirpStack network, so we now need to configure the sensor device to connect to the built-in ChirpStack.

First we need to add the Device Profiles and Application (ignore them if they are already done).

1) Add Device Profiles

image-20231110172143-6.png

2) Add End Node Device

Create an Application

image-20231110172604-8.png

Add a device for the sensor node

image-20231109092517-2.png

Enter Device EUI, Join EUI(APP EUI)and APPKEY of the node Device, and select the Device profile added in the previous step

image-20231110173714-9.png

image-20231110175007-11.png

Step 7: Configure Modbus RTU/TCP Slave

The gateway can as a Modbus RTU slave to run, the user can set a range of the register to write a sensor node uplink data.

For example, there is a sensor node EUI is 70b3d57ed0051e22, the register start is 0xABCD and the register length is 14, which means the uplink data will be written to the register starting at 0xABCD register and the maximum write length not to exceed 14 registers.

So the sensor node 70b3d57ed0051e22 uplink data will be written to the 0xABCD - 0xABE1 register.

Note: Since the length of the payload is the same for different sensor nodes if The length of the data is greater than the configuration length, the data will be replaced with FFFF.

Slave Setting:

Slave Mode                  ---> Support both RTU and TCP mode

Enable Modbus Slave  ---> Enable Slave

Slave Address/Port      ---> Set the slave address/port

Show Sensor History   ---> See the sensor data log

Sensor Settings:

Device EUI                   ---> Sensor node's EUI

Register Start              --->  Setting the start register address to write the sensor node's data

Register Length          --->   The maximum write length with register

Note: Only 1 sensor can be written in the range set by the registers

1) RTU Mode:

image-20240112143033-1.png

After the sensor node is active at the built-in server Chirpstack, the user can add it to this page and enable the Modbus RS485-RTU Slave.

Then MS48-LR will write the uplink data to the 03 code register and record the uplink data.

PLC read the MS48-LR register

Settings: 

Function  : 03 code

Bit rate    :  9600

Parity bit : none

Stop bit    : 1

Response Timeout :  Greater than 3000ms

2) TCP Mode:

image-20240112143439-2.png

PLC read the MS48-LR register

Settings: 

Function     :  03 code

IP Address  :  Gateway IP Address

Server Port :  Slave Port

Connect Timeout :  Greater than 3000ms

3) PLC(Modbus server/master) data show:

image-20231111105300-3.png

History Data:

Click the Show Sensor History will launch to this page

image-20231111105548-4.png

Step 8: Configure Sensor decode to Built-in Chirpstack

1) Add Sensor's decode to Chirpstack

Users can find the ChirpStack v4 decoder code for the Dragino End node in this link:

https://github.com/dragino/dragino-end-node-decoder

The following example is to add the LHT65N decoder:

image-20240319145115-3.png

image-20240319145749-4.png

2) Check the decode on ChiprStack

image-20240319145903-5.png

Step 9: Configure Modbus RTU/TCP Slave Sensor Decode

For example, there is a sensor node EUI is a840411be186e411, the register start is 0x0000 and the register length is 14, which means the uplink data will be written to the register starting at 0x0000 register and the maximum write length not to exceed 14 registers.

Add Decode Data TempC_SHT, the register start address is 0x000F and the register length is 2, which means the Decode Data TempC_SHT will be written to the register starting at 0x000F register and the maximum write length not to exceed 2 registers.

 

So the sensor node a840411be186e411 uplink data will be written to the 0x0000 - 0x000E register, and the Decode Data TempC_SHT will be written to the 0x000F - 0x0010 register.

Note: Since the length of the payload is the same for different sensor nodes if The length of the data is greater than the configuration length, the data will be replaced with FFFF.

 

Decode Data:

Device Type                --->   Sensor decoder data

Register Start              --->   Setting the start register address to write the sensor node's decoder data

Register Length          --->   The maximum write length with register

 

Note: Only 1 Data can be written in the range set by the registers

1710569938804-766.png

 

PLC(Modbus server/master) data show:

Note: Since the decoded data is of floating point type, it is converted to an integer before being written to the Mobdbus' registers.

For example:  23.20(real data) ---> 2320(register show).

1710570017983-979.png

2.4 Accept data to registers for specified Fport

For example, there is a sensor node EUI is f4bbf5a0da6f4da5,

  • the sensor payload uplink is using Fport=2
  • the sensor status uplink is  using Fport=5

If the accept fport is not set, it may cause the registers to be written with 0 decoded data during status uplink, because status uplinks typically do not contain decoded data.

To avoid 0 data being written to the registers. the users can set accept Fport for the sensor,

i.e., the data will be written to the register only when the MS48-LR receives the uplink of the specified Fort

Accept Fport:

DevEUI                       --->   Sensor node DevEUI

Accept FPort              --->   Setting the Accept Fport

image-20240606153055-1.png

PLC(Modbus server/master) data show:

image-20240606155134-2.png

image-20240606155545-3.png

3. Web Configure Pages

3.1 Home

Shows the system running status:

3.2 LoRa Settings

3.2.1 LoRa --> LoRa

This page shows the LoRa Radio Settings. There is a set of default frequency bands according to LoRaWAN protocol, and users can customize the band* as well.

Different MS48-LR hardware versions can support different frequency ranges:

  • 868: valid frequency: 863Mhz ~ 870Mhz. for bands EU868, RU864, IN865, or KZ865.
  • 915: valid frequency: 902Mhz ~ 928Mhz. for bands US915, AU915, AS923 or KR920

After the user choose the frequency plan,  the user can see the actual frequency is used by checking the page LogRead --> LoRa Log

image-20231109145418-1.png

Note *: See this instruction for how to customize the frequency band: How to customized LoRaWAN frequency band - DRAGINO

3.3 LoRaWAN Settings

3.3.1 LoRaWAN --> LoRaWAN Semtech UDP

This page is for the connection set up to a general LoRaWAN Network server such as TTNChirpStack, etc.

image-20231109145535-2.png

3.3.2 LoRaWAN --> LoRaWAN Basic Station

This page is for the connection set up to the TTN Basic Station, AWS-IoT, etc.

image-20231109145619-3.png

Please see this instruction to know more detail and a demo for how to use of LoRaWAN Basic Station: Use of LoRaWAN Basic Station - DRAGINO

3.4 Network Settings

3.4.1 Network --> WiFi

Users can configure the wifi WAN and enable Wifi Access Point on this interface

image-20231109145715-4.png

3.4.2 Network --> System Status

image-20231109145758-5.png
 

3.4.3 Network --> Network

In the Network --> Network interface, Users can set the Ethernet WAN static ip address.

image-20231109145841-6.png

3.4.4 Network --> Cellular

In the Network --> Cellular interface, Users can Enable Cellular WAN and configure Celluar. 

Note: APN cannot be empty.

image-20231109145928-7.png

After the configuration is complete, return to the Home interface and put the mouse on the Cell icon to check the Cellular state.

3.5 System

3.5.1 System --> System Overview

Shows the system info:

image-20240108114851-5.png

3.5.2 System --> System General

There are two login for MS48-LR: root /dragino or admin /dragino. Both root and admin has the same right for WEB access. But root user has also the right to access via SSH to Linux system. admin only able to access WEB interface.

This page can be used to set the password for them.

Timezone:  Set device timezone.

Time Synchronization Service:  Set the time synchronization server.

HTTP Web Service:  Enable/Disable the HTTP service via WAN interface.

Terminal Service:  Enable/Disable the  SSH service via WAN interface.

Fallback Settings:  Enable/Disable the Fallback interface.

Keepalive_Script:  Set the keepalive_scrpt interval.

image-20240719152237-3.png

3.5.3 System --> Backup/Restore

image-20231109150130-9.png

3.5.4 System --> Remoteit

In the System-> Remoteit interface, users can configure the gateway to be accessed remotely via Remote.it.

the users can refer to this link to configure them: Monitor & Remote Access Gateway

image-20231109150415-10.png

3.5.5 System --> Package Management

In the System --> Package Management interface, Users can check the current version of Core Packages.

image-20231109150446-11.png

4. Build-in Server

the default factory version of MS48-LR is installed with the built-in Applicant server: Node-Red, LoRaWAN Server: ChirpStack.

Note:

         Path: Server --> Network Server 

                   Server --> Application Server

Troubleshooting:

         1. URL does not jump properly

                For the ChirpStack, you can use the local IP address and the port is 8080 to access it.

                For the Node-Red, you can use the local IP address and the port is 1880 to access it.

4.1 LoRaWAN Network Server -- ChirpStack

You can access the gateway's built-in LNS server of ChirpStack via the URL( http://<hostname>:8080 or http://<local-IPV4-address> ) in your browser.

Such as  http://dragino-54ff12:8080  or http://<Local-IPV4-Address>

Login account:

Username :        admin

Password:          admin

image-20230616175332-6.png

4.2 Application Server -- Node-Red

You can access the gateway's built-in AS server of Node-Red via the URL(http://<hostname>:1880 or http://<local-IPV4-address>) in your browser.

Such as http://dragino-54ff12:1880  or http://<Local-IPV4-Address>

image-20220725172124-3.png

Using Node-Red, InfluxDB and Grafana

The MS48-LR supports this combination, the default, Node-red is pre-installed but the InfluxDB and Grafana is not pre-installed.

the users can refer to this link to install them.

http://wiki.dragino.com/xwiki/bin/view/Main/Armbian%20OS%20instruction/#H2.6HowtoinstallGrafanaandinfluxdb

Upgrade the node.js

By default, the MS48-LR node.js uses the pre-install version v12 which is due to Debian the ultra-stable via ultra-old.

the users can refer to this link to upgrade them.

http://wiki.dragino.com/xwiki/bin/view/Main/Armbian%20OS%20instruction/#H2.5Howtoupgradethenodejsversiontothelatest.

5. Use RS232 Interface

MS48-LR includes a local ChirpStack Server and Node-Red. This example shows how to configure LHT65N to use with the local Node-Red server. This example assumes users already have:

  • LHT65N register on MS48-LR Built-In ChirpStack server already
  • The user is able to see the data on the built-in ChirpStack server device page
  • The RS232 relay is connected to the RS232 interface of the MS48-LR

The MS48-LR RS232 interface corresponds to /dev/ttyS2.

Below are the steps for the MS48-LR read LHT65N's temperature control RS232 relay example:

image-20240115155839-1.png

1705307593665-981.png

5.1 Link Node-Red to Local ChirpStack

Users can download the Node-Red decoder from this link and import it into the Node-Red platform: MS48-LR read LHT65N's temperature control RS232 relay.json

For more information on importing Input Flow, check out this link: Import Input Flow for Dragino Sensors

After importing the Input Flow is complete, the user needs to edit the MQTT in the node

The specific steps can be found at this link: Example: Use Local Server ChirpStack and Node-Red

image-20240115161940-2.png

6. Use RS485 Interface

The MS48-LR RS485 interface corresponds to /dev/ttyS1.

Below are the steps for the MS48-LR RS485 interface to manually send and receive data:

image-20240702105904-12.png

6.1 Initialize the GPIO21

Users need to run the following command to configure GPIO21:

echo 21 > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio21/direction

6.2 Set the RS485 Tx Mode

Set the MS48-LR RS485 port to Tx mode by lowering the GPIO21 level:

echo "0" > /sys/class/gpio/gpio21/value

Run the following command to send hexadecimal data:

echo -en "\x01\x02\x03\x04\x05" > /dev/ttyS1

image-20240702100108-8.jpeg

Users can use the serial port tool to check the data sent by MS48-LR RS485:

image-20240702100337-9.png

6.3 Set the RS485 Rx Mode

Set the MS48-LR RS485 port to Rx mode by pulling up the GPIO21 level:

echo "1" > /sys/class/gpio/gpio21/value

Run the following command to check the data received by the MS48-LR RS485:

cat /dev/ttyS1 | xxd -p -u

image-20240702110051-13.png

7. More Services

 

Tags:
    
Copyright ©2010-2024 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0