Giter VIP home page Giter VIP logo

bsr_bulb's Introduction

BSRBulb

<img align="right" src="https://raw.githubusercontent.com/diacode/bsr_bulb/master/web/bsr_bulb.jpg", width="400">

An Elixir library for interacting with a BSR Smart Bulb that is connected via bluetooth. This is an RGB LED Bulb with built-in speaker.

It seems there are others brands that sell this bulb under their own name. Some of them are:

In order to reverse engineering the Bluetooth protocol of the bulb we used the Bluetooth HCI snoop log from Android, to capture the bluetooth packets between the mobile app and the smart bulb, and Wireshark to analyze the packets. You can read more about this approach here.

## Supported features

  • Switch on
  • Switch off
  • Set color

Usage

On Mac OS X, pair your computer with your bulb by using the normal Bluetooth device explorer. Once connected, you should hear a sound coming from the bulb's speaker.

Then you need to find the serial port for your bulb. You can use ls /dev | grep tty. For the 1byone version the port is /dev/tty.1byoneBulb-SerialPortSe.

Then open an elixir terminal with iex -S mix and type:

device = "/dev/tty.1byoneBulb-SerialPortSe"
{:ok, bulb} = BSRBulb.Client.start(device)
BSRBulb.Client.switch_on(bulb)
BSRBulb.Client.set_color(bulb, "#ff0000") # Red
BSRBulb.Client.switch_off(bulb)

Acknowledgments

This library was based on the Sphero library. While the bulb and Sphero are different devices, both are controlled through Bluetooth using erlang-serial.

bsr_bulb's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.