Closed MrRSquared closed 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
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
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.
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.
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.
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.
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.
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
Glad it works - next step, with the amp! Which pedal are you getting?
Thank you again. Definitely. This is the one I am trying.
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
Thanks. Yes, those are great apps, and I am definitely going to do that.
Thank you for the help. Since it built, I am closing this issue.
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.