Jan 30, 2015

Building a Dedicated Plex Media Server

So I finally decided to build a dedicated Plex Media Server, my desktop wasn't cutting it.
I used the following Plex link to educate myself about the system requirements.


The Hardware
Basically it stated that for every HD movie I wish to trans-code and stream I needed a passmark of about 2000.

Check passmark.com to determine your CPU passmark, and investigate what you need.
I decided that at maximum I would have 3 simultaneous streams going on, of my home movies of course. All these streams being HD - factor in your network upload speeds when determining what you can handle.

So, ballpark I needed a processor capable of about 6000 on the passmark scale - and I also made room for overhead.

I went with the following processor which gave me a passmark around 7300.:

Start with the processor then let this dictate the rest, I like to keep my systems small so I was looking for a mini-ITX that was LGA 1150 compatible. Please remember and check the CPU maker site to confirm motherboard (MB) comparability.

The MB I chose in the end was:

Mini-ITX means smaller case. I went with the following for simplicity.

So I have my processor, my MB, my case. I added 4GB of RAM and a 120GB SSD. The solid state disk was a little large, since I won't keep my movies locally. This is the RAM and HD:

The Software
So to keep things slick I decided to install Plex on Ubuntu, I figure any future services I want to run will no doubt work on Linux, that and I know Ubuntu. Check the official Plex site for more details on setting this up


I installed Ubuntu Server, because I don't really see a need for a GUI front-end, Plex is configured via the web. After installing Ubuntu Server, installing Plex is simple enough:

Download the .deb package from https://plex.tv/downloads. if you are putting it on a USB for installing on the Ubuntu Server, you may want to install usbmount to automount inserted USB sticks.

sudo apt-get install usbmount

Once you have the .deb package on your server, go ahead and install with the following command, relative to your .deb filename of course:

sudo dpkg -i plexmediaserver_0.9.8.18.290-11b7fdd_amd64.deb

To setup the server, open a browser window, and go to http://127.0.0.1:32400/web, replacing 127.0.0.1 doe the IP of the server if you are configuring this remotely.

Setting Up NAS Shares
The next thing you are going to want to do before getting involved with the configuration is map all your samba shares. I used the following link to work out my samba situation:


Make a .smbcredential file in your home directory so you can map your fstab correctly. In this file put username and equals sign and the access username for the share (and domain if loging into a domain) on the first line, put password and equals sign and the password for that user account on the second line of the file. The file should look like:

username=MyUsername
password=MyPassword

# OR:
# username=MyUsername@MyDomain
# password=MyPassword

# OR: (for cifs on Windows Serve 2003)
# username=MyDomain/MyUsername
# password=MyPassword

Edit fstab to map your mounts (sudo nano /etc/fstab). Entries in your fstab should look similar to the following:

//apollo/install_files /path/to/mnt cifs iocharset=utf8,credentials=/path/to/.smbcredentials,uid=1000 0 0

Where...

//$SERVER/$SHARE $MOUNTPOINT $FS_TYPE credentials=$SMB_CREDENTIALS,uid=$UID,gid=$GID

# e.g.
SERVER=apollo
SHARE=install_files
MOUNTPOINT=/path/to/mnt
FS_TYPE=smbfs
SMB_CREDENTIALS=/path/to/.smbcredentials
UID=1000
GID=1000

Once completed exit nano and save the changes to fstab. Make sure that the shares mount correctly:

sudo mount -a

If successful, reboot and make sure that mounts and Plex start automagivcally.

Now configure your Plex shares! Enjoy.


Oct 6, 2014

Modifying your Asus Nexus 7 (2013 2nd Generation)

The beauty of the Nexus 7 over the iPad, in my opinion, is that it plays content without discrimination - I can install Kodi (XBMC) on it without a problem, along with several other functions that Apple wish to lock down - and this is without modifying it. Other than features and functionality, the price point for entry into a tablet world is great!!  The Nexus 7 is a steal,

With the upcoming release of the Nexus 9, we will no doubt see a marked reduction in the price of the 7.

 I decided it was probably as good a time as any to mess around with modifying my Nexus 7 - and I can tell you, I am nothing but pleased.

Here is a summary of what is involved.

  • Setup your computer to use fastboot
  • Unlock the Nexus 7
  • Install custom recovery software
  • Install Cyanogenmod
  • Install Google Play Store
My guide is based on Linux, Crunchbang to be specific, but you can do this on any OS.  As usual, I found my information on the internet.  Check here for another guide and reference to Windows use, although beyond fastboot setup there is nothing different.

Setup your computer to use fastboot

The first thing to do here is install Android SDK on your computer, it in turn gives you fastboot and adb on your system.

Update:  Here is a link for installing ADB and Fastboot on any system,:
http://lifehacker.com/the-easiest-way-to-install-androids-adb-and-fastboot-to-1586992378

Following directions from this site, for Android SDK (http://developer.android.com/sdk/installing/index.html?pkg=studio)
  • Unpack the downloaded Tar file, android-studio-bundle-.tgz, into an appropriate location for your applications.
  • To launch Android Studio, navigate to the android-studio/bin/ directory in a terminal and execute studio.sh (./studio.sh).
  • You may want to add android-studio/bin/ to your PATH environmental variable so that you can start Android Studio from any directory.
Regarding the last point, I had to add the environment information, as it wouldn't run without it.
  1. Install JDK -- sudo apt-get install openjdk-7-jdk
  2. Environment Variable -- sudo nano /etc/environment adding the following line:
  3. JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-i386
  4. Reboot, and Android Studio starts up.

Unlock the Nexus 7

NOTE Unlocking the bootloader on a Nexus device will automatically wipe all device data.
  1. Power off your Nexus 7
  2. Press and hold the Volume Down and the Power button to power on the Nexus 7.
  3. Connect the device to the computer through USB.
  4. Verify your PC sees the device by typing:
    sudo fastboot devices
  5. If you don't see your device serial number, and instead see "", fastboot is not configured properly on your machine. See fastboot documentation for more info.
  6. From the same terminal, type the following command to unlock the bootloader:
    fastboot oem unlock
A disclaimer will display on the device that must be accepted. Use the volume keys to cycle through the options. Pressing the power button should confirm your selection.  If the device doesn't automatically reboot, reboot it from the menu. It should now be unlocked. You can confirm this is the case if you see an unlocked icon at the bottom of the Google boot screen during reboots.

At this point, download the Cyanogenmod, or whichever customer ROM you would like - to your download folder on your Nexus 7.

Install custom recovery software

Now you can install a variety of different custom recovery software, I installed TeamWin, not the latest but here you can find the latest, http://teamw.in/project/twrp2/193

  1. Download the recovery software of your choosing to your PC.
  2. Power off your Nexus 7
  3. Press and hold the Volume Down and the Power button to power on the Nexus 7.
  4. Connect the Nexus 7 to the computer via USB.
  5. Verify your PC sees the device by typing:
    sudo fastboot devices
  6. If you don't see your device serial number, and instead see "", fastboot is not configured properly on your machine.
  7. Flash recovery onto your device by entering the following command:
    fastboot flash recovery your_recovery_image.img
    (Where the latter part is the filename of the recovery image)
  8. Navigate using the volume keys and select RECOVERY using the Power key.
Leave your Nexus 7 in Recovery.


Install Cyanogenmod

While in Recovery do the following:
  1. Wipe Data
  2. Select Install
    • Install new ROM from ZIP (browse to your downloaded ROM of choice)
  3. Reboot.
Once the system has rebooted, give it some time to check for updates, once all updates to the ROM are finished, make note of the version you are running and proceed to the following location and download the appropriate Google Play Store APK to your download folder.


Install Google Play Store

Now to install Google Play Store to get back all your application goodness.
  1. Power off your Nexus 7
  2. Press and hold the Volume Down and the Power button to power on the Nexus 7.
  3. Navigate using the volume keys and select RECOVERY using the Power key.
  4. Select Install
    • Install new Google Play Store from ZIP
  5. Reboot.
Now you should be running an unlocked custom ROM on your Nexus 7.

Aug 11, 2014

Home Automation Early Adopter Woes

I got sucked into the internet of things some time ago, Philips Hue bulbs is what sparked my interest. This then turned into checking out IFTTT, which led to Belkin WeMo's being purchased. I obviously use a media center, so I purchased the Harmony Ultimate - and gained some hue control.

All these devices and no real common communication between them. Don't get me wrong IFTTT is nice, but it also doesn't play with everything. Step in SmartThings hub which can speak to ZigBee and Z-Wave, as well as the Hue hub - things get a little better.

Having had this setup for months, consisting of the following:

I can safely say I'm happy and I have a few automated activities setup, but I guess the worst thing is the range right now. 

My router is in my basement and it appears that the network is getting busy - I wonder how much g/n, Z-Wave, ZigBee traffic I can handle on my air-waves??? I think I am hitting a limit.

I am currently seeing issues with range in my WeMo's. If my WeMo insight on my first floor is on, my 2nd floor bedroom devices aren't detected - if I switch the first floor insight off and give it a minute, I see the previous problematic devices in the app again - I don't believe this to be Belkin related, just network congestion/interference.

Belkin decided to use standard Wi-Fi rather than ZigBee or Z-wave, and they "cheaped" out using G over N.  I have considered moving to Zigbee, because while they have a shorter range than Z-Wave, my Hue bulbs use ZigBee - and just list Z-wave, Zigbee creates a besh network for extending overall range.

It does seem that Z-wave is far more popular than Zigbee.

I have also considered if making changes at the router, I am wondering if purchasing an AC wireless router would improve anything???  I know I will be still using G, but will my transmission power be better?

In summary, I'm an early adopter and I am happy with what I have gained. While some of the devices were expensive, I invest to make the future brighter for everyone. Hopefully we learn going forward.  Interested in what Google's purchase of Nest will have on Google's future in home automation. 

Does anyone have any tips or experiences about their own automation solutions?

Aug 1, 2014

Kodi, the re-branding that XBMC deserves!

I've used XBMC on several systems in the past 10 years:


As well as several custom built home theater systems.

Finally after 10 years XBMC is shedding it's ties to the original Xbox and renaming itself Kodi - and I embrace this change fully.

While XBMC brings back old memories of hacking away at an Xbox to get more out of it, it no longer needs the association for exposure. Kodi is a strong application in its own right, with a multitude of 3rd party support - and several 3rd parties basing their own branch of software on the core, such as the Boxee Box by D-Link and the highly successful Plex appliaction which even runs on the Amazon Fire TV.

Read more about this on the official site, which I am sure will be renamed also...

XBMC Is Getting a New Name – Introducing Kodi 14/

Congratulations and good luck to the team!

Jul 22, 2014

XBMC and Emulation

So I finally went back to trying to get emulators setup in XBMC (OpenELEC specifically).  It took me a while to get everything setup, but in the end everything is working perfectly.  This all stems from the fact that I got my kid into SNES games to distract him on a long-haul flight.

Now there are several post out there with pieces of information, but solbero posted a great and complete guide on the openelec forum:

http://openelec.tv/forum/128-addons/71535-guides-retroarch-friends

This venture into emulators is not a big leap from XBMC's future, rumours have been around for a while regarding XBMC implementing emulators directly into the XBMC build.  There is even a branch of OpenELEC which contains these modification - I am slightly tempted to try this,  Retroplayer + XBMC:

http://forum.xbmc.org/showthread.php?tid=173361

When it comes to emulation they key component for realism is the joypad, in my humble opinion.  Amazon sells a USB compatible SNES replica controller, and it seems to get some ok feedback:



I myself have gone down the route of Logitech Rumblepasd 2 (Wireless), simply because it has more buttons for arcade based games - and I'm a fan of Logitech products.




The main complaint I hear about the Logitech Rumblepad 2 is the analog sticks are in a square boundary - so you can't recreate free flowing circles with the sticks.  Beware the price of these things, Amazon was selling for $99.  I picked up a couple on eBay for $55 shipped - I know have 3 and will no doubt sell one to recoup.

My implementation uses ROM Collection Browser to fire up the initial games, but after that I use the back-end emulator (RetroArch) to switch games.  I configured my left analog stick to save/load states using up/down, and I configured my right analog button to bring up the retorarch menu, left analog button is configured to exit the emulator and go back to XBMC.

If anyone tries out Retorplayer + XBMC, let me know your thoughts please.

I do have a spare Pi lying around, so I am also considering RetorPie http://blog.petrockblock.com/retropie/retropie-downloads/

For XBMC here is the version of RetroArch I used:
http://sourceforge.net/projects/zaggxbmcaddons/files/?source=navbar

Containing the following list of cores/emulators:
http://sourceforge.net/p/zaggxbmcaddons/wiki/Core%20List/

Jul 2, 2014

Using DYNU as Custom Dynamic DNS on DD-WRT Router

This is a guide to setup a custom dynamic DNS on dd-wrt, specifically I have my dd-wrt router connected to my externally facing modem - it doesn't have a direct WAN connection (this is important). The configuration details should however work in most cases, it will be a simple process of changing "Do not use external ip check"

I am personally using the Netgeart 3500L, which I paid $180 for a few years ago, but you can get at a steal now - NETGEAR WNR3500L RangeMax Wireless-N300 Gigabit Router with USB - Manufacturer Refurbished

I decided to create this guide due to recent issues with no-ip.org.  Other than the fact that they were served with a take-down notice from Microsoft, I was getting tired of logging in every 30 days.  I came across the following site:

http://www.gnutomorrow.com/best-free-dynamic-dns-services-in-2013/

And decided to go with dynu.com.  The configuration is as follows, and I got most of the information from the following page with their api:

http://www.dynu.com/default.aspx?page=dnsapi

You should replace the following fields in the screenshot:

youusername with your the username found under Main Menu >> Dynamic DNS Service Details >> General Settings in your dynu.com account settings - I do not believe that your email will work.
yourpassword with yourpassword to log in to your account
yourserver with your configured dynu hostname



Note that the "Do not use external ip check" is set to no, so that the router determines it's external IP and sends it - since it isn't connected directly, and therefore has no WAN address.

Apr 28, 2014

OpenELEC on the Asus Chromebox

First off I want to say, this was the best use of $179 in a while..just buy it:

ASUS CHROMEBOX-M004U Desktop

This box blows away my old Zotac ION - and it's fanless.  It kills on performance compared to the Raspberry Pi and Zotac ION, and it's small and portable, it's fanless, it boots very quick! I love it.

Disclaimer: All the information in this guide is completely taken from the following link:

http://wiki.xbmc.org/index.php?title=ASUS_Chromebox

But I have formatted it in the appropriate manner for myself to reference in future.

Follow this guide if you want to replace Chrome OS with OpenELEC and have it boot in automatically, I do not do the backup like the wiki, I create a backup USB after the fact on a Windows box, but you can do it from any OS it appears.  I have tested this backup and it works, so this is my preferred and quicker method.

+Matt DeVillier has updated the wiki to provide an all-in-one setup script for installing OpenELEC as default, or dual boot. You must still complete steps 1.1 and 1.2. 

1 Device Preparation

1.1 Put in Developer Mode

Putting the ChromeBox in developer mode will allow you to access the underlying Linux operating system features necessary for installing XBMC.

WARNING: This will erase all user data on the device.

With the device powered off:

  • Insert a paperclip into the hole left of the SD card slot and press the recovery button
  • Power on the device, then remove the paper clip.
  • When greeted with the recovery screen, press CTRL-D to enter developer mode.
  • Press the recovery button (with paperclip) to confirm.
  • The device will reboot and wipe any existing user data.

1.2 Disable Firmware Write Protect

Disabling the firmware write protect will allow us to set the firmware boot flags to shorten the developer boot screen timeout (from 30s to ~1s), and optionally boot directly to the legacy BIOS (and into Ubuntu or OpenELEC). This is not absolutely necessary, but highly convenient and carries little to no risk.
With the device powered off and unplugged:

  • Remove (4) rubber feet from bottom of unit
  • Remove (4) screws under rubber feet
  • Separate two halves of unit
  • Remove write-protect screw circled below:
  • Reassemble in reverse order

1.3 Update the Legacy BIOS

It is necessary to update the legacy BIOS to enable booting from USB/SD media, or if replacing ChromeOS with Ubuntu/OpenELEC, as the stock legacy BIOS is completely broken. If you dual booting and using either the ChrUbuntu or ChrOpenELEC scripts to install, then this step is included as part of those scripts and does not need to be done manually.

To update the legacy BIOS:

  • Power on and boot to ChromeOS
  • Hit CTRL-ALT-F2 to open a shell
  • Login with user chronos (no password required)
  • Download the updated legacy BIOS with the command:
    curl -L http://gdurl.com/EVKN/download -o seabios.bin
  • Flash the new bios with the command:
    sudo flashrom -w -i RW_LEGACY:seabios.bin


This updated legacy BIOS has a ~1.5s wait on the 'Press ECS to show boot menu' screen.

1.4 Set Developer Boot Flags

Setting the following boot flags will allow you to boot either to a backup copy of ChromeOS on USB/SD (using CTRL-U) or to the legacy BIOS (using CTRL-L) and into Ubuntu or OpenELEC.
Important: These boot flags must be set before installing either Ubuntu or OpenELEC.
To set the boot flags, perform the following steps:

  • Power off your ChromeBox, then power on but do not login.
  • Press CTRL-ALT-F2 to open a shell.
  • Login as user chronos, no password is needed.
  • Run the commands:
  • sudo crossystem dev_boot_usb=1
  • sudo crossystem dev_boot_legacy=1
  • Do not reset, proceed to section 1.5 - original wiki doesn't force you to do this, so if you want to change the commands later you appear to have to reinstall Chrome OS and do everything again.


1.5 Set Firmware Boot Flags

With the firmware write-protect disabled, we can shorten the default developer-mode boot wait time (from 30s to ~1s) and set the ChromeBox to default to booting the legacy BIOS (and into Ubuntu or OpenELEC) instead of requiring CTRL-D or CTRL-L to be pressed each time.


  • Power on and boot to ChromeOS
  • Hit CTRL-ALT-F2 to get to command prompt
  • Login with user chronos (no password required)

  • To shorten the boot wait time only, run the command:
    sudo set_gbb_flags.sh 0x1
    (This is the same as immediately pressing CTRL-D

  • To shorten the boot wait time and set the default boot to the legacy BIOS:
    sudo set_gbb_flags.sh 0x489
    (This is the same as immediately pressing CTRL-L)

  • To reset these options to default, use:
    sudo set_gbb_flags.sh 0x0



1.6 Create a Recovery Media for ChromeOS (on USB/SD)

Follow this guide:
https://support.google.com/chromebook/answer/1080595?hl=en

I corrupted my backup from the wiki, so this was my only option - but it is tested and works.

2 Installing OpenELEC


In order to install OpenELEC, you'll need to download a custom build tailored to the ChromeBox. This build differs from the regular OpenELEC Generic x86_64 build in that it uses a slightly older version of the syslinux bootloader (5.10, vs 6.02), as the version included with OpenELEC does not work properly on the ChromeBox at this time. This custom build also includes a fix for some MCE IR remotes, which fail to work when connected to USB 3.0 ports (fix has been submitted as a patch and hopefully will be included in future Linux and OpenELEC releases).

2.1 Installation steps:

Download the custom build of OpenELEC from http://gdurl.com/qnDc/download

Once downloaded, unzip/extract the files.

  • Insert a USB stick and run the create_installstick installer.
  • See the OpenELEC wiki instructions for more details on creating the USB installation media.
  • Power off your ChomeBox. Insert the USB/SD installation media.
  • Power on and press CTRL-L to boot to legacy BIOS
  • Press ESC to bring up the boot menu and select the number corresponding to your USB installation media
  • The OpenELEC installer will load
  • Choose the 'Quick Install' menu option
  • Select the target disk for install (the internal HDD should be the only option presented)
  • Hit Yes/Ok to the prompts confirming that the target disk will be erased/overwritten
  • When the installer has finished, remove the installation media and select Reboot.


If you have set the firmware boot flags as above, OpenELEC should boot right up in about 15 seconds. Otherwise, you will need to hit CTRL-L to boot the legacy BIOS.

That's it, you can update to the latest official OpenELEC build. Afterwards, updates should be automatic.

Update:  Please check the following location for a list of known issues an their available workarounds:
http://wiki.xbmc.org/index.php?title=ASUS_Chromebox#Known_issues_.2B_Fixes.2FWorkarounds