Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't compile after update to 2.2 / Arduino BLE #55

Open
lathoub opened this issue Mar 24, 2022 Discussed in #53 · 19 comments
Open

Can't compile after update to 2.2 / Arduino BLE #55

lathoub opened this issue Mar 24, 2022 Discussed in #53 · 19 comments
Labels
bug Something isn't working

Comments

@lathoub
Copy link
Owner

lathoub commented Mar 24, 2022

Discussed in #53

Originally posted by agentff6600 March 23, 2022
Hi!

I updated to the new version today. I tried compile MidiBle.ino again onto an Arduino NANO 33 IOT (that worked before the update).

Now I get this message:

In file included from /private/var/folders/gf/tr166wdx0cbcrcgq6kl_6h7w0000gn/T/.arduinoIDE-unsaved2022223-32034-lm06d2.6h9ve/MidiBle/MidiBle.ino:6:0:
/Users/windlin/Documents/Arduino/libraries/BLE-MIDI/src/hardware/BLEMIDI_ArduinoBLE.h:5:24: error: 'SERVICE_UUID' was not declared in this scope
 BLEService midiService(SERVICE_UUID);
                        ^~~~~~~~~~~~
/Users/windlin/Documents/Arduino/libraries/BLE-MIDI/src/hardware/BLEMIDI_ArduinoBLE.h:5:24: note: suggested alternative:
In file included from /private/var/folders/gf/tr166wdx0cbcrcgq6kl_6h7w0000gn/T/.arduinoIDE-unsaved2022223-32034-lm06d2.6h9ve/MidiBle/MidiBle.ino:1:0:
/Users/windlin/Documents/Arduino/libraries/BLE-MIDI/src/BLEMIDI_Transport.h:21:26: note:   'bleMidi::SERVICE_UUID'
 static const char *const SERVICE_UUID        = "03b80e5a-ede8-4b33-a751-6ce34ec4c700";
                          ^~~~~~~~~~~~
In file included from /private/var/folders/gf/tr166wdx0cbcrcgq6kl_6h7w0000gn/T/.arduinoIDE-unsaved2022223-32034-lm06d2.6h9ve/MidiBle/MidiBle.ino:6:0:
/Users/windlin/Documents/Arduino/libraries/BLE-MIDI/src/hardware/BLEMIDI_ArduinoBLE.h:6:34: error: 'CHARACTERISTIC_UUID' was not declared in this scope
 BLEStringCharacteristic midiChar(CHARACTERISTIC_UUID,  // standard 16-bit characteristic UUID
                                  ^~~~~~~~~~~~~~~~~~~
/Users/windlin/Documents/Arduino/libraries/BLE-MIDI/src/hardware/BLEMIDI_ArduinoBLE.h:6:34: note: suggested alternative:
In file included from /private/var/folders/gf/tr166wdx0cbcrcgq6kl_6h7w0000gn/T/.arduinoIDE-unsaved2022223-32034-lm06d2.6h9ve/MidiBle/MidiBle.ino:1:0:
/Users/windlin/Documents/Arduino/libraries/BLE-MIDI/src/BLEMIDI_Transport.h:22:26: note:   'bleMidi::CHARACTERISTIC_UUID'
 static const char *const CHARACTERISTIC_UUID = "7772e5db-3868-4112-a1a9-f2669d106bf3";
                          ^~~~~~~~~~~~~~~~~~~

I am not sure what to take from this? Is it pointing at a file in var that should not be there?

@lathoub lathoub added the bug Something isn't working label Mar 24, 2022
@lathoub
Copy link
Owner Author

lathoub commented Mar 24, 2022

It seems ArduinoBLE is no longer working :-(.
I can do some of the work to fox it, but will need help (I no longer have the hardware) - can you help?

@lathoub
Copy link
Owner Author

lathoub commented Mar 24, 2022

(thank you for signalling! 🙏)

@lathoub
Copy link
Owner Author

lathoub commented Mar 24, 2022

I started a new branch to work on Nano 33 support
https://github.com/lathoub/Arduino-BLE-MIDI/tree/Arduino-Nano-BLE-33

@agentff6600
Copy link

Hi!
just posted a message in the discussion but I'll add it here too.

I reverted to version 2.1.0 which seems to resolve the problem.

Then I wonder what difference there is between 2.2.0 and 2.1.0?

@lathoub
Copy link
Owner Author

lathoub commented Mar 24, 2022

Moved midiChar and midiService globals into the BEGIN_BLEMIDI_NAMESPACE namespace. (the global approach is not good and must be corrected).

It now compiles, but I can't test it - can you?

@agentff6600
Copy link

I can try to look into it in the afternoon. I guess I use the link above to alter my library?

@tommitan
Copy link

Hi,
I'm trying to make a MIDI with Arduino (I just want to make music after some sensors conditions) to connect Arduino with my Mac or iPad. I've Arduino Nano Rp 2040 and a MKR VIDOR 4000.
At the moment I'm using the first one with this library.
With the example code:

#include <BLEMIDI_Transport.h>
#include <hardware/BLEMIDI_ArduinoBLE.h>

BLEMIDI_CREATE_INSTANCE("CustomName", MIDI)

void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);

BLEMIDI.setHandleConnected(OnConnected);
BLEMIDI.setHandleDisconnected(OnDisconnected);

MIDI.begin();
}
void loop()
{
MIDI.read();
}

void OnConnected() {
digitalWrite(LED_BUILTIN, HIGH);
}

void OnDisconnected() {
digitalWrite(LED_BUILTIN, LOW);
}

I 've got this error message:

In file included from /Users/tommi/Documents/Arduino/cancella/cancella.ino:2:0:
/Users/tommi/Documents/Arduino/libraries/BLE-MIDI/src/hardware/BLEMIDI_ArduinoBLE.h:5:24: error: 'SERVICE_UUID' was not declared in this scope
BLEService midiService(SERVICE_UUID);
^~~~~~~~~~~~
/Users/tommi/Documents/Arduino/libraries/BLE-MIDI/src/hardware/BLEMIDI_ArduinoBLE.h:5:24: note: suggested alternative:
In file included from /Users/tommi/Documents/Arduino/cancella/cancella.ino:1:0:
/Users/tommi/Documents/Arduino/libraries/BLE-MIDI/src/BLEMIDI_Transport.h:21:26: note: 'bleMidi::SERVICE_UUID'
static const char *const SERVICE_UUID = "03b80e5a-ede8-4b33-a751-6ce34ec4c700";
^~~~~~~~~~~~
In file included from /Users/tommi/Documents/Arduino/cancella/cancella.ino:2:0:
/Users/tommi/Documents/Arduino/libraries/BLE-MIDI/src/hardware/BLEMIDI_ArduinoBLE.h:6:34: error: 'CHARACTERISTIC_UUID' was not declared in this scope
BLEStringCharacteristic midiChar(CHARACTERISTIC_UUID, // standard 16-bit characteristic UUID
^~~~~~~~~~~~~~~~~~~
/Users/tommi/Documents/Arduino/libraries/BLE-MIDI/src/hardware/BLEMIDI_ArduinoBLE.h:6:34: note: suggested alternative:
In file included from /Users/tommi/Documents/Arduino/cancella/cancella.ino:1:0:
/Users/tommi/Documents/Arduino/libraries/BLE-MIDI/src/BLEMIDI_Transport.h:22:26: note: 'bleMidi::CHARACTERISTIC_UUID'
static const char const CHARACTERISTIC_UUID = "7772e5db-3868-4112-a1a9-f2669d106bf3";
^~~~~~~~~~~~~~~~~~~
In file included from /Users/tommi/Documents/Arduino/cancella/cancella.ino:1:0:
/Users/tommi/Documents/Arduino/libraries/BLE-MIDI/src/BLEMIDI_Transport.h: In instantiation of 'void bleMidi::BLEMIDI_Transport<T, _Settings>::receive(byte
, size_t) [with T = bleMidi::BLEMIDI_ArduinoBLE; _Settings = bleMidi::DefaultSettings; byte = unsigned char; size_t = unsigned int]':
/Users/tommi/Documents/Arduino/libraries/BLE-MIDI/src/hardware/BLEMIDI_ArduinoBLE.h:107:65: required from here
/Users/tommi/Documents/Arduino/libraries/BLE-MIDI/src/BLEMIDI_Transport.h:297:60: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
while ((buffer[rPtr + 1] < MIDI_TYPE) && (rPtr < (length - 1)))
~~~~~~^~~~~~~~~~~~~~~
/Users/tommi/Documents/Arduino/libraries/BLE-MIDI/src/BLEMIDI_Transport.h:391:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (++rPtr >= length)
~~~~~~~^~~~~~~~~
/Users/tommi/Documents/Arduino/libraries/BLE-MIDI/src/BLEMIDI_Transport.h:408:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (lPtr >= length)
~~~~~^~~~~~~~~
/Users/tommi/Documents/Arduino/libraries/BLE-MIDI/src/BLEMIDI_Transport.h:260:14: warning: unused variable 'timestampHigh' [-Wunused-variable]
auto timestampHigh = 0x3f & headerByte;
^~~~~~~~~~~~~
exit status 1
Errore durante la compilazione per la scheda Arduino Nano RP2040 Connect.

I'm totally new in this word and a very beginner... so I've literally no idea what to do... can u help me pleaseee!!
I need a solution for my MIDI in a day or two!!

If there's no way to work this out, there's another way (an easy one...) to make sound out of an Arduino sketch???

Thanks, Tom

@lathoub
Copy link
Owner Author

lathoub commented May 19, 2022

Hi @tommitan

Use the branch for the Nano 33/rp2040 (see above)
#55 (comment)

Let me know if it works, so I can roll it up in a release

@richarnt999
Copy link

richarnt999 commented Jun 11, 2022

I have the same problem, and after updating the library at least it compiles. Will let you know if the hardware talks later (that might of course fail due to numerous other problems - I hope to get my arduino nano ble 33 talking to a CME Widi master).

@richarnt999
Copy link

I have the same problem, and after updating the library at least it compiles. Will let you know if the hardware talks later (that might of course fail due to numerous other problems - I hope to get my arduino nano ble 33 talking to a CME Widi master).

Tested and seems to work like a charm.

@richarnt999
Copy link

Close #55

@SunboX
Copy link

SunboX commented Jun 14, 2022

I started a new branch to work on Nano 33 support https://github.com/lathoub/Arduino-BLE-MIDI/tree/Arduino-Nano-BLE-33

Will this also work on a Nano RP2040 ? I did just order one. Because the Nano 33 might be a bit slow for my use case.

@lathoub
Copy link
Owner Author

lathoub commented Jun 14, 2022

Hi, yes, i have it working on a RP2040 - let me know here if it also works for you!

@lathoub
Copy link
Owner Author

lathoub commented Jun 27, 2022

@SunboX did you get it to work on the RP2040?

@lathoub lathoub closed this as completed Jun 30, 2022
@spotman
Copy link

spotman commented Jul 30, 2022

@lathoub I've just tested Arduino-Nano-BLE-33 branch on my hardware and it works as expected. May you merge these changes in the master branch?

@lathoub lathoub reopened this Jul 31, 2022
@lathoub
Copy link
Owner Author

lathoub commented Jul 31, 2022

thx @spotman - all changes for Arduino Nano-BLE-33 are also copied in the newer CustomSettings branch. Would you might testing that branch?

@spotman
Copy link

spotman commented Aug 1, 2022

@lathoub yep. I have an Arduino Nano 33 BLE board, apps for testing BLE-MIDI protocol and an oscilloscope. What kind of tests I need to run on this branch?

@lathoub
Copy link
Owner Author

lathoub commented Aug 1, 2022

the same test you ran before on the BLE branch - internally I added template parameters and I want to make sure they compile and work as expected (they got rather complex and want to see if they also work on another machine then mine :-))

@tarasitri
Copy link

Dear @lathoub,
Thank you for your work and this awesome library. I also started trying to build something with an Arduino Nano 33 BLE. I saw that this issue is still open. I just tested and compile my sketch with the CustomSettings branch that you posted in this message (#55 (comment)).
Unfortunately, the following error appears:

"In file included from C:\Users\MidiBlePairingandButton\MidiBlePairingandButton.ino:5:0:
C:\Users\Arduino\libraries\BLE-MIDI\src/hardware/BLEMIDI_ArduinoBLE.h:140:1: error: expected class-name before '{' token
{
^
C:\Users\Arduino\libraries\BLE-MIDI\src/hardware/BLEMIDI_ArduinoBLE.h:165:1: error: expected class-name before '{' token
{
^
C:\Users\Arduino\libraries\BLE-MIDI\src/hardware/BLEMIDI_ArduinoBLE.h: In member function 'bool bleMidi::BLEMIDI_ArduinoBLE<_Settings>::begin(const char*, bleMidi::BLEMIDI_Transport<bleMidi::BLEMIDI_ArduinoBLE<_Settings>, _Settings>*)':
C:\Users\Arduino\libraries\BLE-MIDI\src/hardware/BLEMIDI_ArduinoBLE.h:204:9: error: 'class BLELocalDevice' has no member named 'setCallbacks'
BLE.setCallbacks(new MyServerCallbacks<_Settings>(this));
^~~~~~~~~~~~
C:\Users\Arduino\libraries\BLE-MIDI\src/hardware/BLEMIDI_ArduinoBLE.h:206:15: error: 'class BLECharacteristic' has no member named 'setCallbacks'
_midiChar.setCallbacks(new MyCharacteristicCallbacks<_Settings>(this));
^~~~~~~~~~~~
Multiple libraries were found for "BLEMIDI_Transport.h"
Used: C:\Users\Arduino\libraries\BLE-MIDI
Compilation error: exit status 1"

Nevetheless, I can compile and send midi notes to my Windows machine using this branch (https://github.com/lathoub/Arduino-BLE-MIDI/tree/Arduino-Nano-BLE-33)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants