Hi-Link HLK-B35 User manual

Shenzhen Hi-Link Electronic Co., Ltd.
HLK-B35 User Manual
Version:V1.0 Revise date:2020 年 11 月 19 日 Reserved ©Shenzhen Hi-Link Electronic Co., Ltd

1
目CONTENTS
1. PRODUCT INTRODUCTION........................................................................................................................................ 1
1.1. BRIEF INTRODUCTION........................................................................................................................................ 1
1.2. PRODUCT FEATURES............................................................................................................................................ 1
1.3. PERFORMANCE AND ELECTRICAL PARAMETERS.................................................................................................. 2
1.4. PRODUCT PACKAGE SIZE AND PIN DEFINITION.............................................................................................. 4
1.5. PIN INTRODUCTION............................................................................................................................................ 4
1.6. SYSTEM BLOCK DIAGRAM.................................................................................................................................... 6
1.7. TEST BOARD INTRODUCTION.............................................................................................................................. 6
2. FUNCTION DESCRIPTION........................................................................................................................................ 7
2.1. WIFI INDICATOR FLASHING DESCRIPTION...................................................................................................... 7
2.2. UART TO WIFI STA............................................................................................................................................ 7
2.3. UART TO WIFI AP.............................................................................................................................................. 8
2.4. SERIAL PORT WORKING STATUS CONVERSION.................................................................................................. 8
2.5. SERIAL-TO-NETWORK DATA CONVERSION.......................................................................................................... 9
2.5.1. MODULE AS TCP SERVER................................................................................................................................ 9
2.5.2. MODULE AS TCP CLIENT................................................................................................................................ 9
2.5.3. MODULE AS UDP SERVER.............................................................................................................................. 10
2.5.4. MODULE AS UDP CLIENT.............................................................................................................................. 10
3. AT COMMAND INSTRUCTIONS................................................................................................................................ 10
3.1. BASIC AT COMMANDS........................................................................................................................................ 11
3.2. WI-FI RELATED AT COMMANDS........................................................................................................................ 14
3.3. TCP/IP RELATED AT COMMANDS...................................................................................................................... 15
3.4. BLE RELATED AT COMMANDS............................................................................................................................ 18
3.5. CUSTOM MESSAGE PROMPT INSTRUCTION........................................................................................................ 18
4.AT COMMAND CONTROL CODE EXAMPLE.................................................................................................................. 20

4.1. QUERY CONFIGURATION INFORMATION............................................................................................................ 20
4.2. CONFIGURE THE MODULE AS A CLIENT (STATIC IP ADDRESS)..................................................................20
4.3. CONFIGURE THE MODULE AS A SERVER (DYNAMIC IP ADDRESS)................................................................22
4.4. RESET.................................................................................................................................................................23
5. BLUETOOTH DISTRIBUTION NETWORK AND DATA TRANSPARENT TRANSMISSION..............................................24
5.1. BLUETOOTH DISTRIBUTION NETWORK.............................................................................................................. 24
5.2. BLUETOOTH TRANSPARENT TRANSMISSION...................................................................................................... 24
6. MODULE POWER CONSUMPTION MEASURED DATA.................................................................................................. 25
6.1. POWER CONSUMPTION IN STA MODE................................................................................................................ 25
6.2. POWER CONSUMPTION OF TRANSPARENT DATA TRANSMISSION IN STA MODE..............................................26
6.3. POWER CONSUMPTION IN AP MODE.................................................................................................................. 26
7. APPENDIX A DOCUMENT REVISION HISTORY...................................................................................................... 27

User Manual
第1页共30
HLK-B35
1. Product Introduction
1.1. Brief introduction
HLK-B35 is a low-cost embedded UART-WIFI (serial-wireless network) module launched by
Hi-link Electronics. It is a Wi-Fi + BLE combined chipset for low-power and high-performance
application development.
This product is based on an embedded module that conforms to network standards through a
serial interface, with an embedded TCP/IP protocol stack, which can realize the conversion between
the user's serial port and the wireless network (WIFI/BLE).
With the HLK-B35 module, the traditional serial device can transmit its own data through the
Internet without changing any configuration, providing a complete and fast solution for the user's
serial device to transmit data through the network.
1.2. Product Features
Wireless subsystem includes 2.4G radio, Wi-Fi802.11b/g/n and BLE5.0 baseband/MAC design
Microcontroller includes 32-bit RISC CPU with FPU (floating point unit), cache and memory power
management unit to control low power consumption mode
DFS (Dynamic Frequency Scaling) main frequency support from 1MHz to 192MHz
Support XIP QSPI Flash hardware encryption
Built-in 276KB RAM, 128KB ROM, 1KB eFus, 2M embedded Flash memory
Working voltage supports 2.1-3.63V, typical value is 3.3V
BLE assists in realizing Wi-Fi fast network configuration
Support AP/STA and BLE coexistence mode, among which WiFi security support:
WPS/WEP/WPA/WPA2 Personal/WPA2 Enterprise/WPA3
Integrated balun, PA/LNA
Abundant peripheral interfaces, 1*SPI master/slave, 2*UART,

User Manual
第2页 共 30
HLK-B35
QSPI Flash Instant AES Decryption (OTFAD)-AES-128, CTR mode
Support AES 128/192/256 bit encryption engine, true random number generator (TRNG), public key
accelerator (PKA)
Widely used in the Internet of Things
1.3. Performance and electrical parameters
Table 1 Performance and electrical parameters
Module
Model HLK-B35
encapsulation In-line
WiFi
Parameters
Wireless
standard
IEEE 802.11 b/g/n
Low energy consumption 5.0: supports BLE 5.0 channel
selection #2, does not support 2M PHY/ADV extension
Up to 40~100m in open environment
Frequency Range 2.412GHz-2.462GHz
Average power
802.11b: 16.48dBm (@11Mbps)
802.11g: 14.54dBm (@54Mbps)
802.11n: 13.78dBm (@HT20),HT40(10.69dBm)
Receiving
sensitivity
11g - 6Mbps: -93 dBm
11g - 54Mbps: -77 dBm
11n - MCS0: -93 dBm
Antenna form
External: I-PEX connector
Built-in: Built-in PCB antenna
Bluetooth
parameter
Frequency Range 2402~2480MHz
Average power -8.4dBm Typical value: 9dBm
Receiving
sensitivity
-97dBm
hardware
parameter
Hardware
interface
1*SPI主/从,2*UART,5*PWM,16*GPIO,1*IIC主/从,
1*SDIO2.0从
Operating DC 2.1~3.63V Typical value 3.3V

User Manual
第3页共30
HLK-B35
Voltage
GPIO driver
ability
Max:12.8 mA
Working current
Claim
≥800mA
Module current
Peak
700mA
No-load
operation
Current
44mA
Operating
temperature
-40℃~85℃
Serial port
Penetrate
Transmission
rate
9600-921600bps
TCP Client
1
software
parameter
wireless
network
Types of
STA/AP
Security
Mechanism
WPS/WEP/WPA/WPA2 Personal/WPA2 Enterprise/WPA3
Encryption type
WEP64/WEP128/TKIP/AES
Network
protocol
IPv4, TCP/UDP,Lwip
User
configuration
AT+ instruction set

User Manual
第4页共30
HLK-B35
1.4. Product package size and pin definition
Pic1 HLK-B35 Product package size and pin definition
1.5. Pin introduction
Table 2 Module pin interface
PIN
Network name
Type
Description
1
RST
I
Chip enable, high active, low reset
2
IO5
I/O
preserve
3
IO2
I/O
preserve
4
IO11
I/O
preserve
5
IO12
I/O
ES0 button, enter at command
mode/restore factory settings, please pull
up if not in use
6
IO14
I/O
preserve
7
IO17
I/O
preserve
8
VCC
P
3.3V power

User Manual
第5页共30
HLK-B35
9
GND
P
GND
10
NC
I/O
preserve
11
NC
I/O
preserve
12
IO20
I/O
preserve
13
IO21
I/O
WiFi connection
0: WiFi is not connected
1: WiFi is connected
14
IO22
I/O
TCP connection
0: Not connected to the TCP server
1: Connected to the TCP server
15
GND
P
GND
16
IO0
I/O
Module status indicator
17
IO8
I/O
Indicator light not used
18
IO1
I/O
preserve
19
IO3
I/O
Debug serial port (TX pin)
20
IO4
I/O
Debug serial port (RX pin)
21
RXD
I/O
Main serial port send pin
22
TXD
I/O
Main serial port Receive pin

User Manual
第6页共30
HLK-B35
1.6. System Block Diagram
Pic 2. HLK-B35 Module architecture diagram
1.7. Test board introduction
Pic 3 Test board introduction

User Manual
第7页共30
HLK-B35
2. Function description
HLK-B35 supports serial port to WIFI STA, serial port to WIFI AP and serial port to BLE
mode.
The module is powered on by default in AP mode (IP is fixed at 192.168.169.1), as a UPD
server, port 9000, WiFi hotspot name is HLK_B35_WIFIxxxxxxxx, where xxxxxxxx is the last 4
bytes of the module's MAC address.
The Bluetooth name is HLK_B35_BLExxxxxxxx, where xxxxxxxx is the last 4 bytes of the
module's MAC address.
2.1. WIFI indicator flashing description
The module is indicated by the flashing of the LED indicator in different states, and the current
operating state of the module can be quickly known from the table:
Module status
Light flashing method
STA mode
Not connected to the router
Periodic three flashes
connected to the router
Fast flashes
Non-TCP client
Socket created successfully
Slow flashing
TCP client
Connect to the TCP server
Slow flashing
AP mode
Periodic four flashes
2.2. UART to WIFI STA
Pic 6 Module as STA
The module converts the serial port data of the device into wifi data to achieve the purpose of
device networking.

User Manual
第8页共30
HLK-B35
2.3. UART to WIFI AP
Pic 7 Module as AP
In AP mode, mobile phones, PCs or other wifi devices can be connected to the B35 module
through wifi, and serial devices can transmit data through the B35 module and other wifi devices.
2.4. Serial port working status conversion
After the HLK-B35 is powered on, the default is the transparent transmission mode. By pulling
down the pin ES0 (GPIO12) for less than 50ms to enter the at command mode, the module will treat
the received data as an at command, and send the at command to let The module enters the
transparent transmission mode. After the network is connected, the data received by the serial port
will be transmitted as transparent transmission data.
Pic 8 Serial port working mode conversion
AT commands
Power on
Transparent
trasmission mode
Pulling down Es0
Send AT commands

User Manual
第9页共30
HLK-B35
2.5. Serial-to-network data conversion
2.5.1. Module as TCP Server
Pic 9 TCP Server
In this mode, the module monitors the specified port and waits for the TCP Client to connect.
After connection, all TCP data is sent directly to the serial port, and the data from the serial port is
sent to all TCP Clients. When the module is used as a TCP Server, it supports up to 4 A TCP Client
connects to the TCP Server.
2.5.2. Module as TCP Client
Pic 10 TCP Client
In this mode, the module will actively connect to the specified IP and port. All data sent from
the TCP Server will be sent directly to the serial port, and data from the serial port will be sent to the
TCP Server. Abnormal network disconnection will cause the module to reconnect actively.
TCP Server
TCP Client
TCP Client
TCP Client
TCP Client
TCP Server

User Manual
第10 页 共 30
HLK-B35
2.5.3. Module as UDP Server
Pic 11 UDP Server
In this mode, the module opens the local designated port. Once the data sent to this port is
received, 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 of the last connection, and the data sent by the serial
port will be sent directly to the recorded remote ip and port.
2.5.4. Module as UDP Client
Pic 12 UDP Client
In this mode, the module will send serial port data to the specified ip port; the data returned by
the server will be sent to the serial port.
3. AT command instructions
Command format: In the AT command mode, the system can be configured through the AT
command of the serial port. The command format is as follows:
UDP Server
UDP Client
UDP Client
UDP Server

User Manual
第11 页共30
HLK-B35
at+[command]=[value],[value],[value]......
All commands start with "at" and end with "\r\n". If the command is not sent in this format, the
module will not proceed.
It does not return any data; after the effective instruction is recognized, the module will return
the corresponding data or perform the corresponding operation, and
Return OK; invalid command module will directly return ERR. The instruction types are shown
in the following table:
3.1. Basic AT commands
3.1.1. Test response:at
Type
Grammar
Return and description
Execute
instructions
at
OK
Note: The module is in AT command mode, and the
baud rate is correct
When receiving ERROR, it indicates that the module
is in AT mode, but the command is invalid
When no data is received, it indicates that the
module is in transparent transmission mode or
working abnormally
The module is in transparent transmission mode by
default
3.1.2. Query software version number:at+ver=?
Type
Grammar
Return and description
Query
instruction
at+ver=?
HLK-B35(V1.00Nov 9 2020-07:38:59)
OK
Note: current version number and firmware date
Type
Form
Description
Query
instruction
at+<x>?
Get the parameter value or status currently
set by the module
Set
instruction
at+<x>=<···>
Set the relevant parameters of the module
Execute
instructions
at+<x>
Execute the function of unchanged internal
parameters of the module

User Manual
第12 页 共 30
HLK-B35
3.1.3. AT help instruction:at+help
Type
Grammar
Return and description
Execute
instructions
at+help
at+help
# at+help -- This text
# ate=<1/0> -- echo on/off
# at+ver=<?> -- version info
......
OK
Note: List all current AT commands and parameter
prompts
3.1.4. Switch echo:at+ate
Type
Grammar
Return and description
Set
instruction
at+ate=1
at+ate=1
OK
Note: The echo function is successfully turned on.
After that, each reply command will first reply to the
sent command, and then reply the related
parameters and execution result of the command
When this parameter is set to 0:
Module directly responds to the relevant data of the
command
The module has the echo function turned on by
default
3.1.5. Baud rate setting:at+uart
Type
Grammar
Return and description
Set
instruction
at+uart=115200,8,n,1
at+uart=115200,8,n,1
Ok
Note: The parameters are baud rate, data bit,
validation, stop bit
Note: The test board baud rate supports up to
921600
‘Add’ means even test, ‘even’: odd test, and’n’ means
invalid test
‘1.5’ is 1.5 stop bits, ‘2’ is 2 stop bits, and ‘1’ is 1 stop
bit

User Manual
第13 页 共 30
HLK-B35
Query
instruction
at+uart=?
at+uart=?
115200,8,n,1
Note: Query the serial port baud rate, data bit,
validation, stop bit
3.1.6. Query MAC address:at+Get_MAC
Type
Grammar
Return and description
Query
instruction
at+Get_MAC=?
at+Get_MAC=?
40:d6:3c:15:5f:e8
Note: Reply to the mac address of the module
3.1.7. Rest:at+default
Type
Grammar
Return and description
Set
instruction
at+default=1
at+default=1
OK
Note:module reset
3.1.8. Save the set parameters:at+net_commit
Type
Grammar
Return and description
Set
instruction
at+net_commit=1
at+net_commit=1
Ok
Note:Submit the setting parameters successfully
3.1.9. Module restart or enter transparent transmission mode:at+reconn
Type
Grammar
Return and description
Set
instruction
at+reconn=1
at+reconn=1
Ok
Note: when the instruction is executed before
at+net_commit=1
Instruction, the module will restart
When the at+net_commit=1 instruction has not
been executed before executing this instruction,
The module will enter the transparent
transmission mode

User Manual
第14 页 共 30
HLK-B35
3.2. WI-FI related AT commands
3.2.1. Set the network mode of the module:at+netmode
Type
Grammar
Return and description
Set
instruction
at+netmode=2
at+netmode=2
Ok
Note: Set the module to STA mode
Query
instruction
at+netmode=?
at+netmode=?
2
Note:2: STA mode 3: 2.4G AP mode
3.2.2. Set the name and password of the connection route/WiFi hotspot :
at+wifi_conf
Type
Grammar
Return and description
Set
instruction
at+wifi_conf=HI-LINK,non
e,12345678
at+wifi_conf=HI-LINK,none,12345678
Ok
Description: When the module is in STA mode, this
parameter is
Set the ssid, encryption method and pwd of the
connection route
When the module is in AP mode, this parameter is
Set up ssid, encryption method and pwd for
establishing WiFi hotspot
Note: The maximum length of the WiFi name and
password is 32 bytes
Query
instruction
at+wifi_conf=?
at+wifi_conf=?
HI-LINK_5FE8,none,12345678
Note:SSID of the connection route, encryption
method and pwd
3.2.3. Query the status of the connection route in STA mode:at+wifi_ConState
Type
Grammar
Return and description
Query
instruction
at+wifi_ConState=?
at+wifi_ConState=?
Disconnected
Note:The module is not connected to the router in sta
mode, connected means the module is connected to
the router in sta mode

User Manual
第15 页 共 30
HLK-B35
3.2.4. Scan for nearby routes:at+scanap
Type
Grammar
Return and description
Execute
instructions
at+scanap
at+scnfap
+CWLAP:
0,IT-soft,e6:d3:32:06:e7:9d,11,-85,WPA2-PSK/WP
A-PSK
1,yangyipeng,00:6b:8e:78:cd:c7,9,-61,WPA2-PSK/
WPA-PSK
2,ChinaNet-vwnA,54:66:6c:c1:af:40,4,-98,WPA2-P
SK/WPA-PSK
3,qfdz6868,bc:5f:f6:c3:fd:e6,13,-81,WPA2-PSK/WP
A-PSK
......
OK
Note:Scanned surrounding WiFi name, MAC address,
channel, signal strength, encryption method
3.3. TCP/IP Related AT commands
3.3.1. Set the IP mode of the module:at+dhcpc
Type
Grammar
Return and description
Set
instruction
at+dhcpc=1
at+dhcpc=1
Ok
Note:Set the IP mode of the module to dynamic IP
Query
instruction
at+dhcpc=?
at+dhcpc=?
1
Note:1: Dynamic IP 0: Static IP
3.3.2. Set module static IP:at+net_ip
Type
Grammar
Return and description
Set
instruction
at+net_ip=192.168.16.25
4,2
55.255.255.0,192.168.16.
254
at+net_ip=192.168.16.254,255.255.255.0,192.168
.16.254
Ok
Note:Set the module's IP, subnet mask, and gateway
successfully
The prerequisite for this instruction to be valid

User Manual
第16 页 共 30
HLK-B35
is that the instruction: at+dhcpc=0 has been
executed, otherwise it is regarded as an invalid
instruction
In AP mode, the default address of the module
is 192.168.169.1 and cannot be set
Query
instruction
at+net_ip=?
at+net_ip=?
192.168.16.254,255.255.255.0,192.168.16.254
Note:Module current IP, subnet mask, gateway
3.3.3. Set TCP connection type:at+mode
Type
Grammar
Return and description
Set
instruction
at+mode=client
at+mode=client
Ok
Note:Successfully set the module to client mode
Query
instruction
at+mode=?
at+mode=?
Client
Note:client: the module as the client server: the
module as the server
3.3.4. Set the socket connection protocol:at+remotepro
Type
Grammar
Return and description
Set
instruction
at+remotepro=tcp
at+remotepro=tcp
OK
Note:Set the socket protocol of the module to tcp
successfully
Query
instruction
at+remotepro=?
at+remotepro=?
tcp
Note:TCP: socket protocol is TCP UDP: socket
protocol is UDP
3.3.5. Set the local port in client mode:at+CLport
Type
Grammar
Return and description
Set
instruction
at+CLport=8080
at+CLport=8080
Ok
Note:Successfully set the local port under the
module client
Note: The prerequisite for this instruction to be valid

User Manual
第17 页 共 30
HLK-B35
is that the instruction: at+mode=client has been
executed, otherwise it is regarded as an invalid
instruction
Query
instruction
at+CLport=?
at+CLport=?
8080
Note:The local port of the module under the client is
8080
3.3.6. Set the remote IP in client mode:at+remoteip
Type
Grammar
Return and description
Set
instruction
at+remoteip=192.168.11.
102
at+remoteip=192.168.11.102
Ok
Note:Set the remote IP under the module client
successfully
The prerequisite for this instruction to be valid is that
the instruction: at+mode=client has been executed,
otherwise it is regarded as an invalid instruction
Query
instruction
at+remoteip=?
at+remoteip=?
192.168.11.102
Note:The remote IP of the module connected under
the client is:192.168.11.102
3.3.7. Set the remote port or local port in client/server mode:at+remoteport
Type
Grammar
Return and description
Set
instruction
at+remoteport=9000
at+remoteport=9000
Ok
Note:Instruction valid
Query
instruction
at+remoteport=?
at+remoteport=?
9000
Note:When the module acts as a client, the remote
port connected to the module is 9000
When the module is used as a server, the local port of
the module is 9000
Table of contents
Other Hi-Link Wireless Module manuals