You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Advertising only sends data in one direction so it's not guaranteed that you'll receive every advertising packet that is sent. What I usually say is to transmit a number all the time, and to then just increment that number when something happens. It's then easy to detect on your IoT hub even if you miss a few packets.

    capturing the battery reading when the lid has been opened, and thus will only be one hit a day

    I think you think that setAdvertising will only send one packet of data? That's not actually the case. It sets the data that Espruino will advertise, but that advertisement is sent several times a second from then on out.

    This might help a bit:­LE

    So the code above will work great, but you'll keep receiving advertising packets on your Pi 3 all the time. Actually sending advertising data doesn't actually use that much power though - your device will still last for months on a battery.


Avatar for Gordon @Gordon started