/BLE-continuous-RSSI-scan

Standalone feature for a continious RSSI capture of a specified MAC address device.

Primary LanguageJavaScript

BLE-continuous-RSSI-scan

Standalone feature for a continious RSSI capture of a specified MAC address device. Saves the RSSI Data into a Log File.

the code relies on the module "@abandonware/noble" https://github.com/abandonware/noble
tested on Raspberry Pi3A+ and a Raspberry Zero 2. It's based on one of abandonware's examples. Code based on https://github.com/efeuentertainment/BLE-continuous-RSSI-scan

Installation on a Raspberry Pi or Raspberry Zero:

  1. clone Repo
git clone https://github.com/corgan2222/BLE-continuous-RSSI-scan 
cd BLE-continuous-RSSI-scan
  1. if not installed install NodeJS 12
./installNodeJS.sh
  1. Install Bluetooth dependencies
sudo ./install_raspi.sh
  1. Install @abandonware/noble and its dependencies
npm install @abandonware/noble
  1. make sure bluetooth is enabled in /boot/config.txt . the line should look like this:
#dtoverlay=pi3-disable-bt

(bluetooth uses UART for communication)

  1. enable the required service
sudo systemctl enable hciuart.service
  1. reboot (starting the hciuart service manually often fails)

if those requirements are not met, any usage of noble will throw an error

Usage:

Scan the Network for the BLE Device you look for

node scanNetwork.js   

If you have trouble to find your Device, try the findBLE.sh. If you found the Device you are looking for, copy the MAC and run

node scanSingleDevice.js BLE-MAC filename.log  

to continuously output your device's RSSI