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

    BLE Advertisement Max Length

    Scheduled Pinned Locked Moved Issues & Bugs
    blelopy4
    3 Posts 3 Posters 278 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.
    • P Offline
      pvstejeswar
      last edited by

      Hi,

      I am trying to send some data as BLE advertisement on Lopy4, below is the function I am using

      def normal_running_mode():
          bluetooth = Bluetooth()
          bluetooth.advertise(False)
          bluetooth.stop_scan()
          bluetooth.init()
          data = [0x4C,0x00,0x02,0x15,0x00,0x00,0xc8,0x43,0xcc,0x00,0x00,0x00,0x00,0x9c,
          0x00,0x00,0x48,0x42,0x02,0x00,0x00,0x00,0x00,0x9c,0x00,0x00,0xe1,0x42,0x81,0x0a]
          print("ADV Dat is " + str(ubinascii.hexlify(bytes(data))))
          bluetooth.set_advertisement(name = None, manufacturer_data = bytes(data))
          bluetooth.advertise(True)
          time.sleep(300)
      

      however the last 6 bytes of the payload is being dropped as shown in image below, what is the maximum size allowed by the field manufacturer_data. The BLE specification says the Max BLE Advertisement Packet size is 31 bytes and my whole payload is around 30 bytes. How can I send these 30 bytes as Advertisement. I tried using service UUID and service data as shown in the code in this link (https://forum.pycom.io/topic/1911/wipy-as-an-ibeacon/3) but that doesn't work.

      BeaconScan.jpg

      1 Reply Last reply Reply Quote 0
      • B Offline
        Buay89
        last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • J Offline
          Jeremy Dahan
          last edited by

          Hi @pvstejeswar , did you figure it out ?

          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