Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. how to get txPower to calculate distance from RSSI

how to get txPower to calculate distance from RSSI

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 2 Posters 1.4k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    sandeepmhptr
    wrote on last edited by
    #1

    QBluetoothServiceDiscoveryAgent serviceInfo; quint i =serviceInfo.device().rssi();

    here i = -43

    how to convert it to distance? I got the link Understanding ibeacon distancing but how to get the transmitter power? to calculate the distance according to formula?
    int ratio_db = txCalibratedPower - rssi;
    int ratio_linear = Math.pow(10, ratio_db / 10);

    int distance = Math.sqrt(ratio_linear);
    
    1 Reply Last reply
    0
    • P Offline
      P Offline
      patrik08
      wrote on last edited by patrik08
      #2

      Test it... as javascript ... :-)

      http://www.metageek.com/training/resources/understanding-rssi.html

      function calculateDistance(rssi) {
        
        var txPower = -59 //hard coded power value. Usually ranges between -59 to -65
        
        if (rssi == 0) {
          return -1.0; 
        }
      
        var ratio = rssi*1.0/txPower;
        if (ratio < 1.0) {
          return Math.pow(ratio,10);
        }
        else {
          var distance =  (0.89976)*Math.pow(ratio,7.7095) + 0.111;    
          return distance;
        }
      } 
      
      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved