Avatar for DanTheMan827

DanTheMan827

Member since Jul 2020 • Last active Jul 2020
  • 2 conversations
  • 5 comments

Most recent activity

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

    You were right, my phone was caching the services, I turned off bluetooth and back on again and it showed up as expected...

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

    I'm trying to create and advertise a BLE service that I can read and write binary data to, but I can't seem to get the service to actually present itself to a connected device, it does advertise however...

    This is the code I've been trying to get working without any success...

    var test = "No data";
    NRF.setServices({
      "78290001-d52e-473f-a9f4-f03da7c67dd1": {
        "78290002-d52e-473f-a9f4-f03da7c67dd1": {
          value : [0, 0, 0, 0, 0, 0, 0, 0,],
          maxLen: 8,
          readable : true,
          writable : true,
          notify: true,
          indicate: true,
          onWrite : function(evt) {
            test = evt;
          }
        }
      }
    }, { uart : false, advertise: ["78290002-d52e-473f-a9f4-f03da7c67dd1"]­ });
    
    setWatch(function() {
      NRF.setServices({ }, { uart : true });
    }, BTN, { repeat: false, edge:"rising", debounce:50 });
    

    My end goal is to have a service that I can write to and then respond back to the device writing the data, I think I could do this by updating the value in the onWrite callback?

    I've been testing with the NRC Connect app and I have the newest firmware on the puck

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

    Oh, I misread, it was potentially 5 years without advertising...

    http://forum.espruino.com/conversations/­297334/

    My usage when actually connecting to the puck would be to connect, transfer about 572 bytes of data, then disconnect... I definitely don't need high-bandwidth mode so that's good to know.

    I suppose I could also increase the advertising interval and lower the BLE transmit power since it'll only need to function within a foot or two of the device that's writing to it and it doesn't need to be detected immediately since the application itself will be scanning in the background for it.

    I don't have a target for the battery life, but I also don't want it to go flat prematurely if I can do simple things to prevent it.

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

    I'm working on a project that simulates NTAG215 tags from the puck.js which will communicate over BLE for managing the NFC tag data, but my question is how long would the expected battery life be in this situation?

    I've read that with just a simple BLE beacon that the battery life is 1-5 years but I don't know how that would be affected by having NFC enabled.

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

    Right now I'm messing around with emulating the NTAG215 NFC specification, it turned out to actually be fairly straightforward to get the basic stuff working.

Actions