This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Spacing between advertising packets

Hi,

I am working on a design of very low power sensor, based on nRF52833. Most of the time my device spends advertising only, with sensor data transmitted within advertising packet Manufacturers data field. 

When I enable advertising with advertising interval of 1 second for example, I see 3 advertising packets transmitted almost back to back. Is it possible to send advertising packet on channel 37, then after 300mS on channel 38 and so on? I have seen some sensors based on dialog semi. chips do that.

My concern is stress on battery, reasoning that decoupling capacitors on Vdd will have more time to recharge between packets. I will be transmitting either with 8dBm Tx power or using coded PHY, which draws considerable energy from battery ( and batteries don't like high pulsing power). By the way, what type of battery would you suggest for 10 year battery life?

Thanks

  • Hello,

    Using the softdevice that is not possible without configuring this between each advertising event. You can set a channel map for your advertising, but this remains unchanged until you manually change this channel map. This means that you need to configure the advertising setup every 300ms. 

    If you want to set a channel mask, you need to adjust some functions in ble_advertising.c.

    The reason for this is that the channel mask is stored in p_advertising->adv_params.channel_mask, and p_advertising is set to 0 inside ble_advertising_init(). Add something like:

    p_advertising->adv_params.channel_mask = MY_CHANNEL_MASK;

    before sd_ble_gap_adv_set_configure(). 

    Then you can e.g. use a timer to trigger ble_advertising_advdata_update(), which you need to call before you call advertising_start() again. You possibly also need to call advertising_stop before both of these. 

    Remember to also change ble_advertising_advdata_update() to set the new channel mask. 

    Best regards,

    Edvin

  • Thank you for quick answer.
    Yes, I can see it's hardly justifiable to do it outside the soft device. And this method could result in higher power consumption due to increased CPU activity and timer run. But good to know anyway.
    Best regards. 

  • Hello,

    My device will be advertising with around 10 second advertising interval. I just realised I could set channel map to ch. 37 and then start advertising with 3.1 second interval and advertising duration of 3 second. Then do the same for ch. 38 and so on. Would this work? Or will soft device not allow duration shorter than interval?

    Thanks

  • Hello,

    You can only have one active advertisement set at the time, so it is not possible to have 3 of these in parallel. You can have one that times out and then update it, as you describe, but I believe that the softdevice will give you the timeout when the last advertising packet has been transmitted (but I am not sure). So you may need to use an additional app_timer for this. 

    One alternative is of course to not use the softdevice, but set up your own advertisements. Although it may be a bit more work on checking how to properly put together the advertising packets, you will have full control of the radio at all times. However, if your advertisements include a scan response, this is quite a bit more complex, because that would also require scanning and replying to scan responses. 

    Best regards,
    Edvin

  • Thanks, I see what you mean. I will experiment and hopefully figure out how to set it up.

Related