DabbleESP32 library compilation failure: "'ledcAttachPin' was not declared in this scope"

Tried to re load my sketch but got this error:

c:\Users\jorvi\Documents\Arduino\libraries\DabbleESP32\src\LedControlModule.cpp: In member function 'virtual void LedControlModule::processData()':
c:\Users\jorvi\Documents\Arduino\libraries\DabbleESP32\src\LedControlModule.cpp:36:33: error: 'ledcAttachPin' was not declared in this scope; did you mean 'ledcAttach'?
   36 |                                 ledcAttachPin(pin,currentChannel);
      |                                 ^~~~~~~~~~~~~
      |                                 ledcAttach
c:\Users\jorvi\Documents\Arduino\libraries\DabbleESP32\src\LedControlModule.cpp:37:33: error: 'ledcSetup' was not declared in this scope
   37 |                                 ledcSetup(currentChannel,100,8);
      |                                 ^~~~~~~~~
c:\Users\jorvi\Documents\Arduino\libraries\DabbleESP32\src\esp32BLEUtilities.cpp: In member function 'virtual void BleCallbacks::onWrite(BLECharacteristic*)':
c:\Users\jorvi\Documents\Arduino\libraries\DabbleESP32\src\esp32BLEUtilities.cpp:29:57: error: conversion from 'String' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   29 |       std::string rx_Value = bleCharacteristic->getValue();
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
c:\Users\jorvi\Documents\Arduino\libraries\DabbleESP32\src\esp32BLEUtilities.cpp: In member function 'void Esp32ble::begin(std::string)':
c:\Users\jorvi\Documents\Arduino\libraries\DabbleESP32\src\esp32BLEUtilities.cpp:55:19: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'String'
   55 |   BLEDevice::init(a);
      |                   ^
      |                   |
      |                   std::string {aka std::__cxx11::basic_string<char>}
In file included from c:\Users\jorvi\Documents\Arduino\libraries\DabbleESP32\src\esp32BLEUtilities.h:5,
                 from c:\Users\jorvi\Documents\Arduino\libraries\DabbleESP32\src\esp32BLEUtilities.cpp:2:
C:\Users\jorvi\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.11\libraries\BLE\src/BLEDevice.h:203:27: note:   initializing argument 1 of 'static bool BLEDevice::init(String)'
  203 |   static bool init(String deviceName = "");
      |                    ~~~~~~~^~~~~~~~~~~~~~~
c:\Users\jorvi\Documents\Arduino\libraries\DabbleESP32\src\esp32BLEUtilities.cpp: In member function 'void Esp32ble::write(std::string)':
c:\Users\jorvi\Documents\Arduino\libraries\DabbleESP32\src\esp32BLEUtilities.cpp:111:38: error: no matching function for call to 'BLECharacteristic::setValue(std::string&)'
  111 |         bleTxCharacteristic->setValue(x);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from C:\Users\jorvi\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.11\libraries\BLE\src/BLEServer.h:50,
                 from C:\Users\jorvi\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.11\libraries\BLE\src/BLEDevice.h:57:
C:\Users\jorvi\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.11\libraries\BLE\src/BLECharacteristic.h:214:8: note: candidate: 'void BLECharacteristic::setValue(const uint8_t*, size_t)'
  214 |   void setValue(const uint8_t *data, size_t size);
      |        ^~~~~~~~
C:\Users\jorvi\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.11\libraries\BLE\src/BLECharacteristic.h:214:8: note:   candidate expects 2 arguments, 1 provided
C:\Users\jorvi\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.11\libraries\BLE\src/BLECharacteristic.h:215:8: note: candidate: 'void BLECharacteristic::setValue(const String&)'
  215 |   void setValue(const String &value);
      |        ^~~~~~~~
C:\Users\jorvi\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.11\libraries\BLE\src/BLECharacteristic.h:215:31: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const String&'
  215 |   void setValue(const String &value);
      |                 ~~~~~~~~~~~~~~^~~~~
C:\Users\jorvi\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.11\libraries\BLE\src/BLECharacteristic.h:216:8: note: candidate: 'void BLECharacteristic::setValue(uint16_t)'
  216 |   void setValue(uint16_t data16);
      |        ^~~~~~~~
C:\Users\jorvi\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.11\libraries\BLE\src/BLECharacteristic.h:216:26: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'uint16_t' {aka 'short unsigned int'}
  216 |   void setValue(uint16_t data16);
      |                 ~~~~~~~~~^~~~~~
C:\Users\jorvi\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.11\libraries\BLE\src/BLECharacteristic.h:217:8: note: candidate: 'void BLECharacteristic::setValue(uint32_t)'
  217 |   void setValue(uint32_t data32);
      |        ^~~~~~~~
C:\Users\jorvi\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.11\libraries\BLE\src/BLECharacteristic.h:217:26: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'uint32_t' {aka 'long unsigned int'}
  217 |   void setValue(uint32_t data32);
      |                 ~~~~~~~~~^~~~~~
C:\Users\jorvi\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.11\libraries\BLE\src/BLECharacteristic.h:218:8: note: candidate: 'void BLECharacteristic::setValue(int)'
  218 |   void setValue(int data32);
      |        ^~~~~~~~
C:\Users\jorvi\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.11\libraries\BLE\src/BLECharacteristic.h:218:21: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int'
  218 |   void setValue(int data32);
      |                 ~~~~^~~~~~
C:\Users\jorvi\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.11\libraries\BLE\src/BLECharacteristic.h:219:8: note: candidate: 'void BLECharacteristic::setValue(float)'
  219 |   void setValue(float data32);
      |        ^~~~~~~~
C:\Users\jorvi\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.11\libraries\BLE\src/BLECharacteristic.h:219:23: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'float'
  219 |   void setValue(float data32);
      |                 ~~~~~~^~~~~~
C:\Users\jorvi\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.11\libraries\BLE\src/BLECharacteristic.h:220:8: note: candidate: 'void BLECharacteristic::setValue(double)'
  220 |   void setValue(double data64);
      |        ^~~~~~~~
C:\Users\jorvi\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.11\libraries\BLE\src/BLECharacteristic.h:220:24: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'double'
  220 |   void setValue(double data64);
      |                 ~~~~~~~^~~~~~
Multiple libraries were found for "BLEDevice.h"
  Used: C:\Users\jorvi\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.11\libraries\BLE
  Not used: C:\Users\jorvi\Documents\Arduino\libraries\ArduinoBLE
exit status 1

Compilation error: exit status 1

Looks like you are using some old code that is not compatible with the 3.x.x ESP32 board package

You can either update the code or go back to an old 2.x.x version

I would update the code. Here is the 2 to 3 migration guide

As @jim-p wrote, the version of the DabbleESP32 library you are using was written for an old version of the "esp32" boards platform. Some breaking changes were made in the esp32 platform since that time, which rendered the library incompatible.

The good news is that the DabbleESP32 library code has since been updated to be compatible with the latest version of the esp32 platform. Unfortunately the maintainers of the DabbleESP32 library haven't made a new release since that time, so this is why you still encounter the incompatibility when using the version of DabbleESP32 installed via the Arduino Library Manager. The solution will be to install the latest development version of the library. I'll provide instructions you can follow to do that:

A. Uninstall Release Version of DabbleESP32 Library

The first thing to do is uninstall the incompatible installation of the library from your computer:

  1. Select Sketch > Include Library > Manage Libraries... from the Arduino IDE menus to open the "Library Manager" view in the left side panel.
  2. Type dabbleesp32 in the "Filter your search..." field.
  3. Find the "DabbleESP32" entry in the list of search results.
  4. Click the "REMOVE" button in the entry.
    An "Uninstall" dialog will open.
  5. Click the "YES" button in the "Uninstall" dialog to confirm that you want to uninstall the library.
    The dialog will close.
  6. Wait for the uninstall process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:

    ⓘ Successfully uninstalled library ...

B. Install Development Version of Library

  1. Click the following link to open the library's GitHub repository homepage in your web browser:
    https://github.com/STEMpedia/DabbleESP32
  2. Click the "Code ▾" button you see on that page.
  3. Select Download ZIP from the menu.
    A download of the ZIP file of the library will start.
  4. Wait for the download to finish.
  5. Select Sketch > Include library > Add .ZIP Library from the Arduino IDE menus.
    The "Select the zip file containing the library you'd like to add" dialog will open.
  6. Select the downloaded DabbleESP32-master.zip file from the dialog.
  7. Click the "Open" button.
    The dialog will close.
  8. If you already have an installation of the library, a "Do you want to overwrite the existing library?" dialog will now open. Click the "YES" button in the dialog.
  9. Wait for the installation process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:

    ⓘ Successfully installed library from ...

Now try compiling your sketch again, just as you did before when you encountered the error. Hopefully everything will work as expected now. If you still encounter an error, share it here and we'll provide further assistance.

The installed DabbleESP32 library is incompatible with ESP32 core 3.3.11. Don't downgrade the ESP32 core first. Update DabbleESP32 to its latest development version.

compiled this is the message got:
Sketch uses 1124147 bytes (85%) of program storage space. Maximum is 1310720 bytes.
Global variables use 43108 bytes (13%) of dynamic memory, leaving 284572 bytes for local variables. Maximum is 327680 bytes.
esptool v5.3.1
Serial port COM4:
Connecting......
Connected to ESP32 on COM4:
Chip type: ESP32-D0WD-V3 (revision v3.1)
Features: Wi-Fi, BT, Dual Core + LP Core, 240MHz, Vref calibration in eFuse, Coding Scheme None
Crystal frequency: 40MHz
MAC: 68:09:47:86:16:28

Uploading stub flasher...
Running stub flasher...
Stub flasher running.
Changing baud rate to 921600...
Changed.

Configuring flash size...

Writing 'C:\Users\jorvi\AppData\Local\arduino\sketches\ACBB39C3FB629DD5918F6B98C7F48C70/sketch_aug28a.ino.bootloader.bin' at 0x00001000...
Flash will be erased from 0x00001000 to 0x00007fff...
Compressed 24992 bytes to 16001...

Writing at 0x00001000 [ ] 0.0% 0/16001 bytes...

Writing at 0x000071a0 [==============================] 100.0% 16001/16001 bytes...
Wrote 24992 bytes (16001 compressed) at 0x00001000 in 0.4 seconds (465.6 kbit/s).
Verifying written data...
Hash of data verified.

Writing 'C:\Users\jorvi\AppData\Local\arduino\sketches\ACBB39C3FB629DD5918F6B98C7F48C70/sketch_aug28a.ino.partitions.bin' at 0x00008000...
Flash will be erased from 0x00008000 to 0x00008fff...
Compressed 3072 bytes to 146...

Writing at 0x00008000 [ ] 0.0% 0/146 bytes...

Writing at 0x00008c00 [==============================] 100.0% 146/146 bytes...
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.0 seconds (956.9 kbit/s).
Verifying written data...
Hash of data verified.

Writing 'C:\Users\jorvi\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.11/tools/partitions/boot_app0.bin' at 0x0000e000...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Compressed 8192 bytes to 47...

Writing at 0x0000e000 [ ] 0.0% 0/47 bytes...

Writing at 0x00010000 [==============================] 100.0% 47/47 bytes...
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (1690.4 kbit/s).
Verifying written data...
Hash of data verified.

Writing 'C:\Users\jorvi\AppData\Local\arduino\sketches\ACBB39C3FB629DD5918F6B98C7F48C70/sketch_aug28a.ino.bin' at 0x00010000...
Flash will be erased from 0x00010000 to 0x00122fff...
Compressed 1124288 bytes to 723686...

Writing at 0x00010000 [ ] 0.0% 0/723686 bytes...

Writing at 0x0001ccc3 [ ] 2.3% 16384/723686 bytes...

Writing at 0x000274de [> ] 4.5% 32768/723686 bytes...

Writing at 0x00032cee [=> ] 6.8% 49152/723686 bytes...

Writing at 0x0003a9ba [=> ] 9.1% 65536/723686 bytes...

Writing at 0x0004001a [==> ] 11.3% 81920/723686 bytes...

Writing at 0x00045dd2 [===> ] 13.6% 98304/723686 bytes...

Writing at 0x0004c488 [===> ] 15.8% 114688/723686 bytes...

Writing at 0x00051df2 [====> ] 18.1% 131072/723686 bytes...

Writing at 0x00057176 [=====> ] 20.4% 147456/723686 bytes...

Writing at 0x0005c887 [=====> ] 22.6% 163840/723686 bytes...

Writing at 0x00062934 [======> ] 24.9% 180224/723686 bytes...

Writing at 0x00068503 [=======> ] 27.2% 196608/723686 bytes...

Writing at 0x0006dd64 [=======> ] 29.4% 212992/723686 bytes...

Writing at 0x00073294 [========> ] 31.7% 229376/723686 bytes...

Writing at 0x00078898 [=========> ] 34.0% 245760/723686 bytes...

Writing at 0x0007efa1 [=========> ] 36.2% 262144/723686 bytes...

Writing at 0x00084776 [==========> ] 38.5% 278528/723686 bytes...

Writing at 0x0008a6c8 [===========> ] 40.8% 294912/723686 bytes...

Writing at 0x000905d1 [===========> ] 43.0% 311296/723686 bytes...

Writing at 0x000964c0 [============> ] 45.3% 327680/723686 bytes...

Writing at 0x0009bff3 [=============> ] 47.5% 344064/723686 bytes...

Writing at 0x000a1a2d [=============> ] 49.8% 360448/723686 bytes...

Writing at 0x000a7350 [==============> ] 52.1% 376832/723686 bytes...

Writing at 0x000acd4d [===============> ] 54.3% 393216/723686 bytes...

Writing at 0x000b25c2 [===============> ] 56.6% 409600/723686 bytes...

Writing at 0x000b855b [================> ] 58.9% 425984/723686 bytes...

Writing at 0x000be115 [=================> ] 61.1% 442368/723686 bytes...

Writing at 0x000c3ccf [==================> ] 63.4% 458752/723686 bytes...

Writing at 0x000c9590 [==================> ] 65.7% 475136/723686 bytes...

Writing at 0x000ceac6 [===================> ] 67.9% 491520/723686 bytes...

Writing at 0x000d42e3 [====================> ] 70.2% 507904/723686 bytes...

Writing at 0x000d9ed7 [====================> ] 72.4% 524288/723686 bytes...

Writing at 0x000df85d [=====================> ] 74.7% 540672/723686 bytes...

Writing at 0x000e53c7 [======================> ] 77.0% 557056/723686 bytes...

Writing at 0x000eb013 [======================> ] 79.2% 573440/723686 bytes...

Writing at 0x000f09f5 [=======================> ] 81.5% 589824/723686 bytes...

Writing at 0x000f6447 [========================> ] 83.8% 606208/723686 bytes...

Writing at 0x000fbc25 [========================> ] 86.0% 622592/723686 bytes...

Writing at 0x001047e6 [=========================> ] 88.3% 638976/723686 bytes...

Writing at 0x0010abb2 [==========================> ] 90.6% 655360/723686 bytes...

Writing at 0x00110711 [==========================> ] 92.8% 671744/723686 bytes...

Writing at 0x0011611e [===========================> ] 95.1% 688128/723686 bytes...

Writing at 0x0011b73a [============================> ] 97.4% 704512/723686 bytes...

Writing at 0x0012156b [============================> ] 99.6% 720896/723686 bytes...

Writing at 0x001227c0 [==============================] 100.0% 723686/723686 bytes...
Wrote 1124288 bytes (723686 compressed) at 0x00010000 in 11.6 seconds (775.1 kbit/s).
Verifying written data...
Hash of data verified.

Hard resetting via RTS pin...

As I said im a complete novice could you explain the above.

It compiled and uploaded successfully.

Thank you