Any working bluetooth controller library for Arduino Nano ESP32?

Hello, I'm trying to connect a PS4 or Xbox One controller to my Arduino Nano ESP32 with the ESP32-BLE-Gamepad or Bluepad32 for NINA-W10 boards on platform io but when I'm trying to just upload code without using the Bluepad32 lib but while including it all those errors appears

In file included from /home/sasha/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:235, from .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/Controller.h:7, from .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/Controller.cpp:4: /home/sasha/.platformio/packages/framework-arduinoespressif32/cores/esp32/io_pin_remap.h:47:61: error: 'digitalPinToGPIONumber' is not a type #define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode) ^~~~~~~~~~~~~~~~~~~~~~ .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/Bluepad32.h:44:8: note: in expansion of macro 'pinMode' void pinMode(uint8_t pin, uint8_t mode); ^~~~~~~ /home/sasha/.platformio/packages/framework-arduinoespressif32/cores/esp32/io_pin_remap.h:42:65: error: 'digitalPinToGPIONumber' is not a type #define digitalRead(pin) digitalRead(digitalPinToGPIONumber(pin)) ^~~~~~~~~~~~~~~~~~~~~~ .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/Bluepad32.h:45:7: note: in expansion of macro 'digitalRead' int digitalRead(uint8_t pin); ^~~~~~~~~~~ /home/sasha/.platformio/packages/framework-arduinoespressif32/cores/esp32/io_pin_remap.h:46:66: error: 'digitalPinToGPIONumber' is not a type #define digitalWrite(pin, val) digitalWrite(digitalPinToGPIONumber(pin), val) ^~~~~~~~~~~~~~~~~~~~~~ .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/Bluepad32.h:46:8: note: in expansion of macro 'digitalWrite' void digitalWrite(uint8_t pin, uint8_t value); ^~~~~~~~~~~~ In file included from /home/sasha/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:235, from .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/Controller.h:7, from .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/Bluepad32.h:9, from .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/Bluepad32.cpp:4: /home/sasha/.platformio/packages/framework-arduinoespressif32/cores/esp32/io_pin_remap.h:47:61: error: 'digitalPinToGPIONumber' is not a type Indexing .pio/build/arduino_nano_esp32/lib085/libAdafruit PWM Servo Driver Library.a #define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode) ^~~~~~~~~~~~~~~~~~~~~~ .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/Bluepad32.h:44:8: note: in expansion of macro 'pinMode' void pinMode(uint8_t pin, uint8_t mode); ^~~~~~~ /home/sasha/.platformio/packages/framework-arduinoespressif32/cores/esp32/io_pin_remap.h:42:65: error: 'digitalPinToGPIONumber' is not a type #define digitalRead(pin) digitalRead(digitalPinToGPIONumber(pin)) ^~~~~~~~~~~~~~~~~~~~~~ .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/Bluepad32.h:45:7: note: in expansion of macro 'digitalRead' int digitalRead(uint8_t pin); ^~~~~~~~~~~ /home/sasha/.platformio/packages/framework-arduinoespressif32/cores/esp32/io_pin_remap.h:46:66: error: 'digitalPinToGPIONumber' is not a type #define digitalWrite(pin, val) digitalWrite(digitalPinToGPIONumber(pin), val) ^~~~~~~~~~~~~~~~~~~~~~ .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/Bluepad32.h:46:8: note: in expansion of macro 'digitalWrite' void digitalWrite(uint8_t pin, uint8_t value); ^~~~~~~~~~~~ /home/sasha/.platformio/packages/framework-arduinoespressif32/cores/esp32/io_pin_remap.h:47:61: error: variable or field 'pinMode' declared void #define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode) ^~~~~~~~~~~~~~~~~~~~~~ .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/Bluepad32.cpp:44:17: note: in expansion of macro 'pinMode' void Bluepad32::pinMode(uint8_t pin, uint8_t mode) { ^~~~~~~ .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/Bluepad32.cpp:44:33: error: expected primary-expression before 'pin' void Bluepad32::pinMode(uint8_t pin, uint8_t mode) { ^~~ /home/sasha/.platformio/packages/framework-arduinoespressif32/cores/esp32/io_pin_remap.h:47:84: note: in definition of macro 'pinMode' #define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode) ^~~ .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/Bluepad32.cpp:44:46: error: expected primary-expression before 'mode' void Bluepad32::pinMode(uint8_t pin, uint8_t mode) { ^~~~ /home/sasha/.platformio/packages/framework-arduinoespressif32/cores/esp32/io_pin_remap.h:47:90: note: in definition of macro 'pinMode' #define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode) ^~~~ /home/sasha/.platformio/packages/framework-arduinoespressif32/cores/esp32/io_pin_remap.h:42:65: error: 'int Bluepad32::digitalRead' is not a static data member of 'class Bluepad32' #define digitalRead(pin) digitalRead(digitalPinToGPIONumber(pin)) ^~~~~~~~~~~~~~~~~~~~~~ .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/Bluepad32.cpp:67:16: note: in expansion of macro 'digitalRead' int Bluepad32::digitalRead(uint8_t pin) { ^~~~~~~~~~~ .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/Bluepad32.cpp:67:36: error: expected primary-expression before 'pin' int Bluepad32::digitalRead(uint8_t pin) { ^~~ /home/sasha/.platformio/packages/framework-arduinoespressif32/cores/esp32/io_pin_remap.h:42:88: note: in definition of macro 'digitalRead' #define digitalRead(pin) digitalRead(digitalPinToGPIONumber(pin)) ^~~ /home/sasha/.platformio/packages/framework-arduinoespressif32/cores/esp32/io_pin_remap.h:46:66: error: variable or field 'digitalWrite' declared void #define digitalWrite(pin, val) digitalWrite(digitalPinToGPIONumber(pin), val) ^~~~~~~~~~~~~~~~~~~~~~ .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/Bluepad32.cpp:117:17: note: in expansion of macro 'digitalWrite' void Bluepad32::digitalWrite(uint8_t pin, uint8_t value) { ^~~~~~~~~~~~ .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/Bluepad32.cpp:117:38: error: expected primary-expression before 'pin' void Bluepad32::digitalWrite(uint8_t pin, uint8_t value) { ^~~ /home/sasha/.platformio/packages/framework-arduinoespressif32/cores/esp32/io_pin_remap.h:46:89: note: in definition of macro 'digitalWrite' #define digitalWrite(pin, val) digitalWrite(digitalPinToGPIONumber(pin), val) ^~~ .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/Bluepad32.cpp:117:51: error: expected primary-expression before 'value' void Bluepad32::digitalWrite(uint8_t pin, uint8_t value) { ^~~~~ /home/sasha/.platformio/packages/framework-arduinoespressif32/cores/esp32/io_pin_remap.h:46:95: note: in definition of macro 'digitalWrite' #define digitalWrite(pin, val) digitalWrite(digitalPinToGPIONumber(pin), val) ^~~ *** [.pio/build/arduino_nano_esp32/liba3e/Bluepad32 for NINA-W10 boards/Controller.cpp.o] Error 1 Compiling .pio/build/arduino_nano_esp32/FrameworkArduino/USB.cpp.o *** [.pio/build/arduino_nano_esp32/liba3e/Bluepad32 for NINA-W10 boards/Bluepad32.cpp.o] Error 1 .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/utility/spi_drv.cpp: In static member function 'static void SpiDrv::begin()': .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/utility/spi_drv.cpp:91:20: error: 'PINS_COUNT' was not declared in this scope if (SLAVERESET > PINS_COUNT) { ^~~~~~~~~~ .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/utility/spi_drv.cpp:91:20: note: suggested alternative: 'ICOUNT' if (SLAVERESET > PINS_COUNT) { ^~~~~~~~~~ ICOUNT In file included from /home/sasha/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:235, from .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/utility/spi_drv.cpp:23: .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/utility/spi_drv.cpp:100:11: error: 'NINA_GPIO0' was not declared in this scope pinMode(NINA_GPIO0, OUTPUT); ^~~~~~~~~~ /home/sasha/.platformio/packages/framework-arduinoespressif32/cores/esp32/io_pin_remap.h:47:84: note: in definition of macro 'pinMode' #define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode) ^~~ .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/utility/spi_drv.cpp:100:11: note: suggested alternative: 'NINA_GPIOIRQ' pinMode(NINA_GPIO0, OUTPUT); ^~~~~~~~~~ /home/sasha/.platformio/packages/framework-arduinoespressif32/cores/esp32/io_pin_remap.h:47:84: note: in definition of macro 'pinMode' #define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode) ^~~ .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/utility/spi_drv.cpp: In static member function 'static int SpiDrv::available()': .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/utility/spi_drv.cpp:66:22: error: 'NINA_GPIO0' was not declared in this scope #define NINA_GPIOIRQ NINA_GPIO0 ^~~~~~~~~~ /home/sasha/.platformio/packages/framework-arduinoespressif32/cores/esp32/io_pin_remap.h:42:88: note: in definition of macro 'digitalRead' #define digitalRead(pin) digitalRead(digitalPinToGPIONumber(pin)) ^~~ .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/utility/spi_drv.cpp:539:47: note: in expansion of macro 'NINA_GPIOIRQ' int SpiDrv::available() { return (digitalRead(NINA_GPIOIRQ) != LOW); } ^~~~~~~~~~~~ .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/utility/spi_drv.cpp:66:22: note: suggested alternative: 'NINA_GPIOIRQ' #define NINA_GPIOIRQ NINA_GPIO0 ^~~~~~~~~~ /home/sasha/.platformio/packages/framework-arduinoespressif32/cores/esp32/io_pin_remap.h:42:88: note: in definition of macro 'digitalRead' #define digitalRead(pin) digitalRead(digitalPinToGPIONumber(pin)) ^~~ .pio/libdeps/arduino_nano_esp32/Bluepad32 for NINA-W10 boards/src/utility/spi_drv.cpp:539:47: note: in expansion of macro 'NINA_GPIOIRQ' int SpiDrv::available() { return (digitalRead(NINA_GPIOIRQ) != LOW); } ^~~~~~~~~~~~ *** [.pio/build/arduino_nano_esp32/liba3e/Bluepad32 for NINA-W10 boards/utility/spi_drv.cpp.o] Error 1 ============================================================================== [FAILED] Took 4.15 seconds ==============================================================================

or with ESP32-BLE-Gamepad
.pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleGamepadConfiguration.cpp: In constructor 'BleGamepadConfiguration::BleGamepadConfiguration()': .pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleGamepadConfiguration.cpp:30:62: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] _transmitPowerLevel(9) ^ .pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleGamepadConfiguration.cpp:30:62: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] .pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleGamepadConfiguration.cpp:30:62: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] .pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleGamepadConfiguration.cpp:30:62: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] .pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleGamepadConfiguration.cpp:30:62: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] .pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleNUS.cpp: In member function 'void BleNUS::begin()': .pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleNUS.cpp:21:5: error: 'delay' was not declared in this scope delay(1000); // Give some time for other services to complete their business ^~~~~ .pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleNUS.cpp:24:9: error: 'Serial' was not declared in this scope Serial.println("No pServer"); ^~~~~~ .pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleNUS.cpp:24:9: note: suggested alternative: 'Stream' Serial.println("No pServer"); ^~~~~~ Stream .pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleNUS.cpp:43:21: warning: 'bool NimBLEService::start()' is deprecated: NimBLEService::start() has no effect. Services are started when the server is started. [-Wdeprecated-declarations] pService->start(); ^ In file included from .pio/libdeps/arduino_nano_esp32/NimBLE-Arduino/src/NimBLEDevice.h:299, from .pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleNUS.h:4, from .pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleNUS.cpp:1: .pio/libdeps/arduino_nano_esp32/NimBLE-Arduino/src/NimBLEService.h:51:10: note: declared here bool start() { return true; } ^~~~~ .pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleNUS.cpp: In member function 'void BleNUS::print(long int)': .pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleNUS.cpp:127:5: error: 'ltoa' was not declared in this scope ltoa(l, buf, 10); ^~~~ .pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleNUS.cpp:127:5: note: suggested alternative: 'utoa' ltoa(l, buf, 10); ^~~~ utoa .pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleNUS.cpp: In member function 'void BleNUS::print(long unsigned int)': .pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleNUS.cpp:133:5: error: 'ultoa' was not declared in this scope ultoa(ul, buf, 10); ^~~~~ .pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleNUS.cpp:133:5: note: suggested alternative: 'utoa' ultoa(ul, buf, 10); ^~~~~ utoa .pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleNUS.cpp: In member function 'void BleNUS::print(float, int)': .pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleNUS.cpp:139:5: error: 'dtostrf' was not declared in this scope dtostrf(f, 6, digits, buf); ^~~~~~~ .pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleNUS.cpp:139:5: note: suggested alternative: 'strstr' dtostrf(f, 6, digits, buf); ^~~~~~~ strstr Compiling .pio/build/arduino_nano_esp32/FrameworkArduino/USBCDC.cpp.o *** [.pio/build/arduino_nano_esp32/lib864/ESP32-BLE-Gamepad/BleNUS.cpp.o] Error 1 .pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleGamepad.cpp: In static member function 'static void BleGamepad::taskServer(void*)': .pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleGamepad.cpp:2060:42: warning: 'void NimBLEHIDDevice::startServices()' is deprecated: Services are now started by the server when start() is called, this function is no longer needed and will be removed in a future release. [-Wdeprecated-declarations] BleGamepadInstance->hid->startServices(); ^ In file included from .pio/libdeps/arduino_nano_esp32/ESP32-BLE-Gamepad/BleGamepad.cpp:4: .pio/libdeps/arduino_nano_esp32/NimBLE-Arduino/src/NimBLEHIDDevice.h:52:27: note: declared here void startServices() __attribute__((deprecated("Services are now started by the server when start() is called, " ^~~~~~~~~~~~~ ============================================================================== [FAILED] Took 7.50 seconds ==============================================================================

Can someone help me resolving those errors or finding an another working library?

Is this file in the library? arduino-esp32/cores/esp32/io_pin_remap.h at master · espressif/arduino-esp32 · GitHub

I also see "deprecated" a few times... maybe the library needs to be refreshed/reinstalled?

for the ESP32S3 have you tried example programs under File>Examples>BLE ?

First learn how to post code and error logs by reading the pinned post re 'How to get the most from the forum'.
Post the code so we can test it.
Which of the 3 or 4 types of bluetooth are you talking about. You must be specific.

the Arduino Nano ESP32 has an on onboard ESP32-S3 which supports BLE 5.0 - see Comparison chips (SoCs) table for ESP8266/ESP32/ESP32-S2/ESP32-S3/ESP32-C3/ESP32-C6
in particular NOT Bluetooth Classic

I suspect the problem is using PlatformIO with its outdated ESP32 core, not necessarily the BLE libraries. I'd recommend trying the Arduino IDE instead.

That uses the ESP32-S3. I vaguely recall reading that this processor is not compatible with Bluepad32. Try one of the original ESP32 boards (WROVER, etc.) and Arduino IDE 1.8.19.

Don't worry I know how to post logs, I didn't specified that I've wrote code, I just added the libs into the platformio.ini lib_deps and it didn't compiled at all without code and concerning bluetooth I don't know if it changes something but it's not important to me to have a specific bluetooth type any of the types is gonna be good to me as long as it works.

That is the point, BLE can not 'talk' to classic etc.

Then why did you not use a code block in post 1?
Adieu.