Wed Oct 24 7:28AM (2007)

SOLVED: Perl "Argument ... isn't numeric in subroutine entry" warning

Problem:

   Argument "2.121_08" isn't numeric in subroutine entry at /usr/lib/perl5/vendor_perl/5.8.8/MLDBM/Serializer/Data/Dumper.pm line 5


Solution: You probably have -w in your hashbang line:

    #!/usr/bin/perl -w


Get rid of it. Replace it with use warnings;

Posted by Ed | Permalink | Categories: Linux

Thu Oct 04 2:04PM (2007)

La Crosse WS-2316 on Linux: Success

For those of you Googling before buying: yes, it works!

I've wanted a weather station for years. When I saw the La Crosse WS-2316 in Costco this weekend for $90, I couldn't resist buying it. The good news is, it works perfectly fine on Linux (2.6.22). The WS-2316 includes a USB-to-serial dongle which lsusb reports as:

  Bus 004 Device 005: ID 0403:6001 Future Technology Devices International, Ltd 8-bit FIFO


The driver for that is ftdi_sio:

    Device Drivers -->
      USB Support  --->
        USB Serial Converter support --->
          USB FTDI Single Port Serial Driver (EXPERIMENTAL)


Here's a udev rule you might want:

   SUBSYSTEM=="tty", ATTRS{manufacturer}=="FTDI", SYMLINK="lacrosse", MODE="0666"


This creates a /dev/lacrosse symlink to the appropriate /dev/ttyUSBx. This is especially important if you have multiple USB-serial adapters. I put that in /etc/udev/rules.d/99-local.rules . That's for a Gentoo system; Debian and others may be different.

You can use Open2300 to talk to the station. Open2300 is clean, simple, elegant, well documented, and has a good API for writing your own tools. UPDATE: Oct 29: If you're a Perl person, try my new Device::LaCrosse::WS23xx

UPDATE: Oct 16: The honeymoon is over. I'm a little disappointed by the unit:

  • Occasional bad data. Between 1-3 times a day, one of the data values is garbage. For instance, outside temperature goes to 136 or -20, or pressure goes to 4 or 40. This could be the Open2300 software, or the unit, or even the USB-to-serial adapter. I don't know, but it's frustrating.
  • No Wind Averaging. Wind speed and direction are instantaneous values, whatever the sensor happens to be reading at the moment it is queried. If you log every 5 minutes, you don't get a sense of what's really going on. If you want to average, you need to hook up the wired connection (wireless only updates every 2 minutes), log wind speed/direction every 32 seconds, and make your own averages.
  • Barometer doesn't work well at high altitude. The minimum pressure it handles is 22.44 inHg, which is about 29.70 inHg relative at our elevation (7200 feet). In other words, we're right near its limit. In practice, readings around and below 29.80 seem flaky.
  • Poor display. The LCD display is poorly thought out. There's no way to see outside temperature and rainfall simultaneously, you need to push buttons until you get the desired reading. But time and date, which are pretty useless for those of us with clocks, are constantly displayed. In practice, I just fire up my web page instead of looking at the LCD.


You get what you pay for. At $90, this was still a good deal. More importantly, I can afford it while the $1,000 Davis remains a distant dream. I don't care that much about pressure or wind speed: what I care about is rain, and to a lesser degree temperature. So I hope the rain gauge works...

Posted by Ed | Permalink | Categories: Linux

Mon Dec 18 7:44AM (2006)

rsync/cp/touch failure, davfs: SOLVED

The Problem:
# rsync -rv --inplace --size-only /local-path /mnt/jungledisk/subdir/
building file list ... done
rsync: open "/mnt/jungledisk/subdir/filename" failed: Invalid argument (22)

Solution: compile CODA kernel module (Filesystems -> Network Filesystems -> Coda).



...and next time, don't ignore this error message:
# mount /mnt/jungledisk
/sbin/mount.davfs: No free coda device to mount.
/sbin/mount.davfs: Trying fuse kernel file system.

Posted by Ed | Permalink | Categories: Linux

Tue Nov 28 7:22PM (2006)

Gentoo Encrypted RAID setup

...with LVM2 to boot. Documented here.

I started with Ubuntu but gave up: Mostly because the Ubuntu CD doesn't include LUKS, but also partly because I just didn't fall in love with Ubuntu. It's very sexy, but it was getting to be a pain to uninstall the fancy Gnome/KDE/XFCE nonsense and get a plain, simple environment.

Posted by Ed | Permalink | Categories: Linux

Sun Mar 26 11:10AM (2006)

Suspend2 on IBM Thinkpad R51

I just got Suspend2 working on my Thinkpad. Mostly I followed the Gentoo Wiki instructions. Here's the only problem I had:

Symptom: System prints "Freezing Processes", then hangs forever.

Solution: add "hsf" to the RestartServices line in /etc/hibernate/hibernate.conf :

    RestartServices hsf postfix alsasound


hsf is the Conexant HSF Softmodem.

The power button is not usable for suspend: it only triggers after a 3-second press, but after 5 seconds, it forces a poweroff. I can't see any way to make the button trigger after a light tap. So, plan B: use Fn+F12. To get acpid to recognize it, I followed the instructions at thinkwiki. The gist of it is:

    echo enabled,0xffff > /proc/acpi/ibm/hotkeys


...and write a custom /etc/acpi/actions/ibm/hotkey script which checks the key and runs hibernate.

Posted by Ed | Permalink | Categories: Linux

Wed Mar 15 6:42PM (2006)

Multihead X with Xorg, Geforce FX 5200, Samsung 204T

Got Multihead X working today! Here were the two big problems:

   (II) NV(1): Mode "1600x1200" is larger than BIOS programmed panel size of 1 x 1.  Removing.
   (II) NV(1): Not using default mode "1600x1200" (unknown reason)


Solution: use the nvidia proprietary (closed) drivers. Bummer, but I couldn't find any other solution. This was Xorg 6.9.0 on Debian.

Second problem: the second monitor remained blank, no matter what. I could move the cursor "into it", that is, I could move the mouse off the edge of my primary screen... but nothing happened on the new screen 1. It was completely dark. I tried everything for a long time; lots of xorg.conf edits, even using nvidia-xconfig.

Solution: move the cursor into the new screen, press Ctl-Alt-KPminus! That was all! Somehow that activated things magically, and the display appeared. It has been working perfectly all day since then, even after more X restarts.

(Update: April 1. I'm heading out on vacation, so I lent the new monitor to a friend. With a Mac. What took hours on my system took seconds on hers. Plug it in, it works. Want to rearrange the layout? Drag some icons. Want to rotate the monitor? Just click on a Control Panel pulldown. Sheesh. Sometimes it sure is frustrating to be a Linux person.)

Posted by Ed | Permalink | Categories: Linux

Sat Mar 11 9:33AM (2006)

Mailman, Postfix, Gentoo

I tried to set up mailman on Gentoo, using Postfix.

The Symptom: a bounce with this text:

    <listname@hostname>: Command died with status 2:
    "/usr/local/mailman/mail/mailman post everyone". Command output: Group
    mismatch error.  Mailman expected the mail wrapper script to be
    executed as group "mailman", but the system's mail server executed the
    mail script as group "nobody".  Try tweaking the mail server to run the
    script as group "mailman", or re-run configure,  providing the command
    line option -with-mail-gid=nobody'.


The solution:

Instead of adding mailman aliases to /etc/aliases, add them to /usr/local/mailman/data/aliases. Then modify /etc/postfix/main.cf:

  +alias_maps = hash:/etc/mail/aliases, hash:/usr/local/mailman/data/aliases
  +alias_database = hash:/etc/mail/aliases, hash:/usr/local/mailman/data/aliases


Yes, you need both lines.

Then make sure that /usr/local/mailman/data/aliases is owned by mailman.mailman, run newaliases, run 'postfix reload', and try again.

Posted by Ed | Permalink | Categories: Linux