Category: linux (page 1 of 10)

Controlling an Original Xbox with an Arduino

A few years ago, I used to use an original Xbox as an XBMC box, it recently occurred to me that there was a perfectly good 500GB hard drive sitting in there doing nothing, so I bought a hard drive caddy and decided to salvage it.

It’s not just a case of pulling the old drive out and putting it into the hard drive enclosure, which I found out the hard way. You first have to unlock the Xbox drive, as for some reason, Microsoft decided that they would lock Xbox hard drives using ATA passwords.

This usually means just booting the Xbox, selecting unlock hard drive from the settings menu of your Xbox dashboard and you’re done. However, I didn’t have a controller, or DVD remote to control the menus (both lost somewhere), though my Xbox does still have the DVD IR receiver plugged into the front. I had the IR receiver, but no remote to control it with. No problem.

I took my Arduino Uno, and built a simple circuit with an IR LED and a resistor. Then I installed the excellent IR library for Arduino written by Ken Shirriff, I’ve used this library in a few projects and it’s fantastic.

Now, how to interface with the Xbox? As people with universal remotes will know, you need the IR codes specific to the device you want to control, the LIRC project maintains a database of IR remote codes, so I found their entry for the Xbox here.

The sendRaw function of the IR library takes an unsigned int array of the length of times for the LED to flash on and off, how can we work out what values to put in this array based on the LIRC file?

Ken published an excellent breakdown of the how LIRC files work here, which helped me construct the arrays needed to work some simple commands.

Basically the HEX number in the LIRC file corresponds to a binary string, and at the top of the file it tells what pattern of IR flashes a ‘1’ corresponds to, and what pattern a ‘0’ corresponds to. Start with the ‘header’ values, add the values for the ones and zeros, and finish with the ptrail value. Note that the values in the file seem oddly specific. This is because they’re measured from real remotes, and real IR recievers aren’t ideal. I just rounded the values for easiness sake.

Pretty soon I had a simple Arduino sketch that takes values from the serial monitor and in turn sends the proper code to the LED. It’s not pretty, but it does the trick.

In the very, very off-chance that someone else needs to do something like this, or wants to create a remote control for their Xbox, I’ve added the code below, it only implements Up, Down, Left, Right, Select, Play and Back, but if you need extra buttons, they should be easy to work out based on what’s there already and the LIRC file.

Eventually, after updating my Xboxes ‘dashboard’ software (UnleashX) to the ‘latest’ version (released about 5 years ago) I was able to unlock the hard drive, put it in my new enclosure and reformat it, and done. Brand new old hard drive.



Using the Zune HD in Linux

Contrary to a lot of advice on the Internet, the Zune HD can be used in Linux. Support has been integrated into libmtp for the mtpz protocol thanks to some awesome work by Sajid Anwar.

libmtp however, does not and will not contain the encryption keys required, so it will seem like the Zune isn’t recognised. Running mtp-detect on the command line gives

shane@ratbert:~$ mtp-detect
Unable to open ~/.mtpz-data for reading, MTPZ disabled.libmtp version: 1.1.6

Listing raw device(s)
Device 0 (VID=045e and PID=063e) is a Microsoft Zune HD.
Found 1 device(s):
Microsoft: Zune HD (045e:063e) @ bus 1, dev 6

It’s simple to get this to work however.

Just create a file in your home directory called .mtpz-data and add to it the following string of numbers. This is the encryption key needed to interface with the Zune.

Encryption Key

Now, run mtp-detect and you should see the encrypted handshake take place, gmtp, Clementine, Rhythmbox and any media player that supports mtp should now be able to copy music to and from the Zune HD.

Do you know what the problem with Linux is?

Some of the users.

For the 20th birthday of the Linux kernel, Microsoft have made a video wishing Linux happy birthday.

My first reaction to this? That’s pretty nice, at the end of the day, there’s no reason we can’t be friends just because of a difference of opinion on the best way to develop an operating system. In fact, I’m surprised Microsoft was relaxed enough to let this out, good on them.

The top comment on the Slashdot post about the video?

It begins with, “I read this as a slight against Linux…” and goes on to say..

I think the general philosophy that has clearly been reiterated by the Linux community is there is absolutely no room for trust in Microsoft. They are a convicted monopolist and have called upon everyone to view Linux as a cancer. They continue to use their patents to extort payment from large and small with bogus insubstantiated claims against Linux. They are the company that uses embrace extend extinguish. This animation represents the same underhanded intentions.

Do these people ever turn off?

Setting up a Windows partition to automatically mount on boot in Ubuntu

Quick one here, something I find myself doing every time I install Ubuntu on a dual boot machine.

1. Create your mount point, sudo mkdir/media/windows
2. Add a line to /etc/fstab, the one below is for a Windows HDD, with the main partition being sda2 (you can work this out by graphically mounting the partition through nautilus and then running df -h)

/dev/sda2 /media/windows ntfs-3g user,fmask=0111,dmask=0000 0 0

Save /etc/fstab then you can run mount /dev/sda2 to mount the drive. It should mount automatically at /media/windows from now on.

Waking up to new Ubuntu

Today Ubuntu 10.10 was released, at 10:10am. Last night I prepared my laptop for a complete reinstall, I took a backup of everything important from both Ubuntu and Windows, and prepared GParted and Windows 7 CD’s.

This took a while, so it was late when I went to bed. That left me with a conundrum, I wanted to install Ubuntu as soon as it came out, but I also wanted to sleep… Hmm..

Read more →

Ubuntu Lucid 10.04 Release – Late Drama

As I’m sure many of you are aware, today is the official release date for the new version of Ubuntu, Lucid Lynx. The graphic to the right of this post idicates that the new release is “Coming Soon” where previously it counted down the days.

Well, the release was delayed at a very late stage, due to a show stopper bug found in the installation process. The bug can be found here –

Basically the problem was with the migration assistant which helps carry over settings from already installed OSes. If the migration assistant found some material to carry over to Ubuntu, the GRUB menu would appear without entries for the other operating systems on the PC. For new users of Ubuntu, this would be a scary experience as they’d believe that their other OS was gone. There are a couple of easy fixes, but it was decided that the best fix was for the new version not to ship until this bug was fixed.

The Ubuntu release team, wisely in my opinion, decided to respin the official ISO’s for Ubuntu 32 and 64 bit so that this bug is not present in the final release.

This means that the release has been delayed for a few hours, but will still happen at some point today (Apr 29th). By all accounts (watch
for up to date info) we’re not too far off an official release, so get your torrent clients ready, and please seed generously.

6 Things to Do After Installing Ubuntu 10.04 Lucid Lynx

I just installed the beta of the new Ubuntu release, 10.04. As I usually like to do, I opted for a clean install and then set about doing all the things I usually do after a clean install. This time, I decided to document exactly what these things are so that other people can get their systems up and running smoothly. Hit the more button to see these steps. Read more →

How to move window buttons from left to right in Ubuntu 10.04

In the latest Ubuntu, the team have made the decision to move the window buttons (minimize, maximize and close) from the right to the left. I don’t agree with this change, so thankfully it’s not a difficult one to reverse.

To relocate the buttons back to their rightful place on the right, follow these steps. Read more →

Great Ubuntu Blog

Just a quick post here, if you use Ubuntu, there are a few places you can keep up with the latest news, most popular and often mentioned is Planet Ubuntu, which aggregates Ubuntu members blogs. It’s often a little too developer heavy and in depth for normal users.

I recently found a great blog solely for users, it highlights the latest updates and news about applications and is a great way to discover new cool apps, like Ubuntu Tweak, Docky, Gwibber and loads others.

That blog is OMG! Ubuntu!, I’m not a huge fan of the name either, but the content can’t be beat. It’s updated several times a day which is incredible, I never knew there was enough Ubuntu news to fill several posts a day!

Anyway, check it out, you won’t be disappointed –

My New Desktop

Since its exam time, of course I’m spending my time doing anything but studying. So, I’ve completely redone my Ubuntu desktop.

Read more →