Hi Nordic Community
I have been building a thermometer device from which I would like to send temperature values via periodic advertising.
I have based the sender and receiver off the Zephyr "periodic adv" and "periodic sync" examples provided in the SDK which I have modified for my purposes. The main change I have made is to move over to "LE Coded" transmission by adding BT_LE_ADV_OPT_CODED to the advertising parameters. I have also increased the TX power to 8dBm.
I am using an nRF52840DK as the sender and nRF52833DK as the receiver.
I have managed to get everything working and the peripheral is successfully sending data and the receiver is successfully synchronising to the peripheral and then receiving temperature data.
I initially set the BT_LE_ADV (BT Advertising) interval to 1s and the BT_LE_PER_ADV (Periodic data transmission) to 1s and everything works fine.
In an effort to reduce power usage I wanted to reduce the interval to 10s for both the BT Advertising as well as Periodic Data transmission however when I do this I have problems and the receiver won't synchronise.
From what I understand in the receiver sample code, the device looks for BT Advertising data and then inspects the data for an "Interval" which indicates that there is periodic data being sent. It then uses information in the BT Advertising event to retrieve the info required to synchronise with the periodic data being sent.
In my testing I set the Periodic Interval to 10s:
If I set the BT Advertisement Interval to 1s then the receiver synchronises without issue.
If I set the BT Advertisement Interval to 3s then the BT Advertisement sometimes doesn't contain the "Interval" data required for the receiver to get it's periodic sync info but it eventually does come through.
If I set the BT Advertisement Interval to 5s then the frequency of not including "Interval" data increases.
If I set the BT Advertisement Interval to 10s then it never seems to contain the "Interval" data.
Is there any advice on how to get this working reliably when setting both the BT Advertising as well as the Periodic Data transmission to 10s intervals?
Is there another way to set up the synchronisation without relying on the "Interval" being available?
Here are some screenshots showing the terminal on the receiver when the Periodic Interval was set to 10s and the Advertising Interval was varied between 3s, 5s, and 10s.
3 second advertising interval:
5 second advertising interval:
10 second advertising interval:
I would appreciate any guidance. Thanks for your help.
Gary