Hi-Link HLK-B30 User manual

Shenzhen Hi-Link Electronic Co., Ltd.
HLK-B30 User Manual
Version: V1.1 Revised date: 2017-1-16 Copr by Hi-link Electronic Co., Ltd.

1
Contents
1. Product description ...................................................................................................................1
1.1. Brief introduction .......................................................................................................... 1
1.2. Product Features ............................................................................................................ 1
1.3. Technical specifications .................................................................................................2
1.4. Pin introduction ............................................................................................................. 3
1.5. Product Encapsulation ...................................................................................................4
1.6. Block diagram ............................................................................................................... 4
1.7. Base plate description ....................................................................................................5
1.8. Power requirements .......................................................................................................5
1.9. WiFi Transmit power consumption ............................................................................... 5
1.10. WiFi received power consumption ..............................................................................6
1.11. WiFi power consumption in each working mode ........................................................6
1.12. WiFi output power in each mode ................................................................................ 6
1.13. WiFi receive sensitivity in each mode .........................................................................7
2. Functional description .............................................................................................................. 7
2.1. The description of flashing WiFi indicator ....................................................................7
2.2. One-click network configuration mode .........................................................................8
2.3. Serial to WiFi STA .........................................................................................................9
2.4. Serial to WiFi AP .........................................................................................................10
2.5. Serial working state conversion .................................................................................. 10
2.6. Serial to Network Data Conversion .............................................................................11
2.6.1. Module as TCP Server ......................................................................................11
2.6.2. Module as TCP Client ...................................................................................... 11
2.6.3. Module as UDP Server .....................................................................................12
2.6.4. Module as UDP Client ......................................................................................12
2.7. Application Area ..........................................................................................................13
3. AT instruction instructions ......................................................................................................13
3.1. Query the current module version: at + ver .................................................................13

2
3.2. Local port operation: at + CLport ........................................................................... 14
3.3. Set the serial port: at + uart ......................................................................................... 14
3.4. Set DHCP: at + dhcpc ................................................................................................. 14
3.5. Set WiFi connection mode: at + netmode ................................................................... 15
3.6. Set TCP connection mode: at + mode ......................................................................... 15
3.7. Set the remote IP when the module as client : at + remoteip ...................................... 15
3.8. Set the remote port when the module as client: at + remoteport .................................16
3.9. Set parameter submission: at + net_commit ............................................................... 16
3.10. System restart / exit at command mode: at + reconn ................................................ 16
3.11. Set the module's ssid and password: at + WiFi_confs ...............................................16
3.12. Set the socket connection protocol: at + remotepro .................................................. 17
3.13. Set network connection parameters: at + net_ip ....................................................... 17
3.14. Query STA Mode Network Connection Status: at + WiFi_ConState ........................17
3.15. Query module MAC address: at + Get_MAC ...........................................................17
3.16. Set the framing length: at + uartpacklen ................................................................... 18
3.17. Set framing time: at + uartpacktimeout .....................................................................18
3.18. Set the Bluetooth name: at + ble_name .....................................................................18
4. AT instruction control code routine ........................................................................................ 19
4.1. Query Configuration Information ............................................................................... 19
4.2. Serial port to WiFi client (static IP address) ................................................................20
4.3. Serial port to WiFi server (dynamic IP address) ......................................................... 21
4.4. Restore factory settings ............................................................................................... 22
4.5. Configuration Software Instructions ........................................................................... 23
5. Firmware upgrade ...................................................................................................................24
6. Method of restoring factory settings ...................................................................................... 26
7. Bluetooth data transmission ................................................................................................... 26
8. Bluetooth distribution network ...............................................................................................28
9. Appendix A Document Revision Record ................................................................................30

Page 1 / 30
1. Product description
1.1. Brief introduction
HLK-B30 is a low-cost embedded UART-WiFi (serial-wireless network) module launched by
Hi-Link Electronics.
This product is based on an embedded module that complies with the network standard through
a serial interface and has a built-in TCP / IP protocol stack.
With the HLK-B30 module, traditional serial devices can transmit their own data over the
Internet without changing any configuration, providing a complete and fast solution for users' serial
devices to transmit data over the network.
1.2. Product Features
Support 802.11b / g / n standards, integrating ARM9, WLAN MAC / Baseband / BLE 4.2
Main frequency supports 120MHz
Built-in 256KB RAM / 2MB FLASH
Working voltage: 3.0-3.6V
2.4G / 1T1R WiFi, BLE 4.2
Support BLE fast network configuration
Support Station, Soft AP
Support SmartConfig, WPA / WPA2 security mode, STA / AP working mode
Support 802.11b / g / n standard, HT-40
Support AP, STA and BLE mixed mode
Rich peripheral interfaces, 1 * SPI, 2 * UART, 6 * PWM, 19 * GPIO
Widely used in the Internet of Things
Support multiple encryption methods WEP64 / 128, TKIP, AES, WPA, WPA2, WAPI

Page 2 / 30
1.3. Technical specifications
Table 1 Product technical specifications
Module
Model
HLK-B30
Encapsulation
Inline
Wireless parameters
Wireless standard
IEEE 802.11 b/g/n Bluetooth standard: BLE 4.2
Frequency Range
2.412GHz-2.484GHz
Transmit power
802.11b: +16 +/-2dBm (@11Mbps)
802.11g: +14 +/-2dBm (@54Mbps)
802.11n: +13 +/-2dBm (@HT20,HT40- MCS7)
Receiving sensitivity
802.11b: -88.4 dBm (@11Mbps ,CCK)
802.11g: -75.7dBm (@54Mbps, OFDM)
802.11n: -73.6dBm (@HT20, MCS7)
External: I-PEX connector
Built-in: Built-in PCB antenna
Hardware parameters
Hardware interface
UART, IIC, PWM, GPIO, SPI
Operating Voltage
3.3V
GPIO drive capability
Max:16ma
Working current
Send continuously =>
Operating temperature
-40℃~80℃
Storage environment
Temperature: <40 ° C, relative humidity: <90% R.H.
Serial port transparent
transmission
Transmission rate
110-921600bps
TCP Client
1
Software parameters
Wireless network type
STA/AP
Security Mechanism
WEP/WPA-PSK/WPA2-PSK
Encryption type
WEP64/WEP128/TKIP/AES
Firmware upgrade
Wireless upgrade, serial port upgrade
Network protocol
IPv4, TCP/UDP
User configuration
AT + instruction set, intelligent configuration with one click

Page 3 / 30
1.4. Pin Introduction
Table 2 Module pin interface
Pin
Network name
Type
Descriptions
1
CEN
I
Chip enabled, highly effective
2
P26_PWM5
I/O
P26,PWM5
3
P24_PWM4
I/O
P24,PWM4
4
P23_TDO_F_S0
I/O
P23,ADC3
5
P22_TDI_F_SI
I/O
ES0, enter at command mode / restore factory
settings, please pull up if not used, same as P28
6
P21_TMS_F_CS
I/O
P21
7
P20_TCK_F_SC
I/O
P20
8
VBAT
P
3.3V power supply
9
P28
I/O
Enter at command mode / restore factory settings,
please pull up if not in use, same as P22
10
P16
I/O
P16
11
P17
I/O
P17
12
P14
I/O
P14
13
P15
I/O
P15
14
P6_PWM0
I/O
P6,PWM0
15
GND
P
GND
16
P7_PWM1
I/O
P7,PWM1
17
P8_PWM2
I/O
WiFi Indicator light
18
P9_PWM3
I/O
P9,PWM3
19
P1_URAT2_RXD
I/O
P1,UART2
20
P0_UART2_TXD
I/O
P0,UART2
21
P10_UART1_RXD
I/O
P10,UART1, For upgrading, command setting
and transparent transmission
22
P11_UART1_TXD
I/O
P11,UART1, For upgrading, command setting
and transparent transmission

Page 4 / 30
1.5. Product Encapsulation
Diagram 1 HLK-B30 encapsulation size
1.6. Block diagram
Diagram 2. HLK-B30 module architecture diagram

Page 5 / 30
1.7 Base plate description
Diagram 3 Baseboard illustration
1.8 Power requirements
Power requirements
Power input voltage
DC:3.3±0.3V
No-load running current
130±50mA
Supply current requirements
≥1000mA
1.9. WiFi Transmit power consumption
WiFi Transmit power consumption
Mode
Rate
Transmit power
Current(ma)
11b
11Mbps
17.5dbm
280
11g
54Mbps
11dbm
150
11n
MCS7
10dbm
130

Page 6 / 30
1.10. WiFi received power consumption
Mode
Rate
Current (ma)
11b
11Mbps
100
11g
54Mbps
100
11n
MCS7
100.5
1.11. WiFi power consumption in each working mode
Status
Descriptions
Average current
(3v3)
Max current (3v3)
Unit
WiFi initialization
RF off, MCU full speed
45.2
46.3
ma
Keep WiFi connected
Keep connected router
101
342
ma
Udp send
After connecting to the
AP, UDP packets are sent
at full speed
93
363
ma
SoftAP
SoftAP networking status
100.5
193.7
ma
SmartConfig
Module distribution
network status
100.8
129.5
ma
1.12. WiFi output power in each mode
Parameters
Minimum value
Typical value
Maximum value
Unit
RF average output power,
802.11b cck Mode 11m
-
17.5
-
dBm
RF average output power,
802.11g OFDM Mode 54m
-
15
-
dBm
RF average output power,
802.11n OFDM Mode MCS7
-
13
-
dBm
Frequency error
-10
-
10
ppm

Page 7 / 30
1.13. WiFi receive sensitivity in each mode
Parameters
Minimum value
Typical value
Maximum value
Unit
RF average output power,
802.11b cck Mode 11m
-
-91
-
dBm
RF average output power,
802.11g OFDM Mode 54m
-
-74
-
dBm
RF average output power,
802.11n OFDM Mode MCS7
-
-70
-
dBm
2. Functional description
HLK-B30 supports serial port to WiFi STA, serial port to WiFi AP, and serial port to BLE mode.
2.1. The description of flashing WiFi indicator
The module is indicated by the flashing LED indicator in different modes, so that you can
quickly and easily know the module's operating status.The module's WiFi indicator has the following
states:
(1) The WiFi indicator flashes twice periodically, it indicates that the module is in One-click
network configuration mode.
(2) The WiFi indicator flashes three times periodically, it indicates that the module is in sta
mode, and the target AP hotspot has not been connected yet.
(3) The WiFi indicator flashes four times periodically, it indicates that the module is in 2.4g ap
mode, but it cannot indicate whether there is a sta client device connected.
(4) The WiFi indicator flashes quickly, it indicates that the module is in sta mode and connected
to the WiFi hotspot. When there is data transmission, the module led will flash quickly.

Page 8 / 30
2.2. One-click network configuration mode
For the IOT WiFi module, based on cost and performance considerations, there is no touch
screen interactive interface like a mobile phone. The user can see the ap list on the mobile phone and
click on the password to connect to the network. What should I do? One-click configuration is that
the WiFi module is in promiscuous mode (can capture all 802.11 frames in the air), the APP sends
the SSID and password to the WiFi module through UDP broadcast or multicast with certain coding
rules, the module parses them out, and then connects to the router. Install the Android app
HLK-TCPdemo, then select the configuration network, select the airkiss mode, enter the password,
click to start the configuration and start the configuration. When the network connection is
successful, the module will change from dual flash to fast flash, indicating that the network is
successful.
Diagram 4 One-click network configuration

Page 9 / 30
When the module is configured in one-click mode, you need to set the module to one-click
mode.You can use the serial configuration tool to set the module to one-click mode.
Diagram 5 Set to one-click network mode
2.3. Serial to WiFi STA
Diagram 6 Module as STA
The module converts the serial data of the device into WiFi data to achieve the purpose of
device networking.
Serial device

Page 10 / 30
2.4. Serial to WiFi AP
Diagram 7 Module as ap
In AP mode, mobile phones, PCs or other WiFi devices can be connected to the B30 module via
WiFi, and serial devices can transmit data through the B30 module and other WiFi devices.
2.5. Serial working state conversion
After HLK-B30 is powered on, the default mode is transparent transmission mode. By pulling
down the ES0 (PIN5) pin for more than 50ms to enter the at command mode, the module will regard
the received data as an at command and send the at command to let the module enter the transparent
transmission mode. After the network connected, the data received by the serial port will be
transmitted as transparent transmission data.
Diagram 8Serial working mode conversion
Power on
Transparent mode
Send AT command
AT command mode
Pull down low
for 50ms

Page 11 / 30
2.6. Serial to Network Data Conversion
2.6.1. Module as TCP Server
Diagram 9 TCP Server
In this mode, the module monitors the designated port and waits for the TCP Client to connect.
After the connection, all TCP data are sent directly to the serial port, and the data at the serial port is
sent to all TCP Clients. When the module is as TCP Server, it supports up to 5 TCP Client connected
to TCP Server.
2.6.2. Module as TCP Client
Diagram 10 TCP Client
In this mode, the module will actively connect to the specified IP and port. All data sent by the
TCP Server is sent directly to the serial port, and data from the serial port is sent to the TCP Server.
Abnormal network disconnection will cause the module to reconnect actively.
TCP Server
TCP Client
TCP Server
TCP Client
TCP Client
TCP Client
TCP Server

Page 12 / 30
2.6.3. Module as UDP Server
Diagram 11 UDP Server
In this mode, the module opens the local designated port. Once receiving the data sent to this
port, the module will send the data to the serial port and record the remote IP and port. The module
will only record the remote information on the last connection, and the data sent by the serial port
will be directly sent to the recorded remote IP and port.
2.6.4. Module as UDP Client
Diagram 12 UDP Client
In this mode, the module sends the serial port data directly to the specified IP and port, and the
data returned from the server will be sent to the serial port.
UDP Server
UDP Client
UDP Client
UDP Server

Page 13 / 30
2.7. Application Area
Smart home
Instruments
Wi-Fi remote monitoring / control
Toy field
Color LED control
Intelligent integrated management of fire protection and security
Smart card terminals, wireless POS machines, hand-held devices, etc.
3. AT instruction instructions
Instruction format: In the AT instruction mode, the system can be configured through the AT
instruction of the serial port.
The instruction format is as follows:
at + [command] = [value], [value], [value] ......
All commands start with "at" and end with "\ r". If the command is not encapsulated in this
format, it will not be processed, and different return values will be returned according to different
command of modules.
Example: "at + ver =?"
The module will return: HLK-B30 (b.1.00.120191206180224)
Query instruction format:
at + [command] =?
3.1. Query the current module version: at + ver
Grammar rules:
Command type
Grammar/ Syntax
Return and description
Executing command
at+ver=?
at+ver=HLK-B30(b.1.00.120191206180224): current version

Page 14 / 30
3.2. Local port operation: at + CLport
Command type
Grammar/ Syntax
Return and description
Executing command
at+CLport=8080
at+CLport=8080
Ok
Description: Set the local port to port 8080
at+CLport=?
at+CLport=?
8080
Description: Query local port
3.3. Set the serial port: at + uart
Command type
Grammar/ Syntax
Return and description
Executing command
at+uart=115200,8,n,1
at+uart=115200,8,n,1
Ok
Description: Set serial parameters
Query command
at+uart=?
at+uart=?
115200,8,n,1
Description: Query serial port parameters
3.4. Set DHCP: at + dhcpc
Command type
Grammar/ Syntax
Return and description
Executing command
at+dhcpc=1
at+dhcpc=1
ok
Query command
at+dhcpc=?
at+dhcpc=?
1
Description: 1: dhcp mode, 0: static ip

Page 15 / 30
3.5. Set WiFi connection mode: at + netmode
Command type
Grammar/ Syntax
Return and description
Executing command
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
3.6. Set TCP connection mode: at + mode
Command type
Grammar/ Syntax
Return and description
Executing command
at+mode=client
at+mode=client
Ok
Description: Set the module to client mode
Query command
at+mode=?
at+mode=?
client
Description: client: client, server: server
3.7. Set the remote IP when the module as client : at + remoteip
Command type
Grammar/ Syntax
Return and description
Executing command
at+remoteip=192.168.1
1.102
at+remoteip=192.168.11.102
ok
Description: Set the remote IP address of the module
Query command
at+remoteip=?
at+remoteip=?
192.168.11.102
Description: Query remote IP

Page 16 / 30
3.8. Set the remote port when the module as client: at + remoteport
Command type
Grammar/ Syntax
Return and description
Executing command
at+remoteport=1234
at+remoteport=1234
ok
Description: Set the remote IP address of the module
Query command
at+remoteport=?
at+remoteport=?
1234
Description: Query remote IP
3.9. Set parameter submission: at + net_commit
Command type
Grammar/ Syntax
Return and description
Executing command
at+net_commit=1
at+net_commit=1
Ok
Description: Submit setting parameters
3.10. System restart / exit at command mode: at + reconn
Command type
Grammar/ Syntax
Return and description
Executing command
at+reconn=1
at+reconn=1
Description: Exit at command mode
Query command
at+net_commit=1
at+reconn=1
at+net_commit=1
ok
at+reconn=1
ok
Description: System restart
3.11. Set the module's ssid and password: at + WiFi_confs
Command type
Grammar/ Syntax
Return and description
Executing command
at+WiFi_conf=HI-LIN
K_5FE8,none,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

Page 17 / 30
3.12. Set the socket connection protocol: at + remotepro
Command type
Grammar/ Syntax
Return and description
Executing command
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/ Syntax
Return and description
Executing command
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 module's ip, gateway, dns
Query command
at+net_ip=?
at+net_ip=?
192.168.16.254,255.255.255.0,192.168.16.254
Description: Query module's ip, gateway, dns
3.14. Query STA Mode Network Connection Status: at + WiFi_ConState
Command type
Grammar/ Syntax
Return and description
Query command
at+WiFi_ConState=?
at+WiFi_ConState=?
Disconnected
Description: In sta mode, the module WiFi is not
connected, Connected means the network is connected
3.15. Query module MAC address: at + Get_MAC
Command type
Grammar/ Syntax
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
Other manuals for HLK-B30
1
Table of contents
Popular PCI Card manuals by other brands

ICP DAS USA
ICP DAS USA PCI-1202 Series quick start guide

TerraTec
TerraTec TerraTValue BT878 quick reference

GeoVision
GeoVision GV-800 quick start guide

SMC Networks
SMC Networks 1244TX-1 - annexe 1 manual

National Instruments
National Instruments 78 R Series Note to Users

Sun Microsystems
Sun Microsystems Netra CP2140 Product note