Avatar for Gurmukh

Gurmukh

Member since Dec 2018 • Last active Sep 2020
  • 4 conversations
  • 22 comments

Most recent activity

    • 23 comments
    • 6,159 views
  • in Puck.js, Pixl.js and MDBT42
    Avatar for Gurmukh

    Thanks Gordon,

    I'm not sure what an active scan is. I was using a slightly modified version of the script in my original question.

    The button, when pressed, makes a connection to the device, reads some data and sends some data. Since I'm doing it in a promise based approach, it takes a while for the data to be read / written. It's super quick in the app (around 1s or so) but takes around 30s on the Puck. I'm using LEDs to help signify that "something is happening". Will check to ensure I'm reusing objects as much as possible, pretty sure I am though.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Gurmukh

    Thanks for the reply Gordon.

    The device is a bathroom extractor fan called Pure Sense which would be tricky to post ;-)

    I did some testing over the weekend and realised I needed to disable a lot of other Bluetooth devices in order for the Puck to discover it. Once I had the ID, I was able to enable the other devices and the Puck began connecting to the fan fine.

    Not sure why this was the case, but I'm super happy that it works now. Takes around 30s to connect and send data but that's not a biggie.

    Thanks for helping debug it!

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Gurmukh

    No worries, thanks for trying.

    It looks like the Puck isn't working for what I wanted it to do which is connect to a BLE device and send some requests.

    I'll now try and get it to connect to a Raspberry Pi via Bluetooth and see if I can get the communication to work that way, it'll just mean an even longer lag :(

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Gurmukh

    Thanks for helping debug this issue.

    I have been reverse engineering a Pure Sense fan for the past few months by inspecting packets in Wireshark on the communication between the Android App and the Fan. By this process I was able to find out the Mac address, Device Name etc.

    nRF shows the device as "LE only", Advertising Type "Legacy", Complete Local Name: "Pure Sense".

    "Pure Sense" is the name of the Bluetooth device list when running on Raspberry Pi (in Python) and Web Bluetooth using JavaScript.

    I cannot see why the Puck would be any different.

    Do you have any idea on how I can change my code to free up the serial (if that's what I need to do?) I'm not sure this is the right approach since other Bluetooth LE devices show up in the scan.

    It's worth noting that the description the Puck shows for each Bluetooth device is different too, there are no friendly names shown for any devices.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Gurmukh

    Thanks

    I'm not sure how that will help, it looks like the Puck can handle more than 1 BLE connection since it can find other BLE devices whilst connected to the WebIDE.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Gurmukh

    I tried to force the connection on Serial1 but now I've got an error 'Prompt not detected'

    I really do wish this was simple. I was able to get this working in Python and Javascript fairly easily, something basic like finding a BLE device should be super simple :(

    function onInit() {
      setTimeout(function() { Serial1.setConsole(); }, 1000);
      // ...
    }
    

    also tried

    function onInit() {
      setTimeout(function() { Serial1.setConsole(true); }, 1000);
      // ...
    }
    
  • in Puck.js, Pixl.js and MDBT42
    Avatar for Gurmukh

    Thanks for that, I don't see a serial port on the PuckJs?

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Gurmukh

    Could it be because I'm already connected via BLE to the Web IDE and I am trying to connect to another BLE device?

    If so, how do I test connecting to a BLE device?

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Gurmukh

    I'm not sure what you mean? If it helps, I have around 90 bluetooth devices in my house (hue spotlights are all bluetooth enabled) and the PuckJs seems to find those with no problems. It just can't find the device it's literally cm's away from.

Actions