Running the Glassfish updatetool on a remote server

development No Comments »

I’ve been playing around with JRuby on Rails and Glassfish and really like the simplicity of deploying simple WAR files to a Glassfish server. Messing around with Apache configurations and managing a bunch of mongrel processes is just not my favorite pastime, plus I like to have the option of running other J2EE webapps on the same server, and interface my RoR app with existing Java libraries.

I ran into some problems trying to get the updatetool for Glassfish working on my VPS (at Rimuhosting) though. The updatetool is a Java Swing app and I’ve never run any GUI apps on this remote host before. It doesn’t have Gnome or KDE running so VNC was not an option. The trick is mostly just to set up your systems for running remote X11 applications over a SSH tunnel. Here’s how I got it to work…. I should say this server runs Ubuntu Hardy and locally I’m on Mac OS X so the X11 install from the Mac OS installation disks was the easy part.

Here’s what I had to do on the remote host:

Read More »

new Trendnet TV-IP400W controller for Zoneminder 1.23.x

Home Automation 10 Comments »

I’ve finally gotten around to rewriting my old Trendnet PTZ controller for Zoneminder 1.22.x to support the new API for Zoneminder 1.23.x. It includes all the old features (moving the camera in horizontally, vertically, diagonally, and going to preset and home position) as well as a new bonus feature: move the camera simply by clicking a point in the live video that you want the camera to recenter on. This is not extremely accurate, but good enough for most uses, and faster than having to click an arrow 20 times.

Here’s the basic steps on how to get this Trendnet TV-IP400 / IV-IP400W driver to work in ZoneMinder: Read More »

jQuery plugin for communication between browser windows

development 1 Comment »

Ajax is great for sending data back and forth between a browser window and the server, but when it comes to communication between two browser windows, there are few libraries that can help you out there.

I’ve been working with jQuery for over a year now and have always wanted to give something back to the user community by releasing my own plugin. Unfortunately it seemed like every type of generic functionality I might ever need had already been developed by others. Until last night.

I was working on a webapp in which my main browser window had to open a popup window, and the user would then perform an action in this window. Upon completion of that action the main (parent) browser window needed to be notified.
Though parent and child window can easily access eachother’s DOM, a common way to get a value from one window to another is by setting a value on a hidden input field of a form in the other window. This requires you to add form markup to your page, which is clunky. A second issue is that if you have several types of events or data to send to the other window, you’ll need to add an input field for each type. And a third issue I ran into is that ‘change’ events do not seem to fire for an input field if that field was updated by another window. ‘change’ or custom events using jQuery didn’t work either this way. ‘click’ events on links or buttons do work, but they would need to be hidden, otherwise the user could click on them too. I got it all working but this all started to look like an ugly hack, cluttering my pages with messy javascript and markup code.

Read More »

Ruby controller for the Trendnet TV-IP400W PTZ camera

development, Home Automation 2 Comments »

I thought I’d follow up on my post of a little while ago about the drivers for the Trendnet TV-IP400W Pan-Tilt-Zoom camera. I wrote a ruby driver for this thing, which makes it trivial to control the camera from any Ruby application. It’s just a single Ruby file, and though I’ve entertained the thought of figuring out how to pour it into a gem and publish it to the plugin repository, I’d probably only do that if there are a significant amount of people interested in using it and/or contributing to it.

As with the old Perl driver for Zoneminder (which I’ve been told doesn’t work anymore with the latest version of ZM, since the interfaces for the PTZ drivers have completely changed), this driver only controls the pan and tilt functions of the camera. Actually, you can also put it in swing mode and store or access preset positions, but none of the available functions actually do anything with the video stream. The video can simply be accessed at:

http://yourcam/image.jpg to grab a single frame of the current camera view
http://yourcam/video.cgi to get the mjpeg stream from the camera

There’s no real zoom control since the cam only has a digital zoom, which I believe is implemented in the client software only (so there’s no way to actually have it stream a zoomed image to your client).

Read More »

A day in the SF eastbay

sites No Comments »

I love outdoor webcams, because they can give you an instant and live view of what the weather and/or a location looks like in places all around the world. Two sites that are great for exploring these live views all around the world are earthcam and cammap.net (though the latter appears to show only US based cams). They are simple services that simply put a database of webcams around the world on top of interactive maps. It’s the kind of site I’ve always wanted to build myself… It’s been done now but that’s ok because I plenty of ideas for other types of web sites left.
As I was browing our local webcams I came across an interesting one though… The Lawrence Hall of Science in Berkeley has a fixed cam pointed towards the bay of San Francisco, and records a snapshot of the view every minute of every day. Every day they automatically generate a little movie out of that, which you can view online. I’ve embedded the video here too, so what you’re seeing here is what yesterday looked like over here. Depending on what day you look at this video, you may catch some of our fantastic sunsets over the bay, the beautiful fog rolling in or out, or all kinds of other weather patterns moving over the East Bay. For the real weather enthousiast, check out the timelaps movie archive with some of the most stunning days caught on video.


The above image of the view from the East Bay hills is at most a couple of minutes old (unless the camera is down). Click to view yesterday’s timelapse movie.

Saint Nicholas in the Netherlands

Dutch expat No Comments »

It’s that time of year again… Saint Nicholas (aka Sinterklaas) has arrived (or is about to arrive) in the Netherlands, on his boat from Spain. He will be riding his white horse around Holland, getting ready to celebrate his birthday on December 5th and hand out presents to the kids. Actually his birthday is on December 6th but many decades or so ago he must have decided that the 5th would be a better day to celebrate it. Anyway, it’s complicated. In the US I have always had a hard time explaining the tradition of Sinterklaas without being laughed at, or without people bringing up the (to them) obvious references to slavery in the Saint Nicholas tradition. Granted, I wouldn’t paint my face black, dress up like a Black Pete (Zwarte Piet) and go wander around Oakland like that, as people who are less aware of the Dutch tradition might misinterpret what they’re seeing.

I came across a hilarious essay by David Sedaris on youtube that (fairly accurately) describes the Saint Nicholas tradition in Holland. You can view it right here - highly recommended. (it’s in 3 parts, make sure to watch all three of them…)

Kiva.org

sites No Comments »

Ever since I spent a year travelling South East Asia in 1999, I’ve wanted to do something to help people in poor countries. I’ve met so many individuals and small business owners that were just struggling to get by, many of them working 7 days a week for just a few dollars per day. I hope that at one point in my life I’ll be able to travel back to some of these places and do some volunteer work and/or help out a local community financially. I’ve donated to organizations like the Red Cross that do incredible work helping out people in need all over the world. But my latest excitement in the world of good-karma-organizations is Kiva.org. Kiva works with microfinance institutions in many developing countries to allow anyone to make an interest free loan to small business owners. These are not actually donations - as a Kiva user you lend money, in any amount that you’re comfortable with. The borrower will typically use the money to buy additional inventory, make certain repairs or otherwise expand his/her business. The vast majority of loans are paid back over time though, which allows lenders to help out even more people. Bill Clinton has been speaking about this organization and all the recent press about Kiva has resulted in the fact that there are actually more lenders than borrowers at the moment. This is great for Kiva of course… I hope they can set up relationships with more microfinance institutions so we can all help more people in more places. So I am now partially financing the business of a pig farmer in Cambodia, and a door to door sales woman in Peru. Please do go check it out: www.kiva.org.

The Trendnet TV-IP400 / TV-IP400W protocol

development, Home Automation 9 Comments »

The Trendnet TV-IP400 is a fun little camera that will work great for home surveillance, as a controllable web cam, etc. The only problem is that the software that comes with it really sucks. I reverse engineered the protocol that is used to control the camera, and wrote a ZoneMinder driver for it… go here for more information. This follow up describes the control protocol that I reverse engineered, and contains most information that you’ll need if you want to write your own driver. I’m assuming that you are familiar with HTTP requests and that you know how to send GET and POST requests to an IP address.

Feel free to use the information in this page in any way you want. I make no guarantees as to its accuracy or completeness. If you write any software based on this info, please let me know!

Read More »

Controlling the Trendnet TV-IP400W camera with ZoneMinder

development, Home Automation 20 Comments »

Update (7/18/08): this driver and instructions work for ZoneMinder 1.22.x only, see my update for ZM 1.23.x support.

I can’t even remember when was the last time that I had to reverse engineer something.. it may have been as long ago as my college days. But last week I had a couple of evenings of fun figuring out the inner workings of my Trendnet TV-IP400W. This is a cool little internet camera with built in wifi and a built in web server. You can control it from a browser and you can actually pan and tilt this camera around the room, so even though the picture quality isn’t great (probably comparable to your average webcam), it can be very useful if you want to keep an eye on your house, your pets, your baby, etc from anywhere in the world. The best part: you can pick one up online for less than $200, which is a steal for a pan/tilt IP camera.

The built in web server is useful for checking up on the live situation, but it does not have any features to automatically notify something or someone if motion is detected in front of the camera. The windows control application does do motion triggered recording, but if you want to monitor your camera from outside your home you’ll have to set it up to email all the videos to yourself, as the windows app can’t function as a web interface.

All of this makes this camera more of a toy, with limited remote monitoring features. But, I wouldn’t be me if I didn’t figure out a way to get what I wanted from this thing. Since I already have 2 Linux boxes running Misterhouse, MythTV and various databases and developer tools, I figured one of these boxes could easily function as a surveillance system as well.

So I set out to install ZoneMinder on my Ubuntu system. ZoneMinder is an extremely full featured (open source) video camera security and surveillance system. It supports multiple CCTV and IP cameras, has a web interface, it can control PTZ (Pan Tilt Zoom) cameras, and supports custom triggers, multiple motion zones per camera, etc.

After a little bit of tinkering I got ZoneMinder running, and it turned out that even getting it to capture video from my Trendnet cam turned out to be trivial… All I needed to do was to configure the camera stream to http://192.168.0.140/video.cgi on my home LAN!

Unfortunately, that’s as much as I’d be able to do with ZoneMinder and this cam. The IP400W uses a proprietary control protocol to move the camera and there wasn’t any ZoneMinder driver for it yet.

But how hard could it be to write one?

Read More »

TimeBridge is live

sites, development 1 Comment »

Today is the public release of the TimeBridge.com service. TimeBridge allows people to schedule meetings with each other, and also share availability information with your contacts, which works both with your Outlook or Google calendar. If you’ve ever tried to set up a meeting with a few people then you know the problem: finding a meeting time that works for everyone can easiliy take more time than the meeting itself. TimeBridge alleviates that pain and will contact all meeting attendees with your proposed meeting times, and (if possible) automatically confirm that time that works for everyone. TechCrunch just wrote up an article on Timebridge, do check it out, or of course go straight to TimeBridge.com and start organizing!

I’ve been doing contract work for TimeBridge since February, when me and my biz partner Tim from BarbaryCodes wrote the very first lines of Ruby on Rails code for their webapp. It’s been a fun project, and the site is very client side heavy so there was a lot of interesting Ajax and Javascript work involved. They’ve been building up an excellent development team of their own and while I’m still involved in troubleshooting and bugfixing, that work may be dwindling down soon. So if you need help with any Rails or J2EE projects, drop me a line, I may be available again soon.