Coder Social home page Coder Social logo

Comments (6)

tttapa avatar tttapa commented on July 23, 2024

Unfortunately, I don't have any Apple hardware to reproduce this myself.
A quick google search brings up this page: https://forums.developer.apple.com/forums/thread/132488 Does removing the device in the settings resolve the issue?

If the Pico is in fact not storing the necessary pairing information, perhaps it could be related to bluekitchen/btstack#498?

from control-surface.

matthias-glatthorn avatar matthias-glatthorn commented on July 23, 2024

Does removing the device in the settings resolve the issue?

No, unfortunately not

I just did some testing with my windows 10 computer - I can see a Bluetooth Midi Device with the name "MIDI Adapter" on this computer as well but I get the same behavior as on my iPhone: the computer tries for some time to establish a connection and then goes right back to "Not Connected".

Can anyone confirm weather I got this part right GenericBLEMIDI_Interface<BTstackBackgroundBackend> midi_ble; ?

from control-surface.

tttapa avatar tttapa commented on July 23, 2024

Last time I tested it, Windows did not support MIDI over BLE natively, it required a third-party program to be able to connect to MIDI devices, so this could be another issue.

That said, I vaguely remember sometimes having to connect twice on Android after uploading a new sketch. This could be related.

I'm afraid I won't have much time in the near future to investigate this further, but it would be interesting to compare the behavior to the BTStack examples, to rule out any Control Surface-specific issues.

You can find all BLE logic here: https://github.com/tttapa/Control-Surface/blob/main/src/MIDI_Interfaces/BLEMIDI/BTstack/gatt_midi.cpp
Advertising is configured here: https://github.com/tttapa/Control-Surface/blob/main/src/MIDI_Interfaces/BLEMIDI/BTstack/advertising.cpp
These are the only files that interact with the low-level BTStack code directly. You can enable debugging logs to see all the events.

Can anyone confirm weather I got this part right GenericBLEMIDI_Interface<BTstackBackgroundBackend> midi_ble; ?

Yes, but why is this necessary? This should be similar to what BluetoothMIDI_Interface already does for you:

struct BluetoothMIDI_Interface : GenericBLEMIDI_Interface<BLEMIDIBackend> {};

from control-surface.

matthias-glatthorn avatar matthias-glatthorn commented on July 23, 2024

Last time I tested it, Windows did not support MIDI over BLE natively, it required a third-party program to be able to connect to MIDI devices, so this could be another issue.

I tried again with Bluetooth LE Explorer and according to this video, Bluetooth LE Explorer should be capable of establishing MIDI over BLE connections. But I could not establish a connection with Bluetooth LE Explorer either. I got "Failed - Pairing error".

but it would be interesting to compare the behavior to the BTStack examples, to rule out any Control Surface-specific issues.

I'm not that firm with C++ and building Makefiles ... but I managed to get the BLECircle.ino working (Examples > MouseBLE > BLECircle in Arduino IDE)

/* Earle F. Philhower, III <[email protected]> */
/* Released to the public domain */

#include <MouseBLE.h>

void setup() {
  Serial.begin(115200);
  MouseBLE.begin("CircleBLE Mouse");
  delay(5000);
  Serial.printf("Press BOOTSEL to move the mouse in a circle\n");
}

void loop() {
  if (BOOTSEL) {
    Serial.println("BARREL ROLL!!!");
    float r = 100;
    float ox = 0.0;
    float oy = 0.0;
    for (float a = 0; a < 2.0 * 3.14159; a += 0.1) {
      float ax = r * cos(a);
      float ay = r * sin(a);
      float dx = ax - ox;
      float dy = ay - oy;
      MouseBLE.move(dx, dy, 0);
      ox = ax;
      oy = ay;
      delay(10);
    }
    MouseBLE.setBattery(random(0, 101)); // Set between 0...100%
    while (BOOTSEL) {
      delay(1);
    }
  }
}

Thank you for your help so far ... if I manage make progress on this issue, I will report back in this thread :)

from control-surface.

tttapa avatar tttapa commented on July 23, 2024

I borrowed a friend's iPad (8th gen, iPadOS 17.5.1), but I can't seem to be able to reproduce the issue: I've uploaded the code you posted to a Pi Pico W, opened MIDI Wrench on the iPad, and I was able to connect (and disconnect and reconnect, even after power a cycle) without any problem.
I don't have access to a mac to try BlueSee.

Using https://github.com/earlephilhower/arduino-pico version 3.9.2 (latest) and the current main branch of Control Surface.

from control-surface.

tttapa avatar tttapa commented on July 23, 2024

Alright, progress, I looked into the problem on Windows, and I could reproduce the issue. Explicitly handling the security manager JUST_WORKS_REQUEST event fixes it for me: 9c530d4

from control-surface.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.