Posted by: cielo | February 19, 2009

Using Snatch as a Plex Remote: Revisited

Being a seasoned Plex user, I start to chuckle when I think about how I once swore off the app out of frustration, having not yet learned all the keyboard shortcuts. Plex just has too many features to get anything accomplished from the minimalistic Apple remote, and a keyboard has no place in the living room as far as I’m concerned. When I got my iPhone, I became enamoured with the idea of a do-it-all device, and started trying out all the available remote control apps out there. I finally found one that met my needs, and it has become an integral part of my Plex experience.

Snatch, anyone?

When Snatch came out, the remote control aspect was more of an afterthought, with it’s primary features being the mouse trackpad and full function keyboard. But the ability to create custom buttons and program them to a keyboard stroke was what got my attention. I was able to create a pretty decent remote for controlling Plex, and while not very graphically pleasing, it worked pretty well. I started keeping a regular stream of communication with Snatch’s developer, Dan, suggesting ways that the remote aspect of the app might be improved. Dan was very receptive to the feedback that he received from the public, and Snatch has really evolved into a great app, especially after the latest release.

One of the new features is the ability to load an image to be used as a button in the remote. This was a great step, but still limits you to a very angular design. But, thanks to another new feature- the ability to set the opacity of the buttons down to zero- I was able to design a remote screen as a whole, rather than button-by-button.

The basic concept is this: I made one button that completely fills the screen and loaded in a single graphic of the whole remote. I then created completely transparent buttons to overlay their graphic counterparts on the “background” button. Getting everything properly aligned on the iPhone screen turned out to be rather tedious, so I instead figured out all the numbers and went into the xml file and edited it manually.

Another great new feature of Snatch is to be able to save and load remote screens to and from your computer. This means that Snatch users can easily share their custom remote creations with others. There is a page on the Snatch website where you can download the remotes that I and others have created.

I decided that there were way too many useful features in Plex to be crammed into a single remote screen, and so created two screens. Snatch now lets you easily swipe side to side between your remote screens, so using the two together is actually very fluid. The first screen has all the main controls such as Play, Pause, Stop, the navigation arrows, and a few other key features that I find myself using often. The second remote contains shortcuts to the various places that you would need to navigate to within Plex, but at the single press of a button, rather than having to backtrack out of the menu structure to the home screen before going anywhere. These functions are not all to be found in the Plex’s keymap files, and so require adding a small customized xml file to Plex’s user files.

OK, enough with the verbiage, Let’s see the remotes!

Here are screenshots of the two remote screens:

main plex remote screen

Plex Remote - main screen

Plex Remote - shortcut screen

Plex Remote - shortcut screen

What do all those buttons do, anyway?

Here are the screenshots again, but with their functions. The second screen obviously already has descriptors on screen for most of the buttons, so…well, you get the idea.

main screen functions

main screen functions

shortcut screen functions

shortcut screen functions

The Plex button that is on both screens not only launches Plex, but also brings focus to it if you have left to check your e-mail or browse the Plex forums to see if your favorite bug has been fixed yet. The two red buttons, ‘A’ and ‘B’,  are meant to be user definable, though I made them default to launching iTunes and DVD player. I have mine set to wake and sleep my media server. Originally, while in fullscreen video, you could press ‘return’ to bring up the OSD, which has many important controls for your videos (subtitles, interlacing, etc), so the ‘Play’ button had this dual function. However, with the latest Plex release, they changed the ‘return’ key to pause the video instead. This makes much more sense, but I had already designed the remote, and there was no more room for another button. I found a good work-around for this, which is included in the custom xml file that I created for the second remote screen. It basically assigns the menu button to also bring up the OSD while watching a video. This actually makes a fair amount of sense, since the functions are similar, and the menu button had no use during fullscreen playback.

OK, I’m sold! How can I get this?

First, and rather obviously, you need to purchase the app Snatch from the iTunes store and install it on your iPhone. It is a bit more expensive than a lot of apps at $5.99, but I think it’s worth it. For Snatch to be able to communicate with your computer, you also need to download and install Snatch Server on your computer, which is a free download available on the Snatch website. Follow the instructions in the Snatch user manual for getting everything set up. Once you’re up and running, you can go on to the next step.

Download the two remote screen files and the custom xml file, and save them some place accessible, like your desktop.

Plex Remote – main screen

Plex Remote – shortcut screen

Custom keyboard xml file (right click and ‘save link as’)

To load up the screens, launch Snatch on your iPhone and make sure it’s connected to Snatch Server. Go to the custom remotes section of Snatch, which is rather cryptically under the ‘Keys’ tab. Press the ‘Edit’ button in the bottom right corner. Then choose ‘Load Screen’. A window should pop up on your computer asking you to select a file. Choose one of the remote screen files you downloaded, which should end in a .remote extension. Click OK, and your iPhone will ask you to confirm that you want to load the screen. Accept, and your screen will be loaded and almost ready to use. Repeat for the second screen.

Just a tip– I have had a bug appear a few times where when you go to load the screen, the dialog flashes only for a millisecond on the screen and instantly disappears. The iPhone sits there, stuck on “waiting for the file” or whatever it says. Relaunching Snatch and Snatch Server doesn’t seem to help. I found that deleting the com.hoofien.snatchserver.plist file from the User/Library/Preferences folder and restarting Snatch clears the problem up. Dan has not been able to reproduce this bug, and so is unable to troubleshoot it. Hopefully this will be fixed in the future.

Now, you need to load the custom keymap file into Plex. In ~/Library/Application Support/Plex/, create a folder called ‘keymaps’ if you don’t have one already. (BTW, “~” refers to your username folder.) Just drop the keyboard.xml file in there, and Plex should start to use your custom definitions the next time it’s launched. If you already had a custom keymap file going, you can simply cut and paste the additional defintions from this file into your existing one.

OK, you should be good to go. But what if you want to change the red ‘A’ and ‘B’ buttons to do something different?

Just bring up the remote screen on your iPhone and select the edit button. Everything should have a grid on it and start jiggling around. Select the button you want to change, and a green dot will appear on it. Just make sure that you DO NOT hit the ‘X’ on the button, becuase this will make it go bye-bye. Once you see the green dot, choose ‘Record’ from the top of the screen. The keyboard will pop up, and you can program any combination of keystrokes that you’d like. You can also go into the launchpad screen and launch an application, and the button will remember that. If you really want to get crazy, you can even program a button with mouse movements, but I honestly haven’t figured out a good use for that, other than messing with someone. Once you have recorded the desired actions of the button, hit ‘finish’ in the top right corner. Then program another button, or hit “Done” to finish.

Just a tip– if you accidentally hit the background button while trying to program another one, all the other buttons will disappear behind the background. To bring them back to the front, just double tap it, and it will send the background back to the back.

That’s it!

You now have a rockin’ Plex remote, that’s not only very functional, but it looks good too!

Enjoy.

Posted by: cielo | February 4, 2009

Wake and Sleep a Media Server from your iPhone

In a previous post, “3 Ways to Control a Headless Server From Your Dock“, I detailed ways of waking/sleeping a server, and mounting the desired volume easily from one’s dock. I use my iPhone as a remote for my HTPC, so it was only a matter of time before I found a way to do it from the comfort of my couch. Plus, the app that I was using, “Wake on LAN”, was proving to be a bit buggy.

While Wake on LAN has some great features such as scanning your entire network, and storing your passwords in Keychain, I would gladly trade it all in for something that works consistently. The problem that I had with WOL was that my Keychain password for my server magically disappeared every time I restarted WOL. I tried to get around this by leaving WOL running all the time, and while this took care of the password issue, there were still quite a few instances where the app didn’t work for other mysterious reasons. I contacted the devs at ReadPixel, and they claimed that the password issue was on Apple’s end, not theirs. Be that as it may, it doesn’t make me want to use the app, especially when there’s a working alternative.

One of the main requirements that I had for a working sleep/wake solution, was to use Applescript in the implementation. I am using the app “Snatch” as a remote for my Plex based media center, and had already integrated some other AppleScripts into the process using another app called “Fastscripts Lite“. Looking around, I found a couple of scripts to do what I needed, and it took only a few moments to add their functionality to my existing remote.

The only downside to my method, is it requires hard-coding the server’s password into the sleep script. However, since this is only being sent within my local network, and behind both hardware and software firewalls, I’m not too concerned about the security issues that it may pose.

The first goal: wake a sleeping server, and mount the volume that contains my media.

I found an Applescript written by Mark Muir, that sends a ‘magic packet’ to a sleeping computer, signaling it to wake up. The basic concept behind this is that it sends this packet of data over your network 16 times in a row, and if your computer has ‘Wake on LAN’ capabilities, it will respond. To enable this functionality on a Mac, simply check “Remote Apple Events” under Preferences>Sharing on the computer you wish to wake.

Mark Muir’s original script, which you can view HERE, contained a dialog box allowing you to input the MAC address of the machine you wanted to wake. Since I was only wanting to wake a single machine, I modified the script to skip the dialog step, and just get down to business. I also added a line to mount the volume with my media, near the end of the script. Here’s the modified script that I used:

property MAC_address : "00:1d:0a:7d:69:42"
property WAN_IP_address : "255.255.255.255"
on run
set command to "/usr/bin/php -r " & quoted form of ("$mac = " & quoted form of MAC_address & "; $ip = " & quoted form of WAN_IP_address & "; " & "
$mac_bytes = explode(\":\", $mac);
$mac_addr = \"\";
for ($i=0; $i<6; $i++)
$mac_addr .= chr(hexdec($mac_bytes[$i]));
$packet = \"\";
for ($i=0; $i<6; $i++) /*6x 0xFF*/
$packet .= chr(255);
for ($i=0; $i<16; $i++) /*16x MAC address*/
$packet .= $mac_addr;
$port = 9;
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_set_option($sock, SOL_SOCKET, SO_BROADCAST, TRUE);
socket_sendto($sock, $packet, strlen($packet), 0, $ip, $port);
socket_close($sock);
")
do shell script command
mount volume "afp://190.168.1.1/mediaDisk"
end run

Of course, I put in a nonsense ip address and MAC address in this example, so you would need to change it out with your specific info.

The second goal: Put the server to sleep when I’m done.

This script is much simpler. Here is the basic format. You obviously need to replace name, password, and the ip address with the proper info.

do shell script (“hdiutil unmount /Volumes/MediaDisk“)

tell application "finder" of machine "eppc://name:password@192.168.1.1" to sleep

I should mention that the sleep script will not compile correctly if the machine in question is not on and running while you are creating the Applescript. In fact, it will not even open up in script editor if the specified volume is not mounted. It took me several frustrating hours to figure out why it would not work properly. Grrrr…

To get up and running, copy each script into Script Editor, insert your ip address, user name,  password, and volume name where required. I have colored the parts of the scripts that you need to change with your info in green. Then compile the scripts and save them in Username>Library>Scripts folder. (you may have to create the folder if it does not exist). Link up the scripts to the desired keyboard keys in Fastscripts Lite, and create a couple of buttons in Snatch. For more detailed directions on how to accomplish this, see the example in this wiki.

Here’s a screenshot of the Snatch remote screen on my iPhone whose sole purpose is only to wake and sleep the server:

photo

This works wonderfully with the custom remote that I have created for Plex:

snatch-shot

Well, there you go. Wake or Sleep at the press of a button. How much easier can it get?

Posted by: cielo | January 22, 2009

The HackBook Nano

This is actually a project that was mostly completed a few months ago, but I was waiting to post pictures until I got one more thing ironed out. Now that that last detail is taken care of, here you go.

wind1

wind2

This thing started out life as an MSI Wind, and came with Windows XP installed on it. But, being the compassionate sort of person that I am, I liberated the poor machine by installing Leopard on it.

I originally set it up as a triple boot with XP, OS X, and Ubuntu, and named it “Triple Booty”.

Hey, that’s booty as in pirate’s booty, not as in booty call. After all, I’m a pirate, not a playa’ !

But alas, the thrill of having three operating systems running on a netbook was soon overtaken by my dislike for the drab and rather uninviting appearance of the Grub Bootloader screen. And having had more experience doing a boot-132 install, I opted for a fresh and clean Vanilla kernel, rather than the hacked WindOSX86 distro that I had first tried out. So now, its just a HackBook Nano.

I had seen some custom stickers floating around for adorning one’s hacked MSI Wind, but liking a graphic design challenge, I set out to create my own version. I came up with these:

windosx86blue_long2

wind5

wind4

windosx86blue

I had originally slapped one of the countless stock Apple stickers that I have acquired with each Apple purchase on the front of the computer to cover up the MSI logo. But, it just looked like, well, what it was- a sticker some guy had haphazardly slapped on there. I wasn’t too happy with that, so I created a better looking and more pirate-like design, and had a professional sign maker cut it out of vinyl for me. There, that’s better!

wind6

This satisfied my penchant for aesthetics for about a day. I decided that it was missing the Myriad Pro Semi-Bold Proclamation of Profligacy that adorns the front of every real Mac laptop. I again went to the sign-maker with my latest crazy request. He gave it a shot, but apparently cutting 20 point font out of vinyl is not the easiest task. Well, to be exact, cutting it is no problem, but weeding the excess vinyl from around the cut design is a bit tedious. After a bunch of wasted vinyl, the sign-maker, liking a challenge every bit as I do, ordered a batch of higher quality vinyl, and gave it another go. The next batch went better, but was still a bear to weed. Only a small fraction of them were even usable, and then the application process was it’s own can o’worms. After three tries however, I got it on to my satisfaction. Not perfect mind, you, but it still looks good enough to turn some heads at the local coffee shop.

wind3

So, other than the stickers and the boot-132 install, the only other modifications I had to make was upgrading the RAM to 2GB, and adding in a Mac compatible wifi card. Some industrious guys on the MSI Wind forum convinced the equally industrious (and apparently bored) guys at Realtech to write a custom driver to enable the stock wifi card to work with OS X. However, it involves using some crappy utility in order to configure and use your wifi options, rather than Leopard’s built in AirPort preferences. I think the $45 I spent on the Dell 1505 Draft N card was money well spent. For some reason or another, this Dell card is seen by OS X as a native AirPort card. I did have to remove a pesky mounting post from the mobo of the Wind that was in the way, but it was a relatively simple task . There is now a Dell 1510 half height wifi card that does not require removing this post. Of course, news of this came about a week after I had already installed mine.

There is one issue with the Wind using OS X. The headphones and mic jacks do not work out-of-box. Someone wrote a great little app that allows the headphone jack to work (originally for the Asus EEEPC), but in order to use a mic, you need a USB dongle. No big deal. The Voodoo team is claiming to be only days away from releasing a driver that will enable both headphones and mic to work properly within Leopard. It will be interesting to see how that plays out.

wind7

Well, hope you like the project. It sure was fun. I just played with one of the new unibody MacBooks yesterday, and in spite of only having the option for the glossy-screen-from-hell and the lack of a FireWire port, its a damn sexy and tempting machine. I have barely gotten my HackBook Nano broken in, and I’m already considering retiring it in favor of one of the new MacBooks.

Its a tough decision, but one that will have to wait until later. Right now, I’m gonna go get me some booty! And I ain’t talkin’ bout no doubloons! Beyotch! uh, I mean, Aaargh!

For more information on how you too can make your own HackBook Nano, check out the MSI Wind Forums.

Posted by: cielo | January 13, 2009

World’s Smallest Mac Coming Soon, High Def Ready!

At the end of 2008, NVIDIA announced it’s fusion of the Intel Atom 330 CPU and the 9400m graphics chipset, dubbed the Ion. Despite the two companies’ long standing playground rivalry, it looks like the ultra tiny set top computers and netbooks containing the unlikely combination will be in the hands of consumers “midway through 2009”, according to Gizmodo. Ever since NVIDIA officially unveiled the platform at CES a couple of days ago, giving the tech world it’s first chance to see the Ion up close and in person, the internet is aflood with excitement regarding this latest advance in the tiny computer craze.

The NVIDIA 9400m is the very same GPU that recently made its way into Apple’s MacBook line, and the Atom 330 is the processor that is at the heart of the HackBox Media Server that I just finished building. What does this mean? That this thing will make the perfect Mac Nano! While lacking some of the processing power of the Mac Mini (which already leaves something to be desired), the NVIDIA graphics chip is light years ahead of the infamous GMA 950. So, imagine a Mac Mini that is half the size, half the price, dual displays including the option for HDMI, and more than capable of outputting full 1080p high definition video, and you’ve got the Ion. Now we just need a sexier case to put that thing into. Or, we can always hide it behind the remote control.

« Newer Posts - Older Posts »

Categories