Saturday, 18 May 2013

Asus RT-N56U Stock Firmware & Sky Fibre

Wow, what a nightmare Sky Fibre is. All I wanted to do was replace the crappy Sagem wireless router with my Asus Black Diamond router and it turned out to be a 3 week sprint of reading about Asuswrt, Tomato and udhcpc. Turns out that yes, it's a pain to setup, but it's definitely possible... and with the stock firmware! :-D

So, how does it all work?

Well, firstly, the Sagem router communicates the with BT OpenReach modem like any other ethernet based device, except it uses MER (MAC Encapsulated Routing) to authenticate the device so that you can't just plug in any old router. What does this actually mean? Well it means the Sagem router sends some very specific information to the OpenReach modem, the client id.

This client id is naturally not found in any configuration screen, you have to sniff it out of a DHCP packet to get it.


  • You have to connect your laptop/system via ethernet to the Sagem router and make sure nothing else is connected.
  • Then give your laptop/system a static ip.
  • You'll then need to fire up a packet sniffing tool like Wireshark.
  • If you start capturing from your ethernet port (eth0 most likely)
  • Then turn on the Sagem router you'll get a lot of packets come back
  • The one you are interested in is the DHCP packets (under protocol these are marked as DHCP). 
  • Open it up and look for the client identifier field (should have the number 61 beside it)
  • Right click it and find the option to copy the value (plain text, or something similar)
  • If you've done it right on paste you should see something like xxx@xxx|password.
  • You'll need to convert that to HEX, use any old web site for this and make sure you remove spaces.

Once done, you'll need to telnet into your Asus RT-N56U. This must be enabled first in the Administration section in the web interface. Once in you'll find that udhcpc is already running (just run ps to see active process's). This is the process that negotiates the IP with the BT OpenReach modem. Copy down the name of the process, something like:

udhcpc -i eth3 -p /var/run/udhcpc0.pid -s /tmp/udhcpc -O33 -O249

Kill the existing process via killall udhcpc

Then start it again, but this time with your client identifier i.e. something like:

udhcpc -i eth3 -p /var/run/udhcpc0.pid -s /tmp/udhcpc -O33 -O249 -x 0x3d:###HEXUSR&PASSWD###

Then plug in your BT OpenReach modem into the WAN port and if it has all worked, after a couple of messages it will successfully get an IP and your internet connection will be up.

No more Sagem router! :-)

Saturday, 23 February 2013

GeekTool - For Everything Else...

So it's been some time since I last posted. Much has happened since then, some big life changing events but all good thankfully! My life has settled down a little bit now so have found myself with some free time.

I thought then it would good to start posting on blogger again; about something new and not media centre related. Although, plenty of that to come as OpenElec and XBMC has been making big waves since last year.

Over the Christmas period just past I was able to get myself a shiny new Macbook Pro Retina while out in the states. Amazing machine. I'll save you all the usual amount of "it just works", but really it just does. After getting back I immediately set about customising and getting it to a place I was happy with everything.

However, one thing I was lacking was easy ways of getting to information on the system without having to run up several apps. If I wanted to get my IP, I could either use the terminal or the network preferences, if I wanted to check out the system log I could use console or the terminal, if I wanted to check when CCC (Carbon Copy Cloner) last ran a backup, i'd either run up console or the terminal.... you get the picture.

So it seemed I could do everything with the terminal, but having to type in commands time and time again would eventually frustrate me. I want the information now. And as much as I love the terminal, it drives me nuts sometimes.

To solve this challenge, I used a tool called GeekTool. GeekTool allows you to create simple desktop widgets that can either display an image, output from a command or the contents of a file. Using a combination of these you can get some fairly complex information displayed on your desktop, here is what I was able to achieve in 30 minutes or so:


I've got my IP, last 10 lines from /var/log/system.log, details of my last CCC backup, current usage of the root partition and date/time all on screen at the same time. They all update a varying intervals depending on how often I need it. The system log updates every second and the CCC stats section updates every 30 minutes. Apart from the disk usage (round graphic), everything else I was able to do out of the box. The round graphic above is actually what is called a geeklet, an extension of sorts, but in reality it's a clever apple script which changes to pre-rendered images. It can be downloaded here for those interested.

Some examples of what is seen above:

  • Getting the date of the last CCC backup from command line
    • cat /Library/Logs/CCC.log | grep "Backup Critical Files: Time" | awk '{ print $1 }' | tail -n -1
  • Percentage of disk space used by root partition (i.e. / ) from command line
    • df / | awk '{ print $5 }' | tail -n 1
  • Current IP Address from command line
    • ifconfig en0 | grep inet | awk '{ print $2 }' | tail -n 1

My terrible command line usage aside, the above will allow you display these pieces of information on your desktop via the shell Geeklet.

There are examples of other peoples setups available here if you need some inspiration.

My final note on this great tool is that for some reason, it consumes a stupid amount of memory when you create and modify geeklets. For instance, after creating the above, I noticed it was consuming around 1.2 GB of memory!!! However if you quit GeekTool and start it again, this number drops significantly.

Happy customising!

Thursday, 12 April 2012

eMachines ER1401 Memory Upgrade

Normally I wouldn't write a post for something so trivial such as a memory upgrade. In a normal ATX or AT form factor Desktop PC or even a modern laptop, it normally isn't that difficult to upgrade the system memory. In fact this was one of the first things I learnt to do when playing around with my dad's old system, an Intel 486dx based system with Windows 3.11 installed.

However for those who own a ER1401 they will know that it's form factor, case design, etc is compact and I had some challenges while doing the upgrade.

Here are some notes for others which if I had known in the first place would have helped me:

Please note that this is not a complete list of instructions and that if you attempt to do this, that you may (and probably will) cause some damage to the chassis due to the fact it was never designed to be opened! 


  • I done the whole upgrade i.e. Opening of case, removal of old memory and installation of new and rebuild in around 30 minutes, but if you are new to this sort of thing, take your time! 

  • Consider not doing this! It is very difficult and noisy to open the case up, at times during the upgrade I wish I hadn't, however it worked out just fine. 

  • I used 2 x 2GB modules which were left over from my Macbook Pro upgrade. They were the exact type I needed i.e. DDR3 modules. You can also order memory from Crucial if you don't have any spare.

  • There aren't any custom screws it's all just Philips screw drive

  • There is a video on YouTube which may help you understand the process of disassembly. However it's more of a joke than an actual guide, so don't expect it to spell everything out.

  • The case is made up of 5 distinct parts
    • The plastic cradle and support
      • This is attached to the main body by two screws, easy to remove and must be removed.

    • Top Black Cover (With the power button on the top right and the VGA port on the left)
      • Is attached to the side plastic support and also the bottom black cover by plastic clips. When removing this start at the bottom, where you removed the cradle and slowly separate it from the edges with a flat head screwdriver (or similar implement). As you do this you will hear clicking noises as it separates. Do this for 3 out of 4 of the edges, once on the final edge, you should be able to just pull the cover off.

    • Side Plastic Support
      • Is attached to the bottom black cover by metal and plastic clips. For me this was the hardest part. I started at the top where the power button is and used the same method as above, slowly separating the side plastic support from the chassis. After removing the side panel I found I broke two of the clips... doh! However when I later assembled the parts, it went together just fine with no visible or noticeable change.If you manage to remove this without causing damage, then my hat comes off to you!

    • Internal Metal Cover
      • Easy to remove, is attached by 3 screws, little bit awkward to remove at first, but just requires a slight bend in the metal cover to remove properly.

    • Bottom Black Chassis (which has the other side plastic support attached to it and also the motherboard inside)
      • The motherboard is housed within this chassis, before removing though, you have to disconnect the CPU/GPU fan power lead and disconnect the two antenna's for the WIFI card (little gold connectors). You also have to unscrew the CPU/GPU heat sink via the 3 screws. Once disconnected and removed, the motherboard should not be attached to anything on the main chassis. Removing it requires a bit of wobbling from side to side, but should pop out with no damage to either itself or the chassis.

Wednesday, 11 April 2012

OpenElec Upgrade to 2.0 (1.95.1) aka XBMC Eden - Conclusion

In my previous post I talked over the experience I had with the initial upgrade. It wasn't the smoothest of upgrades to be sure, however it's always a good upgrade when it works without my better half knowing anything has changed :-D

I also mentioned some issues I was having, specifically the following:


  • VGA Mode error on boot
  • Audio set to Analog but coming through HDMI anyway
  • Thumbnails on my shared drive don't seem to work with the new database, this is either because XBMC Eden index's them differently or that during the migration from the old to the new format, there was a conversion fault in the DB. However I haven't checked this out yet in more detail, could well be something entirely different.

Well the good news two out of three of these issues are solved. Details below:

VGA Mode error on boot


So it turns out that a fix that I had to put in place with a previous version of OpenElec caused problems for the newer version. Specifically the splash screen fix which previously allowed the boot screen logo to display properly however in this version results in a ugly error message. The good news is that the fix is straight forward, just remove the changes that were made to apply the fix at the link above. Excellent! Thanks to Stephan Raue for posting this solution in the previous post!

Thumbnails not showing correctly


One of the changes which happened with the introduction of Eden was a change in how Thumbnails and in general how special locations are referenced and managed. Previously I had just soft-linked the /storage/.xbmc/userdata/Thumbnails folder to a SAMBA location however XBMC did not like this after the upgrade. After doing some reading it became apparent that I needed to add a Path Substitution into the AdvancedSettings.xml file. I added the following above my tags:


<pathsubstitution>
<substitute>
<from>special://masterprofile/Thumbnails/</from>
<to>SMB://192.168.2.100/mysql/Thumbnail Cache/</to>
</substitute>
</pathsubstitution>


A quick restart and the Thumbnails were working like a charm again.

I also after solving the issue found an article on the OpenElec Wiki which covers this issue... doh! My google ninja skills failed me at first, alas, I learnt something new, read the OpenElec wiki first!

With regards to the audio settings. As the audio is actually working at the moment, it's not so critical that I fix this, however I want to take a better look at the weekend. Wish me luck!

If I find anything interesting, will post again.

Tuesday, 10 April 2012

OpenElec Upgrade to 2.0 (1.95.1) aka XBMC Eden - How it went so far...

Nothing more nerve racking than preparing for a major upgrade on production hardware. Sure I could have installed the new OpenElec to a external disk then tested from there, but I prefer to jump in with both feet! So how did it go?

So I downloaded the latest image from the openelec.tv site (the 1.95.1 version which to all intensive purposes is 2.0) and extracted the contents as normal. I used my Windows laptop to do the work required below as apposed to my Macbook, simply because it was closer to me... yep I'm hardcore :-p

I then copied the new KERNEL and SYSTEM images (along with the MD5 files) over to the SAMBA location //openelec/updates on my running ER1401 system.

So far so good, system restart is then required to have OpenElec do the upgrade based on the files that I just transferred above.

Apon reboot I got the familar messages than new images had been detected and that it was upgrading. It automatically reboots then starts with the new and updated OpenElec and XBMC.

However, as it was booting for the first time, I received an error message indicating that the incorrect VGA Mode specified was incorrect. I knew this to be false since I had applied the boot screen fix before and this was adjusted to vga=792, it was also reporting a number I had not seen before. As of yet I've not investigated this further.

Skipping this message, I was then presented with the OpenElec boot screen as normal, albeit not in full perspective due to the above issue. Once the screen disappeared, only a black cursor "X" remained on the screen. No error message, no immediate issue was clear.

After some investigation though it turned out that because I was using a MySQL database on my NAS as the backend for XBMC, it was having issues migrating the database to the new XBMC Eden format. I found this error in the /storage/.xbmc/temp/xbmc.log file, however as the log is now gone I cannot share this with you, but you can't miss it if this is happening to you, it keeps printing it.

Just as a note at this point, you have to re-enable SSH support as the guys over at OpenElec have disabled it by default. It's easy to do, simply create a file called "ssh_enable" in the ConfigFiles folder via SAMBA. Username and password are the default as before. Official instructions on this are at the OpenElec site.

So I renamed the AdvancedSettings.xml file in the ConfigFiles folder and done a restart and bingo! XBMC Eden was now showing on my screen. Things to note at this point.
  • Audio was working already although I want to investigate it further. Currently it's set to Analog however I'm using audio over HDMI.
  • I had to adjust the screen over scan, but I also had to do this with previous versions of OpenElec
 After I changed to my favourite skin and did the normal amount of customisation, I tested Audio and Video and both work great. All the hardware (apart from the built in wireless which I did not test) seems to work fine.

However as mentioned above I had to disconnect from the MySQL DB to get XBMC to load without looping infinately with errors. To fix this I created a copy of the original database and modified the AdvancedSettings.xml to use the copy. After restarting OpenElec and monitoring the progress via SSH I could see it was now working. No clear idea on why it failed originally, except that I do have other devices on my network using the same database.

XBMC Eden is now using the copied version of the database which I will migrate my other devices over to once I've squared off my ER1401. Given that this is a prerelease though, it's actually very stable!

Issues still open which if I find fixes for will post on:
  • VGA Mode error on boot
  • Audio set to Analog but coming through HDMI anyway
  • Thumbnails on my shared drive don't seem to work with the new database, this is either because XBMC Eden index's them differently or that during the migration from the old to the new format, there was a conversion fault in the DB. However I haven't checked this out yet in more detail, could well be something entirely different.

Monday, 9 April 2012

OpenElec 2.0 Beta Released! Time to roll sleeves up...

So after the release of XBMC Eden, it was only a matter of time before OpenElec was also updated to include the latest version of XBMC. The guys over at openelec.tv have now also released the 1st beta version of OpenElec (1.95.1) or 2.0. Good times!

As i'm running a system which is classed as "Generic" i.e. doesn't require a custom build, time will tell how the update/installation goes. What i've read so far is that not only is there significant changes on a OS level within OpenElec, but also there have been changes to the DB that XBMC maintains, so i'm not expecting the upgrade to go smooth, but here goes nothing!

The guys over at OpenElec.tv have put together a wiki on how to upgrade, so give it a go yourself if you feel up to it.

Will post my results after the upgrade has been completed.

Image can be downloaded here.

UPDATE: To see how it went check out this post!

Saturday, 7 April 2012

Blue Pick


Great shot of a friend of mine playing guitar with a well used blue pick.

Sunday, 26 February 2012

About time... 500px plugin for Aperture :-)

Been looking for a quicker way to upload photos to 500px for a while now, even considered coding one myself, however not being a OS X developer, this was not going to happen any time soon.

Works great, recommended!

You can download it here:

https://github.com/iKenndac/500px-Aperture-Uploader/downloads

Instructions for installation as per the ReadMe:

To install the plugin, place it in ~/Library/Application Support/Aperture/Plug-Ins/Export. This folder tree may well be missing on your Mac - if so, just create them. Note: The Library folder in your home folder is hidden by default on Lion - you can get to it by holding down the Option/Alt key and choosing "Library" from the Finder's "Go" menu.


Thanks to Daniel Kennett, hopefully 500px will embrace this on there Apps page.

UPDATE: Author has released a new version!

Tuesday, 21 February 2012

Keyboard Trousers... :-S

Can't imagine this is very ergonomic or even safe to wash! But that aside, nice idea, just can't imagine you'd fit into any real office tapping away at your crotch while looking at a screen.


http://www.webpronews.com/exclusive-keyboard-pants-so-you-can-dance-and-still-type-browse-etc-2012-02

Saturday, 18 February 2012