The iPhone Hotel Room Baby Monitor, part 2

Posted by Johnathan at 10:14 pm, December 2, 2008

In order to use the iPhone Hotel Room Baby Monitor setup I described in part 1 in situations when you’re not behind a friendly router (such as in an actual hotel room), a little advance preparation is required. You’ll need a computer on your home network that you can leave on (or one that you already do) . That computer will need to be running an SSH server (sshd). You’ll also need to know the public IP address of your home network, that is, the IP address assigned by your ISP to your router that’s serving as your home’s internet gateway. Lastly, you’ll need to forward ports for both SSH and the audio stream from your router to your always-on computer. If you’ve got all of that, you’ll be able to establish a secure tunnel from your home to your laptop, and expose your audio stream to the internet, and thus to your iPhone.

As before, I’ll illustrate by using my own equipment, and leave it to you to adapt the instructions to your setup. 

I have a Mac Mini at home that I keep running all the time (set to never sleep or spin down the hard drives). In its System Preferences -> Sharing panel, I have enabled Remote Login, which runs sshd, the SSH server.

System Preferences, Sharing tab

System Preferences, Sharing tab

This allows my Mac Mini to accept SSH connections using a valid username and password for this computer.

To connect to this computer from outside my home network, I’ll need to know how to reach my home network from the internet. You can find the IP address by checking your router’s administration utility (usually just a web page at its LAN address); typical names are “WAN address” or “Internet address”. Consult your router’s documentation for guidance here.  Mine is right on my router’s main dashboard page.

Locating your internet IP address

Locating your internet IP address

Now keep in mind that with most ISPs, unless you’re paying extra for a static IP address, this address will change periodically. We’re not talking that frequently, so if you check the address before you leave, you’ll probably be okay, but no promises. Alternatively, you can (and should) use a free service like the excellent DynDNS to track your dynamic IP, allowing you to use a consistent and easy-to-remember domain name (such as yourname.dyndns.org) instead of a periodically changing set of numbers. It doesn’t take much to get the service running, and it’ll simplify your life if you regularly need to access your home network from the road.

Now you know how to reach your home router, but how to get to your computers behind the router? This is accomplished through another feature of your router called port forwarding (or “enable applications” or some other term; again, check your documentation). You’ll need to forward TCP connections on port 22 to port 22 of the computer you always leave on, and TCP connections from port 8000 to port 8000 of the computer you always leave on. (You may choose to use different port configurations if it suits your needs; those to whom this applies don’t need me to tell them.)

With all of this preparatory work, the magic can happen when you’re on the road. Let’s say you’re out at your hotel room and want to launch the iPhone Hotel Room Baby Monitor. You have Nicecast running as described earlier. Now, open Terminal (in Applications/Utilities) and type the following to make the SSH connection and establish the tunnel from your home to your laptop:

ssh your_username@your_home_ip_address_or_domain_name -R 8000:localhost:8000

If you’ve never connected before, you’ll get a warning. Accept, then provide your password, and you’ll be treated to a command line prompt from your home computer. You won’t need that, so just minimize but don’t close that window (if you close it, the connection will be broken, and you’ll need to reconnect). The SSH server at your home is now dutifully passing all requests to listen to its own port 8000 to port 8000 of your laptop, which not coincidentally just happens to be where Nicecast will be providing the audio stream. And because your home router is also forwarding port 8000 requests to port 8000 of your home computer, pointing the Tuner application on your iPhone to your_home_ip_address_or_domain_name:8000 will play the audio stream generated from your laptop (by way of your home computer and router). Awesome!

Granted, there are a lot of parts here, and it might be daunting to a novice. But this is very useful stuff to know for a variety of potential uses with many other applications. And feel free to shoot me an email or leave a comment if you have a question. Also, you can test your setup while still at home, just to see if it’ll work before you’re outside of your home network and have no way of fixing it. Just make sure that when you test, you configure your router’s port forwarding for port 22 and port 8000 before you launch Nicecast. If you don’t, Nicecast may configure your router automatically, pointing 8000 right to your laptop, leaving out the other computer entirely. That’s convenient when at home, but that’s not how it’ll work when you’re on the road, so get that port forwarding configured as described above so it’ll be usable when away from home.

Filed under: Technology
The iPhone Hotel Room Baby Monitor, part 1

Posted by Johnathan at 9:34 am, November 30, 2008

I had a cool idea the other night. My wife and I have been in hotels with the kids before, feeling trapped in the room once they’ve gone to bed. You’re stuck because you can’t leave them unmonitored, and you can’t make noise inside the room, because you’re in close quarters with a bunch of sleeping kids. Regular baby monitors are unlikely to have the range required to monitor your kiddies while you’re in the lounge down the hall. So what’s the answer? Turn your laptop into a streaming internet radio server and tune in with your iPhone.

I’ll describe how I put it together with the hardware and software I already owned, and you can probably modify the set-up to your own needs. On the laptop side, I used my 17″ MacBook Pro running the superb $40 Nicecast from Rogue Amoeba.  Nicecast takes an audio source of your choice, such as your laptop’s internal microphone, or an application such as iTunes, and will serve a live radio stream of that audio source. (Nicecast will also relay the audio to a dedicated streaming audio service such as Live365. I’m assuming that if you have or are willing to pay $10 a month for such an account, you probably know how to do this already.) Because we’re not looking for high fidelity here, dialing the bitrate down to 24Kbps on Nicecast’s “Quality” tab will conserve some bandwidth, making the stream more palatable for use over AT&T’s data network. It won’t kill you to conserve CPU as well.

Nicecast Quality tab

Nicecast Quality tab

Pick “Audio Device” from the “Source” menu, 

Nicecast Source tab

Nicecast Source tab

mute the volume (laptop feedback won’t help a sleeping baby!), and click “Start Broadcast”. The on-air level monitor should be responsive to room sounds.

Nicecast main window

Nicecast main window

On the receiver side, I use my 3G iPhone and the app Tuner by Nullriver. Tuner can listen to a streamed mp3 source such as the one generated by Nicecast. In Tuner, tap the “Search” tab, then the “Open” button.

Tuner Open Stream pane

Tuner Open Stream pane

That’s where you’ll be able to enter the URL of the Nicecast stream (or technically a playlist file referencing the stream), which Nicecast helpfully provides on its “Share” tab.

 

Nicecast Share tab

Nicecast Share tab

Now under some circumstances, that might be all it takes to start listening to your laptop’s mic from anyplace in the world you can get a data connection on your iPhone. In particular, if your laptop is behind a router that provides UPnP or NAT-PMP, Nicecast will automatically configure it so that your stream will be exposed to the internet at the URL listed under “Internet” on the Share tab. But this is not likely to be the case if you’re on the road, using commercially provided internet access. Part 2 will discuss how to overcome this limitation.

Filed under: Technology
Ah, the memories…

Posted by Johnathan at 2:22 pm, November 24, 2008

Can’t wait to boot into OS9 on the rebuit iMac and install this baby…

Filed under: Music and Technology and Wonders
An On-Record Prediction

Posted by Johnathan at 9:33 am, November 17, 2008

In five years, in late 2013, the notion of a global scientific consensus about the severity of global warming will be shattered, and governments will no longer introduce legislation to limit carbon emissions.  I know I’m not the first to say this, but I’m just going on record.

Filed under: Current Events and Freedom and Reason
Who says I can’t be on two missions?

Posted by Johnathan at 11:27 pm, November 13, 2008

I’m a man on a mission.  Or I guess multiple missions.  One is my very gently ramping up mission to save the world.  But I have another mission with a slightly tighter focus.

In 1995, The Residents and Voyager release a CD-ROM interactive “game” of sorts called Freak Show.  My friend Joe (who worked for Voyager although I’m not sure if he did at that time — it was through Joe’s Voyager connection that I got my hands on a LaserDisc player which allowed me to play a Japanese pressing of Disney’s “Song Of The South”) owned it and showed it to me one evening.  It was just the sort of creepily interesting presentation that tends to get under my skin.

I only saw it once or twice, but there was one part that I couldn’t forget, and haven’t forgotten for all these years since: A short musical phrase played in a loop of 5/4 time in Wanda the Worm Woman’s trailer.  You clicked on the candles in a candelabra to light them, and once all lit, a portrait on the wall smiled, the texture of the musical loop thickened, and a woman’s voice repeated with the loop “Watch me, watch me”.

I’ve found no reference to this tableau on the internet.  The phrase “Watch me watch me watch me” is part of the lyrics to the song about Wanda in the companion album, but that’s not what’s captured my imagination.  

So on to my mission.  I’ve got a working original Bondi-Blue iMac, the OS 8 install discs, and I’m still close with Joe and family.  Hopefully he still has the disc and it’ll play on that configuration (check out Freak Show’s requirements: “Macintosh - 25 MHz 68030 processor or better; System 7; 5,000K of available RAM; 13″ color monitor; CD-ROM drive (double-speed recommended)”).

Once it’s up and running, I almost hope to discover that I imagined the whole thing.  But I didn’t, I know I didn’t.  I’d like to record the audio I’ve referred to, and possibly find a way to take a few screen shots.  Then I’ll post these artifacts of forgotten technological beauty right here.  I hope you’ll enjoy it.

Filed under: Music and Technology and Wonders
“…they’re not hurting anybody…”

Posted by Johnathan at 1:29 pm, November 11, 2008

Speaking of Proposition 8, I was having a quick conversation the other day with a dear friend in California about the success of the ballot measure.  She had worked for its defeat, and was understandably dismayed by the results, given that her preferred presidential candidate won California so handily.  She had said (and I’m paraphrasing broadly because I never remember exactly what people say) “But why wouldn’t people just let [homosexual couples] marry?  It’s not like they’re hurting anybody else…”.

How quaint.  Would that “not hurting anybody” was a defense against the majority imposing its will upon you.  How many of Obama’s supporters, or McCain’s supporters for that matter, think that such a defense is permissible in the economic sphere?  How many of McCain’s supporters, or Obama’s supporters for that matter, would accept that as a justification for bucking “public morals” (whatever their conception of such consists of)?

How long ago did the majority of Americans forget the value of freedom as a principle?  They pay lip service to it, but abandon it at the first sign they think there’s something to be forcibly gained from their neighbors.  Most people, even Californians, still think homosexuality is wrong.  Why not just insist their neighbors fall in line?  Isn’t that what democracy is about?

Finally, a celebrity protest I can get behind!

Posted by Johnathan at 6:50 pm, November 8, 2008

(cross-posted at GoingJohnGalt.org)

While I certainly hope the travesty of California’s Proposition 8 is short-lived, it will be something to see if celebrities stick to their guns in case the injustice continues.  I would love to see a tax showdown, but I fear that the State of California will have to crack down just on principle.  Anything that gives people the idea that they can alter their own tax obligation (other than through the weak mechanism of voting) would be considered intolerable.

Hardening MAMP for easy, secure Wordpress hosting on Mac

Posted by Johnathan at 2:56 pm, November 8, 2008

I just set up a new blog the other day using MAMP, the same Macintosh-Apache-MySQL-PHP distribution that this blog runs on.  And although the latest version is more than a year old, and they explicitly state that “MAMP was created primarily as a PHP development environment for Macintosh computer and should therefore not be used as Live Webserver for the Internet”, I’ve found it to be a capable solution for hosting a live Wordpress blog provided you take a few simple steps to secure it.  Plus for backups and testing purposes, you can’t beat the convenience of having everything you need in the /Applications/MAMP folder.  So for the benefit of anyone who might be interested, here’s what I did to set up a blogging platform that’s both free and secure.

(more…)

That was a nice nap…

Posted by Johnathan at 4:04 pm, November 7, 2008

So I had just gotten some work done setting up a new blog (details to follow) when it occurred to me that it wouldn’t be an ideal place for personal posts. I wondered if maybe I should/could dust off the old TKIA blog, upgrade it, and set it up for use with Wordpress’ blogging app for iPhone. And lo and behold…

Filed under: Blog Business
Short takes

Posted by Johnathan at 2:29 pm, April 12, 2008

A few quickies:

Of course, the events in and around Zimbabwe never fail to sadden me. Note the “If we all believe it, it can be true” wishful thinking of South Africa’s president Thabo Mbeki, who pronounced that there was no crisis in Zimbabwe. This, hours before the convening of the Southern African Development Community summit to discuss the crisis in Zimbabwe. Okay then, so two weeks passing since the presidential election with no word on results is normal? The current president and his party pushing for 1) a recount and 2) a runoff election before results are released is indicative of a stable, smoothly-functioning government? We are looking at either an imminent explosion of violence, or the leaden acceptance of a permanent regime, impervious to even the most basic mechanisms of democracy. I’d call either a crisis.

Cuba has shown some surprising developments in a more positive direction under Raul Castro. The latest reforms incentivize production and warrant new confidence in property titles. Now while I don’t doubt that such changes are purely tactical, designed to give Cuba and its government a little more breathing room while still preserving the bulk of the communist agenda, an increase in freedom is always to be welcomed. A little freedom tends to beget more freedom, at least at the sorrier end of the spectrum of liberty.

Finally, in non-current events, have a gander at the amazing eight-minute animated short Tango (1980) by Zbigniew RybczyÅ„ski. I originally saw this piece as part of this compilation, but it doesn’t appear to be part of any DVD currently in print. If it strikes you as familiar, you might be remembering the video for Redundant by Green Day about ten years ago, which was an homage.

Filed under: Current Events and Wonders