Skip to content
This repository has been archived by the owner on Mar 21, 2019. It is now read-only.
/ flippi Public archive

🏄 Skateboard Bluetooth Low Energy (BLE) controller

License

Notifications You must be signed in to change notification settings

jeandesravines/flippi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flippi

Skateboard Bluetooth Low Energy (BLE) controller using bleno

Table of contents

Setup

Environment

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)

Dependencies

  • nodejs >= 6.x
  • bluetooth
  • bluez <= 4.x
  • libbluetooth-dev
  • libudev-dev
  • git

Install the dependencies

# 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

Install the application

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

Usage

Start

Launch as sudo:

sudo npm start

Environment variables

Environment variables can be passed to override the default configuration.

Channels

GPIO channels' settings.

Motor

The GPIO channel for the first motor.

  • Options: FLIPPI_CHANNEL_0
  • Type: Number
  • Default: 5

Example:

sudo FLIPPI_CHANNEL_0=7 npm start

Device

The used compatible gpio's device.

  • Options: FLIPPI_DEVICE
  • Type: String
  • Values: gpio | five
  • Default: five

Example:

sudo FLIPPI_DEVICE=gpio npm start

Roles

  • 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.

Debug

Indicate if the application use the module debug.

  • Options: DEBUG
  • Type: String | undefined
  • Values: flippi | * | undefined
  • Default: undefined

Example:

sudo DEBUG=flippi npm start

Name

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

Pin

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

Bluetooth Advertising interval (bleno)

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

About

🏄 Skateboard Bluetooth Low Energy (BLE) controller

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published