• Hi everybody and esp. Gordon (thanks for Espruino!!),

    I'm looking into receiving sensor readings from the commercially sold CSC sensor Wahoo Speed (https://www.amazon.com/Wahoo-Cycling-Speed-Sensor-Bluetooth/dp/B01DIE7LUG/ref=sr_1_3?s=sporting-goods&ie=UTF8&qid=1532458958&sr=1-3&keywords=wahoo+speed) which came with my bike computer Wahoo ELEMNT Mini, of which I want to replace the cumbersome headunit.

    The sensors sends data via BLE with the CSC service:

    https://blog.bluetooth.com/part-2-the-wheels-on-the-bike-are-bluetooth-smart-bluetooth-smart-bluetooth-smart

    https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.csc_measurement.xml

    Using NRF connect on Android, the sensor readings are shown easily after enabling the notification.

    Now to the crucial part (for me):
    This code:

    var gatt;
    NRF.requestDevice({ filters: [{ namePrefix: 'Wahoo' }] }).then(function(device) {
      console.log(device);
      return device.gatt.connect();
    }).then(function(g) {
      gatt = g;
      return gatt.getPrimaryService("1816");
    }).then(function(service) {
      console.log("Service:" + service);
      return service.getCharacteristic("0x2A5B");
    }).then(function(characteristic) {
      return console.log(characteristic);
    }).then(function() {
      gatt.disconnect();
      console.log("Done!");
    });
    

    gives me this output:

     ____                 _
    |  __|___ ___ ___ _ _|_|___ ___
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
             |_| espruino.com
     1v99 (c) 2018 G.Williams
    >
    =undefined
    BluetoothDevice: {
      "id": "df:b3:22:19:bd:8e random",
      "rssi": -60,
      "data": new Uint8Array([2, 1, 6, 3, 3, 22, 24, 17, 9, 87, 97, 104, 111, 111, 32, 83, 80, 69, 69, 68, 32, 54, 51, 70, 49]).buffer,
      "name": "Wahoo SPEED 63F1",
      "services": [
        "1816"
       ]
     }
    Service:[object Object]
    BluetoothRemoteGATTCharacteristic: {
      "uuid": "0x2a5b",
      "handle_value": 36, "handle_decl": 35,
      "properties": { "broadcast": false, "read": false, "writeWithoutResponse": false, "write": false,
        "notify": true, "indicate": false, "authenticatedSignedWrites": false }
     }
    Done!
    

    Can anyone point me in the right direction how I can enable and receive the CSC measurement? Sorry I'm a dummy with programming/JavaScript...
    The path to go I imagine would probably consist of writing to 0x2902 characteristic to enable notifications and have some kind of callback receive and interpret the data.

    Later on I plan on using the new MDBT42Q Breakout, connecting a Waveshare epaper display and 3d print a small case and have it running on a 18650 battery. Another option would be to use Pixl.js with a custom case and some kind of battery managment.

    Thanks for any help!!
    Best regards,

    Joost

About

Avatar for Joost @Joost started