August 10th, 2017 By cerb Categories: Linux

I’m going to pair my bluetooth keyboard+touchpad (Bluetooth iPazzPort), i’ll use the bluetoothctl tool.

  1. First we’ll install the required packages with the folllowing command:
    sudo apt-get install pi-bluetooth bluez bluez-tools
  2. We’ll start bluetoothctl -a in order to enter the program. Here i had a problem with the bluetooth daemon (the systemctl status bluetooth command returned an execution error), so i had to change permissions to this file with the following command:
    sudo chmod +x /usr/lib/bluetooth/bluetoothd
  3. Now we’ll execute all these commands:
    • power on <- Powering on the controller
    • agent KeyboardOnly <- Setting the pairing mode
    • default-agent <- Setting the default agent
    • pairable on <- Viewable and pairable
    • scan on <- Enabling scanning
    • pair XX:XX:XX:XX:XX:XX <- Pairing with XX:XX:XX:XX:XX:XX
    • trust XX:XX:XX:XX:XX:XX <- Trusting XX:XX:XX:XX:XX:XX
    • connect XX:XX:XX:XX:XX:XX <- Connecting to XX:XX:XX:XX:XX:XX
    • quit <- Exiting

If the device gets disconnected, we can connect again with hciconfig and hcitool
hciconfig hci0 up
hcitool cc XX:XX:XX:XX:XX:XX

BlueTooth iPazzPort

July 28th, 2017 By cerb Categories: Ultimate Raspbian

Now we’ll install KODI in our Raspbian distribution, i’ve based myself on the official documentation:
Since KODI is already included in the Raspbian official repositories, we’ll just update the repositories and install the package with the following commands:
sudo apt-get update
sudo apt-get install kodi

If you have installed the full version of Raspbian Jessie (not the Lite one), you’ll already have installed the package. We’ll just execute kodi to open the app.

July 27th, 2017 By cerb Categories: Ultimate Raspbian

RetroPie is a script to install emulators. This tutorial will show how to install RetroPie under Raspbian, it’s based on We’ll need a SSH connection to the Raspberry Pi (or doing it locally). I show you how to achieve it here. We’ll also need internet in the Raspberry Pi.

  1. Install packages in order to download the project source code from github. We’ll type this commands in a Raspberry Pi shell, either locally or by SSH:
    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install git lsb-release
  2. We’ll download the latest version of the github project to our home folder with the following commands:
    git clone --depth=1
  3. Once downloaded, we’ll move to the folder and we’ll start the installation
    cd RetroPie-Setup
    chmod +x
    sudo ./
  4. I had a problem with the GL experimental driver, so i had to disable it from raspi-config in Advanced Options -> GL Driver -> Legacy
    Mensaje GLDriver
  5. Just press enter to install (Basic Install will be selected). I recommend to also install the packages manually from Manage packages since i’ve had troubles with some of them. I wasn’t able to install the gamecon/db9 driver in any way.
    Instalacion RetroPie
  6. Once all downloaded/compiled, we’ll be able to execute for the very first time the application with the command emulationstation. In order to change the configuration, we’ll execute the script with the command sudo ./
  7. Finally, we’ll have to copy our roms to the generated folders for each console within ~/RetroPie/roms

Next step: Installing KODI

July 19th, 2017 By cerb Categories: Ultimate Raspbian

I’ve faced some problems when running Raspbian Jessie for the first time from the USB flash drive in my new Raspberry Pi 3. The message was “Root account is locked” and there were problems when mounting the root partition. We’ll edit /etc/fstab with the new addresses for the boot and OS partitions.

  1. Listing the exact name of the boot partition (mmcblk0p1) with the following command:
    ls /dev/mmc*
  2. Creating a backup of the actual fstab with the following command:
    sudo cp /etc/fstab /etc/fstab2
  3. Editing the /etc/fstab file in order to change the partitions addresses with the following command:
    sudo nano /etc/fstab
    we’ll change the first PARTUUID=XXXXX for /dev/mmcblk0p1, and the other one for /dev/sda2
  4. We’ll type sudo reboot to reboot. We’ll then type sudo raspi-config in order to access the configuration.
September 20th, 2015 By cerb Categories: Linux, Ultimate Raspbian

After the first boot, we need to connect our Raspberry Pi to the Internet, and enable a SSH client in our pc to control it remotely. You can access the router configuration page (usually to check out all devices connected to the network and get the Raspberry Pi IP. In my case i’ve got If the Raspberry Pi is connected by WiFi, it’ll be a little harder, since you’ll need to edit a file with your WiFi network and password.

SSH client for Windows

We can download putty. It’s a very simple SSH client. We’ll set the Raspberry Pi IP to connect and select “SSH connection”, then save the session with a name so we don’t have to fill it again the next time. When we click Open, a shell will show up so we can work. The first time we connect, we’ll be asked to accept the authenticity of the host. Then it’ll ask for user and password and you’ll be ready to work as you were locally on the Raspberry Pi.

SSH client for Linux

The SSH command is installed by default in Linux. We’ll open a shell and type ssh IP, where IP means the Raspberry Pi IP (in my case ssh To enter straight, we can type the command ssh pi@IP in our local network (in my case ssh pi@ Here you’ll also be asked to confirm the authenticity of the host the first time, then you’ll be asked for the password (if we type ssh pi@IP) or the user and password if we just type ssh IP. After that you can enter commands as you were locally on the Raspberry Pi.

WiFi connection

In order to configure a WiFi connection with WPA encryption, you’ll have to edit the file /etc/network/interfaces and add the following lines:
auto wlan0
iface wlan0 inet dhcp
wpa-ssid ESSID
wpa-psk PASSWORD
iface default inet dhcp

where ESSID means your network name and PASSWORD your password.

February 18th, 2014 By cerb Categories: Ultimate Raspbian

After a few seconds of checkings, the configuration tool raspi-config will appear. In order to select the options we’ll use the keyboard arrows, and the tabulator key to access the options at the bottom, such as Select or Finish. Then will appear the following options:

  1. Expand Filesystem. Expand the SD in order to fill the unused space. Since the stock rom has only 3gb, if we dump it to a SD it’ll only take up 3gb no matter its size and it would be recommended to expand the partition in order to fill the whole space in the SD, but we’ve installed the operating system inside the USB, not SD, so we won’t touch this option.
  2. Change User Password. User:pi password:raspberry by default.
  3. Enable boot to Desktop/Scratch. Boot straight to the console, desktop or Scratch app:
    1. Console. Boot to console. I recommend this option if we want to load xbmc kodi or emulationstation.
    2. Desktop. Boot to Raspbian Desktop. We can also start it with the command startx in the console.
    3. Scratch. Boot to Scratch application. We can also start it with the command scratch in the Raspbian Desktop.
  4. Internationalisation Options. Configuring language and region.
    1. Change Locale. Select language and country.
    2. Change Timezone.
    3. Change Keyboard Layout.
  5. Enable Camera.
  6. Add to Rastrack. Add your Raspberry Pi to Rastrack. It’s a Raspberry Pi tracker. You can see them around the world from their website.
  7. Overclock. Overclock profile. It’s 700Mhz by default (Raspberry Pi 1), it should be safe to overclock it to 1Ghz without any troubles, but i didn’t need it, so i rather don’t touch it.
  8. Advanced Options.
    1. Overscan. Configure screen edges. If you see two black stripes at the top and bottom of the screen and you want to see it at fullscreen, you’ll change the horizontal overscan values.
    2. Hostname. Set a name for this device in the local network where it’s connected.
    3. Memory Split. Change the amount of RAM that it’s sharing with the GPU. I recommend 192 for the GPU (Raspberry Pi 1).
    4. SSH. Enable or disable remote acces by SSH. I recommend this option in order to get a raspberry shell from any device connected to it by SSH, such as mobile phone, tablet, etc.
    5. SPI. Enable or disable the SPI kernel boot by default. It’s “no” by default.
    6. Audio. Select the audio output. (Auto, jack or hdmi).
    7. Update. Upgrade this tool to the last version.
  9. About raspi-config. Information about this tool. Keep in mind that it can be opened from the shell anytime with the command raspi-config

Next step: Installing RetroPie

August 14th, 2013 By cerb Categories: Ultimate Raspbian

We are going to install the stock Raspbian distribution in the flash drive and SD. Download the latest version of Raspbian wheezy from here.

  1. Unzip the .zip file and dump it to the flash drive.
    • Windows: Use Win32 diskimager
    • Linux: Dump with dd command to SD card. Complete instruction:
      sudo dd if=image.img of=/dev/sdX
      where sdX is the flash drive. Be sure of not confusing it with other storage device as the main hard disk drive. If you only have one disk, the first one will be sda, so the flash drive should be sdb. If you are still unsure I recommend you to see this link where I explain different ways to know which /dev/sdX corresponds with the inserted flash drive.
  2. Now we’ll have in the flash drive two partitions: fat32 with the boot and ext4 with the operating system. Copy the content of the fat32 partition to a folder in your pc.
  3. Remove the fat32 partition from the flash drive and resize the ext4 one.
    • Windows: Paragon Partition Manager. When installing the program you’ll be asked for a product key and serial number that you will get registering for free at the website.
    • Linux: Gparted or another partition manager.
  4. Since the boot size is only 40MB, we can use the rest of the SD as warehouse. Create a fat32 partition with 100MB and set the rest as ext4.
    • Windows: Paragon Partition Manager. This program doesn’t allow to create ext4 partitions, so the warehouse will be FAT32.
    • Linux: Gparted or another partition manager.
  5. Copy the content of the fat32 partition that was in the flash drive (it’s in a folder in your pc) to the fat32 at the SD card.
  6. Finally we’ll have the partitions like this: SD:[FAT32][EXT4] and Flash drive:[EXT4]
  7. Edit the cmdline.txt file of the fat32 partition from the SD, setting root=/dev/sda2 like this:
    dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/sda2 rootfstype=ext4 elevator=deadline rootwait
    Explanation: Raspberry Pi needs a SD card in order to boot, it’ll look for the boot there, but it must look for the operating system in the flash drive. Usually it redirects to mmcblk0p2, that’s the second partition of the SD, where the operating system should be, but we change it to sda2 in order to redirect it to the partition 2 of the first storage device inserted. Actually there’s only one partition in the pendrive, but when we edited the partitions, we left as “sdb2” the remaining partition (it’s called sdb at the pc because there was another one called sda, but it’ll be called sda in the raspberry, not sdb).

Videotutorials for Linux and Windows.

Next step: Raspbian first boot

August 11th, 2013 By cerb Categories: Linux

In linux, when a new device is inserted, a new file will be created at /dev to handle it. When a storage device is inserted, It’ll be created /dev/sdX, where X is a letter between a and z that will increase as we insert more devices. If we only have one, we’ll have /dev/sda. If that device had two partitions, we would have /dev/sda, /dev/sda1 and /dev/sda2. If we insert another device we’ll have /dev/sdb too.

Is very important to know the file at /dev associated to the device that we want to handle because we could format or delete data from another disk by mistake. There are several ways to check:

  • I usually use gparted, it’s a partition editor for gnome. There are all disks with its partitions, called /dev/sda, /dev/sdb, etc. So checking the partitions and size of the device that we’ve just inserted, we can deduce its letter, which should be the last one.
  • Another way to do it is to navigate through a file manager to /dev, to order by “date of modification” and select all with Ctrl+A. Now, when inserting the new storage device, a new file will appear at the end, and won’t be selected, so that’s our file.
  • Another way would be with dmesg | tail command. We type it in a terminal and we’ll see the log of the last events, including the insertion of the pendrive and its associated letter.
  • Another way would be with df command. We type it in a terminal and we’ll see all partitions. There we can deduce which one corresponds to the device that we’ve just inserted looking at its size.

July 31st, 2013 By cerb Categories: Ultimate Raspbian

Ultimate Raspbian presentation, 21 March 2013.

I’ve used:
– Raspberry Pi Model B 512MB RAM
– 2GB Classless MicroSD Kingston
– 8GB Cruzer Blade SanDisk Flash drive
– MicroUSB-USB cable connected to monitor LG M2394D (gives more than 800mA, probably 1A).
– HUB 4 ports USB 2.0 EMTEC
– Keyboard and mouse USB
– Wireless gamePad PS1/2 DragonPlus with adapter to USB GreenAsia.

Ultimate Raspbian by Cerb:
– Is a Raspbian distribution with Retropie (emulators) and XBMC KODI (mediacenter).
– Boots straight to emulationstation.
– I’ve added a “console” called Apps with two “games” to boot the Raspbian x-server or XBMC KODI. Tutorial here
– The 2GB SD boots and redirects to flash drive to continue loading there. I recommend this configuration in order to never corrupt the SD, since OS is in the flash drive.
– Boot’s size is 40MB, i’ve formatted the other 1.8GB as ext4 and mounted it as Warehouse (called “Almacen”).
– I’ve not yet managed to handle XBMC KODI with the GamePad.

For more information (

Next step: Installing Raspbian

July 28th, 2013 By cerb Categories: Ultimate Raspbian

We’re going to need this list of things for our projects:

  • Raspberry Pi. A credit-card-sized computer. I bought it from here for 42€, box included (Raspberry Pi 1 Model B).
  • MicroUSB charger. You can use your smartphone charger (usually 1A), you can also use this ones, but you’ll also need the microUSB->USB cable. I use the Asus charger of my tablet, 2A, though Raspberry Pi consumes less than 1A. You can also connect it to a monitor with USB port.
  • SD card. Or microSD with adapter. I’ve used a low capacity SD to put the Raspbian boot (only 40MB), the operating system is in the pendrive. You can get the 2GB SD card for 2€. SD compatibility list.
  • Flash drive. Here we will install the distribution, 8GB is enough. I’ve chosen flash drive because it’s faster than a class 10 SD and won’t be corrupted. Nowadays (2013) it’s 6-7€.
  • Audio/video cables. Raspberry Pi has two outputs: analog (RCA composite video) with audio jack, and digital HDMI (video+audio). Maybe you will need HDMI to VGA or DVI converters. For this adapters you may need powered usb hubs since there’s a signal processing in there.
  • USB hub. Raspberry Pi has only two USB ports, so you will need a usb hub in order to connect more devices. There are powered usb hubs that complement the power received by the microUSB charger.
  • WiFi adapter. To get access to internet or local network. I use this one.
  • BlueTooth adapter. For wireless devices such as mouses, keyboards or gamepads.

Compatible devices list with Raspberry Pi ->

Unboxing Raspberry Pi and showing all devices I’ll use in this project.

Next step: Ultimate Raspbian presentation