Connecting my bluetooh esp with my mit code


#include <BLEDevice.h>

#include <BLEServer.h>

#include <BLEUtils.h>

#include <BLE2902.h>

#define SERVICE_UUID "6e400001-b5a3-f393-e0a9-e50e24dcca9e"
#define CHARACTERISTIC_UUID "6e400002-b5a3-f393-e0a9-e50e24dcca9e"

BLECharacteristic *pCharacteristic;

BLEDevice::init("Guitar");

BLEServer *pServer = BLEDevice::createServer();

BLEService *pService = pServer->createService(SERVICE_UUID);

pCharacteristic = pService->createCharacteristic(

CHARACTERISTIC_UUID,

BLECharacteristic::PROPERTY_WRITE |

BLECharacteristic::PROPERTY_READ |

BLECharacteristic::PROPERTY_NOTIFY

);

pCharacteristic->addDescriptor(new BLE2902());

pCharacteristic->setCallbacks(new MyCallbacks());

pService->start();

BLEAdvertising *pAdvertising = BLEDevice::getAdvertising();

pAdvertising->addServiceUUID(SERVICE_UUID);

pAdvertising->setScanResponse(true);

BLEDevice::startAdvertising(); // more explicit

Serial.println("BLE Ready and Advertising!");

This is the bulk og my led code related to the connections, and ill be honest, i dont really know whats gone wrong, so if anyone could provide some help that would be amazing!! :slight_smile:

Your characteristic UUIDs differ between the sketch and the text block. (1 vs 2)