Author: scruss

  • Pi Sandwich

    I retired the cardboard case this morning, as I got some proper enclosures:

    Looks a bit like a little red Orac, no?

    This case is a Bud Industries Pi Sandwich. They’re cheap ($5) but very basic. Comprised of two identical halves, you could (if you weren’t fussy about having the top off) house two Raspberry Pis in a single case.

    The downsides are:

    • The clip retainers aren’t that tough, and the computer board can pop out under minor torsion. Make sure you’re supporting the board while you’re putting in the connectors.
    • The box is taller than it needs to be. While this is great for giving space for GPIO cables, there’s a big empty space underneath. I wonder if there’s enough room to jam in a LiPo battery, a DC charger and a Minty Boost-like thing to act as a mini-UPS, with the board lying on top?
      (This device would of course be called a llow, so it would be a Raspberry Pillow. Ahem.)
    • The really nice flat acryllic box sits so flat on smooth surfaces, it sticks, yet still slides about. Sticky feet would help.

    It’s a case. It stops the Raspberry Pi shorting out or getting too dusty/things spilled on it. It’s cheap. It works. I’m happy with it.

  • Sunset near Long Branch

    Sunset near Long Branch

    Instagram filter used: Earlybird

    Photo taken at: Long Branch GO Station

    View in Instagram ⇒

  • learning to tolerate python

    Python is okay, I guess, but there’s not a hint of music to it. I’m a dyed-in-the-wool Perl programmer since 4.036 days. When I think of how I’ll solve a programming problem, I think in Perl (or, more rarely, in PostScript, but I really have to be pretty off-balance to be thinking in stacks). I’m learning Python because all of the seemingly nifty open source geospatial software uses it, and if I’m to write anything for or about the Raspberry Pi, it seems that Python is the language they officially support on it.

    So I’m learning Python by porting some of the simple Perl tools I use around here. It’s painful, not just dealing with the language Fortranesque space-significance, but also physically; I think I put my shoulder out picking up Mark Lutz‘s giant books on Python. The first program I chose to port matches input lines against known words in the system dictionary file. Here’s the Perl version:

    #!/usr/bin/perl -w
    
    use strict;
    use constant WORDLIST => '/usr/share/dict/words';
    
    my %words;
    open(WORDS, WORDLIST);
    while () {
        chomp;
        my $word  = lc($_);
        $words{$word}++;
    }
    close(WORDS);
    
    # now read candidate words from stdin
    while (<>) {
      chomp;
      $_=lc($_);
      print $_,"\n" if defined($words{$_});
    }
    
    exit;
    

    I most recently used this to look for available call signs that — minus the number — were real words. The input lines from the available call sign list look like this:

    VA3PHZ
    VA3PIA
    VA3PID
    VA3PIF
    VA3PIH
    ...

    so if I strip out the 3s and run it through the program:

    sed 's/3//;' va3_avail.txt | ./callsigncheck.pl

    I get one hit: vapid. Which is now my call sign, VA3PID. Moohah.

    The Python version is much shorter, and I’m semi-impressed with the nifty little trick in line 5 (aka ‘dictionary comprehension’) which offers some hope for the future of terse, idiomatic code. The fileinput module gives Perlish stdin-or-ARGV[] file input, without which I’m sunk.

    #!/usr/bin/python
    import fileinput                        # Perl-like file input
    
    # get our wordlist
    words={w.lower(): 1 for w in open('/usr/share/dict/words', 'r').read().split()}
    
    # read through input looking for matching words
    for l in fileinput.input():
        ll=l.lower().rstrip()
        if words.get(ll, 0):
            print(ll)
    

    (So far, I’ve found the PLEAC – Programming Language Examples Alike Cookbook useful in comparing the languages.)

  • Fattery

    I’ve had my MacBook for just over three years (just past AppleCare, alas), but recently the trackpad had been acting up. I couldn’t get it to click and drag at all. Opening up the case showed me that the battery was getting a bit, well, tubby — something that apparently happens as Lithium Ion batteries age.

    I finally ordered a new one, and it came today. It’s nearly 50% slimmer, and sits flat on the table, unlike the old battery. My trackpad works perfectly again.

  • Ahh, the smell of charring FR-2 …

    Mike Cook’s Raspberry Pi Breakout Board. My first stripboard build. No, I’m not showing you the solder side …

  • Chirp is a thing

    Chirp is a new annoyance, a way of sending links and stuff via audio. Sounds like it’s doing it via MFSK, and is only sending the ID of the link on Chirp’s server, as there’s not much data sent. Here’s what the spectrum plot looks like:

    This is what it sounds like: test chirp [mp3].

  • 330s

    330s

    Instagram filter used: Lo-fi

    View in Instagram ⇒

  • Raspbian ftw!

    Raspbian is good. If you haven’t upgraded your Raspberry Pi to run it — or any other hard float distro — then you should. It makes the little board seem positively zippy.

    The processor on the Pi is an odd beast. It’s an ARMv6, somewhere between the ARMv5 that the original Debian distro supported, and the ARMv7, which has to have hardware floating point support. The Pi’s processor has floating point in hardware, but it wasn’t supported in the first distribution. Raspbian fixes this, and also has a nice hardware setup wizard (which I wish I’d known about before I spent a while preconfiguring the SD card on another Linux box, grr).

    My highly unscientific benchmark of how fast a computer is is encoding an audio file with ‘lame -V2′. If it comes out faster than real time, it’s fast enough. My first trial in late June came out at a dismal 27% real time — so that would mean that a 4 minute song would take 14′ 49″ to encode. Very poor. Trying it again with Raspbian today gave me 209% real time — so that same song would be done in 1′ 55″. Much better.

    While I was fossicking about with the Pi, I switched its power adapter over to a battery-backed outlet on my UPS. With summer storms, our power has been a bit glitchy, and the tiny USB power supply wasn’t able to ride through any of them. This, I hope, will allow me to have an uptime better than the time between storms …

    I also made this last week:

    It’s a GPIO breakout, a sort of home made Adafruit Pi Cobbler. It’s on a tiny 13×4 fragment of stripboard. The soldering was fiddly, as stripboard is only single sided, so there was much fine tipped soldering iron action (and swearing). I now have the parts to built Mike Cook’s Breakout board with zener diodes providing protection, but this will do for simple applications if I’m careful.

  • Ontario Hamfest yesterday

    Glad I went to the Ontario Hamfest yesterday — I won the Superprize! It is quite super; it’s an ICOM V80 2m HT. Built like an absolute tank; it feels heavier than my Kenwood TH-D72. Thanks to Burlington Amateur Radio Club for organizing the event, and to Radioworld for donating the prizes.

    (If I want to get a little grinchy on this, the prize ticket said it was going to be a V82, a much pricier dualband HT, but hey! a free radio …)

    It was an enjoyable event, if small by comparison to Hamvention, but then, everything is. Was pleased to see an Arduino/µC vendor at the show – Bill, of Aztec MCU Prototyping. Bill had some of his Omega MCU Systems boards for sale, which mostly feature ZIF sockets for rapid prototyping. I bought the Arduino-compatible (in software, if not pinout) Omega-328U board, and the PICAXE-based D-Axe. So that means I have even more types of µCs to learn!