Bluetooth LE Demo on the DEV-IOT6U

From wiki.emacinc.com
Revision as of 14:20, 29 September 2020 by Btisler (talk | contribs) (Created page with "==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 wi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 RS9116 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 and 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