Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fjms/raspibeacon
Beacon low energy scanning program that sends a post request to an end point defined in the parameters.
https://github.com/fjms/raspibeacon
beacon raspberry-pi-3
Last synced: 6 days ago
JSON representation
Beacon low energy scanning program that sends a post request to an end point defined in the parameters.
- Host: GitHub
- URL: https://github.com/fjms/raspibeacon
- Owner: fjms
- Created: 2017-11-14T15:51:46.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-13T16:56:27.000Z (over 6 years ago)
- Last Synced: 2024-04-28T20:22:07.640Z (5 months ago)
- Topics: beacon, raspberry-pi-3
- Language: JavaScript
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
```sh
sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev
```Make sure ```node``` is on your path, if it's not, some options:
* symlink ```nodejs``` to ```node```: ```sudo ln -s /usr/bin/nodejs /usr/bin/node```
* [install Node.js using the NodeSource package](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions)#### Usage
```js
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
```js
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:
```js
{ 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.
```js
{ dateTime: 2017-11-22T11:34:51.621Z,
inOut: false,
uuid: 'AA:BB:CC:DD:EE:FF',
id_device: 'XXXXXXXXXXXXXXXX' }
```