The Algorithm

The first step is to record RSSI measurements and calculate distances using the following standard RSSI attenuation model, which returns a distance in meters. RSSI corresponds the the received RSSI value, A is the received signal strength at one meter, and n is a signal propagation constant.