Wear for Locus Map beta testing

Started by milan.cejnar, December 06, 2017, 19:50:53

0 Members and 12 Guests are viewing this topic.

Marie Zemanova

@Milan
Continuing the message in the help topic about HR on Ticwatch E and Redmi Note 4x:

Bit more details
Ticwatch E: Wear version 2.8.2.183948193, rights given all except Storage (noticed just now)
Locus Map version 1.1.6

Redmi Note 4x: System MIUI 9 (9.3.22), Wear OS 2.15.0.207193535
Locus Map version 3.32.2, HR addon v. 1.0.7

Bit more for troubleshooting the HR reading:
On its own, Locus was running on the watch but the HR sensor was not, unless the app was on the screen in foreground and about 1 min after it went in background (the watch face dimmed). Locus was running without problems, simply tapping the watch to bring it in foreground again was enough to get again several HR readings. But as soon as the watch dimmed, the HR ran only for a few moments more.
While in background, Locus was only reading HR already provided by SGT, not initialising the reading. From the recording, the exact moment when I started SGT is very clear.




The first hour was Locus only, the second with SGT and the third (roughly) when the connection dropped and Locus recorded from the phone only.

---
The connection problem seems to be constant and somewhat puzzling, wear os is saying "connected" but I have noticed that no app can use the BT connection, so it is not only Locus. All apps where they connect are connecting through WIFI.
The only thing I would like to change on Locus side is to break the HR reading if no connection is detected, so that the reset is not necessary.

I'll have to reset the watch and to delete the connection on phone again to hopefully bring the BT connection back.

Majka


  •  

H Ifang

I was not able to reestablish connectivity by clearing data and cache of various apps / services as you suggested. While before that action Locus itself still worked with the old version, now it also has no more connection to the phone-counterpart.
The phone Wear OS app (of course, after deleting its data) does not know the watch any longer and it cannot be re-registered there too. So only possibility would be to do the watch reset / reinstallation as it seems.

I guess I will wait for next-gen now for that, sell the old one. As it happens snapdragon 3100 was presented today.
Lets see how fast new models are available, and for what prices..
  •  

Danjel Rojka

Am I the only one where it works reasonably well?

Best Regards
Danjel
  •  

fera

#123
It is very highly possible, Danjel, I'm afraid so  :-\

But good for you :)

What OS are you using on what devices?

Quote from: Danjel Rojka on September 11, 2018, 15:25:03
Am I the only one where it works reasonably well?

Best Regards
Danjel
  •  

Danjel Rojka

I use Nokia 7 Plus with Android 8.1 as Pure Android or Android One.

As Smartwatch I use the Polar M600 with current WearOS version. I can find out the exact version this evening.
  •  

fera

So we use the same wear version and Android One version (8.1), only difference is that you use it on a Nokia 7 and me on a Xiaomi Mi A1.

Puzzling... Maybe the watch hardware?
  •  

Marie Zemanova

Quote from: Danjel Rojka on September 11, 2018, 15:25:03
Am I the only one where it works reasonably well?

I would expect people posting when they have problems, not when everything works as expected... Myself, I wouldn't be here except a short thank you, if there was nothing to troubleshoot.

To be clear, I am not complaining about Locus. The connection problems I have are Wear problems, it has nothing to do with Locus alone. It might be a combination of Wear and MIUI, I'll try to update to latest MIUI and / or LineageOS.

And I could live with the problem I had with HR on Wear (reading HR only when in foreground, but could be avoided if another app was initialising the readings). For me, using 3rd party app as workaround would be fine. I was getting everything I needed in Locus this way in real time and everything was in the track recorded.

But if something is not working exactly as expected, IMHO, best is to give very detailed feedback. The developer can ignore it when they want but nobody can expect them to test any combination of hardware and software.
And any workaround could help others with the same problem.

Majka
  •  

Danjel Rojka

I am always happy when I get positive feedback. This can narrow errors and exclude certain constellations.

Yesterday I had the problem that the connection or recording was not continuous. Presumably, this is due to the low battery level on the smartwatch.

But I have to verify that again.

I'll let you know.
  •  

milan.cejnar

Hello,
@H Ifang I see you too have a lot of "fun" with Wear OS platform :) I myself cannot copy my accounts to  Google Play on the watch so Google Play is not working for me at all. Clearing accounts & clearing caches on the phone & watch factory reset didn't help :( @Marie here also has some general Wear OS connectivity issues if I understand correctly. I really don't understand what is Google doing with the platform but it is not so great so far :/

@Marie
Thanks for a lot of info and nice graph to show what is going on. It seems you actually have 2 separate problems. The first one is a problem that fera and a also sometimes Danjel have which is that a lot of data is missing from the recording so the HRM is dropping to zero way too often. That is something I will try to fix.
The second problem seems to be that your watch is probably killing of the foreground HRM service when you exit the app. That is something I will check but honestly don't think I will be able to fix. The OS should not be killing off foreground services under normal circumstances and I am not sure why your watch is so mean to do that to the Locus app.
Definitely thanks for the feedback though and I will be glad if you help with beta testing later because your watch seems exceptionally buggy with our app :/

@Danjel @fera
Well the app and HRM is working for me as well, which is very unfortunate for a developer :) Though I can confirm that those drops to 0 BPM seem to be an issue with the app which I will be working on to fix it later. I will try to use more light-weight communication API from watch to the phone to send HRM

@fera
I am a bit surprised that the rest of the APP is working normally though without a lot of "connection lost" error screens in your case if HRM seems to be so unstable, really a mystery :/ Really weird that various phone/watch combinations behave so differently and definitely not helping with the debugging...

Anyway thank you for all the feedback I need to work on something else for a couple of weeks but I have been talking with Menion and fixing these Wear OS HRM issues is quite a high priority for us so I am hoping to return to working on Wear OS very soon and start releasing some experimental Beta versions with a bit different communications handling. Sorry for all the trouble in the meantime and I hope the rest of the add-on is working correctly for you.
  •  

Danjel Rojka

#129
Quote from: Danjel Rojka on September 12, 2018, 13:34:57
I use Nokia 7 Plus with Android 8.1 as Pure Android or Android One.

As Smartwatch I use the Polar M600 with current WearOS version. I can find out the exact version this evening.

On Polar M600 is Wear OS 1.5
HomeApp 2.15
Android 8.0
Security Patche  from 5.August 2018

On the Smartwatch the power saving function is deactivated.
  •  

Marie Zemanova

Quote from: milan.cejnar on September 13, 2018, 16:19:51
... @Marie here also has some general Wear OS connectivity issues if I understand correctly. I really don't understand what is Google doing with the platform but it is not so great so far :/

@Marie
Thanks for a lot of info and nice graph to show what is going on. It seems you actually have 2 separate problems. The first one is a problem that fera and a also sometimes Danjel have which is that a lot of data is missing from the recording so the HRM is dropping to zero way too often. That is something I will try to fix.
The second problem seems to be that your watch is probably killing of the foreground HRM service when you exit the app. That is something I will check but honestly don't think I will be able to fix. The OS should not be killing off foreground services under normal circumstances and I am not sure why your watch is so mean to do that to the Locus app.
...

In the meantime, I did some changes on my phone and updated everything I could (system, google play services, Wear OS to latest version). The Wear OS (connection) problems might be solved - I need to check over a longer time then the single bug-free day I had.

The problem was there on MIUI9, and was slightly better on fresh install of MIUI10 (8.9.6, last weekly version from miui.cz) without any changes from standard settings. It still didn't work well enough and I got BT-disconnects quite often.

To troubleshoot the bluetooth connection, there are some changes needed in the system: both Locus and Wear OS need to have "power saving" disabled, additionally both need to be "locked in memory" and both run slightly better if "wakelock" is manually enabled in permissions (including allowing wakelock initialised from 3rd party apps). I suspect this would be true for all apps which have to run even in part in the background - for example the HR zones plugin. This seems to stabilize the Bluetooth connection so that no "lost connection" comes up. It did clear the problem when the watch couldn't be paired at all as well, no more "Airplane mode" on/off or resetting the phone and hoping for best to get it working since I set it up this way. It isn't enough to disable the power saving features, for some reason it needs the additional changes as well.

This might (but only might) be a solution even for MIUI9, but the settings (and switches) needed are hidden deeper im System and some might be inpossible to set without rooting. No idea, I won't be going back to this version.

With these settings, Locus is running stable on both phone and watch, the connection is solid and the recording can be initialised from phone or from watch, and closed from phone or watch as well.

Regarding heartrate from the watch:
The Locus app was on the watch in foreground, on screen. I have disabled any power saving feature I found/I could access. Unfortunatelly, I cannot fine tune it the same way as the phone.
Locus was running fine, but the HR was not read (this time, on its own it didn't get even single reading). As soon as I started SGT on the watch, Locus on the phone started to display HR, the recording includes both HR and cadence from ANT+ sensor without a problem and without a single glitch anywhere.



I am ready to test any beta version for possible solution. But for me, this is working fine just as it is.
It just seems that Locus on Wear, at least on my watch, would need to push harder to get HR reading, it can at the moment only read the heartrate if it is already provided by something else. Just to be clear,  it does have the needed premission - this shows inside of the app on watch as well as in application info in system. I did look at permission of SGT - this has additionally "storage" and "GPS" permission on the watch.

Majka
  •  

milan.cejnar

Hello Majka,
I am using MIUI 8.5 and can confirm that without disabling battery optimizations Locus Map quickly loses GPS in the background or gets terminated. Wear add-on surprisingly runs even without disabling optimizations at least on my phone. I might try to update my MIUI and see if it gets worse in the newer versions. But disabling the optimizations is basically required for Xiaomi devices in order for GPS to run correctly in background, seems there is no way around that unfortunately.

As for the watch it is really a mystery. I do not understand why would your watch just kill the foreground Locus HRM service. When I prepare the next beta I will try to show popup toast messages on service start and stop and also reenable HRM debugging so that we could see if HRM sensor is really not feeding any data for you even with the app in the foreground.

Best Regards
Milan
  •  

Marie Zemanova

Quote from: milan.cejnar on September 18, 2018, 11:15:53
I am using MIUI 8.5 and can confirm that without disabling battery optimizations Locus Map quickly loses GPS in the background or gets terminated. Wear add-on surprisingly runs even without disabling optimizations at least on my phone.
I have found ton of messages regarding problems with bluetooth on MIUI. It does work for some versions - somewhere in the 8.5 range :) - but the next few up have the problem. It is not limited to the WearOS devices, it is a general BT problem, people cannot connect to car devices as well. I would say, somebody has probably forgotten to get the BT connection an exception from optimisation in system in these versions.
I didn't find anything about possible solutions.
What I am doing seems to be working, I have confirmed it again today: Unless I lock the WearOS app in the memory, it just looks like everything is running fine - but the BT won't either connect at all, or the WearOS app is "saying" it is connected, but the connection is not really running stable (for example no screenshot possible, etc.). Locus on Wear is getting the "not connected" message at the same time.

Since my first message, there was update of system/wear os app/google play services on the watch as well, and since then I cannot get single reading of HR from Locus on Wear by itself, where the previous version got the values at least if Locus was in foreground and not dimmed. Might be some optimisation somewhere in the updates.

Majka
  •  

fera

Quote from: Marie Zemanova on September 17, 2018, 21:59:56
Regarding heartrate from the watch:
The Locus app was on the watch in foreground, on screen. I have disabled any power saving feature I found/I could access. Unfortunatelly, I cannot fine tune it the same way as the phone.
Locus was running fine, but the HR was not read (this time, on its own it didn't get even single reading). As soon as I started SGT on the watch, Locus on the phone started to display HR, the recording includes both HR and cadence from ANT+ sensor without a problem and without a single glitch anywhere.

Majka, help me clarify something :)

If I understand correctly, when you start SGT the Locus add-on is running on the watch as well at the same time? Which one stayed in the foreground?

Did this help the HR readings if you haven't used an ANT+ cadence sensor as well?
My question is, do you suggest that SGT somehow "pushes" the readings to the LM on the phone?

Thanks!
  •  

Marie Zemanova

Quote from: fera on September 18, 2018, 13:29:11
If I understand correctly, when you start SGT the Locus add-on is running on the watch as well at the same time? Which one stayed in the foreground?
Yes, both are running at the same time. And for me, neither has to run in the foreground, it is working even if both apps are in background and the watch is completely dimmed. It doesn't make any difference which app is started first and which second. As soon as both are running, I get the HR without any problems in Locus.

What I am suggesting is that SGT is doing something different and is for some reason is better at getting the sensor to work and to keep it working.

Locus is without any problems reading the heart rate from the sensor if the sensor is already running. But (at least on my watch) the Locus wear app is unable to start the sensor and to keep it at work. It needs SGT to do it instead.

The first experience I had was somewhat better - Locus was able to start the sensor when the app was in foreground and not dimmed but as soon as the watch screen dimmed (with Locus still in foreground), it couldn't keep the HR sensor at work. At least that is my current interpretation of the problem.

You could try this for yourself and it might be good to have another confirmation: Install the SGT tracker app, get it working on the watch and run Locus at the same time. If my reasoning is correct, you would then get constant HR readings as well, no zero values.
  •