Hi,
I’m using the estimote proximity beacons for my autonomous vehicle project. The raspberry pi is mounted on the vehicle, so when the vehicle moves the pi has to detect the proximity sensor ID and the distance between the sensor and the pi. I’m using the noble.js languge and noble library. The program prints out the macAdress, rssi and distance.
The issue is that the program prints out the macAdress but I could’t find the beacon’s macAddress on estimote cloud to match up with which macAddress blongs to which beacon. Is there any way I can find the macAddress of the beacon? if not Is there any way I can print the UUID of the beacon using node.js?
Thanks in advance for your help!
Here is the node.js code that I’m using
var noble = require('noble');
const BeaconScanner = require("node-beacon-scanner");
noble.on('stateChange', function(state) {
if (state === 'poweredOn')
//noble.startScanning([], true); // any service UUID, allow duplicates
noble.startScanning();
else
noble.stopScanning();
});
noble.on('discover', function(peripheral) {
var macAddress = peripheral.uuid;
var rss = peripheral.rssi;
var tp = peripheral.txpower;
var txPower = -59 //hard coded power value. Usually ranges between -59 to -65
if (rss == 0){
return -1.0;
}
var ratio = rss*1.0/txPower;
if (ratio < 1.0) {
return Math.pow(ratio,10);
}
else {
var distance = (0.89976)*Math.pow(ratio,7.7095)+ 0.111;
console.log('macAddress: ', macAddress, ' rssi', rss, 'distance' ,distance);
}
});