Sunday, 27 May 2012

HDMI to VGA for Pi

The 19" TV in my study only has one HDMI port. To be fair, this is not uncommon on a screen of this size, but it did mean faffing about with a HDMI switch if I wanted to connect my Pi.

Fortunately someone over on the official Rasberry Pi forums found this at Amazon:

I decided to grab one and had been using it quite happily until today...

It seems that the HDMI-to-VGA cable I have (the Amazon neewer one) draws some power from my Pi. Presumably it needs some to make the chip work that converts the signal. I've no idea how much exactly, but it might explain some of the power problems I've been having!

I played with Debian a lot yesterday, fiddling about with configurations and trying various games (Scummvm, Doom, Quake 3, Pingus) all without any issues.

Today I decided to try out OpenELEC and kept having problems with the screen on my monitor blanking out for a second or so and then coming back. Very annoying. I tried switching to a normal HDMI cable and the problem went away, so I concluded that it must be this cable drawing power from my Pi.

Now as I was saying, I was having some power problems previously, even with a genuine Samsung Galaxy S II charger, which I think without checking provides 700ma. That prompted me to switch to a powered USB hub, with the mouse and keyboard plugged into that on two ports and a third port providing power back to the Pi, leaving a fourth port spare.

Having reached the end of my tether with the screen blanking out this evening I considered not running the Pi from the USB hub and instead using the Samsung charger JUST for the Pi and the powered hub for everything else. I decided I didn't really want to do this as it meant having two separate devices plugged in to use my Pi and I was already a bit annoyed at having to use a powered hub.

Then I remembered that I have some 2.5" hard drive enclosures that come with Y-USB cables. The idea is that you plug both USB plugs in and one provides power and data connection and the second just provides additional power for more hungry drives. As I don't actually own a drive that's ever needed this second connector plugged in I decided I could sacrifice one of these cables.

A quick Google search showed that I would still only get 5v of power on the cable (I was initially concerned I would get 10v and blow my Pi!) but estimates on amps varied between 600 to 1000 ma.

I decided to go for it and grabbed a spare micro USB cable and one of these Y-USB cables and got busy. I didn't bother connecting the data wires as this is purely intended for powering the Pi, just connected the red/black wires.

Plugged it in, turned it on and it works perfectly, the screen blanking is gone!

Hopefully this might help out someone else when they're having a frustrating day...

EDIT: Forgot to mention that I initially had some problems in OpenELEC that I didn't have in Debian with what I can only describe as "sparkly bits" on certain screens. This is easily fixed by following instructions here:

Sunday, 20 May 2012


Have spent part of my day learning how to play OpenTTD, having NEVER played a Transport Tycoon game before. My curiosity was piqued having heard of efforts to port this to the Pi. You can read more about that here:

If you're like me and have never played this game before, check it out here:

Needless to say, it's a great little game and I'm looking forward to seeing a fully working (and hopefully optimised) version of it running on my Pi.

Distro Issues

Spent a frustrating morning trying to get the recently released Slackware distribution running on my Pi. I have no doubt that it will be great when problems are ironed out and I have nothing but praise and admiration for the person (or persons) responsible for porting it to the Pi, but it's just not ready for prime-time yet.

The main two problems I encountered were that I could not get my network connection working and I was experiencing lots of problems using my wireless mouse/keyboard.

Now the first of these problems may be down to my lack of Linux knowledge, but after numerous Google searches and checking of files, running of ifconfig and netconfig I was still getting no nearer to getting it working.

The second problem, with my wireless mouse/keyboard exhibited as lots of lag between keypresses or repeating my keypresses or just not picking up on them. This was a problem I had seen previously on Debian which turned out to be down to my power supply. I've since replaced that (now using a powered USB hub) and they are working perfectly in Debian. I wonder if Slackware is using more power than Debian and therefore affecting the mouse/keyboard and potentially the ethernet too?

If you want to try it for yourself, you can pick it up here:

Anyway, back to Debian I went and decided to get the problems with the display sorted out. Here I had two problems, text was too small so as to be virtually unreadable and I had fat black borders at the top and bottom of the screen.

Now I am sure the small text is perfect if you are on a 32" or 37" or 40" (or even bigger) screen, but at present my Pi is hooked up to a 19" screen, so I needed to find out how I changed the resolution.

I referred to the following two pages:

These (particularly the first link) should tell you EVERYTHING you need to know about the config.txt file. I set hdmi_mode=4 and then after a bit of trial and error I got the overscan settings perfect.

Next up, installing Chromium using the instructions here:

Friday, 18 May 2012

Battery Power

One thing my son and I were interested in was powering a Raspberry Pi from batteries. At present we have no specific application for this, but obviously if it can be done it opens up a world of opportunities for a portable Pi!

To this end I popped into my local Maplin store on my way home and picked up a 4xAA Battery Box (Code HF29 - £1.29) and a PP3 Clip (Code HF28 - £1.19) to go with a micro USB cable I picked up at Poundland earlier in the week.

I snipped the USB plug (the big one, not the micro one!) from the end of the cable and stripped back some insulation. I then snipped the yellow and white wires off and connected the red and black wires to the same colours on the PP3 cable. This then clipped onto the battery box which by now was filled with batteries, ready to rock.

We connected up the Pi and it came to life! Booted OpenELEC and started a video playing, all without problems. Very pleased.

We might make a further trip back to Maplin this weekend to pick up a switch and some rechargeable batteries, I'll keep you posted!

EDIT: Tweeted about the above, and the Raspberry Pi people dropped me a tweet back to say "awesome - but be aware that if you push more than 5v through you may shorten the lifetime if the chip. 5v linear regulator FTW!" Hmmm... obviously this isn't quite as simple as I thought and a bit more work is required! In short, don't follow my instructions above for now, will update when I come up with a better solution.

Saturday, 12 May 2012

Raspberry Pi

I finally got my hands on a Pi on Thursday, 10/05/12. Sadly (for me) I had already promised the first Pi we received to my 10 year old son, so I had to hand it over. I'd been following the Pi since it's first appearance on the BBC website. I'd got my son interested and had promised him one for Christmas last year. Sadly due to various delays they weren't available anything like early enough for Christmas so he got an IOU and the aforementioned promise that the first Raspberry Pi I got hold of would be his.

Fortunately for me, while he's quite techy, he's not as techy as me so I've been able to play around with it a fair bit over the last couple of days. I've been darting in and out of his bedroom with different SD cards and scribbled notes like a madman! After getting Debian up and running (simplicity itself, just download and follow the instructions on the website) we wanted to get Quake 3 running. I found some very useful instructions here and soon had everything downloaded and copied across. Sadly loading up the game would cause the Pi to freeze up.

We tried various combinations of USB hubs, mice, keyboards, even a different SD card, but to no avail. I decided to move onto trying something else and got busy with OpenELEC! I've been using XBMC in various forms for about a year and a half now and fully intend to have at least one (if not several once they become easier to get hold of) Raspberry Pi dedicated to running XBMC. I was hoping the process of setting it up would be as easy as that for Debian, but no joy. I would have to download the sources and compile it myself!

Fortunately some great instructions were available here on the OpenELEC website to get me going. I grabbed a spare laptop (no DVD drive or battery, hence why it's a spare!) and installed Ubuntu 12.04 as I would need a flavour of Linux on hand to compile and didn't want to tie up my own laptop (also running Ubuntu 12.04) all day. I then ran through the instructions and left it to build. And build. And build.

And build.

Finally about 4pm it finished (I had started at around 9am) and I then used the second part of the instructions to get it onto an SD card. Booted up the Pi with the new SD card and it all looked great! Sadly it was frozen, more problems!

It was about this time when I decided that maybe the PSU I had purchased was no good. It was a plug with a USB port that is *supposed* to provide 5v at 1000Ma. So I pulled the USB cable from the bottom and shoved it into the next nearest thing... the front of my son's XBox 360! Pi booted up and worked like a charm, lovely!

(For reference, the 360 doesn't even need to be switched on for this!)

I've still run into a few power-related issues, so I don't think this is a permanent solution and am on the look out for a powered USB hub or two now. Still, it was fun to get these things set up and I've definitely learnt a few new things. Just wondering what I'm going to do next...