Wiki source code of MS48-LR -- LoRaWAN To Modbus Gateway
Last modified by Kilight Cao on 2025/02/28 09:31
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | (% style="text-align:center" %) | ||
2 | ((( | ||
3 | (% style="text-align:center" %) | ||
4 | [[image:image-20231127105359-1.png||_mstalt="430768" height="453" width="453"]] | ||
5 | |||
6 | |||
7 | (% style="display:none" %) (%%) | ||
8 | |||
9 | |||
10 | |||
11 | ))) | ||
12 | |||
13 | **Table of Contents:** | ||
14 | |||
15 | {{toc/}} | ||
16 | |||
17 | |||
18 | |||
19 | |||
20 | |||
21 | |||
22 | = 1. Introduction = | ||
23 | |||
24 | == 1.1 What is MS48-LR == | ||
25 | |||
26 | |||
27 | ((( | ||
28 | ((( | ||
29 | The MS48-LR is an open-source LoRaWAN gateway that can (% style="color:blue" %)**convert LoRaWAN to Modbus RTU/TCP**(%%). It lets you bridge LoRa wireless network to an IP network via (% style="color:blue" %)**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. | ||
30 | ))) | ||
31 | |||
32 | ((( | ||
33 | The MS48-LR is fully compatible with LoRaWAN protocol. MS48-LR includes a (% style="color:blue" %)**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 (% style="color:blue" %)**LoRaWAN to Modbus RTU/TCP**(%%). | ||
34 | ))) | ||
35 | |||
36 | ((( | ||
37 | 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. | ||
38 | ))) | ||
39 | |||
40 | ((( | ||
41 | MS48-LR supports (% style="color:blue" %)**remote management**(%%). System Integrator can easy to remote monitor the gateway and maintain it. | ||
42 | |||
43 | |||
44 | == 1.2 How does it work? == | ||
45 | |||
46 | |||
47 | 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 | ||
48 | |||
49 | [[image:image-20231111103753-1.png||_mstalt="427583" height="585" width="1031"]] | ||
50 | |||
51 | |||
52 | ))) | ||
53 | |||
54 | == 1.3 Specifications == | ||
55 | |||
56 | |||
57 | (% style="color:#037691" %)**Hardware System:** | ||
58 | |||
59 | * CPU: Quad-core Cortex-A7 1.2Ghz | ||
60 | * RAM: 512MB | ||
61 | * eMMC: 4GB | ||
62 | |||
63 | (% style="color:#037691" %)**Interface:** | ||
64 | |||
65 | * 10M/100M RJ45 Ports x 1 | ||
66 | * Multi-Channel LoRaWAN Wireless | ||
67 | * WiFi 802.11 b/g/n | ||
68 | * USB 2.0 host connector x 1 | ||
69 | * Mini-PCI E connector x 1 | ||
70 | * RS485 Interface x 1 | ||
71 | * RS232 Interface x 1 | ||
72 | |||
73 | (% style="color:#037691" %)**LoRa Spec:** | ||
74 | |||
75 | * Up to -140 dBm sensitivity with SX1250 Tx/Rx front-end | ||
76 | * 70 dB CW interferer rejection at 1 MHz offset | ||
77 | * Able to operate with negative SNR, CCR up to 9dB | ||
78 | * 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 | ||
79 | * Dual digital TX & RX radio front-end interfaces | ||
80 | * 10 programmable parallel demodulation paths | ||
81 | * Dynamic data-rate (DDR) adaptation | ||
82 | * True antenna diversity or simultaneous dual-band operation | ||
83 | |||
84 | (% style="color:#037691" %)**Cellular 4G LTE (optional):** | ||
85 | |||
86 | * Quectel: [[**EC25 LTE module**>>url:https://www.quectel.com/product/ec25minipcie.htm||_mstmutation="1"]] | ||
87 | * Standard Size SIM Slot | ||
88 | * 2 x 4G Sticker Antenna. | ||
89 | * Up to 150Mbps downlink and 50Mbps uplink data rates | ||
90 | * Worldwide LTE,UMTS/HSPA+ and GSM/GPRS/EDGE coverage | ||
91 | * MIMO technology meets demands for data rate and link reliability in modem wireless communication systems | ||
92 | |||
93 | (% style="color:#037691" %)**Operating Condition:** | ||
94 | |||
95 | * Work Temperature: -20 ~~ 70°C | ||
96 | * Storage Temperature: -20 ~~ 70°C | ||
97 | * Power Input: 12V, 2A, DC | ||
98 | |||
99 | == 1.4 Features == | ||
100 | |||
101 | |||
102 | * Open Source Debian system | ||
103 | * Managed by Web GUI, SSH via WAN or WiFi | ||
104 | * Remote Management | ||
105 | * Auto-provisioning for batch deployment and management | ||
106 | * LoRaWAN Gateway | ||
107 | * 10 programmable parallel demodulation paths | ||
108 | * Pre-configured to support different LoRaWAN regional settings. | ||
109 | * Allow customizing LoRaWAN regional parameters. | ||
110 | * Different kinds of LoRaWAN Connections such as | ||
111 | ** Semtech UDP Packet Forwarder | ||
112 | ** LoRaWAN Basic Station | ||
113 | ** ChirpStack-Gateway-Bridge (MQTT) | ||
114 | * Built-in (% style="color:#037691" %)**ChirpStack**(%%) local LoRaWAN server | ||
115 | * Built-in (% style="color:#037691" %)**Node-Red**(%%) local Application server | ||
116 | * Act as Modbus Slave mode | ||
117 | |||
118 | == 1.5 LED Indicators == | ||
119 | |||
120 | |||
121 | MS48-LR has totally four LEDs, They are: | ||
122 | |||
123 | (% style="color:blue" %)**➢ LED 1 (ETH LED):**(%%) This GREEN LED will blink GREEN when the ETH port is connecting | ||
124 | |||
125 | (% style="color:blue" %)**➢ LED 2 (RET LED):**(%%) This GREEN LED will show different colors in different states: | ||
126 | |||
127 | ✓ **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. | ||
128 | |||
129 | ✓ **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. | ||
130 | |||
131 | (% style="color:blue" %)**➢ LED 3:**(%%) This GREEN LED is undefined | ||
132 | |||
133 | (% style="color:blue" %)**➢ LED 4 (Power LED):**(%%) This GREEN LED will be solid if the device is properly powered | ||
134 | |||
135 | (% style="color:blue" %)**➢ LED 5 (WIFI LED): **(%%)This LED shows the WIFI interface connection status. | ||
136 | |||
137 | ✓ **SOLID GREEN:** The device enables the WiFi WAN Client and connects to the WiFi successfully. | ||
138 | |||
139 | ✓ **BLINKING GREEN:** The device's WiFi WAN Client connection is unsuccessful. | ||
140 | |||
141 | ✓** OFF:** The device WiFi WAN Client is not enabled. | ||
142 | |||
143 | (% style="color:blue" %)**➢ LED 6 (SYS LED):**(%%) This GREEN LED will show different colors in different states: | ||
144 | |||
145 | ✓ **SOLID GREEN:** The device is alive with a LoRaWAN server connection. | ||
146 | |||
147 | ✓ **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 | ||
148 | |||
149 | ✓** OFF:** Device doesn't have an Internet connection. | ||
150 | |||
151 | |||
152 | == 1.6 RS485 & RS232 interface == | ||
153 | |||
154 | [[image:image-20240108150505-1.png||_mstalt="428103" height="576" width="678"]] | ||
155 | |||
156 | |||
157 | == 1.7 Button Instruction == | ||
158 | |||
159 | |||
160 | The MS48-LR has two black buttons, which are: | ||
161 | |||
162 | |||
163 | **RST: **Press and release, and the gateway will restart | ||
164 | |||
165 | **LED status: ** All LEDs are off except for the LED 4 (Power LED). | ||
166 | |||
167 | |||
168 | **Toggle:** | ||
169 | |||
170 | (% style="color:blue" %)**//➢ //Long press 4-5s : **(%%)the gateway will reload the Network and Initialize wifi configuration | ||
171 | |||
172 | // // (% _mstmutation="1" %)**LED status: **(%%) LED 2 (RET LED) will SOLID GREEN Until the reload is finished. | ||
173 | |||
174 | (% style="color:blue" %)**➢ Long press more than 10s: **(%%)the gateway will restore the factory settings. | ||
175 | |||
176 | (% _mstmutation="1" %)**LED status: **(%%) LED 2 (RET LED) will BLINKIND GREEN Until the restore is finished. | ||
177 | |||
178 | |||
179 | |||
180 | == 1.8 Installation == | ||
181 | |||
182 | |||
183 | [[image:image-20240122115220-1.png||_mstalt="425412"]] | ||
184 | |||
185 | |||
186 | = 2. Quick Start = | ||
187 | |||
188 | |||
189 | The MS48-LR supports network access via Ethernet or Wi-Fi connection and runs without a network. | ||
190 | |||
191 | In most cases, the first thing you need to do is make the MS48-LR accessible to the network. | ||
192 | |||
193 | |||
194 | == 2.1 Access and Configure MS48-LR == | ||
195 | |||
196 | === 2.1.1 Find IP address of MS48-LR === | ||
197 | |||
198 | |||
199 | ==== (% style="color:blue" %)**Method 1**(%%): Connect via MS48-LR WiFi ==== | ||
200 | |||
201 | |||
202 | At the first boot of MS48-LR, it will auto generate a WiFi network called (% style="color:green" %)**//dragino-xxxxxx //**(%%)with password: | ||
203 | |||
204 | (% style="background-color:yellow" %)**dragino+dragino** | ||
205 | |||
206 | 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 (% style="color:green" %)**10.130.1.1** | ||
207 | |||
208 | |||
209 | |||
210 | [[image:image-20240119093621-1.png||_mstalt="429988" height="365" width="850"]] | ||
211 | |||
212 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20All%20Gateway%20models/HP0C/WebHome/image-20230527085250-2.png?width=284&height=495&rev=1.1||_mstalt="430508" alt="image-20230527085250-2.png"]] | ||
213 | |||
214 | |||
215 | ==== (% style="color:blue" %)**Method 2**(%%): Connect via Ethernet with DHCP IP from the router ==== | ||
216 | |||
217 | |||
218 | ((( | ||
219 | 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. | ||
220 | ))) | ||
221 | |||
222 | ((( | ||
223 | You can also use this IP to connect. | ||
224 | ))) | ||
225 | |||
226 | |||
227 | [[image:image-20240119093637-2.png||_mstalt="432705" height="372" width="1141"]] | ||
228 | |||
229 | |||
230 | ==== (% style="color:blue" %)**Method 3**(%%): Connect via MS48-LR Fallback IP ==== | ||
231 | |||
232 | [[image:image-20240119093652-3.png||_mstalt="432029"]] | ||
233 | |||
234 | |||
235 | |||
236 | (% style="color:blue" %)**Steps to connect via fallback IP:** | ||
237 | |||
238 | ~1. Connect the PC's Ethernet port to MS48-LR's WAN port | ||
239 | |||
240 | 2. Configure PC's Ethernet port has IP: 172.31.255.253 and Netmask: 255.255.255.252 | ||
241 | |||
242 | |||
243 | **Settings ~-~-> Network & Internet ~-~-> Ethernet ~-~-> Change advanced sharing options ~-~-> Double-click"Ethernet" ~-~-> Internet Protocol Version 4 (TCP/IPv4)** | ||
244 | |||
245 | |||
246 | As in the below photo: | ||
247 | |||
248 | |||
249 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20All%20Gateway%20models/HP0C/WebHome/image-20230413172038-1.png?width=1243&height=732&rev=1.1||_mstalt="429143" alt="image-20230413172038-1.png"]] | ||
250 | |||
251 | Configure computer Ethernet port steps video: **[[attach:fallback ip.mp4||target="_blank"]]** | ||
252 | |||
253 | If you still can't access the MS48-LR fallback ip, follow this connection to debug : **[[Trouble Shooting>>http://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20All%20Gateway%20models/HP0C/#H9.3A0FallbackIPdoesnotwork2Chowcanuserscheck]]** | ||
254 | |||
255 | |||
256 | 3. In the PC, use IP address 172.31.255.254 to access the MS48-LR via Web or Console. | ||
257 | |||
258 | [[image:image-20240119093803-4.png||_mstalt="431730" height="664" width="1217"]] | ||
259 | |||
260 | |||
261 | ==== (% style="color:blue" %)**Method 4**(%%): Connect via WiFi with DHCP IP from the router ==== | ||
262 | |||
263 | |||
264 | [[image:image-20240119093834-5.png||_mstalt="433407" height="336" width="1020"]] | ||
265 | |||
266 | Fill in the WiFi information by checking the box and clicking (% style="color:red" %)**Save&Apply** | ||
267 | |||
268 | [[image:image-20240119093902-6.png||_mstalt="432432" height="382" width="1082"]] | ||
269 | |||
270 | |||
271 | **Wi-Fi configuration successful** | ||
272 | |||
273 | [[image:image-20240119093944-7.png||_mstalt="434772" height="562" width="1093"]] | ||
274 | |||
275 | |||
276 | === 2.1.2 Access Configure Web UI === | ||
277 | |||
278 | |||
279 | **Web Interface** | ||
280 | |||
281 | Open a browser on the PC and type the MS48-LR ip address (depends on your connect method) | ||
282 | |||
283 | [[**//http:~~/~~/IP_ADDRESS //**>>url:http://ip_address/]] or //**[[http:~~/~~/172.31.255.254>>url:http://172.31.255.254(/]]**//(Fallback IP) | ||
284 | |||
285 | You will see the login interface of MS48-LR as shown below. | ||
286 | |||
287 | The account details for Web Login are: | ||
288 | |||
289 | **User Name: root** | ||
290 | |||
291 | **Password: dragino** | ||
292 | |||
293 | [[image:image-20240320134426-1.png||_mstalt="428285"]] | ||
294 | |||
295 | |||
296 | == 2.2 Typical Network Setup == | ||
297 | |||
298 | === 2.2.1 Overview === | ||
299 | |||
300 | |||
301 | 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: | ||
302 | |||
303 | * **WAN Port Internet Mode** | ||
304 | |||
305 | * **WiFi Client Mode** | ||
306 | |||
307 | * **Cellular Mode** | ||
308 | |||
309 | === 2.2.2 Use the WAN port to access the Internet === | ||
310 | |||
311 | |||
312 | 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 (% style="color:blue" %)**home page**: | ||
313 | |||
314 | [[image:image-20240108114745-4.png||_mstalt="431171" height="471" width="912"]] | ||
315 | |||
316 | |||
317 | === 2.2.3 Access the Internet as a WiFi Client === | ||
318 | |||
319 | |||
320 | In the WiFi Client Mode, MS48-LR acts as a WiFi client and gets DHCP from an upstream router via WiFi. | ||
321 | |||
322 | The settings for WiFi Client is under page (% style="color:blue" %)**Network ~-~-> Wi-Fi** | ||
323 | |||
324 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20All%20Gateway%20models/HP0C/WebHome/image-20230411095739-1.png?width=691&height=264&rev=1.1||_mstalt="432341" alt="image-20230411095739-1.png"]] | ||
325 | |||
326 | |||
327 | In the WiFi Survey Choose the WiFi AP, and input the Passphrase then click(% style="color:blue" %)** Save & Apply**(%%) to connect. | ||
328 | |||
329 | [[image:image-20240108114602-3.png||_mstalt="428181" height="477" width="925"]] | ||
330 | |||
331 | |||
332 | === 2.2.4 Use built-in 4G modem for internet access === | ||
333 | |||
334 | |||
335 | Users can see whether MS48-LR has EC25 on the label of the gateway to determine whether there is 3G/4G Cellular modem. | ||
336 | |||
337 | If the MS48-LR has 3G/4G Cellular modem, user can use it as main internet connection or back up. | ||
338 | |||
339 | First, install the Micro SIM card as below direction | ||
340 | |||
341 | Second, Power off/ ON MS48-LR to let it detect the SIM card. | ||
342 | |||
343 | [[image:image-20240320134750-2.png||_mstalt="428532"]] | ||
344 | |||
345 | |||
346 | The set up page is (% style="color:blue" %)**Network ~-~-> Cellular** | ||
347 | |||
348 | 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. | ||
349 | |||
350 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20All%20Gateway%20models/LPS8N%20-%20LoRaWAN%20Gateway%20User%20Manual/WebHome/1657090932270-444.png?rev=1.1||_mstalt="294190" alt="1657090932270-444.png"]] | ||
351 | |||
352 | |||
353 | When cellular fails to connect or has problems, users can refer to this link to Trouble Shooting:**[[How to Trouble Shooting if Cellular connection fails>>https://wiki.dragino.com/xwiki/bin/view/Main/Notes%20for%20cellular%20network%20connection/#H2.2ForLPS8v22FMS48-LR]]** | ||
354 | |||
355 | |||
356 | === 2.2.5 Check Internet connection === | ||
357 | |||
358 | |||
359 | In the (% style="color:blue" %)**Home**(%%) page, we can check the Internet connection. | ||
360 | |||
361 | * GREEN Tick [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20All%20Gateway%20models/LPS8N%20-%20LoRaWAN%20Gateway%20User%20Manual/WebHome/1652436675869-206.png?width=15&height=14&rev=1.1||_mstalt="297271" alt="1652436675869-206.png"]] : This interface has Internet connection. | ||
362 | * Yellow Tick [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20All%20Gateway%20models/LPS8N%20-%20LoRaWAN%20Gateway%20User%20Manual/WebHome/1652436705761-420.png?width=15&height=15&rev=1.1||_mstalt="293215" alt="1652436705761-420.png"]] : This interface has IP address but don't use it for internet connection. | ||
363 | * RED Cross [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20All%20Gateway%20models/LPS8N%20-%20LoRaWAN%20Gateway%20User%20Manual/WebHome/1652436787176-950.png?width=15&height=14&rev=1.1||_mstalt="297557" alt="1652436787176-950.png"]] : This interface doesn't connected or no internet. | ||
364 | |||
365 | (% class="wikigeneratedid" %) | ||
366 | [[image:image-20240108115101-6.png||_mstalt="427674" height="467" width="905"]] | ||
367 | |||
368 | |||
369 | == 2.3 Bridge LoRaWAN network to Modbus network == | ||
370 | |||
371 | |||
372 | By following the steps below in the configuration example, Users can convert the uplink data of the lorawan sensor to modbus RTU/TCP data | ||
373 | |||
374 | MS48-LR eliminates the need to add additional lorawan gateways to implement (% style="color:blue" %)**LoRaWAN to Modbus RTU/TCP** | ||
375 | |||
376 | |||
377 | === **Step 1: Configure the LoRa Radio to your area Frequency Plan** === | ||
378 | |||
379 | |||
380 | The Frequency Plan has to be set the same as the Sensor node Frequency Plan. | ||
381 | |||
382 | [[image:image-20231108164616-1.png||_mstalt="430573" height="353" width="765"]] | ||
383 | |||
384 | |||
385 | === **Step 2: Copy the unique Gateway EUI & Configure the LoRaWAN Server address** === | ||
386 | |||
387 | |||
388 | Users need to connect the MS48-LR configuration to the built-in lorawan server. | ||
389 | |||
390 | Every MS48-LR has a unique gateway EUI. The ID can be found on the LoRaWAN Semtech page: | ||
391 | |||
392 | [[image:image-20231110160659-1.png||_mstalt="429858" height="804" width="1004"]] | ||
393 | |||
394 | |||
395 | === **Step 3: Enable the Built-in LoRaWAN Network Server** === | ||
396 | |||
397 | |||
398 | [[image:image-20231110163133-2.png||_mstalt="426881" height="522" width="1015"]] | ||
399 | |||
400 | |||
401 | === **Step 4: Logging to the Built-in LoRaWAN Network Server** === | ||
402 | |||
403 | |||
404 | [[image:image-20231110170323-4.png||_mstalt="427297" height="526" width="1006"]] | ||
405 | |||
406 | |||
407 | === **Step 5: Register the gateway to the built-in ChirpStack** === | ||
408 | |||
409 | |||
410 | Copy Gateway EUI from the previous step to the following interface: | ||
411 | |||
412 | [[image:image-20231110170802-5.png||_mstalt="428233" height="675" width="1011"]] | ||
413 | |||
414 | |||
415 | === **Step 6: Register the Sensor-node to the built-in ChirpStack** === | ||
416 | |||
417 | |||
418 | 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. | ||
419 | |||
420 | First we need to add the Device Profiles and Application (ignore them if they are already done). | ||
421 | |||
422 | |||
423 | ==== **1) Add Device Profiles** ==== | ||
424 | |||
425 | [[image:image-20231110172143-6.png||_mstalt="428649" height="641" width="1017"]] | ||
426 | |||
427 | |||
428 | ==== **2) Add End Node Device** ==== | ||
429 | |||
430 | |||
431 | **Create an Application** | ||
432 | |||
433 | [[image:image-20231110172604-8.png||_mstalt="429975"]] | ||
434 | |||
435 | |||
436 | Add a device for the sensor node | ||
437 | |||
438 | [[image:image-20231109092517-2.png||_mstalt="431210" height="516" width="1000"]] | ||
439 | |||
440 | |||
441 | Enter Device EUI, Join EUI(APP EUI)and APPKEY of the node Device, and select the Device profile added in the previous step | ||
442 | |||
443 | [[image:image-20231110173714-9.png||_mstalt="431275" height="519" width="1002"]] | ||
444 | |||
445 | |||
446 | [[image:image-20231110175007-11.png||_mstalt="450762" height="660" width="1004"]] | ||
447 | |||
448 | |||
449 | === **Step 7: Configure Modbus RTU/TCP Slave** === | ||
450 | |||
451 | |||
452 | 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. | ||
453 | |||
454 | |||
455 | 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. | ||
456 | |||
457 | So the sensor node 70b3d57ed0051e22 uplink data will be written to the 0xABCD - 0xABE1 register. | ||
458 | |||
459 | (% style="color:red" %)**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.** | ||
460 | |||
461 | **Slave Setting:** | ||
462 | |||
463 | Slave Mode ~-~--> Support both RTU and TCP mode | ||
464 | |||
465 | Enable Modbus Slave ~-~--> Enable Slave | ||
466 | |||
467 | Slave Address/Port ~-~--> Set the slave address/port | ||
468 | |||
469 | Show Sensor History ~-~--> See the sensor data log | ||
470 | |||
471 | |||
472 | **Sensor Settings:** | ||
473 | |||
474 | Device EUI ~-~--> Sensor node's EUI | ||
475 | |||
476 | Register Start ~-~--> Setting the start register address to write the sensor node's data | ||
477 | |||
478 | Register Length ~-~--> The maximum write length with register | ||
479 | |||
480 | (% style="color:red" %)**Note: Only 1 sensor can be written in the range set by the registers** | ||
481 | |||
482 | About how long the register needs to be configured: | ||
483 | In most cases, the payload length of Dragino's sensor is 11 bytes, which corresponds to a register length of 6. | ||
484 | The modbus data forwarded by the gateway will have the Dev Address, Fcnt, Rssi, Payload, and Date of the sensor. | ||
485 | **Dev Address** occupies 2, **Fcnt** occupies 1, **Rssi** occupies 1, **Date** occupies 2, so by default you need to configure the register length to be greater than or for 12. | ||
486 | |||
487 | User can check the payload length on the Event page: | ||
488 | |||
489 | [[image:image-20250207115927-2.png]] | ||
490 | |||
491 | |||
492 | |||
493 | ==== **1) RTU Mode**: ==== | ||
494 | |||
495 | (% class="wikigeneratedid" id="H" %) | ||
496 | [[image:image-20240112143033-1.png||_mstalt="426140" height="755" width="1318"]] | ||
497 | |||
498 | |||
499 | 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. | ||
500 | |||
501 | Then MS48-LR will write the uplink data to the 03 code register and record the uplink data. | ||
502 | |||
503 | |||
504 | **PLC read the MS48-LR register** | ||
505 | |||
506 | **Settings: ** | ||
507 | |||
508 | **Function : 03 code** | ||
509 | |||
510 | **Bit rate : 9600** | ||
511 | |||
512 | **Parity bit : none** | ||
513 | |||
514 | **Stop bit : 1** | ||
515 | |||
516 | **Response Timeout : Greater than 3000ms** | ||
517 | |||
518 | |||
519 | ==== (% style="color:inherit; font-family:inherit; font-size:20px" %)**2) TCP Mode:**(%%) ==== | ||
520 | |||
521 | (% class="wikigeneratedid" id="H-1" %) | ||
522 | [[image:image-20240112143439-2.png||_mstalt="429780" height="604" width="1065"]] | ||
523 | |||
524 | |||
525 | **PLC read the MS48-LR register** | ||
526 | |||
527 | **Settings: ** | ||
528 | |||
529 | **Function : 03 code** | ||
530 | |||
531 | **IP Address : Gateway IP Address** | ||
532 | |||
533 | **Server Port : Slave Port** | ||
534 | |||
535 | **Connect Timeout : Greater than 3000ms** | ||
536 | |||
537 | |||
538 | ==== **3) PLC(Modbus server/master) data show:** ==== | ||
539 | |||
540 | [[image:image-20231111105300-3.png||_mstalt="425022"]] | ||
541 | |||
542 | |||
543 | **History Data:** | ||
544 | |||
545 | **Click the Show Sensor History will launch to this page** | ||
546 | |||
547 | [[image:image-20231111105548-4.png||_mstalt="430014" height="763" width="1054"]] | ||
548 | |||
549 | |||
550 | === **Step 8: Configure Sensor decode to Built-in Chirpstack** === | ||
551 | |||
552 | |||
553 | ==== **1) Add Sensor's decode to Chirpstack** ==== | ||
554 | |||
555 | Users can find the ChirpStack v4 decoder code for the Dragino End node in this link: | ||
556 | |||
557 | [[https:~~/~~/github.com/dragino/dragino-end-node-decoder>>url:https://github.com/dragino/dragino-end-node-decoder]] | ||
558 | |||
559 | **If the user's sensor is from another manufacturer, you need to search for the chirpstack decoder of the corresponding sensor on the official website of the corresponding manufacturer.** | ||
560 | |||
561 | |||
562 | The following example is to add the LHT65N decoder: | ||
563 | |||
564 | [[image:image-20240319145115-3.png||_mstalt="430092" height="815" width="1004"]] | ||
565 | |||
566 | [[image:image-20240319145749-4.png||_mstalt="434655" height="758" width="1005"]] | ||
567 | |||
568 | |||
569 | ==== **2) Check the decode on ChiprStack** ==== | ||
570 | |||
571 | [[image:image-20240319145903-5.png||_mstalt="432315" height="705" width="1020"]] | ||
572 | |||
573 | |||
574 | === **Step 9: Configure Modbus RTU/TCP Slave Sensor Decode** === | ||
575 | |||
576 | |||
577 | (% class="MsoNormal" %) | ||
578 | (% lang="EN-US" style="background-attachment:initial; background-clip:initial; background-image:initial; background-origin:initial; background-position:initial; background-repeat:initial; background-size:initial" %)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. | ||
579 | |||
580 | (% class="MsoNormal" %) | ||
581 | (% lang="EN-US" style="background-attachment:initial; background-clip:initial; background-image:initial; background-origin:initial; background-position:initial; background-repeat:initial; background-size:initial" %)Add Decode Data TempC_SHT, the register start address is 0x000F and the register length is 2,(%%) which means the Decode Data TempC_(% lang="EN-US" style="background-attachment:initial; background-clip:initial; background-image:initial; background-origin:initial; background-position:initial; background-repeat:initial; background-size:initial" %)SHT(%%) will be written to the register starting at 0x000F register and the maximum write length not to exceed 2 registers. | ||
582 | |||
583 | ((( | ||
584 | |||
585 | ))) | ||
586 | |||
587 | (% class="MsoNormal" %) | ||
588 | (% lang="EN-US" style="background-attachment:initial; background-clip:initial; background-image:initial; background-origin:initial; background-position:initial; background-repeat:initial; background-size:initial" %)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. | ||
589 | |||
590 | (% class="MsoNormal" %) | ||
591 | (% style="color:red" %)**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.** | ||
592 | |||
593 | ((( | ||
594 | |||
595 | ))) | ||
596 | |||
597 | (% style="margin: 0cm 0cm 7.5pt; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;" %) | ||
598 | (% lang="EN-US" style="font-size:10.5pt" %)**Decode Data:** | ||
599 | |||
600 | (% style="margin: 0cm 0cm 7.5pt; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;" %) | ||
601 | (% lang="EN-US" style="font-size:10.5pt" %)Device (%%)Type(% lang="EN-US" style="font-size:10.5pt" %) ~-~--> Sensor decoder data | ||
602 | |||
603 | (% style="margin: 0cm 0cm 7.5pt; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;" %) | ||
604 | (% lang="EN-US" style="font-size:10.5pt" %)Register Start ~-~--> Setting the start register address to write the sensor node's decoder data | ||
605 | |||
606 | (% style="margin: 0cm 0cm 7.5pt; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;" %) | ||
607 | (% lang="EN-US" style="font-size:10.5pt" %)Register Length ~-~--> The maximum write length with register | ||
608 | |||
609 | ((( | ||
610 | |||
611 | ))) | ||
612 | |||
613 | (% style="margin: 0cm 0cm 7.5pt; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;" %) | ||
614 | (% lang="EN-US" style="color:red; font-size:10.5pt" %)**Note: Only 1 Data can be written in the range set by the registers** | ||
615 | |||
616 | (% style="margin: 0cm 0cm 7.5pt; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;" %) | ||
617 | [[image:1710569938804-766.png||_mstalt="298597" height="656" width="917"]] | ||
618 | |||
619 | ((( | ||
620 | |||
621 | ))) | ||
622 | |||
623 | (% style="margin: 0cm 0cm 7.5pt; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;" %) | ||
624 | ==== **PLC(Modbus server/master) data show:** ==== | ||
625 | |||
626 | |||
627 | (% style="color:red" %)**Note: Since the decoded data is of floating point type, it is converted to an integer before being written to the Mobdbus' registers.** | ||
628 | |||
629 | For example: 23.20(real data) ~-~--> 2320[Dec]=0x08FE[Hex](register show). | ||
630 | |||
631 | |||
632 | (% style="color:red" %)**When the decoded data is negative, the data will be added to 0x10000** | ||
633 | |||
634 | For example: -23.20(real data) ~-~--> -2320+0x10000=63216[Dec]=0xF6F0[Hex](register show). | ||
635 | |||
636 | [[image:1710570017983-979.png||_mstalt="298571" height="694" width="531"]] | ||
637 | |||
638 | |||
639 | == 2.4 Accept data to registers for specified Fport == | ||
640 | |||
641 | |||
642 | For example, there is a sensor node EUI is f4bbf5a0da6f4da5, | ||
643 | |||
644 | * the sensor payload uplink is using Fport=2 | ||
645 | * the sensor status uplink is using Fport=5 | ||
646 | |||
647 | **//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.//** | ||
648 | |||
649 | |||
650 | To avoid 0 data being written to the registers. the users can set accept Fport for the sensor, | ||
651 | |||
652 | i.e., the data will be written to the register only when the MS48-LR receives the uplink of the specified Fort | ||
653 | |||
654 | |||
655 | (% style="margin: 0cm 0cm 7.5pt; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;" %) | ||
656 | **Accept Fport(% lang="EN-US" style="font-size:10.5pt" %):(%%)** | ||
657 | |||
658 | (% style="margin: 0cm 0cm 7.5pt; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;" %) | ||
659 | (% lang="EN-US" style="font-size:10.5pt" %)DevEUI ~-~--> Sensor node DevEUI | ||
660 | |||
661 | (% style="margin: 0cm 0cm 7.5pt; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;" %) | ||
662 | Accept FPort(% lang="EN-US" style="font-size:10.5pt" %) ~-~--> Setting the (%%)Accept Fport | ||
663 | |||
664 | |||
665 | [[image:image-20240606153055-1.png||_mstalt="429715"]] | ||
666 | |||
667 | |||
668 | === **PLC(Modbus server/master) data show:** === | ||
669 | |||
670 | [[image:image-20240606155134-2.png||_mstalt="430001"]] | ||
671 | |||
672 | |||
673 | [[image:image-20240606155545-3.png||_mstalt="432276"]] | ||
674 | |||
675 | |||
676 | == 2.5 Modbus Downlink == | ||
677 | |||
678 | |||
679 | The user can use Modbus downlink to send a payload to the sensor device | ||
680 | |||
681 | **Prerequisites:** | ||
682 | |||
683 | The preceding configurations are complete and the sensor data is forwarded properly | ||
684 | |||
685 | |||
686 | === **Step 1. Generate chirpstack API token** === | ||
687 | |||
688 | |||
689 | Users can generate API tokens on the **API Keys** interface with built-in chirpstack | ||
690 | |||
691 | Copy and save the API token after it is generated. | ||
692 | |||
693 | [[image:image-20241230113013-6.png||height="345" width="1347"]] | ||
694 | |||
695 | |||
696 | === **Step 2. Configuring API tokens and reloading the modbus service** === | ||
697 | |||
698 | |||
699 | Configure the API token from step 1 on the Downlink token and click "**Reload**" | ||
700 | |||
701 | [[image:image-20241230110939-2.jpeg]] | ||
702 | |||
703 | |||
704 | === **Step 3. Configure downlink registers for the device** === | ||
705 | |||
706 | |||
707 | For example, there is a sensor node EUI is a84041a77259044c, the register start is 0x10 and the register length is 3, which means the downlink data will be written to the register starting at 0x10 register and the maximum write length not to exceed 3 registers. | ||
708 | |||
709 | So the sensor node a84041a77259044c downlink data will be written to the 0x10 - 0x13 register. | ||
710 | |||
711 | |||
712 | **Downlink Settings:** | ||
713 | |||
714 | Device EUI ~-~--> Sensor node's EUI | ||
715 | |||
716 | Register Address(Start) ~-~--> Setting the start register address to write the downlink data | ||
717 | |||
718 | Register Length ~-~--> The maximum write length with register | ||
719 | |||
720 | (% style="color:red" %)**Note: Only 1 sensor can be written in the range set by the registers** | ||
721 | |||
722 | [[image:image-20241230113057-8.jpeg||height="431" width="1197"]] | ||
723 | |||
724 | |||
725 | === **Step 4. Sent downlink to the MS48** === | ||
726 | |||
727 | |||
728 | For example, there is a sensor node EUI is a84041a77259044c, downlink is 2601 | ||
729 | |||
730 | (% style="color:red" %)**Note: that you need to use 16 function codes to write downlink data for the registers** | ||
731 | |||
732 | It is required that the downlink registers do not hold data in existence, otherwise a large number of downlink will be generated | ||
733 | |||
734 | [[image:image-20241230112132-4.jpeg||height="720" width="1089"]] | ||
735 | |||
736 | |||
737 | By default, each register occupies 16 bits (2 bytes). Therefore, when the client sends data such as 030101, it is necessary to directly add FFFFF in the single register, for example: 0x0301, 0xFFFF, 0xFF01, | ||
738 | |||
739 | the gateway will automatically convert it to 030101 downlink | ||
740 | |||
741 | [[image:image-20250228092430-1.png||height="658" width="937"]] | ||
742 | |||
743 | |||
744 | |||
745 | === **Step 5. Check chirpstack Queue** === | ||
746 | |||
747 | |||
748 | After the downlink is sent, the user can check whether the downlink queue is generated on the **Queue** page of the sensor device on the built-in chirpstack | ||
749 | |||
750 | [[image:image-20241230113037-7.jpeg||height="662" width="1226"]] | ||
751 | |||
752 | |||
753 | The above single-byte register downlink queue results | ||
754 | |||
755 | [[image:image-20250228092545-2.png||height="724" width="1227"]] | ||
756 | |||
757 | = 3. Web Configure Pages = | ||
758 | |||
759 | == 3.1 Home == | ||
760 | |||
761 | |||
762 | Shows the system running status: | ||
763 | |||
764 | |||
765 | == 3.2 LoRa Settings == | ||
766 | |||
767 | === 3.2.1 LoRa ~-~-> LoRa === | ||
768 | |||
769 | |||
770 | 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. | ||
771 | |||
772 | Different MS48-LR hardware versions can support different frequency ranges: | ||
773 | |||
774 | * **868**: valid frequency: 863Mhz ~~ 870Mhz. for bands EU868, RU864, IN865, or KZ865. | ||
775 | * **915**: valid frequency: 902Mhz ~~ 928Mhz. for bands US915, AU915, AS923 or KR920 | ||
776 | |||
777 | After the user choose the frequency plan, the user can see the actual frequency is used by checking the page **LogRead ~-~-> LoRa Log** | ||
778 | |||
779 | [[image:image-20231109145418-1.png||_mstalt="430612" height="372" width="761"]] | ||
780 | |||
781 | |||
782 | (% style="color:red" %)//**Note *: See this instruction for how to customize the frequency band:**//(%%)//** __[[How to customized LoRaWAN frequency band - DRAGINO>>url:http://wiki.dragino.com/xwiki/bin/view/Main/How%20to%20customized%20LoRaWAN%20frequency%20band/]]__**// | ||
783 | |||
784 | |||
785 | == 3.3 LoRaWAN Settings == | ||
786 | |||
787 | === 3.3.1 LoRaWAN ~-~-> LoRaWAN Semtech UDP === | ||
788 | |||
789 | |||
790 | This page is for the connection set up to a general LoRaWAN Network server such as [[TTN>>url:http://www.thethingsnetwork.org/]], [[ChirpStack>>url:https://www.chirpstack.io/]], etc. | ||
791 | |||
792 | [[image:image-20231109145535-2.png||_mstalt="430924" height="577" width="666"]] | ||
793 | |||
794 | |||
795 | === 3.3.2 LoRaWAN ~-~-> LoRaWAN Basic Station === | ||
796 | |||
797 | |||
798 | This page is for the connection set up to the TTN Basic Station, AWS-IoT, etc. | ||
799 | |||
800 | [[image:image-20231109145619-3.png||_mstalt="432302" height="438" width="668"]] | ||
801 | |||
802 | 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>>url:http://wiki.dragino.com/xwiki/bin/view/Main/Use%20of%20LoRaWAN%20Basic%20Station/]]__ | ||
803 | |||
804 | |||
805 | == 3.4 Network Settings == | ||
806 | |||
807 | === 3.4.1 Network ~-~-> WiFi === | ||
808 | |||
809 | |||
810 | Users can configure the wifi WAN and enable Wifi Access Point on this interface | ||
811 | |||
812 | [[image:image-20231109145715-4.png||_mstalt="431626" height="282" width="774"]] | ||
813 | |||
814 | |||
815 | === 3.4.2 Network ~-~-> System Status === | ||
816 | |||
817 | |||
818 | [[image:image-20231109145758-5.png||_mstalt="434304" height="535" width="772"]] | ||
819 | |||
820 | |||
821 | === 3.4.3 Network ~-~-> Network === | ||
822 | |||
823 | |||
824 | In the **Network ~-~-> Network** interface, Users can set the Ethernet WAN static ip address. | ||
825 | |||
826 | [[image:image-20231109145841-6.png||_mstalt="432289" height="248" width="783"]] | ||
827 | |||
828 | |||
829 | === 3.4.4 Network ~-~-> Cellular === | ||
830 | |||
831 | |||
832 | In the (% _mstmutation="1" %)**Network ~-~-> Cellular**(%%) interface, Users can Enable Cellular WAN and configure Celluar.(% style="display:none" %) | ||
833 | |||
834 | (% style="color:red" %)**Note: APN cannot be empty.** | ||
835 | |||
836 | [[image:image-20231109145928-7.png||_mstalt="434681" height="361" width="804"]] | ||
837 | |||
838 | |||
839 | After the configuration is complete, return to the Home interface and put the mouse on the Cell icon to check the Cellular state. | ||
840 | |||
841 | When cellular fails to connect or has problems, users can refer to this link to Trouble Shooting:**[[How to Trouble Shooting if Cellular connection fails>>https://wiki.dragino.com/xwiki/bin/view/Main/Notes%20for%20cellular%20network%20connection/#H2.2ForLPS8v22FMS48-LR]]** | ||
842 | |||
843 | |||
844 | == 3.5 System == | ||
845 | |||
846 | === 3.5.1 System ~-~-> System Overview === | ||
847 | |||
848 | |||
849 | Shows the system info: | ||
850 | |||
851 | [[image:image-20240108114851-5.png||_mstalt="430820" height="575" width="839"]] | ||
852 | |||
853 | |||
854 | === 3.5.2 System ~-~-> System General === | ||
855 | |||
856 | |||
857 | There are two login for MS48-LR: (% style="color:blue" %)**root /dragino**(%%) or (% style="color:blue" %)**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. | ||
858 | |||
859 | This page can be used to set the password for them. | ||
860 | |||
861 | (% style="color:#037691" %)**__Timezone: __**(%%)Set device timezone. | ||
862 | |||
863 | (% style="color:#037691" %)**__Time Synchronization Service: __**(%%) Set the time synchronization server. | ||
864 | |||
865 | (% style="color:#037691" %)**__HTTP Web Service: __**(%%)Enable/Disable the HTTP service via WAN interface. | ||
866 | |||
867 | (% style="color:#037691" %)**__Terminal Service: __**(%%)Enable/Disable the SSH service via WAN interface. | ||
868 | |||
869 | (% style="color:#037691" %)**__Fallback Settings: __**(%%)Enable/Disable the Fallback interface. | ||
870 | |||
871 | (% style="color:#037691" %)**__Keepalive_Script: __**(%%)Set the keepalive_scrpt interval. | ||
872 | |||
873 | |||
874 | [[image:image-20240719152237-3.png||_mstalt="432055" height="701" width="833"]] | ||
875 | |||
876 | |||
877 | === 3.5.3 System ~-~-> Backup/Restore === | ||
878 | |||
879 | |||
880 | [[image:image-20231109150130-9.png||_mstalt="429325" height="217" width="830"]] | ||
881 | |||
882 | |||
883 | === 3.5.4 System ~-~-> Remoteit === | ||
884 | |||
885 | |||
886 | In the **System-> Remoteit** interface, users can configure the gateway to be accessed remotely via Remote.it. | ||
887 | |||
888 | the users can refer to this link to configure them: **[[Monitor & Remote Access Gateway>>url:http://wiki.dragino.com/xwiki/bin/view/Main/Monitor%20%26%20Remote%20Access%20Gateway/?Remote%20Access#H2.1A0RemoteAccessviaRemote.it.]]** | ||
889 | |||
890 | [[image:image-20231109150415-10.png||_mstalt="451308" height="424" width="835"]] | ||
891 | |||
892 | |||
893 | === 3.5.5 System ~-~-> Package Management === | ||
894 | |||
895 | |||
896 | In the **System ~-~-> Package Management** interface, Users can check the current version of Core Packages. | ||
897 | |||
898 | [[image:image-20231109150446-11.png||_mstalt="452998" height="566" width="840"]] | ||
899 | |||
900 | |||
901 | = 4. Build-in Server = | ||
902 | |||
903 | |||
904 | the default factory version of MS48-LR is installed with the built-in Applicant server: **Node-Red**, LoRaWAN Server: **ChirpStack**. | ||
905 | |||
906 | (% style="color:red" %)**Note:** | ||
907 | |||
908 | (% _mstmutation="1" %)**Path**(%%): Server ~-~-> Network Server | ||
909 | |||
910 | Server ~-~-> Application Server | ||
911 | |||
912 | (% style="color:blue" %)**Troubleshooting:** | ||
913 | |||
914 | **~ 1. URL does not jump properly** | ||
915 | |||
916 | For the ChirpStack, you can use the local IP address and the port is **8080** to access it. | ||
917 | |||
918 | For the Node-Red, you can use the local IP address and the port is **1880** to access it. | ||
919 | |||
920 | |||
921 | == 4.1 LoRaWAN Network Server ~-~- ChirpStack == | ||
922 | |||
923 | |||
924 | 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. | ||
925 | |||
926 | Such as __**//http:~/~/dragino-54ff12:8080 or http:~/~/<Local-IPV4-Address>//**__ | ||
927 | |||
928 | (% style="color:blue" %)**Login account:** | ||
929 | |||
930 | **Username : ** **admin** | ||
931 | |||
932 | **Password: ** ** admin** | ||
933 | |||
934 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20All%20Gateway%20models/HP0C/WebHome/image-20230616175332-6.png?width=1029&height=519&rev=1.1||_mstalt="432016" alt="image-20230616175332-6.png"]] | ||
935 | |||
936 | |||
937 | == 4.2 Application Server ~-~- Node-Red == | ||
938 | |||
939 | |||
940 | 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. | ||
941 | |||
942 | Such as __**//http:~/~/dragino-54ff12:1880 or [[http:~~/~~/<Local-IPV4-Address~>>>http://<Local-IPV4-Address>]]//**__ | ||
943 | |||
944 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20All%20Gateway%20models/HP0C/WebHome/image-20220725172124-3.png?width=843&height=610&rev=1.1||_mstalt="429767" alt="image-20220725172124-3.png"]] | ||
945 | |||
946 | |||
947 | === **Using Node-Red, InfluxDB and Grafana** === | ||
948 | |||
949 | The MS48-LR supports this combination, the default, Node-red is pre-installed but the InfluxDB and Grafana is not pre-installed. | ||
950 | |||
951 | the users can refer to this link to install them. | ||
952 | |||
953 | [[http:~~/~~/wiki.dragino.com/xwiki/bin/view/Main/Armbian%20OS%20instruction/#H2.6HowtoinstallGrafanaandinfluxdb>>url:http://wiki.dragino.com/xwiki/bin/view/Main/Armbian%20OS%20instruction/#H2.6HowtoinstallGrafanaandinfluxdb]] | ||
954 | |||
955 | |||
956 | === **Upgrade the node.js** === | ||
957 | |||
958 | By default, the MS48-LR node.js uses the pre-install version v12 which is due to Debian the ultra-stable via ultra-old. | ||
959 | |||
960 | the users can refer to this link to upgrade them. | ||
961 | |||
962 | [[http:~~/~~/wiki.dragino.com/xwiki/bin/view/Main/Armbian%20OS%20instruction/#H2.5Howtoupgradethenodejsversiontothelatest.>>url:http://wiki.dragino.com/xwiki/bin/view/Main/Armbian%20OS%20instruction/#H2.5Howtoupgradethenodejsversiontothelatest.]] | ||
963 | |||
964 | |||
965 | = 5. Use RS232 Interface = | ||
966 | |||
967 | |||
968 | 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: | ||
969 | |||
970 | * LHT65N register on MS48-LR Built-In ChirpStack server already | ||
971 | * The user is able to see the data on the built-in ChirpStack server device page | ||
972 | * The RS232 relay is connected to the RS232 interface of the MS48-LR | ||
973 | |||
974 | The MS48-LR RS232 interface corresponds to (% style="color:blue" %)**/dev/ttyS2.** | ||
975 | |||
976 | Below are the steps for the MS48-LR read LHT65N's temperature control RS232 relay example: | ||
977 | |||
978 | [[image:image-20240115155839-1.png||_mstalt="432328" height="304" width="1036"]] | ||
979 | |||
980 | [[image:1705307593665-981.png||_mstalt="297804" height="526" width="691"]] | ||
981 | |||
982 | |||
983 | == 5.1 Link Node-Red to Local ChirpStack == | ||
984 | |||
985 | |||
986 | 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>>attach:MS48-LR read LHT65N's temperature control RS232 relay.json||target="_blank"]]** | ||
987 | |||
988 | For more information on importing Input Flow, check out this link: **[[Import Input Flow for Dragino Sensors>>url:http://wiki.dragino.com/xwiki/bin/view/Main/Node-RED/#H3.A0ImportInputFlowforDraginoSensors]]** | ||
989 | |||
990 | After importing the Input Flow is complete, the user needs to edit the MQTT in the node | ||
991 | |||
992 | The specific steps can be found at this link: **[[Example: Use Local Server ChirpStack and Node-Red>>http://wiki.dragino.com/xwiki/bin/view/Main/Notes%20for%20ChirpStack/#H12.A0Example:UseLocalServerChirpStackandNode-RedinLPS8v2]]** | ||
993 | |||
994 | [[image:image-20240115161940-2.png||_mstalt="429377" height="593" width="1149"]] | ||
995 | |||
996 | |||
997 | = 6. Use RS485 Interface = | ||
998 | |||
999 | |||
1000 | The MS48-LR RS485 interface corresponds to (% style="color:blue" %)**/dev/ttyS1.** | ||
1001 | |||
1002 | Below are the steps for the MS48-LR RS485 interface to manually send and receive data: | ||
1003 | |||
1004 | [[image:image-20240702105904-12.png||_mstalt="452595"]] | ||
1005 | |||
1006 | == 6.1 Initialize the GPIO21 == | ||
1007 | |||
1008 | |||
1009 | Users need to run the following command to configure GPIO21: | ||
1010 | |||
1011 | (% class="box infomessage" %) | ||
1012 | ((( | ||
1013 | **echo 21 > /sys/class/gpio/export | ||
1014 | echo "out" > /sys/class/gpio/gpio21/direction** | ||
1015 | ))) | ||
1016 | |||
1017 | |||
1018 | == 6.2 Set the RS485 Tx Mode == | ||
1019 | |||
1020 | |||
1021 | Set the MS48-LR RS485 port to Tx mode by lowering the GPIO21 level: | ||
1022 | |||
1023 | (% class="box infomessage" %) | ||
1024 | ((( | ||
1025 | **echo "0" > /sys/class/gpio/gpio21/value** | ||
1026 | ))) | ||
1027 | |||
1028 | Run the following command to send hexadecimal data: | ||
1029 | |||
1030 | (% class="box infomessage" %) | ||
1031 | ((( | ||
1032 | **echo -en "\x01\x02\x03\x04\x05" > /dev/ttyS1** | ||
1033 | ))) | ||
1034 | |||
1035 | [[image:image-20240702100108-8.jpeg||_mstalt="470652"]] | ||
1036 | |||
1037 | |||
1038 | Users can use the serial port tool to check the data sent by MS48-LR RS485: | ||
1039 | |||
1040 | [[image:image-20240702100337-9.png||_mstalt="430456" height="595" width="617"]] | ||
1041 | |||
1042 | |||
1043 | == 6.3 Set the RS485 Rx Mode == | ||
1044 | |||
1045 | |||
1046 | Set the MS48-LR RS485 port to Rx mode by pulling up the GPIO21 level: | ||
1047 | |||
1048 | (% class="box infomessage" %) | ||
1049 | ((( | ||
1050 | **echo "1" > /sys/class/gpio/gpio21/value** | ||
1051 | ))) | ||
1052 | |||
1053 | Run the following command to check the data received by the MS48-LR RS485: | ||
1054 | |||
1055 | (% class="box infomessage" %) | ||
1056 | ((( | ||
1057 | **cat /dev/ttyS1 | xxd -p -u** | ||
1058 | ))) | ||
1059 | |||
1060 | [[image:image-20240702110051-13.png||_mstalt="449566"]] | ||
1061 | |||
1062 | |||
1063 | = 7. Power Analyze = | ||
1064 | |||
1065 | |||
1066 | Users can refer to and calculate the power consumption of the MS48-LR in this: | ||
1067 | |||
1068 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:515px" %) | ||
1069 | |=(% style="width: 80px; background-color: rgb(79, 129, 189); color: white;" %)**Model**|=(% style="width: 80px; background-color: rgb(79, 129, 189); color: white;" %)**Input Power**|=(% style="width: 175px; background-color: rgb(79, 129, 189); color: white;" %)**Test Mode**|=(% style="width: 80px; background-color: rgb(79, 129, 189); color: white;" %)**Current(mA)**|=(% style="width: 100px; background-color: rgb(79, 129, 189); color: white;" %)**Power Consumption(W)** | ||
1070 | |(% colspan="1" rowspan="10" style="width:83px" %)**MS48-LR**|(% colspan="1" rowspan="10" style="width:105px" %)**(+12V)** | ||
1071 | |(% style="width:533px" %)Starting current|(% style="width:118px" %)90-190|(% style="width:195px" %)1.080-2.280 | ||
1072 | |(% style="width:533px" %)No network|(% style="width:118px" %)179-210|(% style="width:195px" %)2.148-2.520 | ||
1073 | |(% style="width:533px" %)wifi and internet connection(LORA Start)|(% style="width:118px" %)137-178|(% style="width:195px" %)1.644-2.136 | ||
1074 | |(% style="width:533px" %)wifi and internet connection(LORA Start) and 4G|(% style="width:118px" %)144-201|(% style="width:195px" %)1.728-2.412 | ||
1075 | |(% style="width:533px" %)wifi and internet connection(LORA Start) and 4G and 64g U disk|(% style="width:118px" %)172-225|(% style="width:195px" %)2.100-2.700 | ||
1076 | |(% style="width:533px" %)4G connection(LORA Start)|(% style="width:118px" %)161-226|(% style="width:195px" %)1.932-2.712 | ||
1077 | |(% style="width:533px" %)wifi and internet connection(LORA Start) and 64g U disk|(% style="width:118px" %)162-193|(% style="width:195px" %)1.956-2.316 | ||
1078 | |(% style="width:533px" %)send manually|(% style="width:118px" %)377|(% style="width:195px" %)4.524 | ||
1079 | |(% style="width:533px" %)accept manually|(% style="width:118px" %)175|(% style="width:195px" %)2.100 | ||
1080 | ))) | ||
1081 | |||
1082 | |||
1083 | = 8. More Services = | ||
1084 | |||
1085 | == 8.1 NTP Service/Time Synchronization == | ||
1086 | |||
1087 | |||
1088 | The gateway time sync service is provided by chrony service. | ||
1089 | |||
1090 | === 1). Modify the NTP server address: === | ||
1091 | |||
1092 | (% class="box infomessage" %) | ||
1093 | ((( | ||
1094 | **Configuration file path: /etc/chrony/chrony.conf ** | ||
1095 | ))) | ||
1096 | |||
1097 | === 2). Start/Stop/Enable/Disable NTP service: === | ||
1098 | |||
1099 | (% class="box infomessage" %) | ||
1100 | ((( | ||
1101 | **systemctl start chrony | ||
1102 | \\systemctl stop chrony | ||
1103 | \\systemctl disable chrony | ||
1104 | \\systemctl enable chrony** | ||
1105 | ))) | ||
1106 | |||
1107 | |||
1108 | = 9. Trouble Shooting = | ||
1109 | |||
1110 | == 9.1 Click "Manual_Update", why there is no response? == | ||
1111 | |||
1112 | |||
1113 | When you click "Manual_Update", the gateway will finish updating within 10 minutes and display the update log. | ||
1114 | |||
1115 | [[image:image-20250208141034-1.png]] | ||
1116 | |||
1117 | |||
1118 | == 9.2 How to reset the built-in server == | ||
1119 | |||
1120 | |||
1121 | Users need to click "Reset" on the Server~-~->Network Server interface, ChirpStack will be reset. | ||
1122 | |||
1123 | [[image:image-20250208141159-2.png||height="441" width="1072"]] | ||
1124 | |||
1125 | |||
1126 | == 9.3 How does modbus tcp downlink single-byte register contents to sensor devices == | ||
1127 | |||
1128 | |||
1129 | (% id="cke_bm_110537S" style="display:none" %) (%%)By default, each register occupies 16 bits (2 bytes). Therefore, when the client sends data such as **030101**, it is necessary to directly add **FFFFF** in the single register, for example:** 0x0301, 0xFFFF, 0xFF01,** | ||
1130 | |||
1131 | the gateway will automatically convert it to **030101** downlink | ||
1132 | |||
1133 | [[image:image-20250228092430-1.png||height="614" width="874"]] | ||
1134 | |||
1135 | [[image:image-20250228092545-2.png||height="724" width="1227"]] | ||
1136 | |||
1137 | == 9.4 How to check the Storage of the gateway == | ||
1138 | |||
1139 | |||
1140 | Run the following command on the command line interface of the gateway to check the disk space usage: | ||
1141 | |||
1142 | (% class="box infomessage" %) | ||
1143 | ((( | ||
1144 | df -sh | ||
1145 | ))) | ||
1146 | |||
1147 | [[image:https://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20All%20Gateway%20models/HP0C/WebHome/image-20250207145702-2.png?rev=1.1||alt="image-20250207145702-2.png"]] | ||
1148 | |||
1149 | On the Linux console of the gateway, enter the following command to check the total disk space occupied by the files running on the gateway: | ||
1150 | |||
1151 | (% class="box infomessage" %) | ||
1152 | ((( | ||
1153 | **du -sh /usr/local/ /usr/* /var/*** | ||
1154 | ))) | ||
1155 | |||
1156 | [[image:https://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20All%20Gateway%20models/HP0C/WebHome/image-20250207145617-1.png?rev=1.1||alt="image-20250207145617-1.png"]] | ||
1157 | |||
1158 | == 9.4 How to clear the local server cache of the gateway using the command == | ||
1159 | |||
1160 | |||
1161 | = 10. Supports = | ||
1162 | |||
1163 | |||
1164 | If you are experiencing issues and can't solve them, you can send mail to [[support@dragino.com>>mailto:support@dragino.com]]. | ||
1165 | |||
1166 | With your question as detailed as possible. We will reply and help you in the shortest. | ||
1167 | |||
1168 | |||
1169 | = (% data-sider-select-id="a056b4ad-7d05-42b4-ad74-7a3134f8010a" %)11. Order Info(%%) = | ||
1170 | |||
1171 | |||
1172 | (% style="color:#0000ff" %)**MS48-LR-XXX-YYY** | ||
1173 | |||
1174 | (% style="color:#0000ff" %)**XXX**(% style="color:black" %): Frequency Band | ||
1175 | |||
1176 | * (% style="color:red" %)**AS923**(%%): LoRaWAN AS923 band | ||
1177 | |||
1178 | * (% style="color:red" %)**AU915**(%%): LoRaWAN AU915 band | ||
1179 | |||
1180 | * (% style="color:red" %)**EU868**(%%): LoRaWAN EU868 band | ||
1181 | |||
1182 | * (% style="color:red" %)**KR920**(%%): LoRaWAN KR920 band | ||
1183 | |||
1184 | * (% style="color:red" %)**US915**(%%): LoRaWAN US915 band | ||
1185 | |||
1186 | * (% style="color:red" %)**IN865**(%%): LoRaWAN IN865 band | ||
1187 | |||
1188 | (% style="color:#0000ff" %)**YYY**(% style="color:black" %): 4G Cellular Option | ||
1189 | |||
1190 | * (% style="color:red" %)**EC25-E**(% style="color:black" %): EMEA, Korea, Thailand, India | ||
1191 | |||
1192 | * (% style="color:red" %)**EC25-AFX**(% style="color:black" %): America:Verizon, AT&T(FirstNet), U.S.Cellular; Canada:Telus | ||
1193 | |||
1194 | * (% style="color:red" %)**EC25-AUX**(% style="color:black" %): Latin America, New Zeland, Taiwan | ||
1195 | |||
1196 | * (% style="color:red" %)**EC25-J**(% style="color:black" %): Japan, DOCOMO, SoftBank, KDDI | ||
1197 | |||
1198 | More info about valid bands, please see [[EC25-E product page>>url:https://www.quectel.com/product/ec25.htm]]. | ||
1199 | |||
1200 | |||
1201 | = 12. Manufacturer Info = | ||
1202 | |||
1203 | |||
1204 | **Shenzhen Dragino Technology Development co. LTD** | ||
1205 | |||
1206 | Room 202, Block B, BCT Incubation Bases (BaoChengTai), No.8 CaiYunRoad | ||
1207 | |||
1208 | LongCheng Street, LongGang District ; Shenzhen 518116,China | ||
1209 | |||
1210 | |||
1211 | = 13. FCC Warning = | ||
1212 | |||
1213 | |||
1214 | This equipment has been tested and found to comply with the limits for a Class B digital device, pursuant to Part 15 of the FCC Rules. These limits are designed to provide reasonable protection against harmful interference in a residential installation. This equipment generates uses and can radiate radio frequency energy and, if not installed and used in accordance with the instructions, may cause harmful interference to radio communications. However, there is no guarantee that interference will not occur in a particular installation. If this equipment does cause harmful interference to radio or television reception, which can be determined by turning the equipment off and on, the user is encouraged to try to correct the interference by one or more of the following measures: | ||
1215 | |||
1216 | ~-~- Reorient or relocate the receiving antenna. | ||
1217 | |||
1218 | ~-~- Increase the separation between the equipment and receiver. | ||
1219 | |||
1220 | ~-~- Connect the equipment into an outlet on a circuit different from that to which the receiver is connected. | ||
1221 | |||
1222 | ~-~- Consult the dealer or an experienced radio/TV technician for help. | ||
1223 | |||
1224 | Changes or modifications not expressly approved by the party responsible for compliance could void the user's authority to operate the equipment. | ||
1225 | |||
1226 | The antenna(s) used for this transmitter must be installed to provide a separation distance of at least 20 cm from all persons and must not be co-located or operating in conjunction with any other antenna or transmitter. | ||
1227 | |||
1228 | |||
1229 |