Puck.js iBeacon code not working

Posted on
  • Hello,

    I have used the standard code from the espruino library:

    require("ble_ibeacon").advertise({
      uuid : [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], // ibeacon uuid
      major : 0x0001, // optional
      minor : 0x0001, // optional
      rssi : -59 // optional RSSI at 1 meter distance in dBm
    });
    

    But nothing is working. I am on the latest firmware.

    Anybody has it working?

    Thank you!

  • Have you disconnected from the IDE? Puck.js won't advertise while it is still connected to another computer.

    Also, an iPhone is unlikely to show anything with the a UUID of all 0s as it's not valid - although you should still be able to see the advertisement and decode it with an app like NRF Connect.

  • Yes it is disconnected from the web ide. I am scanning both with a pycom and with NRF Connect.

    I am using a UUID this is the actual code:

    require("ble_ibeacon").advertise({
        uuid : [0x2E, 0xE8, 0x3B, 0x75, 0x86, 0x38, 0x47, 0xB5, 0x8F, 0xDF, 0x9A, 0x89, 0xA2, 0xB1, 0x9E, 0xC9], // ibeacon uuid
        major : 0x0001, // optional
        minor : 0x0001, // optional
        rssi : -59 // optional RSSI at 1 meter distance in dBm
      });
    

    The only thing I see is the standard Puck.js ...

    Thank you!

  • Would it be possible to have the puck.js not advertise anything to save battery and enable it by clicking the button? To save energy and make the battery last. Like on and off button.

  • Can you try re-uploading again now please? It looks like a bug crept into the ibeacon code a while ago and nobody noticed - it should now be fixed.

    Would it be possible to have the puck.js not advertise anything to save battery and enable it by clicking the button?

    Yes, absolutely - just call NRF.sleep() and NRF.wake() - although that'll shut down Bluetooth LE if you're connected as well :)

    To save power you could also look at just reducing the advertising interval if you wanted as well.

  • Thr 2018.08.09

    Hello @user92831, check out:

    Tutorials forum:

    'Quick Start Best Practices - Puck tips - increasing battery life - change xmit distance - advertising interval'

    http://forum.espruino.com/conversations/­324125/#comment14359775

  • Thank you!

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

Puck.js iBeacon code not working

Posted by Avatar for user92831 @user92831

Actions