• Ahh - ok so I had two bugs.

    The first was leaving off the interval:xx, and the second was that my delta time was based on the time between any bluetooth updates, not just the puck updates. That was dumb on my part.

    So now my puck js code:

    var presses = 0;
    NRF.setConnectionInterval(7.5)
    
    NRF.setAdvertising({},{name: "Puck", discoverable: true, manufacturer: 0x0590, manufacturerData:[presses], interval:20});
    
    function updateAdvertising() {
      presses++;
      NRF.setAdvertising({},{manufacturer: 0x0590, manufacturerData:[presses], interval:20});
    }
    
    updateAdvertising();
    
    setInterval(updateAdvertising, 1);
    

    and fixing my dumb python bug, gives me this output:

    Puck
    Manufacturer Data: 12, Delta Time: 0.01 seconds
    Puck
    Manufacturer Data: 15, Delta Time: 0.01 seconds
    Puck
    Manufacturer Data: 78, Delta Time: 0.87 seconds
    Puck
    Manufacturer Data: 82, Delta Time: 0.02 seconds
    Puck
    Manufacturer Data: 3c, Delta Time: 0.90 seconds
    Puck
    Manufacturer Data: 63, Delta Time: 0.07 seconds
    Puck
    Manufacturer Data: 68, Delta Time: 0.01 seconds
    Puck
    Manufacturer Data: 23, Delta Time: 0.89 seconds
    Puck
    Manufacturer Data: 24, Delta Time: 0.00 seconds
    Puck
    Manufacturer Data: d8, Delta Time: 0.90 seconds
    Puck
    Manufacturer Data: db, Delta Time: 0.01 seconds
    Puck
    Manufacturer Data: dc, Delta Time: 0.00 seconds
    Puck
    Manufacturer Data: 88, Delta Time: 0.88 seconds
    Puck
    Manufacturer Data: 89, Delta Time: 0.00 seconds
    Puck
    Manufacturer Data: 48, Delta Time: 0.91 seconds
    Puck
    

    And those numbers actually match what I see in terminal. I think at this point I'll pursue a direct connection instead of advertising (but if you have any other suggestions for that I'll happily give them a shot). Thx again for all the quick responses.

About

Avatar for DrewS @DrewS started