Separate bluetooth services into different BT-devices #122
Replies: 5 comments 45 replies
-
|
You are asking and stating a lot of things, and to be fair I dont fully understand a lot of these. I assume this is because you dont understand the different BLE Profiles. So lets break things down CPS and SCS and FTMS all are standards and Polar implements them correctly as well as orm. But the first two require wheel circumference the later is fully self sufficient. All three include distance and cadence as data. in addition to that CPS and FMTS includes power in addition to that FTMS includes pace as a standalone data item, )but CPS and CSC has all information that is necessary for the watch to calculate pace). In CPS and CSC distance is calculated from the rotation of bicycle wheel. Of course rowers do not have one, but these profiles require setting the wheel circumference to work properly. The data needed for distance calculation is manipulated artificially in the BLE package in a way that if you set the wheel circumference to 10mm, the correct distance is rerecorded. So the question is whether you have set the wheel circumference when using CPS or CSC?
Anything is possible, but this is pointless. This is not how CPS and CSC works. CPS can be considered an extension of CSC as it includes power data in addition to the data to CSC already has (technically CPS has more but from ORM perspective this is the difference) What is important is that on watches allow different profiles to connect for different activities. For instance garmin only alows CPS and CSC on Cycling activities for BLE (i.e. nothing gets recorded if you select rower). Garmin does not support FTMS. We provide two FTMS profiles: one is rower the other is Bike So I suppose (but I dont have Polar watch) that you need to select the correct profile for the correct activity. If you select rowing I suppose you should use FTMS Rower, if you select bike you should use FTMS Bike. PM5 mode is not supported by Polar. its a specific protocol. Polar can connect to PM5 of the Concept 2 rower erg via FTMS or ANT+ FE. |
Beta Was this translation helpful? Give feedback.
-
Do you clear the previous sensor? You see the MAC of the device is the same. So if not, is well possible that Polar does not able to handle different sensors with the same MAC (which is totally realistic because I cannot just simply do this on my Garmin either I even have to restart the device before connecting to the new type). on you other question. I am not 100% understand what is that your asking or stating. Can you please summarise it or make more specific what is that you are asking or saying? But to also provide some information: As I said, the profiles are as per the spec. The sizes of the data, the bytes and bits and their places, the flags all of it. They are all in line with the spec. I have another project ESP Rowing Monitor, I use the same logic (though in c++). I have a web GUI for that where I do the inverse, i.e. translate these to metrics. They are on spec. What you need to understand (and probably this would be clear for you if you read the BLE specifications for each sport profile properly) is that CPS and CSC behaves differently from FTMS. This is because the former 2 does not report absolute values. and it does not report speed. Everything needs to be calculated on the client side. Further more, these two profiles do not have a concept of "distance" they only count revolution (crank and wheel). To be able to report distance properly I had to apply a trick where I translate distance to revolution (actually every centimetre is sent as one wheel revolution) so that is why you have to set the wheel circumference to 10mm. Now, the way centrals calculate speed for these profiles is that they check the delta distance (received wheel rev * wheel circumference) and the delta time and they can calculate the speed for that period. The above also means that these watches are free to calculate distance the way they want (please see this issue: Abasz/ESPRowingMonitor#25) as there is no distance data in CSC and CPS we are just mimicking it by tricking the device. they may apply interpolation or what ever like Garmin. In addition to the above, BLE broadcasts every second (this is totally fine from a BLE Spec perspective) but it broadcast the last stroke data until a new stroke comes in. This is necessary because unlike in FTMS which has a pace field (which we can choose to update whenever), CSC and CPS does not and if we update distance mid stroke we will have spikes (during the drive's second higher speed during the recovery's second lower speed, you can see a picture of this on the issue I linked). But the point is that the reason we are able to get away with this is due to the fact that every decent company that implements CSC and CPS I have seen, disregards packets with the same data for a bit of time (e.g. Garmin does it for approx. 4 seconds) before triggering recalculation of previous vs. current distance and setting the speed/pace to zero. It is possible that Polar is not among these but I would be rather surprised because this issue has never been reported in the past 2 years. But to be transparent I never my self tested Polar because I dont have one. You are referring to a data filed: is this official Polar or something that is from their ? Are you using Polar's built in native activity (sport profile) to start the session? Is it cycling or rowing? why are you not using FTMS as I think Polar supports that and it is superior compared to the other (which only exist because Garmin does not support FTMS at all....) |
Beta Was this translation helpful? Give feedback.
-
|
Unfortunately my browser froze, while I was tyipng and I extracted the last lines from an emergency-picture.... My first statement was false due to mistyping and everything seems to be fine with CSC:
It will be implemented as a sensor in the training session "cycling" a the watch shows plausible values for cadence (but not for speed). When I try connect to CPS, the sensor is found with the name "OpenRower 0.9.6 (CPS) 1F1BB" and after it is connected, it is registered as "undefined (CPS)" in the list of connected sensors. It will not be implemented in the training session "cycling" and the watch shows the error message that no power sensor/meter is available and no speed and cadence sensor is available. I tried this after removing "OpenRower 0.9.6 (CSC)" from the list of connected devices and also restarted/rebooted my watch. I wonder, why my watch sets the sensors name to "undefined" as the BLE data capture with NRF does contain all information according to the CPS specification.
Absolutely! I checked the data that was human readable in nRF and evaluated the power-, revolution-, cadence- and time-data send by BLE. And it was in accordance to the specification and contained the values that ORM calculated.
I understand this and it makes absolutely sense. Therefore I suspect my polar watch to cut off revolution data that might be not considered plausible for bike revolutions, although the wheel circumference can be set down to a minimum value of 10 mm.
The data named _Polar is downloaded from the PolarFlow Website, where the data from the watch is uploaded, can be analyzed and on demand be downloaded.
The sports profile "indoor rowing" does not connect to any sensor. I asked Polar support about it and they said this is not supposed to work.
I also contacted polar support on this question and git the answer, that it is not implemented:
This is quite interesting as FTMS is implemented more and more in fitness machines and it would be a valuable function to retrieve speed and tilt from a treatmill or adjust its speed from the watch with respect to the implemented "running test" as this would give more consistent results compared to trying to run in the different required speed ranges for the running test outdoor. Or setting a training sequence for an indoor bike or a treatmill on the watch. Best regards Gero <Edit: pictures of watch display added> |
Beta Was this translation helpful? Give feedback.
-
That is very strange and I am not happy about it :) Can you please add logging to the HciSocket so I can see what packets are being send and received? This is the file to edit: And this is how it should look like (its around the bottom of the page). var socket = new native.HciSocket();
var res = socket.bind(devId, data => {
if (data instanceof Buffer) {
console.log('HCI Data:', data); // -> This is the new line
this.emit('data', data);
} else {
this.emit('close');
}
});
if (res < 0) {
throwError('Could not bind socket hci' + devId, res);
}
this.write = function write(data) {
// If error is returned, then the socket should be be closed soon automatically
console.log('HCI Write:', data); // -> This is the new line
return socket.write(data);
};
this.close = function close() {
socket.close();
};I would need a comparison between changed and unchanged gatt.js. Always connecting as a fresh sensor and ORM restarted in between so there are no other commands. So this is the testing flow:
Then edit gatt.js with the proposed changes and do the same flow. There is no need to start activity. Also if possible dont start simulation on ORM. Set logging for you should see something along the lines of this: |
Beta Was this translation helpful? Give feedback.
-
With the changed
The watch does work. I just mixed up that the changes in Out of curiosity I just tried to pair again with As an intermediate result so far it seems that users of Polar watches do not benefit from the suggested changes in
|
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
first of all I would like to thank you for the marvelous work on this project. I am new to Indoor-Rowing and use it primarily as a supplement to running, as I hope to establish a consistent Zone-2-Training in the right HF-Zone easier on teh rower than with running and have a sort of core-training included the same way.
Installation of ORM was really easy and after successfully configuring my rower (with some interesting trials and errors on the way; i will write down some information on this in a separate post later), it works like a charm, with stable stroke detection and plausible metrics in general, which accidentally correspond quite well to the data on the monitor delivered with the rower (Focus Fitness Row6). I found that a little suspicious, as the general notion is, that apart from concept2 monitors, the metrics can not considered trustworthy in general.
I used a Polar Vantage M for running and upgraded to a Vantage V3 last week. With respect to connectivity, they behave equal.
What I found interesting is, that both watches do recognize the original rownig computer, which communctaes with te FTMS-Service, but do no process any data from it. Both watches do not recognize the two FTMS-Services and the PM5 services from ORM. I find that fact intersting as at least the FTMS-Service is standardized and thus on the aquisition level the data packages should be processed equally in general.
I also tested the CSC and CPS profiles on the ORM with my polar watch. Both services are recognized and can each be paired to the watch. As polar does apparently not support external sensor data for its "Indoor Rowing"-profile, Using the bike service wouls be a feasible workaround.
With the "Indoor Bike"-profile on my polar watch (with tire-diameter 10 mm configured) and CSC-Profile on ORM, the cadence is shown and saved on the watch. But the speed is not available, neither the distance as it is propably calculated from speed and elapsed time.
With the CPS-Profile on ORM, the watch shows power and cadence, which is usefull already as the distance can be manually added later. Although it would be nice, if speed and distance could be recorded as well.
I wondered, if the polar watch explicitly expects one BT-client with a cadence-service only and a separate BT-client with a speed-service as the manual only describes the pairing with their own somewhat outdated Polar speed and candence sensors. For other listed, supported devices, which are also somehow outdated, I did not find any information, if they transmit as a combined (speed and and cadence) sensor as one single BT-device or if each service is transmitted by an individual BT-device. From my point of view it would not make any sence with respect to the BT specification, as it explicitly describes a CSC-Service (Cycling speed AND cadence) and not a specified speed service and another differently specified cadence service. This is actually the question that bothers me most, as I do not understand, if Polar does no abide to the standards in general or does have additional requirements on device specific data, like manufacturer ids etc., which would be really awfull!
If my thoughts about this "problem" are correct, do you think, it would be possible and easy to establish a supplementary Profile, which offers two BT Services at once and can be configured with different names (ORM Power, ORM Speed). The ORM will currently be paired with different service descriptions for the CSC and CPS profiles of ORM but is stored as paired with "openrowingmonitor" for both on them. As a result, switching profiles on ORM does not result in different data aquisition on the watch but the client will not be found at all because it is propably internally stored with the mores specific descriptor of the service which it was paired with. Thus it is not possible to switch profiles before unpairing the openrowingmontor-device for the CSC-Profile and pairing it again with the CPS-Profile on ORM.
I would guess that this could generate more CPU load on the raspberry, so that data aquisition and processing might become unstable or tacky. Thus the easier way, without additional development effort, could be a second raspberry, where the BT-device name can be changed to something else than "openrowingmonitor" and the CSC-Service is truncated to transmit the speed (and distance?) only, hoping that the watch does process the speed data, as no other data is present.
I described my findings on the incosistency of FTMS connectibility and compatbility and the incomplete data for the CSC-Service and asked for additionl information, so that one could e.g implement an emulator/converter, which gathers different BT-Service data as a server and provides the data with as different clients. So far on my first less detailed request, Polar recommende to contact the manufacturer of the third-party-sensor. But as the original Focus Fitness computer does communicate well with e.g. kinomap and the implementation of ORM does obey to the BT-Specifications, I do not know, what can be done about the unsatisfying findings concerning the Polar BLE-Connectivity without further information, how the watch does process the BLE data.
Sure, Polar watches aim mainly on runners, and as some of them do triathlon, they support cycling and also swimming, while ambitious cyclist would prefer different products. But as the specifications für BLE-services are clear, I cannot see any real reason for not implementing the support for FTMS measurement services (although the controll point service would be nice for power testing on treatmills) and also implement the UUID 2AD1 for rowing data as long as the according software RAM is not so packed, that these few lines of code are technically not feasible.
To put it short: Does anyone have an idea, how this issue can be solved?
Regards,
Gero
PS: I have already created accounts for intervals.icu and rowsandall.com and try to get aquqinted with those sites, so that I do not rely on the unfortunatelly closed PloarFlow-World if necessary. But I got accustomed with it for quite a while and found it easy to use and well arranged....
Beta Was this translation helpful? Give feedback.
All reactions