Overview
This article explains what a GATT error is when attempting to use Bluetooth (BLE) with the micro:bit app on an iOS or Android device, and provides guidance on how to troubleshoot a GATT error that occurs.
How a GATT error is generated
If you are using the micro:bit with the mobile apps, you may encounter a GATT error when attempting to flash a program to the device.
The Generic Attribute Profile (GATT) defines the way two Bluetooth devices exchange data, for example, a micro:bit and a mobile phone.
The mobile device or tablet, also known as the central device, will search to see if the micro:bit (peripheral device) is advertising a service that allows the mobile device or tablet to connect to it. The connection between the central device and the peripheral is exclusive. If the connection cannot be established or if the service is not found, it will result in a GATT error.
Troubleshooting a GATT error
A peripheral can only be connected to one (central) device at a time.
You may need to 'forget' the micro:bit in the Bluetooth settings on your mobile or tablet device before attempting to pair.
You may need to use a computer to send a hex file to the micro:bit via USB using the drag-and-drop method to the MICROBIT drive. The recommended hex file to use is the 'meet the micro:bit' program, as it resets the micro:bit.
The micro:bit should always be in pairing mode before attempting to connect your device (iPhone, iPad, or Android device), either using the 'pressing the reset button 3 times' method or 'while holding the A + B buttons, press the reset button, then releasing the A + B buttons' method. Either method should result in the Bluetooth symbol appearing on the micro:bit display.
Once a peripheral connects to a central device, no other devices can connect until the existing connection is broken.
When you try to flash a program, the mobile device or tablet will search to see if the micro:bit is advertising a service that lets it send a program to it. If it does not find the service, it will result in a GATT error.
Common errors include:
DFU SERVICE NOT FOUND
DFU CHARACTERISTICS NOT FOUND
A complete list can be found in the Android App repository on GitHub.
If you see a GATT error, please submit a support ticket.
If you are comfortable using GitHub, you can check all the current issues reported for the micro:bit Android app at https://github.com/microbit-foundation/microbit-android/issues.
Further information
There is an excellent introduction to GATT on the Adafruit website.