Last active
February 12, 2018 08:46
-
-
Save eklimcz-zz/225d4617cc10e40b3053 to your computer and use it in GitHub Desktop.
Basic scanning with Noble
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var noble = require('noble'); | |
//replace localhost with your server's IP; | |
var socket = require('socket.io-client')('http://localhost/scanner'); | |
//replace with your hardware address | |
var addressToTrack = '7c669d9b2dda'; | |
socket.on('connect', function(){ | |
console.log('connected to server'); | |
}); | |
noble.on('discover', function(peripheral){ | |
if(peripheral.uuid == addressToTrack){ | |
socket.emit('deviceData', {mac: peripheral.uuid, rssi:peripheral.rssi}); | |
} | |
}); | |
noble.startScanning([], true) //allows dubplicates while scanning |
After run this script that do not show connected to server in Linux console, please help.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is it possible for you to share code for original beacon tracking project.