Raspberry Pi + SBrick

Finally got time to return to the Pi.

Yes, the Raspberry Pi can talk to the SBrick. It’s only necessary to install Bluez 5.

But as the standard Raspbian is based on Debian Wheezy, if you install bluez from the repositories

sudo apt-get install bluez

you will get Bluez 4 (today, 1 December 2014, it’s version 4.99). I can make a Low Energy Scan (lescan) and find the SBrick but my gatttool commands fail with

Host is down (112)

So we need Bluez 5. There are at least two ways:

  • get Bluez 5 source code and compile as in RPi Bluetooth LE
  • update Raspbian to Debian Jessiea as it already includes Bluez 5

I’m lazy, I don’t like to compile anything. I’m also afraid that any update might brake compatibility and forces me to recompile again. And my laptop (Unbuntu) and my EV3 (ev3dev) are already running a version of Jessie so let’s update.

Warning: Raspbian update from Wheezy to Jessie takes almost a day – so compiling Bluez might appeal to those in a hurry.

We need enough free space on the SD card. I used a 4 GB card and my first try failed miserable after a long night. So the second time I removed some things to assure an happy end.

First I transfered the most recent image available (2014-09-09) to the 4 GB card and edited networking to get wi-fi (I only use SSH with the Raspberry, like I do with the LEGO Mindstorms EV3).

After first boot with the fresh card run rasp-config to expand the file system with all free space available.

sudo rasp-config

after next boot remove some heavy things and clean:

sudo apt-get remove x11-common midori lxde
rm /opt/vc/src/hello_pi/hello_video/test.h264
rm -rf python_games
sudo apt-get clean
df -h

there are now 2.0 GB available on the 4.0 GB card. That’s enough, let’s change the source of our packages:

sudo nano /etc/apt/sources.list

replace ‘wheezy’ with ‘jessie’ and save.

sudo apt-get update
sudo apt-get upgrade
sudo reboot
By now we have near 1.8G available.

sudo dist-upgrade
sudo reboot

Now we are already using a Debian Jessie version of Raspbian.

sudo apt-get install bluez

As of 1 December 2014, Debian Jessie for Raspberry Pi uses bluez 5.23-1. Now remove all garbage and check space again:

apt-get autoremove

df -h

807 MB avaliable, not bad.

My bluetooth BT 4.0 USB dongle is recognized (it already was) but is not active by default so before using it

sudo hciconfig hci0 up

now gatttool commands work with the SBrick, and so all my scripts from Ubuntu and EV3.

 

 

 

 

 

 

Um comentário em “Raspberry Pi + SBrick”

  1. Hi Falcao,
    I use WeDOMore (github) to connect a WeDo hub to the USB of my Pi which can drive two WeDo motors. Power is taken from the Pi’s USB(model A+). I then control the motors with a wiimote using cwiid. Some of the other wiimote buttons are used to take pictures from the attached Raspberry Pi camera. I also attached an Open electrons.com serial BT card to get a a direct link to the RPi from my smartphone. No need for a laptop/pc or wifi network.

Deixe um comentário

O seu endereço de email não será publicado. Campos obrigatórios marcados com *