Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob

BLE WiFi Introducer

BLE WiFi Introducer

AndrewY_86
Employee
Employee
25 sign-ins 25 replies posted 10 replies posted

The BLE WiFi Introducer app shows an example interfacing the BLE and WiFi components on a combo chip. It demonstrates GATT database initialization, DCT configuration, processing read/write requests from a BLE client, and sending data to the client. The BLE WiFi Introducer has two components, an app running on a WICED devices, and an app running on an iOS device.

WICED App Functionality:

  • Reads WiFi network configuration from DCT and attempts to connect to the network
  • Upon failure to join the network, BLE GATT server is started to advertise network connection characteristic values
  • When the iOS app triggers the BLE GATT characteristic write event, the network credential values are received. The WICED device will attempt to connect to the network and send the result via a notification message to the iOS device
  • Pressing the user button on the WICED board wipes the WiFi network credentials from the DCT and the system is rebooted

iOS App Functionality:

  • Scans for a WICED based device and reads advertising data
  • Connects to the WICED device and allows user to enter network credentials for the currently connected network
  • Writes the network credentials to the corresponding BLE GATT characteristic values
  • Indicates the success or failure state of the WICED device network connection and allows for re-entering credentials upon connection failure

Step by step usage guide:

  1. Use an OS X system to install the iOS Demo App (WiFIIntroducer) onto an iOS device. The files are located at <WICED_SDK>/apps/demo/ble_wifi_introducer/peerapps/iOS
  2. Compile and download the ble_wifi_introducer app onto a WICED device using the target "demo.ble_wifi_introducer-<platform> download run"
  3. Open a terminal to view the output. Since WiFi network credentials were not edited in the wifi_config_dct, the connection will fail and the BLE GATT server will start advertising. You should see output similar to the following,
    1.PNG
  4. On the iOS device, connect to the WiFi AP that you want the WICED device to connect to. Open the WiFiIntroducer application and you should be greeted with the following splash screen,
    IMG_3382small.PNGIMG_3370small.PNG
  5. The app will scan until a nearby WICED device is detected. Bring the WICED device close to the iOS device and the following screen will be brought up
    IMG_3385small.PNG
    Note: If the iOS app does not detect the WICED device, kill and reopen the iOS application

  6. Enter the WiFi AP passphrase and press connect. You will be prompted to pair the device. Select "Pair" and a secure LE connection will be made between the iOS device and the WICED device using the ECDH algorithm to generate and exchange the secure keys.
    IMG_3375small.PNG
    Note: If the device has been previously paired, it may be necessary to remove the pairing before the app will run correctly. Do this by going to Settings > Bluetooth. Under My Devices, click the "i" icon next to WiFiInt and select "Forget This Device"

  7. The WiFi network credentials will be sent to the WICED device and the connection result will be pushed back to the iOS device. If the connection fails, press "Try Again" to re-input the passphrase. Upon successful connection, the network credentials will be saved to the DCT.
    IMG_3376small.PNGIMG_3377small.PNGfail.pngsuccess.png
  8. When rebooting the WICED device, since the DCT has configured Network credentials, the BLE GATT server will not be started. You can press the user button on the WICED board to reset the DCT. The device will reboot and the BLE GATT server will start advertising.
2432 Views
Comments
Anonymous
Not applicable

Any updates to make this work with the new versions of Swift?

I can not seem to get it working using WICED Studio 4.0.10.14

joMa_1809706
Level 4
Level 4
10 likes received First like received First like given

So I follow the directions above for my BCM94343W_AVN demo board and it doesn't do anything after the last message below. I see no advertising. Pressing the user button has no effect. Any clues as to how I should proceed?

Starting WICED v4.1.1

Platform BCM94343W_AVN initialised

Started ThreadX v5.6

Initialising NetX_Duo v5.7_sp2

Creating Packet pools

WWD SDIO interface initialised

WLAN MAC Address : B0:38:29:43:C0:3F

WLAN Firmware    : wl0: Jan 10 2017 19:57:03 version 7.45.98.6 (r663489) FWID 01-cf6f763a

WiFi Introducer Sensor Start

Joining : YOUR_AP_SSID

Failed to join : YOUR_AP_SSID

Joining : YOUR_AP_SSID

Failed to join : YOUR_AP_SSID

Joining : YOUR_AP_SSID

Failed to join : YOUR_AP_SSID

00:00:23.016640 GKI_create_task func=0x801c561  id=1  name=BTU  stack=0x0  stackSize=6144

00:00:23.025640 GKI_create_task func=0x801da79  id=0  name=HCISU  stack=0x0  stackSize=4096

<end of log>

joMa_1809706
Level 4
Level 4
10 likes received First like received First like given

(SOLVED) Found this in another thread...

Guys,
Please add 'featured_baud_rate' member to wiced_bt_config variable in platform.c file,if it is not there already.
For BCM9434W_AVN's platform.c file -  it should be like this:

/*BT chip specific configuration information*/

  const platform_bluetooth_config_t wiced_bt_config =                                                                                                                                                                                

  {

      .patchram_download_mode      = PATCHRAM_DOWNLOAD_MODE_MINIDRV_CMD,

      .patchram_download_baud_rate = 115200,

      .featured_baud_rate          = 115200

  };

I'll recommend trying the same for other platforms where BLE hello sensor app( or BLE ) failed.

Thanks,
Dharam

Contributors