Puck.js, exposing Sensor Data to Google Science Journal

Posted on
  • Hi Gordon,

    I would like Google Science Journal to be able to record sensor data from my Puck.je over BLE.

    Can you point me to an example that would be relevant please?

    Here are the details, from a user who had a similar problem, visa vi, the Micro:Bit

    "As I understand it the Science Journal app is looking for Bluetooth advertising a service with the UUID "555a0001-0aaa-467a-9538-01f0652c74e8" and sends the value of the sensor on a characteristic with the UUID of "555a0003-0aaa-467a-9538-01f0652c74e8.

    If you use online tools, such as https://pxt.microbit.org/, to program the micro:bit then it will use the UUIDs as specified in the default micro:bit profile as specified at https://lancaster-university.github.io/m­icrobit-docs/resources/bluetooth/bluetoo­th_profile.html

    You would need to use the mbed platform (https://developer.mbed.org/platforms/Mic­robit/) to expose the sensors with the right UUIDs."

    I'm looking to translate that logic to Espruino code. I guess temperature would be good place to start. Note, I'm not trying to create a BLE temperature sensor with the expected temp sensor profile, but rather this particualr flavor the the Science Journal requires.

    Thanks,

    R.

  • It looks like you need to port the arduino code here:

    https://github.com/google/science-journa­l-arduino/blob/master/src/arduino101/sci­ence-journal-arduino.cpp

    You should be able to take a puck.js sample, and change the service Id's like you have identified.

  • Using the link above, it looks like:

    NRF.setServices({
      '555a0001-0aaa-467a-9538-01f0652c74e8' : {
        '555a0003-0aaa-467a-9538-01f0652c74e8' : {
          value : [0],
          maxLen : 20,
          readable : true,
          notify : true, 
        }
      }
    }, { advertise : ['555a0001-0aaa-467a-9538-01f0652c74e8']­ });
    
    // then every so often call:
    NRF.updateServices({
      '555a0001-0aaa-467a-9538-01f0652c74e8' : {
        '555a0003-0aaa-467a-9538-01f0652c74e8' : {
          value : [your_value_here],
          notify : true, 
        }
      }
    });
    

    I guess you might need to add the config characteristic, but it might work as-is

  • Thank you! I think that's exactly what I need...

  • As luck has it, I do have an Arduino 101 in my lab to test this further.

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

Puck.js, exposing Sensor Data to Google Science Journal

Posted by Avatar for user81224 @user81224

Actions