Avatar for Tineler

Tineler

Member since Apr 2017 • Last active Nov 2017
  • 2 conversations
  • 6 comments

Most recent activity

  • in Puck.js
    Avatar for Tineler

    Hi Gordon!

    Thanks, this works. :-) Regarding where to put some info on this: It would be great to have a tutorial, using the Puck.js together with the web bluetooth API (not only with your wrapper class).

    Now, I have some other questions regarding this:

    1. Do you know if it's possible to connect multiple devices at once via Web Bluetooth?
    2. Do you know if I can connect to devices automatically via Web Bluetooth? (Let's say: Remember a device and if it's reachable, Web Bluetooth should automatically connect to it)
    3. Using the characteristicvaluechanged event, I should be able to get the real time data, every time the battery percentage changes, right?
  • in Puck.js
    Avatar for Tineler

    Hi! I'm trying to read data from the puck.js over web bluetooth. As a PoC I just wanted to read the battery percentage, but it doesn't work: The Puck.js does not appear on the list for the bluetooth devices in the web browser. My assumption is, that the web bluetooth library does not know, that my puck is advertising battery data.. Any idea how to fix this?

    The code on my Puck.js:

    NRF.setServices({
      0x180F : { // Battery Service
        0x2A19: {  // Battery Level
          readable: true,
          notify: true,
          value : [Puck.getBatteryPercentage()]
    }}});
    setInterval(function(){
      NRF.updateServices({
        0x180F: {
          0x2A19: {
            value : [Puck.getBatteryPercentage()]
          }
        }
      });
    }, 60000);
    

    For testing purposes I used the Web Bluetooth Sample page: https://googlechrome.github.io/samples/w­eb-bluetooth/battery-level.html

  • in Puck.js
    Avatar for Tineler

    Yes, I'm trying to scan for advertising data that's coming from my Puck.js.

    I indeed had a Bluetooth connection open (for the IDE). Thank you!

  • in Puck.js
    Avatar for Tineler

    Hi @Gordon

    How did you test the advertising? I'm trying to test it using a WiPy and the nRF connect app, but I don't see any data.

  • in Puck.js
    Avatar for Tineler

    Hi Robin

    Thanks for you response! It works using pinMode(PIN, "input_pullup") and digitalRead :-)

  • in Puck.js
    Avatar for Tineler

    Hey guys!

    I want to check if the sliding door of my terrarium is closed using the Puck.js (light green LED if it is closed, else light red LED). I found a cool tutorial, where I can see how to do this using a magnet.

    But I think a better solution would be to attach 2 wires to the Puck.js and then put a metal plate on the side of the door. If the door is closed, the circuits is also closed and otherwise it's open.

    I'm not very familiar with the Puck.js so far, so I have two questions for this idea:

    1. To which pins should I connect the two wires?
    2. How can I determine, if the two wires are connected or not?

    Thanks for your help!

Actions