You are reading a single comment by @Gurmukh and its replies. Click here to read the full conversation.
  • I am trying to connect the PuckJs to a Bluetooth device.

    I have written code in JavaScript and it runs fine on the browser. I've written similar code in Python and it connects fine to the device.

    However, the PuckJs just can't seem to find the device. I'm not sure why, since it's located very close to it.

    The MAC address is: 4c:xx:xx:xx:xx:xx and there's also a Device Name which I can filter by using the namePrefix in JavaScript.

    I've tried NRF.findDevices, NRF.setScan, the results I get are odd. There is an id field in each device, but none of them match the MAC address I want to connect to.

    Anyone know what I'm missing?

    The JavaScript code that works is:

      let device = await navigator.bluetooth.requestDevice({
        filters: [
          { namePrefix: 'P' }
        ],
      });
      server = await device.gatt.connect();
    

    When migrated to use NRF, no device is found:

      NRF.requestDevice({ filters: [{ namePrefix: 'P' }], timeout: 20000 }).then(function(device) {
        console.log(device);
      });
    
    

    results in no device found matching filters.

    I've also tried findDevice, setScan, with a large timeout and a max of 100 devices. I do get a lot of results (expected), but not the device I want.

    To confirm, I can connect to the device via Web and also Python on Raspberry Pi, just not on the PuckJs.

    Thanks!

About

Avatar for Gurmukh @Gurmukh started