-
-
Notifications
You must be signed in to change notification settings - Fork 291
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
BLE connectivity issues debugging #335
Comments
What issues are you trying to solve exactly? At had a look at BluetoothCommunication.java and I have a couple of ideas you can try:
Here is what I do in my own BLE apps when the device is getting connected and need to discover the services:
|
Hello, I followed your steps on a scale which had a pre-configured user from the original app as I mentioned in the other issue and just added it in this app. The extended info (during "pairing") from the scale was fetched for around 10-15 seconds, then I saw that the table wasn't synced and I couldn't see my last weighing so I decided to step on the scale, but it couldn't weigh me as I was on a carpet floor and moved to a hard surface floor. It weighed me and showed me all my stats on the scale display, but nothing came to the app and after that I downloaded the log which I am attaching now. |
Here one from moto g5. https://drive.google.com/file/d/1pBNgj_PXoKX3TzLYzRKFlmQDJ-u0_7_7/view?usp=drivesdk |
@Alejandro131: the problem in your log I think was that the wrong descriptor was used to enable notifications. Please try with the latest version and report how it works for you. |
@ReidarHH: your case is harder. I added an extra delay just now. Please test with the latest build (once done) and let me know how it went. If that doesn't work, try to revoke the coarse location permission and try connecting to the scale. In that case you can't do the search for scales under settings -> bluetooth so just try to connect to it after enabling the debug log. |
@Dododappere: Thanks for your suggestions! I appreciate all points and hints. We've seen a number of different BLE problems, and this is my attempt at structuring the reporting a bit. Your first two suggestions I've already implemented on the ble-main branch which is used here. For the third, we've seen at least one scale (Medisana BS444) where it seems like connecting always fails if it isn't discovered first. There are also some phones where scanning improves the success rate. I have had the scanning during connect removed, but had to add it to fix connectivity issues. I will let @ReidarHH try a build with autoconnect = true as a next step (after the one in the previous comment) to see if that helps in that case. |
Here's the result of the debug log. https://drive.google.com/file/d/13ps4qoWRACtD43brBicbpuUeyAfmIA5z/view?usp=drivesdk |
Here's mine (SBF70): |
@erijo Thanks for the quick response and fix. (SBF70 and Nexus 4) I downloaded the app and fired it under 2 conditions - with a scale which has a user from the original app and with a reset scale. With a scale which has a user from the original app and I added the user to openScale I got everything - the intermediate weight and all the body data, but there is one strange thing - the scale reports AMR (1736 kcal) and BMR (1510 kcal), but the app shows only BMR by default (and there is no option to activate AMR) and also it seems that the BMR value read by the app is actually the AMR value - 1736 kcal. This is the log for that condition: With the other conditing - reset scale and reset app, I only get the weight measurement and nothing else, so it seems that openScale can't create users on the scale so that I can get all the other body data. This is the log for it: On a side note, not every time I weighed myself the app registered it, but that is probably because of the merge readings settings and the fact that I weighed myself at close intervals (less than a minute), but worked with larger time intervals, so I guess it is how it works. |
@bandita00: you seem to have the same problem as @Alejandro131 had. That problem is fixed in 2f1b766. But you need to use the build in the issue description and not from the play store. |
To see if it helps the problem reported by @Alejandro131 in #335.
@Alejandro131: There's been discussions about BMR, RMR and AMR elsewhere. The value is calculated by the app and different apps may use different formulas. Which is right or wrong I don't know, but we'll leave that discussion for another issue. Regarding the new user problem I did an untested "fix". Please try the latest build after resetting the scale. |
@ReidarHH: added some code that will toggle the autoConnect flag if connection fails (to test @Dododappere idea about using autoConnect = true). After trying the other test (without the coarse location permission), please try with the latest version. If the first connection fails, try to connect again. It should then use autoConnect = true. |
@erijo Thanks for the quick response and fix. I tested it on a reset scale with 2 different users (both times the scale was reset, so I could be sure that the problem wasn't from me). The scale gets the information from the app and now my name is shown on the scale and all values are calculated, but the moment this happens, the app loses connection and no information is sent back to it, so I can't see the values in the app, only on the scale display. Here are the logs: P.S. About the BMR/AMR should I open another issue or it isn't a priority currently? |
I decided to test the scale again and here are the results. This time I tested on a reset scale but after that I tried to measure myself again and also tried adding a 2nd user as well. Here are my steps:
I'm attaching 2 logs, one is from 1) to 6) and the second is from 7) to 8) openScale_2018-10-11_09-44.txt All in all it seems that even with some quirks I can successfully use openScale with SBF70 - keeping in mind that 1st time user creation readings aren't available and that I have to read the BMR/AMR from the scale display it is a working solution. |
@Alejandro131 you have to do it like in #332 (comment) described to create a 2nd account. For the BMR/AMR issue you don't have to create a new issue. If you want to be exactly the RMR is calculated in openScale see #310 @erijo Do you think that the Bluetooth connection problem is resolved with the ble branch? Should we merge it into the master rep? Do you know what the problem was? A timing problem? |
I think the connectivity is improved at least. I've merged it to master so we can perhaps close this for now. Don't have much time at the moment to look into this more. |
@ReidarHH: would be interesting to hear if latest master works any better for you, or if you're still having problems. |
Hello Erik |
@Alejandro131 : if you want to you can test this dev version which should hopefully work better with the first user registration. |
Just tested it - works perfectly - 1st user doesn't get disconnected on first measurement and everything is transferred to the app. 2nd user registration works flawlessly as well - thanks for the update and fix :) |
To help debug BLE issues, please:
Then report your result as a comment here. Remember to attach (i.e. don't copy paste it as a comment) the debug log. Also describe what you did and what happened.
The text was updated successfully, but these errors were encountered: