Espressif ESP32 User Manual

ESP32 Bluetooth Networking
User Guide
Version 1.1
Copyright © 2019
About This Guide
This document provides a guide to using ESP32 in Bluetooth networking for IoT devices with examples.
Release Note
Documentation Change Notification
Espressif provides email notifications to keep customers updated on changes to technical documentation. Please subscribe at https://www.espressif.com/en/subscribe.
Certification
Download certificates for Espressif products from https://www.espressif.com/en/
certificates.!
Date
Version
Release notes
2017.03
V1.0
First release.
2019.05
V1.1
Update figures.
Content
1. Introduction! 1".............................................................................................................................
1.1. Overview! 1"....................................................................................................................................
1.2. EspBlufi! 1"......................................................................................................................................
2. APIs for Networking Development! 3".........................................................................................
2.1. BluFi Protocol! 3".............................................................................................................................
2.2. APIs on ESP32 End! 3"....................................................................................................................
2.3. APIs on the EspBlufi APK End! 4"...................................................................................................
3. ESP32 Bluetooth Networking Examples! 5"................................................................................
3.1. Hardware and Software Preparation! 5"..........................................................................................
3.2. Setting ESP32 to Station Mode! 5".................................................................................................
3.3. Setting ESP32 as a SoftAP! 9........................................................................................................
!
1. Introduction

1. Introduction

1.1. Overview

The ESP32, as a single 2.4 GHz Wi-Fi and Bluetooth combo chip, supports Wi-Fi setups via both SmartConfig and Bluetooth. Users can use ESP32 for secure configuration of Wi­Fi networking for IoT devices.
Using Bluetooth for configuring Wi-Fi network presents the following advantages:
The Bluetooth protocol is open and scalable.
By using Bluetooth protocol, users can easily discover nearby devices via Bluetooth beacons.
The Bluetooth protocol is secure, because the authentication of the device is done
over a secure Bluetooth connection before the password is sent to the device.
Users can also transmit data over Bluetooth to a smartphone, even when the router
is not working. The phone can then uploads the data to the Internet.
The phone can now also connect to the Bluetooth device and send commands directly to control the device if the Wi-Fi network is down.
1.2. EspBlufi
ESP32 is compliant with Bluetooth v4.2 BR/EDR and BLE specifications. Espressif has developed the app EspBlufi specifically for Bluetooth networking of IoT devices. The app is
supported on Android 4.3 and above. For smartphones of Android 6.0 or above, because of Google’s modification to the Android API, users must give their permission for access to their current location and enable the location information module to start the Bluetooth scanning.
EspBlufi can be downloaded via: https://github.com/EspressifApp/EspRelease/tree/
master/EspBlufi
Open EspBlufi after downloading it. In the user interface as shown in Figure 1-1, click on
the ! icon in the upper right corner.
!
Figure 1-1. EspBlufi User Interface
Espressif
! /!1 13
2019.05
!
1. Introduction
The Configure button will be shown in the interface and click this button.
!
Figure 1-2. CONFIGURE Button
Configure the length of BLE mtu, BLE device filtering, and check the version of the app
and Blufi repository.
!
Figure 1-3. CONFIGURE Interface!
Espressif
! /!2 13
2019.05
Loading...
+ 11 hidden pages