Bluetooth LE Demo on the DEV-IOT6U
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:
-
Connect your dev kit to your personal computer using a microUSB cable and start a serial terminal connection. (Steps Here)
- Enable Bluetooth ( Steps Covered Here )
-
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:
-
Download the BLE Scanner App from the Google Play Store or Apple App Store
-
Open the app
-
Find the EMAC Demo entry. You may be asked to enter an alias for the device.
-
Click CONNECT
- enter yes in the dev kit terminal to allow pairing, and yes on the smartphone
-
On the next screen, click the arrow next to Custom Service
-
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.