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

Failed to subscribe to notification (sometimes) #1027

Open
graphefruit opened this issue Aug 20, 2024 · 5 comments
Open

Failed to subscribe to notification (sometimes) #1027

graphefruit opened this issue Aug 20, 2024 · 5 comments
Labels

Comments

@graphefruit
Copy link

Hello together, @peitschie :)
(first of all, sorry for taking that long to open up the ticket)

I wanted to say that I'm deeply thankful for your support here and making this awesome plugin, maintaining it so wonderfull and helping us all out! THANKS!!!!

To the situation:
Somehow I got a bluetooth scale which is doing strange things on customers side.
Most of the times, the app can connect to the bluetooth scale.
But sometimes, the app can't connect to the bluetooth scale.
The issue comes from the ble.startNotification

"DEFAULT: [\"failed to subscribe to notifications \\\"Could not find service with UUID 49535343-fe7d-4ae5-8fa9-9fafd205e455 on peripheral with UUID 140FC66D-B212-05F1-F5C1-2A285331FC85\\\"\"]",

If the user restarts the app, then the app can connect to the given UUID and Notification ID.
Also to mention that when trying to ble.connect again after some seconds and try again to ble.startNotification don't resolve the issue, you realy need to restart the app.

I've also tried to add a timeout with 150ms before calling ble.startNotification but this doesn't help either.

Adding to this, when the connection fails, I set a timeout, I search for the device again, and just when its found I try to connect and give also there needed timeouts.

Do you have any ideas why this behaves that strange?

Furthermore heres a screenshot of two logfiles: The left side where the connection works without any issues, the right one where the notification fails:
log_sample

Thanks for your great work and your awesome support!
Lars

@peitschie
Copy link
Collaborator

Hi @graphefruit

Which version of the plugin are you running with this? Is there any chance you can test a build with the current alpha version ([email protected])?

There's been a commit recently that might make it more obvious if there's a service discovery failure going on here: 28a6103

@peitschie peitschie added the ios label Aug 21, 2024
@graphefruit
Copy link
Author

Hey @peitschie,
thanks for the fast support and response!
Actually I'm running on cordova-plugin-ble-central 1.7.4 "BLE"
I will install this plugin and will sent it to the tester/person which can reproduce this issue sometimes.

I guess the error is passed to cordova, so I can rightly log it correct?

@graphefruit
Copy link
Author

@peitschie sad news :(
I've installed the [email protected], with one scale it works to transmit the weight to the app.
The other scale is not working anymore. Reverting back to 1.7.4 let the scale work again.

Can I do something to send you debugging helps? (Shall I create a new ticket aswell?)

@peitschie
Copy link
Collaborator

Hi @graphefruit

Grabbing debug logs on iOS is very difficult, unfortunately. The fact this is intermittent with the same version of the plugin does point towards something about the peripheral causing issues with iOS, rather than the plugin itself here having any issue.

It's worth checking if another BLE app has the same issue (e.g., nrf Connect) as this would hint much more strongly at a peripheral issue.

@graphefruit
Copy link
Author

graphefruit commented Aug 28, 2024

Good Morning @peitschie !
Thanks for the feedback.

Maybe I wrote a bit miss understanding, sorry for this, I'll try to clear it:

Scale 1:
I have a scale: DiFluid Microbalance TI.

On 1.7.4 it connects and the app can retrieve the send weight from the scale.
On 1.7.5 it connects but the app CANT retrieve the send weight anymore.

Scale 2:
I have a scale: Acaia Pearl S

On 1.7.4 it connects and the app can retrieve the send weight from the scale.
On 1.7.5 it connects and the app can retrieve the send weight from the scale.

The Acaia Pearl S was the scale which had issues that sometimes the App can't connect to the notifications and needed a reopening of the app completly.

Cause of Scale 1: It somehow points out the fact that something was changed in the version, which now makes somehow issues with attaching to the notification and get all data to handle.

Thanks for your help!
Have a great cup of morning coffee
Lars

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants