1. Get Start ......................................................................................................................................................................... 6
1.4. Data Transport Testing ....................................................................................................................................... 11
2.2. Features ............................................................................................................................................................. 13
4. Product Function .......................................................................................................................................................... 18
4.1. Net basic function .............................................................................................................................................. 19
4.1.1. IP address/subnet masks/gateway .......................................................................................................... 19
4.1.2. DNS Address ........................................................................................................................................... 22
4.1.3. Hardware Restore the Factory Function ................................................................................................. 22
4.1.4. Web Server ............................................................................................................................................. 23
4.1.5. Net Firmware Upgrade ........................................................................................................................... 24
4.2.2. TCP Server Mod ...................................................................................................................................... 30
4.3. Serial Function ................................................................................................................................................... 46
4.3.1. Serial port Basic Parameters ................................................................................................................... 46
4.3.2. Flow Control ........................................................................................................................................... 47
4.3.3. Serial Port Mapping ................................................................................................................................ 48
4.3.4. Similar RFC2217 ...................................................................................................................................... 49
4.4. Special Function ................................................................................................................................................. 52
4.4.1. Heartbeat Package Function ................................................................................................................... 53
4.4.5. Net Printing ............................................................................................................................................. 60
4.4.7. Customize MAC ....................................................................................................................................... 62
4.4.9. Clear Buffer Data ..................................................................................................................................... 64
4.4.10. Short Connection .................................................................................................................................. 65
5.3. AT Command ..................................................................................................................................................... 86
5.3.1. Net AT Command .................................................................................................................................... 86
5.3.2. Serial AT Command ................................................................................................................................. 86
5.3.3. Error AT Command ................................................................................................................................. 88
5.3.4. AT Command .......................................................................................................................................... 89
5.3.5. AT Command Details ............................................................................................................................... 91
6. Contact us ................................................................................................................................................................... 119
8. Modified History ......................................................................................................................................................... 120
K7 is a module that can realize data transmission between the Network and TTL serial port, which is equipped with
ARM cortex-M4 processor. No need to care of the details, the module realize the protocol converse.parameters can be
set in the software and webpage, configure one time and save forever.
This character aimed at get start and the user are advised to operation one time according to the instr to
understand K7 completely.
Questions occur in the testing, you can refer to our application case and answers:
(also, it can be used in the industrial serial to Ethernet Converter:USR-N668,USR-N510, USR-N520, USR-N540,
USR-TCP232-410S, USR-TCP232-419 and industrial ethernet modules: USR-TCP232-E2, USR-TCP232-ED2.)
To test the communication converse from serial port to net, connect the USR-K7 with evaluation board, and
connected with the PC using serial cable, then connect the net port of K7 and PC. Power on the it. The diagram is as
fellow:
Diagram 1.1.2-1 Hardware Connection
Note: the power adapter and cable are from USR.
1.2. Net Testing Environment
To prevent from searching nothing, not ping and not opening the webpage, you should testing the below contents
before using.
1) Shut down firewall and antivirus software.
2) Shut down net card none-related and reserve only one local connection.
3) For the direct connection between PC and server, please provide a static IP in the same LAN with the IP of K7,
PC network data → network →K7 serial port → PC serial port
As the below:
Diagram 1.4-1 Default Parameters Testing
2. Overview
2.1. Brief Introduction
Super port module K7 is a new serial Ethernet module. It is a module that can realize data transmission between
the network and TTL serial port. This module is equipped with ARM cortex- M4 processor, which has the advantages of
low power consumption, fast speed and high stability.
In terms of the volume, the width of the device is equal to the common RJ45 port, and the length is less than twice
length of the common network port, with the industry- leading ultra-small volume, and the current is only 130mA when
This product is developed on the basis of the hardware and software of serial to ethernet M4 series. The internal
integration of TCP/IP protocol stack, user can use it to complete the embedded device networking function easily,saving
the development process of human, material and development cycle, so that products can be faster into the market,
enhance competitiveness.
Passed the strict testing, K7 has successful case in Banks, highways, large corporate networks, busy webcam
networks and complex network environments such as fiber-optic to Ethernet.
2.2. Features
Equipped with ARM cortex-M4, industrial width of temperature,TCP/IP protocol stack, more stable and reliable.
10/100Mbps net port, supports Auto-MDI/MDIX
Supports TCP server, TCP client, UDP server, UDP client and HTTPD client work mode
Build-in webpage where can set the parameters, also can customize webpage. The port of the webpage can be
defined
Enable 485, and the serial port can work as 485
Supports RTS/CTS hardware flow control and Xon/Xoff software flow control
Supports USR-VCOM
Baud rate:600bps~1Mbps; and five parity way:none, odd, even, mark, space
Supports modbus gateway
Supports Reload button, hardware restore to factory setting
RJ45 have Link/Data indicator, in the net port, there is Isolating transformer,1.5KB ESD
The unique MAC in the world, and the user can self-defined
Supports net upgrade firmware,DDNS, DHCP
Supports keepalive, check dead connection and abnormal and reconnection
1.IP address is the identity representation of the module in the LAN, which is unique in the LAN, so please be sure there
is no another device same as it in the LAN.
Static IP
Handle to setting. Note fill the IP, subnet masks and gateway.
Static IP adopted to the environment that required to statistics the IP and the device and makes them correspond
Setting and query the access way,IP, subnet masks and gateway
parameters for K7
one to one.
Advantage: accessing the device that can not distribute IP address can be searched via UDP broadcast.
Disadvantage: different net segment in the different LAN can not communicate normally.
DHCP
Get IP address , gateway address, DNS server and other information from the gateway server to easy the step for
setting IP address, DHCP adopted to the environment that have no special requirement to IP.
Advantage: accessing the device equipment with the DHCP server such as router can communicate directly.
Reduce the hassle of setting IP address and subnet masks.
Disadvantage: accessing the device with no DHCP server such as computer directly, K7 can not work.
2.Subnet masks is a 32 address, used to determine the host number and the network number by shielding some IP
address, indicates the number of subnet and determine the flag within the subnet. Using combine with the IP address.
The subnet masks needed to set, usually we use the subnet masks: 255.255.255.0. The number of IP addresses in the
subnet is 2 to the eighth power minus 2, that is, 256-2=254, and the general host addresses are all 0 or 1 (binary) has its
special role.
3.Gateway is the net port of the LAN. If you connect the router to access the internet, the gateway is the router IP
address, setting wrong and can not access into the net. No device such as router and no setting, keep the default.
DNS address of the K7 can be set. When K7 need DNS, it will quest for the address that you set.(3010 and above
version support self-define DNS address.)
The default DNS server address is the gateway. In DHCP, default DNS address is acquired automatically.
DNS address can be set, which means that if the domain name server are imperfect,user also can realize the
domain name analyze referred to AT command.
Put down the reload →power on →reload keep for 5s→ put up
Diagram 4.1.3-1 Restore to Factory Setting Step
When there are wronged parameters or forget the password, you can use hardware restore.
Form 4.1.3-1 Hardware Restore Factory AT Command
4.1.4. Web Server
The build-in webpage of the K7 same as the common webpage. User can check the related status of the module
via webpage. Default port of the web server:80(can be modify, after modify, you can access the webpage via other port.
Check the running status of the K7
1) Running time: determine the running time and whether restart.
2) TX count(eth): determine how many data K7 send to internet.
3) RX count(eth): determine how many data send to module from net
4) Conn status(eth)A: connection status of the A to determine which status that K7 stay.
LISTEN: under TCP server mode, listening and wait being connected.
CONNECTING: under TCP client, K7 building the connection to TCP server
CONNECTED: have built
CONNECTED(n):under TCP server, the number of the client connected.
ERROR: k7 stayed in abnormal disconnection.
5) Conn status (ETH)B:connection status of socket B
Diagram4.1.4-1 Running Status
4.1.5. Net Firmware Upgrade
Net upgrade firmware is stable and easy. New function can be enjoyed in the last firmware to meet the high
requirement. Ask for new firmware from supply or from the USR support: http://h.usriot.com, details please refer to
1. TCP client provides client connection for TCP net server. Build connection automatically and connect to server
to realize the data transmit between serial port and server port. According to related rule of TCP, TCP client has
difference between connecting and disconnecting, to confirm the data transport reliable. Usually used in the data
interaction between device and server, which is the commonest communication way.
2. Under TCP client mode, K7 supports recognize the abnormal connection automatically. About 15s internal to
send Keep Alive to keep active after build. If there is abnormal disconnection, k7 will find it and reconnection.K7
connects the server as a TCP, remote port is 0, connecting with random port every time.
3. connecting the remote IP automatically, but do not receive any other connecting quest.
4. Supporting the similar RFC2217, USR-cloud and modbus TCP. In LAN, if the K7 is static IP, please be sure that
set the IP of K7 in the same LAN and set gateway correctly, or K7 is can not communication.
5. Note: keep alive, similar RFC2217, USR-cloud and modbus TCP are instructed in the bellow.
6. TCP client communication case:
① K7 work in TCP client mode, remote IP:172.16.11.8, remote port:8234, click to save then search the K7 again
and check the parameters.
Also you can set in the webpage, remote IP and port are as above, then save and restart.
② connecting the TCP server, the IP of my computer:172.16.11.8, local host port:8234(can be modify), testing
software show the connection information:172.16.11.68:24( if the local port of K7 is 0, here will distribute a port
randomly for K7, e.g.172.16.11.68:49155).
③ setting the correct serial port parameters, click the serial port and the sent, receive the bi-direction data
transmission.
1. Under TCP server mode ,module monitoring the local port, receive and build connection when there is
connecting quest, receive the data and sent all to the client connected. If access the TCP server of K7 across the public
net, user should build termination mapping on the router.( mapping way: http://www.usr.cn/Download/155.html) also
TCP server supports Keepalive to monitoring connection timely.
2. Used in communicating with the TCP client in LAN. Adopt to the situation where is no server and several PC
and phone sending quest. And same as TCP client , TCP server has different between connecting and disconnecting to
confirm data transport stable.
3. TCP server supports similar RFC2217 and modbus TCP
4. At most K7 can receive 8 client to connect when work as TCP server. The max number of the client can be
connected can be set.
5. Under TCP server,K7 listens the local port and do not monitoring, if the questing number more than max
number you set, kick off the oldest one.
6. communication case:
K7 work in CP server mode, local port 23. Open the testing software and have the mode to be TCP client, writing
the remote IP and remote local port, the click connection and testing data transporting.
2. UDP client is a wireless transport protocol, provide the transmission service that easy and not reliable. No
difference between the disconnecting and connecting, make the IP and port then send data to it. No requirement for
drop package. Small data package and fast frequency, send data to point IP.
3. Under UDP client mode ,K7 communicate with the remote port of the remote IP, if the data comes from other
tunnel, it will not be received by K7.
4. Under the UDP client, K7 can realize the UDP broadcast if the remote address is 255.255.255.255; meanwhile,
it also can receive the broadcast data. 3010 and above firmware supports broadcast in LAN, like xxx.xxx.xxx.255.
5. Communication case:
① Build a UDP, the IP of the PC: 172.16.11.8, port:20108
② K7 work in UDP client mode, remote port is 20108
③ Click the serial port send. Received data, the testing software remote IP and port change into IP and port for K7,
then click net send and send data to serial port.
1. Do not check the original IP address basic on the common UDP, under UDP server mode, K7 received the UDP
data package and change the remote IP change into data original IP and port, the turn back to the last IP and port.
2. Used in communicating with several device and do not want to use the TCP for the high speed.
3. Application case:
① set K7 into UDP server mode, local port is 23
② Click two testing software, work mode:UDP; remote IP and port is the IP and port of K7. then click send, the
serial port will receive the data , click serial port send, the testing software will display the data that received by the
recent one communicating with K7.
Webpage to serial port function can realizes the interaction between the serial port and webpage forK7. user’s
device data display to webpage, and realize the interaction between the webpage and device.
and deal with the data. Then the result will display on the web. After design the webpage, download the webpage to K7
according to the defined webpage to realize the development.
Receive the data assigned VCOM data, and send it in the data of net data using VCOM to solve the PC as a serial
port and can not connect with device,which is convenient for users.
E.g.
1. Take K7 in TCP Server mode as a server, which is convenient for user to change the computer and connected.
2. Setting the way to connect the VCOM and K7 manually:
① Open the VCOM and add the serial port, choose the port: COM2(avoid the exist COM port) protocol use the TCP
client, remote IP set to the IP of the K7, remote port is the port of the K7. note fill the device name.
② Click sure, observe if the connection is established, if the connection has established, and you can test the data
transport transmission.
Via setting serial port parameters, keep consistent with the device to make sure communicating.
4.3.2. Flow Control
Diagram 4.3.2-1 Serial Flow Control
Flow control: the way for serial port flow control, users can choose to enable 485 or not, control the receive and
send for 485, 3010 and later default enable 485 control mode, under the condition that no hardware flow control,
enable 485.
1. NONE: default serial port mode, under this mode, 3010 and later version enable 485
2. RTS/CTS: hardware flow control. The hardware flow control for K7 supports RTS/CTS.
3. Xon/Xoff: software flow control. 3010 and later version enable the software flow control.
Hardware or software flow control deal the serial port data for better. When the serial port received buffer data
out than the threshold value, inform the remote port stop sending data until complete buffering, then inform to deal
with data.
Usually used in the situation that rich in time.
4.3.3. Serial Port Mapping
The serial packing time and length of K7 can be set. Packing the serial port data according to the packing time and
packing length under the transparent transmission mode .
The frame mechanism of serial port is based on the packaging time and the packaging length. The case are as
fellow.
1. Packing time set as 10ms and the length as 512.
If the internal time for serial received the data more than 10ms, or the length more than 512, K7 send packing to
net when the serial port receive data.
2. If the packing time is 0 and the packing length is not 0, only the packing length work; and if the packing length is
0 and he packing time is not 0, only the packing time work.
3. Set the packing time is 0 ms and the packing length is 0
When the packing time is 0ms, K7 works the default packing time: if the interval that serial port received data more
than packing time for send 4 byte, K7 send packing. E.g. baud rate 115200, 4 bytes packing time is:
T=0.4ms, (if the value less than 0.1ms. Packing time calculates as 0.1ms.
T=1/baud rate*10*4
4. For the limit of the serial port speed, users should control the flow when K7 receive the data from net and send
to serial, or there will be data over flow in serial. So when send net data to serial, user should calculate the data flow.
E.g.
Calculate way: if sending M bytes need N s. the way to check for possible overflow methods (if the net situation is
ok, the time can be ignored ). The time for M bytes:
T=1/baud rate*10*m
If there is no overflow, M bytes of data must be transmit within Ns,
N>2T is require for K7 to work properly. If the baud rate is less than 9600, keep n>T.
Serial packing time: default is 4 bytes time, can be set from0~255.
Serial packing length:default 1460, can be set from the 0~1460.
4.3.4. Similar RFC2217
Similar RFC2217 is a simple RFC2217 protocol, working with the VCOM and changing serial port parameters
candynamically to realize the communication with variable serial port parameters.
Enable this function, using USR-VCOM can open this function,which can realize the serial baud of the PC software
and K7 automatically match. No need to pay attention to serial port baud rate setting.
For the encryption of data transmission in some industrial situation, some device will change the data length, baud,
parity and other parameters in the transmission, and K7 supports this function.
Protocol length is 8 bytes, details are as fellows. The value in example are in HEX type.
1) When using RFC2217, click setting software RFC2217 to enable this function.
2) When the serial port parameters change, send the RFC2217 package, after K7 received the RFC2217 command,
modify the serial parameters and can not transparent transmission.
Modbus polling:supports more than one master PC query the data of slave PC, the timeout can be set. 3010 and
above version supports this function.
4.4.3. Registration Package
Under the net transparent transmission mode, user can have the module sent registration package to server to
recognize the original of the data or work as the authorization code for server function.
Registration can be sent when the connection build between the module and server, also it can inset a registration
package data in front of the data package. The data registered can be MAC address or the definition registration
package(at most the definition registration can be 40 byte.)
3010 and above version supports the registration package.
Send registration package when building connection usually used in the situation that connecting the server
needed to register.
USR-cloud aim to solve the problem of the communication between device and device, device and upper
machine( android, IOS,PC).USR-cloud used to transparent transport the data, the device connected can access remote
data without modify.USR-cloud can used in remote monitor, the internet of things, the internet of cars and intelligent
house, so the K7 installed USR-cloud. More information can be scan http://console.usriot.com
USR-cloud software is a platform for communication between devices and PC software. The cloud software is
mainly used for data transmission or monitoring remotely. This function only works in TCP client mode and supports the
devices with firmware 3009 and later versions.
Login link of USRIOT Cloud: http://console.usriot.com
Remote server address: console.usriot.com
Local port: The port of device, Remote port: Cloud software’s port
Device ID: It is assigned to device by cloud software
Communications Code: Password generated after adding the device to cloud software
K7 can connect with the serial printing, operating the printing via net, and change the serial printer into net printer,
3010 and above version supports this function.
Testing way:
1. Configuring module parameters:work mode:TCP server, local port:9100
K7 supports customize webpage. The user can upgrade their webpage into K7 via customize webpage. To be more
convenient for user, we have prepared upgrade webpage package
Including webpage code(K7 default webpage code and medium webpage code), webpage tools can be download.
1. If you will customize webpage, please contact with the USR supports or the sale.
Modify the webpage code, open “UpgradeHtml.exe”, destination IP is the IP of K7, the final name of file is “fs”,
product choose the”M4”, then click the upgrade.
Diagram 4.4.6-2 Webpage Upgrade
4.4.7. Customize MAC
The unique MAC in the world for K7, can be check in the webpage. If the user have special demand, can set instant
MAC via webpage. Please do not all F. restore to the factory setting and the MAC will be back to the factory MAC.
Restart timeout( no data restore) used to keep K7 long time stable work. When net port can not receive the data,
or have note receive data for long time, K7 will restart in the time to prevent the communication from the abnormal.
The time can be set via webpage and AT command, range from 60~65536s, default value is 3600s. When the time less
than 60s, default is 0 which means that disable this function.
Before data connection, data serial port received will be put in the buffer zone. K7 serial received buffer:2Kbyte.
After connecting the TCP connection, clear the buffer data or not can be choose in the webpage, default do not clear. If
user enable the short connection, this function will do not work.
Used to save the server resource, used in the situation that several point to one. Short connection make sure all
the connection can work, do not need any extra way to filtrate.
TCP short connection can used under the TCP client mode. Enable the short connection and send data, if there is
no data received any data in serial port or the net port, it will disconnect.
Default disable, the interval time can be set, range from 2~255s, default 3s. setting diagram are as fellow:
1. Click the K7 you searched. At first you should check the password, if the password is correct, there will show the
information for K7, if the password is error, software will bond out the window that you should enter the username and
password, the click enter. Both default username and password are admin. All the default parameters setting and there
will not bond out username and password.
Flow control: None/RS485/Hardware, Hardware means hardware flow control, none or RS485 means no flow
control.
Work mode: TCP Server /TCP Client/ Httpd Client/UDP Client/UDP Server
Remote IP/remote port:the IP and port of server connected when K7 work as a client including TCP Client/ Httpd
Client/UDP Client
Local port: the port that K7 build connection, recommend set to be 0 when K7 work as TCP client, which means
build in random connection.
TCP server style: none
Modbus TCP: setting when using the modbus TCP to modbus RTU
Pack time and packlen: used in the serial port mapping
Synchronize baud rate(RFC2217)
4. Firmware upgrade:
If the module firmware need to upgrade to the high vision,user can consult with sales to get the upgraded
firmware and click the device, upgrade the vision. When you upgrade it, connect directly the device and PC and notice
that PC upgrading module is forbidden.
Select the device, then choose upgrade the firmware.
12 34: encryption version, others are not encrypted
version; encrypted version can upgrade the encrypt
program and no encrypted one should analyze the
encryption then send.
Application_title
19~34
55 53 52 2D 54 43
50 32 33 32 2D 35
30 30 00 00
device name
checksum
35
F0
(this value can be ignore)
Check sum initial value is 0x00, reduce every bits of
TAG_STATUS in order,till the last bit, and the result is
Open the browse and enter the IP of K7,( default is 192.168.0.7) and user can open the K7 login windows. Enter
username:admin, password:admin, then click enter and enter the webpage.
Diagram 5.2-1 Username and Password
Click the English on the right up, change the language.
Save all the parameters and click restart module to work.
5.3. AT Command
5.3.1. Net AT Command
Net AT command, the command collection that delivery via net port and module under the command mode,
details are like the serial port command.
Net AT command mode: keep the module and PC in the same LAN, and the user can setting via AT command.
Send www.usr.cn via UDP, if the module and PC in the same LAN, PC will receive the return data from K7, which
means module have enter the net AT command and can configure it.
Under AT command mode, if there is no command for 30s, K7 will exit the AT command.
5.3.2. Serial AT Command
AT+ command is the command collection that perform the command transport using UART and module under the
order mode. Later we will interpret the type in detail.
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.
AT command test tools.UART interface commend to use secureCRT software tool or USR pro APP. Below are using
the secureCRT with UART to perform.
From transparent transport to order mode need two step as below:
Fill “+++”in the UART. After the module receive the “++++”,it will send a “a” to confirm;
Fill the confirming “a” in the UART, after the module receive and send “+ok”, enter the command mode.
Diagram 5.3.1-1 Enter the AT Command
Instr: if no feedback after fill “++++”and “a”, as the above.
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.
The order change into temporary command mode from transparent transport mode:
1. Serial mode device send “+++”to module continuously. The module receive and send “a” back. Before sending“+++”is
the packaging time and can not send any data.
2. After receive “a” feedback a “a”in 3s.
3. After the module receive “a, send “ok”to the device, and enter “AT”command
4. After the device receive “+ok” and know the module enter the AT command mode, then send AT command.
The order change into net transparent transport from AT command mode:
1.Serial device send “AT+ENTM”to module.
2.After the module receive the command, feedback “+ok”, then back to the previous working mode.