How to configure BLE Advertisement Behaviour eg rate & TX_PWR?



  • Hi,

    How would I set the TX power and advertisement rate?

    Also, what are the current defaults for the WiPy?

    Lourens



  • @lcgeldenhuys said in How to configure BLE Advertisement Behaviour eg rate & TX_PWR?:

    So with adv_int_max at 40 milliseconds, it looks like I would have to do bluetooth.advertise() with enable / disable on a timer if I want a 500 millisecond interval?

    What I'm really after is a single advertisement at a configurable rate of say 1 to 4 per second. Would be nice if a future bluetooth.set_advertisement() could take a rate parameter.

    Same here, I look to do a beacon that could last 5-10 years with a single battery. Until we get the deep sleep, it is just a mere dream for now.

    Benoit Despatis, P.Eng.



  • So with adv_int_max at 40 milliseconds, it looks like I would have to do bluetooth.advertise() with enable / disable on a timer if I want a 500 millisecond interval?

    What I'm really after is a single advertisement at a configurable rate of say 1 to 4 per second. Would be nice if a future bluetooth.set_advertisement() could take a rate parameter.



  • @jmarcelino said in How to configure BLE Advertisement Behaviour eg rate & TX_PWR?:

    settings

    yes, pull requests are much much better :)



  • @livius
    I prefer to do pull requests ;-)

    But sure let me dig how power settings work on the ESP32 forum first and I'll then suggest changes through the "proper" channels.



  • @jmarcelino
    will be good to see your findings raported as issues on github :)



  • That's a good question, I don't see any way to set the BLE TX Power.

    The ESP32 datasheet lists +10dBm max output power in BLE mode, but looking at the BLE FCC test report for the WiPy 2.0 the peak power was only 2.87 dBm, even considering the antenna attenuation that's low. I guess the BLE TX Power is not currently set at the maximum.

    As for advertising interval there are two parameters that set it:

    Minimum advertising interval (adv_int_min) = 20 milliseconds
    Maximum advertising interval (adv_int_max) = 40 milliseconds

    These aren't visible on the Python side and baked in modbt.c


Log in to reply
 

Looks like your connection to Pycom Forum was lost, please wait while we try to reconnect.