-
-
Notifications
You must be signed in to change notification settings - Fork 138
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
Release 1.4.1: Pull request #470: reconnect of BLE client fails #473
Comments
I suspect this line: https://github.com/lathoub/Arduino-BLE-MIDI/blob/929c2fc04962672ddba903a618601bea44ee1f3e/src/hardware/BLEMIDI_Client_ESP32.h#L527 Adding a third parameter, |
Thanks for your turbo fast reply and the proposed solution. This does the trick - thanks so much for your impressive analysis of the problem👌. |
You're welcome 😄 The explanation is that in 1.4.0, when subscribing to notifications/indications it was forcing a write with response on the descriptor, which was done because it's mandatory in the BLE specifications. This was reverted to let the app decide in 1.4.1 because in some situations (Tasmota and probably others) this caused issues with some devices. Your issue was the opposite, in that not writing with response caused a problem so this change manually forces that action. |
Thanks again for your detailed explanations - now I have a touch of an idea about the background of this issue😊. Looking forward to work with your brilliant library in my tiny experimental projects😉... |
Thanks for the thourough investigation @MicroMidi and response @h2zero. I would suggest to add a parameter to the client connect
so to provide the 3rd parameter to the
This would not break backward compatibility (defaulting to the 1.4.0 Alternative, provide access to both
Also tagging @RobertoHE |
Is this line also relevant for adjustments?: Obviously, my preferred default value for the response behaviour is Thanks again @h2zero and @lathoub for supporting me in this issue🙏 |
That may work fine and it is an easy way to do that. Another way may be using CustomSetting Branch (when the pull request will get accepted and merged to the main branch) and adding in the configuration default struct the Response and Notification parameter (initialized to true by default) that may be overridden in each project at the definition of the BLE-Client Object. |
I would suggest using a default value of This option was actually planned to be removed but now reconsidered because of situational issues. |
As you like it. |
Doesn't hurt to add an option if you'd like to.
I would say that you could test if the characteristic has notifications or indications available and set this to prefer notifications when available and indications otherwise. |
CustomSetting Branch updated. @h2zero Could you check the changes in subscribe method?
I can´t test it (unfortunately, I haven't any ESP32). @MicroMidi and @ketan, could you test it? Thanks for your help |
Looks good to me, left a comment in the commit. |
@RobertoHE: Thanks for all your time and effort - this looks very promising. And in fact - the tests with my ESP32 Wrover Test Kit and the very sensitive "Vox Adio Air" BLE-MIDI server went fine: Everything runs stable and reliable and the BLE reconnection works without any problems after switching the Vox device off and then on again. This was the scenario that caused problems when the response message on the established BLE-connection was missing. Great work👌! |
Thanks for providing us with such a powerful and multi-functional library @h2zero! I'm using your library in combination with the BLE-MIDI-library of @lathoub (https://github.com/lathoub/Arduino-BLE-MIDI)
Since release 1.4.1 I noticed re-connection problems with my BLE-MIDI client code on an ESP32 platform (https://github.com/MicroMidi/VOX-Adio-Air-MIDI-Footswitch) - and I was able to break it down to the changes of pull request #470 that causes this problem. To be honest - I have no clue what the background of this change is, but the connected BLE-server that I use (a Vox Adio Air guitar amp) seems to have problems with that change.
Is there any chance to figure out what the reason for that behaviour could be? Could it be a problem of the BLE implementation of the Vox amp? Another BLE-MIDI effect device (NUX Mighty Plug) works flawlessly with that change - and uses almost the same code base.
Thanks in advance for any hint ...
The text was updated successfully, but these errors were encountered: