Hi-Link HLK-B32 User manual

Shenzhen HI-Link Electronic Co.,Ltd
HLK-B32 User Manual

Content
1. Product Profile ............................................................................................................................................................1
1.1 Overview ....................................................................................................................................................... 1
1.2 Product Characteristics ..................................................................................................................................1
1.3 Product Packaging .........................................................................................................................................1
1.4 Technical Specifications ................................................................................................................................2
1.5 Pins Introduction ........................................................................................................................................... 3
2. Functional Description ............................................................................................................................................... 4
2.1 WiFi Indicator Flashing Description .............................................................................................................4
2.2 Wifi Connection Status Indicator Pin ............................................................................................................5
2.3 Socket Connection Status Indicator Pin ........................................................................................................5
2.4 One-click Distribution Mode ........................................................................................................................ 5
2.5 Web Distribution Function ............................................................................................................................ 6
2.6 Serial to WIFI STA ........................................................................................................................................7
2.7 Serial Port Working State Conversion .......................................................................................................... 8
2.8 Serial Port-network Data Conversion........................................................................................................... 8
2.8.1 Module as TCP Server ......................................................................................................................... 8
2.8.2 Module as TCP Client........................................................................................................................ 9
2.8.3 Module as UDP Server .......................................................................................................................9
2.8.4 Module as UDP Client ..................................................................................................................... 10
2.9 Application Areas ...................................................................................................................................... 10
3. AT Instructions ..........................................................................................................................................................10
3.1 Query Current Module Version: at+ver .......................................................................................................11
3.2 Local Port Operation: at+CLport ................................................................................................................ 11
3.3 Set up Serial Port: at+uart ........................................................................................................................... 12
3.4 Set up DHCP: at+dhcpc .............................................................................................................................. 12
3.5 Set up Wifi Connection Mode: at+netmode ................................................................................................12
3.6 Set up TCP Connection Mode: at+mode .................................................................................................... 12
3.7 Set up Remote IP When Modules Work as Client: at+remoteip .................................................................13
3.8 Set up Remote Port When Module Act as Client: at+remoteport ...............................................................13
3.9 Set Parameter Submission: at+net_commit ................................................................................................ 13
3.10 System Restart: at+reconn .........................................................................................................................13
3.11 Set the Module's ssid and Password: at+wifi_conf ...................................................................................14
3.12 Set up Socket Connection Protocol: at+remotepro ...................................................................................14
3.13 Set Network Connection Parameters: at+net_ip .......................................................................................14
3.14 Query Network Connection Status in STA Mode: at+wifi_ConState ...................................................... 14
3.15 Query Module MAC Address: at+Get_MAC ...........................................................................................15
3.16 Set the Frame Length: at + uartpacklen ....................................................................................................... 15
4. Upgrade Introduction ............................................................................................................................................... 17
3.17 Set the Frame Time:at+uartpacktimeout

4.1 Introduction of Serial Port Upgrade Method .............................................................................................. 17
4.1.1 Open Serial Port Upgrade Software ....................................................................................................17
4.1.2 Start to Upgrade ............................................................................................................................... 18
4.2 Introduction of Network Upgrade Methods ................................................................................................18
4.2.1 Router Connection ...............................................................................................................................18
4.2.2 Lookup Module IP ........................................................................................................................... 18
5.Electrical Specification .............................................................................................................................................21
5.1 Electric Parameter .......................................................................................................................................... 21
5.2 Current Waveform ..........................................................................................................................................21
5.2.1 STA Mode ............................................................................................................................................24
5.2.1 Smart C Mode ..................................................................................................................................... 25
6.Appendix A Document Revision ...........................................................................................................................25
3.17 Set the Frame Time:at+uartpacktimeout3.17 Set the Frame Time:at+uartpacktimeout
3.17 Set the Frame Time:at+uartpacktimeout3.17 Set the Frame Time:at+uartpacktimeout3.17 Set the Frame Time:at+uartpacktimeout3.17 Set the Frame Time:at+uartpacktimeout

1
1. Product Profile
1.1 Overview
HLK-B32 is a new low-cost embedded UART-WIFI module (serial-Wireless network)
developed by Shenzhen Hi-Link co., Ltd.
This product is an embedded module based on the serial interface in line with the network
standard , built-in TCP/IP protocol stack, can realize the user serial port-wireless network (WIFI)
conversion.
Through the HLK-B32 module, the traditional serial device can transmit its own data
through the Internet network without changing any configuration, which provides a complete and
fast solution for the user's serial port device to transmit the data through the network.
1.2 Product Characteristics
Compatible 2.4G 802.11 b/g/n; 5G 802.11 a
Dedicated high-performance 32-bit RISC CPU
Support for 20 MHz and 40MHz bandwidth in the 2.4 GHz band
Single frequency 1T1R mode, data rate up to 150Mbps
Support for 2.4g/ 5 GHz band, dual frequency 1T1R
Support two working modes of STA/AP
Built-in TCP/IP protocol stack
Support various AT instructions
Support one-click configuration of intelligent networking features
Support wireless upgrade (OTA)
5V single power supply, low power consumption
More GPIO pins
Fast transmission speed of serial port
1.3 Product Packaging
Figure 1. HLK-B32encapsulation size

2
1.4 Technical Specifications
Table 1 Product Technical specifications
Module
Model HLK-B32
Package Plug-in
Wireless
parameter
Wireless standard 2.4G 802.11 b/g/n; 5G 802.11 a
Frequency range
Transmitting power
802.11b: 15.85dBm (@1Mbps)
802.11g: 16.85dBm (@6Mbps)
802.11a:
Receiving sensitivity
802.11b: -88.4 dBm (@11Mbps ,CCK)
802.11g: -75.7dBm (@54Mbps, OFDM)
802.11n: -73.6dBm (@HT20, MCS7)
802.11a: -75.0 dBm (@MCS7)
Antenna form
External:
'LSROH$QWHQQD
Built-in: no built-in antenna
Hardware
parameters
Hardware interface UART, IIC, PWM, GPIO, SPI
Working voltage 5V
GPIO drive capability Max:16ma
Working current
Continuous send=>
Average value: ~100mA, peak value:120mA
In normal mode =>
Average: ~100mA, Peak: 110mA
Working temperature -40℃~80℃
Storage environment Temperature: <40℃, The relative humidity: <90% R.H.
Serial
transmission
Transmission speed 110-921600bps
TCP Client 2
Software
parameters
Wireless network type STA
Security mechanism WEP/WPA-PSK/WPA2-PSK
Encryption type WEP64/WEP128/TKIP/AES
Firmware upgrade Wireless, uart
networking protocol IPv4, TCP/UDP
User configuration AT+instruction, smart config
802.11n20: 13.69dBm; 802.11n40: 12.16dBm
5150-5250MHz: 11.78dBm;5250-5350MHz: 14.28dBm;
5470-5725MHz: 15.35dBm;5725-5850MHz: 11.74dBm;
2.4G wifi: 2412MHz-2462MHz;
5G Wi-Fi: 5150-5250MHz; 5250-5350MHz; 5470-5725MHz; 5725-5850MHz

3
1.5 Pins Introduction
Table 2 Module pin interface
Pin
Network Name
Type
Description
1
NC
NC
2
NC
NC
3
NC
NC
4
NC
NC
5
NC
NC
6
NC
NC
7
NC
NC
8
GND
Ground
GND
9
NC
NC
10
3V3
P
External power supply pin: 3.3V@ 200mA
11
NC
NC
12
NC
NC
13
NC
NC
14
NC
NC
15
NC
NC
16
GPIO0
I/O
ES0 pin, pull down 1 second, serial 0 into AT command mode;
Pull down ≥ 8 seconds, restore factory default parameter settings
17
NC
NC
18
NC
NC
19
NC
NC
20
NC
NC
21
NC
NC
22
NC
NC
23
NC
NC
24
NC
NC
25
NC
NC
26
NC
NC
27
NC
NC
28
NC
NC
29
NC
NC
30
NC
NC
31
NC
NC

4
2. Functional Description
2.1 WiFi Indicator Flashing Description
The module is flashed by the LED indicator in different modes, so that the module running
status can be quickly and easily known. The WiFi indicator of the module mainly has the following
status:
(1) The wifi indicator flashes twice periodically: indicates that the module is in the
one-click distribution mode.
(2) The wifi indicator flashes thirdly periodically: indicates that the module is in the sta
32
NC
NC
33
NC
NC
34
NC
NC
35
GPIO59
SOCKET connection status indication
36
GPIO58
WIFI connection status indication
37
NC
NC
38
UART_RXD0
Serial port 0 input for transparent transmission and at command
setting
39
UART_TXD0
Serial port 0 output, used for transparent transmission and at
command setting, need to be pulled low or left hanging
40
UART_RXD1
Serial port 1 input
41
NC
NC
42
SYS_RST_N
I
RST pin, module reset, active low, reset time ≥ 500ms
43
NC
NC
44
UART_TXD1
Serial port 1 output
45
NC
NC
46
VDD_5V
P
5V input
47
NC
NC
48
NC
NC
49
GPIO33
Wifi indicator
50
GND
Ground
Ground
51
NC
NC
52
NC
NC

5
mode and the target ap hotspot is not connected.
(3) The wifi indicator flashes fourthly periodically: indicates that the module is in 2.4g ap
mode, but it does not indicate whether there is a sta client device connected.
(4) The wifi indicator flashes periodically: indicates that the module is in the 5.8g ap mode,
but it does not indicate whether there is a sta client device connected.
(5) The wifi indicator flashes quickly: indicates that the module is in the sta mode and is
connected to the wifi hotspot. When there is data transmission, the module LED will flash
quickly.
2.2 Wifi Connection Status Indicator Pin
GPIO58 pin is used as the indicator pin of the module’s wifi connection status in sta mode.
When the module's wifi is connected to the router, GPIO58 will output a high level, otherwise will
output low level, and other modes will output low level.
2.3 Socket Connection Status Indicator Pin
The GPIO59 pin is used as the indicator pin of the module socket's connection status. When the
socket connection is successful, the GPIO outputs a high level, otherwise outputs low level.
2.4 One-click Distribution Mode
For the IOT wifi module, based on cost and performance considerations, there is no touch
screen interactive interface like a mobile phone. Users can see the ap list on the mobile phone and
click the password to connect to the network. What should I do? One-click configuration is the wifi
module in promiscuous mode (can capture all 802.11 frames in the air), APP sends the SSID and
password to the wifi module through UDP broadcast or multicast through certain encoding rules, the
module parses out, and then connects to the router.
Install the Android app HLK-TCPdemo, then select Configure Networking, select the elian
mode, then select V5, input the password, click to open the configuration and start the configuration.
When the distribution network is successful, the module will change from double flash to quick flash,
indicating network successful connected.

6
Figure 2. One-click distribution network
2.5 Web Distribution Function
When the module is in ap mode, input 192.168.16.254 in the browser, and then input the account
and password admin, later enter the web page setting interface. (Default factory firmware is not
supported)
Figure 3. Module web page setting interface
When the module is in the sta mode, input the module's ip in the browser to access to the

7
module's web page setup function.
2.6 Serial to WIFI STA
Figure 4. Module as STA
The module converts the serial port data into wifi data to achieve the purpose of networking.

8
2.7 Serial Port Working State Conversion
After the HLK-B32 is powered on, the default mode is transmission mode. By pulling down the
pin ES0 (GPIO0) to enter at instruction mode longer than 50ms, the module will process the
received data as at instructions, send at instructions to let the module into transparent mode, After the
network connection, the data received by the serial port will be transmitted as transparent data.
Figure 6. Serial port mode conversion
2.8 Serial Port-network Data Conversion
2.8.1 Module as TCP Server
Figure 7. TCP Server
In this mode, the module listens to the specified port, waits for TCP Client connection, and after the
connection, all TCP data is directly sent to the serial port end, and the data of the serial port end is sent to all TCP
Client ends. When the module is used as the TCP server, the most supporting two TCP clients are connected to the
TCP server.
AT mode
Power on
Transparent mode
Pull down es0 pin
Send at command
TCP Server
TCP Client
TCP Client
TCP Client

9
2.8.2 Module as TCP Client
Figure 10. TCP Client
In this mode, the module will actively connect to the specified IP, port, all the data sent from the
TCP Server end is sent directly to the serial port, and the data from the serial port to the TCP Server
side. Abnormal network disconnection can result in active re-connection of the module.
2.8.3 Module as UDP Server
Figure 11. UDP Server
In this mode, the module opens the local designated port, once it receives the data sent to the
port, the module sends the data to the serial port and records the remote ip, port. The module only
records the remote information on the last connection, and the data sent by the serial port is sent
directly to the recorded remote ip, port.
TCP Server
TCP Client
UDP Client
UDP Server

10
2.8.4 Module as UDP Client
Figure 12. UDP Client
In this mode, the module sends the serial port data directly to the specified ip, port, and the data
returned from the server will be sent to the serial port.
2.9 Application Areas
Smart home;
Instruments and instruments;
Wi-Fi remote monitoring / control;
Toy field;
Color LED control;
Fire protection, security intelligent integrated management;
Smart card terminals, wireless POS machines, handheld devices and so on.
3. AT Instructions
The AT command mode is displayed
ES/RST pin:
In any state, keeping GPIO0 pin (pin 16) low for a time greater than Tes(50ms) and less than Trst(3s) will
immediately enter the AT command mode.
UDP Server
UDP Client

11
Figure 13. ES/RST Exits transparent transmission mode
Instruction format: in AT instruction mode, the system can be configured through the AT
instructions of the serial port. The command format is as follows:
at+[command]=[value],[value],[value]......
All commands begin with "at" and "\ r" end. If the command is not encapsulated in this format,
it will not be processed and will return a different return value depending on the command module.
For example:“at+ver=?”
Module will return: HLK-B32 (V1.00 (Nov 30 2017)
Query instruction format: at+[command]=?
3.1 Query Current Module Version: at+ver
Grammatical rules:
Command type
Grammar
Return and description
EO
at+ver=?
at+ver=HLK-B32(V1.00(Nov 30 2017)): current version
3.2 Local Port Operation: at+CLport
Command type
Grammar
Return and description
EO
at+CLport=8080
at+CLport=8080
Ok
Description: set the local port to port 8080
at+CLport=?
at+CLport=?
8080
Description: Query local port

12
3.3 Set up Serial Port: at+uart
Command Type
Grammar
Return and description
EO
at+uart=115200,8,n,1
at+uart=115200,8,n,1
Ok
Description: Set up serial Port parameters
Query Command
at+uart=?
at+uart=?
115200,8,n,1
Description:query serial port parameters
3.4 Set up DHCP: at+dhcpc
Command Type
Grammar
Return and description
EO
at+dhcpc=1
at+dhcpc=1
ok
Query Command
at+dhcpc=?
at+dhcpc=?
1
Description: 1: dhcp mode, 0: static ip
3.5 Set up Wifi Connection Mode: at+netmode
Command Type
Grammar
Return and description
EO
at+netmode=3
at+netmode=3
Ok
Description: set the module to ap mode
Query Command
at+netmode=?
at+netmode=?
3
Description: 1: One-click distribution network 2: sta
mode, 3: 2.4G ap mode, 4: 5.8G ap mode
3.6 Set up TCP Connection Mode: at+mode
Command Type
Grammar
Return and description
EO
at+mode=client
at+mode=client
Ok
Description: set the module to client mode
Query Command
at+mode=?
at+mode=?
client
Description: client: server:

13
3.7 Set up Remote IP When Modules Work as Client: at+remoteip
Command Type
Grammar
Return and description
EO
at+remoteip=192.168.11.102
at+remoteip=192.168.11.102
ok
Description: set the remote ip of the mode
Query Command
at+remoteip=?
at+remoteip=?
192.168.11.102
Description: query remote ip
3.8 Set up Remote Port When Module Act as Client: at+remoteport
Command Type
Grammar
Return and description
EO
at+remoteport=1234
at+remoteport=1234
ok
Description: set the remote port of the mode
Query Command
at+remoteport=?
at+remoteport=?
1234
Description:query remote port
3.9 Set Parameter Submission: at+net_commit
Command Type
Grammar
Return and description
EO
at+net_commit=1
at+net_commit=1
Ok
Description: submit setup parameters
3.10 System Restart: at+reconn
Command Type
Grammar
Return and description
EO
at+reconn=1
at+reconn=1
Description: Quit at command mode
EO
at+net_commit=1
at+reconn=1
at+net_commit=1
ok
at+reconn=1
ok
Description: System restart

14
3.11 Set the Module's ssid and Password: at+wifi_conf
Command Type
Grammar
Return and description
EO
at+wifi_conf=HI-LINK_5FE8,n
one,12345678
at+wifi_conf=HI-LINK_5FE8,none,12345678
ok
Description: set the ssid and password of the module
Query Command
at+wifi_conf=?
at+wifi_conf=?
HI-LINK_5FE8,none,12345678
Description: Query the ssid and password of the module
3.12 Set up Socket Connection Protocol: at+remotepro
Command Type
Grammar
Return and description
EO
at+remotepro=tcp
at+remotepro=tcp
ok
Description: set the module socket protocol to tcp
Query Command
at+remotepro=?
at+remotepro=?
tcp
Description: query module socket connection protocol
3.13 Set Network Connection Parameters: at+net_ip
Command Type
Grammar
Return and description
EO
at+net_ip=192.168.16.254,255.
255.255.0,192.168.16.254
at+net_ip=192.168.16.254,255.255.255.0,192.168.16.254
ok
Description: set the ip, gateway, dns of the module
Query Command
at+net_ip=?
at+net_ip=?
192.168.16.254,255.255.255.0,192.168.16.254
Description: query module ip, gateway, dns
3.14 Query Network Connection Status in STA Mode: at+wifi_ConState
Command Type
Grammar
Return and description
Query Command
at+wifi_ConState=?
at+wifi_ConState=?
Disconnected
Description: in sta mode, the module wifi is not connected, and the
Connected indicates that the network is connected

15
3.15 Query Module MAC Address: at+Get_MAC
Command Type
Grammar
Return and description
Query Command
at+Get_MAC=?
40:D6:3C:15:5F:E8
at+Get_MAC=?
40:D6:3C:15:5F:E8
Description: query module mac address
3.16 Set the Frame Length: at + uartpacklen
Command Type
Grammar
Return and description
EO
at+uartpacklen=64
at+uartpacklen=64
Ok
Description:Set the frame length of the module to 64 bytes
Query Command
at+uartpacklen=?
at+uartpacklen=?
64
Description:The frame length of the query module is 64 bytes
3.17 Set the Frame Time:at+uartpacktimeout
Command Type
Grammar
Return and description
EO
at+uartpacktimeout=200
at+uartpacktimeout=200
Ok
Description:Set the frame time of the module to 200ms
Query Command
at+uartpacktimeout=?
at+uartpacktimeout=?
200
Description:The frame grouping time of the query module is 200ms

17
4.
Upgrade Introduction
The upgrade of HLK-B32 module can be carried out through serial port or network, and the
appropriate upgrade method can be selected according to the field environment.
4.1 Introduction of Serial Port Upgrade Method
In the upgrade folder there is a img file, upgrade software mainly read the files inside to
upgrade; There are three files in the img folder, where HLK-B32.img and HLK-B32
(b.1.00.1 20180611182552). Img file contents are the same, only file names are different,
HLK-B32 (b.1.00.120180611182552). Txt records the default parameter for this firmware; HLK-
B32 (b.1.00.120180611182) 552) "is the firmware version number, when the module runs this
firmware query version number and this version number the same, each firmware has a unique
version number, automatically generated by the compilation system; When there is a new firmware
to upgrade, the three files can be overwritten.
4.1.1 Open Serial Port Upgrade Software
Open serial port upgrade software HLK-B32_uart.exe, input lowercase string c, select
serial port number, select the corresponding baud rate through digital key 1 / 2 / 3 / 4

18
4.2 Introduction of Network Upgrade Methods
In order to realize the network upgrade of the module, it is necessary to connect the line module
through wifi, and then to upgrade the data transmission according to the ip of the module.
4.2.1 Router Connection
Modules that need to be upgraded can be configured and connected to routers through serial port configuration
tools, or ap mode can be used.
4.2.2 Lookup Module IP
Because you need to input the ip, of the module when upgrading, you can go to the router to find the
corresponding ip, of the module or use HLK-_Discover to search the corresponding ip. for the module in the local
area network.
Figure 18. Lookup module ip
5.Electrical Specification
5.1 Electric Parameter
Electric parameter(for information only)
Power input voltage DC:5±0.2V
No-load running current 60±20mA @5V
Module average power consumption about 300mW
Module current peak 450mA
Requirements for power supply current ≥800mA
5.2 Current Waveform
Module test environment:single module without baseboard test, single and dual frequency antenna. The module
current peak shall refer to the table above.
Table of contents
Other Hi-Link Wireless Router manuals