5

I know it's pretty standard to set up an Arduino system as a BLE client, and use something like an app running on a smartphone as the GATT server, which receives the data and does something with it.

In my scenario I have a BLE sensor that is not connected directly to the Arduino system, and I want the Arduino to be able to respond to the sensor output (a wearable accelerometer) and, for example, initiate various lighting sequences depending on the data being received.

I would prefer not to introduce a third component (ie: mobile device as GATT server) into the equation. I'd like for the Arduino to listen to the remote device's services and characteristics, analyze the incoming data and then make some decisions about what LEDs to illuminate based on that analysis.

Can an Arduino run as a GATT server?

dda
1,5951 gold badge12 silver badges17 bronze badges
asked Jan 8, 2016 at 14:43
6
  • 1
    You have it precisely backward. The GATT server is the peripheral device. The client is typically a mobile device. That said, I'm looking into this exact thing right now. The Arduino 101's Nordic module is capable of running in Central mode, but I'm unable to find any info on loading the S120 Soft Device. I have read that the Arduino lib doesn't have an API for it though. Theoretically possible, but I haven't figured out how to do it yet. Commented Aug 18, 2016 at 0:10
  • Does it have to be an Arduino or can it be Arduino IDE compatible? - e.g. something like the Adafruit Feather Bluefruit LE module? Commented Oct 10, 2019 at 11:56
  • Sure, I think @Simon Commented Oct 30, 2019 at 16:41
  • @Tom Auger There is an Adafruit Feather 32u4 Bluefruite LE module, you can interact with the BLE part using AT commands, it's pretty basic and can only act as a Server/Peripheral device. It doesn't support notifications or indications, but you can define a custom service with it's own characteristics. Commented Nov 1, 2019 at 10:52
  • 1
    @ Tom Auger The ESP32 modules also support BLE, but I haven't played with that aspect of the module. Looking at the examples available for the ESP32, that can be both a GATT Client and a GATT Server. Commented Nov 1, 2019 at 10:54

2 Answers 2

0

An ESP32 module (Arduino IDE compatible) can act as both a GATT Client and Server, and there are module examples for each of these, as well as github projects.

answered Nov 1, 2019 at 10:57
1
  • I'll be checking that out soon. To make your answer more complete, you might post some example code or at the minimum some links, for the benefit of others that Google this question. Commented Nov 2, 2019 at 13:43
-1

I got this link here that could be helpful - link at the bottom. It is a tutorial that shows you how to control your Arduino with a custom app on an Android. It uses the MIT app creator, an app that lets you create an app. You program it with there IDE in some Java I believe. You can add button to your app so that is sends a message to your Arduino then program the Arduino to do something when it receives that message. For the Arduino side, you could buy an HC-05 Bluetooth module. It is both an transmitter and receiver. It is quite cheap and very popular so there is many libraries out there. I think this is a good module you should get and I recommend to get them in pairs so you can connect them together with 2 Arduinos.

https://www.youtube.com/watch?v=E-1w7dL3Cps

answered Oct 5, 2016 at 15:13
1
  • Not applicable to the question asked. An HC-05 is a classic bluetooth device. This question is about BLE aka BTLE which is a very different standard, arguably having little more than the word "bluetooth" in common with one another. Commented Jul 3, 2017 at 3:15

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.