USR IOT USR-TCP232-302 User manual

USR-TCP232-302 User Manual h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
2 / 53
USR-TCP232-302 User Manual.............................................................................................................................. 1
1. Quick Start...............................................................................................................................................................4
1.1. Hardware Testing Environment................................................................................................................4
1.2. Connection...................................................................................................................................................4
1.3. Default Parameter...................................................................................................................................... 6
1.4. Data Transmission Testing........................................................................................................................6
2. Overview..................................................................................................................................................................7
2.1. Brief Introduction.........................................................................................................................................7
2.2. Features....................................................................................................................................................... 7
2.3. Parameters.................................................................................................................................................. 8
2.4. Size............................................................................................................................................................... 9
3. Module Function.................................................................................................................................................. 10
3.1. Work Mode................................................................................................................................................ 10
3.1.1. TCP Client Mode...........................................................................................................................10
3.1.2. TCP Server Mode......................................................................................................................... 11
3.1.3. UDP Client Mode.......................................................................................................................... 13
3.1.4. UDP Server Mode.........................................................................................................................14
3.1.5. HTTPD Client Mode..................................................................................................................... 15
3.1.6. TCP and UDP Mechanism.......................................................................................................... 15
3.2. DHCP and DNS Function....................................................................................................................... 16
3.3. VCOM.........................................................................................................................................................17
3.3.1. TCP232-302 Works as Client..................................................................................................... 17
3.3.2. TCP232-302 Works as Server....................................................................................................18
3.3.3. Other Ways to Create VCOM..................................................................................................... 19
3.4. Special Function....................................................................................................................................... 21
3.4.1. Factory Reset................................................................................................................................ 21
3.4.2. Link Function................................................................................................................................. 21
3.4.3. Reset Function.............................................................................................................................. 21
3.4.4. ID Function.....................................................................................................................................22
3.4.5. Index Function...............................................................................................................................22
3.4.6. RFC2217 Function........................................................................................................................22
3.5. Additional Function...................................................................................................................................22
3.5.1. Display IP and Data......................................................................................................................22
3.5.2. Serial Port Parameter Setting.....................................................................................................22
3.5.3. Set Client Number in TCP Server Mode...................................................................................22
3.5.4. Defined MAC Address..................................................................................................................22
3.5.5. Defined DNS Server IP................................................................................................................22
3.5.6. Defined Registration Package.................................................................................................... 23
3.5.7. Defined Heartbeat Package........................................................................................................23
3.6. Firmware Upgrade................................................................................................................................... 24
3.7. Configuration Protocol.............................................................................................................................25
3.7.1. Network setting protocol command........................................................................................... 25

USR-TCP232-302 User Manual h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
3 / 53
3.7.2. Network echo command..............................................................................................................29
3.7.3. Monitor function.............................................................................................................................31
3.7.4. Serial port setting protocol...........................................................................................................31
3.7.5. Reset command............................................................................................................................ 36
3.7.6. Similar T24 series setting protocol.............................................................................................36
3.8. UART Framing mechanism.................................................................................................................... 38
3.8.1. packing method.............................................................................................................................38
3.8.2. Flow calculation.............................................................................................................................38
4. Parameter Setting................................................................................................................................................39
4.1. Webpage Setting...................................................................................................................................... 39
4.2. Log in..........................................................................................................................................................39
4.3. State Configuration.................................................................................................................................. 40
4.4. Local IP...................................................................................................................................................... 40
4.5. Serial Port.................................................................................................................................................. 41
4.6. Expand Function.......................................................................................................................................42
4.7. Misc Configuration................................................................................................................................... 43
4.8. Reboot........................................................................................................................................................44
4.9. Software Setting....................................................................................................................................... 44
5. Appendix............................................................................................................................................................... 47
AppendixⅠ:Meaning of Port parameter bit................................................................................................. 47
AppendixⅡ:ID type of Independent ID.........................................................................................................48
Appendix Ⅲ:Upper computer Socket programming example..................................................................48
Server Socket code:........................................................................................................................................ 48
Client Socket code:..........................................................................................................................................50
6. Contact Information............................................................................................................................................. 52
7. Disclaimer............................................................................................................................................................. 52
8. Undated History................................................................................................................................................... 53

USR-TCP232-302 User Manual h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
4/ 53
1. Quick Start
USR-TCP232-302 is used for data bidirectional transparent transmission between RS232 and Ethernet .
TCP232-302 itself complete protocol conversion, parameter can be set by built-in webpage or software.
Once set, permanent preservation.
This chapter is quick start for using USR-TCP232-302 ,we advice users to read it carefully and operate
personally, it can help you know about module generally.
Here is application case for inference:
http://www.usriot.com/support/application-case/usr-tcp232-series-application-case/
You can also email it to Customer Support Center:
http://h.usriot.com/
1.1. Hardware Testing Environment
To test TCP232-302 conversion function, user should connect RS232 to computer by USB to serial line,
then connect its LAN port to computer LAN port by internet cable.
Here is schematic diagram for hardware link .
Diagram 1.1-1 Hardware Link
1.2. Connection
Computer should be set as follows:
1) Shut down firewall and anti-virus software .

USR-TCP232-302 User Manual h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
6/ 53
1.3. Default Parameter
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
Serial baud rate
115200
Serial parameter
None, 8 ,1
Local port
20108
Target IP
192.168.0.201
Target port
8234
Diagram 1.3-1 TCP232-302 Default Parameter
1.4. Data Transmission Testing
Steps for network communication parameters:
1) Install USR-TCP232-Test.exe .
2) Connect UART to PC, LAN to PC.
3) Protocol: TCP Server
Server IP: 192.168.201 ( PC Static IP )
Server Port No: 8234

USR-TCP232-302 User Manual h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
7/ 53
Diagram 1.4-1 Port to LAN Test
2. Overview
2.1. Brief Introduction
TCP232-302 is a new serial to Ethernet device server which realizes data bidirectional transparent
transmission between RS232 and RJ45 Port. It is equipped with ARM core with characters of low power,
fast speed, high stability.
It integrates internal TCP/IP Protocol, it also has some industry characteristic function.
2.2. Features
●Support DHCP (Dynamic Host Configuration Protocol), obtain an IP address automatically;
●Support DNS (Domain Name System), server address can be defined, domain name resolution;
●Web-set: Setting parameters through web;
●Upgrade firmware via network;
●Support AUTO MDI/MDIX, can use a crossover cable or parallel cable connection;
●Serial port baud rate 600 bps ~230.4 Kbps, and None, Odd, Even, Mark, Space, five check bits;
●Work mode: TCP Server, TCP Client, UDP Client, UDP Server, HTTPD Client;
●Working model related parameters can be set via a serial port or network, setting protocol is available;

USR-TCP232-302 User Manual h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
8/ 53
user can integrate it into software;
●Support virtual serial port, self-developed USR-VCOM software;
●Heartbeat package mechanism to ensure connection is reliable, put an end to connect feign death;
●User-defined registration package mechanism, check the status of connection;
●Under TCP Server , Client number is 1-16, default value is 4, the IP connected to Client is visible;
●Support User-defined MAC address;
●Restore factory default;
●Across the gateway, switches, routers;
●Across the gateway, across switches, routers;
●Provide(socket), VB, C++, Delphi, Android, IOS;
●Download application cases;
●Support customization;
2.3. Parameters
Parameter
Parameter Value
Voltage
DC 4.75~7V
Current
150mA
Consumption
<1W
Temperature
Working temp: -25 ~ 75 °C
Storage temp: -40 ~ 105 °C
Storage humidity: 5% ~ 95% RH
Diagram 2.3-1 USR-TCP232-302 Parameters

USR-TCP232-302 User Manual h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
10 / 53
3. Module Function
Diagram 3-1 Functional flow
3.1. Work Mode
TCP Client
TCP Server
UDP Client
UDP Server
HTTPD Client
3.1.1. TCP Client Mode
It has to be connected before transferring data.
1) In TCP Client Mode,TCP232-302 connects TCP Server actively, establish a connection to transmit date
2) In TCP Client Mode, It has function of identifying disconnected link. When connected, it will send
keepalive package every 15s.If unconnected ,it can be detected timely and enforceTCP232-302 to disconnect
the former link to establish a new one.
3) When TCP232-302 try to connect remote server ,if the local port number is not “0" ,it will establish a
connection with the same source port every time.
4) It has synchronizing function of baud rate, user should install USR VCOM Software.

USR-TCP232-302 User Manual h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
11 / 53
5) When local port number is “0” , it means local port is random.
Diagram 3.1.1-1 TCP Client Setting
Diagram 3.1.1-2 TCP Client Mode
3.1.2. TCP Server Mode
1) It has to be connected before transferring data.
2 ) In TCP Server Mode, 302 monitors local port, it will response and establish a connection when there
is a request. Up to 4 links at the same time. Once received data, 302 serial port will send data to all the devices
which connect to TCP232-302.
3 ) It has synchronizing function of baud rate, user should install USR VCOM Software.

USR-TCP232-302 User Manual h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
12 / 53
4) In TCP Server Mode, The maximum number can be configured by user. TCP Client number is from 1
to 16, default value 4. When the Client link is more than 16, the new link will replace the former link from Link 1
Diagram 3.1.2-1 TCP Server Setting

USR-TCP232-302 User Manual h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
13 / 53
Diagram 3.1.2-2 TCP Server Mode
3.1.3. UDP Client Mode
1) The Model belongs to UDP Protocol.
2) In UDP Client Mode, TCP232-302 won’t establish the connection actively. It can only communicate with
the target port whose IP has been set. When serial port receive data, it send data to target IP and port. If data
doesn’t come from this channel, it will not be accepted by TCP232-302.
3) In UDP Client Mode, if target IP is set as 255.255.255.255, it can realize function of entire network
broadcast, also can receive broadcast data. If broadcast in network segment ,eg.192.168.0.255, it can only
send data ,can’t receive data.
4) Under UDP Client, maximum data length sent from MCU to TCP232-302 is 1460.

USR-TCP232-302 User Manual h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
14 / 53
Diagram 3.1.3-1 UDP Client Mode
3.1.4. UDP Server Mode
1) UDP Server is based on normal UDP, it doesn’t validate the source of IP address. Once received UDP
data, it convert target IP to data source IP, similar to TCP Server.
2) In UDP Server Mode, TCP232-302 records an IP, Once it receives data, it will send data to record IP.
TCP232-302 also works as a server, can receive data from Ethernet and convert target IP to data source IP.
Diagram 3.1.4-1 UDP Server Setting

USR-TCP232-302 User Manual h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
15 / 53
Diagram 3.1.4-2 UDP Server Mode
3.1.5. HTTPD Client Mode
1) In HTTPD Client Mode, TCP232-302 send data to HTTP Server or receive data from HTTP Server,
complex HTTP protocol will be done by TCP232-302, it is convenient for user to programming.
2) TCP232-302 received data from HTTP Server will send to serial port without process.
3) According to demand, user can define HTTP content. If the request type is POST, TCP232-302 will add
Connection and Content-Length.
4)In HTTPD Client Mode, it supports GET and Post Function .
3.1.6. TCP and UDP Mechanism
TCP
UDP
Advantages
Stable;
Not easy to lose data package;
Reliable connection mechanism;
No connection mechanism;
Easy and flexible;
Transmission interval is accurate;
Disadvantage
Easy to block up Information;
Because of check and resend
mechanism, interval isn’t accurate
Under bad network condition, it is
high risky to losing data package

USR-TCP232-302 User Manual h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
16 / 53
3.2. DHCP and DNS Function
DHCP: Dynamic Host Configuration Protocol
When T2 connects to remote server, it can obtain an IP address automatically which router or gateway
distributed. If you don’t know how to set IP address or it can’t connect because of the set IP is not in the same
segment, the function is helpful. IP address obtained from DHCP can be checked ,but can’t be modified.
Diagram 3.2-1 DHCP
DNS: Domain Name System
e.g. domain name sever is cloud usr.cn, when we don’t know Server IP or Server IP changed, this function
plays an important role, it can connect remote server by resolving server domain name
Note: when use NDS function, gateway must be same as router IP or choose DHCP function.

USR-TCP232-302 User Manual h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
17 / 53
Diagram 3.2-2 DNS
3.3. VCOM
USR-VCOM Download: http://www.usriot.com/usr-vcom-setup-software-v3-7-1-520/
USR-VCOM Manual: http://www.usriot.com/usr-vcom-setup-software-user-manual-v3-5-2/
If user’s upper computer and device are all connect by serial port, user can create a COM which has TCP/
IP to realize remote control by USR-VCOM software.
1) Turn off firewall and anti-virus software.
2) Install USR-VCOM.
I advise user to select “Search”or “Smart vcom” to create virtual port. Please refer to 3.3.3
3.3.1. TCP232-302 Works as Client
1) Set module parameters. T2 work model: TCP Client.
2) Open USR-VCOM, set virtual port as follows :

USR-TCP232-302 User Manual h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
18 / 53
Diagram 3.3.1-1 Create Server Virtual Port
3) If the work mode and parameter is correct , TCP232-302 will connect automatically. If user want to
monitor sent data, please click “Monitor”. It is used to check whether the data is correct .
Diagram 3.3.1-2 Monitor Date
3.3.2. TCP232-302 Works as Server
1) Set TCP232-302 work mode: TCP Server.
2) Set virtual port as follows:
Table of contents
Other USR IOT Media Converter manuals

USR IOT
USR IOT RS232 User manual

USR IOT
USR IOT USR-DR404 User manual

USR IOT
USR IOT USR-TCP232-306 User manual

USR IOT
USR IOT USR-TCP232-E2 User manual

USR IOT
USR IOT USR-TCP232-ED2 User manual

USR IOT
USR IOT USR-N520 User manual

USR IOT
USR IOT USR-W600 User manual

USR IOT
USR IOT USR-TCP232-410s User manual

USR IOT
USR IOT USR-N540 User manual

USR IOT
USR IOT USR-W610 User manual