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

    Read Tx Power from a iBeacon Device with Wipy2

    Scheduled Pinned Locked Moved WiPy 2&3
    blebluetoothibeacontxpowerrssi
    4 Posts 3 Posters 2.1k Views 3 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.
    • R Offline
      redimo
      last edited by

      Hello Guys

      I want to calculate the distance to an iBeacon.
      So I need the Rssi and the Tx Power at 1m.

      For the RSSI I use this code:

      import binascii
      from network import Bluetooth
      bluetooth = Bluetooth()
      
      bluetooth.start_scan(20)
      while bluetooth.isscanning():
          adv = bluetooth.get_adv()
          if adv:
             print("device mac = {}".format(binascii.hexlify(adv.mac)))
             print("device RSSI = {}".format(adv.rssi)) 
      

      How do I get the TX Power at 1m from my device?

      Thanks

      P 1 Reply Last reply Reply Quote 0
      • P Offline
        pwest @redimo
        last edited by

        @redimo Probably the best way to do this is to actually measure the RSSI as you move the beacon away from the receiver. That is, measure RSSI at 1 meter separation, 2m, 3m, and so on, and then a table (or function) that, based on the measured data, will allow you to look up range based on RSSI. You'll need different tables for different beacons (if they have different output power or antennas), and things will be very different whenever obstructions (e.g. furniture, walls, people) are between the beacon and the receiver.

        R 1 Reply Last reply Reply Quote 0
        • RobTuDelftR Offline
          RobTuDelft
          last edited by

          You need some kind of signal propogation model. Some of the parameters within this model you would then empirically determine.

          E.g. https://en.wikipedia.org/wiki/Free-space_path_loss

          Without data you're just another person with an opinion.
          Hackster | About me

          1 Reply Last reply Reply Quote 0
          • R Offline
            redimo @pwest
            last edited by redimo

            @pwest
            We've found out how. On iBeacon, when you read the data you get an Array. You need to do int(lastHexValue, 16) and then -256. This results in the set TxPower the BLE Beacon has

            Edit: this site explains very well how the iBeacon protocoll is built, aswell as to where to find the TxPower:
            http://www.warski.org/blog/2014/01/how-ibeacons-work/

            1 Reply Last reply Reply Quote 1

            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