Wiki source code of RS485-CB -- RS485/UART to NB-IoT/LTE-M Converter User Manual
Last modified by Karry Zhuang on 2025/03/06 16:31
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | |||
2 | |||
3 | (% style="text-align:center" %) | ||
4 | [[image:image-20231008143931-2.png||height="414" width="521"]] | ||
5 | |||
6 | |||
7 | |||
8 | |||
9 | |||
10 | |||
11 | |||
12 | |||
13 | |||
14 | **Table of Contents:** | ||
15 | |||
16 | {{toc/}} | ||
17 | |||
18 | |||
19 | |||
20 | |||
21 | |||
22 | |||
23 | = 1. Introduction = | ||
24 | |||
25 | == 1.1 What is RS485 / UART to NB-IoT/LTE-M Converter == | ||
26 | |||
27 | |||
28 | The Dragino RS485-CB is a (% style="color:blue" %)**RS485 / UART to NB-IoT/LTE-M Converter**(%%) for Internet of Things solutions. User can connect RS485 or UART sensor to RS485-CB converter, and configure RS485-CB to periodically read sensor data and upload via NB-IoT network to IoT server. | ||
29 | |||
30 | RS485-CB can interface to RS485 sensor, 3.3v/5v UART sensor or interrupt sensor. RS485-CB provides (% style="color:blue" %)**a 3.3v output**(%%) and(% style="color:blue" %)** a 5v output**(%%) to power external sensors. Both output voltages are controllable to minimize the total system power consumption. | ||
31 | |||
32 | RS485-CB supports different uplink methods including (% style="color:blue" %)**MQTT, MQTTs, UDP, TCP or CoAP**(%%) for different application requirement, and support uplinks to various IoT Servers. | ||
33 | |||
34 | RS485-CB supports (% style="color:blue" %)**BLE configure and OTA update**(%%) which make user easy to use. | ||
35 | |||
36 | RS485-CB is IP67 (% style="color:blue" %)**waterproof**(%%) and powered by (% style="color:blue" %)**8500mAh Li-SOCI2 battery**(%%), it is designed for long-term use up to several years. | ||
37 | |||
38 | RS485-CB has optional built-in SIM card and default IoT server connection version. Which makes it works with simple configuration. | ||
39 | |||
40 | |||
41 | == 1.2 Features == | ||
42 | |||
43 | |||
44 | * For -NB Bands: B1/B2/B3/B4/B5/B8/B12/B13/B17/B18/B19/B20/B25/B28/B66/B70/B85 | ||
45 | * For -CB Bands: B1/B2/B3/B4/B5/B8/B12/B13~/~/B18/B19/B20/B25/B28/B66/B71/B85 | ||
46 | * CAT-M1 / LTE-M Bands: B1/B2/B3/B4/B5/B8/B12/B13/B18/B19/B20/B25/B26/B27/B28/B66/B85 | ||
47 | * Ultra-low power consumption | ||
48 | * Support multiply RS485 devices by flexible rules | ||
49 | * Support Modbus protocol | ||
50 | * Support Interrupt uplink | ||
51 | * Supports connecting a UART sensors with 3.3V or 5V | ||
52 | * Multiply Sampling and one uplink | ||
53 | * GNSS for Location Report | ||
54 | * Support Bluetooth v5.1 remote configure and update firmware | ||
55 | * Uplink via MQTT, MQTTs, TCP, UDP or CoAP | ||
56 | * Uplink on periodically | ||
57 | * Downlink to change configure | ||
58 | * 8500mAh Battery for long term use | ||
59 | * Nano SIM card slot for NB-IoT SIM | ||
60 | |||
61 | == 1.3 Specification == | ||
62 | |||
63 | |||
64 | (% style="color:blue" %)**Common DC Characteristics:** | ||
65 | |||
66 | * Supply Voltage: 2.6v ~~ 3.6v | ||
67 | * Operating Temperature: -40 ~~ 85°C | ||
68 | |||
69 | (% style="color:blue" %)**I/O Interface:** | ||
70 | |||
71 | * Battery controllable output (2.6v ~~ 3.6v depends on battery) | ||
72 | * +5v controllable output | ||
73 | * 1 x RS485 Interface | ||
74 | * 1 x UART Interface , 3.3v or 5v | ||
75 | * 1 x Interrupt or Digital IN/OUT pins | ||
76 | * 1 x I2C Interface | ||
77 | * 1 x one wire interface | ||
78 | |||
79 | (% style="color:blue" %)**NB-IoT Spec:** | ||
80 | |||
81 | (% style="color:#037691" %)**NB-IoT Module: BG95-NGFF** | ||
82 | |||
83 | (% style="color:#037691" %)**Support Bands:** | ||
84 | |||
85 | * B1 @H-FDD: 2100MHz | ||
86 | * B2 @H-FDD: 1900MHz | ||
87 | * B3 @H-FDD: 1800MHz | ||
88 | * B4 @H-FDD: 2100MHz | ||
89 | * B5 @H-FDD: 860MHz | ||
90 | * B8 @H-FDD: 900MHz | ||
91 | * B12 @H-FDD: 720MHz | ||
92 | * B13 @H-FDD: 740MHz | ||
93 | * B17 @H-FDD: 730MHz | ||
94 | * B18 @H-FDD: 870MHz | ||
95 | * B19 @H-FDD: 870MHz | ||
96 | * B20 @H-FDD: 790MHz | ||
97 | * B25 @H-FDD: 1900MHz | ||
98 | * B28 @H-FDD: 750MHz | ||
99 | * B66 @H-FDD: 2000MHz | ||
100 | * B70 @H-FDD: 2000MHz | ||
101 | * B85 @H-FDD: 700MHz | ||
102 | |||
103 | (% style="color:blue" %)**Battery:** | ||
104 | |||
105 | * Li/SOCI2 un-chargeable battery | ||
106 | * Capacity: 8500mAh | ||
107 | * Self Discharge: <1% / Year @ 25°C | ||
108 | * Max continuously current: 130mA | ||
109 | * Max boost current: 2A, 1 second | ||
110 | |||
111 | (% style="color:blue" %)**Power Consumption** | ||
112 | |||
113 | * STOP Mode: 10uA @ 3.3v | ||
114 | * Max transmit power: 350mA@3.3v | ||
115 | |||
116 | == 1.4 Applications == | ||
117 | |||
118 | |||
119 | * Smart Buildings & Home Automation | ||
120 | * Logistics and Supply Chain Management | ||
121 | * Smart Metering | ||
122 | * Smart Agriculture | ||
123 | * Smart Cities | ||
124 | * Smart Factory | ||
125 | |||
126 | == 1.5 Sleep mode and working mode == | ||
127 | |||
128 | |||
129 | (% style="color:blue" %)**Deep Sleep Mode: **(%%)Sensor doesn't have any NB-IoT activate. This mode is used for storage and shipping to save battery life. | ||
130 | |||
131 | (% style="color:blue" %)**Working Mode:** (%%)In this mode, Sensor will work as NB-IoT Sensor to Join NB-IoT network and send out sensor data to server. Between each sampling/tx/rx periodically, sensor will be in IDLE mode), in IDLE mode, sensor has the same power consumption as Deep Sleep mode. | ||
132 | |||
133 | |||
134 | == 1.6 Button & LEDs == | ||
135 | |||
136 | |||
137 | [[image:Main.User Manual for LoRaWAN End Nodes.D20-LBD22-LBD23-LB_LoRaWAN_Temperature_Sensor_User_Manual.WebHome@1675071855856-879.png]] | ||
138 | |||
139 | |||
140 | (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:510px" %) | ||
141 | |=(% style="width: 167px;background-color:#4F81BD;color:white" %)**Behavior on ACT**|=(% style="width: 117px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width:226px;background-color:#4F81BD;color:white" %)**Action** | ||
142 | |(% style="width:167px" %)Pressing ACT between 1s < time < 3s|(% style="width:117px" %)Send an uplink|(% style="width:225px" %)((( | ||
143 | If sensor has already attached to NB-IoT network, sensor will send an uplink packet, (% style="color:blue" %)**blue led** (%%)will blink once. | ||
144 | Meanwhile, BLE module will be active and user can connect via BLE to configure device. | ||
145 | ))) | ||
146 | |(% style="width:167px" %)Pressing ACT for more than 3s|(% style="width:117px" %)Active Device|(% style="width:225px" %)((( | ||
147 | (% style="color:green" %)**Green led**(%%) will fast blink 5 times, device will enter (% style="color:#037691" %)**OTA mode**(%%) for 3 seconds. And then start to attach NB-IoT network. | ||
148 | (% style="color:green" %)**Green led**(%%) will solidly turn on for 5 seconds after joined in network. | ||
149 | Once sensor is active, BLE module will be active and user can connect via BLE to configure device, no matter if device attach NB-IoT network or not. | ||
150 | ))) | ||
151 | |(% style="width:167px" %)Fast press ACT 5 times.|(% style="width:117px" %)Deactivate Device|(% style="width:225px" %)(% style="color:red" %)**Red led**(%%) will solid on for 5 seconds. Means device is in Deep Sleep Mode. | ||
152 | |||
153 | (% style="color:red" %)**Note: When the device is executing a program, the buttons may become invalid. It is best to press the buttons after the device has completed the program execution.** | ||
154 | |||
155 | |||
156 | == 1.7 BLE connection == | ||
157 | |||
158 | |||
159 | RS485-CB support BLE remote configure and firmware update. | ||
160 | |||
161 | |||
162 | BLE can be used to configure the parameter of sensor or see the console output from sensor. BLE will be only activate on below case: | ||
163 | |||
164 | * Press button to send an uplink | ||
165 | * Press button to active device. | ||
166 | * Device Power on or reset. | ||
167 | |||
168 | If there is no activity connection on BLE in 60 seconds, sensor will shut down BLE module to enter low power mode. | ||
169 | |||
170 | |||
171 | == 1.8 Pin Definitions , Switch & SIM Direction == | ||
172 | |||
173 | |||
174 | RS485-CB use the mother board which as below. | ||
175 | |||
176 | [[image:image-20240729141052-3.jpeg||height="421" width="686"]] | ||
177 | |||
178 | |||
179 | === 1.8.1 Jumper JP2 === | ||
180 | |||
181 | |||
182 | Power on Device when put this jumper. | ||
183 | |||
184 | |||
185 | === 1.8.2 BOOT MODE / SW1 === | ||
186 | |||
187 | |||
188 | **1)** (% style="color:blue" %)**ISP**(%%): upgrade mode, device won't have any signal in this mode. but ready for upgrade firmware. LED won't work. Firmware won't run. | ||
189 | |||
190 | **2)** (% style="color:blue" %)**Flash**(%%): work mode, device starts to work and send out console output for further debug | ||
191 | |||
192 | |||
193 | === 1.8.3 Reset Button === | ||
194 | |||
195 | |||
196 | Press to reboot the device. | ||
197 | |||
198 | |||
199 | === 1.8.4 SIM Card Direction === | ||
200 | |||
201 | |||
202 | See this link. [[How to insert SIM Card>>https://wiki.dragino.com/xwiki/bin/view/Main/General%20Manual%20for%20-CB%20%2C%20-CS%20models/#H2.1GeneralConfiguretoattachnetwork]]. | ||
203 | |||
204 | |||
205 | === 1.8.5 SW2 Jumper (Define UART level to external Sensor)(% style="display:none" %) (%%) === | ||
206 | |||
207 | |||
208 | SW2 defines the voltage level of BOARD_RX and BOARD_TX pins. It should match the external sensor voltage level | ||
209 | |||
210 | |||
211 | = 2. Use RS485-CB to communicate with IoT Server = | ||
212 | |||
213 | == 2.1 Send data to IoT server via NB-IoT/CAT-M1 network == | ||
214 | |||
215 | |||
216 | The RS485-CB is equipped with a NB-IoT module, the pre-loaded firmware in RS485-CB will get environment data from sensors and send the value to local NB-IoT network via the NB-IoT module. The NB-IoT network will forward this value to IoT server via the protocol defined by RS485-CB. | ||
217 | |||
218 | |||
219 | Below shows the network structure: | ||
220 | |||
221 | [[image:image-20240731113834-1.png||height="452" width="967"]] | ||
222 | |||
223 | |||
224 | There are two version: (% style="color:blue" %)**-GE**(%%) and (% style="color:blue" %)**-1T**(%%) version of RS485-CB. | ||
225 | |||
226 | |||
227 | (% style="color:blue" %)**GE Version**(%%): This version doesn't include SIM card or point to any IoT server. User needs to use AT Commands to configure below two steps to set RS485-CB send data to IoT server. | ||
228 | |||
229 | * Install NB-IoT SIM card and configure APN. See instruction of [[Attach Network>>https://wiki.dragino.com/xwiki/bin/view/Main/General%20Manual%20for%20-CB%20%2C%20-CS%20models/#H2.1GeneralConfiguretoattachnetwork]]. | ||
230 | |||
231 | * Set up sensor to point to IoT Server. See instruction of [[Configure to Connect Different Servers>>https://wiki.dragino.com/xwiki/bin/view/Main/General%20Manual%20for%20-CB%20%2C%20-CS%20models/#H3.Configuretoconnecttodifferentservers]]. | ||
232 | |||
233 | Below shows result of different server as a glance. | ||
234 | |||
235 | (% border="1" cellspacing="4" style="width:515px" %) | ||
236 | |(% style="background-color:#4f81bd; color:white; width:100px" %)**Servers**|(% style="background-color:#4f81bd; color:white; width:300px" %)**Dash Board**|(% style="background-color:#4f81bd; color:white; width:115px" %)**Comments** | ||
237 | |(% style="width:127px" %)[[Node-Red>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H3.5A0Node-RedA028viaA0MQTT29]]|(% style="width:385px" %)((( | ||
238 | (% style="text-align:center" %) | ||
239 | [[image:image-20230819113244-8.png||height="183" width="367"]] | ||
240 | )))|(% style="width:170px" %) | ||
241 | |[[ThingsBoard>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H3.6A0ThingsBoard.CloudA028viaA0MQTT29]]|((( | ||
242 | (% contenteditable="false" tabindex="-1" %)[[image:https://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LDS25-NB--NB-IoT_LiDAR_ToF_Distance_Auto-Clean_Sensor/WebHome/image-20230819113244-11.png?width=367&height=141&rev=1.1||alt="image-20230819113244-11.png" data-widget="image"]] | ||
243 | )))| | ||
244 | |(% style="width:127px" %)[[General UDP>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H3.1GeneralA0UDPA0Connection]]|(% style="width:385px" %)Raw Payload. Need Developer to design Dash Board|(% style="width:170px" %) | ||
245 | |(% style="width:127px" %)[[General MQTT>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H3.2GeneralA0MQTTA0Connection]]|(% style="width:385px" %)Raw Payload. Need Developer to design Dash Board|(% style="width:170px" %) | ||
246 | |||
247 | (% style="color:blue" %)**1T Version**(%%): This version has 1NCE SIM card pre-installed and configure to send value to ThingsEye. User Just need to select the sensor type in ThingsEyeand Activate RS485-CB and user will be able to see data in ThingsEye. See here for [[ThingsEye Config Instruction>>url:https://wiki.thingseye.io/xwiki/bin/view/Main/]]. | ||
248 | |||
249 | |||
250 | == 2.2 Configure Device to Read RS485 Sensors == | ||
251 | |||
252 | |||
253 | There are plenty of RS485 and TTL level devices in the market and each device has different commands to read the valid data. To support these devices in most flexible, RS485-CB supports flexible command set. User can use [[Dragino RS485 Tool>>url:https://www.dropbox.com/sh/us9qecn39fwt8n1/AABREdqUCzEmJMRrfuWuXasoa?dl=0]], [[AT Commands or LoRaWAN Downlink>>url:http://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LB_Waterproof_RS485UART_to_LoRaWAN_Converter/#H3.5ConfigureRS485-LBviaATorDownlink]] Command to configure how RS485-CB should read the sensor and how to handle the return from RS485 or TTL sensors. | ||
254 | |||
255 | |||
256 | === 2.2.1 Method 1 ~-~- via RS485 Configure Tool === | ||
257 | |||
258 | |||
259 | Use the RS485 Configure tool is the recommand method. Please see the instruction of how to use the tool: | ||
260 | |||
261 | * **[[RS485 Configure Tool Instruction>>url:http://wiki.dragino.com/xwiki/bin/view/Main/RS485_Configure_Tool/]]** | ||
262 | |||
263 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LB_Waterproof_RS485UART_to_LoRaWAN_Converter/WebHome/image-20231127144411-1.png?width=494&height=368&rev=1.1||alt="image-20231127144411-1.png" height="368" width="494"]] | ||
264 | |||
265 | |||
266 | === 2.2.2 Method 2 ~-~- via AT Commands === | ||
267 | |||
268 | ==== 2.2.2.1 Configure UART settings for RS485 or TTL communication ==== | ||
269 | |||
270 | |||
271 | ((( | ||
272 | RS485-CB can connect to either RS485 sensors or TTL sensor. User need to specify what type of sensor need to connect. | ||
273 | ))) | ||
274 | |||
275 | |||
276 | ((( | ||
277 | (% style="color:blue" %)**1. RS485-MODBUS mode:** | ||
278 | ))) | ||
279 | |||
280 | ((( | ||
281 | (% style="color:#037691" %)**AT+MOD=1** (%%) ~/~/ Support RS485-MODBUS type sensors. User can connect multiply RS485 , Modbus sensors to the A / B pins. | ||
282 | ))) | ||
283 | |||
284 | |||
285 | ((( | ||
286 | (% style="color:blue" %)**2. TTL mode:** | ||
287 | ))) | ||
288 | |||
289 | ((( | ||
290 | (% style="color:#037691" %)**AT+MOD=2** (%%) ~/~/ Support TTL Level sensors, User can connect one TTL Sensor to the TXD/RXD/GND pins. | ||
291 | |||
292 | |||
293 | ))) | ||
294 | |||
295 | ((( | ||
296 | RS485-CB default UART settings is (% style="color:green" %)**9600, no parity, stop bit 1,data bit 8**(%%). If the sensor has a different settings, user can change the RS485-CB setting to match. | ||
297 | ))) | ||
298 | |||
299 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:519px" %) | ||
300 | |=(% style="width: 119px; background-color:#4F81BD; color: white;" %)((( | ||
301 | ((( | ||
302 | **AT Commands** | ||
303 | ))) | ||
304 | )))|=(% style="width: 121px; background-color:#4F81BD; color: white;" %)((( | ||
305 | ((( | ||
306 | **Description** | ||
307 | ))) | ||
308 | )))|=(% style="width: 278px; background-color:#4F81BD; color: white;" %)((( | ||
309 | ((( | ||
310 | **Example** | ||
311 | ))) | ||
312 | ))) | ||
313 | |(% style="width:119px" %)((( | ||
314 | ((( | ||
315 | AT+BAUDR | ||
316 | ))) | ||
317 | )))|(% style="width:121px" %)((( | ||
318 | ((( | ||
319 | Set the baud rate. | ||
320 | |||
321 | Default Value is: 9600. | ||
322 | ))) | ||
323 | )))|(% style="width:278px" %)((( | ||
324 | ((( | ||
325 | ((( | ||
326 | AT+BAUDR=9600 | ||
327 | ))) | ||
328 | ))) | ||
329 | |||
330 | ((( | ||
331 | ((( | ||
332 | Options: (1200,2400,4800,14400,19200,115200) | ||
333 | ))) | ||
334 | ))) | ||
335 | ))) | ||
336 | |(% style="width:119px" %)((( | ||
337 | ((( | ||
338 | AT+PARITY | ||
339 | ))) | ||
340 | )))|(% style="width:121px" %)((( | ||
341 | ((( | ||
342 | ((( | ||
343 | Set UART parity. | ||
344 | ))) | ||
345 | ))) | ||
346 | |||
347 | ((( | ||
348 | ((( | ||
349 | Default Value is: no parity. | ||
350 | ))) | ||
351 | ))) | ||
352 | )))|(% style="width:278px" %)((( | ||
353 | ((( | ||
354 | ((( | ||
355 | AT+PARITY=0 | ||
356 | ))) | ||
357 | ))) | ||
358 | |||
359 | ((( | ||
360 | ((( | ||
361 | Option: 0: no parity, 1: odd parity, 2: even parity | ||
362 | ))) | ||
363 | ))) | ||
364 | ))) | ||
365 | |(% style="width:119px" %)((( | ||
366 | ((( | ||
367 | AT+STOPBIT | ||
368 | ))) | ||
369 | )))|(% style="width:121px" %)((( | ||
370 | ((( | ||
371 | ((( | ||
372 | Set serial stopbit | ||
373 | ))) | ||
374 | ))) | ||
375 | |||
376 | ((( | ||
377 | ((( | ||
378 | Default Value is: 1bit. | ||
379 | ))) | ||
380 | ))) | ||
381 | )))|(% style="width:278px" %)((( | ||
382 | ((( | ||
383 | AT+STOPBIT=0 for 1 bit | ||
384 | |||
385 | AT+STOPBIT=1 for 1.5 bits | ||
386 | ))) | ||
387 | |||
388 | ((( | ||
389 | ((( | ||
390 | AT+STOPBIT=2 for 2 bits | ||
391 | ))) | ||
392 | ))) | ||
393 | ))) | ||
394 | |(% style="width:119px" %)AT+DATABIT|(% style="width:121px" %)((( | ||
395 | ((( | ||
396 | ((( | ||
397 | Set serial databit. | ||
398 | ))) | ||
399 | ))) | ||
400 | |||
401 | ((( | ||
402 | ((( | ||
403 | Default Value is: 8bits. | ||
404 | ))) | ||
405 | ))) | ||
406 | )))|(% style="width:278px" %)((( | ||
407 | ((( | ||
408 | AT+DATABIT=7 for 7 bits | ||
409 | ))) | ||
410 | |||
411 | ((( | ||
412 | ((( | ||
413 | AT+DATABIT=8 for 8 bits | ||
414 | ))) | ||
415 | ))) | ||
416 | ))) | ||
417 | |||
418 | Example(Soil three-parameter detector): | ||
419 | |||
420 | (% style="color:blue" %)**Wiring the UART sensor** | ||
421 | |||
422 | ((( | ||
423 | **GND <~-~-~-~-~-~-~-~-> GND | ||
424 | TX <~-~-~-~-~-~-~-~-> RX | ||
425 | RX <~-~-~-~-~-~-~-~-> TX | ||
426 | VCC <~-~-~-~-~-~-~-~-> 3.3/5V** | ||
427 | ))) | ||
428 | |||
429 | [[image:image-20231024153119-2.png||height="362" width="631"]] | ||
430 | |||
431 | |||
432 | (% style="color:blue" %)**Set the correct configuration:** | ||
433 | |||
434 | (% style="color:#037691" %)**AT+BAUDR=9600** | ||
435 | |||
436 | (% style="color:#037691" %)**AT+PARITY=0** | ||
437 | |||
438 | (% style="color:#037691" %)**AT+STOPBIT=1** | ||
439 | |||
440 | (% style="color:#037691" %)**AT+DATABIT=8** | ||
441 | |||
442 | If the sensor needs 5v. Need to move the switch position to 5v and then use the command (% style="color:blue" %)**AT+5VT=30000** | ||
443 | |||
444 | |||
445 | (% style="color:blue" %)**Configuration read command:** | ||
446 | |||
447 | (% style="color:#037691" %)**AT+CFGDEV=FE 03 00 00 00 03 11 C4,0** | ||
448 | |||
449 | **FE:** Station address | ||
450 | |||
451 | **03:** Function code | ||
452 | |||
453 | **00 00:**Register start address | ||
454 | |||
455 | **00 03:**Number of registers | ||
456 | |||
457 | **11 04:** Check code | ||
458 | |||
459 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LB_Waterproof_RS485UART_to_LoRaWAN_Converter/WebHome/image-20230220111709-2.png?rev=1.1||alt="image-20230220111709-2.png"]] | ||
460 | |||
461 | |||
462 | Use AT+COMMAND1 to set it as a command, and use AT+DATACUT1 to intercept the bytes I need | ||
463 | |||
464 | [[image:image-20231024154517-6.png||height="327" width="770"]] | ||
465 | |||
466 | |||
467 | (% style="color:blue" %)**upload payload:** | ||
468 | |||
469 | [[image:image-20231024154424-5.png]] | ||
470 | |||
471 | |||
472 | === 2.2.3 Configure sensors === | ||
473 | |||
474 | |||
475 | ((( | ||
476 | Some sensors might need to configure before normal operation. User can configure such sensor via PC or through RS485-CB AT Commands (% style="color:#4f81bd" %)**AT+CFGDEV**. | ||
477 | ))) | ||
478 | |||
479 | ((( | ||
480 | When user issue an (% style="color:#4f81bd" %)**AT+CFGDEV**(%%) command, Each (% style="color:#4f81bd" %)**AT+CFGDEV**(%%) equals to send a command to the RS485 or TTL sensors. This command will only run when user input it and won't run during each sampling. | ||
481 | ))) | ||
482 | |||
483 | (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:510px" %) | ||
484 | |=(% style="width: 130px;background-color:#4F81BD;color:white" %)**AT Commands**|=(% style="width: 190px;background-color:#4F81BD;color:white" %)**Description**|=(% style="width: 190px;background-color:#4F81BD;color:white" %)**Example** | ||
485 | |(% style="width:121px" %)AT+CFGDEV|(% style="width:179px" %)((( | ||
486 | ((( | ||
487 | This command is used to configure the RS485/TTL devices; they won’t be used during sampling. | ||
488 | ))) | ||
489 | |||
490 | ((( | ||
491 | AT+CFGDEV=xx xx xx xx xx xx xx xx xx xx xx xx, | ||
492 | ))) | ||
493 | |||
494 | ((( | ||
495 | mm: 0: no CRC, 1: add CRC-16/MODBUS in the end of this command | ||
496 | ))) | ||
497 | )))|(% style="width:210px" %)AT+CFGDEV=xx xx xx xx xx xx xx xx xx xx xx xx,m | ||
498 | |||
499 | === 2.2.4 Configure read commands for each sampling === | ||
500 | |||
501 | |||
502 | (% style="color:red" %)**Note: Please upgrade firmware to v1.0.3 or above. Otherwise, if a data error occurs in AT+COMMANDx check crc mode, the device will enter an inoperable state.** | ||
503 | |||
504 | |||
505 | ((( | ||
506 | RS485-CB is a battery powered device; it will sleep most of time. And wake up on each period and read RS485 / TTL sensor data and uplink. | ||
507 | ))) | ||
508 | |||
509 | ((( | ||
510 | During each sampling, we need to confirm what commands we need to send to the sensors to read data. After the RS485/TTL sensors send back the value, it normally includes some bytes and we only need a few from them for a shorten payload. | ||
511 | ))) | ||
512 | |||
513 | ((( | ||
514 | To save the LoRaWAN network bandwidth, we might need to read data from different sensors and combine their valid value into a short payload. | ||
515 | ))) | ||
516 | |||
517 | ((( | ||
518 | This section describes how to achieve above goals. | ||
519 | ))) | ||
520 | |||
521 | ((( | ||
522 | During each sampling, the RS485-CB can support 15 commands to read sensors. And combine the return to one or several uplink payloads. | ||
523 | ))) | ||
524 | |||
525 | ((( | ||
526 | (% style="color:blue" %)**Command from RS485-CB to Sensor:** | ||
527 | ))) | ||
528 | |||
529 | ((( | ||
530 | RS485-CB can send out pre-set max 15 strings via **AT+COMMAD1**, **ATCOMMAND2**,…, to **AT+COMMANDF** . All commands are of same grammar. | ||
531 | |||
532 | |||
533 | ))) | ||
534 | |||
535 | ((( | ||
536 | (% style="color:blue" %)**Handle return from sensors to RS485-CB**: | ||
537 | ))) | ||
538 | |||
539 | ((( | ||
540 | After RS485-CB send out a string to sensor, RS485-CB will wait for the return from RS485 or TTL sensor. And user can specify how to handle the return, by **AT+DATACUT or AT+SEARCH commands** | ||
541 | ))) | ||
542 | |||
543 | * ((( | ||
544 | (% style="color:blue" %)**AT+DATACUT** | ||
545 | ))) | ||
546 | |||
547 | ((( | ||
548 | When the return value from sensor have fix length and we know which position the valid value we should get, we can use AT+DATACUT command. | ||
549 | |||
550 | |||
551 | ))) | ||
552 | |||
553 | * ((( | ||
554 | (% style="color:blue" %)**AT+SEARCH** | ||
555 | ))) | ||
556 | |||
557 | ((( | ||
558 | When the return value from sensor is dynamic length and we are not sure which bytes the valid data is, instead, we know what value the valid value following. We can use AT+SEARCH to search the valid value in the return string. | ||
559 | ))) | ||
560 | |||
561 | |||
562 | ((( | ||
563 | (% style="color:blue" %)**Define wait timeout:** | ||
564 | ))) | ||
565 | |||
566 | ((( | ||
567 | Some RS485 device might has longer delay on reply, so user can use AT+CMDDL to set the timeout for getting reply after the RS485 command is sent. For example, AT+CMDDL1=1000 to send the open time to 1000ms | ||
568 | ))) | ||
569 | |||
570 | ((( | ||
571 | **Examples:** | ||
572 | ))) | ||
573 | |||
574 | ((( | ||
575 | Below are examples for the how above AT Commands works. | ||
576 | ))) | ||
577 | |||
578 | ((( | ||
579 | (% style="color:blue" %)**AT+COMMANDx **(%%)**: **This command will be sent to RS485/TTL devices during each sampling, Max command length is 14 bytes. The grammar is: | ||
580 | ))) | ||
581 | |||
582 | (% border="1" class="table-bordered" style="background-color:#f2f2f2; width:497px" %) | ||
583 | |(% style="width:494px" %)((( | ||
584 | ((( | ||
585 | **AT+COMMANDx=xx xx xx xx xx xx xx xx xx xx xx xx,m** | ||
586 | ))) | ||
587 | |||
588 | ((( | ||
589 | **xx xx xx xx xx xx xx xx xx xx xx xx: The RS485 command to be sent** | ||
590 | ))) | ||
591 | |||
592 | ((( | ||
593 | **m: 0: no CRC, 1: add CRC-16/MODBUS in the end of this command** | ||
594 | ))) | ||
595 | ))) | ||
596 | |||
597 | ((( | ||
598 | For example, if we have a RS485 sensor. The command to get sensor value is: 01 03 0B B8 00 02 46 0A. Where 01 03 0B B8 00 02 is the Modbus command to read the register 0B B8 where stored the sensor value. The 46 0A is the CRC-16/MODBUS which calculate manually. | ||
599 | ))) | ||
600 | |||
601 | ((( | ||
602 | In the RS485-CB, we should use this command AT+COMMAND1=01 03 0B B8 00 02,1 for the same. | ||
603 | |||
604 | |||
605 | ))) | ||
606 | |||
607 | If a single command exceeds 14 bytes, you can use the command splicing function. | ||
608 | |||
609 | When AT+CMDDLx=1, the commands of AT+COMMANDx and AT+COMMAND(x+1) will be merged. | ||
610 | |||
611 | **Examples:** To send 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F data it should be configured: | ||
612 | |||
613 | AT+COMMAND1=00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D,0 | ||
614 | |||
615 | AT+COMMAND1=1 | ||
616 | |||
617 | AT+COMMAND2=0E 0F,0 | ||
618 | |||
619 | |||
620 | ((( | ||
621 | (% style="color:blue" %)**AT+SEARCHx**(%%): This command defines how to handle the return from AT+COMMANDx. | ||
622 | ))) | ||
623 | |||
624 | (% border="1" class="table-bordered" style="background-color:#f2f2f2; width:473px" %) | ||
625 | |(% style="width:470px" %)((( | ||
626 | ((( | ||
627 | **AT+SEARCHx=aa,xx xx xx xx xx** | ||
628 | ))) | ||
629 | |||
630 | * ((( | ||
631 | **aa: 1: prefix match mode; 2: prefix and suffix match mode** | ||
632 | ))) | ||
633 | * ((( | ||
634 | **xx xx xx xx xx: match string. Max 5 bytes for prefix and 5 bytes for suffix** | ||
635 | ))) | ||
636 | ))) | ||
637 | |||
638 | ((( | ||
639 | **Examples:** | ||
640 | ))) | ||
641 | |||
642 | ((( | ||
643 | **1) For a return string from AT+COMMAND1: 16 0c 1e 56 34 2e 30 58 5f 36 41 30 31 00 49** | ||
644 | ))) | ||
645 | |||
646 | ((( | ||
647 | If we set AT+SEARCH1=1,1E 56 34. (max 5 bytes for prefix) | ||
648 | ))) | ||
649 | |||
650 | ((( | ||
651 | The valid data will be all bytes after 1E 56 34 , so it is (% style="background-color:yellow" %)**2e 30 58 5f 36 41 30 31 00 49** | ||
652 | ))) | ||
653 | |||
654 | ((( | ||
655 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LB_Waterproof_RS485UART_to_LoRaWAN_Converter/WebHome/1653271044481-711.png?rev=1.1||alt="1653271044481-711.png"]] | ||
656 | |||
657 | |||
658 | ))) | ||
659 | |||
660 | ((( | ||
661 | **2) For a return string from AT+COMMAND1: 16 0c 1e 56 34 2e 30 58 5f 36 41 30 31 00 49** | ||
662 | ))) | ||
663 | |||
664 | ((( | ||
665 | If we set AT+SEARCH1=2, 1E 56 34+31 00 49 | ||
666 | ))) | ||
667 | |||
668 | ((( | ||
669 | Device will search the bytes between 1E 56 34 and 31 00 49. So it is(% style="background-color:yellow" %) **2e 30 58 5f 36 41 30** | ||
670 | ))) | ||
671 | |||
672 | ((( | ||
673 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LB_Waterproof_RS485UART_to_LoRaWAN_Converter/WebHome/1653271044481-711.png?rev=1.1||alt="1653271044481-711.png"]] | ||
674 | |||
675 | |||
676 | ))) | ||
677 | |||
678 | ((( | ||
679 | (% style="color:#037691" %)**AT+DATACUTx**(%%)** : **This command defines how to handle the return from AT+COMMANDx, max return length is 100 bytes. | ||
680 | ))) | ||
681 | |||
682 | (% style="background-color:#f2f2f2; width:496px" %) | ||
683 | |(% style="width:493px" %)((( | ||
684 | ((( | ||
685 | **AT+DATACUTx=a,b,c** | ||
686 | ))) | ||
687 | |||
688 | * ((( | ||
689 | **a: length for the return of AT+COMMAND** | ||
690 | ))) | ||
691 | * ((( | ||
692 | **b:1: grab valid value by byte, max 6 bytes. 2: grab valid value by bytes section, max 3 sections.** | ||
693 | ))) | ||
694 | * ((( | ||
695 | **c: define the position for valid value. ** | ||
696 | ))) | ||
697 | ))) | ||
698 | |||
699 | ((( | ||
700 | **Examples:** | ||
701 | ))) | ||
702 | |||
703 | * ((( | ||
704 | (% style="color:blue" %)**Grab bytes:** | ||
705 | ))) | ||
706 | |||
707 | ((( | ||
708 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LB_Waterproof_RS485UART_to_LoRaWAN_Converter/WebHome/1653271581490-837.png?width=722&height=313&rev=1.1||alt="1653271581490-837.png"]] | ||
709 | ))) | ||
710 | |||
711 | |||
712 | * ((( | ||
713 | (% style="color:blue" %)**Grab a section.** | ||
714 | ))) | ||
715 | |||
716 | ((( | ||
717 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LB_Waterproof_RS485UART_to_LoRaWAN_Converter/WebHome/1653271648378-342.png?width=720&height=326&rev=1.1||alt="1653271648378-342.png"]] | ||
718 | ))) | ||
719 | |||
720 | |||
721 | * ((( | ||
722 | (% style="color:blue" %)**Grab different sections.** | ||
723 | ))) | ||
724 | |||
725 | ((( | ||
726 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LB_Waterproof_RS485UART_to_LoRaWAN_Converter/WebHome/1653271657255-576.png?width=730&height=305&rev=1.1||alt="1653271657255-576.png"]] | ||
727 | |||
728 | |||
729 | ))) | ||
730 | |||
731 | ((( | ||
732 | (% style="color:red" %)**Note:** | ||
733 | ))) | ||
734 | |||
735 | ((( | ||
736 | (% style="color:#037691" %)**AT+SEARCHx** (%%)and (% style="color:#037691" %)**AT+DATACUTx**(%%) can be used together, if both commands are set, RS485-CB will first process AT+SEARCHx on the return string and get a temporary string, and then process AT+DATACUTx on this temporary string to get the final payload. In this case, AT+DATACUTx need to set to format** AT+DATACUTx=0,xx,xx** where the return bytes set to **0**. | ||
737 | ))) | ||
738 | |||
739 | ((( | ||
740 | **Example:** | ||
741 | ))) | ||
742 | |||
743 | ((( | ||
744 | (% style="color:red" %)AT+COMMAND1=11 01 1E D0,0 | ||
745 | ))) | ||
746 | |||
747 | ((( | ||
748 | (% style="color:red" %)AT+SEARCH1=1,1E 56 34 | ||
749 | ))) | ||
750 | |||
751 | ((( | ||
752 | (% style="color:red" %)AT+DATACUT1=0,2,1~~5 | ||
753 | ))) | ||
754 | |||
755 | ((( | ||
756 | (% style="color:red" %)Return string from AT+COMMAND1: 16 0c 1e 56 34 2e 30 58 5f 36 41 30 31 00 49 | ||
757 | ))) | ||
758 | |||
759 | ((( | ||
760 | (% style="color:red" %)String after SEARCH command: 2e 30 58 5f 36 41 30 31 00 49 | ||
761 | ))) | ||
762 | |||
763 | ((( | ||
764 | (% style="color:red" %)Valid payload after DataCUT command: 2e 30 58 5f 36 | ||
765 | ))) | ||
766 | |||
767 | |||
768 | ((( | ||
769 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LB_Waterproof_RS485UART_to_LoRaWAN_Converter/WebHome/1653271763403-806.png?rev=1.1||alt="1653271763403-806.png"]] | ||
770 | ))) | ||
771 | |||
772 | |||
773 | === 2.2.5 Uplink when the sensor is not responding === | ||
774 | |||
775 | (% style="color:blue" %) | ||
776 | |||
777 | (% class="wikigeneratedid" %) | ||
778 | **1) ** When (% style="color:blue" %)**AT+MOD=1**(%%), if the data intercepted by (% style="color:#037691" %)** AT+DATACUT**(%%) or (% style="color:#037691" %)** AT+MBFUN **(%%)is empty, it will display **NULL**, and the payload will be filled with **n FFs**. | ||
779 | |||
780 | |||
781 | [[image:1698135215181-146.png]] | ||
782 | |||
783 | |||
784 | **2)** When** (% style="color:blue" %)AT+MOD=2(%%)**, if the data intercepted by (% style="color:#037691" %)** AT+DATACUT** (%%)or (% style="color:#037691" %)** AT+MBFUN**(%%) is empty, it will display **NULL**, and the payload will be filled with **n 00s**. | ||
785 | |||
786 | |||
787 | [[image:1698135222111-424.png||height="292" width="410"]] | ||
788 | |||
789 | |||
790 | === 2.2.6 Uplink on Interrupt === | ||
791 | |||
792 | |||
793 | Put the interrupt sensor between 3.3v_out and GPIO_EXTI. | ||
794 | |||
795 | [[image:image-20241109135127-1.png]] | ||
796 | |||
797 | |||
798 | ((( | ||
799 | (% style="color:#4472c4" %)**AT+INTMOD=0**(%%) Disable Interrupt.( Default Value) | ||
800 | ))) | ||
801 | |||
802 | ((( | ||
803 | (% style="color:#4472c4" %)**AT+INTMOD=1**(%%) Interrupt trigger by rising or falling edge. | ||
804 | ))) | ||
805 | |||
806 | ((( | ||
807 | (% style="color:#4472c4" %)**AT+INTMOD=2** (%%) Interrupt trigger by falling edge. | ||
808 | ))) | ||
809 | |||
810 | ((( | ||
811 | (% style="color:#4472c4" %)**AT+INTMOD=3**(%%) Interrupt trigger by rising edge. | ||
812 | ))) | ||
813 | |||
814 | |||
815 | == 2.3 Payload Types == | ||
816 | |||
817 | |||
818 | To meet different server requirement, RS485-CB supports different payload type. | ||
819 | |||
820 | **Includes:** | ||
821 | |||
822 | * [[General JSON format payload>>||anchor="H2.3.1GeneralJsonFormat28Type3D529"]]. (Type=5) | ||
823 | |||
824 | * [[HEX format Payload>>||anchor="H2.3.2HEXformatPayload28Type3D029"]]. (Type=0) | ||
825 | |||
826 | User can specify the payload type when choose the connection protocol. Example: | ||
827 | |||
828 | (% style="color:#037691" %)**AT+PRO=2,0** (%%) ~/~/ Use UDP Connection & hex Payload | ||
829 | |||
830 | (% style="color:#037691" %)**AT+PRO=2,5** (%%) ~/~/ Use UDP Connection & Json Payload | ||
831 | |||
832 | (% style="color:#037691" %)**AT+PRO=3,0 ** (%%) ~/~/ Use MQTT Connection & hex Payload | ||
833 | |||
834 | (% style="color:#037691" %)**AT+PRO=3,5 ** (%%) ~/~/ Use MQTT Connection & Json Payload | ||
835 | |||
836 | (% style="color:#037691" %)**AT+PRO=4,0** (%%) ~/~/ Use TCP Connection & hex Payload | ||
837 | |||
838 | (% style="color:#037691" %)**AT+PRO=4,5** (%%) ~/~/ Use TCP Connection & Json Payload | ||
839 | |||
840 | |||
841 | === 2.3.1 General Json Format(Type~=5) === | ||
842 | |||
843 | |||
844 | This is the General Json Format. As below: | ||
845 | |||
846 | (% style="color:#4472c4" %)**{"IMEI":"868508065601703","IMSI":"460240210507483","Model":"RS485-CB","Payload":"0108b0","interrupt":0,"interrupt_level":0,"battery":3.265,"signal":27,"time":"2025-01-13T00:57:00Z","latitude":0.000000,"longitude":0.000000,"gps_time":"1970-01-01T00:00:00Z","1":["0108b5","2025-01-11T09:55:58Z"],"2":["0108b8","2025-01-11T09:40:58Z"],"3":["0108b9","2025-01-11T09:25:58Z"],"4":["0100fa","2025-01-11T09:10:58Z"],"5":["0108d4","2025-01-11T08:16:00Z"],"6":["0108d5","2025-01-11T08:01:00Z"],"7":["010105","2025-01-11T07:46:00Z"],"8":["010de8","2025-01-11T07:31:00Z"]}** | ||
847 | |||
848 | [[image:image-20250113091109-1.png]] | ||
849 | |||
850 | |||
851 | === 2.3.2 HEX format Payload(Type~=0) === | ||
852 | |||
853 | |||
854 | This is the HEX Format. As below: | ||
855 | |||
856 | (% style="color:#4472c4" %)**f868508065601703f460240210507483606f0cc61c00000000000000000000000000006784688d0108b26784682d0108b46782402e0108b567823caa0108b8678239260108b9678235a20100fa678228c00108d46782253c0108d5678221b8010105** | ||
857 | |||
858 | [[image:image-20250113094049-3.png]] | ||
859 | |||
860 | [[image:image-20250113092807-2.png]] | ||
861 | |||
862 | |||
863 | (% style="color:blue" %)**Device ID(f+IMEI):**(%%)** **f868508065601703= 868508065601703 | ||
864 | |||
865 | |||
866 | (% style="color:blue" %)**SIM Card ID(f+IMSI):**(%%)** **f460240210507483= 460240210507483 | ||
867 | |||
868 | |||
869 | (% style="color:blue" %)**Version:** | ||
870 | |||
871 | These bytes include the hardware and software version. | ||
872 | |||
873 | (% style="color:#037691" %)**Higher byte:**(%%) Specify Sensor Model: 0x60 for RS485-CB | ||
874 | |||
875 | (% style="color:#037691" %)**Lower byte:**(%%) Specify the software version: 0x6f=111, means firmware version 1.1.1 | ||
876 | |||
877 | |||
878 | (% style="color:blue" %)**BAT (Battery Info):** | ||
879 | |||
880 | Ex1: 0x0cc3 = 3267mV | ||
881 | |||
882 | |||
883 | (% style="color:blue" %)**Signal Strength:** | ||
884 | |||
885 | NB-IoT Network signal Strength. | ||
886 | |||
887 | **Ex1: 0x17 = 23** | ||
888 | |||
889 | **0** -113dBm or less | ||
890 | |||
891 | **1** -111dBm | ||
892 | |||
893 | **2...30** -109dBm... -53dBm | ||
894 | |||
895 | **31** -51dBm or greater | ||
896 | |||
897 | **99** Not known or not detectable | ||
898 | |||
899 | |||
900 | (% style="color:blue" %)**GPIO_EXIT Level **(%%): | ||
901 | |||
902 | GPIO_EXTI is used as Interrupt Pin. | ||
903 | |||
904 | (% style="color:#037691" %)**Example:** | ||
905 | |||
906 | 01 (H): GPIO_EXTI pin is high level. | ||
907 | |||
908 | 00 (L): GPIO_EXTI pin is low level. | ||
909 | |||
910 | |||
911 | (% style="color:blue" %)**GPIO_EXIT Flag:** | ||
912 | |||
913 | This data field shows if this packet is generated by **Interrupt Pin** or not. | ||
914 | |||
915 | Note: The Interrupt Pin is a separate pin in the screw terminal. | ||
916 | |||
917 | (% style="color:#037691" %)**Example:** | ||
918 | |||
919 | 0x00: Normal uplink packet. | ||
920 | |||
921 | 0x01: Interrupt Uplink Packet. | ||
922 | |||
923 | |||
924 | (% style="color:blue" %)**Latitude:** | ||
925 | |||
926 | EX1:** **0x00000000 ~/~/ Locating fails or is not enabled. | ||
927 | |||
928 | EX2: 0x015a77dc(H)=22706410(D): 22.706410 | ||
929 | |||
930 | |||
931 | (% style="color:blue" %)**Longitude:** | ||
932 | |||
933 | EX1:** **0x00000000 ~/~/ Locating fails or is not enabled. | ||
934 | |||
935 | EX2: 0x06cf3c7a(H)=114244730(D): 114.244730 | ||
936 | |||
937 | |||
938 | (% style="color:blue" %)**GPS_Timestamp:** | ||
939 | |||
940 | EX1: 0x00000000 ~/~/ The value is "1970-01-01T00:00:00Z" in JSON format. The initial GPS time is not refreshed if GPS positioning is disabled or fails. | ||
941 | |||
942 | EX2: 0x6682595d =1719818589 = 2024-07-01 15:23:09 | ||
943 | |||
944 | |||
945 | (% style="color:blue" %)**TimeStamp:** | ||
946 | |||
947 | Unit TimeStamp Example: 66A730F3(H) = 1722233075(D) | ||
948 | |||
949 | Put the decimal value into this link(https://www.epochconverter.com/) to get the time. | ||
950 | |||
951 | |||
952 | (% style="color:blue" %)**Payload_version: ** | ||
953 | |||
954 | The payload version number is used to parse different decodes. | ||
955 | |||
956 | |||
957 | (% style="color:blue" %)**RS485_sensor_data:** | ||
958 | |||
959 | The data returned by the RS485 sensor or UART sensor needs to be cut out the AT+DATACUTx and AT+MBFUN or AT+SEARCHx commands. | ||
960 | |||
961 | **Example:** | ||
962 | |||
963 | Distance sensor:** **0x0e95(H) = 3733(D) = 3733mm | ||
964 | |||
965 | |||
966 | = 3. Configure RS485-CB = | ||
967 | |||
968 | == 3.1 Configure Methods == | ||
969 | |||
970 | |||
971 | RS485-CB supports below configure method: | ||
972 | |||
973 | * AT Command via Bluetooth Connection (**Recommended**): [[BLE Configure Instruction>>http://wiki.dragino.com/xwiki/bin/view/Main/BLE%20Bluetooth%20Remote%20Configure/]]. | ||
974 | |||
975 | * AT Command via UART Connection : See [[UART Connection>>http://wiki.dragino.com/xwiki/bin/view/Main/UART%20Access%20for%20LoRa%20ST%20v4%20base%20model/#H2.4UARTConnectionforRS485-BLbasemotherboard]]. | ||
976 | |||
977 | == 3.2 Serial Access Password == | ||
978 | |||
979 | |||
980 | After the Bluetooth or UART connection is successful, use the Serial Access Password to enter the AT command window. | ||
981 | |||
982 | The label on the box of the node will print the initial password: AT+PIN=**xxxxxx**, and directly use the six-digit password to access the AT instruction window. | ||
983 | |||
984 | [[image:https://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-NB%2C-NS_RS485%2CUART_to_NB-IoT_Converter_User_Manual/WebHome/image-20250226165815-1.png?rev=1.1||alt="image-20250226165815-1.png"]] | ||
985 | |||
986 | |||
987 | If you need to change the password, use **AT+PWORD=**xxxxxx (6 characters), CB nodes only support lowercase letters. | ||
988 | |||
989 | [[image:image-20240826180009-2.png]] | ||
990 | |||
991 | |||
992 | (% style="color:red" %)**Note: After entering the command, you need to add a line break, and you can also set automatic line breaks in the Bluetooth tool or UART connection tool.** | ||
993 | |||
994 | [[image:image-20240826180016-3.png]] | ||
995 | |||
996 | |||
997 | == 3.3 AT Commands Set == | ||
998 | |||
999 | |||
1000 | AT+<CMD>? : Help on <CMD> | ||
1001 | |||
1002 | AT+<CMD> : Run <CMD> | ||
1003 | |||
1004 | AT+<CMD>=<value> : Set the value | ||
1005 | |||
1006 | AT+<CMD>=? : Get the value | ||
1007 | |||
1008 | |||
1009 | (% style="color:blue" %)**General Commands** | ||
1010 | |||
1011 | AT : Attention | ||
1012 | |||
1013 | AT? : Short Help | ||
1014 | |||
1015 | ATZ : MCU Reset | ||
1016 | |||
1017 | AT+TDC : Application Data Transmission Interval | ||
1018 | |||
1019 | AT+CFG : Print all configurations | ||
1020 | |||
1021 | AT+CFGMOD : Working mode selection | ||
1022 | |||
1023 | AT+DEUI : Get or set the Device ID | ||
1024 | |||
1025 | AT+PRO : Choose agreement | ||
1026 | |||
1027 | AT+RXDL : Extend the sending and receiving time | ||
1028 | |||
1029 | AT+DNSCFG : Get or Set DNS Server | ||
1030 | |||
1031 | AT+GETSENSORVALUE : Returns the current sensor measurement | ||
1032 | |||
1033 | AT+SERVADDR : Server Address | ||
1034 | |||
1035 | AT+MOD: Get or Set work mode | ||
1036 | |||
1037 | AT+5VT : Get or Set extend the time of 5V power | ||
1038 | |||
1039 | AT+3V3T : Get or Set extend the time of 3V3 power | ||
1040 | |||
1041 | AT+INTMOD : Get or Set the trigger interrupt mode (0:input,1:falling or rising,2:falling,3:rising) | ||
1042 | |||
1043 | AT+BAUDR: Get or Set baudr of uart | ||
1044 | |||
1045 | AT+DATABIT: Get or Set databit(7:7 bit,8:8 bit) of uart | ||
1046 | |||
1047 | AT+PARITY: Get or Set parity(0:none,1:odd,2:even) of uart | ||
1048 | |||
1049 | AT+STOPBIT: Get or Set stopbit(0:1 bit,1:1.5 bit,2:2 bit) of uart | ||
1050 | |||
1051 | AT+CMDEAR: Erase command(number of begin to number of ending) | ||
1052 | |||
1053 | AT+PAYVER: Get or Set payload version | ||
1054 | |||
1055 | AT+MBFUN: Get or Set Modbus Funtion code(0:none,1:01 or 02,2:03 or 04)for automatic cut | ||
1056 | |||
1057 | AT+COMMAND: Send data of command1-15 to RS485 deceive for payload | ||
1058 | |||
1059 | AT+SEARCH: Retrieve the hexadecimal character that appears in command 1-15 | ||
1060 | |||
1061 | AT+DATACUT: Cut receive data after use command1-15 | ||
1062 | |||
1063 | AT+CMDDL: Set delay timeout after send rs485 command1-15 | ||
1064 | |||
1065 | AT+CFGDEV: Send data to RS485 deceive | ||
1066 | |||
1067 | AT+DNSTIMER: Regularly resolve domain names | ||
1068 | |||
1069 | |||
1070 | (% style="color:blue" %)**MQTT Management** | ||
1071 | |||
1072 | AT+CLIENT : Get or Set MQTT client | ||
1073 | |||
1074 | AT+UNAME : Get or Set MQTT Username | ||
1075 | |||
1076 | AT+PWD : Get or Set MQTT password | ||
1077 | |||
1078 | AT+PUBTOPIC : Get or Set MQTT publish topic | ||
1079 | |||
1080 | AT+SUBTOPIC : Get or Set MQTT subscription topic | ||
1081 | |||
1082 | |||
1083 | (% style="color:blue" %)**Information** | ||
1084 | |||
1085 | AT+FDR : Factory Data Reset | ||
1086 | |||
1087 | AT+PWORD : Serial Access Password | ||
1088 | |||
1089 | AT+LDATA : Get the last upload data | ||
1090 | |||
1091 | |||
1092 | == 3.4 Test Uplink and Change Update Interval == | ||
1093 | |||
1094 | |||
1095 | By default, Sensor will send uplinks (% style="color:blue" %)**every 2 hours**(%%) | ||
1096 | |||
1097 | User can use below commands to change the (% style="color:blue" %)**uplink interval**. | ||
1098 | |||
1099 | (% style="color:#037691" %)**AT+TDC=7200 ** (%%) ~/~/ Set Update Interval to 7200s | ||
1100 | |||
1101 | User can also push the button for more than 1 seconds to activate an uplink. | ||
1102 | |||
1103 | |||
1104 | == 3.5 Fast command to handle MODBUS device == | ||
1105 | |||
1106 | |||
1107 | ((( | ||
1108 | The command is for fast configure to read Modbus devices. It is only valid for the devices which follow the [[MODBUS-RTU protocol>>url:https://www.modbustools.com/modbus.html]]. | ||
1109 | ))) | ||
1110 | |||
1111 | |||
1112 | ((( | ||
1113 | (% style="color:#037691" %)**AT+MBFUN has only two value:** | ||
1114 | ))) | ||
1115 | |||
1116 | * ((( | ||
1117 | (% style="color:#4472c4" %)** AT+MBFUN=1**(%%): Enable Modbus reading. And get response base on the MODBUS return | ||
1118 | ))) | ||
1119 | |||
1120 | ((( | ||
1121 | AT+MBFUN=1, device can auto read the Modbus function code: 01, 02, 03 or 04. AT+MBFUN has lower priority vs AT+DATACUT command. If AT+DATACUT command is configured, AT+MBFUN will be ignore. | ||
1122 | ))) | ||
1123 | |||
1124 | * ((( | ||
1125 | (% style="color:#4472c4" %)**AT+MBFUN=0**(%%): Disable Modbus fast reading. | ||
1126 | ))) | ||
1127 | |||
1128 | ((( | ||
1129 | |||
1130 | |||
1131 | **Example:** | ||
1132 | ))) | ||
1133 | |||
1134 | * ((( | ||
1135 | AT+MBFUN=1 and AT+DATACUT1/AT+DATACUT2 are not configure (0,0,0). | ||
1136 | ))) | ||
1137 | * ((( | ||
1138 | AT+COMMAND1= 01 03 00 10 00 08,1 ~-~-> read slave address 01 , function code 03, start address 00 01, quantity of registers 00 08. | ||
1139 | ))) | ||
1140 | * ((( | ||
1141 | AT+COMMAND2= 01 02 00 40 00 10,1 ~-~-> read slave address 01 , function code 02, start address 00 40, quantity of inputs 00 10. | ||
1142 | |||
1143 | |||
1144 | ))) | ||
1145 | |||
1146 | == (% data-sider-select-id="2157289a-8dac-42b1-91f9-154bbb3c704a" %)3.6 RS485 command timeout(%%) == | ||
1147 | |||
1148 | |||
1149 | ((( | ||
1150 | Some Modbus device has slow action to send replies. This command is used to configure the RS485-CB to use longer time to wait for their action. | ||
1151 | ))) | ||
1152 | |||
1153 | ((( | ||
1154 | Default value: 0, range: 0 ~~ 10 seconds | ||
1155 | ))) | ||
1156 | |||
1157 | ((( | ||
1158 | * (% style="color:#037691" %)**AT Command:** | ||
1159 | |||
1160 | (% style="color:#4472c4" %)**AT+CMDDLaa=hex(bb cc)** | ||
1161 | ))) | ||
1162 | |||
1163 | ((( | ||
1164 | **Example:** | ||
1165 | ))) | ||
1166 | |||
1167 | ((( | ||
1168 | **AT+CMDDL1=1000** to send the open time to 1000ms | ||
1169 | ))) | ||
1170 | |||
1171 | |||
1172 | == 3.7 Clear RS485 Command == | ||
1173 | |||
1174 | |||
1175 | ((( | ||
1176 | The AT+COMMANDx and AT+DATACUTx AT+SEARCHx and AT+CMDDLx settings are stored in special location, user can use below command to clear them. | ||
1177 | ))) | ||
1178 | |||
1179 | |||
1180 | * ((( | ||
1181 | (% style="color:#037691" %)**AT Command:** | ||
1182 | ))) | ||
1183 | |||
1184 | ((( | ||
1185 | (% style="color:#4472c4" %) **AT+CMDEAR=mm,nn** (%%) mm: start position of erase ,nn: stop position of erase Etc. AT+CMDEAR=1,10 means erase AT+COMMAND1/AT+DATACUT1/AT+SEARCH1/AT+CMDDL1 to AT+COMMANDA/AT+DATACUTA/AT+SEARCHA/AT+CMDDLA. | ||
1186 | ))) | ||
1187 | |||
1188 | |||
1189 | == 3.8 Set Payload version == | ||
1190 | |||
1191 | |||
1192 | This is the first byte of the uplink payload. RS485-CB can connect to different sensors. User can set the PAYVER field to tell server how to decode the current payload. | ||
1193 | |||
1194 | * (% style="color:#037691" %)**AT Command:** | ||
1195 | |||
1196 | (% style="color:#4472c4" %)** AT+PAYVER: **(%%)Set PAYVER field = 1 | ||
1197 | |||
1198 | |||
1199 | == 3.9 Control output power duration == | ||
1200 | |||
1201 | |||
1202 | ((( | ||
1203 | User can set the output power duration before each sampling. | ||
1204 | ))) | ||
1205 | |||
1206 | * ((( | ||
1207 | (% style="color:#037691" %)**AT Command:** | ||
1208 | ))) | ||
1209 | |||
1210 | ((( | ||
1211 | **Example:** | ||
1212 | ))) | ||
1213 | |||
1214 | ((( | ||
1215 | (% style="color:#4472c4" %)** AT+3V3T=1000**(%%) ~/~/ 3V3 output power will open 1s before each sampling. | ||
1216 | |||
1217 | (% style="color:#4472c4" %)** AT+3V3T=0**(%%) ~/~/ Normally open 3V3 power supply. | ||
1218 | |||
1219 | (% style="color:#4472c4" %)** AT+3V3T=65535**(%%) ~/~/ Normally closed 3V3 power supply. | ||
1220 | ))) | ||
1221 | |||
1222 | ((( | ||
1223 | (% style="color:#4472c4" %)** AT+5VT=1000** (%%) ~/~/ +5V output power will open 1s before each sampling. | ||
1224 | ))) | ||
1225 | |||
1226 | (% style="color:#4472c4" %)** AT+5VT=0**(%%) ~/~/ Normally closed +5V power supply. | ||
1227 | |||
1228 | (% style="color:#4472c4" %)** AT+5VT=65535**(%%) ~/~/ Normally open +5V power supply. | ||
1229 | |||
1230 | |||
1231 | == 3.10 Get sensor value == | ||
1232 | |||
1233 | |||
1234 | * ((( | ||
1235 | (% style="color:#037691" %)**AT Command:** | ||
1236 | ))) | ||
1237 | |||
1238 | (% style="color:#4472c4" %)** AT+GETSENSORVALUE=0 **(%%)** **~/~/ The serial port gets the reading of the current sensor | ||
1239 | |||
1240 | (% style="color:#4472c4" %)** AT+GETSENSORVALUE=1 **(%%)~/~/ The serial port gets the current sensor reading and uploads it. | ||
1241 | |||
1242 | |||
1243 | == 3.11 +3V3 Output == | ||
1244 | |||
1245 | |||
1246 | ((( | ||
1247 | RS485-CB has a Controllable +3V3 output, user can use this output to power external sensor. | ||
1248 | ))) | ||
1249 | |||
1250 | ((( | ||
1251 | The +3V3 output will be valid for every sampling. RS485-CB will enable +3V3 output before all sampling and disable the +3V3 after all sampling. | ||
1252 | ))) | ||
1253 | |||
1254 | ((( | ||
1255 | The +3V3 output time can be controlled by AT Command. | ||
1256 | ))) | ||
1257 | |||
1258 | |||
1259 | ((( | ||
1260 | (% style="color:#037691" %)**AT+3V3T=1000** | ||
1261 | ))) | ||
1262 | |||
1263 | |||
1264 | ((( | ||
1265 | Means set +3v3 valid time to have 1000ms. So, the real +3v3 output will actually have 1000ms + sampling time for other sensors. | ||
1266 | ))) | ||
1267 | |||
1268 | ((( | ||
1269 | By default, the AT+3V3T=0. This is a special case, means the +3V3 output is always on at any time | ||
1270 | ))) | ||
1271 | |||
1272 | |||
1273 | == (% data-sider-select-id="3c4690d3-9bf3-497f-9d1f-0766ce51aa62" %)3.12 +5V Output(%%) == | ||
1274 | |||
1275 | |||
1276 | ((( | ||
1277 | RS485-CB has a Controllable +5V output, user can use this output to power external sensor. | ||
1278 | ))) | ||
1279 | |||
1280 | ((( | ||
1281 | The +5V output will be valid for every sampling. RS485-CB will enable +5V output before all sampling and disable the +5v after all sampling. | ||
1282 | ))) | ||
1283 | |||
1284 | ((( | ||
1285 | The 5V output time can be controlled by AT Command. | ||
1286 | ))) | ||
1287 | |||
1288 | |||
1289 | ((( | ||
1290 | (% style="color:#037691" %)**AT+5VT=1000** | ||
1291 | ))) | ||
1292 | |||
1293 | |||
1294 | ((( | ||
1295 | Means set 5V valid time to have 1000ms. So, the real 5V output will actually have 1000ms + sampling time for other sensors. | ||
1296 | ))) | ||
1297 | |||
1298 | ((( | ||
1299 | By default, the AT+5VT=0. If the external sensor which require 5v and require more time to get stable state, user can use this command to increase the power ON duration for this sensor. | ||
1300 | ))) | ||
1301 | |||
1302 | |||
1303 | == 3.13 Switch Jumper == | ||
1304 | |||
1305 | |||
1306 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:463px" %) | ||
1307 | |=(% style="width: 123px;background-color:#4F81BD;color:white" %)**Switch Jumper**|=(% style="width: 340px;background-color:#4F81BD;color:white" %)**Feature** | ||
1308 | |(% style="width:123px" %)SW1|(% style="width:340px" %)ISP position: Upgrade firmware via UART | ||
1309 | Flash position: Configure device, check running status. | ||
1310 | |(% style="width:123px" %)SW2|(% style="width:336px" %)5V position: set to compatible with 5v I/O. | ||
1311 | 3.3v position: set to compatible with 3.3v I/O. | ||
1312 | |||
1313 | ((( | ||
1314 | (% style="color:blue" %)** +3.3V**(%%): is always ON | ||
1315 | ))) | ||
1316 | |||
1317 | ((( | ||
1318 | (% style="color:blue" %)** +5V**(%%): Only open before every sampling. The time is by default, it is (% style="color:#4472c4" %)** AT+5VT=0**(%%). | ||
1319 | |||
1320 | (% style="color:red" %)**Note: If SW2 is at +5V and AT+5VT=0, work mode 2 will not be able to send data.** | ||
1321 | ))) | ||
1322 | |||
1323 | |||
1324 | == 3.14 Clock logging == | ||
1325 | |||
1326 | |||
1327 | Sometimes when we deploy lots of end nodes in field. We want all sensors sample data at the same time, and upload these data together for analyze. In such case, we can use clock loging feature. | ||
1328 | |||
1329 | We can use this command to set the start time of data recording and the time interval to meet the requirements of the specific collection time of data. | ||
1330 | |||
1331 | * (% style="color:blue" %)**AT Command:**(%%) (% style="color:#037691" %)**AT+CLOCKLOG=a,b,c,d** | ||
1332 | |||
1333 | (% style="color:#4472c4" %)**a: **(%%)**0:** Disable Clock logging. ** 1: **Enable Clock Logging | ||
1334 | |||
1335 | (% style="color:#4472c4" %)**b: **(%%)Specify First sampling start second: range **(0 ~~ 3599, 65535) ** ~/~/ (% style="color:red" %)**Note:**(%%)** **If parameter b is set to 65535, the log period starts after the node accesses the network and sends packets. | ||
1336 | |||
1337 | (% style="color:#4472c4" %)**c: **(%%)Specify the sampling interval: range **(0 ~~ 255 minutes)** | ||
1338 | |||
1339 | (% style="color:#4472c4" %)**d: **(%%)How many entries should be uplink on every TDC **(max 32)** | ||
1340 | |||
1341 | (% style="color:red" %)**Note: To disable clock recording, set the following parameters: AT+CLOCKLOG=1,65535,0,0** | ||
1342 | |||
1343 | [[image:image-20240309094931-1.png]] | ||
1344 | |||
1345 | |||
1346 | **Example:** | ||
1347 | |||
1348 | **AT+CLOCKLOG=1,65535,1,5** | ||
1349 | |||
1350 | After the node sends the first packet, data is recorded to the memory at intervals of 1 minute. For each TDC uplink, the uplink load will include: battery information + the last 5 memory records (payload + timestamp). | ||
1351 | |||
1352 | [[image:image-20240729143030-4.png||height="635" width="764"]] | ||
1353 | |||
1354 | (% style="color:red" %)**Note: Users need to synchronize the server time before configuring this command. If the server time is not synchronized before this command is configured, the command takes effect only after the node is reset.** | ||
1355 | |||
1356 | |||
1357 | == 3.15 Example Query saved historical records == | ||
1358 | |||
1359 | |||
1360 | * (% style="color:blue" %)**AT command:**(%%)** (% style="color:#037691" %)AT+CDP(%%)** | ||
1361 | |||
1362 | This command can be used to search the saved history, recording up to 32 groups of data, each group of historical data contains a maximum of 100 bytes. | ||
1363 | |||
1364 | [[image:image-20240729143232-5.png||height="630" width="718"]] | ||
1365 | |||
1366 | |||
1367 | == (% data-sider-select-id="052d009a-8af5-47e1-ad43-b15959eeed92" %)3.16 Uplink log query(%%) == | ||
1368 | |||
1369 | |||
1370 | * (% style="color:blue" %)**AT command:**(%%)** (% style="color:#037691" %)AT+GETLOG(%%)** | ||
1371 | |||
1372 | This command can be used to query upstream logs of data packets. | ||
1373 | |||
1374 | [[image:image-20240729143335-6.png||height="618" width="715"]] | ||
1375 | |||
1376 | |||
1377 | == 3.17 Set the downlink debugging mode(Since firmware v1.1.0) == | ||
1378 | |||
1379 | |||
1380 | Feature: Set the conversion between the standard version and 1T version downlinks. | ||
1381 | |||
1382 | (% style="color:blue" %)**AT command: AT+DOWNTE** | ||
1383 | |||
1384 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:510px" %) | ||
1385 | |=(% style="width: 138px; background-color: rgb(79, 129, 189); color: white;" %)**Command Example**|=(% style="width: 143px; background-color: rgb(79, 129, 189); color: white;" %)**Function/Parameters**|=(% style="width: 229px; background-color: rgb(79, 129, 189); color: white;" %)**Response/Explanation** | ||
1386 | |(% style="width:134px" %)AT+DOWNTE=?|(% style="width:143px" %)Get current Settings|(% style="width:229px" %)((( | ||
1387 | 0,0 (default) | ||
1388 | OK | ||
1389 | ))) | ||
1390 | |(% colspan="1" rowspan="2" style="width:134px" %)((( | ||
1391 | ((( | ||
1392 | |||
1393 | |||
1394 | |||
1395 | |||
1396 | AT+DOWNTE=0,a | ||
1397 | ))) | ||
1398 | |||
1399 | ((( | ||
1400 | |||
1401 | ))) | ||
1402 | )))|(% style="width:143px" %)**0**: Disable downlink debugging|(% style="width:229px" %)((( | ||
1403 | OK | ||
1404 | ))) | ||
1405 | |(% style="width:143px" %)**1**: Enable downlink debugging, users can see the original downlink reception.|(% style="width:229px" %)((( | ||
1406 | OK | ||
1407 | ))) | ||
1408 | |||
1409 | **Example:** | ||
1410 | |||
1411 | * AT+DOWNTE=0,0 ~/~/ Disable downlink debugging. | ||
1412 | * AT+DOWNTE=0,1 ~/~/ Enable downlink debugging. | ||
1413 | |||
1414 | (% style="color:blue" %)**Downlink Command: ** | ||
1415 | |||
1416 | No downlink commands for feature | ||
1417 | |||
1418 | |||
1419 | == 3.18 Set the TLS mode == | ||
1420 | |||
1421 | |||
1422 | Refer to this link ([[Instructions for using TLS certificates>>https://wiki.dragino.com/xwiki/bin/view/Dragino%20NB%20device%20connection%20to%20AWS%20platform%20instructions/#H4.2A0A0For-CB2F-CSmodel]])to use the TLS mode. | ||
1423 | |||
1424 | (% style="color:blue" %)**AT Command: **(% style="color:#037691" %)**AT+TLSMOD** | ||
1425 | |||
1426 | **Example 1: ** AT+TLSMOD=0,0 ~/~/ Disable TLS Mode. | ||
1427 | |||
1428 | **Example 2:** AT+TLSMOD=1,0 ~/~/ No authentication | ||
1429 | |||
1430 | AT+TLSMOD=1,1 ~/~/ Perform server authentication | ||
1431 | |||
1432 | AT+TLSMOD=1,2 ~/~/ Perform server and client authentication if requested by the remote server | ||
1433 | |||
1434 | (% style="color:blue" %)**Downlink command:**(%%)** (% style="color:#037691" %)Downlinking is only supported for text format downlinks using the MQTT protocol(%%)** | ||
1435 | |||
1436 | Format: {AT+TLSMMOD=a,b} | ||
1437 | |||
1438 | Example1: Downlink Payload:** {AT+TLSMOD=0,0} **~/~/ AT+TLSMOD=0,0 | ||
1439 | |||
1440 | Example2: Downlink Payload:** {AT+TLSMOD=1,2} **~/~/ AT+TLSMOD=1,2 | ||
1441 | |||
1442 | (% style="color:red" %)**Note:**(%%) The UDP protocol does not work with this command. | ||
1443 | |||
1444 | |||
1445 | = 4. Battery & Power Consumption = | ||
1446 | |||
1447 | |||
1448 | RS485-CB use ER26500 + SPC1520 battery pack. See below link for detail information about the battery info and how to replace. | ||
1449 | |||
1450 | [[**Battery Info & Power Consumption Analyze**>>http://wiki.dragino.com/xwiki/bin/view/Main/How%20to%20calculate%20the%20battery%20life%20of%20Dragino%20sensors%3F/]] . | ||
1451 | |||
1452 | |||
1453 | = 5. Firmware update = | ||
1454 | |||
1455 | |||
1456 | User can change device firmware to:: | ||
1457 | |||
1458 | * Update with new features. | ||
1459 | |||
1460 | * Fix bugs. | ||
1461 | |||
1462 | Firmware and changelog can be downloaded from : **[[Firmware download link>>https://www.dropbox.com/scl/fo/1mzflb9p9kx15btnc11gr/ACwpCtXawZ1d290F0K4JwFo/RS485-CB?dl=0&rlkey=ku98jt8u30coqy66saebai2co&subfolder_nav_tracking=1]]** | ||
1463 | |||
1464 | Methods to Update Firmware: | ||
1465 | |||
1466 | * (Recommended way) OTA firmware update via BLE: [[**Instruction**>>url:http://wiki.dragino.com/xwiki/bin/view/Main/BLE_Firmware_Update_NB_Sensors_BC660K-GL/]]. | ||
1467 | |||
1468 | * Update through UART TTL interface : **[[Instruction>>http://wiki.dragino.com/xwiki/bin/view/Main/UART_Access_for_NB_ST_BC660K-GL/#H4.2UpdateFirmware28Assumethedevicealreadyhaveabootloader29]]**. | ||
1469 | |||
1470 | = 6. FAQ = | ||
1471 | |||
1472 | == 6.1 How can I access the BG95-NGFF AT Commands? == | ||
1473 | |||
1474 | |||
1475 | User can access to BG95-NGFF directly and send AT Commands. | ||
1476 | |||
1477 | [[See BG95-NGFF AT Command set>>https://www.dropbox.com/scl/fo/1mzflb9p9kx15btnc11gr/ALDWTvDjuVoXvDJuYWCRh5U/Vendor%20Datasheet/BG95?dl=0&rlkey=ku98jt8u30coqy66saebai2co&subfolder_nav_tracking=1]] | ||
1478 | |||
1479 | |||
1480 | == 6.2 How many RS485-Slave can RS485-CB connects? == | ||
1481 | |||
1482 | |||
1483 | ((( | ||
1484 | The RS485-CB can support max 32 RS485 devices. Each uplink command of RS485-CB can support max 16 different RS485 command. So RS485-CB can support max 16 RS485 devices pre-program in the device for uplink. For other devices no pre-program, user can use the downlink message (type code 0xA8) to poll their info. | ||
1485 | ))) | ||
1486 | |||
1487 | |||
1488 | == 6.3 How to configure the device through the MQTT subscription function? == | ||
1489 | |||
1490 | |||
1491 | 1)Subscription content: {AT COMMAND} | ||
1492 | |||
1493 | (% style="color:#037691" %)**Example:** | ||
1494 | |||
1495 | Setting AT+5VT=500 through Node-RED requires MQTT to send the content {AT+5VT=500}. | ||
1496 | |||
1497 | [[image:1698140180821-486.png]] | ||
1498 | |||
1499 | The serial port displays: | ||
1500 | |||
1501 | [[image:image-20231024174641-2.png||height="267" width="531"]] | ||
1502 | |||
1503 | |||
1504 | 2)Multiple AT commands can be configured on the downlink. | ||
1505 | |||
1506 | The command format is as follows: | ||
1507 | |||
1508 | {AT COMMAND1;AT COMMAND2;..AT COMMANDn} | ||
1509 | |||
1510 | Each command is separated by a ";" symbol and the total length of the commands issued cannot exceed 150 characters. | ||
1511 | |||
1512 | (% style="color:#037691" %)**Example:** | ||
1513 | |||
1514 | a)Send downstream from the MQTT.fx platform. | ||
1515 | |||
1516 | [[image:https://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-NB%2C-NS_RS485%2CUART_to_NB-IoT_Converter_User_Manual/WebHome/image-20241022172224-1.png?width=746&height=213&rev=1.1||alt="image-20241022172224-1.png"]] | ||
1517 | |||
1518 | b)You can see the downlink received on the serial port. | ||
1519 | |||
1520 | [[image:https://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-NB%2C-NS_RS485%2CUART_to_NB-IoT_Converter_User_Manual/WebHome/image-20241022172244-2.png?width=575&height=445&rev=1.1||alt="image-20241022172244-2.png"]] | ||
1521 | |||
1522 | The configuration is completed, as follows. | ||
1523 | |||
1524 | [[image:https://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-NB%2C-NS_RS485%2CUART_to_NB-IoT_Converter_User_Manual/WebHome/image-20241022172322-4.png?width=708&height=107&rev=1.1||alt="image-20241022172322-4.png"]] | ||
1525 | |||
1526 | |||
1527 | == 6.4 How to Use RS485-CB to connect to RS232 devices? == | ||
1528 | |||
1529 | |||
1530 | [[Use RS485-CB to connect to RS232 devices. - DRAGINO>>http://wiki.dragino.com/xwiki/bin/view/Main/RS485%20to%20RS232/]] | ||
1531 | |||
1532 | |||
1533 | == 6.5 How to judge whether there is a problem with the set COMMAND == | ||
1534 | |||
1535 | === 6.5.1 Introduce: === | ||
1536 | |||
1537 | |||
1538 | Users can use below the structure to fast debug the communication between RS485-CB. The principle is to put the PC in the RS485 network and sniff the packet between Modbus MTU and RS485-CB. We can (% style="color:blue" %)**use this way to:** | ||
1539 | |||
1540 | 1. Test if Modbus-MTU works with PC commands. | ||
1541 | 1. Check if RS485-CB sent the expected command to Mobus-MTU | ||
1542 | 1. Check if Modbus-MTU return back the expected result to RS485-CB. | ||
1543 | 1. If both b) and c) has issue, we can compare PC's output and RS485-CB output. | ||
1544 | |||
1545 | [[image:1698136924033-830.png]] | ||
1546 | |||
1547 | |||
1548 | (% style="color:blue" %)**Example Connection: ** | ||
1549 | |||
1550 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LN%20%E2%80%93%20RS485%20to%20LoRaWAN%20Converter/WebHome/image-20221130104310-2.png?rev=1.1||alt="image-20221130104310-2.png"]] | ||
1551 | |||
1552 | |||
1553 | === 6.5.2 Set up PC to monitor RS485 network With Serial tool === | ||
1554 | |||
1555 | |||
1556 | (% style="color:red" %)**Note: Receive and send set to hex mode** | ||
1557 | |||
1558 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LN%20%E2%80%93%20RS485%20to%20LoRaWAN%20Converter/WebHome/image-20221130104310-3.png?width=714&height=616&rev=1.1||alt="image-20221130104310-3.png" height="616" width="714"]] | ||
1559 | |||
1560 | |||
1561 | === 6.5.3 With ModRSsim2: === | ||
1562 | |||
1563 | |||
1564 | (% style="color:blue" %)**(1) Select serial port MODBUS RS-232** | ||
1565 | |||
1566 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LN%20%E2%80%93%20RS485%20to%20LoRaWAN%20Converter/WebHome/image-20221130104310-4.png?width=865&height=390&rev=1.1||alt="image-20221130104310-4.png" height="390" width="865"]] | ||
1567 | |||
1568 | |||
1569 | (% style="color:blue" %)**(2) Click the serial port icon** | ||
1570 | |||
1571 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LN%20%E2%80%93%20RS485%20to%20LoRaWAN%20Converter/WebHome/image-20221130104310-5.png?width=870&height=392&rev=1.1||alt="image-20221130104310-5.png" height="392" width="870"]] | ||
1572 | |||
1573 | |||
1574 | (% style="color:blue" %)**(3) After selecting the correct serial port and baud rate, click ok** | ||
1575 | |||
1576 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LN%20%E2%80%93%20RS485%20to%20LoRaWAN%20Converter/WebHome/image-20221130104310-6.png?rev=1.1||alt="image-20221130104310-6.png"]] | ||
1577 | |||
1578 | |||
1579 | (% style="color:blue" %)**(4) Click the comms.** | ||
1580 | |||
1581 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LN%20%E2%80%93%20RS485%20to%20LoRaWAN%20Converter/WebHome/image-20221130104310-7.png?width=835&height=376&rev=1.1||alt="image-20221130104310-7.png" height="376" width="835"]] | ||
1582 | |||
1583 | Run RS485-CB command and monitor if it is correct. | ||
1584 | |||
1585 | |||
1586 | === 6.5.4 Example – Test the CFGDEV command === | ||
1587 | |||
1588 | |||
1589 | RS485-LN sent below command: | ||
1590 | |||
1591 | (% style="color:blue" %)**AT+CFGDEV=01 03 20 00 01 85 c0,1**(%%) to RS485 network, and PC is able to get this command and return commands from MTU to show in the serial tool. | ||
1592 | |||
1593 | We can see the output from the Serial port tool to analyze. And check if they are expected result. | ||
1594 | |||
1595 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LN%20%E2%80%93%20RS485%20to%20LoRaWAN%20Converter/WebHome/image-20221130104310-8.png?width=797&height=214&rev=1.1||alt="image-20221130104310-8.png" height="214" width="797"]] | ||
1596 | |||
1597 | |||
1598 | We can also use ModRSsim2 to see the output. | ||
1599 | |||
1600 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LN%20%E2%80%93%20RS485%20to%20LoRaWAN%20Converter/WebHome/image-20221130104310-9.png?width=729&height=531&rev=1.1||alt="image-20221130104310-9.png" height="531" width="729"]] | ||
1601 | |||
1602 | |||
1603 | === 6.5.5 Example – Test CMD command sets. === | ||
1604 | |||
1605 | |||
1606 | Run (% style="color:blue" %)**AT+GETSENSORVALUE=1**(%%) to test the CMD commands set in RS485-CB. | ||
1607 | |||
1608 | (% style="color:blue" %)**Serial port tool:** | ||
1609 | |||
1610 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LN%20%E2%80%93%20RS485%20to%20LoRaWAN%20Converter/WebHome/image-20221130104310-10.png?width=844&height=339&rev=1.1||alt="image-20221130104310-10.png" height="339" width="844"]] | ||
1611 | |||
1612 | |||
1613 | (% style="color:blue" %)**ModRSsim2:** | ||
1614 | |||
1615 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LN%20%E2%80%93%20RS485%20to%20LoRaWAN%20Converter/WebHome/image-20221130104310-11.png?width=962&height=281&rev=1.1||alt="image-20221130104310-11.png" height="281" width="962"]] | ||
1616 | |||
1617 | |||
1618 | === 6.5.6 Test with PC === | ||
1619 | |||
1620 | |||
1621 | If there is still have problem to set up correctly the commands between RS485-LN and MTU. User can test the correct RS485 command set in PC and compare with the RS485 command sent out via RS485-LN. as long as both commands are the same, the MTU should return correct result. | ||
1622 | |||
1623 | Or User can send the working commands set in PC serial tool to Dragino Support to check what should be configured in RS485-LN. | ||
1624 | |||
1625 | (% style="color:blue" %)**Connection method:** | ||
1626 | |||
1627 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LN%20%E2%80%93%20RS485%20to%20LoRaWAN%20Converter/WebHome/image-20221130104310-12.png?rev=1.1||alt="image-20221130104310-12.png"]] | ||
1628 | |||
1629 | |||
1630 | (% style="color:blue" %)**Link situation:** | ||
1631 | |||
1632 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LN%20%E2%80%93%20RS485%20to%20LoRaWAN%20Converter/WebHome/image-20221130104310-13.png?width=486&height=458&rev=1.1||alt="image-20221130104310-13.png" height="458" width="486"]] | ||
1633 | |||
1634 | |||
1635 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/RS485-LN%20%E2%80%93%20RS485%20to%20LoRaWAN%20Converter/WebHome/image-20221130104310-14.png?width=823&height=371&rev=1.1||alt="image-20221130104310-14.png" height="371" width="823"]] | ||
1636 | |||
1637 | |||
1638 | == 6.6 General Manual for -CB , -CS models == | ||
1639 | |||
1640 | |||
1641 | Users can follow the instructions in this [[link>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Manual%20for%20-CB%20%2C%20-CS%20models/]] to see how to configure to connect to different servers. | ||
1642 | |||
1643 | |||
1644 | == 6.7 How to determine whether the returned data value FF is valid data or invalid data? == | ||
1645 | |||
1646 | The address of the returned data can be used as a flag. | ||
1647 | |||
1648 | The customer uses the intercept command to intercept the first bit of the returned data (the slave address of the sensor) as a judgment flag. | ||
1649 | |||
1650 | **Invalid data:** | ||
1651 | |||
1652 | If the first bit and the data are both FF, it means the data is empty. | ||
1653 | |||
1654 | |||
1655 | **Valid data:** | ||
1656 | If the first bit is a normal slave address and the data is FF, it means the data is normal. | ||
1657 | |||
1658 | = 7. Order Info = | ||
1659 | |||
1660 | |||
1661 | Part Number: (% style="color:blue" %)**RS485-CB-XX** | ||
1662 | |||
1663 | (% style="color:red" %)**XX**(%%): | ||
1664 | |||
1665 | * (% style="color:#037691" %)**GE**(%%): General version ( Exclude SIM card) | ||
1666 | |||
1667 | * (% style="color:#037691" %)**1T**(%%): with 1NCE* 10 years 500MB SIM card and Pre-configure to ThingsEye server | ||
1668 | |||
1669 | (% style="color:blue" %)**YY: The grand connector hole size** | ||
1670 | |||
1671 | * (% style="color:#037691" %)**M12**(%%): M12 hole | ||
1672 | |||
1673 | * (% style="color:#037691" %)**M16**(%%): M16 hole | ||
1674 | |||
1675 | = 8. Packing Info = | ||
1676 | |||
1677 | |||
1678 | (% style="color:#037691" %)**Package Includes**: | ||
1679 | |||
1680 | * RS485-CB NB-IoT/LTE-M Sensor Node x 1 | ||
1681 | |||
1682 | * External antenna x 1 | ||
1683 | |||
1684 | (% style="color:#037691" %)**Dimension and weight**: | ||
1685 | |||
1686 | * Device Size: 13.0 x 5 x 4.5 cm | ||
1687 | |||
1688 | * Device Weight: 150g | ||
1689 | |||
1690 | * Package Size / pcs : 14.0 x 8x 5 cm | ||
1691 | |||
1692 | * Weight / pcs : 180g | ||
1693 | |||
1694 | = 9. Support = | ||
1695 | |||
1696 | |||
1697 | * Support is provided Monday to Friday, from 09:00 to 18:00 GMT+8. Due to different timezones we cannot offer live support. However, your questions will be answered as soon as possible in the before-mentioned schedule. | ||
1698 | |||
1699 | * Provide as much information as possible regarding your enquiry (product models, accurately describe your problem and steps to replicate it etc) and send a mail to [[Support@dragino.cc>>mailto:Support@dragino.cc]]. | ||
1700 | |||
1701 | (% style="display:none" %) (%%) |