USR IOT USR-N668 User manual

USR-N668 User Manual Technical Support: h.usriot.com
Jinan USR IOT Technology Limited 2
Contents
USR-N668 User Manual ........................................................................................................................................... 1
Features...................................................................................................................................................................... 4
1. Get Start ............................................................................................................................................................. 5
1.1.Hardware Test............................................................................................................................................... 5
1.2.NTE Network Test Environment.................................................................................................................... 7
1.3. Default parameter test ................................................................................................................................ 7
2. Product overview................................................................................................................................................ 9
2.1. Basic parameters ....................................................................................................................................... 10
3. Hardware Design .............................................................................................................................................. 11
3.1. Hardware Dimensions........................................................................................................................ 11
3.2. Pin definition ..................................................................................................................................... 11
3.2.2. Pin definition .................................................................................................................................. 14
3.2.3. LED Indicator................................................................................................................................... 14
4. Product Functions............................................................................................................................................. 15
4.1. Basic Functions .......................................................................................................................................... 15
4.1.1. IP address / Subnet mask / Gateway............................................................................................... 15
4.1.2. DNS................................................................................................................................................. 17
4.1.3. VPN-PPTP........................................................................................................................................ 17
4.1.4. VPN-GRE ......................................................................................................................................... 18
4.1.5. Network diagnosis .......................................................................................................................... 19
4.1.6. Restore factory settings .................................................................................................................. 20
4.1.7. Web Server ..................................................................................................................................... 20
4.1.8. Firmware upgrade........................................................................................................................... 21
4.2. Transtransmission function........................................................................................................................ 22
4.2.1. TCP Client........................................................................................................................................ 22
4.2.2. TCP Server....................................................................................................................................... 24
4.2.3. UDP Client....................................................................................................................................... 26
4.2.4. UDP Server...................................................................................................................................... 28
4.2.5. Httpd Client..................................................................................................................................... 29
4.2.6. SSL Client ........................................................................................................................................ 31
4.2.7. V-COM ............................................................................................................................................ 32
4.3. Serial port Functions.................................................................................................................................. 33
4.3.1. Serial port framing mechanism....................................................................................................... 33
4.3.2. RFC2217-like................................................................................................................................... 33
4.4. Characteristic function............................................................................................................................... 34
4.4.1. Socket B .......................................................................................................................................... 34
4.4.2. Heartbeat Packet Function ............................................................................................................. 35
4.4.3. Registration package....................................................................................................................... 36
4.4.4. Modbus TCP.................................................................................................................................... 37
4.4.5. No data reconnection ..................................................................................................................... 38
4.4.6. DDNS............................................................................................................................................... 39
4.4.7. Remote management and remote monitoring............................................................................... 39

USR-N668 User Manual Technical Support: h.usriot.com
Jinan USR IOT Technology Limited 3
4.4.8. Scheduled task................................................................................................................................ 40
5.Parameter setting.................................................................................................................................................. 41
5.1. Network protocol settings parameters ...................................................................................................... 41
5.1.1. Software setting parameters........................................................................................................... 41
5.1.2. Setting protocol settings parameters.............................................................................................. 43
5.2. Web settings parameters........................................................................................................................... 43
5.3. AT command.............................................................................................................................................. 46
5.3.1. AT command................................................................................................................................... 46
5.3.2. Error code....................................................................................................................................... 47
6.Contact Us ............................................................................................................................................................. 48
7.Disclaimer.............................................................................................................................................................. 48
8.Update History....................................................................................................................................................... 48

USR-N668 User Manual Technical Support: h.usriot.com
Jinan USR IOT Technology Limited 4
Features
Two 10/100Mbps Ethernet port, support Auto-MDI/MDIX.
8 serial ports all support RS232/RS485/RS422.
Support Static IP or DHCP.
TCP Server, TCP Client, UDP Client, UDP Server, HTTPD Client .
8 serial ports all support two sockets ,and all can send data to two different servers when work as Client.
It works as TCP client, supports to 16(max) TCP Client.
Keep-alive & Registration-package.
Modbus TCP to Modbus RTU.
User-defined overtime Reload (no data reload)and overtime connection.
The modifiable , one and only MAC.
DNS domain name resolution ,user-defined DNS server address.
Remote monitoring and remote firmware upgrading.
Network time synchronization +RTC real time clock.
User-defined Task Scheduler.
Supports web server configuration.
Supports V-COM.
Reload by hardware and software.
Run across gateways, switches and routers.
Work in LAN or external network.

USR-N668 User Manual Technical Support: h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
5
1. Get Start
Product link:
http://usriot.com/products/8-ports-serial-to-ethernet-converter.html
Figure 1 Download Page
If you have any question, please submit it back to customer center: http://h.usriot.com
1.1.Hardware Test
1.1.1. Hardware Preparation
You need:
1. USR-N668 for one;
2. Power cord (85V~265V)for one;
3. Female to female serial cable for one;
4. DB9-M to RJ45 for one;
5. Network line for two;
6. PC(with RS232,or USB to 232)
1.1.2. Hardware Connection
For test the communication conversion between serial port and network , you should connect the
USR-N668 to PC with serial cable(or USB to serial cable),connect the Ethernet port of USR-N668 and PC
with network. Make sure the connection is correct , then power on.
ALL the connecting lines form USR IOT;

USR-N668 User Manual Technical Support: h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
6
The test only for RS232, factory default setting for RS232;
Check the dial up settings window ,make sure USR-N668 work at correct pattern.(See the details in
Hardware introduce->Dial up)
Figure 1. RS232/485/422 smart switch
N668 serial port 1->network->DB9-M to RJ45->mother to mother serial cable->PC serial port
Figure 2. serial port connection between N668 and PC
The above is the hardware connection diagram of RS232 for transparent transmission. when use
RS485/RS422,you can connect the corresponding signal line.(see the details in Hardware introduce->
Serial port pin definition )
Note: the standard configuration of DB9-M to RJ 45 is only one, if you need more, you need separate

USR-N668 User Manual Technical Support: h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
7
purchase
The overall hardware connection and data flow are as follows,
Figure 3. data flow
1.2.NTE Network Test Environment
Before the network test, you should:
1) Close the firewall of the computer (usually found in the control panel)and anti-virus software;
2) Close the network card which is not related to this test, only one local connection is reserved;
3) For servers to connect directly to PC, a static IP (address in the same network segment with USR-N668) must be
set to the PC (e.g.192.168.0.201).
Figure 4. PC local connection settings
1.3. Default parameter test
Table 1 default parameters

USR-N668 User Manual Technical Support: h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
8
Item
Content
User name
admin
Password
admin
IP address
192.168.0.7
Subnet mask
255.255.255.0
Default gateway
192.168.0.1
Default mode of operation
TCP Server
Default target port
20001~20008
Default local port
20001~20008
Default target IP
192.168.0.201
Serial baud rate
115200
Serial port parameters
None/8/1
After confirmation, You can carry out the bidirectional between the serial port and the Ethernet port.
Communication procedures are as follows:
1) Open the testing software”USR-TCP232-Test.exe”,connected hardware;
2) The default mode of operation is TCP Server, first port serial port monitor 20001 port. So choose TCP client mode at
the network setup end of the software,IP:192.168.0.7,target port 20001,then click the connect. The serial baud
rate is 115200, The serial port parameter is set to None/8/1,chick open.
3) Send data for test, the data flow form serial port to Net is: PC serial port->668 serial port->668 Ethernet port->PC
network; the data flow form Net to serial port is: PC network->668 Ethernet port->668 serial port->PC serial port.
The specific demo is shown below.

USR-N668 User Manual Technical Support: h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
9
Figure 5. data transmission test
The USR-TCP232-Test.exe download links:
https://www.usriot.com/support/downloads/usr-tcp-test-testing-software.html
2. Product overview
Figure 6. USR-N668 hardware interface

USR-N668 User Manual Technical Support: h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
10
2.1. Basic parameters
2.2.
Table 2 Electrical parameters
classification
parameter
numerical
Hardware parameters
Working voltage
AC 85~265V, 50/60Hz
Power Consumption
1.6W
Ethernet Port
RJ45、10/100Mbps
Number of Ethernet port
2
Serial port format
RJ45
Number of serial port
8*RS232/RS485/RS422
Serial baud rate
300-115.2K(bps)
Software parameters
Network protocol
IP、TCP/UDP、ARP、ICMP、IPV4、HTTP、SSL
IP
Static IP、DHCP
Domain name resolution
Support, customize DNS server address
User configuration
Software configuration,
Web page configuration,
AT instruction configuration
Simple pass through mode
TCP Server/TCP Client/SSL Client
UDP Server/UDP Client/Http Client
Class RFC2217
Support
Network cache
10kbyte
Serial port cache
10kbyte
Average transmission delay
>=50ms
Software kit
V-COM,setup software,test program
Packaging mechanism
50ms packing time,
1472 bytes packing length
Certificate
CE/RoHs
Other
Reliability grade
EN61000-4-2(static electricity) Grade 4
EN61000-4-4(pulse group) Grade 4
EN61000-4-5(surge) Grade 3
Shell protection
IP30
Full-size
482*185*45 MM
Work temperature
40~85℃
Storage temperature
40~85℃
Work humidity
5%~95%(Non condensation)
Storage humidity
5%~95%(Non condensation)

USR-N668 User Manual Technical Support: h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
11
3. Hardware Design
3.1. Hardware Dimensions
Figure 7 Hardware dimensions
3.2. Pin definition
3.2.1. Dial switch
On the back of the equipment, there is a dial up switch setting window.
You need to use the cross flower screwdriver, remove the screws to see.
The following is the setting of the code switch.

USR-N668 User Manual Technical Support: h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
13
Figure 10. RS485 model
Figure 11. RS422 model
Table 3 Correspondence
communication mode
Dial switch(L to R)
232
0 0
485
1 1
422
1 0
Pay attention:
The switch position is shown in the figure.
The dialing sequence form L to R.
Default is 232 mode,the dial switch is “0 0”.

USR-N668 User Manual Technical Support: h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
14
3.2.2. Pin definition
The serial port pin diagram is as follows (The hardware interface is RJ45).
Figure 12. Serial line sequence
Table 4 Serial line sequence
Pin Number
Name
Function
1
232_TX/422_Z/485_B1
232 send;422 signal Z;485 signal B
2
232_RX/422_A1
232 receive;422 signal A
3
422_Y/485_A1
422 signal Y;485 signal A
4
422_B1
422 signal B
5
NC
6
GND
232 signal GND
7
NC
8
NC
Pay attention:
232,485,422 can’t work at one time;
The position of the dialing switch must be correct.
The hardware interface is RJ45, you need to use 8 core cable and crystal head to make communication cables.
3.2.3. LED Indicator
Figure 13. LED location

USR-N668 User Manual Technical Support: h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
15
LED status reference table.
Table 5 LED indicator
Indicator
Function
PWR
Red/On: Power on
WORK
Green/ Flicker: Working
STATE
Red/ Undefined
READY
Green/On: working
TXN
Red/Flicker: Serial port sending data
RXN
Green/Flicker: Serial port receiving data
4. Product Functions
This chapter introduces the functions of USR-N668 as the following diagram shown, you can get an overall knowledge
of it.
Figure 14 Product 668 Functions diagram
4.1. Basic Functions
4.1.1. IP address / Subnet mask / Gateway
There are two ways for module to get IP address: Static IP and DHCP.

USR-N668 User Manual Technical Support: h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
16
Figure 15 IP address setup
Table 6 Station IP and DHCP
IP acquisition mode
Advantage
Static IP
Default setting of module is Static IP and default IP is
192.168.0.7. When user set module in Static IP mode, user need
set IP, subnet mask and gateway and must pay attention to the
relation among IP, subnet mask and gateway.
DHCP
Module in DHCP mode can dynamically get IP, Gateway, and DNS
server address from Gateway Host. When user connect directly
to PC, module can’t be set in DHCP mode. Because common
computer does not have the ability to assign IP addresses.
Subnet mask is mainly used to determine the IP address of the network number and host number, indicating the
number of subnets, judging whether the module is in the subnet flag. Subnet Masks must be set , we usually use the C
class subnet mask: 255.255.255.0, network number for the first 24 bits, host number for the last 8 bits, the number of
subnets For the 255 module IP in 255 scopes, the module IP is considered in this subnet.
Gateway refers to the network number of the module where the current IP address is located. If you connect to devices
such as routers when connecting to the outside network, the gateway is the router IP address, if set up incorrectly, you
can’t access the outside network correctly, if you do not connect to devices such as routers, you do not need to set up,
the default can be.
Reference AT command
Table 7 Station IP /DHCP AT command
AT command
Describe

USR-N668 User Manual Technical Support: h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
17
AT+WANN
Set and query IP, IP/ subnet mask / gateway parameters
4.1.2. DNS
DNS server address , default master server 208.67.222.222, standby server 8.8.8.8.
DNS server address can be set, can achieve domain name resolution in the case of imperfect local domain name server,
users can also set the address of a specific DNS server according to needs, 668 need domain name resolution will be set
to the DNS server to submit a resolution request.
In the case of DHCP, the domain name server address is automatically acquired.
Figure 16 DNS server
Reference AT command
Table 8 DNS AT command
AT command
Describe
AT+DNS
Set and query DNS server
4.1.3. VPN-PPTP
Support the VPN link of PPTP protocol.
Figure 17 PPTP set
Remote address, user name, password are the basic parameters; there are encryption, authentication and other
parameters can be set.

USR-N668 User Manual Technical Support: h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
18
Figure 18 Data encryption
Data encryption: support MPPE, MPPE-128 and other encryption methods.
Authentication: support PAP, CHAP, MSCHAP, MSCHAPv2, etc.
LCP response interval: the default heartbeat interaction interval is 300 seconds.
MTU: maximum transmission unit, default 1500, can be reduced according to requirements.
4.1.4. VPN-GRE
Support VPN-GRE

USR-N668 User Manual Technical Support: h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
19
Figure 19VPN-GRE
There are four main parameters. remote address, local address, remote tunnel address, and local tunnel address. After
the GRE is established, the two sides can interoperate and visit each other on IP.
4.1.5. Network diagnosis
The network diagnostic function supports Ping instructions for testing the network link.
e.g.: ping www.baidu.com -w 3
-w indicates the duration of Ping.

USR-N668 User Manual Technical Support: h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
20
Figure 20 network diagnostic function
4.1.6. Restore factory settings
1) Hardware buttons: Press the Reload button between 5S and 15s to restore the factory settings , and no restore will
be performed if less than 5S or more than 15s. When the module parameter is configured erroneous or if you forget to
set the password, you can use the hardware to restore the factory settings.
2) Setting up software: setting up the factory's function by setting up the software.
3) AT instruction: enter AT instruction mode and resume factory by instruction AT+RELD.
4) Web page: restore the factory button.
4.1.7. Web Server
Built-in web server, users can set parameters through the web page and also can view the relevant state of the module.
The default home page is the current status interface, which is refreshed every 5s, showing the working status of 668.
Table of contents
Other USR IOT Server manuals