Monday, January 31, 2011

Sansa Clip Plus on Ubuntu 10.04

Problem:I had some trouble with my Sansa on Ubuntu.  I could see it as a drive, but I couldn't access it. 

Solution:  Update the firmware.  If you have a windows computer, you can get the most recent firmware update that way.  There may be a way to load in Linux as well.

After that, you can use it as a drive in Ubuntu.  To do this, go to settings -> system -> usb -> MSC on the device.  Alternatively, you can select MTP to use it through your media player's interface, but this seems kind of clunky to me.

Extra Credit:
I keep my files on a honking FreeNAS media server which has lots of wonderful redundancy which I access through NFS.  I didn't want to mess about with a media player to sort and load the files, but I did want something that could only get my more recent files (anything from the last year) and load them.  My solution was simple, create a shell script to do it.

Here is the code.  In the revised version, I added an optional command line argument for the number of days so it isn't locked to 365.

The code messes with $IFS to handle spaces in names, creates a directory to hold the files locally, finds files in a 2 directory deep structure which are 365 days old or newer, and then copies those files to the local directory.  After that, it copies those local files to the player (removing asterices in the file name in the process).  When done, it deletes the local directory before exiting.

Feel free to modify this code and distribute it as you will.  It would be a lot more flexible with arguments to provide the mp3 folder path, local path, and media player path.  Also, users may want to skip the step of intermediate copying if they store their files locally already.  If you do keep your files right on your PC, I can't warn enough about the necessity of backups.

Monday, January 24, 2011

Consolidating Your Pile of Home Theater Remotes

The problem, you have a pile of remotes to go with all your components.  This can get irritating and unmanageable in a hurry.  The good news is that there are a lot of options out there to replace your pile of remotes, but the bad news is that finding the right one may drive you up a wall.  In selecting a remote there are a number of important features you should consider.


This is the most obvious feature.  You can't do much if you don't have the right buttons, and you'll want to find a button that has similarly labeled buttons to those on your oem remotes so you don't end up assigning existing functions to illogically labeled buttons.  If price is no object, you can even opt for crazy touchscreen remotes with customizable button layouts.  Some remotes have a half-way solution using a screen where you can apply labels to adjacent buttons.


Every universal remote around can use hand-entered numeric codes or search through a list of built-in codes to find one which is pre-set for a device like yours.  This is great if you only by on-brand electronics which use popular existing codes.  If you get something off brand or want to control some other odd IR device like an HDMI switch or lighting system, then this may be your best choice.  With this feature, the new remote can record the IR output triggered by a button on your existing remote to one of its own buttons. 


This feature lets you program a sequence of commands to be triggered by a certain button.  This gives you the ability to do some pretty neat stuff at the push of a button like turn devices on or off, navigate menus, or switch modes.  Many remotes even let you use learned buttons in macros as well.  Be aware that lower cost remotes may have very small limits on the number of commands per macro or lack control of pauses such that the macro might finish before a device has time to turn on completely and become responsive to remote signals.


A screen can make it much easier to program a remote since you don't need external paper manuals to enter codes and can just select your device from a menu to program them.  However, screens may decrease durability and battery life substantially.  Because of rapid battery drain, many of these remotes include charging docks which bring their own issues (contact corrosion).  However, touch screens can add substantial flexibility to user interface of the remote control.


Some remotes can fire off radio signals in addition to or rather than infrared (IR) signals.  The advantage is that RF has no line-of-sight requirement.  These RF signals can be converted to IR by a box which can "shine" those IR signals at your components.  This means you can hide your components in a closet or another room if you want, and you'll never have to worry about aim again.


You can spend anywhere from ten bucks to several thousand on remotes, but you don't have to break the bank.  There are remotes around $20 with learning and macro capabilities, and many under $100 which have screens and can be programmed via PC.

My suggestions for various price ranges up to $100 include:

$20 Sony RMVL600 (learning, 16 command macros, 8
$25 One For All OARI06G

$25 One For All OARI06G (learning, 15 command macros, modern button layout)

$40 URC RF10 (very good learning storage, and 10 macros with 55 steps each, one line monchrome lcd, and RF)

$80 URC RF20 bundle  (extensive learning storage, 190 step macros, monochrome lcd, RF and remote IR emitter included!)

$90 URC-R50 (18 devices, extensive learning storage, 255 step macros, color screen)

I don't like spending a lot on remotes, so I can't provide much first hand advice on remotes over $100.  However, you can get good advice at remotecentral.  If you just need a general remote and simple macros, the Sony would suit you.  It's learning works very well even with somewhat longer IR commands than other remotes can handle in it's price range and you can take advantage of this to have it learn two buttons onto one.  For a more updated button layout like you might have on your DVR remote, the One For All may be better. 

The URC remotes are generally a very good value for less than $100.  They introduce serious macro and learning capabilities with very minimal limitation.  They also have models with built-in RF capabilities and screens.  An alternative to URC is the Harmony remotes by Logitech, but you generally won't get as much in the learning/macro department for the money.

Anyway, now you have a launching point to start your own search for your perfect remote.  As you gain more familiarity with advanced remotes, you may consider delving into advanced topics like JP1 remotes and hex IR code programming.  Good luck.

Thursday, January 13, 2011

HOWTO: Free VOIP On An Android Phone

THERE IS A NEWER/BETTER WAY TO DO THIS DOCUMENTED HERE. It does reference some of the material below though since some steps are unchanged.  


Recently I wanted to replace my work cell phone with a good voice over IP (VOIP) solution that would work on my regular personal cell phone.  I work from home, so I have plenty of bandwidth through my wireless router (though it can work fine on 3G or better), and I don't like having to juggle multiple cell phones.

The solution I will provide you takes some fairly involved setup, but the end result is totally free incoming and outgoing calls which work fairly seamlessly on your Android smart phone.  This solution will let you talk up to 2000 minutes per month for no charge.

Required Tools:
Google Voice Account Account
ipkall Account
SIPDroid Android App
Google Voice Callback Android App

1.Set up PBXes
Sign up for an account.  Then go to add extension and click SIP.  Pick any extension number you desire.  You can come back later to set up voicemail how you want.

Next, go to ring groups and create one for your extension (the number you used in the last step).

The final step in PBX setup is to configure the inbound route.  The trunk is your pbx account username and extension number separated by a hyphen.

I chopped out some unnecessary stuff here.

Note that PBXes free accounts are limited to 2000 minutes per month.

2. IPKALL setup
Ipkall provides a real telephone number where people can reach you.  This is free for you because IPKALL makes money off termination charges from incoming calls.  The numbers are based in various Washington state area codes.  Use the password from the pbxes sip extension information.

Make sure you enter the same info you used as the trunk name in the inbound route screen.  Pick any area code you like.  After you submit and they approve it, you will get your new phone number via e-mail.

3.Set Up SIPDroid
SIPDroid is free and works great with pbxes.  I am sure there are other SIP clients for Android which are quite good as well.

Menu -> Settings -> SIP Account:
username: username-200    
password:  password
server or proxy:
Note the username and password are the same as those used for ipkall.  Other settings can be left at default.

You will also want to set the preferred call type to "Phone" in Menu -> Settings -> Call Options -> Preferred Call Type.  Otherwise your phone will try to use the SIP account to whenever you dial any number which won't work.

You may want to examine other settings to control how SIPDroid works depending on your data connection (wifi vs 3G), which audio codecs to use, etc.  If everything is working, SIPDroid will show a green dot in your status bar.

Now you are all set up to receive incoming calls, and you could stop here if that was all you wanted to do.  However, I assume most of you will want to call out.  If so, read on.

4.Configure Google Voice

Google voice is needed for outbound calling.  You have set up everything for inbound calling from that IPKALL number, but you have no way to place calls.  Google voice can do a web dial where it calls your ipkall number and then connects to the party you are trying to reach.  This sounds like a PITA, but it is quite transparent once set up. 

Sign up for google voice, and get a google voice phone number.  Then go to settings -> voice settings -> add a new phone.  Now enter your ipkall number (instead of 555-5555).

When you click save, a box will pop up for verifying your phone number.  It will contain a two digit code in a text box which you have to enter when google voice calls you.  If you are lucky, you won't have trouble using the dialer on SIPDroid to enter the code.  I was not so lucky, but I have had problems even on a real cell phone when trying to verify google voice.  The workaround is to put the phone on speakerphone mode and hold the mic up to your computer speaker where you play the appropriate tones.  You can go to this site to generate the tones into a sound file to play back, and this worked for me.  If you have no luck, cancel out of the verification pop up and then try saving again with another code.   Some people had luck holding a house phone up to the mic to generate the tones.  In any event, once it is done the number will be saved.

Now you can test everything out by clicking call and initiating a phone call on the google voice web interface (from a computer).  Obviously this isn't very practical since you can only initiate calls from the site.  If you aren't using the google voice app, don't bother installing it just for dialing.  It can initiate a web dial (like we just did), but it is only set up to work for incoming calls on your normal cell line and will fail if you are connecting with SIPDroid.  Luckily, an independent developer has made a very nice app that does just what we need called Google Voice Callback.

5.Google Voice Callback (please get the paid version if you like it)

After you get this Android app, it is pretty easy to set up.
1.Enter your google voice login information (or the app can obtain it from your google account info entered in the phone already).
2.Choose your ipkall number as your callback number.
3.This app will allow you to customize which calls should initiate a GV web dial to your SIP client instead of a normal call.  You can set all, none, or custom filter rules.

For me, I only wanted numbers starting with a certain area code to be dialed through SIPDroid.   So under the custom filter rules, I set a default action of "Do not use GV" and added a rule called "555" with action include and pattern 555*.  When I call out using the normal phone dialer, it will call normally or trigger a VOIP call when I call a 555 number.  This is all fairly seamless, and the only difference you will notice from a regular call is a little pop up while this app logs into google voice and initiates the call for a few seconds.  After that, your sip client will ring and you can enjoy your free SIP calls.

You can also set all US numbers, specific phone numbers, or ask on certain numbers.  Have fun.