Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - mspider65

#1
Thanks!

I've just given some useful links to Jose.
I hope it will be helpful.

Massimo
#2
Hi Orux, Great Job!
I have just done a test sending Power, Speed, Cadence and Accumulated Energy (the last field)  and i can see all the correct values on the dashboard.
Is it possible to have also these values stored in the tour data ?

Massimo
#3
Hi Orux, thanks!
Since i also use your greath app i will be glad to help you in the fix (if you want).
In case, do not hesitate to contact me on my registration email.
You probably already know, but  below You could find the link to the GATT specification of the Cycling Power Measurement Characteristic.
https://www.bluetooth.com/xml-viewer/?src=https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Characteristics/org.bluetooth.characteristic.cycling_power_measurement.xml

Massimo
#4
Hi,
i'm using the 7.4.22 version and I found a problem in the Cycle Power BT 4.0 sensor implementation.
I was trying to integrate a BT power sensor developed by me without success and I had to decompile the code of your application to understand why it didn't work.

I have seen that to read the values ​​sent by the sensor, the application read the optional values ​​from fixed positions instead of using an offset based on the values ​​actually present in the message.
I attach a piece of code example showing the correct way to read the sensor message content.

In this way the application will be compatible with all BT 4.0 Power Sensors (BT Cycle Power Profile standard) and not only the sensors you have tested and sends exactly the data you expect to receive.

Regards,
Massimo



private static final int PEDAL_POWER_BALANCE_PRESENT        = 0x0001;
private static final int ACCUMULATED_TORQUE_PRESENT         = 0x0004;
private static final int WHEEL_REVOLUTION_DATA_PRESENT      = 0x0010;
private static final int CRANK_REVOLUTION_DATA_PRESENT      = 0x0020;
private static final int EXTREME_FORCE_MAGNITUDES_PRESENT   = 0x0040;
private static final int EXTREME_TORQUE_MAGNITUDES_PRESENT  = 0x0080;
private static final int EXTREME_ANGLES_PRESENT             = 0x0100;
private static final int TOP_DEAD_SPOT_ANGLE_PRESENT        = 0x0200;
private static final int BOTTOM_DEAD_SPOT_ANGLE_PRESENT     = 0x0400;
private static final int ACCUMULATED_ENERGY_PRESENT         = 0x0800;

.
.
.

if (characteristic.getUuid().toString().equalsIgnoreCase(CHARACTERISTIC_UUID_CYCLING_POWER)) {
    // Read flags
    int flag =  characteristic.getIntValue(BluetoothGattCharacteristic.FORMAT_UINT16, 0);
   
    // read istantaneous power (always present)
    int power = characteristic.getIntValue(BluetoothGattCharacteristic.FORMAT_SINT16, 2);

    // Read optional fields
    int offset = 4;
    if ((flag & PEDAL_POWER_BALANCE_PRESENT) != 0) {
        power_balance = characteristic.getIntValue(BluetoothGattCharacteristic.FORMAT_UINT8, offset);
        offset +=1;
    }
    if ((flag & ACCUMULATED_TORQUE_PRESENT) != 0) {
        accumulatedTorque = characteristic.getIntValue(BluetoothGattCharacteristic.FORMAT_UINT16, offset);
        offset +=2;
    }
    if ((flag & WHEEL_REVOLUTION_DATA_PRESENT) != 0) {
        wheel_revolutions = characteristic.getIntValue(BluetoothGattCharacteristic.FORMAT_UINT32, offset);
        offset +=4;
        last_wheel_event_time = characteristic.getIntValue(BluetoothGattCharacteristic.FORMAT_UINT16, offset);
        offset +=2;
    }
    if ((flag & CRANK_REVOLUTION_DATA_PRESENT) != 0) {
        crank_revolutions = characteristic.getIntValue(BluetoothGattCharacteristic.FORMAT_UINT16, offset);
        offset +=2;
        last_crank_event_time = characteristic.getIntValue(BluetoothGattCharacteristic.FORMAT_UINT16, offset);
        offset +=2;
    }
    .
    .
    .
   
   
    then do the same for all the other fields in the following order:
   
    Extreme Force Magnitudes - Maximum Force Magnitude
    Etreme Force Magnitudes - Minimum Force Magnitude
   
    Extreme Torque Magnitudes- Maximum Torque Magnitude
    Extreme Torque Magnitudes- Minimum Torque Magnitude
   
    Extreme Angles - Maximum Angle
    Extreme Angles - Minimum Angle
   
    Top Dead Spot Angle
   
    Bottom Dead Spot Angle
   
    Accumulated Energy

}



#5
GENERAL / BT 4 Cycling Power Profile
May 04, 2020, 08:55:33 AM
Hy,
i'm adding Bluetooth capabilities to the Tongsheng TSDZ2 E-Bike motor. I have added to the BT interface the Cycling Power Profile but I'm not able to integrate the sensor into Oruxmaps.
I have tried to use the Cycle Power BT 4.0 sensor option but the data collected is wrong.
I also don't understand what the two configuration parameters T1 and T2 are for.
My sensor implementation follows the Cycling Power Profile Bluetooth specifications  (https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=412769), (https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=412770) and my sensor provides speed, cadence and instantaneous Power.
Could someone give me some more details about Oruxmaps BT 4.0 Cycle Power Sensor integration?

Regards