USR IOT USR-N540 User manual

USR-N540 User Manual www.usriot.com
Jinan USR IOT Technology Limited 1 / 39 tec@usr.cn
Multifunctional Serial to Ethernet converter
(USR-N540) File version: Ver1.0.3
Jinan USR IOT Technology Co., Ltd. works on LAN and WAN and wireless for MCU to Ethernet
Solutions, Ethernet, WIFI, GPRS, and Wireless modules, we can supply custom design for those usage,
looking forward to cooperate with you.

USR-N540 User Manual www.usriot.com
Jinan USR IOT Technology Limited 2 / 39 tec@usr.cn
Content
1. Introduction................................................................................................................................. 4
1.1. Overview........................................................................................................................ 4
1.2 Features ................................................................................................................................ 4
1.2. Applications .................................................................................................................... 5
1.3. Order information............................................................................................................ 5
1.4. Electrical characteristics ................................................................................................... 5
2. Simple Test.................................................................................................................................. 6
2.1. Hardware connection ....................................................................................................... 6
2.2. Login ............................................................................................................................. 7
2.3. Default parameter test..................................................................................................... 9
3. Work mode................................................................................................................................ 10
3.1. UDP mode .................................................................................................................... 10
3.2. TCP Client mode............................................................................................................ 11
3.3. UDP Server mode .......................................................................................................... 12
3.4. TCP Server mode .......................................................................................................... 14
3.5. Httpd Client mode ......................................................................................................... 16
4. Hardware .................................................................................................................................. 19
4.1. Hardware introduction ................................................................................................... 19
4.2. brief............................................................................................................................. 19
4.3. LED.............................................................................................................................. 20
4.4. Reload key.................................................................................................................... 21
4.5. RS232 .......................................................................................................................... 21
4.6. RS485 .......................................................................................................................... 21
4.7. RS422 .......................................................................................................................... 23
4.8. RJ45 ............................................................................................................................ 25
5. Paramters configuration .............................................................................................................. 26
5.1. Web page..................................................................................................................... 26
5.2. Setup software.............................................................................................................. 26
6. Specific functions ....................................................................................................................... 27
6.1. ModbusRTU to ModbusTCP............................................................................................. 27
6.2. Hardware flow control(RTS/CTS)..................................................................................... 28
6.3. MAC address................................................................................................................. 29
6.4. Packet time and Packet length ........................................................................................ 29
6.5. Sync baud via net(2217) ................................................................................................ 29
6.6. Webserver port ............................................................................................................. 30
6.7. Module id and id type .................................................................................................... 30
6.8. Device name................................................................................................................. 31
6.9. Buffer data before connected ......................................................................................... 32
6.10. Reset timeout ............................................................................................................... 32
6.11. Local IP config .............................................................................................................. 33
6.11.1. Static IP .......................................................................................................... 33

USR-N540 User Manual www.usriot.com
Jinan USR IOT Technology Limited 3 / 39 tec@usr.cn
6.11.2. DHCP .............................................................................................................. 33
6.12. DNS ............................................................................................................................. 33
6.13. Comm param ................................................................................................................ 34
6.14. Username and password ................................................................................................ 34
6.15. Firmupdate ................................................................................................................... 35
7. Contact ..................................................................................................................................... 38
8. Update History ........................................................................................................................... 39

USR-N540 User Manual www.usriot.com
Jinan USR IOT Technology Limited 4 / 39 tec@usr.cn
1. Introduction
1.1. Overview
The USR-N540 product series is an intelligent plug-and-play RS232/RS485/RS422 to Ethernet adapter
that enables any device or machine with serial port, to become Ethernet network and Internet enabled, and
have network data transmit ability. It features a powerful built-in device server, so you can access your serial
device from anywhere in the world over internet! The USR-N540 is easily configured via local network, or
through the serial port and web pages.
We Provide Network products and the best service to our customers.
• Chips • Modules • Software • Products
1.2 Features
1. Cortex-M4 kernel, industrial working temperature range(-40~85℃), elaborate optimization TCPIP
protocol stack, stable and reliable.
2. selectable RS232/RS485/RS422 port, Different port can be used together, work independently,
distinguish the connected serial port via port number.
3. Auto-MIDX function, discretionarily connect cross-over or direct network cable, automatic switching.
4. Support TCP Server, TCP Client, UDP, UDP Server, HTTPD Client,websocket, various of ethernet
protocols.
5. Support virtual serial port, provide corresponding software.
6. Serial port highest baud rate from 600bps to 1024000bps(RS232 only max 115200bps).
7. wide voltage input, more applications.
8. Support DHCP, automatically access IP, can inquire the facility within network through the setup
software.
9. Supply the protocol for VIP customers
10. Provide PC TCP/IP SOCKET programming example, VB, C++, Delphi, Android, IOS.
11. A built-in web page, also parameter setting via web, can customize web pages for users.
12. Can also set via UDP broadcast, provide the set up protocol.
13. Reload button, a key restore default Settings.
14. RJ45 status indicator light, RJ45 interface built-in isolation transformer, 2 KV isolation.
15. The global unique MAC address bought from IEEE, the user can define MAC address (please state when
you make order).
16. Support upgrade firmware via network.
17. Support remote IP and domain name at the same time
18. Support up to 8 link from client when act as TCP Server, same data will be send to all client.
19. Can modify http server port from default port 80 for module built-in http server.
20. Support Keepalive, detect a dead link quickly and make sure the connection more stable.

USR-N540 User Manual www.usriot.com
Jinan USR IOT Technology Limited 5 / 39 tec@usr.cn
1.2. Applications
Fire and Security Panels
Vending Machines
Point of Sale Terminals
Remote equipment management
IT management services
Access Control
Industrial Control
Home Automation
Instrumentation
Building Control
Power Management
1.3. Order information
Type
Part Numbers
Electric interface
Serial to Ethernet Converter
USR-N540
4 * RS232/RS485/RS422
Figure 1 Diagram 1-1 Order information
1.4. Electrical characteristics
Working tempterature range: -40~85℃.
Unpowered storage temperature and humidity range: -65~150℃, 5~95%RH
Input voltage range
12V average current
USR-N540
DC9~24V
53mA

USR-N540 User Manual www.usriot.com
Jinan USR IOT Technology Limited 6 / 39 tec@usr.cn
2. Simple Test
If you have any question, please contact us the in the client support center:
http://h.usriot.com/index.php?c=frontTicket&m=sign
2.1. Hardware connection
The picture below is device picture .
Diagram 2-1 USR-N540 with case
Connect device’s RJ45 to PC with network cable
Be sure your PC’s network configuration is static ip 192.168.0.201, netmask 255.255.255.0, gateway
192.168.0.1
Connect device’s first RS232 port to PC via USB to RS232 converter
Power device with DC12V
Here is device's default network configuration,
IP address: 192.168.0.7
Subnet mask: 255.255.255.0
The default gateway: 192.168.0.1

USR-N540 User Manual www.usriot.com
Jinan USR IOT Technology Limited 7 / 39 tec@usr.cn
2.2. Login
Open a browser, type and Login above IP address http://192.168.0.7, you will enter module's setup web pages.
User name and password are both “admin”, this can be modified after login into the system.
Default user name: admin
Default password: admin

USR-N540 User Manual www.usriot.com
Jinan USR IOT Technology Limited 8 / 39 tec@usr.cn
After you have login, you can see webpage as follow, this is config page.
Figure 2 Diagram 2-2 page after login
name
Description
Current status
display of firmware revision, ip address and
mac address
Local IP config
Config for local ip address
Port1
Config for first serial to ethernet
Port2
Config for second serial to ethernet
Port3
Config for third serial to ethernet
Port4
Config for fourth serial to ethernet
Web to Serial
Config for Web to serial
Misc Config
Config for device name,
username,password

USR-N540 User Manual www.usriot.com
Jinan USR IOT Technology Limited 9 / 39 tec@usr.cn
Reboot
Reboot device via webpage
2.3. Default parameter test
To test briefly in default working mode, on the foundation of the hardware connection, use the matched software
USR-TCP232-Test to make transmitting and receiving test. The left side is serial port, use software default settings, the
right side is the network part, set to workmode TCP Client, remote server address 192.168.0.7, remote port 23.
This illustration shows the 10 ms two-way simultaneous automatically transmit screenshots. As the allocated
memory of the display control is limited, in order to test large amount of data transceiver, here will suspend the receive
display, only statistical data. Below is the effect after testing for a few hours, and transmitting millions of bytes. Stable
and reliable, without a byte loss.

USR-N540 User Manual www.usriot.com
Jinan USR IOT Technology Limited 10 / 39 tec@usr.cn
Figure 3 Diagram 2-3 default working mode communication
3. Work mode
3.1. UDP mode
When in UDP mode, after power on, module will connect to remote server's specific port.
When received data from the remote server, module will send it to serial port; otherwise, when data is
received from serial port, send it to ethernet.
The assist software can be download from link below:
http://www.usriot.com/Download/199.html

USR-N540 User Manual www.usriot.com
Jinan USR IOT Technology Limited 11 / 39 tec@usr.cn
Figure 4 Diagram 3-1 UDP mode communication test
Note:
local port and remote port can be different.
Max UDP send length(ethernet to serial) is 1472 bytes. If you want to send more than 1472 Bytes,
please div it into shorter packet.
3.2. TCP Client mode
Open web pages and config module to
Work Mode: TCP Client
Remote port number: 23
remote server addr: 192.168.0.131

USR-N540 User Manual www.usriot.com
Jinan USR IOT Technology Limited 12 / 39 tec@usr.cn
Figure 5 Diagram 3-2 TCP Client mode
Figure 6 Diagram 3-3 TCP Client communication test
3.3. UDP Server mode
Like the socket UDP server in pc API. Many to one data transfer supported, the data from uart/232/485

USR-N540 User Manual www.usriot.com
Jinan USR IOT Technology Limited 13 / 39 tec@usr.cn
part will be transformed to the last UDP packet’s address.
Here show 2 UDP client communicate with server, server send data to the last client communicates with it.
Figure 7 Diagram 3-4 Client 1 <-> server

USR-N540 User Manual www.usriot.com
Jinan USR IOT Technology Limited 14 / 39 tec@usr.cn
Figure 8 Diagram 3-5 Client 2 <-> server
3.4. TCP Server mode
TCP Server mode have max 8 client connected at max;
When act as TCP server, only local port matters,

USR-N540 User Manual www.usriot.com
Jinan USR IOT Technology Limited 15 / 39 tec@usr.cn
Figure 9 Diagram 3-6 select workmode TCP server
Figure 10 Diagram 3-7 test result, we can establish more than 1 client to test

USR-N540 User Manual www.usriot.com
Jinan USR IOT Technology Limited 16 / 39 tec@usr.cn
3.5. Httpd Client mode
This function is easier used for webpage developer. We establish one web server page, add this:
[<?php echo $_GET['data']; ?>]
Means we can GET data from HTTP client’s request. Open this URL: www.usr.cn/1.php?data=12345, the web
page is downbelow, we can see that the web server have got the data(12345),
Figure 11 Diagram 3-8 Request www.usr.cn/1.php? and upload data
Then we take another way, set module Work mode HTTPD Client, Target address www.usr.cn, Target port 80.

USR-N540 User Manual www.usriot.com
Jinan USR IOT Technology Limited 18 / 39 tec@usr.cn
Figure 13 Diagram 3-10 module act as HTTPD Client
In the response, all the data returned, but the http header from server will be returned, too. the user may need to
parse this to get your data.

USR-N540 User Manual www.usriot.com
Jinan USR IOT Technology Limited 19 / 39 tec@usr.cn
4. Hardware
4.1. Hardware introduction
4.2. brief
power supply range DC9V~24V, DC plug or 5.08-2 plug
4 port RS232/RS485/RS422, selectable by software

USR-N540 User Manual www.usriot.com
Jinan USR IOT Technology Limited 20 / 39 tec@usr.cn
TX/RX LED for each port
4.3. LED
Num
name
Description
1
Power
Always on when powerd
2
Work
Toggle every seconds
3
Link(green)
Locate on RJ45, always on when cable plug
4
Data(yellow)
Locate on RJ45, blink when there is data
5
TX1
Data TX pin for port 1
6
RX1
Data RX pin for port 1
7
TX2
Data TX pin for port 2
8
RX2
Data RX pin for port 2
9
TX3
Data TX pin for port 3
10
RX3
Data RX pin for port 3
11
TX4
Data TX pin for port 4
12
RX4
Data RX pin for port 4
Other manuals for USR-N540
1
Table of contents
Other USR IOT Media Converter manuals

USR IOT
USR IOT USR-TCP232-302 User manual

USR IOT
USR IOT USR-CANET200 User manual

USR IOT
USR IOT USR-W610 User manual

USR IOT
USR IOT USR-TCP232-ED2 User manual

USR IOT
USR IOT RS232 User manual

USR IOT
USR IOT USR-TCP232-306 User manual

USR IOT
USR IOT USR-GM1 User manual

USR IOT
USR IOT USR-TCP232-E2 User manual

USR IOT
USR IOT USR-DR404 User manual

USR IOT
USR IOT USR-W630 User manual