Features
10/100Mbps Ethernet port, support Auto-MDI/MDIX.
Support TCP Server, TCP Client, UDP Client, UDP Server, HTTPD Client. Support Baud rate from 600bps to 230.4bps; Support None, Odd, Even, Mark, Space.
Support heartbeat packet and identity packet.
Support web server, AT command and setup software to configure module.
Support timeout reset function.
Support TCP Client non-persistent function.
Support DHCP/Static IP.
Support software/hardware reload.
Support virtual serial port with USR-VCOM software.
1.1. Application Diagram
1.2. Hardware Design
1.2.1. Hardware Dimensions
1.2.2. DB9 Pin definition
2. Product Functions
This chapter introduces the functions of USR-TCP232-302 as the following diagram shown, you can get an overall
knowledge of it
2.1. Basic Functions
2.1.1. Static IP/DHCP
There are two ways for module to get IP address: Static IP and DHCP.
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.
User can change Static IP/DHCP by setup software. Setting diagram as follow:
2.1.2. Restore default settings
Hardware: User can press Reload over 5 seconds and less than 15 seconds then release to restore default settings.
Software: User can use setup software to restore default settings.
AT command: User can enter AT command mode and use AT+RELD to restore default settings.
2.1.3. Upgrade Firmware Version
User can contact to salespersons for needed firmware version and upgrade by setup software as follow:
2.2. Socket functions
TCP232-302 socket support TCP Server, TCP Client, UDP Server, UDP Client and HTTPD Client.
2.2.1. TCP Client
TCP Client provides Client connections for TCP network services. TCP Client device will connect to server to
realize data transmission between the serial port and server. According to the TCP protocol, TCP Client has
connection/disconnection status differences to ensure reliable data transmission.
TCP Client mode support Keep-Alive function: After connection is established, module will send Keep-Alive
packets about every 15 seconds to check the connection and will disconnect then reconnect to TCP server if
abnormal connection is been checked by Keep-Alive packets. TCP Client mode also support non-persistent
function.
TCP232-302 work in TCP Client mode need connect to TCP Server and need set the parameters: Remote Server
Addr and Remote Port Number. TCP232-302 work in TCP Client won’t accept other connection request except
target server and will access server with random local port if user set local port to zero.
User can set TCP232-302 in TCP Client mode and related parameters by setup software or web server as follows:
2.2.2. TCP Server
TCP Server will listen network connections and build network connections, commonly used for communication
with TCP clients on a LAN. According to the TCP protocol, TCP Server has connection/disconnection status
differences to ensure reliable data transmission.
TCP Server mode also support Keep-Alive function.
TCP232-302 work in TCP Server mode will listen local port which user set and build connection after receiving
connection request. Serial data will be sent to all TCP Client devices connected to TCP232-302 in TCP Server
mode simultaneously.
TCP232-302 work in TCP Server support 16 client connections at most and will kick off oldest connection beyond
maximum connections(User can enable/disable this function by web server).
User can set TCP232-302 in TCP Server mode and related parameters by setup software or web server as follows:
2.2.3. UDP Client
UDP transport protocol provides simple and unreliable communication services. No connection connected
/disconnected.
In UDP Client mode, TCP232-302 will only communicate with target IP/Port. If data not from target IP/Port, it
won’t be received by TCP232-302.
In UDP Client mode, if user set remote IP as 255.255.255.255, TCP232-302 can broadcast to entire network
segment and receive broadcast data. After firmware version 4015, 302 support broadcasting in same network
segment.(Such like xxx.xxx.xxx.255 broadcasting way).
User can set TCP232-302 in UDP Client mode and related parameters by setup software or web server as follows:
2.2.4. UDP Server
In UDP Server mode, TCP232-302 will change target IP every time after receiving UDP data from a new IP/Port
and will send data to latest communication IP/Port.
User can set TCP232-302 in UDP Server mode and related parameters by setup software or web server as follows:
2.2.5. HTTPD Client
In HTTPD Client mode, TCP232-302 can achieve data transmission between serial port device and HTTP server.
User just need set TCP232-302 in HTTPD Client and set the HTTPD header, URL and some other related
parameters, then can achieve data transmission between serial port device and HTTP server and don’t need care
about the HTTP format of data.
User can set TCP232-302 in HTTPD Client mode and related parameters by web server as follow:
2.3. Serial port
2.3.1. Serial port basic parameters
2.3.2. VCOM Application
User can download VCOM software from http://www.usriot.com/usr-vcom-virtual-serial-software/. Through
this software user can set up connection between TCP232-302 and virtual serial to solve the problem that
traditional equipment PC software used in serial port communication way.
2.3.3. Serial Package Methods
For network speed is faster than serial. Module will put serial data in buffer before sending it to network. The data
will be sent to Network as Package. There are 2 ways to end the package and send package to network - Time
Trigger Mode and Length Trigger Mode.
TCP232-302 adopt fixed Package time (four bytes sending time) and fixed Package length (400 bytes).
2.3.4. Baud Rate Synchronization
When module works with USR devices or software, serial parameter will change dynamically according to
network protocol. Customer can modify serial parameter by sending data conformed to specific protocol via
network. It is temporary, when restart module, the parameters back to original parameters.
User can adopt Baud Rate Synchronization function by setup software as follows:
2.4. Features
2.4.1. Identity Packet Function
Identity packet is used for identify the device when module works as TCP client/UDP client. There are two sending
methods for identity packet.
Identity data will be sent when connection is established.
Identity data will be add on the front of every data packet.
Identity packet can be MAC address or user editable data (User editable data at most 40 bytes). User can set
TCP232-302 with Identity Packet function by web server as follow:
2.4.2. Heartbeat Packet Function
Heartbeat packet: Module will output heartbeat data to serial or network periodic. User can configure the
heartbeat data and time interval. Serial heartbeat data can be used for polling Modbus data. Network heartbeat
data can be used for showing connection status and keep the connection (only take effect in TCP/UDP Client
mode).
User can set TCP232-302 with Heartbeat Packet function by web server as follow:
2.4.3. Editable Web server
TCP232-302 support user modify the web server based on template according to needs, then use related tool to
upgrade. If user have this demand can contact to our salespersons for web server source and tool.
2.4.4. Reset function
When 302 work in TCP Client mode, 302 will connect to TCP Server. When user open Reset function, 302 will
restart after trying connecting to TCP Server 30 times but still can’t connect to.
User can enable/disable the Reset function by setup software as follow:
2.4.5. Index function
Index function: Used in situation when 302 work in TCP Server mode and establish more than one connection to
TCP Client. After open Index function, 302 will mark every TCP Client to distinguish them. User can send/receive
data to/from different TCP Client according to their unique mark.
User can enable/disable the Index function by setup software as follow:
2.4.6. TCP Server setting
302 work in TCP Server mode allow at most 16 TCP Clients connection. Default is 4 TCP Clients and user can
change maximum TCP Clients connection by web server. When TCP Clients more than 4, user need make every
connection data less than 200 bytes/s.
If TCP Clients connected to 302 exceed maximum TCP Clients, user can enable/disable kick off old connection
function by web server.
User can set above TCP Server settings by web server as follow:
2.4.7. Non-persistent Connection
TCP232-302 support non-persistent connection function in TCP Client mode. When TCP232-302 adopt this
function, TCP232-302 will connect to server and send data after receiving data from serial port side and will
disconnect to server after sending all the data to server and no data from serial port side or network side over a
fixed time. This fixed time can be 2~255s, default is 3s. User can set TCP232-302 with non-persistent connection
function by web server as follow:
2.4.8. Timeout Reset function
Timeout reset function(no data reset): If network side no data transmission beyond a fixed time(User can set this
fixed time between 60~65535s, default is 3600s. If user set a time less than 60s, this function will be disable), 302
will reset. User can set the Timeout Reset function by web server as follow:
3. Parameter Setting
There are three ways to configure USR-TCP232-302. They are setup software configuration, web server
configuration and AT command configuration.
3.1. Setup software Configuration
User can download setup software from http://www.usriot.com/usr-m0-setup-software/. When user want to
configure the TCP232-302 by setup software, user can run setup software, search TCP232-302 in same LAN and
configure the TCP232-302 as follow:
After researching TCP232-302 and clicking TCP232-302 to configure, user need log in with user name and
password. Default user name and password both are admin. If user keep the default parameters, it is not
necessary to log in.
3.2. Web Server Configuration
User can connect PC to TCP232-302 through LAN port and enter web server to configure.
Web server default parameters as follow:
After firstly connecting PC to TCP232-302, user can open browser and enter default IP 192.168.0.7 into address
bar, then log in user name and password, user will enter into web server. Web server screenshot as follow:
3.3. AT Command
We have specific user manual for AT commands.
3.3.1. Serial AT Command
4. Contact Us
5. Disclaimer
This document provide the information of USR-TCP232-302 products, it hasn’t been granted any intellectual
property license by forbidding speak or other ways either explicitly or implicitly. Except the duty declared in sales
terms and conditions, we don’t take any other responsibilities. We don’t warrant the products sales and use
explicitly or implicitly, including particular purpose merchantability and marketability, the tort liability of any
other patent right, copyright, intellectual property right. We may modify specification and description at any time
without prior notice.
6. Update History
2017-09-13 V1.0.3.01 Established.
Configuration of Serial to Ethernet Converters
serial to ethernet converters are mainly used to transfer data from serial to network and allow serial device to connect TCP/IP network. In order to facilitate the use of serial device serve, there are some common questions and resolution of configuration of serial to ethernet converter as follows.
First is the problem of virtual serial. In the process of use virtual serial and testing on the computer cannot connect independently.
Answer: You may use the setting software equipped by factory to debug.
Second, What to do when the serial cannot configurate parameters?
Answer: Factory setting forbids serial to configurate parameter, so you need to open the page of configuration and choose allowing serial to configurate parameter.
Third, how to recover factory setting on serial to ethernet converter?
Answer: 1. Recovery through hardware: press reload on serial to ethernet converter for 5-10 seconds to recover
2. recovery through software. Set the software to recover or send commend of recovery to factory setting through network protocol
3. recovery through AT commend. Recover through commend AT+RELD after entering AT commend mode.
Fourth, fail to connect AP when configurating serial to ethernet converter through webpage.
Answer: Configurate the product parameter correctly and restart server.
Fifth, serial to ethernet converter fail to receive data after configurating virtual serial
Answer: First is to check whether the virtual serial has been configurated correctly. Second, the inconsistence of transfer speed and the speed of virtual serial program when sending data to distant device will also led to the loss of data. You may solve the problem through setting “simulated baud rate” in the virtual program.
Five problems in the configuration process of serial to ethernet converter and their resolution are explained as above.
USR-TCP232-302 Cannot Work with USR-VCOM
1. Hardware:
● Whether to use the power adapter provided by our company for power supply.
● Whether the network port indicator of USR-TCP232-302 is normal, or please replace a network cable. Under normal circumstances, the green light is always on, and the yellow light flashes.
● If the device is the default static IP 192.168.0.7, then need to set the computer to the static IP of the same network segment as 302, and connect directly through the network cable.
● If the device is in DHCP mode, you need to connect the computer and 302 devices to the same switch or router.
2. Software:
● Check the parameter settings of USR-TCP232-302, if 302 works as TCP Client, then need to set VCOM to TCP Server. And if 302 works as TCP Server, then VCOM is TCP Client.
● Please create a virtual serial port manually.
3. Others:
● Please disable the computer's anti-virus software and other network cards during the test, turn off the firewall.
● Pins of RS232 serial port of 302 should correspond to the pins of the serial device: RX to TX, TX to RX, GND to GND.
How to send AT command?
1.What is the AT command?
AT command is used for controlling module. You can use AT command to configure and query the settings.
2.How to use the AT command?
For USR device is in transparent mode normally, you must enter AT command mode at first. Then you can send AT command to configure or query the settings. After you configure the USR device, you should restart the USR device to make the settings take effect. Every time module restart will work in work mode rather AT command mode. Every AT command must add character carriage return and line feed . In Hex, is 0x0D is 0x0A.
Powered successfully, we can setting the module with UART.
The default UART port parameters of the module are: baud rate1152000, no parity, data 8 and stop 1.
Recommend to use secureCRT software tool or testing program of USRIOT.
Below are using the secureCRT to operate AT command:
Need two step as below:
Fill “+++”in the UART. After the module receive the “++++”,then will return an “a” to confirm;
When you receive an 'a' , then you need to send other 'a' within 3 seconds
After that, module will return “+ok” to enter into the commend mode.
Fill “+++”and “a” need to achieve in the time to reduce the chance of entering command mode while working normally
accidentally. Detail requirement are as fellows.
Time requirement:
T1>the interval of serial port package
T2<300ms
T3<300ms
T5<3s
Change transparent transmission mode to AT command mode :
1. Serial mode device send “+++”to module continuously. If the module received ‘+++’ successfully then it will send “a” back.
2. When module received “a” and then user need to send other “a” to uart within 3s.
3. The module will return ‘+ok’ when module received ‘a’ successfully. And enter into command mode Change AT command mode to transparent transmission mode:
1. Serial device send “AT+ENTM”to module.
2. After the module receive the commend, feedback “+ok”, then back to the previous working mode.
Example: Use USR-TCP232-Test.exe software to send serial command or use your own serial software or MCU send command to our module.
Open test program and configure the serial parameters. Click ‘Open’:
Send +++ to serial. Notes do not add a SPACE or ENTER, that will not return the correct character.
If you give a correct command, the module will return an 'a' likes this:
When you receive an 'a' , then you need to send an 'a' within 3 seconds. You can not add any SPACE or ENTER either.
The module will return +Ok. The the module enter into the AT command mode.
Now you can send AT command to the module, but you should add an ENTER after your command.
3. Network AT Command
Ensure that the module and the computer are in the same network segment before enter into the mode of network AT command. Send www.usr.cn to port 48899 via UDP broadcast of ethernet port. If the module and the PC are in the same network segment, the module will receive the answers. Then it indicates that the modules has entered into the mode of network AT command, and the parameters can be set by AT command. But the module will automatically exit the network AT command mode if there is no command within 30s under AT command mode.