• Hi,

    It's as @fanoush says - the advertising messages are sent all the time regardless. There's no two-way communications unless you actively connect to the Puck, so to ensure delivery it just sends the advertising all the time (usually a few times a second).

    The power consumption of sending the data is very minimal so it's nothing to worry about, and the Puck is only executing JS when you press the button.

    EspruinoHub is seeing the advertising messages and does a few things:

    • Reports RSSI for every message - which is why you see a lot of them
    • Notices if a message hasn't changed, and only sends "/ble/advertise/e9:1d:0b:37:51:d3/180f" if it has or if a minute has passed (the code for that is here)

    Nodered has a rbe - report by exception - block that you can drag in to filter out the extra advertising messages, and only report when something has changed: http://www.espruino.com/BLE+Node-RED#detecting-button-presses

    Hope that helps!

About

Avatar for Gordon @Gordon started