Tuesday, January 29, 2008

Running SBS-1 BaseStation on Linux

This is slightly off-topic, but you can probably guess why I'm interested in this stuff. There's been discussion on the forums whether you can run BaseStation on Linux, but I couldn't find the answer on the web, so I'm posting it here after finding out myself.

I bought myself an SBS-1 (by Kinetic Avionic Products) for a Christmas present. I've been running the BaseStation software on Windows so far, but that's not fun if you want to run it remotely.

So, tonight I tried to run it in Linux on top of Wine. It worked. Here's how:

1. Install a recent version of wine, and practically any versions of the old but incredibly useful tools nc and cu. On my Debian system this can be done using the command apt-get update && apt-get install wine nc cu. I'm runnig debian testing (lenny, in January 2008). This probably applies to Ubuntu, too.

2. Run some other Windows software with wine first, get it configured on your account and see that it actually runs something successfully.

3. Download the BaseStation CD which contains the driver DLLs. The driver DLLs are not really used, but they have to be present on the system so that BaseStation.exe will run.

4. Extract the DLLs from the CD in a temporary directory, and copy them to the system32 directory of your wine installation:

mkdir tmp && cd tmp
unzip ../BaseStation-1-1-1-119-CD.ZIP '*.dll'
mv *.dll ~/.wine/drive_c/windows/system32/
cd .. && rm -rf tmp

5. Download the latest version of BaseStation (I tried

When wine is properly configured on your system, Firefox will run the wine-safe installer for the EXE file automatically, and basestation will be installed. If this doesn't happen, you might have to run the installer by hand (wine-safe setup.exe). After the installation, the installer will quit. Don't run BaseStation yet.

6. The application apparently cannot talk to the USB bus under wine, so we'll have to do a trick here. Connect the SBS-1 to the USB port of your Linux system, and observe the output of the dmesg command - it should notify you that an USB serial port has been found. On my system it looks like this:

usb 2-2: new full speed USB device using uhci_hcd and address 5
usb 2-2: configuration #1 chosen from 1 choice
ftdi_sio 2-2:1.0: FTDI USB Serial Device converter detected
drivers/usb/serial/ftdi_sio.c: Detected FT232RL
usb 2-2: FTDI USB Serial Device converter now attached to ttyUSB0

Now, the SBS-1 hardware can be reached behind /dev/ttyUSB0 at 921600 bits per second. We could connect to it using the very simple Unix "call up" program cu --nostop -s 921600 -l /dev/ttyUSB0, but we cannot talk the proprietary binary protocol used by the SBS-1 and the BaseStation software. Yet.

7. So, we run cu under another very simple and extremely useful Unix tool, nc, which is the swiss army knife of TCP/IP. We tell nc tolisten on TCP port 19251 using the localhost IP address of (so that it cannot be connected by anyone from the Internet), and to start up the cu program when a connection arrives:

nc -l -s -p 19251 -c "cu --nostop -s 921600 -l

8. Now, while we have nc waiting for the connection, we can start up BaseStation in another window:

wine .wine/drive_c/Program\ Files/Kinetic/BaseStation/BaseStation.exe

Tell it to connect over the network, the address is, and the port is 19251.

There's no reason why you couldn't do this over the Internet, either. You might want to run cu under inetd instead of nc, though, since nc will quit when the connection closes. Remember to set up your firewall / tcp wrappers properly!

Thursday, January 24, 2008

The 2-hour outage last night

After adding 4G of memory on the server (which went well, as usual) I had to do some disk arrangements, which took some time to complete. After booting up the Apache web server didn't return web pages correctly any more - web browsers would show the HTML source code instead of nicely formatted pages. After playing with a network analyzer (thanks Wireshark) and getting a little help from an ex-colleague I finally got it fixed.

I had upgraded a good bunch of libraries on the system earlier, but hadn't really restarted the web server processes afterwards (I'm only running a graceful restart after log rotation and config changes), so the web server was still using the old libraries. Now, after the reboot, new libraries were linked in, and it broke. There was an extra line break (\r\n) after the Server: Apache... HTTP header, and web browsers promptly stopped parsing the headers, and assumed a text/plain content type, and showed the HTML.

The strange thing was that enabling content-encoding compression (SetOutputFilter DEFLATE) fixed the problem. While it did work, the header was:

Server: Apache/2.2.6 (Unix) mod_ssl/2.2.6 OpenSSL/0.9.8g

While it didn't work, the header was:

Server: Apache/2.2.6 (Unix) mod_ssl/2.2.6
(+ the extra CRLF, then Connection: close and the following headers)

The workaround was to set ServerTokens Prod, so that the header only says Apache, and doesn't give any hints of version numbers or modules. My best guess is that disabling DEFLATE changed library linking order so that the openssl version query returned "\r\n". gnutls maybe?

The sysadmin lesson to learn here is probably that you should restart services depending on libraries which you have upgraded, so that incompatibility is revealed right away. It's nice to know which upgrade broke what. It's not fun to see applications break after "just a reboot".

On the positive side, the system isn't swapping any more.

Wednesday, January 23, 2008

Maintenance outage: adding memory

The aprs.fi server is going to be down for some time tonight or tomorrow, while I'm adding 4G of memory in it. Sorry for the inconvenience.

Tuesday, January 22, 2008

Lost: Find 815: Christiane I on APRS

ABC studios, an Australian company called Hoodlum and the creators of the TV series Lost have created an alternative reality game called Find 815, which produces content for fans of Lost during January. The first episode of Season 4 will be aired on January 31st. Lost is pretty popular, and so is the Find 815 game. The game is described in more detail on Lostpedia, a wiki site dedicated to Lost.

The story briefly mentions amateur radio, and involves a ship called Christiane I. The fun part is that Christiane I has an APRS tracker onboard and is now sailing somewhere near the Christmas Island! There has been some speculation whether ABC has actually hired a real ship, which could be tracked using APRS, and a few popular blogs and forums have linked to findu and aprs.fi.

I cannot comment on whether the ship tracker is authentic, although the TCPXX path does mean something to APRS experts.

Rotating APRS symbols

I've just installed the rotating APRS symbol code on the production server. I hope it won't slow your browsers down too much. It will cause some slowness, and eat a bit more memory, but it might be worth it.

The symbols have been rotated in 10° steps (0° to 350°) using Gimp's scripting language (Scheme / Script-Fu) and a little Perl. This was my first piece of Scheme, and my favorite quote from the Script-Fu tutorials was "Debugging Script-Fu scripts is only slightly less painful than stabbing yourself in the eye with a dull spoon". It's so true. I would have used imagemagick, but it broke the transparency. So I learned a new programming language. :)

Turkish APRS

TA2T spent 5½ hours last night translating aprs.fi in Turkish! Thank you.

Over the weekend I tried to make the map icons rotate and point to the course of a moving station. Got it basically working, but it still looks too ugly to be published. Need to do some graphics conversion work first. It might have a performance impact, I hope it won't be too bad.

Thursday, January 17, 2008

Ordered a new server.

Today I ordered a new server for aprs.fi. Intel Core 2 Quad (Q6600 2.4 GHz, single CPU with 4 CPU cores), 4GB of ram initially (will probably upgrade to 8GB later this year), 2*320G SATA disks (16 MB cache, NCQ, 5-year warranty). 1155 EUR, about 1700 USD. 1U rack case, two gigabit Ethernet interfaces (Intel). This should help performance a little bit, but I'll probably have to get another one later this year. This one should arrive in about a week.

I've also ordered a 4GB memory upgrade for the current server, which is 183 EUR (270 USD) - fully buffered ECC memory is a bit pricey, and that's what the server requires. The new one eats unbuffered, which is only around 100 EUR for 4GB now.

In case you're wondering, my paypal account is hessu@hes.iki.fi. Using aprs.fi is free, and will remain so.

Tuesday, January 15, 2008

Portuguese translation and a little more colour on the map

CT1AKV spent hours last night and today translating all of the strings to Portuguese! Obrigado!

I spent a couple hours and made the callsign labels on the map change colour depending on the type of the tracking target. APRS items get blue labels, APRS objects get red labels, weather stations get yellow labels and AIS ships now have green labels. Normal APRS stations still have a white label.

The bulletin page now shows empty categories (the "local" category is empty for most of you, since it only shows bulletins and announcements sent by stations within 500 kilometers of your location).

Monday, January 14, 2008

APRS bulletins and announcements

Bulletins and announcements can now be viewed on the new APRS bulletin board page.

The APRS bulletin format doesn't really scale up on the Internet, but the page tries to show local announcements (within 500 km of your location) first. If your location is not guessed correctly, use the Save current map view as default view Option to tell the site where you're located.

Thursday, January 10, 2008

Saving default view + beacon lookup speedup

You can now save the current map view as the default view by selecting the Save current map view as default view option. The map's center point (or tracked target callsign), zoom level and map type will be saved in the settings cookie, and recalled when you next visit the site (unless another specific location or callsign is requested).

The beacon list view gained a lot of speed after an optimization. Looking up beacons sent by a callsign now takes milliseconds instead of seconds. I had to recreate a database table to do this, though, and some history was lost, but hey, they were only beacon packets. We'll get new ones for free!

Monday, January 7, 2008

Français and language subdomains

The French translation is now nearly complete, thanks to F4EIR, HB9HFD and HB3YKO. Thanks!

Last night I added per-language subdomains, so that the translations can be easily sampled and indexed by web spiders like Google. So, to try out APRS maps in any of the 9 different languages, you can simply add the two-letter ISO 639-1 country code to the URL:
To permanently change the language in aprs.fi, you need to change the preferred language settings in your web browser (Firefox 2.0: Edit -> Preferences -> Advanced -> General -> Languages -> Choose, Firefox 1.5: Tools -> Options -> Advanced -> General -> Languages -> Choose, IE: Tools -> Internet Options -> General -> Languages). Move your preferred language first in the priority list. This will also affect other well-behaving web sites like Google.

The translations have been made by volunteers.

Friday, January 4, 2008

APRS digipeater path adviser

The station info page now gives some feedback and advice on APRS digipeater path settings. It approves paths which request less than 4 digipeaters and suggests paths which have 2 digipeaters (WIDE2-2 or WIDE1-1,WIDE2-1 or TRACE2-2). It also gives advice on invalid usage of RELAY and WIDE1-1 when they're not the first component of the path, and suggests replacing RELAY with WIDE.

There are different opinions on "good" settings, and there are regional differences too. I believe the settings offered are good for most environments. It doesn't really matter so much if one uses TRACE or WIDE, as long as the total amount of digipeaters isn't very large. 2 is good in areas with good coverage digipeaters and igates, 3 is usually good elsewhere. 5, 6 or 7 is, well, not good.

Thursday, January 3, 2008

Holidays, Norwegian, and relaxed callsign rules

I'm back from the Christmas holidays, and looking forward to fixing some bugs and doing a little new development. I spent Christmas in the Åland islands and worked some HF digital modes as OH0/OH7LZB. It was a lot of fun, I've never really felt like being a DX before. Had a sort of a pile-up on 14 MHz RTTY for quite a while!

New year was spent a bit further away... can you recognize the place from these photos? :) It was a lot of fun, a very nice town with very nice people. The hostel was awful, though, and not very cheap either.

Now, let's get back to business:

I installed the new Ham::APRS::FAP version 1.01 on the production server. It relaxes APRS-IS source callsign validation rules so that any alphanumeric 'callsign' (including a variable amount of '-' characters) with a maximum of 9 characters is accepted. Things like OH7AA-A (D-STAR DPRS) and aprsdOEZ will now get in the database, too. Welcome!

There is a new complete translation in Norwegian, thanks to LA4RT, LA9UI, and LA4DNA. The site is now available in 8 languages (counting complete or almost complete translations)!

There have also been significant new contributions to the French, Japanese, Polish, German and Dutch translations. Thanks go to HB3YKO, HB9HFD, JA7UDE, JO2VTM, SQ6NTI, SQ3EYC, HB9TQJ, Dl7JP, DO1GVT, DK7IN, PG1G and PA3BWE.

I'd like to remind everyone doing translations about two little things:

- Remember consistency. Please try to use a single word for a certain feature everywhere. For example, always use your preferred translation of Options when referring to the Options pop-up window. Please avoid using a mix of Options, Preferences and Selections. It's OK if your preferred translation actually is closer to Preferences, just use the same word everywhere. :)

- If you're uncertain about a translation for a term, please double-check (use Wikipedia or something). For example, Course, Heading and Bearing are all different things and have different translations, which are easy to mix.

After saying that, I'd like to repeat my thanks to everyone involved in the translation project. The translations seem to be of good quality, and they do make the site more accessible. I'll improve the translation tool in the future, and add more strings (the Options window and help texts should appear soon).

Happy new year, everyone!