Bluetooth unable to connect - AES failed... retrying: 0

Hello all,

I’m trying to run a simple Bluetooth test on a custom Artemis board:

#include <ArduinoBLE.h>

BLEService customService("19B10000-E8F2-537E-4F6C-D104768A1214"); // Define a custom service UUID
BLEStringCharacteristic customCharacteristic("19B10001-E8F2-537E-4F6C-D104768A1214", BLERead | BLEWrite, 100); // Use a default UUID

void setup() {
  // Start BLE
  BLE.begin();
  
  // Set a local name for the device
  BLE.setLocalName("test");
  
  // Add the service and characteristic
  customService.addCharacteristic(customCharacteristic);
  BLE.addService(customService);
  
  // Start advertising
  BLE.advertise();
  
  Serial.begin(9600);
}

void loop() {
  // Your Arduino code logic goes here
  
  // Read the value from the characteristic
  BLEDevice central = BLE.central();
  if (central) {
    if (customCharacteristic.written()) {
      Serial.println("Received: " + customCharacteristic.value());
    }
  }
}

My PC recognizes the module (with the name “test”) but when trying to connect I get the following error:

AES failed... retrying: 0

In Serial output

How should I fix this?

That usually points to an error with the authentication; ensure the libraries are up to date and double-check that the bluetooth mode is compatible

Can you pair it with the default BLE sketch?

All libraries are up to date, default BLE sketch doesn’t pair, what do you mean by compatible bluetooth mode?

The flavors of bluetooth - Some devices use SPP, some are BLE only, etc

What is custom about the board? Maybe there’s something funky going on?

Hi there. I have the same problem. Using Artemis Thing Plus board and latest adruino library. Standard laptop with Win10 installed. It finds the buetooth service but during connecting getting the AES failed error message.