0% found this document useful (0 votes)
80 views31 pages

NS1 UserManual EN V1.2

EBYTE NS1

Uploaded by

T5 Tecnologia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views31 pages

NS1 UserManual EN V1.2

EBYTE NS1

Uploaded by

T5 Tecnologia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

Chengdu Ebyte Electronic Technology Co.,Ltd.

NS1_User_Manual

NS1 User Manual


Serial ⇌ Ethernet
Serial Server
Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd.
1
Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

CONTENTS
Disclaimer....................................................................................................................................................................... 1
1 Product Overview........................................................................................................................................................ 2
1.1 Brief Introduction............................................................................................................................................. 2
1.2 Feature.............................................................................................................................................................. 2
2 Product Overview........................................................................................................................................................ 3
2.1 Technical parameters........................................................................................................................................ 3
2.2 Interface and Indicator Description.................................................................................................................. 4
2.3 Dimensions....................................................................................................................................................... 6
2.4 Hardware design............................................................................................................................................... 7
2.4.1 Typical application connection..............................................................................................................7
2.4.2 Power supply connection.......................................................................................................................7
2.4.3 UART interface......................................................................................................................................8
2.4.4 10/100M external Ethernet network transformer..................................................................................8
2.4.5 10/100M internal Ethernet network transformer...................................................................................9
2.4.6 PCB library............................................................................................................................................ 9
3 Functional Introduction............................................................................................................................................. 10
3.1 Serial port parameters.....................................................................................................................................10
3.2 Introduction to basic functions....................................................................................................................... 10
3.2.1 Web page configuration.......................................................................................................................10
3.2.2 Subnet mask/IP address....................................................................................................................... 12
3.2.3 Domain Name Resolution (DNS)........................................................................................................13
3.2.4 Restore factory settings....................................................................................................................... 13
3.3 Socket function............................................................................................................................................... 13
3.3.1 TCP server mode................................................................................................................................. 13
3.3.2 TCP Client Mode................................................................................................................................. 13
3.3.3 UDP Server Mode................................................................................................................................13
3.3.4 UDP Client Mode................................................................................................................................ 14
3.3.5 HTTP Client Mode.............................................................................................................................. 14
3.3.6 MQTT Client mode............................................................................................................................. 16
3.4 Advanced Features..........................................................................................................................................19
3.4.1 Random native port............................................................................................................................. 19
3.4.2 Heartbeat Packet Function...................................................................................................................19
3.4.3 Registration package function............................................................................................................. 20
3.4.4 Short connection function....................................................................................................................20
3.4.5 Timeout restart function...................................................................................................................... 20
3.4.6 Cache cleaning function...................................................................................................................... 21
3.4.7 Network disconnection and reconnection........................................................................................... 21
3.4.8 Remote upgrade...................................................................................................................................21
3.5 Modbus Gateway............................................................................................................................................ 22
3.5.1 Modbus RTU and Modbus TCP protocol conversion.........................................................................22
3.5.2 Simple Protocol Conversion Mode..................................................................................................... 23
3.5.3 Multi-host mode.................................................................................................................................. 23

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. I


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

3.5.4 Storage Gateway..................................................................................................................................24


3.5.5 Configurable Gateway.........................................................................................................................24
3.5.6 Automatic upload.................................................................................................................................25
4 Configuration Mode...................................................................................................................................................27
4.1 Web Settings................................................................................................................................................... 27
4.2 Configuration tool software settings.............................................................................................................. 27
4.3 AT command configuration............................................................................................................................ 27
Revision history............................................................................................................................................................ 28
About us........................................................................................................................................................................ 28

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. II


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

Disclaimer
EBYTE reserves all rights to this document and the information contained herein. Products, names, logos and
designs described herein may in whole or in part be subject to intellectual property rights. Reproduction, use,
modification or disclosure to third parties of this document or any part thereof without the express permission of
EBYTE is strictly prohibited.
The information contained herein is provided “as is” and EBYTE assumes no liability for the use of the
information. No warranty, either express or implied, is given, including but not limited, with respect to the accuracy,
correctness, reliability and fitness for a particular purpose of the information. This document may be revised by
EBYTE at any time. For most recent documents, visit www.ebyte.com.
Note:
The contents of this manual are subject to change due to product version upgrades or other reasons.Chengdu
Ebyte Electronic Technology Co.,Ltd. reserves the right to make changes to the contents of this manual without
notice or suggestion.This manual serves only as a user guide and Chengdu Ebyte Electronic Technology Co.,Ltd.
endeavours to provide accurate information in this manual, but Chengdu Billionaire Electronics Co., Ltd. does not
ensure that the contents are completely error-free and that all statements, information and suggestions in this
manual do not constitute any express or implied warranty.

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 1


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

1 Product Overview

1.1 Brief Introduction

NS1 is a serial server that realizes serial data ⇌ Ethernet data conversion;
It has a variety of Modbus gateway modes and MQTT/HTTP IoT gateway
modes, which can meet the networking functions of various serial devices;
Output TTL level serial port signal, support various operating status
feedback output, support hardware reset and factory settings;
It can be configured with multiple baud rates and verification and also
supports serial flow control configuration;

1.2 Feature

 RJ45 adaptive 10/100M Ethernet interface;


 Support multiple working modes (TCP Server, TCP Client, UDP Server, UDP Client, HTTPC, MQTTC);
 Support three configuration methods: configuration tool, web page and AT command;
 Server mode supports multiple socket connections;
 Support multiple baud rates;
 Support multiple check (None, Odd, Even, Mark, Space);
 Support multiple serial flow control configurations (NONE,CTS/RTS, DSR/DTR, XON/XOFF);
 Support DHCP function;
 Support DNS (domain name resolution), and custom domain name resolution server;
 Support multiple Modbus gateways (simple protocol conversion, multi-host mode, storage gateway,
configurable gateway, etc.);
 Supports quick access to Alibaba Cloud, Baidu Cloud, OneNET, Huawei Cloud, and standard MQTT
servers of version 3.1;
 Support HTTP protocol (GET/POST request)
 Support virtual serial port;
 Support timeout restart function, time can be customized;
 Support short connection function, short connection interval time customization;
 Support heartbeat package and registration package function;
 Support serial port cache cleaning function;
 Support access to external network and local area network;
 Support hardware reset to factory settings;
 Support online upgrade function.

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 2


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

2 Product Overview

2.1 Technical parameters

Item Instruction
Operating Voltage 3.0 ~ 5.5V(DC)
current drain 15mA @ 5V
TTL(3.3V)
Interface
Ethernet port (RJ45)
TCP Server、TCP Client、UDP Server、UDP Client、HTTP Client、
Work Mode
MQTT Client(default TCP Server)
Socket connection Support 6-way client connection (TCP server mode)
Network protocol IPv4、TCP/UDP、HTTP、MQTT
How to get IP DHCP、Static IP (default static IP)
DNS Support
DNS server Customizable (default 114.114.114.114)
Configuration method Web pages, configuration tools, AT commands
IP address Customizable (default 192.168.3.7)
local port Customizable (default 8887)
subnet mask Customizable (default 255.255.255.0)
gateway Customizable (default 192.168.3.1)
target IP Customizable (default 192.168.3.3)
destination port Customizable (default 8888)
Serial port cache 1024Byte
Packaging mechanism 512 Byte
Serial port baud rate 1200 ~ 230400 bps(default 115200)
data bits 5、6、7、8(default 8)
stop bit 1、2(default 1)
Check Digit None、Odd、Even、Mark、Space(default None)
Flow Control NONE、CTS/RTS、DSR/DTR、XON/XOFF(default None)
Product Size 17mm * 19mm * 4mm (length*width*height)
product weight 1.6g ± 1g
Working temperature
-40 ~ +85℃、5% ~ 95%RH(no condensation)
and humidity
Storage temperature
-40 ~ +105℃、5% ~ 95%RH(no condensation)
and humidity

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 3


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

2.2 Interface and Indicator Description

No. Pins Function Instruction


Common ground terminal, power supply negative terminal
1 GND GND
input;
The serial port receives the indicator light output, the default
output is high level, when there is data input, it outputs low
2 PA14 RX_LED
level, and when there is continuous data, it outputs a square
wave signal with a period of 80ms and a low level of 20ms;
3 PA13 NC Default dangling;
4 PA12 NC Default dangling;
5 RXD1 NC Default dangling;
6 TXD1 NC Default dangling;
After the network cable is inserted, it outputs a low level, and
7 PB9 LINKLED
the network cable is not connected to output a high level;
8 PB8 SPDLED SPD indicator;
9 TCK NC Default dangling;
10 TIO NC Default dangling;
11 3.3V 3.3V output Can output 3.3V, please do not connect large load
Common ground terminal, power supply negative terminal
12 GND GND
input;
13 RX_P RX_P Ethernet receives RX+ signal;
14 RX_N RX_N Ethernet receives RX-signal;
15 TX_P TX_P Ethernet sends TX+ signal;
16 TX_N TX_N Ethernet sends TX-signal;
17 D+ NC Default dangling;
18 D- NC Default dangling;
The serial port sends data, the TTL level communication
19 TXD0 TXD0
voltage only supports 3.3V, if it is connected to 5V, it needs

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 4


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

level conversion;
20 PB6 RTS MODEM output signal of serial data, request to send;
21 PB5 NC Default dangling;
The serial port receives data, the TTL level communication
22 RXD0 RXD0 voltage only supports 3.3V, if it is connected to 5V, it needs
level conversion;
RS485 software enable control pin, when the serial port sends
23 PB3 485_EN
data, it is high-level output, and the default is low-level output;
24 PB2 NC Default dangling;
25 PB1 NC Default dangling;
26 PB0 CTS MODEM input signal of serial data, clear to send;
27 RST nRST External reset input, active low;
28 PB22 NC Default dangling;
The network port link indicator output, the default output high
level, the output low level after the connection is successful
29 PB21 LED2
under the TCP protocol, and the default output low level under
the UDP protocol;
Running indicator, after the module is powered on and
30 PB20 LED1
initialized, this pin outputs a 5Hz square wave;
31 ANT NC Default dangling;
To restore the factory pins, an external reset button is required,
32 PA4 IO_RST
and the low level is valid for about 5s;
33 PA5 NC Default dangling;
The serial port sends indicator light output, the default output is
high level, when there is data output, it outputs low level, and
34 PA15 TX_LED
when there is continuous data, it outputs a square wave signal
with a period of 80ms and a low level of 20ms;
Common ground terminal, power supply negative terminal
35 GND GND
input;
36 VCC VCC Positive power input, support 3-5.5V input;

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 5


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

2.3 Dimensions

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 6


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

2.4 Hardware design

2.4.1 Typical application connection

2.4.2 Power supply connection

NS1 adopts DC typical 5V. The VCC voltage range is 3.0~5.5V, the normal working current is 15mA@5V,
and the peak current is about 58mA@5V. It should be noted that if the power supply is less than 3.3V, the 3.3V
output of pin 11 will change according to the input. VCC can be connected to 10UF/16V/10% and 100nF/50V/10%
bypass chip capacitor stabilization modules. As shown below.

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 7


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

2.4.3 UART interface

UART is a serial data interface and only supports TTL-3.3V communication level. It can connect RS-232 chip
to RS-232 level to connect with external equipment. The UART interface of this module includes TXD/RXD signal
lines. Taking RS-232 level as an example, the reference circuit is as follows:

If you are communicating directly with MCU (3.3V level), you only need to add the TXD of the module to the
RXD of the MCU, and connect the RXD of the module to the TXD of the MCU. If the MCU is at 5V level, a
conversion circuit needs to be added in the middle, as shown in the figure below:

2.4.4 10/100M external Ethernet network transformer

The NS1 module can be connected to an external 10/100M Ethernet physical interface, and supports the
design method of interconnection between RJ45 connectors and network transformers.
The network transformer and RJ45 connector are combined into a standard 10/100M Ethernet physical
interface, which is then connected to the NS1 module. RX+ and RX- go through the differential line, 100 ohm

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 8


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

differential impedance matching, TX+ and TX- go through the differential line, 100 ohm differential impedance
matching. The hardware design reference circuit diagram is as follows:

2.4.5 10/100M internal Ethernet network transformer

RJ45 has a built-in 2KV electromagnetic isolation network transformer. The corresponding network data
receiving pin of the NS1 module is directly AC coupled with the data receiving pin of the Ethernet physical
interface to serve as a data transmission channel in the system. RX+ and RX- go through the differential line, 100
ohm differential impedance matching, TX+ and TX- go through the differential line, 100 ohm differential
impedance matching. The hardware design reference circuit diagram is as follows.

2.4.6 PCB library

To get pcb library for hardware design, please visit


https://www.ebyte.com/product-view-news.html?id=1466

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 9


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

3 Functional Introduction

3.1 Serial port parameters

The basic parameters of the serial port include: baud rate, data bits, stop bits, and parity bits.
Baud rate: serial communication rate, configurable 1200, 2400, 4800, 9600, 14400, 19200, 38400, 57600,
115200, 230400bps.
Data Bits: The length of the data bits, the range is 5, 6, 7, 8.
Stop bit: range 1, 2 can be set.
Check digit: The check digit of data communication, supports five check modes: None, Odd, Even, Mark,
Space.
Flow Control: NONE、CTS/RTS、DSR/DTR、XON/XOFF

3.2 Introduction to basic functions

3.2.1 Web page configuration

The device has a built-in web server, which is convenient for users to set and query parameters through web
pages.
The port of the web server can be customized (2-65535), default: 80
Operation method (Microsoft Edge version 94.0.992.50 is an example, it is recommended to use Google
kernel browser, IE kernel browser is not supported):
Step 1: Open the browser, enter the IP address of the device in the address bar, for example 192.168.3.7 (the
IP address and the computer need to keep the same network segment), if you forget the IP of the machine, you can
query it through AT commands and configuration software

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 10


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

Step 2: The webpage pops up the main interface, and you can query and set relevant parameters;
Step 3: Click Submit to save the configuration parameters after entering the correct key. The factory default
key is: 123456;

Step 4: The progress bar indicates the configuration progress. Do not refresh the web page again after the
configuration is completed (refresh the web page to enter the configuration mode again, you can restart the device
or submit it again to enter the communication mode);

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 11


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

It can also be opened through the Open Web Configuration button of the configuration software.
[Note] If the port number is modified, the port number should be added to the address input field. For example,
if you modify the web page access port to 8080, you need to enter 192.168.3.7:8080 in the address bar to connect to
the web page configuration.

3.2.2 Subnet mask/IP address

The IP address is the identification of the module in the local area network and is unique in the local area
network. Therefore, it cannot be duplicated with other devices on the same local area network. There are two ways
to obtain the IP address of the module, static IP and DHCP.
(1) Static IP: Static IP needs to be set manually by the user. In the process of setting, pay attention to writing IP,
subnet mask and gateway at the same time. Static IP is suitable for scenarios where IP and device statistics are
required and one-to-one correspondence is required.
Advantages: Access to devices that cannot be assigned IP addresses can be searched through the broadcast
mode of the entire network segment, which is convenient for unified management;
Disadvantages: Different network segments in different LANs, resulting in normal TCP/UDP communication.
(2) Dynamic DHCP: The main function of DHCP is to dynamically obtain the IP address, gateway address,
DNS server address and other information from the gateway host, thereby eliminating the tedious steps of setting
the IP address. It is suitable for scenarios where there is no requirement for IP, and there is no mandatory
one-to-one correspondence between IP and modules.
Advantages: devices with DHCP Server such as access routers can communicate directly, reducing the trouble
of setting IP address gateway and subnet mask.
Disadvantage: Connecting to a network without DHCP Server, such as direct connection with a computer, the
module will not work properly. The subnet mask is mainly used to determine the network number and host number
of the IP address, to indicate the number of subnets, and to determine whether the module is in the subnet. The
subnet mask must be set. Our commonly used class C subnet mask: 255.255.255.0, the network number is the first
24 bits, the host number is the last 8 bits, the number of subnets is 255, and the module IP is in the range of 255
within this subnet, the module IP is considered to be in this subnet. Gateway refers to the network number of the
network where the current IP address of the module is located. If a device such as a router is connected to the
external network, the gateway is the router

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 12


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

3.2.3 Domain Name Resolution (DNS)

Domain name resolution translates domain names into network-recognized IP addresses through Domain
Name Resolution (DNS) servers. The domain name resolution (DNS) server address of the serial port server
supports user definition, and can realize domain name resolution through a custom domain name resolution server
in the event of an abnormal domain name server. The device will report the resolution to the custom domain name
resolution (DNS) server during domain name resolution. Request, return the device connection parameters (usually
the IP address) after the parsing is completed.
In DHCP mode, the domain name resolution (DNS) server address is automatically obtained (synchronized
with the router's domain name resolution address) and cannot be modified.
In static IP mode, the factory default address of the Domain Name Resolution (DNS) server is
114.114.114.114.

3.2.4 Restore factory settings

Press and hold the Reload pin of the device until the LED indicator lights up to release the key.

3.3 Socket function

3.3.1 TCP server mode

TCP Server is the TCP server. In TCP Server mode, the device listens to the local port, accepts the client's
connection request and establishes a connection for data communication. When the Modbus gateway function is
turned off, the device sends the data received by the serial port to all client devices that establish connections with
the device, and supports connecting up to 6 clients. After the Modbus gateway function is enabled, the non-Modbus
data will be cleared and not forwarded.
Typically used for communication with TCP clients within a local area network.

3.3.2 TCP Client Mode

TCP Client is the TCP client. When the device is working, it will actively initiate a connection request to the
server and establish a connection to realize the interaction between serial port data and server data.
To use the client, you need to configure the target IP address/domain name and target port accurately.

3.3.3 UDP Server Mode

UDP Server means that the device does not verify the IP address of the data source when communicating with
the UDP protocol. After receiving a UDP data packet, it saves the source IP address and source port of the data
packet, and sets it as the destination IP and port, so The data sent by the device only sends data packets to the
source IP address and port where the device received data last time .

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 13


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

This mode is usually used in scenarios where multiple network devices communicate with this device, and the
frequency is high, and the TCP Server cannot meet the conditions.
Using UDP Server requires the remote UDP device to send data first, otherwise the data cannot be sent
normally.
[Note] In UDP mode, the data sent by the network to the device should be less than 512Bit per packet,
otherwise it will cause data loss

3.3.4 UDP Client Mode

UDP Client is a connectionless transmission protocol that provides transaction-oriented simple and unreliable
information transmission services. There is no connection establishment and disconnection, and data can be sent to
the other party only by configuring the destination IP and destination port. It is usually used in data transmission
scenarios where there is no requirement for the packet loss rate, the data packets are small and the transmission
frequency is fast, and the data is to be transmitted to the specified IP.
In UDP Client mode, the device will only communicate with the configured (target IP and target port) remote
UDP devices.
In this mode, the target address is set to 255.255.255.255, and the sent data will be broadcast on the entire
network segment, but the transceiver device needs to ensure that the ports are consistent, and the device can also
receive broadcast data.

3.3.5 HTTP Client Mode

This mode can realize the function of HTTP grouping. It provides two modes: GET and POST. Customers can
configure URL, Header and other parameters by themselves, and the device (serial port server) will send packets to
realize fast communication between the serial port device and the HTTP server. In HTTP client mode, it is
recommended to use random ports and enable short connections to save HTTP server resources.

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 14


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

Configure the local network parameters and the HTTP server address and port(You are advised to enable
DHCP and random ports), As shown in the figure below(Above is the upper computer, below is the web page):

Return standard HTTP frame data (left image) and only valid data (right image):

Parameter configuration description as shown in the figure (GET on, POST is under):

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 15


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

3.3.6 MQTT Client mode

The serial port server supports quick access to standard MQTT3.1.1 protocol servers (OneNET, Baidu Cloud,
Huawei Cloud, user-built and other server types) and Alibaba Cloud servers, supports service quality level
configuration (QoS 0, QoS 1), and supports super long text Configuration, convenient and better access to network
service operators (server address, three elements, subscription and publishing addresses support up to 128
characters of configuration).

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 16


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

To use MQTT function, advanced Settings such as short links should be turned off as shown in the figure
below (upper computer and webpage configuration as shown below) :

1) standard MQTT3.1.1 and Baidu Cloud and Huawei Cloud and OneNET(Left: software, right: web page)

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 17


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

2) Alibaba Cloud
Alibaba Cloud Supports the use of Alibaba Cloud's "Three Elements" to directly connect to the server to
obtain the "Three Elements" required to connect to Alibaba Cloud, as shown in the figure(The following parameters
are only examples):

To configure a topic for communication testing:

Select the corresponding product, go to "Custom Topic" under the Topic class list (for details, please refer to
the Alibaba Cloud documentation), click "Define Topic Class", set the name to 1234, and grant publish and
subscribe permissions (for data return pass).
Configure the device connection parameters, as shown in the following figure:
{
"ProductKey": "a1GlhuTU1yN",
"DeviceName": "DEV04",
"DeviceSecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
Alibaba Cloud server address: ProductKey.iot-as-mqtt.cn-shanghai.aliyuncs.com:1883
Topic for subscription and publication: /a1GlhuTU1yN/DEV04/user/1234

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 18


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

Alibaba Cloud MQTT platform communication test:

3.4 Advanced Features

3.4.1 Random native port

TCP client, UDP client, HTTP client, MQTT client can configure the local port to 0 (use random local port),
and server mode cannot use random port, otherwise the client cannot establish a connection correctly.
Using a random port connection can quickly re-establish the connection when the device disconnects the
server unexpectedly, preventing the server from rejecting the connection due to four waves of incompleteness. It is
recommended to use a random port in client mode .
The device will automatically enable random ports when configuring the TCP client, HTTP client, and MQTT
client modes.

3.4.2 Heartbeat Packet Function

In client mode, users can choose to send heartbeat packets and set the time of heartbeat packets by themselves.
The heartbeat packet can be selected in two modes: network heartbeat packet and serial port heartbeat packet. It
supports hexadecimal and ASCII transmission. This heartbeat packet is not MQTT heartbeat and needs to be turned
off in MQTT client mode. MQTT heartbeat only needs to configure KeepAlive in "MQTT function settings" Time,
it is recommended not to configure less than 60s, for example, 120s is recommended in the Alibaba Cloud manual.
Heartbeat packet sending mode:
(1) The default is to turn off the heartbeat packet mode.
(2) Serial port mode -> The device sends heartbeat content to the serial bus according to the set heartbeat
interval.
(3) Network port mode -> The device sends heartbeat content to the network port bus according to the set

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 19


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

heartbeat interval.
Customize heartbeat packet content (maximum support 40 bytes (ASCII) data, 20 bytes (HEX) data)
Customize the interval for sending heartbeat packets. When it is set to 0, the heartbeat packet function is
turned off. If the setting value is greater than zero, the heartbeat packet function is turned on. When it is turned on,
the range can be set: (1-65536) seconds.

3.4.3 Registration package function

In the client mode, the user can choose to send the registration package, and set the registration package time
by definition.
The registration package supports the following modes:
(1) The MAC address (OLMAC) is sent when the network establishes a connection with the device.
(2) The data of the custom registration package sent when the network establishes a connection with the
device (OLCSTM).
(3) After the network and the device are connected, each packet of data sent by the device to the network is
preceded by a MAC address (EMBMAC).
(4) After the network and the device are connected, each packet of data sent by the device to the network is
prepended with custom registration packet data (EMBCSTM).
Custom registration package content (maximum support 40 bytes (ASCII) data, 20 bytes (HEX) data).

3.4.4 Short connection function

In client mode, short network connection is supported (this function is disabled by default). TCP short
connection is mainly used to save server resource overhead, and is generally used in multi-point
(multi-client)-to-point (server) scenarios.
In client mode, short network connection is supported (this function is disabled by default). TCP short
connection is mainly used to save server resource overhead, and is generally used in multi-point
(multi-client)-to-point (server) scenarios.
When the short link hold time is set to 0, the short link function is turned off. When the setting range is (2-255)
seconds, the short connection function is enabled, and the default hold time is 0 seconds (disabled).

3.4.5 Timeout restart function

Supports the timeout restart function (default: 300 seconds), which is mainly used to ensure the long-term
stable operation of the device. If data is not sent and received within the set timeout restart time, the device will
restart to avoid the impact of abnormal conditions on communication.
The parameter range of timeout restart time is (60-65535) seconds. If it is set to 0, it means shutdown timeout
restart. The default is 300 seconds.

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 20


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

3.4.6 Cache cleaning function

The device is in the client mode. When the TCP connection is not established, the data received by the serial
port will be placed in the buffer area. The serial port receiving buffer is 1024 bytes, and the data larger than 1024
bytes will cover the earliest received data. After the network connection is successful, you can Select to clear the
serial port cache or send the cache through the network through configuration.
Enable: The device does not save the data received by the serial port before the connection is established.
Disabled: After the connection is established, the network will receive the serial buffered data.

3.4.7 Network disconnection and reconnection

In client mode, after the device is disconnected from the network, it will try to actively connect to the server at
the specified time. If the request times out and the set number of reconnections has not been successfully
reconnected, the device will restart to prevent the device from disconnecting from the network. Unable to restore
connection. Disconnection and reconnection time: The time interval between each attempt of the device to
re-establish the network. Number of reconnections: The number of times the device tries to re-establish the network,
and the cumulative number of requests reaches the preset value. If the connection is not successful, the device will
automatically restart. The actual restart time is the network disconnection reconnection period multiplied by the
number of reconnections. It is recommended to use the factory default parameters without special requirements.

3.4.8 Remote upgrade

In order to facilitate later maintenance and upgrade functions and to replace different firmware, the serial
server (NA11x series, NB114, NS1, NT1, etc.) supports online upgrade, and users can upgrade or replace the
current firmware through the upgrade firmware provided by our company through the host computer.
Network upgrade firmware operation steps:
Step 1: Open the host computer, open the device upgrade assistant in the menu bar, and select the required
firmware (The official website only provides the latest firmware, please refer to "Firmware Instructions" for
details);

Step 2: Click to search for devices, and click to stop searching after finding the device;

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 21


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

Step 3: Select the corresponding device that needs to be upgraded;

Step 4: Click to start the upgrade, the device indicator flashes, and wait for the upgrade to complete.
[Note] When the device is just powered on, click "Search Device" in the upgrade assistant, the device will
enter the firmware burning state, and it will return to normal mode after power off and restart.

3.5 Modbus Gateway

3.5.1 Modbus RTU and Modbus TCP protocol conversion

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 22


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

Enable(Check): Convert Modbus RTU protocol to Modbus TCP protocol.


Disabled: Do not perform protocol conversion but verify Modbus data, discard non-Modbus data (RTU/TCP)
and not transmit.

3.5.2 Simple Protocol Conversion Mode

Convert Modbus RTU data to Modbus TCP data, or convert Modbus TCP data to Modbus RTU data, to realize
the mutual conversion of Ethernet Modbus data and serial port Modbus data.
Simple protocol conversion can work in any mode (TCP client, TCP server, UDP client, UDP server etc.), no
matter what mode it is working in, there can only be one Modbus master station.
Simple protocol conversion configuration (TCP server mode as an example, the upper computer on the left,
web page on the right) :

3.5.3 Multi-host mode

There is only one Modbus master station for relatively simple protocol conversion, while the multi-master
mode can handle up to 6 Modbus TCP masters. One request is processed at a time, while the multi-host mode will
be sequenced according to the TCP request, and other links will wait) to solve the bus conflict problem (currently
only 6 host connections are supported), only supports working in TCP server mode, slave machine Only in the
serial port, otherwise it will not work properly.
It is recommended to configure "Simple Protocol Conversion" when no multi-channel host is used.
Multi-host mode configuration (upper computer, web page below) :

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 23


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

3.5.4 Storage Gateway

The storage gateway not only arbitrates the bus data but also stores the repeated read commands. When
different hosts request the same data, the gateway does not need to query the register status of the RTU device
multiple times, but directly returns the data cached in the storage area. To a certain extent, the multi-host request
processing capability of the gateway is improved, and the time consumed by the entire request process is also
shortened. Users can customize the storage area command polling interval and command storage time according to
their needs.
As the optimization of multi-host request performance, the storage gateway can only work in the TCP server
mode, which improves the response speed of the network side.
Features:
(1) The gateway has a 5K cache for storing instructions and returning results (reading 10 holding registers as
an example, it can store 189 instructions and return results);
(2) The RTU response time-out automatically clears the cache to ensure the real-time and authenticity of the
data;
(3) The polling interval can be customized, 0-65535ms;
(4) The gateway will poll the RTU device according to the storage time of the instruction used for
configuration. If the MODBUS host does not query the instruction again during the storage time, the gateway will
automatically delete the storage instruction to release the cache;
(5) The first command and control command (05, 06, 0F, 10 function codes) will directly access the RTU
device;
(6) Only 01, 02, 03, 04 Modbus function code query result storage is supported;
Storage gateway configuration (upper computer, web page) :

3.5.5 Configurable Gateway

The gateway automatically polls the RTU device registers according to the pre-configured MODBUS
commands (only supports the configuration of the MODBUS read command), and the commands in the
non-storage table will directly operate the RTU device. Frequently read commands can be stored in the gateway in
advance, which can shorten the response time (query configured commands). Due to the above features, the serial
port side of the configurable gateway can only be connected to Modbus slaves.
Add instruction, left for the upper computer, right for the web page

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 24


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

Instruction storage description (Add instruction, Left picture software right picture web page):

Instruction storage description (Delete, Left picture software right picture web page):

Clear instructions:

Configurable gateway configuration (Left picture software right picture web page) :

3.5.6 Automatic upload

In client mode (TCP client, UDP client etc.), the gateway will automatically poll the instructions in the stored
instruction table and upload it to the server, and the feedback format (Modbus RTU format or Modbus TCP format)
can be selected according to the requirements. ) and the command polling interval (0-65535ms).
For instruction pre-storage, refer to "Configurable Gateway - Instruction Storage Instructions", and
automatically upload the upper computer/web page configuration:

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 25


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

TCP client demo (Modbus RTU format on the left and Modbus TCP format on the right):

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 26


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

4 Configuration Mode

4.1 Web Settings

You can customize the relevant parameters through the Web setting method. Open the browser, enter the
device IP in the address bar (default: 192.168.3.7), enter the page, you can query and set parameters, and finally
click the "Submit" menu to wait for the page to return to the successful prompt, and it will take effect.
Note: Do not enter the web page configuration during normal use, which may cause data loss. If you enter the
web page configuration, you need to restart to enter the communication mode.
Web page configuration initialization password: 123456, can be customized configuration, only supports 6-bit
uppercase and lowercase letters and numerical configuration.
The webpage configuration requires browsers with newer kernels to work properly, such as Microsoft Edge
(96.0.1054.62), Google chrome (96.0.4664.110), Firefox (95.0.2), etc.
[Note] IE, 360 compatibility mode, QQ browser compatibility mode and other browsers using IE core are not
supported to use web page configuration.

4.2 Configuration tool software settings

Open the configuration tool software, search for devices, double-click the identified device, and the parameter
query configuration interface will pop up. You can customize and modify relevant parameters according to your
needs, then save the configuration, restart the device, and complete the parameter modification.
【Note】:
Do not use multiple host computers in the same local area network environment. Multi-network card industrial
computers need to temporarily disable and do not use network cards, otherwise the host computer will not be able
to search for devices normally (the same device is displayed multiple times, no device can be found, etc.)
The host computer shields the wireless network card, so the network cable must be connected to use the host
computer, and the wireless network card can be configured through the web page.

4.3 AT command configuration

The query and modification of relevant parameters of the device can be completed through AT command
configuration. For specific AT commands, please refer to "NA11x&NT&NS-AT Command Set".

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 27


Chengdu Ebyte Electronic Technology Co.,Ltd. NS1_User_Manual

Revision history

Version Date Description Issued by


1.0 2021-06-28 Initial version LC
1.1 2022-09-13 Content revision LZX
1.2 2022-02-12 Adapt to "9013-2-xx" firmware LC

About us
Technical support: [email protected]
Documents and RF Setting download link: www.ebyte.com
Thank you for using Ebyte products! Please contact us with any questions or suggestions: [email protected]
-------------------------------------------------------------------------------------------------
Phone: +86 028-61399028
Web: www.ebyte.com
Address: B5 Mould Park, 199# Xiqu Ave, High-tech District, Sichuan, China

Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd. 28

You might also like