Saturday, July 11, 2009

Zipit2 clock, email / twitter monitor

This was my second (and last) project involving the Zipit2.
It culminated in a PHP script that generates images based on dynamic information, called ImgUI. This can then be displayed on any device that is capable of pulling and displaying images from an HTTP server. The idea should be reusable for any device that fits the criteria.
For the ZipIt2, the quick and dirty way to display images on the screen was to switch the tty over to graphical mode, then just dump raw data to /dev/fb0. This has to be the right orientation and format. I've coded up a tool that takes raw RGB888 pixeldata flips it the right way, then converts it to BGR565. This is used by the script. A minimal shell script on the z2 then just pulls a new image every minute or so and dumps it to the framebuffer. Above you see the Z2 displaying the clock "applet". Thanks to PHP's imap extension I also have one that checks specific folders on imap accounts, and displays unread mail.

Plus I also included a sample twitter applet:

I'm releasing this under the MIT license.

Includes applets seen above, z2 output driver and script, plus a readme file that should tell you everything you need to know.

Download here: ImgUI Z2

Wednesday, July 8, 2009

Relay on LPT port

I made this (on a piece of leftover junk PCB) to remotely switch an external HDD connected to my home server on/off.
I went with the "Safer New Design" from here, but then decided to opto-isolate it anyway. An LPT port data pin switches the led in a 4N25 opto-coupler, which then switches an external power brick's connection to the board. The relay then switches the mains on an extension cord. I pulled the NAIS 5v/220V relay from a broken monitor. Although with this design the switching voltage isn't really that important. As long as it's within the accepted ranges of the opto-coupler and transistor.

Coded up this simple command-line tool in FreeBasic to use it with:

dim as string myCmd
dim as ubyte myState

myCmd = ucase(command$(1))
if myCmd <> "ON" and myCmd <> "OFF" then goto state
if myCmd = "ON" then out &h378,1
if myCmd = "OFF" then out &h378,0

myState = inp(&h378)
if myState = 0 then print "Relay is OFF" else print "Relay is ON"

I decided to release my board layout along with some notes on this project, in case anyone wants to build this. The notes say it all.

You can check it out here or download it as an Eagle BRD (v5.6)

In case you build it, leave a comment :)

Tuesday, July 7, 2009

Zipit2 mikmod

Due to the projects I've done with the first iteration, curiosity did bring me to buy a Zipit2 eventually. I loved the free IM forever, or similar text on the box even-though they're selling the services now for $100 a year or so.. that makes the initial impression somewhat negative. :-) Anyway, Aeronix kinda supports re-purposing the device this time around. There's some licensing debacle that's keeping the DIYer community away from the device. There does seem to be progress though. I've done two small projects with the Z2 before selling it. (Yes, I don't actually have it anymore). The first one was trying to get mikmod and mad player to work. Basically nothing compiled for the ZipIt1 worked well on the Z2. Nothing that had to do with audio anyway. I don't really know that much about the intricacies of playback on DMA based audio interfaces, but it seemed to have all kinds of buffer problems if I just dumped data out on /dev/dsp (that worked fine with the Z1). I did somewhat manage to get mikmod playing after trying random buffer sizes for about an hour.. but I think it was mostly luck that it worked, and it still hiccuped from time to time. (Then again, so does the stream player in the official software, so maybe it's a general driver bug? or maybe they didn't fully grasp it either..)

Here's a video of mikmod working on the Z2. I won't release anything because I have no idea where I put the files anymore :-) You'll probably need to crank up the volume to hear anything, sorry about that.

Monday, July 6, 2009

Leather Mouse, Man!

About 10 years ago I was buying noname mice every other month, and they kept breaking one way or another, until I decided to invest in a Logitech iFeel MouseMan.

It was an interesting mouse. Featured force-feedback (which was fun for a whole 5 minutes) There was actually a plugin for Unreal Tournament that made use of it, which was my game of choice at the time, but I decided to remove the vibration motor after a while because it made the mouse a bit heavy. I used this mouse for several years, without a single problem. Then a micro-switch started giving out and I decided to clean the mouse when I took it apart to replace the switch. Washing it with whatever I did turned out to be a rather bad idea, as the rubber parts of the mouse started "rotting" away. It appeared to be breaking down into an oily goo, and was losing it's color in the process. Obviously this made it impractical to use, so I shelved it. Until about a week ago when I got bored and decided to tear the rotted rubber from the plastic inserts and replace them with leather. I might not have started doing it if I knew how much work would be involved. I don't know what kind of glue they used, but it took close to 2 hours with sandpaper, a Dremel-like tool, xacto knife and pliers to get to and clean the plastic pads. The rest was pretty easy, cutting leather to size, gluing it to the pads, then folding it in around the edges.

I''m satisfied with the outcome.