RS485-NB/NS -- RS485/UART to NB-IoT Converter User Manual
Table of Contents:
- 1. Introduction
- 2. Use RS485-NB/NS to communicate with IoT Server
- 2.1 Send data to IoT server via NB-IoT network
- 2.2 Configure Device to Read RS485 Sensors
- 2.3 Payload Types
- 2.4 Test Uplink and Change Update Interval
- 2.5 Fast command to handle MODBUS device
- 2.6 RS485 command timeout
- 2.7 Clear RS485 Command
- 2.8 Set Payload version
- 2.9 Control output power duration
- 2.10 Get sensor value
- 2.11 +3V3 Output
- 2.12 +5V Output
- 2.13 Switch Jumper
- 2.14 Clock logging (Since firmware version v1.0.7)
- 2.15 Example Query saved historical records
- 2.16 Uplink log query
- 2.17 Scheduled domain name resolution
- 2.18 Set the QoS level
- 2.19 Set the downlink debugging mode(Since firmware v1.2.0)
- 2.20 Domain name resolution settings(Since firmware v1.2.0)
- 3. Configure RS485-NB/NS
- 4. Battery & Power Consumption
- 5. Firmware update
- 6. FAQ
- 7. Order Info
- 8. Packing Info
- 9. Support
1. Introduction
1.1 What is RS485 / UART to NB-IoT Converter
The Dragino RS485-NB/NS is a RS485 / UART to NB-IoT Converter for Internet of Things solutions. User can connect RS485 or UART sensor to RS485-NB/NS converter, and configure RS485-NB/NS to periodically read sensor data and upload via NB-IoT network to IoT server.
RS485-NB/NS can interface to RS485 sensor, 3.3v/5v UART sensor or interrupt sensor. RS485-NB/NS provides a 3.3v output and a 5v output to power external sensors. Both output voltages are controllable to minimize the total system power consumption.
RS485-NB/NS supports different uplink methods including MQTT, MQTTs, UDP , TCP or CoAP for different application requirement, and support uplinks to various IoT Servers.
RS485-NB/NS supports BLE configure and wireless OTA update which make user easy to use.
RS485-NB/NS is IP67 waterproof and powered by 8500mAh Li-SOCI2 battery or solar powered + Li-ion battery, it is designed for long-term use up to several years.
RS485-NB/NS has optional built-in SIM card and default IoT server connection version. Which makes it works with simple configuration.
1.2 Features
- NB-IoT Bands: B1/B2/B3/B4/B5/B8/B12/B13/B17/B18/B19/B20/B25/B28/B66/B70/B85 @H-FDD
- Ultra-low power consumption
- Support multiply RS485 devices by flexible rules
- Support Modbus protocol
- Support Interrupt uplink
- Supports connecting a UART sensors with 3.3V or 5V
- Multiply Sampling and one uplink
- Support Bluetooth v5.1 remote configure and update firmware
- Uplink via MQTT, MQTTs, TCP, UDP or CoAP
- Uplink on periodically
- Downlink to change configure
- 8500mAh Li/SOCl2 Battery (RS485-NB)
- Solar panel + 3000mAh Li-ion battery (RS485-NS)
1.3 Specification
Common DC Characteristics:
- Supply Voltage: 2.5v ~ 3.6v
- Operating Temperature: -40 ~ 85°C
I/O Interface:
- Battery controllable output (2.6v ~ 3.6v depends on battery)
- +5v controllable output
- 1 x RS485 Interface
- 1 x UART Interface , 3.3v or 5v
- 1 x Interrupt or Digital IN/OUT pins
- 1 x I2C Interface
- 1 x one wire interface
NB-IoT Spec:
NB-IoT Module: BC660K-GL
Support Bands:
- B1 @H-FDD: 2100MHz
- B2 @H-FDD: 1900MHz
- B3 @H-FDD: 1800MHz
- B4 @H-FDD: 2100MHz
- B5 @H-FDD: 860MHz
- B8 @H-FDD: 900MHz
- B12 @H-FDD: 720MHz
- B13 @H-FDD: 740MHz
- B17 @H-FDD: 730MHz
- B18 @H-FDD: 870MHz
- B19 @H-FDD: 870MHz
- B20 @H-FDD: 790MHz
- B25 @H-FDD: 1900MHz
- B28 @H-FDD: 750MHz
- B66 @H-FDD: 2000MHz
- B70 @H-FDD: 2000MHz
- B85 @H-FDD: 700MHz
Battery:
- Li/SOCI2 un-chargeable battery
- Capacity: 8500mAh
- Self Discharge: <1% / Year @ 25°C
- Max continuously current: 130mA
- Max boost current: 2A, 1 second
Power Consumption
- STOP Mode: 10uA @ 3.3v
- Max transmit power: 350mA@3.3v
1.4 Applications
- Smart Buildings & Home Automation
- Logistics and Supply Chain Management
- Smart Metering
- Smart Agriculture
- Smart Cities
- Smart Factory
1.5 Sleep mode and working mode
Deep Sleep Mode: Sensor doesn't have any NB-IoT activate. This mode is used for storage and shipping to save battery life.
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.
1.6 Button & LEDs
Behavior on ACT | Function | Action |
---|---|---|
Pressing ACT between 1s < time < 3s | Send an uplink | If sensor has already attached to NB-IoT network, sensor will send an uplink packet, blue led will blink once. |
Pressing ACT for more than 3s | Active Device | Green led will fast blink 5 times, device will enter OTA mode for 3 seconds. And then start to attach NB-IoT network. |
Fast press ACT 5 times. | Deactivate Device | Red led will solid on for 5 seconds. Means device is in Deep Sleep Mode. |
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.
1.7 BLE connection
RS485-NB/NS support BLE remote configure and firmware update.
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:
- Press button to send an uplink
- Press button to active device.
- Device Power on or reset.
If there is no activity connection on BLE in 60 seconds, sensor will shut down BLE module to enter low power mode.
1.8 Pin Definitions , Switch & SIM Direction
1.8.1 Jumper JP2
Power on Device when put this jumper.
1.8.2 BOOT MODE / SW1
1) 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.
2) Flash: work mode, device starts to work and send out console output for further debug
1.8.3 Reset Button
Press to reboot the device.
1.8.4 SIM Card Direction
See this link. How to insert SIM Card.
1.8.5 SW2 Jumper (Define UART level to external Sensor)
SW2 defines the voltage level of BOARD_RX and BOARD_TX pins. It should match the external sensor voltage level
1.9 Mechanical
1.9.1 for NB version
1.9.2 for NS version
2. Use RS485-NB/NS to communicate with IoT Server
2.1 Send data to IoT server via NB-IoT network
The RS485-NB/NS is equipped with a NB-IoT module, the pre-loaded firmware in RS485-NB/NS 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-NB/NS.
Below shows the network structure:
There are two version: -GE and -1T version of RS485-NB/NS.
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-NB/NS send data to IoT server.
- Install NB-IoT SIM card and configure APN. See instruction of Attach Network.
- Set up sensor to point to IoT Server. See instruction of Configure to Connect Different Servers.
Below shows result of different server as a glance.
Servers | Dash Board | Comments |
Node-Red | ||
ThingsBoard | ||
General UDP | Raw Payload. Need Developer to design Dash Board | |
General MQTT | Raw Payload. Need Developer to design Dash Board |
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-NB/NS and user will be able to see data in ThingsEye. See here for ThingsEye Config Instruction.
2.2 Configure Device to Read RS485 Sensors
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-NB/NS supports flexible command set. User can use Dragino RS485 Tool, AT Commands or LoRaWAN Downlink Command to configure how RS485-NB/NS should read the sensor and how to handle the return from RS485 or TTL sensors.
2.2.1 Method 1 -- via RS485 Configure Tool
Use the RS485 Configure tool is the recommand method. Please see the instruction of how to use the tool:
2.2.2 Method 2 -- via AT Commands
2.2.2.1 Configure UART settings for RS485 or TTL communication
RS485-NB/NS can connect to either RS485 sensors or TTL sensor. User need to specify what type of sensor need to connect.
1. RS485-MODBUS mode:
AT+MOD=1 // Support RS485-MODBUS type sensors. User can connect multiply RS485 , Modbus sensors to the A / B pins.
2. TTL mode:
AT+MOD=2 // Support TTL Level sensors, User can connect one TTL Sensor to the TXD/RXD/GND pins.
RS485-NB/NS default UART settings is 9600, no parity, stop bit 1,data bit 8. If the sensor has a different settings, user can change the RS485-NB/NS setting to match.
AT Commands | Description | Example |
---|---|---|
AT+BAUDR | Set the baud rate. Default Value is: 9600. | AT+BAUDR=9600 Options: (1200,2400,4800,14400,19200,115200) |
AT+PARITY | Set UART parity. Default Value is: no parity. | AT+PARITY=0 Option: 0: no parity, 1: odd parity, 2: even parity |
AT+STOPBIT | Set serial stopbit Default Value is: 1bit. | AT+STOPBIT=0 for 1 bit AT+STOPBIT=1 for 1.5 bits AT+STOPBIT=2 for 2 bits |
AT+DATABIT | Set serial databit. Default Value is: 8bits. | AT+DATABIT=7 for 7 bits AT+DATABIT=8 for 8 bits |
Example(Soil three-parameter detector):
Wiring the UART sensor
GND <--------> GND
TX <--------> RX
RX <--------> TX
VCC <--------> 3.3/5V
Set the correct configuration:
AT+BAUDR=9600
AT+PARITY=0
AT+STOPBIT=1
AT+DATABIT=8
If the sensor needs 5v. Need to move the switch position to 5v and then use the command AT+5VT=30000
Configuration read command:
AT+CFGDEV=FE 03 00 00 00 03 11 C4,0
FE: Station address
03: Function code
00 00: Register start address
00 03: Number of registers
11 04: Check code
Use AT+COMMAND1 to set it as a command, and use AT+DATACUT1 to intercept the bytes I need
upload payload:
2.2.3 Configure sensors
Some sensors might need to configure before normal operation. User can configure such sensor via PC or through RS485-NB/NS AT Commands AT+CFGDEV.
When user issue an AT+CFGDEV command, Each 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.
AT Commands | Description | Example |
---|---|---|
AT+CFGDEV | This command is used to configure the RS485/TTL devices; they won’t be used during sampling. AT+CFGDEV=xx xx xx xx xx xx xx xx xx xx xx xx, mm: 0: no CRC, 1: add CRC-16/MODBUS in the end of this command | AT+CFGDEV=xx xx xx xx xx xx xx xx xx xx xx xx,m |
2.2.4 Configure read commands for each sampling
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.
RS485-NB/NS 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.
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.
To save the LoRaWAN network bandwidth, we might need to read data from different sensors and combine their valid value into a short payload.
This section describes how to achieve above goals.
During each sampling, the RS485-NB/NS can support 15 commands to read sensors. And combine the return to one or several uplink payloads.
Command from RS485-NB/NS to Sensor:
RS485-NB/NS can send out pre-set max 15 strings via AT+COMMAD1, ATCOMMAND2,…, to AT+COMMANDF . All commands are of same grammar.
Handle return from sensors to RS485-NB/NS:
After RS485-NB send out a string to sensor, RS485-NB/NS 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
AT+DATACUT
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.
AT+SEARCH
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.
Define wait timeout:
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
Examples:
Below are examples for the how above AT Commands works.
AT+COMMANDx : This command will be sent to RS485/TTL devices during each sampling, Max command length is 14 bytes. The grammar is:
AT+COMMANDx=xx xx xx xx xx xx xx xx xx xx xx xx,m xx xx xx xx xx xx xx xx xx xx xx xx: The RS485 command to be sent m: 0: no CRC, 1: add CRC-16/MODBUS in the end of this command |
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.
In the RS485-NB/NS, we should use this command AT+COMMAND1=01 03 0B B8 00 02,1 for the same.
If a single command exceeds 14 bytes, you can use the command splicing function.
When AT+CMDDLx=1, the commands of AT+COMMANDx and AT+COMMAND(x+1) will be merged.
Examples: To send 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F data it should be configured:
AT+COMMAND1=00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D,0
AT+COMMAND1=1
AT+COMMAND2=0E 0F,0
AT+SEARCHx: This command defines how to handle the return from AT+COMMANDx.
AT+SEARCHx=aa,xx xx xx xx xx
|
Examples:
1) For a return string from AT+COMMAND1: 16 0c 1e 56 34 2e 30 58 5f 36 41 30 31 00 49
If we set AT+SEARCH1=1,1E 56 34. (max 5 bytes for prefix)
The valid data will be all bytes after 1E 56 34 , so it is 2e 30 58 5f 36 41 30 31 00 49
2) For a return string from AT+COMMAND1: 16 0c 1e 56 34 2e 30 58 5f 36 41 30 31 00 49
If we set AT+SEARCH1=2, 1E 56 34+31 00 49
Device will search the bytes between 1E 56 34 and 31 00 49. So it is 2e 30 58 5f 36 41 30
AT+DATACUTx : This command defines how to handle the return from AT+COMMANDx, max return length is 100 bytes.
AT+DATACUTx=a,b,c
|
Examples:
Grab bytes:
Grab a section.
Grab different sections.
Note:
AT+SEARCHx and AT+DATACUTx can be used together, if both commands are set, RS485-NB/NS 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.
Example:
AT+COMMAND1=11 01 1E D0,0
AT+SEARCH1=1,1E 56 34
AT+DATACUT1=0,2,1~5
Return string from AT+COMMAND1: 16 0c 1e 56 34 2e 30 58 5f 36 41 30 31 00 49
String after SEARCH command: 2e 30 58 5f 36 41 30 31 00 49
Valid payload after DataCUT command: 2e 30 58 5f 36
2.2.5 Uplink when the sensor is not responding
1) When AT+MOD=1, if the data intercepted by AT+DATACUT or AT+MBFUN is empty, it will display NULL, and the payload will be filled with n FFs.
2) When AT+MOD=2, if the data intercepted by AT+DATACUT or AT+MBFUN is empty, it will display NULL, and the payload will be filled with n 00s.
2.2.6 Uplink on Interrupt
Put the interrupt sensor between 3.3v_out and GPIO_EXTI.
AT+INTMOD=0 Disable Interrupt.( Default Value)
AT+INTMOD=1 Interrupt trigger by rising or falling edge.
AT+INTMOD=2 Interrupt trigger by falling edge.
AT+INTMOD=3 Interrupt trigger by rising edge.
2.3 Payload Types
To meet different server requirement, RS485-NB/NS supports different payload type.
Includes:
- General JSON format payload. (Type=5)
- HEX format Payload. (Type=0)
User can specify the payload type when choose the connection protocol. Example:
AT+PRO=2,0 // Use UDP Connection & hex Payload
AT+PRO=2,5 // Use UDP Connection & Json Payload
AT+PRO=3,0 // Use MQTT Connection & hex Payload
AT+PRO=3,5 // Use MQTT Connection & Json Payload
AT+PRO=4,0 // Use TCP Connection & hex Payload
AT+PRO=4,5 // Use TCP Connection & Json Payload
2.3.1 General Json Format(Type=5)
This is the General Json Format. As below:
{"IMEI":"863663062798815","IMSI":"460083513507309","Model":"RS485-NB","Payload":"0108b4","battery":3.605,"signal":25,"time":"2024/12/11 09:34:15","1":["0108b2","2024/12/11 09:28:12"],"2":["0108b4","2024/12/11 09:11:11"],"3":["0108b4","2024/12/11 08:56:11"],"4":["0108b6","2024/12/11 08:41:11"],"5":["0108b4","2024/12/11 08:26:11"],"6":["0108b7","2024/12/11 08:11:11"],"7":["01ffff","2024/12/11 07:56:10"],"8":["01ffff","2024/12/11 07:41:10"]}
Notice:The maximum number of bytes in the Payload is 1 payload version number plus 687 RS485 data.
2.3.2 HEX format Payload(Type=0)
This is the HEX Format. As below:
f863663062798815f46008351350730917780e1519000067595c860108b367595b2c0108b26759572f0108b4675953ab0108b4675950270108b667594ca30108b46759491f0108b76759459a01ffff6759421601ffff
Version:
These bytes include the hardware and software version.
Higher byte: Specify Sensor Model: 0x17 for RS485-NB/NS
Lower byte: Specify the software version: 0x78=120, means firmware version 1.2.0
BAT (Battery Info):
Ex1: 0x0e15 = 3605mV
Signal Strength:
NB-IoT Network signal Strength.
Ex1: 0x19 = 25
0 -113dBm or less
1 -111dBm
2...30 -109dBm... -53dBm
31 -51dBm or greater
99 Not known or not detectable
GPIO_EXIT Level :
GPIO_EXTI is used as Interrupt Pin.
Example:
01 (H): GPIO_EXTI pin is high level.
00 (L): GPIO_EXTI pin is low level.
GPIO_EXIT Flag:
This data field shows if this packet is generated by Interrupt Pin or not.
Note: The Interrupt Pin is a separate pin in the screw terminal.
Example:
0x00: Normal uplink packet.
0x01: Interrupt Uplink Packet.
TimeStamp:
Unit TimeStamp Example: 67595c86(H) = 1733909638(D)
Put the decimal value into this link(https://www.epochconverter.com/) to get the time.
Payload_version:
The payload version number is used to parse different decodes.
RS485_sensor_data:
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.
2.4 Test Uplink and Change Update Interval
By default, Sensor will send uplinks every 2 hours
User can use below commands to change the uplink interval.
AT+TDC=7200 // Set Update Interval to 7200s
User can also push the button for more than 1 seconds to activate an uplink.
2.5 Fast command to handle MODBUS device
The command is for fast configure to read Modbus devices. It is only valid for the devices which follow the MODBUS-RTU protocol.
AT+MBFUN has only two value:
AT+MBFUN=1: Enable Modbus reading. And get response base on the MODBUS return
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.
AT+MBFUN=0: Disable Modbus fast reading.
Example:
AT+MBFUN=1 and AT+DATACUT1/AT+DATACUT2 are not configure (0,0,0).
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.
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.
2.6 RS485 command timeout
Some Modbus device has slow action to send replies. This command is used to configure the RS485-NB/NS to use longer time to wait for their action.
Default value: 0, range: 0 ~ 10 seconds
- AT Command:
AT+CMDDLaa=hex(bb cc)
Example:
AT+CMDDL1=1000 to send the open time to 1000ms
2.7 Clear RS485 Command
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.
AT Command:
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.
2.8 Set Payload version
This is the first byte of the uplink payload. RS485-NB/NS can connect to different sensors. User can set the PAYVER field to tell server how to decode the current payload.
- AT Command:
AT+PAYVER: Set PAYVER field = 1
2.9 Control output power duration
User can set the output power duration before each sampling.
AT Command:
Example:
AT+3V3T=1000 // 3V3 output power will open 1s before each sampling.
AT+3V3T=0 // Normally open 3V3 power supply.
AT+3V3T=65535 // Normally closed 3V3 power supply.
AT+5VT=1000 // +5V output power will open 1s before each sampling.
AT+5VT=0 // Normally closed +5V power supply.
AT+5VT=65535 // Normally open +5V power supply.
2.10 Get sensor value
AT Command:
AT+GETSENSORVALUE=0 // The serial port gets the reading of the current sensor
AT+GETSENSORVALUE=1 // The serial port gets the current sensor reading and uploads it.
2.11 +3V3 Output
RS485-NB/NS has a Controllable +3V3 output, user can use this output to power external sensor.
The +3V3 output will be valid for every sampling. RS485-NB/NS will enable +3V3 output before all sampling and disable the +3V3 after all sampling.
The +3V3 output time can be controlled by AT Command.
AT+3V3T=1000
Means set +3v3 valid time to have 1000ms. So, the real +3v3 output will actually have 1000ms + sampling time for other sensors.
By default, the AT+3V3T=0. This is a special case, means the +3V3 output is always on at any time
2.12 +5V Output
RS485-NB/NS has a Controllable +5V output, user can use this output to power external sensor.
The +5V output will be valid for every sampling. RS485-NB/NS will enable +5V output before all sampling and disable the +5v after all sampling.
The 5V output time can be controlled by AT Command.
AT+5VT=1000
Means set 5V valid time to have 1000ms. So, the real 5V output will actually have 1000ms + sampling time for other sensors.
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.
2.13 Switch Jumper
Switch Jumper | Feature |
---|---|
SW1 | ISP position: Upgrade firmware via UART Flash position: Configure device, check running status. |
SW2 | 5V position: set to compatible with 5v I/O. 3.3v position: set to compatible with 3.3v I/O. |
+3.3V: is always ON
+5V: Only open before every sampling. The time is by default, it is AT+5VT=0.
Note: If SW2 is at +5V and AT+5VT=0, work mode 2 will not be able to send data.
2.14 Clock logging (Since firmware version v1.0.7)
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.
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.
- AT Command: AT+CLOCKLOG=a,b,c,d
a: 0: Disable Clock logging. 1: Enable Clock Logging
b: Specify First sampling start second: range (0 ~ 3599, 65535) // Note: If parameter b is set to 65535, the log period starts after the node accesses the network and sends packets.
c: Specify the sampling interval: range (0 ~ 255 minutes)
d: How many entries should be uplink on every TDC (max 32)
Note: To disable clock recording, set the following parameters: AT+CLOCKLOG=1,65535,0,0
Example:
AT+CLOCKLOG=1,65535,1,5
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).
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.
- Downlink command: 0x0A
Format: Command Code (0x0A) followed by 5 bytes.
- Example 1: Downlink Payload: 0A01FFFF0F08 // Set SHT record time: AT+CLOCKLOG=1,65535,15,8
- Example 1: Downlink Payload: 0A0104B00F08 // Set SHT record time: AT+CLOCKLOG=1,1200,15,8
Note: When entering the downlink payload, there must be no Spaces between bytes.
2.15 Example Query saved historical records
- AT command: AT+CDP
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.
2.16 Uplink log query
- AT command: AT+GETLOG
This command can be used to query upstream logs of data packets.
2.17 Scheduled domain name resolution
This command is used to set up scheduled domain name resolution.
AT command:
- AT+DNSTIMER // Unit: hour
After setting this command, domain name resolution will be performed regularly.
2.18 Set the QoS level
This command is used to set the QoS level of MQTT.
AT command:
- AT+MQOS // 0~2
Downlink command: 0x07
Format: Command Code (0x07) followed by 1 byte.
Ex1: Downlink payload: 0x0700 // AT+MQOS=0
Ex2: Downlink payload: 0x0701 // AT+MQOS=1
2.19 Set the downlink debugging mode(Since firmware v1.2.0)
Feature: Set the conversion between the standard version and 1T version downlinks.
AT command: AT+DOWNTE
Command Example | Function/Parameters | Response/Explanation |
---|---|---|
AT+DOWNTE=? | Get current Settings | 0,0 (default) OK |
AT+DOWNTE=a,b | a: Set the conversion between the downlink of the standard version and 1T version | 0: Set the downlink of the standard version. |
b: Enable/Disable downlink debugging | 0: Disable downlink debugging mode. |
Example:
- AT+DOWNTE=0,1 //Set to standard version downlink, and enable downlink debugging.
- AT+DOWNTE=1,1 //Set to 1T version downlink, and enable downlink debugging.
Downlink Command:
No downlink commands for feature
2.20 Domain name resolution settings(Since firmware v1.2.0)
Feature: Set dynamic domain name resolution IP.
AT command: AT+BKDNS
Command Example | Function/Parameters | Response/Explanation |
---|---|---|
AT+BKDNS=? | Get current Settings | 0,0,NULL (default) OK |
AT+BKDNS=a,b,c |
a: Enable/Disable dynamic domain name resolution. | 1: Disable dynamic domain name update. The ip address will be saved after the domain name is resolved, if the next domain name resolution fails, the last saved ip address will be used. 2: Enable dynamic domain name update. The ip address will be saved after domain name resolution, if the next domain name resolution fails, the last saved ip address will be used, and the domain name resolution will be updated regularly according to the time set by the customer. |
b: Set the time to update the domain name resolution at regular intervals. |
Unit: hour | |
c: Set the IP address manually. | The format is the same as AT+SERVADDR. If domain name resolution fails, this ip address will be used directly, if domain name resolution succeeds, parameter c will be updated to the successfully resolved IP address. |
Example:
- AT+BKDNS=1,0 //Dynamic domain name resolution is disabled.
- AT+BKDNS=2,1 //The dynamic domain name resolution function is enabled and the automatic update time is set to 1 hour.
- AT+BKDNS=2,4,3.69.98.183,1883 //The dynamic domain name resolution function is enabled and the automatic update time is set to 4 hour, and manually set the ip address, if the domain name failed to resolve, it will directly use this ip to communicate. When the next domain name resolution is successful, it will be updated to the ip address of the successful resolution.
Downlink Command:
No downlink commands for feature
3. Configure RS485-NB/NS
3.1 Configure Methods
RS485-NB/NS supports below configure method:
- AT Command via Bluetooth Connection (Recommended): BLE Configure Instruction.
- AT Command via UART Connection : See UART Connection.
3.2 Serial Access Password
After the Bluetooth or UART connection is successful, use the Serial Access Password to enter the AT command window.
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.
If you need to change the password, use AT+PWORD=xxxxxx (6 characters), NB nodes only support lowercase letters.
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.
3.3 AT Commands Set
AT+<CMD>? : Help on <CMD>
AT+<CMD> : Run <CMD>
AT+<CMD>=<value> : Set the value
AT+<CMD>=? : Get the value
General Commands
AT : Attention
AT? : Short Help
ATZ : MCU Reset
AT+TDC : Application Data Transmission Interval
AT+CFG : Print all configurations
AT+CFGMOD : Working mode selection
AT+DEUI : Get or set the Device ID
AT+PRO : Choose agreement
AT+RXDL : Extend the sending and receiving time
AT+DNSCFG : Get or Set DNS Server
AT+GETSENSORVALUE : Returns the current sensor measurement
AT+SERVADDR : Server Address
AT+MOD: Get or Set work mode
AT+5VT : Get or Set extend the time of 5V power
AT+3V3T : Get or Set extend the time of 3V3 power
AT+INTMOD : Get or Set the trigger interrupt mode (0:input,1:falling or rising,2:falling,3:rising)
AT+BAUDR: Get or Set baudr of uart
AT+DATABIT: Get or Set databit(7:7 bit,8:8 bit) of uart
AT+PARITY: Get or Set parity(0:none,1:odd,2:even) of uart
AT+STOPBIT: Get or Set stopbit(0:1 bit,1:1.5 bit,2:2 bit) of uart
AT+CMDEAR: Erase command(number of begin to number of ending)
AT+PAYVER: Get or Set payload version
AT+MBFUN: Get or Set Modbus Funtion code(0:none,1:01 or 02,2:03 or 04)for automatic cut
AT+COMMAND: Send data of command1-15 to RS485 deceive for payload
AT+SEARCH: Retrieve the hexadecimal character that appears in command 1-15
AT+DATACUT: Cut receive data after use command1-15
AT+CMDDL: Set delay timeout after send rs485 command1-15
AT+CFGDEV: Send data to RS485 deceive
AT+DNSTIMER: Regularly resolve domain names
MQTT Management
AT+CLIENT : Get or Set MQTT client
AT+UNAME : Get or Set MQTT Username
AT+PWD : Get or Set MQTT password
AT+PUBTOPIC : Get or Set MQTT publish topic
AT+SUBTOPIC : Get or Set MQTT subscription topic
Information
AT+FDR : Factory Data Reset
AT+PWORD : Serial Access Password
AT+LDATA : Get the last upload data
4. Battery & Power Consumption
RS485-NB use ER26500 + SPC1520 battery pack and RS485-NS use 3000mAh Recharable Battery with Solar Panel. See below link for detail information about the battery info and how to replace.
Battery Info & Power Consumption Analyze .
5. Firmware update
User can change device firmware to::
- Update with new features.
- Fix bugs.
Firmware and changelog can be downloaded from : Firmware download link
Methods to Update Firmware:
- (Recommended way) OTA firmware update via BLE: Instruction.
- Update through UART TTL interface : Instruction.
6. FAQ
6.1 How can I access t BC660K-GL AT Commands?
User can access to BC660K-GL directly and send AT Commands.
6.2 How many RS485-Slave can RS485-NB/NS connects?
The RS485-NB/NS can support max 32 RS485 devices. Each uplink command of RS485-NB/NS can support max 16 different RS485 command. So RS485-NB/NS 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.
6.3 How to configure the device through the MQTT subscription function?
1)Subscription content: {AT COMMAND}
Example:
Setting AT+5VT=500 through Node-RED requires MQTT to send the content {AT+5VT=500}.
The serial port displays:
2)Starting with v1.1.0 firmware,, multiple AT commands can be configured on the downlink.
The command format is as follows:
{AT COMMAND1;AT COMMAND2;..AT COMMANDn}
Each command is separated by a ";" symbol and the total length of the commands issued cannot exceed 150 characters.
Example:
a)Send downstream from the MQTT.fx platform.
b)You can see the downlink received on the serial port.
The configuration is completed, as follows.
6.4 How to Use RS485-NB/NS to connect to RS232 devices?
Use RS485-NB/NS to connect to RS232 devices. - DRAGINO
6.5 How to judge whether there is a problem with the set COMMAND
6.5.1 Introduce:
Users can use below the structure to fast debug the communication between RS485-NB/NS. The principle is to put the PC in the RS485 network and sniff the packet between Modbus MTU and RS485-NB/NS. We can use this way to:
- Test if Modbus-MTU works with PC commands.
- Check if RS485-NB/NS sent the expected command to Mobus-MTU
- Check if Modbus-MTU return back the expected result to RS485-NB/NS.
- If both b) and c) has issue, we can compare PC's output and RS485-NB/NS output.
Example Connection:
6.5.2 Set up PC to monitor RS485 network With Serial tool
Note: Receive and send set to hex mode
6.5.3 With ModRSsim2:
(1) Select serial port MODBUS RS-232
(2) Click the serial port icon
(3) After selecting the correct serial port and baud rate, click ok
(4) Click the comms.
Run RS485-NB/NS command and monitor if it is correct.
6.5.4 Example – Test the CFGDEV command
RS485-LN sent below command:
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.
We can see the output from the Serial port tool to analyze. And check if they are expected result.
We can also use ModRSsim2 to see the output.
6.5.5 Example – Test CMD command sets.
Run AT+SENSORVALUE=1 to test the CMD commands set in RS485-LN.
Serial port tool:
ModRSsim2:
6.5.6 Test with PC
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.
Or User can send the working commands set in PC serial tool to Dragino Support to check what should be configured in RS485-LN.
Connection method:
Link situation:
7. Order Info
Part Number: RS485-NB-XX or RS485-NS-XX
XX:
- GE: General version ( Exclude SIM card)
- 1T: with 1NCE * 10 years 500MB SIM card and Pre-configure to ThingsEye server
YY: The grand connector hole size
- M12: M12 hole
- M16: M16 hole
8. Packing Info
Package Includes:
- 1 x RS485-NB or RS485-NS NB-IoT Sensor Node
- External antenna x 1
Dimension and weight:
- Device Size: 13.0 x 5 x 4.5 cm
- Device Weight: 150g
- Package Size / pcs : 14.0 x 8x 5 cm
- Weight / pcs : 180g
9. Support
- 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.
- 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.