Cycling Speed and Cadence Sensor

Posted on
  • Hi,
    I was trying the app CSC sensor with a Coospo-Bk805 on my bike.
    The watch does detect it and connects to it.
    Values recorded keep at zero though.
    Whereas, using any app (not only those recommanded by Coospo) on my phone or any other device, detects the Bk805 and records valuable datas (Speed, distance, total distance, cadence, battery level, ...).
    Am I missing a point ? shall i have to tweak CSCS Bangle app to use the correct datas ?
    Any help would be great
    Thanks

  • Hi,
    I am the author of the app. Unfortunately I am spread a little thin at the moment and will not be able to debug this in detail in the next few days (but will hopefully get to it eventually).
    I have tested the app with two different sensors, a Wahoo brand sensor and a no-name sensor from a China direct import website (I don't have access to the latter right now, so I can't check on the exact name or make). Both worked without any special tweaks, so I am not sure what is going on here.
    That being said, I will have to work on the app anyways to adapt it to the new Bangle 2 layout. I will also try to source a Bk805 sensor to see if I can test it out...
    Marko

  • Perhaps one further clarification: the app currently only reads the 'speed' portion of the data sent by the sensor, I wonder if that is somehow related to your problem... Is there a way to set the sensor to 'speed only' mode?

  • Hi Marko, thank you for having taken a bit of your time to let me know this ! I really appreciate, and don't worry, take your time, there is no urge.

    The Bk805 is providing both cadence and speed in a single module (there are two magnets, one on the pedal lever, the other on the wheel). I haven't found (yet) if it is able to be set to speed only.

    And I ll try to monitor what is sending and received

    nRF Toolbox provides not only the way to update our favourite watch's firmware, but a CSCS monitor too. It reads correctly the BK805's datas. Perhaps digging there to have a clue of how it works...

    I ll too ask my bicycles friends riders if they have other CSCS brandss to test with your app (just to be sure the issue isn't a wrong setting of my watch)

    Looking forward for the next episode

  • I just ordered a BK805 so I'll see if I can figure out why it's not working (it'll be a few weeks before it arrives I think though). It makes me think this would be a great addition to be able to log the information along with a GPS trace.

  • Great ! that s really nice to hear
    Thank you

  • a little up, just in case someone has tried something with the CSC app and wanted to share

  • I've just pushed some changes, they'll be on the development app loader right now (not banglejs.com/apps)

    The issue was that if the sensor supported cadence, only cadence was read, not the wheel revs as well :)

    It's fixed now so should work fine. It's tantalisingly close to being usable on Bangle.js 2 as well - it's just everything on screen has a hard-coded position so right now not all the data fits.

  • Thank you very much Gordon ! I'll give it a try this afternoon

  • hi again,
    I have just tested it.
    I first checked the batteries of the Bk805. 100%
    I connected it to nRf toolbox, and cadence and speed are shown.
    Then i disconnected it and launched the Bangle ´s CSC app.
    It connected to the BK805.
    But after a few cycles of the pedal lever, and even again for a longer time, still no value shown on the watch. Everything kept at zero, even the battery level of the BK805 only showing a question mark. On both pages (speed and cadence)
    I pushed the reconnection button (by the way, i think their functions have been swapped regarding the Readme) but still no success.
    I ll have a later try with the consol on

  • Did you load it from the development app loader? So you've got version 0.06?

  • as soon as i saw it on the dev app loader, and just checked to be sure, the version on my watch is the 0.06
    Could it be GadgetBridge that selfishly keeps BLE for itself ?
    I havent tried yet with GB disabled

  • No, that should be fine. Literally all I did was run the app and it worked fine for me, showing a bunch of different readings. Although battery never updated.

    Maybe try running it with the Web IDE connected and see if you get any error messages

  • 
    ____                 _
    |  __|___ ___ ___ _ _|_|___ ___
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
             |_| espruino.com
     2v10.229 (c) 2021 G.Williams
    {"t":"status","bat":50}
    Done!
    >
    {"t":"act","stp":0,"hrm":-1}
    {"t":"act","stp":0,"hrm":-1}
    {"t":"act","stp":0,"hrm":-1}
    {"t":"act","stp":0,"hrm":-1}
    {"t":"act","stp":0,"hrm":-1}
    {"t":"act","stp":0,"hrm":-1}
    {"t":"act","stp":2,"hrm":-1}
    {"t":"act","stp":17342,"hrm":-1}
    {"t":"act","stp":17342,"hrm":-1}
    {"t":"act","stp":17342,"hrm":-1}
    {"t":"act","stp":17342,"hrm":-1}
    {"t":"act","stp":17342,"hrm":-1}
    {"t":"act","stp":1,"hrm":-1}
    {"t":"act","stp":1,"hrm":-1}
    {"t":"act","stp":17349,"hrm":-1}
    {"t":"act","stp":1,"hrm":-1}
    {"t":"act","stp":1,"hrm":-1}
    {"t":"act","stp":17351,"hrm":-1}
    {"t":"act","stp":17351,"hrm":-1}
    {"t":"act","stp":17351,"hrm":-1}
    {"t":"act","stp":17351,"hrm":-1}
    {"t":"act","stp":17351,"hrm":-1}
    {"t":"act","stp":17351,"hrm":-1}
    {"t":"act","stp":17351,"hrm":-1}
    {"t":"act","stp":17351,"hrm":-1}
    {"t":"act","stp":17351,"hrm":-1}
    {"t":"act","stp":17351,"hrm":-1}
    {"t":"act","stp":1,"hrm":-1}
    {"t":"act","stp":2,"hrm":-1}
    {"t":"act","stp":1,"hrm":-1}
    {"t":"act","stp":17360,"hrm":-1}
    {"t":"act","stp":1,"hrm":-1}
    {"t":"act","stp":1,"hrm":-1}
    {"t":"act","stp":1,"hrm":-1}
    {"t":"act","stp":17363,"hrm":-1}
    {"t":"act","stp":17363,"hrm":-1}
    {"t":"act","stp":17363,"hrm":-1}
    {"t":"act","stp":17363,"hrm":-1}
    {"t":"act","stp":2,"hrm":-1}
    {"t":"act","stp":2,"hrm":-1}
    {"t":"act","stp":17372,"hrm":-1}
    {"t":"act","stp":17372,"hrm":-1}
    {"t":"act","stp":17372,"hrm":-1}
    {"t":"act","stp":17372,"hrm":-1}
    {"t":"act","stp":17372,"hrm":-1}
    {"t":"act","stp":17372,"hrm":-1}
    {"t":"act","stp":17372,"hrm":-1}
    {"t":"act","stp":17372,"hrm":-1}
    {"t":"act","stp":17372,"hrm":-1}
    {"t":"act","stp":17372,"hrm":-1}
    {"t":"act","stp":17372,"hrm":-1}
    {"t":"act","stp":17372,"hrm":-1}
    {"t":"act","stp":17372,"hrm":-1}
    
    

    Well i expected to see something more related to the CSC…

  • Hmm - well Done! comes from https://github.com/espruino/BangleApps/b­lob/master/apps/cscsensor/cscsensor.app.­js#L238 so it's definitely connecting and thinks everything is ok.

    I think your best bet is to upload that file and add some print statements to updateSensor to try and see what's going on - it just seems strange as I specifically bought a BK-805 to test and mine works great

  • to upload that file and add some print statements to updateSensor to try and see what's going on

    thank you Gordon
    Although I m not sure to understand what you mean with "upload that file" (which one and where to), nor how to "add some print statements to updateSensor".

  • I have tested several things and believe I have part of the solution to my problem. In NrFTools CadenceSpeed and another app on my phone that the BK works with, I noticed that the speed measurement was not constant, sometimes it didn't show anything. So I optimized the place of the BK on my bike by bringing the magnets closer together. By repeating a test with the CSC application of the Bangle, data was finally displayed. Finally, not all of them, the cadence remained at zero. Indeed I think that the other fields (average distance, total distance, etc.) are calculated from the speed. This is why they remained empty when the speed was not sensed. That doesn't explain to me why cadence is not measured when it is with other apps I've tested.

  • Ahh, ok, perfect! So it was a hardware issue!

    I notice @user113695 said above:

    currently only reads the 'speed' portion of the data sent by the sensor

    So I think because he doesn't have a sensor that does the pedal speed too, he hasn't been able to properly add/test code for that.

    When I tested, I used only wheel speed (which I did by waving a magnet over the sensor) - I didn't get a chance to do pedals too :)

  • Hehe, all makes sense then :-)
    For now, what i needed was my speed and distance, so I'm actually happy with it, but i'm curious, so I'll take it as a personnal challenge to try to understand the code and try to figure out how to get/set the cadence too.
    Thank you very much Gordon for having taken time to help !

  • No problem! Yes, it could be quite a good project. It seems the code is there:

    https://github.com/espruino/BangleApps/b­lob/master/apps/cscsensor/cscsensor.app.­js#L158-L159

    But I think it must be getting it from the wrong place in the data string (eg getUint16(1, true) should be something other than 1) because that's the same place wheelRevs comes from.

    https://learn.adafruit.com/bluetooth-bic­ycle-speed-cadence-sensor-display-with-c­lue?view=all might be handy as a primer

    Actually I think what's happened is the original app was designed thinking that if the crank speed bit was set, the whole advertising packet only did the crank. But what it really means is that there's wheel and crank data.

    It's really hard to read, but here's the spec: https://github.com/oesmith/gatt-xml/blob­/master/org.bluetooth.characteristic.csc­_measurement.xml

    So I think just changing to:

            const crankRevs = event.target.value.getUint16(7, true);
            const crankTime = event.target.value.getUint16(9, true);
    

    might fix it

  • Wow, wonderful ! i ll try that, thank you very very much !

  • is there any chance that someone would like to adapt this nice app for the Bangle2?
    @user113695 maybe ?

  • I started working on moving the interface over to the new Layout library (so it would work on both Bangles), but my effort was based on an older code base. I would have to merge it with the cadence sensor work. I also added a added an optional device selection dialog, in case there is more than one sensor in the vicinity.
    Hopefully I can find some time soon to put some more work into it...


    1 Attachment

    • IMG_20220208_161041.jpg
  • In fact, you can try out the current (incomplete) version at https://berkenbu.github.io/BangleApps/
    I haven't changed the meta data yet, you will have to select "All apps" in the top left instead of "Bangle.js 2", otherwise it won't install on Bangle2

  • Sounds great news ! thanks
    I'll give a try at it, thank you very much @user113695

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Cycling Speed and Cadence Sensor

Posted by Avatar for nicoboss @nicoboss

Actions