Skateboard Bluetooth Low Energy (BLE) controller using bleno
This application was created for Raspberry 2 B+ on Raspbian and developed on macOS.
It was tested on:
- Raspbian 8.0 Jessie (Production)
- macOS 10.12 (Development + Test)
- Ubuntu 14.04 (Development + Test)
- Ubuntu 12.04 (Test)
- nodejs >= 6.x
- bluetooth
- bluez <= 4.x
- libbluetooth-dev
- libudev-dev
- git
# Update dependencies
sudo apt-get update
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
# Install dependencies
sudo apt-get update
sudo apt-get install -y git nodejs build-essential
sudo apt-get install -y bluetooth libbluetooth-dev libudev-dev libdbus-1-dev libglib2.0-dev
# Prerequisites
sudo systemctl stop bluetooth
# Downgrade bluez to version < 5
curl https://www.kernel.org/pub/linux/bluetooth/bluez-4.101.tar.xz | tar -xJ
(cd bluez-4.101; ./configure && make && sudo make install)
rm -r bluez-4.101
This application can then be installed with git and npm:
# Install app from git
git clone https://github.com/jeandesravines/flippi.git
cd flippi
npm install
Launch as sudo:
sudo npm start
Environment variables can be passed to override the default configuration.
GPIO channels' settings.
The GPIO channel for the first motor.
- Options:
FLIPPI_CHANNEL_0
- Type:
Number
- Default:
5
Example:
sudo FLIPPI_CHANNEL_0=7 npm start
The used compatible gpio's device.
- Options:
FLIPPI_DEVICE
- Type:
String
- Values:
gpio
|five
- Default:
five
Example:
sudo FLIPPI_DEVICE=gpio npm start
gpio
: The local Raspberry's GPIO. In this case, @jdes/gpio will be used.five
: An USB connected device connected to the Raspberry. In this case, Jonny Five will be used.
Indicate if the application use the module debug
.
- Options:
DEBUG
- Type:
String
|undefined
- Values:
flippi
|*
|undefined
- Default:
undefined
Example:
sudo DEBUG=flippi npm start
The name of the application.
This option will automatically set the BLENO_DEVICE_NAME
with the same value.
- Options:
FLIPPI_NAME
- Type:
String
- Default:
Flippi
Example:
sudo FLIPPI_NAME=Hello npm start
The Pin to secure the communication between the remote and the application.
- Options:
FLIPPI_PIN
- Type:
String
- Default:
1234
Example:
sudo FLIPPI_PIN=2468 npm start
A custom advertising interval in ms.
Advertising intervals must be between 20ms to 10000ms.
- Options:
BLENO_ADVERTISING_INTERVAL
- Type:
Number
- Default:
500
Example:
sudo BLENO_ADVERTISING_INTERVAL=200 npm start