paulhamsh / SparkMIDI

Midi control capability for the Spark 40 Amp
Apache License 2.0
10 stars 4 forks source link

SparkMIDI is not building #8

Closed MrRSquared closed 2 years ago

MrRSquared commented 2 years ago

Hello, I am running into an issue building the Spark MIDI project. I am using SPARKMIDI15.ino and getting this error. Do you have any ideas about what I am doing wrong or what I need to install? I could build again with verbose error reporting if it helps. I tried building for the WROOM module as well with the same results. I also receive the same results if I attempt to build v12.

Thank you for all of your help.

Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, Core 1, Core 1, None"

In file included from C:~\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.4\libraries\BLE\src/BLECharacteristic.h:17,

                 from C:~\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.4\libraries\BLE\src/BLEServer.h:20,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkComms.h:7,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkIO.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\Spark.h:4,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkMIDI15.ino:108:

C:~\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.4\libraries\BLE\src/BLEDescriptor.h:25:7: error: redefinition of 'class BLEDescriptor'

 class BLEDescriptor {

       ^~~~~~~~~~~~~

In file included from C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLECharacteristic.h:25,

                 from C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLEService.h:23,

                 from C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLEDevice.h:25,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkComms.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkIO.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\Spark.h:4,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkMIDI15.ino:108:

C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLEDescriptor.h:28:7: note: previous definition of 'class BLEDescriptor'

 class BLEDescriptor {

       ^~~~~~~~~~~~~

In file included from C:~\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.4\libraries\BLE\src/BLEServer.h:20,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkComms.h:7,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkIO.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\Spark.h:4,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkMIDI15.ino:108:

C:~\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.4\libraries\BLE\src/BLECharacteristic.h:53:7: error: redefinition of 'class BLECharacteristic'

 class BLECharacteristic {

       ^~~~~~~~~~~~~~~~~

In file included from C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLEService.h:23,

                 from C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLEDevice.h:25,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkComms.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkIO.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\Spark.h:4,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkMIDI15.ino:108:

C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLECharacteristic.h:45:7: note: previous definition of 'class BLECharacteristic'

 class BLECharacteristic  {

       ^~~~~~~~~~~~~~~~~

In file included from C:~\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.4\libraries\BLE\src/BLEServer.h:21,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkComms.h:7,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkIO.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\Spark.h:4,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkMIDI15.ino:108:

C:~\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.4\libraries\BLE\src/BLEService.h:49:7: error: redefinition of 'class BLEService'

 class BLEService {

       ^~~~~~~~~~

In file included from C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLEDevice.h:25,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkComms.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkIO.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\Spark.h:4,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkMIDI15.ino:108:

C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLEService.h:28:7: note: previous definition of 'class BLEService'

 class BLEService {

       ^~~~~~~~~~

C:~\Documents\Arduino\SparkMIDI15\SparkComms.ino: In member function 'virtual void CharacteristicCallbacks::onWrite(BLECharacteristic*)':

SparkComms:115:39: error: 'class BLECharacteristic' has no member named 'getValue'; did you mean 'setValue'?

     for (auto & it : pCharacteristic->getValue()) {

                                       ^~~~~~~~

                                       setValue

C:~\Documents\Arduino\SparkMIDI15\SparkComms.ino: In member function 'virtual void MIDICharacteristicCallbacks::onWrite(BLECharacteristic*)':

SparkComms:129:39: error: 'class BLECharacteristic' has no member named 'getValue'; did you mean 'setValue'?

     for (auto & it : pCharacteristic->getValue()) {

                                       ^~~~~~~~

                                       setValue

C:~\Documents\Arduino\SparkMIDI15\SparkComms.ino: In function 'bool connect_to_all()':

SparkComms:230:14: error: 'init' is not a member of 'BLEDevice'

   BLEDevice::init("Spark 40 MIDI BLE");

              ^~~~

SparkComms:231:27: error: 'createClient' is not a member of 'BLEDevice'

   pClient_sp = BLEDevice::createClient();

                           ^~~~~~~~~~~~

SparkComms:235:30: error: 'createClient' is not a member of 'BLEDevice'

   pClient_pedal = BLEDevice::createClient();

                              ^~~~~~~~~~~~

SparkComms:237:22: error: 'getScan' is not a member of 'BLEDevice'

   pScan = BLEDevice::getScan();

                      ^~~~~~~

SparkComms:239:24: error: 'createServer' is not a member of 'BLEDevice'

   pServer = BLEDevice::createServer();

                        ^~~~~~~~~~~~

SparkComms:244:39: error: 'class BLEService' has no member named 'createCharacteristic'; did you mean 'addCharacteristic'?

   pCharacteristic_receive = pService->createCharacteristic(S_CHAR1, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR);

                                       ^~~~~~~~~~~~~~~~~~~~

                                       addCharacteristic

SparkComms:244:88: error: 'PROPERTY_READ' is not a member of 'BLECharacteristic'

   pCharacteristic_receive = pService->createCharacteristic(S_CHAR1, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR);

                                                                                        ^~~~~~~~~~~~~

SparkComms:244:123: error: 'PROPERTY_WRITE' is not a member of 'BLECharacteristic'

   pCharacteristic_receive = pService->createCharacteristic(S_CHAR1, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR);

                                                                                                                           ^~~~~~~~~~~~~~

SparkComms:244:159: error: 'PROPERTY_WRITE_NR' is not a member of 'BLECharacteristic'

   pCharacteristic_receive = pService->createCharacteristic(S_CHAR1, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR);

                                                                                                                                                               ^~~~~~~~~~~~~~~~~

SparkComms:245:36: error: 'class BLEService' has no member named 'createCharacteristic'; did you mean 'addCharacteristic'?

   pCharacteristic_send = pService->createCharacteristic(S_CHAR2, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_NOTIFY);

                                    ^~~~~~~~~~~~~~~~~~~~

                                    addCharacteristic

SparkComms:245:85: error: 'PROPERTY_READ' is not a member of 'BLECharacteristic'

   pCharacteristic_send = pService->createCharacteristic(S_CHAR2, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_NOTIFY);

                                                                                     ^~~~~~~~~~~~~

SparkComms:245:120: error: 'PROPERTY_NOTIFY' is not a member of 'BLECharacteristic'

   pCharacteristic_send = pService->createCharacteristic(S_CHAR2, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_NOTIFY);

                                                                                                                        ^~~~~~~~~~~~~~~

SparkComms:251:28: error: 'class BLECharacteristic' has no member named 'setCallbacks'

   pCharacteristic_receive->setCallbacks(&chrCallbacks_r);

                            ^~~~~~~~~~~~

SparkComms:252:25: error: 'class BLECharacteristic' has no member named 'setCallbacks'

   pCharacteristic_send->setCallbacks(&chrCallbacks_s);

                         ^~~~~~~~~~~~

SparkComms:254:52: error: no matching function for call to 'BLECharacteristic::addDescriptor(BLE2902*)'

   pCharacteristic_send->addDescriptor(new BLE2902());

                                                    ^

In file included from C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLEService.h:23,

                 from C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLEDevice.h:25,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkComms.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkIO.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\Spark.h:4,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkMIDI15.ino:108:

C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLECharacteristic.h:91:8: note: candidate: 'void BLECharacteristic::addDescriptor(BLEDescriptor&)'

   void addDescriptor(BLEDescriptor& descriptor);

        ^~~~~~~~~~~~~

C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLECharacteristic.h:91:8: note:   no known conversion for argument 1 from 'BLE2902*' to 'BLEDescriptor&'

SparkComms:264:39: error: 'class BLEService' has no member named 'createCharacteristic'; did you mean 'addCharacteristic'?

   pCharacteristicMIDI = pServiceMIDI->createCharacteristic(MIDI_CHAR, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR | BLECharacteristic::PROPERTY_NOTIFY);

                                       ^~~~~~~~~~~~~~~~~~~~

                                       addCharacteristic

SparkComms:264:90: error: 'PROPERTY_READ' is not a member of 'BLECharacteristic'

   pCharacteristicMIDI = pServiceMIDI->createCharacteristic(MIDI_CHAR, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR | BLECharacteristic::PROPERTY_NOTIFY);

                                                                                          ^~~~~~~~~~~~~

SparkComms:264:125: error: 'PROPERTY_WRITE' is not a member of 'BLECharacteristic'

   pCharacteristicMIDI = pServiceMIDI->createCharacteristic(MIDI_CHAR, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR | BLECharacteristic::PROPERTY_NOTIFY);

                                                                                                                             ^~~~~~~~~~~~~~

SparkComms:264:161: error: 'PROPERTY_WRITE_NR' is not a member of 'BLECharacteristic'

   pCharacteristicMIDI = pServiceMIDI->createCharacteristic(MIDI_CHAR, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR | BLECharacteristic::PROPERTY_NOTIFY);

                                                                                                                                                                 ^~~~~~~~~~~~~~~~~

SparkComms:264:200: error: 'PROPERTY_NOTIFY' is not a member of 'BLECharacteristic'

   pCharacteristicMIDI = pServiceMIDI->createCharacteristic(MIDI_CHAR, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_WRITE_NR | BLECharacteristic::PROPERTY_NOTIFY);

                                                                                                                                                                                                        ^~~~~~~~~~~~~~~

SparkComms:269:24: error: 'class BLECharacteristic' has no member named 'setCallbacks'

   pCharacteristicMIDI->setCallbacks(&chrCallbacksMIDI);

                        ^~~~~~~~~~~~

SparkComms:271:51: error: no matching function for call to 'BLECharacteristic::addDescriptor(BLE2902*)'

   pCharacteristicMIDI->addDescriptor(new BLE2902());

                                                   ^

In file included from C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLEService.h:23,

                 from C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLEDevice.h:25,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkComms.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkIO.h:6,

                 from C:~\Documents\Arduino\SparkMIDI15\Spark.h:4,

                 from C:~\Documents\Arduino\SparkMIDI15\SparkMIDI15.ino:108:

C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLECharacteristic.h:91:8: note: candidate: 'void BLECharacteristic::addDescriptor(BLEDescriptor&)'

   void addDescriptor(BLEDescriptor& descriptor);

        ^~~~~~~~~~~~~

C:~\Documents\Arduino\libraries\ArduinoBLE\src/BLECharacteristic.h:91:8: note:   no known conversion for argument 1 from 'BLE2902*' to 'BLEDescriptor&'

SparkComms:276:13: error: 'class BLEService' has no member named 'start'

   pService->start();

             ^~~~~

SparkComms:278:17: error: 'class BLEService' has no member named 'start'

   pServiceMIDI->start();

                 ^~~~~

SparkComms:285:29: error: 'getAdvertising' is not a member of 'BLEDevice'

   pAdvertising = BLEDevice::getAdvertising(); // create advertising instance

                             ^~~~~~~~~~~~~~

SparkComms:286:42: error: 'class BLEService' has no member named 'getUUID'

   pAdvertising->addServiceUUID(pService->getUUID()); // tell advertising the UUID of our service

                                          ^~~~~~~

SparkComms:288:46: error: 'class BLEService' has no member named 'getUUID'

   pAdvertising->addServiceUUID(pServiceMIDI->getUUID()); // tell advertising the UUID of our service

                                              ^~~~~~~

C:~\Documents\Arduino\SparkMIDI15\SparkComms.ino: In function 'void app_write(byte*, int)':

SparkComms:396:27: error: 'class BLECharacteristic' has no member named 'notify'

     pCharacteristic_send->notify(true);

                           ^~~~~~

C:~\Documents\Arduino\SparkMIDI15\SparkComms.ino: In function 'void app_write_timed(byte*, int)':

SparkComms:410:27: error: 'class BLECharacteristic' has no member named 'notify'

     pCharacteristic_send->notify(true);

                           ^~~~~~

Multiple libraries were found for "BLEDevice.h"

 Used: C:~\Documents\Arduino\libraries\ArduinoBLE

 Not used: C:~\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.4\libraries\BLE

 Not used: C:~\Documents\Arduino\libraries\BLEPeripheral

exit status 1

'class BLECharacteristic' has no member named 'getValue'; did you mean 'setValue'?

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
paulhamsh commented 2 years ago

I'm guessing a Windows user?

Can you first check your temp Arduino build directory is completely empty? File / Preferences then open the 'More preferences can be edited directly in the file' and there might be an entry for build.path

build.path=C:\Users\Paul\Documents\ArduinoBuild

If there is, check this has no files at all in there. If not, then create one because it make compiles much quicker. Then try again

paulhamsh commented 2 years ago

And can you paste the start of SparkMIDI15.ino like this:

//     | .--------------. || .--------------. || .--------------. || .--------------. || .--------------. |    | .--------------. || .--------------. || .--------------. || .--------------. |
//     | |    _______   | || |   ______     | || |      __      | || |  _______     | || |  ___  ____   | |    | | ____    ____ | || |     _____    | || |  ________    | || |     _____    | |
//     | |   /  ___  |  | || |  |_   __ \   | || |     /  \     | || | |_   __ \    | || | |_  ||_  _|  | |    | ||_   \  /   _|| || |    |_   _|   | || | |_   ___ `.  | || |    |_   _|   | |
//     | |  |  (__ \_|  | || |    | |__) |  | || |    / /\ \    | || |   | |__) |   | || |   | |_/ /    | |    | |  |   \/   |  | || |      | |     | || |   | |   `. \ | || |      | |     | |
//     | |   '.___`-.   | || |    |  ___/   | || |   / ____ \   | || |   |  __ /    | || |   |  __'.    | |    | |  | |\  /| |  | || |      | |     | || |   | |    | | | || |      | |     | |
//     | |  |`\____) |  | || |   _| |_      | || | _/ /    \ \_ | || |  _| |  \ \_  | || |  _| |  \ \_  | |    | | _| |_\/_| |_ | || |     _| |_    | || |  _| |___.' / | || |     _| |_    | |
//     | |  |_______.'  | || |  |_____|     | || ||____|  |____|| || | |____| |___| | || | |____||____| | |    | ||_____||_____|| || |    |_____|   | || | |________.'  | || |    |_____|   | |
//     | |              | || |              | || |              | || |              | || |              | |    | |              | || |              | || |              | || |              | |
//     | '--------------' || '--------------' || '--------------' || '--------------' || '--------------' |    | '--------------' || '--------------' || '--------------' || '--------------' |
//      '----------------'  '----------------'  '----------------'  '----------------'  '----------------'      '----------------'  '----------------'  '----------------'  '----------------' 

//
// Spark MIDI
//
// Open source MIDI control for the Spark 40 amp from Positive Grid
// See    https://github.com/paulhamsh/SparkMIDI for more details
// Also   https://github.com/paulhamsh/Spark     for documentation on the API and the message format to the Spark amp   
//

//Dependencies:
// NimBLE                          >=1.2.0 (last tested with 1.3.6)
// SSD1306 by Adafruit             >=2.3.0  
// ESP32 Dev Module board          =2.0.4
// Heltec ESP32 Series Dev-boards  =0.0.5

// For ESP32 Dev Kit update the preferences for board managers to point to: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
// And load the latest board library - 2.0.2 when built on 23 Jan 2022
// This has the latest BLE code which has setMTU 
// The Heltec WIFI does not have a library supporting setMTU so that is removed by the preprocessor conditional (in SparkComms)

// Select the BLE type 
// -------------------
// if CLASSIC is defined, will compile with BLE stack which allows serial bluetooth
// - if not defined will use NimBLE which has no serial bluetooth
// it matters because Android Spark apps use serial bluetooth
// but BLE doesn't handle Spark disconnection well, whereas NimBLE does

#define CLASSIC

// Select the BLE devices you need
// -------------------------------
// if BLE_APP_MIDI is defined it will allow a BLE MIDI device to connect (much like the app)
// if BLE_CONTROLLER is defined it will search for a bluetooth controller (like Akai LPD8 Wireless or IK Multimedia iRig Blueboard)

#define BLE_APP_MIDI
#define BLE_CONTROLLER

// Select whether to use external OLED
// -----------------------------------
//#define OLED_ON

// Select the USB host device type
// -------------------------------
// USB_HOST is the generic MAX 2341 host
// USB_TRINKET is a Trinket M0 device programmed as a USB Host

//#define USB_HOST
//#define USB_TRINKET

// Select the ESP32 board type
// ---------------------------
// M5STICK, M5CORE2, ESP_DEVKIT, HELTEC_WIFI
// Don't forget to set your board type in Tools -> Board as well!!
//
// Allowed combinations are:
// M5STICK && USB_TRINKET
// M5CORE2 && USB_TRINKET
// M5CORE && USB_HOST  (the USB Host base from M5)
// ESP_DEVKIT && (USB_TRINKET || USB_HOST)  can be either - the only one with a circuit for both so far
// HELTEC_WIFI && USB_HOST
//
// OLED_ON is acceptable with all boards except HELTEC_WIFI

#define ESP_DEVKIT
//#define HELTEC_WIFI
//#define M5CORE
//#define M5CORE2
//#define M5STICK
paulhamsh commented 2 years ago

Also check the board manager URL you are using. Some sites say to use: https://dl.espressif.com/dl/package_esp32_index.json But I use: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

I have a feeling the first one had issues for me. Though - if you are on v2.0.5 then you probably must be using the second one.

MrRSquared commented 2 years ago

Thank you for your reply. I tried both 2.0.4 and 2.0.5. They both broke in the same place, so I must be using the second repo (thank you for including that in the instructions, it was helpful). I am on Windows. I will check the other two pieces when I am at home. I do know that before I updated the IDE, I was using the other repo for my ESP32 Arduino projects, so the cache sounds like a plausible issue.

I apologize about all the confusion. I have only either built simple Arduino projects from scratch or used the Arduino or Adafruit libraries directly. In both situations, I only used one *.ino file and the library headers. Hence the confusion.

I am really excited about this project both in terms of learning a bit more about how Arduino libraries work, and about the end result. My amp has not even yet arrived, and I am already enthralled with the possibilities it offers.

paulhamsh commented 2 years ago

I've just de-installed the IDE and re-installed 1.8.19. Using the #defines in the code above, and using this board manager URL https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json, it all worked fine. ESP32 Dev Module (bought from A-Z Delivery so ESP32-WROOM-32).

Also before re-installing I deleted everything from here: C:\Users\Family\AppData\Local\Arduino15

Not sure if that matters.

I'm sure we'll crack it - it does sound odd.

MrRSquared commented 2 years ago

Thank you for going through all of this to help me out. When you re-installed, did you add any other dependencies (though I am not using them, I added both the other Bluetooth library and the screen library from Adafruit, and now I wonder if the former could be the culprit)? I will check all of this evening, and I think clearing the cache will solve it. I will post back either way.

paulhamsh commented 2 years ago

No, just the board library. To test it. NimBLE shouldn't interfere, but it could be if that was triggered as well as the classic library - that would definitely have clashing definitions. But...that shouldn't happen in the code, and doesn't for me

Try without NimBLE installed, then with it again. Also check that #define CLASSIC is there And perhaps get the code again (clone / download) to ensure there were no changes made in error - something could have triggered the BLE and non-BLE libraries.

MrRSquared commented 2 years ago

Okay, Major progress. I built it and it seems to be working (I still do not have the Spark hardware, but the pedal comes tomorrow and the amp is supposed to arrive Friday :). The ESP32 works, and it seems I may not need to hard code too many terminal messages as the Debug messages are enough at least for the connection messages. If I need to, the switch statements are clear a clear access point for adding new messages (thank you for that).

I will put the beginning of the file below, but it is essentially the one you used.

So, the problem. I think what caused it was an old Bluetooth stack I used for my cheerlight. . I used a tiny pico to create one for my classroom. It is quite cool actually.

Anyway, I went through all the fixes above to no avail. However, I even though I did not have the cache folder you did, an old install did create a different one in my documents folder (C:/~/Documents/ArduinoData). I deleted that (and my old projects folder), uninstalled and reinstalled the IDE (V1.8.19), and it worked. Then, I reinstalled the NimBLE library just in case, and it still worked.

Thank you for all of your help. I am currently in business (well, awaiting the arrival of the other hardware).

This is really a cool project.

Here is the beginning of my file.

//       .----------------.  .----------------.  .----------------.  .----------------.  .----------------.      .----------------.  .----------------.  .----------------.  .----------------. 
//     | .--------------. || .--------------. || .--------------. || .--------------. || .--------------. |    | .--------------. || .--------------. || .--------------. || .--------------. |
//     | |    _______   | || |   ______     | || |      __      | || |  _______     | || |  ___  ____   | |    | | ____    ____ | || |     _____    | || |  ________    | || |     _____    | |
//     | |   /  ___  |  | || |  |_   __ \   | || |     /  \     | || | |_   __ \    | || | |_  ||_  _|  | |    | ||_   \  /   _|| || |    |_   _|   | || | |_   ___ `.  | || |    |_   _|   | |
//     | |  |  (__ \_|  | || |    | |__) |  | || |    / /\ \    | || |   | |__) |   | || |   | |_/ /    | |    | |  |   \/   |  | || |      | |     | || |   | |   `. \ | || |      | |     | |
//     | |   '.___`-.   | || |    |  ___/   | || |   / ____ \   | || |   |  __ /    | || |   |  __'.    | |    | |  | |\  /| |  | || |      | |     | || |   | |    | | | || |      | |     | |
//     | |  |`\____) |  | || |   _| |_      | || | _/ /    \ \_ | || |  _| |  \ \_  | || |  _| |  \ \_  | |    | | _| |_\/_| |_ | || |     _| |_    | || |  _| |___.' / | || |     _| |_    | |
//     | |  |_______.'  | || |  |_____|     | || ||____|  |____|| || | |____| |___| | || | |____||____| | |    | ||_____||_____|| || |    |_____|   | || | |________.'  | || |    |_____|   | |
//     | |              | || |              | || |              | || |              | || |              | |    | |              | || |              | || |              | || |              | |
//     | '--------------' || '--------------' || '--------------' || '--------------' || '--------------' |    | '--------------' || '--------------' || '--------------' || '--------------' |
//      '----------------'  '----------------'  '----------------'  '----------------'  '----------------'      '----------------'  '----------------'  '----------------'  '----------------' 

//
// Spark MIDI
//
// Open source MIDI control for the Spark 40 amp from Positive Grid
// See    https://github.com/paulhamsh/SparkMIDI for more details
// Also   https://github.com/paulhamsh/Spark     for documentation on the API and the message format to the Spark amp   
//

//Dependencies:
// NimBLE               >=1.2.0 (last tested with 1.3.6)
// SSD1306 by Adafruit  >=2.3.0  

// For ESP32 Dev Kit update the preferences for board managers to point to: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
// And load the latest board library - 2.0.2 when built on 23 Jan 2022
// This has the latest BLE code which has setMTU 
// The Heltec WIFI does not have a library supporting setMTU so that is removed by the preprocessor conditional (in SparkComms)

// Select the BLE type 
// -------------------
// if CLASSIC is defined, will compile with BLE stack which allows serial bluetooth
// - if not defined will use NimBLE which has no serial bluetooth
// it matters because Android Spark apps use serial bluetooth
// but BLE doesn't handle Spark disconnection well, whereas NimBLE does

#define CLASSIC

// Select the BLE devices you need
// -------------------------------
// if BLE_APP_MIDI is defined it will allow a BLE MIDI device to connect (much like the app)
// if BLE_CONTROLLER is defined it will search for a bluetooth controller (like Akai LPD8 Wireless or IK Multimedia iRig Blueboard)

#define BLE_APP_MIDI
#define BLE_CONTROLLER

// Select whether to use external OLED
// -----------------------------------
//  #define OLED_ON

// Select the USB host device type
// -------------------------------
// USB_HOST is the generic MAX 2341 host
// USB_TRINKET is a Trinket M0 device programmed as a USB Host

//#define USB_HOST
//#define USB_TRINKET

// Select the ESP32 board type
// ---------------------------
// M5STICK, M5CORE2, ESP_DEVKIT, HELTEC_WIFI
// Don't forget to set your board type in Tools -> Board as well!!
//
// Allowed combinations are:
// M5STICK && USB_TRINKET
// M5CORE2 && USB_TRINKET
// M5CORE && USB_HOST  (the USB Host base from M5)
// ESP_DEVKIT && (USB_TRINKET || USB_HOST)  can be either - the only one with a circuit for both so far
// HELTEC_WIFI && USB_HOST
//
// OLED_ON is acceptable with all boards except HELTEC_WIFI

#define ESP_DEVKIT
//#define HELTEC_WIFI
//#define M5CORE
//#define M5CORE2
//#define M5STICK
paulhamsh commented 2 years ago

Glad it works - next step, with the amp! Which pedal are you getting?

MrRSquared commented 2 years ago

Thank you again. Definitely. This is the one I am trying.

paulhamsh commented 2 years ago

Download nRF Connect and/or Lightblue on your phone and it will scan and connect to the pedal and you can check what messages it sends - that will help any debugging

MrRSquared commented 2 years ago

Thanks. Yes, those are great apps, and I am definitely going to do that.

MrRSquared commented 2 years ago

Thank you for the help. Since it built, I am closing this issue.