I’m going to pair my bluetooth keyboard+touchpad (Bluetooth iPazzPort), i’ll use the bluetoothctl tool.
First we’ll install the required packages with the folllowing command: sudo apt-get install pi-bluetooth bluez bluez-tools
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
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
Now we’ll install KODI in our Raspbian distribution, i’ve based myself on the official documentation: http://kodi.wiki/view/HOW-TO:Install_Kodi_on_Raspberry_Pi#Raspbian
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.
RetroPie is a script to install emulators. This tutorial will show how to install RetroPie under Raspbian, it’s based on https://retropie.org.uk/docs/Manual-Installation/ 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.
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
We’ll download the latest version of the github project to our home folder with the following commands: cd
git clone --depth=1 https://github.com/RetroPie/RetroPie-Setup.git
Once downloaded, we’ll move to the folder and we’ll start the installation cd RetroPie-Setup
chmod +x retropie_setup.sh
I had a problem with the GL experimental driver, so i had to disable it from raspi-config in Advanced Options -> GL Driver -> Legacy
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.
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 retropie_setup.sh with the command sudo ./retropie_setup.sh
Finally, we’ll have to copy our roms to the generated folders for each console within ~/RetroPie/roms
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.
Listing the exact name of the boot partition (mmcblk0p1) with the following command: ls /dev/mmc*
Creating a backup of the actual fstab with the following command: sudo cp /etc/fstab /etc/fstab2
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
We’ll type sudo reboot to reboot. We’ll then type sudo raspi-config in order to access the configuration.
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 http://192.168.0.1) to check out all devices connected to the network and get the Raspberry Pi IP. In my case i’ve got 192.168.0.7. 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 192.168.0.7). To enter straight, we can type the command ssh pi@IP in our local network (in my case ssh firstname.lastname@example.org). 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.
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
iface default inet dhcp
where ESSID means your network name and PASSWORD your password.
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:
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.
Change User Password. User:pi password:raspberry by default.
Enable boot to Desktop/Scratch. Boot straight to the console, desktop or Scratch app:
Console. Boot to console. I recommend this option if we want to load xbmc kodi or emulationstation.
Desktop. Boot to Raspbian Desktop. We can also start it with the command startx in the console.
Scratch. Boot to Scratch application. We can also start it with the command scratch in the Raspbian Desktop.
Internationalisation Options. Configuring language and region.
Change Locale. Select language and country.
Change Keyboard Layout.
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.
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.
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.
Hostname. Set a name for this device in the local network where it’s connected.
Memory Split. Change the amount of RAM that it’s sharing with the GPU. I recommend 192 for the GPU (Raspberry Pi 1).
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.
SPI. Enable or disable the SPI kernel boot by default. It’s “no” by default.
Audio. Select the audio output. (Auto, jack or hdmi).
Update. Upgrade this tool to the last version.
About raspi-config. Information about this tool. Keep in mind that it can be opened from the shell anytime with the command raspi-config
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.
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.
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.
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.
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.
Finally we’ll have the partitions like this: SD:[FAT32][EXT4] and Flash drive:[EXT4]
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).
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.
– 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 XBMCKODI (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.
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.