Monitor Your Puck Console From Your Phone?

Posted on
  • This may be really obvious to some but I just figured it out.

    Using nRF Connect you can monitor your pucks runtime console. In your code write something short to the console every little while. For example:

    var clicks = 0;
    setInterval(function() {
      console.log("clicks: " + clicks);
    }, 1000);
    setWatch(function() {
      clicks++;
    }, BTN, { repeat:true, edge:'rising', debounce: 20 });
    

    Disconnect then connect via nRF Connect, expand the UART Service, tap the little bunch of down arrows icon next to TX Characteristic, and watch your button clicks being reported in near real-time;

    Yep I realize that connecting nRF to the puck stops the puck from doing certain other bluetoothy things while connected. And I'm not sure about battery friendliness. But it's still cool. Handy for grabbing a quick status update perhaps. Especially when developing/testing. The RX Characteristic lets you send short commands too. But it's not very convenient.

    For fast moving values I had good luck outputting short updates every 500ms, and the phone keeping up.

  • Thanks! that's really handy.

    There's also nRF UART (and I think the Adafruit Bluefruit app does it too) if you want to be able to show stuff with history.

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

Monitor Your Puck Console From Your Phone?

Posted by Avatar for dklinkman @dklinkman

Actions