Bluetooth LE Demo on the DEV-IOT6U

From wiki.emacinc.com
Jump to: navigation, search

Intro

Here we will demonstrate basic Bluetooth LE (low energy) connectivity between a smartphone (android/iOS) device and the DEV-IOT6U Development Kit. The application will connect to the DEV-IOT6U via the onboard Murata LBEE5kl1dx-883 radio module, once connected the user can 'wirelessly' send and recieve text messages to the dev kit.

Required Materials

  • Android device/iOS (Smartphone)

  • DEV-IOT6U Development Kit

  • A personal computer

Steps

ON YOUR PC:

  1. Connect your dev kit to your personal computer using a microUSB cable and start a serial terminal connection. (Steps Here)

  2. Enter the following commands into the serial terminal to launch the bluetooth application

    root@somimx6ul:~ bluetoothctl
    [bluetoothctl] system-alias "EMAC Demo"
    [bluetoothctl] default-agent
    [bluetoothctl] menu gatt
    [bluetoothctl] register-service 0xFFFF # (Choose yes when asked if primary service)
    [bluetoothctl] register-characteristic 0xAAAA read,write # (Select a value of 2 when prompted)
    [bluetoothctl] register-application # (This commits the services/characteristics and registers the profile)
    [bluetoothctl] back
    [bluetoothctl] advertise on

    The DEV-IOT6U bluetooth connection should now be discoverable.

ON YOUR ANDROID/iOS DEVICE:

  1. Download the BLE Scanner App from the Google Play Store or Apple App Store

  2. Open the app

  3. Find the EMAC Demo entry. You may be asked to enter an alias for the device.
    DevIOT6U BLEDemo1.PNG

  4. Click CONNECT

    • enter yes in the dev kit terminal to allow pairing, and yes on the smartphone
  5. On the next screen, click the arrow next to Custom Service

  6. Clicking on the ‘Write,Read’ button on Custom AAAA, then "Write", opens a text box that allowsyou to write a value to the dev kit. "Text" can be selected to send a alphanumeric message to the dev kit's bluetooth controller. These messages can be viewed in the terminal.
    Clicking "Read" reads back a default value set in the register characteristics command.

    DevIOT6U BLEDemo2.PNG DevIOT6U BLEDemo3.PNG DevIOT6U BLEDemo4.PNG DevIOT6U BLEDemo5.PNG


Further Information

  • Getting Started with the DEV-IOT6U
  • Wifi and Bluetooth on the DEV-IOT6U