Category Archives: Raspbian

Setting up PS3 controllers on Retropie (Gasia/ Shanwan clones)

If you like retro-gaming you probably came across RetroPie, which allows to turn your Raspberry Pi into a retro-gaming machine.

RetroPie supports game-controllers of many different brands, however it can be difficult to configure them, especially if you chose a wireless (bluetooth) controller. I decided for a wireless Sony PS3 controller and purchased a pair of “compatible” devices from Aliexpress a.k.a. Gasia/Shanwan clones.

IMG_7667a

The RetroPie Wiki provides some useful information on how to pair these controllers with a bluetooth dongle. At the moment RetroPie supports PS3 controllers using the sixad daemon, which is part of the QtSixA package.

The QtSixA  Sixaxis Joystick Manager can connect PS3 hardware, but it takes over bluez/ bluetoothd service and other bluetooth devices, so that keyboards or mice can’t connect when sixad is active.

Thus, I was wondering why there is no ‘native’ bluez support for PS3 devices. A Google search revealed that bluez comes with a ‘sixaxis’ plugin supporting only “genuine” PS3 controllers. However, I found on the gmane mailing list that bluez patches are currently under development, but none of them made it into an official or main developer branch, yet.

BlueZ PS3 support using the Sixaxis plugin

Fortunately Szymon Janc, one of the bluez developers, provided some patches for the OpenELEC.tv Mediacenter. [Update: 2016-09-28] However, development of OpenELEC.tv seems to be dead, since there were no updates for quite a while. Therefore, I do not expect that patches supporting other PS3 clones will be released soon.

Here is a short tutorial on how to use these patches for RetroPie and to fix the annoying PS3 Shanwan/Gasia pairing problem:

Mastering the Raspberry Pi2 kernel update

As a visitor of many discussion forums about the Raspberry Pi, I recently stumbled upon a lot of cries for help, such as “My RasPi doesn’t boot anymore!” or “Help, my i2c-, spi devices and 1-wire sensors” suddenly disappeared.

Pi2ModB1GB_-compD O N ‘ T   P A N I C!

All of you probably belong to the Raspi lovers, that wan’t  to keep the device’s linux-kernel at a “bleeding-edge” release, doing an “rpi-update” almost every day. Be aware that such a kernel is still tagged as “experimental”, so that it can seriously damage your Raspbian installation. The number of messages is still very high in all discussion forums and a lot of experienced users already became tired in answering the help requests.

To be on the safe site, update your system using “apt-get update && apt-get upgrade” or “apt-get dist-upgrade”, unless you know what you are doing. If your upgrade already has failed, but you’re still able to boot the system, you can roll-back to a previous release with:

sudo rpi-update b2f6c103e5355bee90ff57f55cdf6d7005485a23

The long string represents the Git hash for the specific firmware revision. You can look for those hash in the rpi-update git repos commits list: https://github.com/Hexxeh/rpi-firmware/commits/master.

However, if you want to stay with the latest 3.18 kernel branch, here’s what you can do to solve your problems with i2c, spi, lirc and 1-wire:

Continue reading Mastering the Raspberry Pi2 kernel update

Overclocking a Raspberry Pi

As you probably know, one can overclock the RasPi to 1 GHz without losing its warranty given that the temperature of the device does not reach more than 80 °C. My RasPi runs at 950 GHz, since it crashed with the highest possible settings. To do so, I’ve changed my /boot/config.txt as follows:

#uncomment to overclock the arm. 700 MHz is the default.
arm_freq=950
force_turbo=0

# for more options see http://elinux.org/RPi_config.txt
gpu_mem=128
gpu_mem_256=160
gpu_mem_512=316
cma_lwm=16
cma_hwm=32
core_freq=250
sdram_freq=450
over_voltage=6
avoid_safe_mode=1

A complete list of configuration options for the /boot/config.txt can be found on elinux.org.

Since more heat is generated by overclocking, I placed my RasPi into an enclosure lacking a lid. For better heat dissipation, I glued heatsinks to the ARM processor. You can check the CPU temperature with:

$ cat /sys/class/thermal/thermal_zone0/temp

Under idle conditions, the temperature on the overclocked Pi is about 36 °C, whereas my Pi within the Pibow without heatsink and default settings is running at 48 °C.

IMG_6077
RasPi in LEGO enclosure with heat sink.

The settings above also activate dynamic memory sharing for RAM and GPU. More RAM for the GPU will be automatically assigned when you’re starting the Xserver.

If you want to free more RAM, you can disable kernel modules if you don’t need them. For example, if you’re not going to use sound, blacklist the corresponding snd* modules in /etc/modprobe.d/raspi-blacklist.conf.

# blacklist spi and i2c by default (many users don't need them)

#blacklist spi-bcm2708
#blacklist i2c-bcm2708
blacklist leds_gpio
blacklist led_class
blacklist snd_bcm2835
blacklist snd_pcm
blacklist snd
blacklist snd_timer
blacklist snd_page_alloc
blacklist snd_rawmidi
blacklist snd_seq_device
blacklist snd_usb_audio
blacklist snd_hwdep
blacklist snd_usbmidi_lib

If you want to run your Pi 24/7, you may want to add watchdog support, which automatically resets your Pi on system errors. For installation of the watchdog do:

$ sudo modprobe bcm2708_wdog
$ echo "bcm2708_wdog" | sudo tee -a /etc/modules
$ sudo apt-get install watchdog

and edit few lines in /etc/watchdog.conf to

watchdog-device        = /dev/watchdog
max-load-1             = 24
temperature-device     = /sys/class/thermal/thermal_zone0/temp
max-temperature        = 75

The watchdog will be activated on next reboot.