Raspberry Pi as a thin client

 The processor on the Raspberry Pi isn't all that fast, so why not offload it? I have a HP ML350 that is mostly idling, except when I need to use PostgreSQL, so I thought to set it up as a desktop server for my Pi.


I set up a RDP server since it works well with Linux and also Windows. First thing's first, install xrdp and all other dependencies:


apt-get install build-essential libpam0g-dev libssl-dev x11vnc vncviewer fakeroot checkinstall x11vnc xrdp rdesktop


Then, install your desktop of choice. I chose XFCE since it's pretty lightweight

apt-get install xfce4

I've had problems getting it to start X remotely, so I fixed it with the following. Do this in the user's account (/home/pi for example)


touch .Xauthority
chmod 600 .Xauthority

And that's it!. Start up your Raspberry Pi, install rdesktop, and connect to your server:

rdesktop -g 1024x768 -P server_address

NES controller on the Raspberry Pi

Because I wanted the full experience, I wanted to hook up my NES controller to my Raspberry Pi and play NES games. I looked around and didn't find anything that fit my needs.

I wrote a script, that's up on Github now, that converts button presses on the NES controller to keyboard presses. So for example, by pressing the A button it registers as pressing the Z key on a keyboard. How to set it up is all right here.

I spliced the wires on the NES controller (thanks to this diagram) and used a breadboard to connect the appropriate wires to ground, +5V, the data, latch, and clock pin. Now I can play Mario in retroarch with a NES controller!

SNES emulator on the Raspberry Pi

 I won a Raspberry Pi for getting 3rd place in the Open 7400 Logic Competition, of which HubCityLabs donated the Raspberry Pi. My initial project idea for it was to set up a wall mounted weather station. For the time being I thought I'd mess around with it and get somehwhat familiar on what I'm dealing with.


I downloaded the Rasbian image and wrote it to an SD card. It's recommended that the SD card is a minimum of class 4.

Everything is supported 'out of the box' with Rasbian so there's no fiddling around. After purchasing a HDMI cable and connecting it to the Pi, it still output video via the RCA jack instead. I opened up /boot/config.txt and set hdmi_safe=1 and voila, HDMI worked!

To mess around with it, I discovered RetroPie. I picked the "slow" option which compiled all the binaries, rather than get the precompiled binaries. I didn't watch it intesnely, but it seemed to take about an hour. Once that's installed, you can now play SNES, NES, GBA and Atari 2600 games! RetroPie installs the emulators to ~/RetroPie/emulators and all the libraries to ~/RetroPie/emulatorcores. I downloaded Super Mario World and ran:

~/RetroPie/emulators/RetroArch/retroarch -L ~/RetroPie/emulatorcores/pocketsnes-libretro/libretro.so path_to_snes_rom.smc


To explain, it uses the RetroArch emulator and the pocketsnes library.

Here's the result:

I don't have a gamepade of any sort, so I just used the keyboard. The letters on the keyboard correspond to the controller (X is X on the controller, A is A, etc...). I had the GPU set to 128MB and it seemed to run fine. I overclocked it another 100Mhz just to see any performance gains, but I didn't notice any and it ran about 5 degrees hotter than stock. 


To get an NES/SNES controller working with it, check out the next post.