Skip to content

Conversation

JuniorPolegato
Copy link

Hi!

I made some adjustments for compatibility with new versions of BLE and NimBLE.

@awong1900
Copy link

awong1900 commented Aug 5, 2025

That is good job. Do this branch support nimble v2.3.x and esp arduino 3.0?

@JuniorPolegato
Copy link
Author

JuniorPolegato commented Aug 6, 2025

That is good job. Do this branch support nimble v2.3.x and esp arduino 3.0?

Hi! Thanks.

Yes, I compiled with "esp32 by Espressif Systems Version 3.2.1" and with (and without) "NimBLE-Arduino by H2zero Version 2.3.2" and this test code:

#include <Arduino.h>
#include <BleKeyboard.h>

BleKeyboard bleKeyboard;

void setup() {
  Serial.begin(115200, SERIAL_8N1);
  while (!Serial);

  Serial.println("\n\n\n\nBLE Keyborad test...\n\n\n\n\n");

  bleKeyboard.setName("Keyboard");
  bleKeyboard.begin();
  bleKeyboard.setDelay(30);
}

void loop() {
  static size_t buffer_len;
  if (bleKeyboard.isConnected()) {
    if ((buffer_len = Serial.available())) {
      char data[buffer_len + 1];
      Serial.read(data, buffer_len);
      data[buffer_len] = '\0';
      Serial.print(data);
      Serial.flush();
      bleKeyboard.print(data);
      bleKeyboard.flush();
    }
    else {
      Serial.print("-");
    }
  }
  else {
    Serial.print(".");
  }
  Serial.flush();
  delay(300);
}

@StuDentBRz
Copy link

Sorry for being noob where can I download the updated version of the the library that you made? Tried to download on your github page by clicking on code and download zip, installed the library on ide but got an error while was compiling the code on it...

@JuniorPolegato
Copy link
Author

Hi!

You need to extract the zip file in the libraries directory for your user, in my case it is "/home/junior/projects/arduino/libraries".
Search on your settings.
I use VSCodium with Arduino Community extension, instead of ArduinoIDE or PlatformIO.

@JuniorPolegato
Copy link
Author

JuniorPolegato commented Aug 10, 2025

Hi!

I updated to "esp32 by Espressif Systems Version 3.3.0", this fix was necessary:
espressif/arduino-esp32#11681
I manually modified the file ~/.arduino15/packages/esp32/hardware/esp32/3.3.0/libraries/BLE/src/BLESecurity.cpp, adding the new lines from this fix.

I also updated to "NimBLE-Arduino by H2zero Version 2.3.4".

I can now confirm that the code works fine in these versions with "#define USE_NIMBLE" or "#undef USE_NIMBLE".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants