-
Hi @Gordon, I might reverse the logice based on the feedback received, but the idea was to scan for the strongest beacon every minute or so. The code that does this is fairly simple and worked fine in a simple test. see below.
In this scenario, an home for elderly or our setup for an event, we're effectively able to control the BLE devices in the environment. So per section that I want to have a location reported, I would place one beacon right now. But again, maybe I am just turning this around, I need to think about it. In the end it needs to be fairly simple to setup and demonstrate, I might still have tendency to go with the scanning on the puck directly.
setInterval(function() { NRF.findDevices(function(devices) { var nearestDevice = null; devices.forEach(function(device) { if (nearestDevice === null) { nearestDevice = device; } else if (device.rssi > nearestDevice.rssi) { nearestDevice = device; } }); if (nearestDevice) { console.log(nearestDevice.id, nearestDevice.name, nearestDevice.rssi); } }, 2000); }, 5000);
@Gordon do you have a recommendation for the accelerometer that I need to connect as well as for doing free-fall detection?
Sounds like a good idea...
So you actually want to use the Pucks themselves to effectively triangulate where someone is?
If you're just after reporting signal strengths back down WiFi I'd seriously consider using the hub directly though, rather than a Puck (as keeping scanning for nearby beacons will drain the battery relatively quickly).