Puck to Android connection

Posted on
  • Hi Guys,

    I would like to connect from Puck to Android using "NRF.connect("Bluetooth Mac address")"
    What is required on Android, start GATT server ?

    Thank you.

  • That's right, yes. I believe you may be able to experiment using the nRF connect app to create a server.

  • Hi Gordon,

    I configured a sample GATT server using nRF connect app. I have following issues:

    • NRF.setScan executed on Puck does not return any results.
    • NRF.connect("Bluetooth Mac address") executed on Puck cannot connect and fails with "Unhandled promise rejection: Connection timeout."

    Thank you.

  • I guess you just typed NRF.setScan()? You need to add a handler to make it work.

    Try NRF.findDevices(print) for something a bit easier.

    There are different types of address too - see what findDevices returns - you may have to put random after the Mac address to make it work (if the address is classified as not being universally unique).

  • Hi Gordon,

    Neither

    packets=10;
    NRF.setScan(function(d) {
      packets--;
      console.log(d); // print packet info
      if (packets<=0)
        NRF.setScan(); // stop scanning
    });
    
    

    nor

    NRF.findDevices(function(devices) {
      console.log(devices);
    }, 1000);
    

    return any results.

    I guess configuring GATT server with the sample configuration does not start the server itself.

    Another approach could be implementing a GATT server on Android.

  • Ahh, that all looks fine. Sometimes it can depend on your phone - as far as I know not all Android phones support Central mode.

    If you had a second Android phone then you could at least test :)

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

Puck to Android connection

Posted by Avatar for user73560 @user73560

Actions