Modbus
Modbus
HF2211
P
O
SH
RK
Overview of Characteristic
MIPS MCU with 4MB Flash and 8MB SRAM. Run on eCos
O
Size: 95 x 65 x 25 mm (L x W x H)
FCC/CE/RoHS Certificated
http://www.iotworkshop.com -1-
HF2211 Serial Server Device User Manual
HISTORY...........................................................................................................................................7
P
1.3. Device Paremeters ...........................................................................................................9
1.4. Key Application ..............................................................................................................10
O
2. HARDWARE INTRODUCTION .........................................................................................11
2.1. Pins Definition ................................................................................................................12
2.2. RS232 Interface ..............................................................................................................13
SH
2.3. RS485 Interface ..............................................................................................................14
2.4. RS422 Interface ..............................................................................................................14
2.5. RJ45 Interface ................................................................................................................15
2.6. Mechanical Size .............................................................................................................15
RK
2.7. Rail Mounting .................................................................................................................16
2.8. Order Information ..........................................................................................................16
2.9. Package Information ......................................................................................................16
http://www.iotworkshop.com -2-
HF2211 Serial Server Device User Manual
P
3.15. Auto-IP Function ...............................................................................................................37
3.16. NTP Function .....................................................................................................................37
3.17. Heartbeat Function ...........................................................................................................38
O
3.18. UART Fast Config..............................................................................................................38
3.19. Other Function...................................................................................................................38
SH
4. CLI COMMAND NOTES .......................................................................................................40
4.1. Working Mode ................................................................................................................40
4.1.1. Switch Transparent Transmission Mode to Cli Command Mode .................................... 40
4.2. Cli Command Overview .................................................................................................41
RK
4.2.1. Cli Command Format ...................................................................................................... 44
4.2.1.1. Show Command ........................................................................................................... 44
4.2.1.2. SYS Directory ............................................................................................................... 45
4.2.1.3. SYS/Auth Directory ...................................................................................................... 45
4.2.1.4. SYS/Auth/User Command ............................................................................................ 45
O
http://www.iotworkshop.com -3-
HF2211 Serial Server Device User Manual
P
4.2.1.35. UART/Edit Command ................................................................................................. 54
4.2.1.36. UART/Clean Command .............................................................................................. 54
4.2.1.37. SOCK Directory .......................................................................................................... 54
O
4.2.1.38. SOCK/Show Command .............................................................................................. 54
4.2.1.39. SOCK/New Command................................................................................................ 54
SH
4.2.1.40. SOCK/netp directory................................................................................................... 56
4.2.1.41. SOCK/netp/clean Command ...................................................................................... 56
4.2.1.42. DATA Directory........................................................................................................... 57
4.2.1.43. Restart Command ...................................................................................................... 57
4.2.1.44. Reload Instruction....................................................................................................... 57
RK
4.2.1.45. WIFI Catolog............................................................................................................... 57
4.2.1.46. WIFI/Show Command ................................................................................................ 57
4.2.1.47. WIFI/Mode Command ................................................................................................ 58
4.2.1.48. WIFI/Status Command ............................................................................................... 58
O
http://www.iotworkshop.com -4-
HF2211 Serial Server Device User Manual
LIST OF FIGURES
Figure 1. HF2211 Appearance ............................................................................................................................... 11
Figure 2. HF2211 Interface ..................................................................................................................................... 12
Figure 3. HF2211 Side View ................................................................................................................................... 13
Figure 4. RS232 Pin Defination(Male/Needle Type) ............................................................................................... 14
Figure 5. HF2211 RS422 Connection ..................................................................................................................... 14
Figure 6. RJ45 Pin Defination ................................................................................................................................. 15
Figure 7. HF2211 Mechanical Dimension ............................................................................................................... 15
Figure 8. HF2211 Rail ............................................................................................................................................ 16
Figure 9. HF2211 Product Order Information ......................................................................................................... 16
P
Figure 10. HF2211 Software Protocol Structure ..................................................................................................... 17
Figure 11. HF2211 Function Structure ................................................................................................................... 18
Figure 12. General AP Network .............................................................................................................................. 18
O
Figure 13. STA Application ..................................................................................................................................... 19
Figure 14. AP+STA Wireless Network .................................................................................................................... 20
SH
Figure 15. AP and STA Combination Application ................................................................................................... 21
Figure 16. Configure Wi-Fi Parameter .................................................................................................................... 22
Figure 17. STA Scan Parameter............................................................................................................................. 22
Figure 18. Configure the Wi-Fi Parameter .............................................................................................................. 23
Figure 19. STA Scan .............................................................................................................................................. 23
RK
Figure 20. Ethernet Interface Function(AP) ............................................................................................................ 24
Figure 21. Ethernet Interface Function(Router) ...................................................................................................... 24
Figure 22. Ethernet Port Function(Bridge, reserved) .............................................................................................. 25
Figure 23. Transparent data transmission example................................................................................................ 25
O
http://www.iotworkshop.com -5-
HF2211 Serial Server Device User Manual
P
Figure 54. Other Function ....................................................................................................................................... 39
Figure 55. HF2211 Default: UART Parameters ...................................................................................................... 40
Figure 56. Switch Transparent Transmission Mode to Cli Command Mode ........................................................... 41
O
Figure 57. Cli Command Root Directory ................................................................................................................. 41
Figure 58. Cli Command SYS Tree ........................................................................................................................ 42
SH
Figure 59. Cli Command UART Tree ...................................................................................................................... 42
Figure 60. Cli Command SOCK Tree ..................................................................................................................... 43
Figure 61. Cli Other Command ............................................................................................................................... 44
RK
O
W
T
IO
http://www.iotworkshop.com -6-
HF2211A Serial Server Device User Manual
LIST OF TABLES
HISTORY
P
Ed. V1.0 08-03-2017 First Version
O
SH
RK
O
W
T
IO
http://www.iotworkshop.com -7-
HF2211A Serial Server Device User Manual
1. PRODUCT OVERVIEW
P
attached device.
The HF2211 using highly integrated hardware and software platform,It has been optimized for all kinds
O
of applications in the industrial control, smart grid , personal medical application and remote control
that have lower data rates, and transmit or receive data on an infrequent basis.
SH
The HF2211 integrates all serial to Ethernet functionality with 95 x 65 x 25mm size..
Support Serial to 10/100M Ethernet Conversion, Serial Speed Upto 460800 bps
Support 10/100M Ethernet Auto-Negotiation
W
Size: 95 x 65 x 25mm (L x W x H)
FCC/CE/RoHS Certificated
IO
http://www.iotworkshop.com -8-
HF2211A Serial Server Device User Manual
Item Parameters
System Information
Processor/Frequency MIPS/320MHz
Flash/SDRAM 4MB/8MB
Operating System ECos
Ethernet Port
P
Port Number 1 RJ45
Interface Standard 10/100 Base-T Auto-Negotiation
O
Protection 8KV Isolation
Transformer Integrated
IP,TCP,UDP,DHCP,DNS,HTTP Server/Client,ARP,
SH
Network Protocol BOOTP, AutoIP, ICMP,Web socket, Telnet, FTP,TFTP,
uPNP, NTP, SNMP,Modbus TCP
SSL v3
Security Protocol AES 128Bit
DES3
IPV6 Support Plan to Support
RK
Wi-Fi Interface
Standard 802.11 b/g/n
Frequency 2.412GHz-2.484GHz
Network Mode STA/AP/STA+AP
O
Security WEP/WPAPSK/WPA2PSK
Encryption WEP64/WEP128/TKIP/ AES
802.11b: +20dBm(Max.)
W
Serial Port
Port Number 1 RS232/RS485/RS422
IO
RS232: DB9
Interface Standard RS485/RS422: 5.08mm connector
Support one channel of RS232/RS422/RS485.
Data Bits 8
Stop Bit 1,2
Check Bit None,Even,Odd,Space,Mark
Baud Rate TTL: 600 bps~460800 bps
No Flow control
Flow Control Hardware RTS/CTS、DSR/DTR
Software Xon/ Xoff flow control
Software
http://www.iotworkshop.com -9-
HF2211A Serial Server Device User Manual
P
Storage Temp. -45 ~ 105°C, 5 ~ 95% RH(no condensation)
Input Voltage 5~36VDC or 9~50VDC
O
Working Current ~200mA
Power <700mW
Other Information
SH
Certificate CE, FCC, RoHS
Medical devices
ATM machines
W
Modems
Time/attendance clocks and terminals
IO
http://www.iotworkshop.com - 10 -
HF2211A Serial Server Device User Manual
2. HARDWARE INTRODUCTION
The HF2211 unit is a complete solution for serial port device connecting to network. This powerful
device supports a 10/100BASE-T Ethernet connection, a reliable and proven operating system stored
in flash memory, an embedded web server, a full TCP/IP protocol stack,and standards-based (AES)
encryption.
Through Ethernet cable connect router with HF2211 serial server for data transfer, which makes the
P
data transformation very simple. HF2211 meet EMC Class B security level,It can pass every countries
relevant certification test
O
SH
RK
O
W
http://www.iotworkshop.com - 11 -
HF2211A Serial Server Device User Manual
P
O
SH
RK
O
W
T
IO
http://www.iotworkshop.com - 12 -
HF2211A Serial Server Device User Manual
P
Table 2. HF2211 Interface Definition
O
External RJ45 Ethernet 10/100M Ethernet
Interface SMA Antenna SMA Interface
SH
RS232 RS232 Communication
RS485/RS422 RS485/RS422 Communicaton
Earth Protect Earth
DC Input DC Power 5~36V Input or 9~50VDC
RK
LED Internal Power Supply Indicator
Indicator Power On:Power is OK
Off:Power is NG
Connection Indicator
O
Device serial port is male(needle), RS232 voltage level(can connect to PC directly), Pin Order is
cosistent with PC COM port. Use cross Cable connected with PC(2-3 cross, 7-8 cross, 5-5 direct, 7-8
no connection), see the following table for pin defination.
http://www.iotworkshop.com - 13 -
HF2211A Serial Server Device User Manual
P
3 TXD Send Data
5 GND GND
O
7 RTS Request to Send
8 CTS Clear to Send
SH
2.3. RS485 Interface
RS485 use two wire links, A(DATA+), B(DATA-). Connect A(+) to A(+), B(-) to B(-) for communication.
RK
The RS485 interface support maximum 32 485 device, special hardware version can support max 255
device. The cable maximum length is 1200 meters. Need to add 120Ohm terminal resistor for over
300 meters.
O
RS422 interface use T+/T-/R+/R-, cross connect to device as the following picture.
W
Name Description
TX+ Transfer Data+
TX- Transfer Data-
RX+ Receive Data+
T
http://www.iotworkshop.com - 14 -
HF2211A Serial Server Device User Manual
Ethernet port is 10M/100M adaptive, support AUTO MDI/MDIX which means it support direct
connecting to PC with Ethernet cable.
P
Table 4. RJ45 Interface
O
Pin Number Name Description
1 TX+ Transfer Data+
2 TX- Transfer Data-
SH
3 RX+ Receive Data+
4 PHY-VCC Transformer Tap Voltage
5 PHY-VCC Transformer Tap Voltage
6 RX- Receive Data-
RK
7 N.C. None Connect
8 N.C. None Connect
http://www.iotworkshop.com - 15 -
HF2211A Serial Server Device User Manual
P
O
Figure 8. HF2211 Rail
SH
Base on customer detailed requirement, HF2211 provide different configuration version, Details as
below:
RK
O
W
T
1 * HF2211
1 * 12V/1A DC adapter
1 * RS232 cable
1 * Ethernet cable
1 * SMA Antenna
http://www.iotworkshop.com - 16 -
HF2211A Serial Server Device User Manual
3. FUNCTIONAL DESCRIPTION
The HF2211 has the following feature:
Connect customer’s device with PC or server via TCP/UDP/Telnet.
Contain a HTTP web server allow user to configure through browser with PC or phone.
Have multi-programmable I/O pins used to monitor or control device directly.
P
The HF2211 device uses the IP address for network communications. If uses the TCP to assure that
O
no data is lost or duplicated. If use UDP to assure that data can be fast and effective to Destination
address.
SH
Supported protocols include:
ARP, UDP, TCP, ICMP, DHCP, Telnet, DHCP, HTTP Server/Client Web socket
Telnet command configuration, Web server configuration
Security Protocol: TLS, AES, DES3 encryption
HF2211
RK
Protocols Security Configuration
Web
DHCP DNS/DDNS SSL/TLS
CLI
Application IGMP TCP/IP AES
Telnet
Programming WebSocket HTTP DES
O
Log
Interface
TCP/UDP
IP/ICMP
W
Ethernet
FreeRTOS OS Drivers
Cortex-M3 MCU
HF2211 can be set as a wireless STA and AP as well. And logically, it supports two wireless interfaces,
one is used as STA and the other is AP. Other STA devices can join into the wireless network through
AP interface. So the it can provide flexible networking method and network topology. Functions is as
follow:
http://www.iotworkshop.com - 17 -
HF2211A Serial Server Device User Manual
<Introductions>
P
AP: Wireless access point which is the central joint. Usually, wireless router is a AP, other STA
O
devices can connect with AP to join the network.
STA: Wireless station which is terminal of a wireless network. Such as laptop and pad etc.
SH
3.2.1. AP Network
HF2211 can construct a wireless network as AP. All the STA devices will consider the AP as the
centre of the wireless network. The mutual communication can be transponded by AP,shown as follow:
RK
O
W
T
IO
http://www.iotworkshop.com - 18 -
HF2211A Serial Server Device User Manual
Take the following picture as example. When router works in AP mode, HF2211 connects to the
user’s devices by RS232/RS485 interface. In this topology, the whole wireless network can be easily
stretched.
P
O
SH
RK
O
W
T
HF2211 can support AP+STA method. It can support AP and STA interface at the same time.Shown
as follow:
http://www.iotworkshop.com - 19 -
HF2211A Serial Server Device User Manual
P
O
SH
RK
O
W
In this picture, HF2211 open the AP+STA function and the STA interface can be connected to the
T
remote server by the router. Similarly, the AP interface can also be used. Phone/PAD can be
connected to the AP interface and to control the serial devices or set itself.
IO
Through AP+STA function, it is convenient to use Phone/PAD to monitor the user’s devices and not
change its original settings.
Through AP+STA function, it is convenient to configure the product.And it solves the problem that the
formal product can only configure by serial port.
Notes that:
When the AP+STA function is opened, the STA interface needs to connect to other router. Otherwise,
STA interface will endlessly scan the router information nearby. When it is scanning, it will bring bad
effects to the AP interface, like losing data etc.
http://www.iotworkshop.com - 20 -
HF2211A Serial Server Device User Manual
P
O
SH
RK
O
W
Notes:
IO
Open the IOTManager after connect to the AP hotspot generated by HF2211 and configure the
parameter.
http://www.iotworkshop.com - 21 -
HF2211A Serial Server Device User Manual
P
O
SH
RK
Figure 16. Configure Wi-Fi Parameter
O
W
T
IO
Use PC to connect with HF2211 through its AP hotspot or Ethernet connection. Type the default
IP(10.10.100.254, default username and password: admin/admin) to login the webpage to configure
the parameter.
http://www.iotworkshop.com - 22 -
HF2211A Serial Server Device User Manual
P
O
SH
Figure 18. Configure the Wi-Fi Parameter
RK
O
W
T
HF2211 provides with a 100M Ethernet interface. Through the 100M Ethernet interface, user can
achieve the connection among WIFI, serial port and Ethernet port.
http://www.iotworkshop.com - 23 -
HF2211A Serial Server Device User Manual
P
O
SH
RK
Figure 20. Ethernet Interface Function(AP)
HF2211 servers as AP and generate a central network. The IP addresses of all the devices and
O
The HF2211 device Ethernet interface work in router mode. When connect to router, it will get IP
address from router(as picture 192.168.1.100). The product itself generate a subnet(10.10.100.254
default). The device from the Ethernet interface is assigned with IP address by module
(10.10.100.101 ).Then the device and the PC1 are in the same subnet for network communication. A
connection fro PC1 to PC2, but PC2 cannot actively connect to PC1.
http://www.iotworkshop.com - 24 -
HF2211A Serial Server Device User Manual
The HF2211 device Ethernet interface work in router mode. When connect to router, it will get IP
P
address from router(as picture 192.168.1.101). AT the whole network, the product is like an invisible
device. PC1 ad PC2 can communicated mutually without any constraint. But if product needs to
O
connect with other devices, it needs set LAN IP address(192.168.1.10 as picture)
Notes:
SH
Webpage, IOTManager, or Cli command to set working mode, by default is router mode.
The HF2211 Device support transparent transmission mode of serial interface, In this mode, User
only need to set some necessary parameter(network communication parameter). After power on, the
O
device can auto connect to default socket setting(TCP/UDP). Use web page or PC IOTManager
software to set commucation parameter.
W
T
IO
http://www.iotworkshop.com - 25 -
HF2211A Serial Server Device User Manual
Upload data flow: All the different TCP connection or the Client’s data will be continuously transmitter
to UART.
P
Download data flow: All data received from UART will be copied and broadcast to every TCP client.
O
Detailed multiple TCP connection structure drawing as below:
SH
RK
Figure 24. TCP Server data transmission example
O
The device support max 5 Socket channel, each socket can work individual at TCP/UDP, Multi Socket
simultaneous communication of data stream is as following.
W
T
Multi Socket can be created through software configure or webpage configure. The below set up 3
socket channel.
http://www.iotworkshop.com - 26 -
HF2211A Serial Server Device User Manual
P
O
Figure 26. Webpage set up multi Socket channel
SH
3.4.3. HTTP Mode
HF2211 device support sending data in HTTP format to HTTP server(Set product working mode by
IOTManager software or webpage). When device socket works in HTTP mode, All received UART
data will automaticly transform to HTTP format(add HTTP header) and transmit to HTTP server. For
RK
the received HTTP data from HTTP server, will automatically remove HTTP header and only output
the data packet to UART.
O
W
T
IO
http://www.iotworkshop.com - 27 -
HF2211A Serial Server Device User Manual
P
O
Figure 28. Web Page Configure
SH
HF2211 UART received“pppp”data, send below data to HTTP Server.
GET /abcdefg HTTP/1.1
api-key: A4hQnojCHf8PurykvCHvsQ4JCMM=
RK
pppp
HTTP Server send below data, HF2211 serial output“abcde”
GET /abcdefg HTTP/1.1
api-key: A4hQnojCHf8PurykvCHvsQ4JCMM=
O
abcde
W
T
IO
http://www.iotworkshop.com - 28 -
HF2211A Serial Server Device User Manual
When device work in Telnetd mode, UART port can connect to user device console port(some
gateway and switch device may have this console port to set parameters of its working mode). May
use HF2211 to config user device via Telnetd mode.
P
O
SH
RK
Figure 30. IOTManager Software Configure Protocol
O
W
Connect device UART to user device console port(The example use NC916) and create Telnet
T
http://www.iotworkshop.com - 29 -
HF2211A Serial Server Device User Manual
P
O
SH
Figure 32. Telnet details example
http://www.iotworkshop.com - 30 -
HF2211A Serial Server Device User Manual
3.6. Keepalive
When TCP connection between device and server became abnormal. The device will check the
P
obnormal status and reconnect to server ( when the device working in TCP Client Mode), When the
device working in TCP Server, It will break the TCP client and wait for next connection.
O
SH
RK
O
3.7. Timeout
The device will break the TCP connection after some time(default is 300 seconds and it can be
T
modified)if there is no data packet received from Destination TCP target . It will reconnect to
server(When device works in TCP Client mode). When device working in TCP Server, It will
IO
disconnect with TCP Clien. This mechanism can effectively restore TCP abnormal connection.If set it
to “0”, this function will be close.
http://www.iotworkshop.com - 31 -
HF2211A Serial Server Device User Manual
P
3.8. Route Setup
O
The data received from Socket channel can be set to another socket channel. (Default: socket
Destination channel is UART, It also can be other Socket channel, Or take the Socket as log print
SH
usage)
The below example shows the default netp Socket channel route setting to Socket1, Socket1
configure as TCP Server mode and route setting to UART. So the netp Socket channel received
UART data will output to Socket1, and Socket1 channel will output to serial output.
RK
O
W
T
IO
http://www.iotworkshop.com - 32 -
HF2211A Serial Server Device User Manual
P
3.9.1. UART Free-Frame
O
HF2211 support UART Free-Frame function, If user select to open this function,Module will check the
intervals between any two bytes when receiving UART data, If the interval time exceed the setting
SH
value, It will think it as the end of one frame, Or it will receive data until greater than internal buffer
bytes( Default: 512, the largest 1400 bytes), then transfer to Socket Channel.
Module default UART Free-Frame interval time is 50ms, it will packaged into another frame if received
UART data interval time is greater than 50ms. User also can set this interval time to minimum 10ms
RK
through Cli command and webpage.
If interval time is set to 10ms and customer MCU cannot send next byte within 10ms, The serial data
will be break into two frame.
O
W
HF2211 support UART Auto-Frame function, If user select to open this function,setting frame tigger
IO
length and auto frame trigger time parameters, Then the product will auto framing the data which
received from UART port and transmitting to the network as pre-defined data structure.
Auto-Frame trigger length: The fixed data length that product used to transmitting to the network.
Auto-Frame trigger time: After the trigger time, If UART port received data cann’t reach auto-frame
trigger length, Then product will transmitting available data to network and bypass the auto-frame
trigger length condition.
http://www.iotworkshop.com - 33 -
HF2211A Serial Server Device User Manual
P
O
SH
RK
Figure 41. UART Auto-Frame Function
Eport E10 support lable function, If user select to open this function, The UART port will send all
suitable one frame data to network.
W
T
IO
HF2211 support ModbusRTU to ModbusTCP and ModbusTCP to ModbusRTU. It’s very convenient to
connect with Modbus device. Modbus protocol setting as below:
http://www.iotworkshop.com - 34 -
HF2211A Serial Server Device User Manual
P
Cli command is used for setting module configure parameters. Detailed command function and setting
is in next chapter, Cli command can be set through UART port or Telnet function (Appendix C), The
O
waiting time of below picture means use timeout time. If it exceed default 300s when no Cli command
is input, it will exit Cli command mode. When the HF2211 receive continuous UART data of “+++”, it
will enter into Cli command. ( The device working in transparent transmission mode by default) May
SH
also set the device working in Cli command mode by default or disable this function .
RK
O
W
HF2211 support software and hardware UART flow control. If use hardware follow control, must use
RS232 interface. If use software follow control, then It allowed the device output UART data after
IO
receive single UART 0x11 data(Default: value can be modified). It will stop output UART data after
receive single UART 0x13 data(Default: value can be modified).
http://www.iotworkshop.com - 35 -
HF2211A Serial Server Device User Manual
If set to “Half Duplex”, the product enable RS485 interface. The flow control by default is set as
“Disable”, it need to use RS485, set it to “Half Duplex” as the following picture.
P
HF2211 support OTA(over the air) firmware upgrade. User can use webpage to upgrade its firmware,
O
whether external or internal webpage(192.168.0.101/hide. Internal webpage can be used for upgrade
external webpage). Please check below example. IP address is assigned by router.
SH
RK
O
W
http://www.iotworkshop.com - 36 -
HF2211A Serial Server Device User Manual
P
3.15. Auto-IP Function
O
Connect device Ethernet with PC, the device will use default auto IP. The PC may use this IP to
config the device or transfer data(PC will need about 15 seconds to use default 169.254.xxx.xxx IP,
SH
then this communication can be created). As the following example, 169.254.173.207(If occure IP
conflict, it will use other ip instead)
RK
O
Support NTP function(default is disabled). Support set NTP server, port, time zone information, more
detailed usage see application document of “UART Fast Config”.(112.124.43.15 is High-Flying test
NTP server)
T
IO
http://www.iotworkshop.com - 37 -
HF2211A Serial Server Device User Manual
P
Figure 52. Cli Command NTP Setting and Query
O
3.17. Heartbeat Function
Support heartbeat function, can set the heartbeat time and content(heartbeat time is the same as
SH
keepalive setting), if the product does not receive data from TCP server within heartbeat time, it will
send heartbeat to server. The heartbeat function can only be enabled when socket is set as TCP client.
RK
O
Product support Cli command to config its parameters, but also support special HEX format UART
data for fast config, see application manual for detailed usage.
T
The HF2211 device parameters can be exported and loaded into other equipment..
http://www.iotworkshop.com - 38 -
HF2211A Serial Server Device User Manual
P
O
Figure 54. Other Function
SH
RK
O
W
T
IO
http://www.iotworkshop.com - 39 -
HF2211A Serial Server Device User Manual
The device will enter into default transparent transmission mode after powered on. User can switch to
Cli command mode through special UART data. Module default UART parameters are as below:
P
O
SH
RK
O
In Command mode, User can use UART port to set module through Cli command.
Notes:
T
Steps:
Input “+++” via UART tools, the device will output “EPORT>” after received“+++”. Then the
device already enters into Cli command mode.
Notes:
”+++” should be in one frame. Other data is not allowed before or after “+++”
http://www.iotworkshop.com - 40 -
HF2211A Serial Server Device User Manual
P
O
<Notes>: SH
Figure 56. Switch Transparent Transmission Mode to Cli Command Mode
RK
In Cli command mode, users can set or query parameters. Cli command details see next chapter
Cli command can be input through terminal (SecureCRT or other UART tools) or by user device MCU
programming. As below picture, we use SecureCRT tool. Press “Tab” key, it will list current available
Cli command or directory. If intput first character and then press “Tab” key, it will show the Cli
W
http://www.iotworkshop.com - 41 -
HF2211A Serial Server Device User Manual
P
O
SH
RK
Figure 58. Cli Command SYS Tree
O
W
T
IO
http://www.iotworkshop.com - 42 -
HF2211A Serial Server Device User Manual
P
O
SH
RK
O
W
T
IO
http://www.iotworkshop.com - 43 -
HF2211A Serial Server Device User Manual
P
Cli command is in ASCII format. The usage is similar to Linux terminal. Command format as following:
Format Notes
O
< >: Cli command name or directory.
[ ]: Cli command parameters.
SH
Command Message
<CMD> [para-2 para-3 para-4…]<CR>
<CMD>: Main directory or command name;
[para-n] : command parameters. If have multiple directory, it can also can be the son
directory. As below example;
RK
<CR>: Command Terminator, “Enter” key, HEX data: 0x0a or 0x0d
<Notes>
If the input command not existed, UART will output again “EPORT>” to allow next command input.
O
If need enter into son directory, press “space” key between the directorys.
T
If need to display all the directory or commands in the current directory, press “Tab” key to query.
IO
http://www.iotworkshop.com - 44 -
HF2211A Serial Server Device User Manual
Show [SYS/UART/SOCK]
Parameter:
Show all information if no parameters. Parameter can be one of the following:
SYS: System running status
UART: UART status
SOCK: Socket status
P
O
4.2.1.2.
SYS Directory
SH
Function: Display/Set all system related information
RK
Format:
Tab Query
O
detail)
Format:
Tab Query
T
Function: Display/Set web or Telnet Cli command login user name. (function see
appendix)
Format:
Query
<User>
Set
<User> [value]
Parameter:
Setting is valid immediately.
User: Login user name. Default: admin
http://www.iotworkshop.com - 45 -
HF2211A Serial Server Device User Manual
P
Setting is valid immediately
Password: Login password. Default: admin
value: set value. Length range 1~29 characters
O
4.2.1.6. SYS/Network Directory
SH
Function: Display/Set related network information.
Format:
Tab Query
RK
4.2.1.7. SYS/Network/Show Command
Function: Display network related information
Format:
O
Query
<Show>
Set
<DHCP> [Enable/Disable]
IO
Parameter:
Setting is valid after reboot.
Enable: Enable DHCP function. The device will get DHCP IP from router when
Ethernet port is connected to router LANN port. Default: Enable.
Disable: Disable DHCP function. Allocate device static IP address according to the
hit of intputting IP and gateway address.
http://www.iotworkshop.com - 46 -
HF2211A Serial Server Device User Manual
<DNS>
Set
<DNS> [IP]
Parameter:
When DHCP function is Disabled, this setting is valid. Setting is valid after reboot.
IP Address: DNS server address. Default: 10.10.100.254.
P
Query
<Mode>
Set
O
<Mode> [Router/Bridge]
Parameter:
SH
Setting is valid after reboot.
Router: Router mode, Default value.
Bridge: Bridge mode.
Set
<Hostname> [name]
Parameter:
W
Hostname is the name which show in router DHCP client list. Setting is valid
immediately.
Name Address: Hostname, length range: 1~30 characters. Default: HF2211.
Query
<Telnet>
Set
<Telnet> [Enable/Disable]
Parameter:
See appendix for detailed Telnet function usage. Telnet is used for remote send Cli
command or transmit data, Setting is valid after reboot.
Enable: Enable Telnet function. Default: Enable.
Input Port Numbver: Telnet Port Number. Default: 23
Input Echo Mode: Enable/Disable Cli command echo function. Default: Enable
http://www.iotworkshop.com - 47 -
HF2211A Serial Server Device User Manual
P
Webpage is used for config module working parameters. Setting is valid after reboot.
Enable: Enable Web config function. Default: Enable.
Input Port Number: Web Port Number. Default: 80
O
Disable: Disable Web config function
SH
Function: Display/Set MAC address.
Format:
Query
<MAC>
RK
Set
<MAC> [8888 value]
Parameter:
Global unique MAC Address. It is not allowed to modify it.
O
<JCMD> [Enable/Disable]
Parameter:
IO
Jason command is used for config module. IOTManage software use this mechanism. If
disable JCMD function, IOTManage is no longer valid. Setting is valid after reboot.
Enable: Enable JCMD function. Default: Enable.
Disable: Disable JCMD function.
http://www.iotworkshop.com - 48 -
HF2211A Serial Server Device User Manual
<NTP> [Enable/Disable]
Parameter:
NTP is used for product to get and output real time. See uart fast config application
manual to fast query. Setting is valid immediately.
Enable: Enable NTP Function.
NTP Server Address: NTP Server address, domain name or IP address
NTP Server Port: port number, Default:123, Range;0~127
GMT: Time zone, default is 0, Range:-12~12.
Disable Disable NTP Function, Default value.
P
Function: Display/Set UART information directory.
Format:
O
Tab key query
4.2.1.18.
UART/Show Instruction
SH
Function: Display UART information function.
RK
Format:
Query
<Show>
Query
<Baudrate>
Set
<Baudrate> [value]
Parameter:
T
230400, 460800
http://www.iotworkshop.com - 49 -
HF2211A Serial Server Device User Manual
P
Setting is valid immediately.
Value: Default: 1bits. Can choose 1, 1.5, 2.
O
4.2.1.22. UART/Parity Instruction
Function: Display/Set UART parity function.
SH
Format:
Query
<Parity>
Set
<Parity> [value]
RK
Parameter:
Setting is valid immediately.
Value: Default: None. Can choose NONE, EVEN, ODD.
Query
<Bufsize>
Set
<Bufsize> [value]
Parameter:
Buffer is used for cache UART received data. If the received data of one frame is larger
than buffer size. The data frame will be break into two packet send to network. Setting is
valid after reboot.
Value: Default: 512. Length range: 32~1400 bytes.
http://www.iotworkshop.com - 50 -
HF2211A Serial Server Device User Manual
P
Value: Default: 50ms. Length Range: 10~1000ms.
O
Function: Display/Set UART flow control function.
Format:
SH
Query
<FlowCtrl>
Set
<FlowCtrl> [Enable/Disable]
Parameter:
RK
Flow control includes software flow control and hardware flow control. Software flow
control priority is higher than hardware. If enable software flow control, the hardware
flow control pin(CTS/RTS) will be useless. Software flow control use special UART data
for control. Hardware flow control use CTS/RTS pin control. Setting is valid immediately.
O
Query
<SWFlowCtrl>
IO
Set
<SWFlowCtrl> [Enable/Disable]
Parameter:
Enable software flow control function. The device UART can output data After UART
received Xon single-byte enable data. When UART received Xoff single-byte disable
data. It will disable the device UART output data.
Enable: Enable software flow control function, When in enable status, it allow
UART data output when bootup by default.
Xon: Enable UART output data. Default: 0x11.
Xoff: Disable UART output data. Default: 0x13.
http://www.iotworkshop.com - 51 -
HF2211A Serial Server Device User Manual
P
Set Cli command parameters. Setting is valid immediately.
Serial-String: Enable specific data to enter into Cli command mode.
[Input Serail String]: Default: +++, Range1~10 bytes. Also can input hex
O
format data. The HEX data are separated by Spaces, Like【30 31 32 33 34】,
When it recieved string data “01234”, then It can enter into Cli command.
SH
Always: Always work in Cli command mode when device power on.
Disable: Disable Cli command mode. UART and Telnet both can’t use Cli
Command.
<Cli-WaitTime> [timeout]
Parameter:
Set Cli command mode timeout exit time. If there is no Cli command sent for the
W
waitfime, It will exit Cli command mode to transparent transmission, Setting is valid
immediately.
timeout: Default: 300s, Range 0: Disable WaitTime function, 1~300s.
Query
<Proto>
Set
<Proto> [NONE/Modbus/Frame]
Parameter:
Setting is valid immediately.
NONE: Default: None, transparent transmission, the received UART data will be
directly sent to network.
Modbus: Modbus RTU to Modbus TCP.
http://www.iotworkshop.com - 52 -
HF2211A Serial Server Device User Manual
P
Function: Display/Set UART auto-frame frame length
Format:
O
Query
<FrameLen>
SH
Set
<FrameLen> [value]
Parameter:
Set UART auto-frame length, Setting is valid immediately.
value: Default: 8, Range: 8~1400.
RK
4.2.1.33. UART/Frame/FrameTime Command
Function: Display/Set UART auto-frame time
Format:
O
Query
<FrameTime>
Set
W
<FrameTime> [value]
Parameter:
Set UART auto-frame time, Setting is valid immediately.
value: Default: 100ms, Range: 100~10000.
T
Format:
Query
<Tag>
Set
<Tag> [Enable/Disable]
Parameter:
Set UART auto-frame tag. Only transmit data from tag head to tag tail. Filter the other
datas. Setting is valid immediately.
Enable: Enable auto-frame tag function.
TagHead: LabelHead. Default: 0x55, Single byte data.
TagTail: LabelTail. Default: 0xAA, Single byte data.
http://www.iotworkshop.com - 53 -
HF2211A Serial Server Device User Manual
P
Function: Clear UART transmit-receive data information
Format:
O
Set
<Clean>
SH
Parameter:
Clear the UART data count(Data packet/Frame/Error packet and so on) shown in
webpage.
Netp and UDP are created socket channel. Itsupport maximum 5 Sockets.
http://www.iotworkshop.com - 54 -
HF2211A Serial Server Device User Manual
P
equipment.
TLS: Function is reserved. We will update it soon.
TCP Server Mode:
O
Input Local Port[0]: Set local port, Range 1~65535, 0 is random port. For
TCP Server and UDP application, set it to a fixed 1~65535(TCP port 80 is
SH
used for its webpage). For TCP Client application, usually set it to 0.
Input Buffer size[512]: Set Buffer size. Default: 512 bytes, Range:1~1400.
Input KeepAlive[60]: Set TCP keepalive, Heartbeat time, Defalut 60s,
Range: >=0.
Input Timeout[300]: Set TCP timeout, If exceed setted time and don’t received
RK
any network data package, It will break TCP connection. If working in TCP
client mode, it will reconnect immediately. If it work in TCP server mode, the
TCP client need to create the connction. Set this value to 0 is to close the
function. The function is used for TCP to restore abnormal connection.
O
Disable: No encryption
TLS: TLS1.2 encryptioin, only support in TCP client mode.
AES: AES encryption, TCP/UDP all support this.
DES3: DES3 encryption, TCP/UDP all support this.
Input key: AES or DES3 key. For AES encryptiont, the key is fixed
T
Bytes of key. The key can be ASCII or Hex format data. Hex format
data need to use “space” character as separator, ex, “01 02 03…”
Input Rout[uart]: Set the Socket channel output, Can choose UART and other
created Socket or use as Log print using.
TCP Client Mode ( Only list out difference)
Input Server Address: Set server IPv4 address or domain name.
Input Server Port: Set server port
Input Local Port[0]: Same as above
Input Buffer size[512]: Same as above
Input KeepAlive[60]: Same as above
http://www.iotworkshop.com - 55 -
HF2211A Serial Server Device User Manual
P
Input Stop Serial: Set Burst Mode Stop bits. It can be ASCII or Hex
format data, Hex format data need use space as separator , 1~10
bytes.
O
Input Rout[uart]: Same as above
UDP Server/ UDP Client
SH
HTTP Mode
Input HTTP type[POST]: HTTP request type. Default: POST. Can choose
POST or GET.
Input HTTP path[/]: HTTP request path, Need start by“/”. The longest byte is
63 bytes.
RK
Input HTTP version[1.0]: HTTP Protocol Version. Default: 1.0, Can choose
1.0 or 1.1
Input HTTP parameters: Add HTTP head information, end by “Enter” key.If
want to end the input, direct input “Enter” key. All HTTP header data length
O
Every created Socket channel can be modified through name. The above command
function is the same as New Socket command description
http://www.iotworkshop.com - 56 -
HF2211A Serial Server Device User Manual
The network data packets information can be checked from webpage. The command
will reset the data count.
Default: data sent in ASCII format. Also can change to send by HEX, The command is
P
used for Cli command mode to transfer data.
O
Function: Restart instruction.
Format:
SH
Set
<Restart>
Reload to factory setting, if add the following parameters, it will only restore
corresponding parameters. Parameter can including one of the below three:
SYS: Restore system setting relevant paramter
W
Format:
Tab query
IO
http://www.iotworkshop.com - 57 -
HF2211A Serial Server Device User Manual
P
Function: Display/Set WIFI work mode.
Format:
Query
O
<Mode>
Set
SH
<Mode> [AP/STA/APSTA]
Parameter:
Set WIFI work mode. Valid after restart.
AP mode: Default, AP mode
Input AP SSID:Input the name of AP, 1~31 characters
RK
Input AP Key:Input the password of AP, no password default, 8~63
characters.
STA:STA mode
Input STA SSID:Input the name of router, 1~31 character
O
http://www.iotworkshop.com - 58 -
HF2211A Serial Server Device User Manual
P
Format:
Set
<Exit>
O
SH
4.2.1.51. Quit Command
Function: Quit the current and go the father Cli command directory.
Format:
Set
RK
<Quit>
Format:
Set
FwUpgrade [url]
W
Parameter:
Do upgrade function, if upgrade success, it will feedback “Upgrade OK”, if fail, output
“Upgrade FAIL”, reboot to run with new firmware if success
url: firmware url resources, Ex: http://192.168.0.101/mfw.bin
T
IO
http://www.iotworkshop.com - 59 -
HF2211A Serial Server Device User Manual
APPENDIX A:REFERENCES
A.1.Test Tools
http://gb.hi-flying.com/downloadsfront.do?method=picker&flag=all&id=8c366199-b599-47a4-8d9c-
20fa0b68bfcf&fileId=89&v=0.zip
P
O
SH
RK
UART、Network Test software:
http://www.hi-
flying.com/download_list_dc/&downloadcategoryid=14&isMode=false&comp_stats=comp-
O
FrontDownloadsCategory_show01-1376450727769.html
http://www.hi-flying.com/products_detail/productId=95.html
T
IO
http://www.iotworkshop.com - 60 -
HF2211A Serial Server Device User Manual
B.2.Telnet Features:
P
a)Telnet support echo mode,
O
b)Telnet only support one Client port.
SH
d)Telnet connected with TCP, If Client port don’t transmit data in 300s, It will auto
disconnect.
RK
B.3.Telnet Usage:
Telnet function default as ON, If can’t connect, Pls use webpage or configuration to check the
function is on or off.
O
W
a)Configure Secure CRT module and connect parameter, Equipment need to connect
T
with LAN, Can use equipment LAN IP to access , If need remote to access the
IO
equipment, It need router have public IP address as port and mapped to internal
http://www.iotworkshop.com - 61 -
HF2211A Serial Server Device User Manual
P
O
SH
b)Use webpage account and password login in module, Then interface will show
RK
“EPORT>” .
O
W
T
IO
c)Later use are same as UART cli command, And can realise Telnet data with UART
http://www.iotworkshop.com - 62 -
HF2211A Serial Server Device User Manual
P
O
Telnet Software implementation principle:
SH
Step 1 Establish TCP connection with module
RK
Step 2 Module send “login”, Client port send user name(need end with Enter key,Tools
Step 3 Module send 0xFF 0xFB 0x01 Close telnet input display.
http://www.iotworkshop.com - 63 -
HF2211A Serial Server Device User Manual
Step 5 Module send 0xFF 0xFC 0x01 Open telnet input display
P
O
SH
RK
Step 6 It can send and receive Cli command After Enter into Cli command mode.
O
W
T
IO
http://www.iotworkshop.com - 64 -
HF2211A Serial Server Device User Manual
------------------------------------------------------------------------------------------------------------
Address: Room 1002,Building 1,No.3000,Longdong Avenue,Pudong New
Area,Shanghai,China,201203
Web: www.iotworkshop.com or www.hi-flying.com
Contact:
P
Sales: [email protected]
Support: [email protected]
O
Service: [email protected]
Business: [email protected]
---------------------------------------------------------------------------- -------------------------------
SH
For more information about IOTworkshop modules, applications, and solutions, please visit our web
site www.iotworkshop.com
RK
O
<END OF DOCUMENT>
W
T
IO
http://www.iotworkshop.com - 65 -