You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • interval is the the number of milliseconds between the advertising packets getting sent. The default is 375ms.

    Basically in order to do anything with a Bluetooth LE device, you have to get an advertising packet. The device sends a packet and the listens for a very short time after that - and if there's a connection attempt it needs to be sent during that time.

    The advertising packets are sent on 3 different frequencies in rotation. If a device is listening for connection then in usually only listens on 1 frequency - so even at 375ms the advertisement will probably only be received once a second. Most computers will only wait around 2 seconds to get a connection, so higher intervals get progressively more hit and miss for establishing connections.

    If I could have set it any lower and got reliable connections, I would have (in fact early Pucks shipped advertising slightly less often and I had to change it).

    Basically:

    • minimum: I wouldn't ever use - but more advertising packets means a higher chance that one will get through = higher range (unless there are loads of devices doing it)
    • maximum: You'll never be able to connect with this, however if you have something that is reporting a value that doesn't change often (eg. room temperature) and have no need to connect then it's a great way to save battery.
    • If you want to connect reliably, use the default of 375. You might get away with 1000 on some hardware, but I wouldn't bank on it.

    If you really want to save battery more then you can lower the advertising interval and then have code that raises it back up to 375 when there's a button press.

About

Avatar for Gordon @Gordon started