Jump to content
Electronics-Lab.com Community

Connect& Configure WiFi via Bluetooth -- Ameba Arduino


MENG XI

Recommended Posts

BLE -- WiFi  Config  Demo Video

 

Realtek's RTL8722 microcontroller is a dual-core, dual-band WiFi and BLE 5.0 capable embedded platform suitable for Internet of Things application.

For many non-professional developer, setting up WiFi AP information for WiFi microcontroller might be a hassle as there is no user interface to manually select the AP we want. However, RTL8722 has BLE 5.0 which give it an edge to pass WiFi information to the board prior to connecting to WiFi, making WiFi connection as easy as simply tapping few button on your mobile phone, here is how,

 

Materials

  • AmebaD [RTL8722 CSM/DM] x 1
  • Android / iOS mobile phone

Example

Introduction

In this example, a WiFi configuration service is set up on the Ameba Bluetooth stack. A mobile phone with the configuration app connects to the Ameba device using BLE and configures the Ameba to connect to the correct WiFi access point.

Procedure

Ensure that the Realtek WiFi configuration app is installed on your mobile phone, it is available at:

- Google Play Store: https://play.google.com/store/apps/details?id=com.rtk.btconfig
- Apple App Store: https://apps.apple.com/sg/app/easy-wifi-config/id1194919510

Open the example, "Files" -> "Examples" -> “AmebaBLE” -> “BLEWifiConfigService”.

2

Upload the code and press the reset button on Ameba once the upload is finished.

On your mobile phone, open the Realtek WiFiConfig app and tap the round button to scan for Ameba boards.

3

Select the correct Ameba board from the scan results. The app will connect to the Ameba board and ask the board to scan for WiFi networks and send the scan results back to the app using BLE.

3

3

3

If your phone is currently connected to a WiFi network, the app will ask for the WiFi password to connect the Ameba board to the same WiFi network. Tap “Select AP” to choose another WiFi network, or enter the password and tap continue to connect Ameba to the selected WiFi network.

3

After the Ameba board connects to the WiFi network, the following message will be shown. Tap “Try another AP” to connect to another WiFi network or tap “Confirm” to keep the current WiFi network and disconnect BLE from the Ameba board.

3

Code Reference

BLEWifiConfigService is used to create an instance of the WiFi configuration service to run on the Bluetooth device.

BLE.configAdvert()->setAdvType(configService.advData()) is used to set the correct advertisement data necessary for the phone app to find the Ameba Bluetooth device.

Link to comment
Share on other sites


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
  • Create New...