Connect an Android tablet to Arduino 101

Hello,

I would like to connect my Samsung Galaxy Tab 2 tablet to an Arduino 101 board. My problem is how to start. I saw that I have to use a BLE service but I just don't know which one to take and how I do it. Does anyone have example code for me how to connect an Android device to an Arduino 101 with the on-board BLE unit?

Greets,

Sven

RidgyFive64: Hello,

I would like to connect my Samsung Galaxy Tab 2 tablet to an Arduino 101 board. My problem is how to start. I saw that I have to use a BLE service but I just don't know which one to take and how I do it. Does anyone have example code for me how to connect an Android device to an Arduino 101 with the on-board BLE unit?

Greets,

Sven

Well, you would need to program your tablet to do so. Luckily, there are some apps already done and you could try to follow the example:

https://www.arduino.cc/en/Tutorial/Genuino101CurieBLEHeartRateMonitor

The app is not the problem. I’ve build an Android app for my tablet, which has to connect to the Arduino.
But I wonder how to send data and receive data via the on-board BLE unit.
I have studied the Heart-rate example, but I think that BLEservice is useless for my purpose

I don’t think it is useless. Maybe you just don’t understand it correctly.
If you want to stream audio or video, BLE is probably not the right technology for you.

BLE is not like UART where you send unstructured data and it is up to your application to decode the information.

To understand BLE, you first have to understand GATT. The data you want to expose from your GATT server (Arduino 101) has to be advertised in the form of Services and Characteristics.

The Characteristics are the data you want to be read and/or written to in your Arduino. Characteristics that have a relationship together are grouped into a Service.

There is a good tutorial of how it works on the Android side of things there :

  • Do a scan to find your Bluetooth peripheral (Arduino)
  • Connect to it
  • Read/Write its Characteristics

On the Arduino side, the Heart Rate Monitor is a good example.
You can find some more examples on GitHub :

This book could be a great place to start for understanding the basics :
http://www.amazon.com/Make-Bluetooth-Projects-Raspberry-Smartphones/dp/1457187094
However, its using the Bluefruit from Adafruit instead of the Arduino 101. The API is similar though.

Good answers from FredBlais and edsa.

I can write/read perfectly over BLE from a Linux PC using bluepy, or gatttool (part of bluez). I've recently started to look at a custom Android BLE app - I do not think implementing the Android equivalent will be as easy, but the 101 is not the cause of the difficulty.

@DaveOR

I used gatttool and I was able to read/write my Arduino 101 with my Intel Edison and Udoo Neo. Can you tell me a bit more about how you get it to work with bluepy or give me some link to read?

Thanks :)

I've used bluepy on Edison with the 101. I'll come back with some details.