Posts

Showing posts with the label led bulb

How to configure a Raspberry 3 with a MagicBulb

Image
First, we need to download the official rapsberry image (raspbian Pixel version): wget  http://vx2-downloads.raspberrypi.org/raspbian/images/raspbian-2017-01-10/2017-01-11-raspbian-jessie.zip Now, we need mount the image in a microSD. You can use etcher to automatize the entire proccess: wget https://resin-production-downloads.s3.amazonaws.com/etcher/1.0.0-beta.18/Etcher-1.0.0-beta.18-linux-x64.zip unzip -e Etcher-1.0.0-beta.18-linux-x64.zip ./Etcher-1.0.0-beta.18-linux-x64.AppImage Before placing the microSD in the raspberry, you need enable ssh service. To do this, just create a file called ssh in the boot partition. cd /media/PI_BOOT touch ssh where PI_BOOT is the boot raspberry partition. Use pi as user and raspberry as password to access it throught ssh. Now, we need to install dependencies for magicblue: sudo apt-get install libglib2.0-dev libbluetooth-dev git clone https://github.com/IanHarvey/bluepy.git cd bluepy sudo python s...

How to control a MagicBlue LED bulb with Linux

Image
If you want to control your LED bulbs throught bluetooth, I recommend MagicBlue LED bulbs. Does not have an official API, but exists an unofficial on  https://github.com/Betree/magicblue First, I installed an old version of magicblue (gattlib based), but I'm going to tell you the steps if you need to solve it for a similar app. sudo apt-get install python3-pip  sudo pip3 install setuptools bluepy git clone https://github.com/Betree/magicblue.git cd magicblue sudo python3.5 setup.py install  sudo magicblueshell ImportError: No module named 'gattlib' pip3 install gattlib /usr/bin/ld: cannot find -lboost_python-py34     collect2: error: ld returned 1 exit status     error: command 'x86_64-linux-gnu-g++' failed with exit status 1 pip3 download gattlib tar xvzf ./gattlib-0.20150805.tar.gz cd gattlib-0.20150805/ sed -ie 's/boost_python-py34/boost_python-py35/' setup.py pip3 install . sudo magicblueshell list_devices Name   ...