Introduction: LinkIt One : AT Commands Over Bluetooth SPP

In this instructable, I'll be discussing how to use Bluetooth SPP for LinkIt One to work as a AT interface to the development board.

In short, you can try these commands through Bluetooth to LinkIt One and can get reponse

  1. AT+GET_BATTERY : Read battery charge, and charging status
  2. AT+GET_ANALOG : Read analog pin values
  3. AT+SET_LED<0> : Set LED at pin 13 to OFF
  4. AT+SET_LED<1> : Set LED at pin 13 to ON

Step 1: Add AT_CMD_arduino Library to Arduino IDE

Follow these steps :

  1. Goto https://github.com/loovee/AT_CMD_Arduino
  2. Download the ZIP file
  3. In Arduino IDE, goto Sketch -> Add LIbrary -> Add .ZIP Library
  4. Browse to downloaded ZIP file and click OK

This will install the library to your arduino IDE

Step 2: Sketch You LinkIt One

Please find the complete sketch attached.

  1. In setup(), we are initializing BL SPP interface and setting the AT command sets
  2. In loop(), we are continuously monitoring for AT commands through BL SPP interface.
  3. Other three function - setLed(), getBattery(), getAnalog() - provides the handlers for related AT commands

Step 3: Installing Android App and Testing

To test the sketch, install Bluetooth SPP tools Pro from https://play.google.com/store/apps/details?id=mobi...

  1. Now unpair your LinkIt One, if you have already paired it with your phone.
  2. Goto Bluetooth SPP tools Pro, scan for devices.
  3. Select your LinkIt One device once it's shown in the list.
  4. Click to Pair and then Connect
  5. Use 'Command Line Mode' and select '\r\n' as delimiter.
  6. Now you will be able to send AT commands to your LinkIt One

Currently the following commands are supported :

  1. AT+GET_BATTERY
  2. AT+GET_ANALOG
  3. AT+SET_LED<0>
  4. AT+SET_LED<1>

A demo video is attached.

Happy Making,

vish

Comments

About This Instructable

622views

3favorites

License:

More by v-i-s-h:IoT enabled Solar Power Harnessing (intel IoT)LinkIt One : Adding an ePaper displayLinkIt One Control : The GATT Way
Add instructable to: