Recent blog entries for softweyr

Wow, long time since last entry. I spent the summer working like mad (gotta love those start-ups) and didn't have much time for anything, including sailing, FreeBSD, or OpenSail. Now that nasty weather is here again, maybe I'll get more time for hacking.

One of my contributors got me hooked on itty bitty CPUs this summer, so I've been playing with PICs and AVRs, and have decided to use AVRs for the OpenSail instruments. Rather than put dumb counter/sensor devices from DalSemi at the masthead, I'll stuff a small CPU up there and just return cooked data via serial line. The power consumption, especially on the low-power AVRs, is quite good and the circuitry is actually simpler than using multiple 1-wire devices.

We have managed to create part of the physical hardware for the wind instruments as well. We found a great supply of simple nylon bushings at a local hardware store and have experimented with a brass shaft passing through said nylon bushing. The brass seems stiffer than aluminum, and is certainly easier to work. Soldering brass to brass is quite simple, compared to the inert gas welding required for aluminum. Brass should stand up to the harsh saline environment of the Great Salt Lake better than aluminum, which tends to pit over time if unprotected.

So anyhow, we have rotating shafts and an enclosure that can be waterproofed; the enclosure is made of two female PVC pipe caps and a short segment of 2.5" OD PVC sprinkler pipe. As we perfect the sensor wheels we'll probably be able to shrink down to 2" OD pipe, and perhaps someday a custom enclosure.

I'll post more when we have some working code for the AVR. One of my co-contributors is going to do a PIC version of the wind sensor when he has time.

I posted OpenSail on the projects page here at Advogato. I'll try to fill in more detail here and on the web site sometime soon. Maybe I can even talk my helpers into joining Advogato.

I've got the wind direction indicator design for OpenSail pretty much set now. I realized I could make the encoder disk for the position indicator a lot less complex by making it double sided, encoding 4 bits of position data on each side. This effectively gives you 9 bits of position information, since the "side" counts as a bit.

I spent some time today drawing the encoder wheel design with xfig. I'm going to need a better drafting program for the vinal version; xfig offers pretty limited capabilities for precise angular placements and coloring of regions. I have one side of the encoder drawn out now, but correctly setting the angles for the reverse side is going to be tricky; the outermost track is offset from the reverse by 6.625 degrees.

To read the encodings on the wheel, I'm going to use 8 Dallas Semiconductor 2406 1-Wire switches, with the B channel configured to sense the output of an optical encoder. The encoders will be arranged to shine on the tracks of the encoder wheel, returning 0 for the black sectors and 1 for the white.

Each 2406 has a unique serial number and 1Kbits of OTP EPROM, so once I get all the devices on the board I can run a little program to figure out which bit each 2406 device corresponds to, then burn the bit position into the EPROM. During OpenSail initialization, it will query each of the 2406 devices for it's function (or bit position) and record the device IDs, so later information scans can address the devices by ID.

I've also decided to use the same encoder wheel for the wind speed sensor. I'll probably couple two tracks of the encoder to a DS2422 1-wire counter/RAM. I can use the outer track, with more divisions, for slow winds speeds, and one of the inner tracks for high wind speeds that cause the counter to overflow. Actually, considering that each counter is 32 bits, this isn't real likely, but the chip has two counters, might as well use them, right? I haven't quite figured out exactly how to wire the encoders up to the counter inputs yet, but I know a few EEs who really want to go sailing.

The really nice part about the Dallas Semiconductor 1-wire devices is that I can stuff a fair amount of intelligence into a small, light package to go at the masthead, and still run just one wire up the mast, using the mast itself as signal and power ground. The 1-wire bus provides +Vcc and Tx/Rx data all multiplexed over a single wire.

Well, the clouds are clearing and it's time to go sailing. I'll report progress as it happens.

Along with all the work-related stuff (pushing out another Beta release, designing for a new hardware platform, etc), I got a few hours to work on OpenSail. One of my co-workers has taken an interest in this project, and started poking through the Dallas Semiconductor website, looking at the 1-Wire Bus devices.

I suppose I should OpenSail as a project here; somebody might actually read about and do something. I get so tired from work I don't have much time to devote to it, and what time I do manage I want to go sailing instead of egg-heading around with more code. Oh, well, as the song says, I'll sleep when I'm dead.

Just in case anyone reads this, the idea behind OpenSail is to wire up wind instruments, knot/log impeller, electronic compass, a GPS, and perhaps a depth sounder to a computer. Then we write some software to tell the crew, the helmsman, and the tactician (yes, this is for racing) where the boat is and what the wind is doing. Other possibilites include displaying position and situation on a chart display; recording historical data during the trip for later review; and display performance vs. polar plot data, both in real-time and using the historical data.

The real problems aren't the code, but rather the custom hardware we'll have to craft. Sailing hardware is expensive in general, and the manufacturers of the purpose-built sailing stuff don't want the competition. The stuff made for home weather stations and such aren't tough enough, and generally aren't accurate enough either.

So anyhow, I guess I'll go figger out how to add the project here on advogato. Jason and I are going to collect all the info I've gathered and write a requirements/design spec in HTML so I can post it on the web page, then we can link it here.

Ugh. Almost one year, huh? Life in a startup can be time-consuming.

Just to bring this diary up-to-date, I became a System Architect for DoBox Inc. about a year ago, just when my diary entries here ended. Now I can come up for breath, and catch up on my participation in public software development. The DoBox software I've been working on is based on BSD technology - the core operating system is a customized version of OpenBSD, plus tools and utilities from NetBSD, FreeBSD, and other Open Source projects.

OpenSail has been on the back burner this entire time, but I'm hoping to get some time to work on it this spring. I'm currently working on a replacment for the lame-o wind direction instrument in the One-Wire weather kit, which shows only 8 directions: N, NE, E, SE, S, SW, W, and NW. I'm toying with a 9-bit optical encoder for true 360 degree accuracy, or perhaps an 8-bit encoder which will give just slight sub 1 degree accuracy. I'll still be using 1-Wire devices at the masthead to keep the weight and wiring requirements down.

I'll try to keep this a little more up to date, including recent contributions to BSD and other projects. I'll also try to get OpenSail stuffed into the project list here sometime, and get the other two contributors to link to it.

I spent some time this afternoon poking around the Dallas Semiconductor web site, and ordered a One-Wire Weather Station Kit. Keichii is excited about helping, so I'm going to plunge into the early design work for a project I've wanted for a long time, my OpenSail project.

The initial goals for OpenSail are quite modest: given a wind direction and velocity from the One-Wire weather kit, and boat speed and direction from a GPS via serial/NMEA output, calculate and display the apparent and true wind speed. Later, we can add features like wind tracking, performance vs. polar plots, layline tack alerts, lifts, etc.

I spent some time poking into libvgl for graphics output, but that would limit it's portability. Since I'll probably run it on my VAIO, I think I'll stick with X for output. A friend at work suggested writing it in GTK-, since that will be good experience. I'll look into it more this week while I'm off work.

I wish I could afford to just do this full time.

Hacked up the tab-expansion code in Xchat. It was doing a rather lazy first-fit, and I kept talking to Greg Lehey's backup connection, groggy-B, instead of his primary connection, groggy-P. Attempts to modify his naming convention met with a stone wall of 'this is how we named things at Tandem, so it must be right.'

I also implemented a weighted selection; when you choose one amibguous definition over another it will prefer the one you just selected over all others. For instance, once you've addressed groggy-P in a message, the next time gr<tab> will select groggy-P over groggy-B and green.

I haven't decided if I like the weighting or not. I'll work with a few more days, make a decision, and contact the Xchat maintainer to see if he is interested in the patches. If not, I may add them to the BSD port/pkg kits.

Reading through the diaries of some of the other FreeBSD people here, I'm amazed at the number of people I've come to know over the years through the internet, but not in person. I'm still awed at the contributions these people make on a daily basis, and more than a little surprised at just how long I've known some of them. It's good to see more BSD people flooding in here, this looks like an interesting resource.

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!