Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    How to configure BLE Advertisement Behaviour eg rate & TX_PWR?

    Scheduled Pinned Locked Moved WiPy 2&3
    7 Posts 4 Posters 2.7k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L Offline
      lcgeldenhuys
      last edited by

      Hi,

      How would I set the TX power and advertisement rate?

      Also, what are the current defaults for the WiPy?

      Lourens

      1 Reply Last reply Reply Quote 0
      • J Offline
        jmarcelino
        last edited by jmarcelino

        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

        L 1 Reply Last reply Reply Quote 0
        • L Offline
          livius @jmarcelino
          last edited by

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

          think about people first, then computers

          J 1 Reply Last reply Reply Quote 1
          • J Offline
            jmarcelino @livius
            last edited by

            @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.

            L 1 Reply Last reply Reply Quote 2
            • L Offline
              livius @jmarcelino
              last edited by

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

              settings

              yes, pull requests are much much better :)

              think about people first, then computers

              1 Reply Last reply Reply Quote 0
              • L Offline
                lcgeldenhuys
                last edited by

                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.

                B 1 Reply Last reply Reply Quote 0
                • B Offline
                  bdespatis @lcgeldenhuys
                  last edited by

                  @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.

                  1 Reply Last reply Reply Quote 0

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better 💗

                  Register Login
                  • 1 / 1
                  • First post
                    Last post

                  Pycom on Twitter

                  Pycom