Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
WINC3400 Provisioning and Battery Application - SAME70 XPlained Pro Documentation

Introduction

This example demonstrates Wi-Fi provision via BLE using the WINC3400 Wi-Fi/BLE module and Battery Profile
It uses the following hardware:

  • SAM Xplained Pro.
  • the WINC3400 module on EXT1.
  • thirdparty Android device.

Main Files

  • battery_app_s.c : Initialize the SAM board and perform BLE provisioning and then starts Battery Profile

Usage

  1. To connect the SAM board to the internet Access Point over Wi-Fi, the user must
  2. provide credentials (SSID and passphrase) over BLE. As a first step, it is required
  3. that the user install the Microchip Bluetooth Data application available available in the Android
  4. play store on to an any Android device.
  5. Then, power up the SAM board and run the Android application: perform a scan, select
  6. an SSID and enter the passphrase.
  7. Finally, press connect and enter the PIN code "123456".
  8. If connection to AP is successful, WINC3400 BLE will start beaconing.
  9. After Successful Wi-Fi connection, this application switch to BLE Proximity profile.
  10. Then run the Android application: perform a scan, select
  11. "MCHP-BAS" to get start with the Battery service.
  12. The application show the level of Battery available in the connected Mobile.
  13. Build the program and download it into the board.
  14. On the computer, open and configure a terminal application as the follows.
    * Baud Rate : 115200
    * Data : 8bit
    * Parity bit : none
    * Stop bit : 1bit
    * Flow control : none
    *
  15. Start the application.
  16. In the terminal window, the following text should appear:
    * -- Wifi BLE Provisioning demo with Battery--
    * -- SAMXXX_XPLAINED_PRO --
    * -- Compiled: Jun xx xxxx xx:xx:xx --
    * (APP)(INFO)Chip ID 3400d2
    * (APP)(INFO)Curr driver ver: x.x.x
    * (APP)(INFO)Curr driver HIF Level: (2) x.x
    * (APP)(INFO)Fw HIF: 8104
    * (APP)(INFO)Firmware HIF (2) : x.x
    * (APP)(INFO)Firmware ver : x.x.x
    * (APP)(INFO)Firmware Build <Month> DD YYYY Time xx:xx:xx
    * (APP)(INFO)Ota HIF: xxxx
    * (APP)(INFO)OTP MAC
    * (APP)(INFO)MAC Address: xx:xx:xx:xx:xx:xx
    * (APP)(INFO)M2M_NO_PS
    * (APP)(INFO)POWER SAVE 0
    * (APP)(INFO)Reset provision data(APP)(INFO)BLE provisioning started
    * (APP)(INFO)Provisioning Failed
    * (APP)(INFO)BLE provisioning started
    * (APP)(INFO)Provisioned AP:(APP)(INFO)Sec type : 2(APP)(INFO)SSID : XXX(APP)(INFO)Passphrase : XXXXXX(APP)(INFO)Provisioning data received
    * (APP)(INFO)Retrieving ssid...
    * (APP)(INFO) have valid ssid(APP)(INFO)WiFi Connect: using provisioned AP(APP)(INFO)Wifi State :: CONNECTED ::
    * (APP)(INFO)DHCP IP Address :: xxx.xxx.x.x ::
    * (APP)(INFO)WiFi Connected up to layer 3
    * (APP)(INFO)Provisioning Complete
    * BLE is initializing
    * Device Name: MCHP-BLE
    * Initializing Battery Service Application
    * BLE Started Adv
    *
    * Battery Level:x%
    * Battery Level:xx%
    * Battery Level:xxx%
    *

Compilation Information

This software was written for the GNU GCC compiler using Atmel Studio 7.0 Other compilers are not guaranteed to work.

Contact Information

For further information, visit Microchip.