Skip to content

Beacon low energy scanning program that sends a post request to an end point defined in the parameters.

Notifications You must be signed in to change notification settings

fjms/raspibeacon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raspibeacon

Beacon low energy scanning program that sends a post request to an end point defined in the parameters.

You can filter by beacons brands, define the time between beacon detection.

Linux

  • Kernel version 3.6 or above
  • libbluetooth-dev

Ubuntu/Debian/Raspbian

sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev

Make sure node is on your path, if it's not, some options:

Usage

npm install raspibeacon
var raspibeacon = require('raspibeacon')
let options = {
    brands: ['Kontakt'],
    host: "http://10.148.144.104:3000",
    endpoint: "/api/ionic/raspibeacons",
    timeout: 180000 // Time in milliseconds passed without detecting a beacon inside the action radius
}
raspibeacon.startScan(options);
Modo debug
npm install raspibeacon
var raspibeacon = require('raspibeacon')
let options = {
    brands: ['Kontakt','RadioLand iBeacon'],
    host: "http://10.148.144.104:3000",
    endpoint: "/api/ionic/raspibeacons",
    timeout: 180000 // Time in milliseconds passed without detecting a beacon inside the action radius  
}
raspibeacon.startScanDebug(options);

Response

When a beacon is detected, a post request is sent to the server with the following structure:

{ dateTime: 2017-11-22T11:04:41.734Z,
  inOut: true,
  uuid: 'AA:BB:CC:DD:EE:FF',
  id_device: 'XXXXXXXXXXXXXXXX' }

A post with the following structure is sent when a time passes without the beacon being detected, determined by the timeout param.

{ dateTime: 2017-11-22T11:34:51.621Z,
  inOut: false,
  uuid: 'AA:BB:CC:DD:EE:FF',
  id_device: 'XXXXXXXXXXXXXXXX' }

About

Beacon low energy scanning program that sends a post request to an end point defined in the parameters.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published