RF Path Probing

We are trying to put up a 70cm amateur radio packet network, I started this by hacking together a connector last week. I really need to figure out where I can reach on 70cm.

Hibby and I tried to voice between my home and his, but were unable to hear each other. That isn't so bad, we really want to be able to get into my office where a friend can host a packet repeater.

I have remote access to work, so if I can get audio out of a radio onto the internet I will be able to do a remote check. The plan was to setup a pi, with an [rtl-sdr][6] and [rtl_fm][7] doing demodulation, ssh in and stream the audio back to where ever I am.

rtl_fm is an excellent tool, it can connect to an rtl-sdr stick and provide samples from the sdr. It can give you raw iq output or demodulate audio. This rtl_fm command can be used with the play (from the [sox][8] package to play broadcast fm.

$ rtl_fm -M wbfm -f 90.9M | play -r 32k -t raw -e s -b 16 -c 1 -V1 -

I referred to a blog post with an example of streaming audio over ssh using sox. To test audio streaming over ssh I pushed a copy of this amazing album and got lost for a while listening to it.

$ ssh -C sdr@192.168.1.181 "cat test.flac"| play -q -

rtl_fm will happily dump samples to stdout, a test with broadcast fm over ssh is:

$ ssh -C localhost "rtl_fm -M wbfm -f 90.9M " | play -r 32k -t raw -e s -b 16 -c 1 -V1 -

Broadcast FM is an excellent way to figure out if your demodulate pipeline is working, it is always running and it shits out a fuckton of power.

The command to demod narrow fm looks like:

$ rtl_fm -M fm -s 1000000 -f 145.800M -r 48k | play -r 32k -t raw -e s -b 16 -c 1 -V1 -

And it can be run over ssh:

$ ssh -C localhost "rtl_fm -M fm -s 1000000 -f 433.550M -r 48k "| play -r 48k -t raw -e s -b 16 -c 1 -V1 -

Hibby and I tried some calls to this station from his, but I wasn't able to hear anything. Probably something to do with both of us being in buildings facing away from each other. I will give this a try from mine and see what happens.


Reading: Normal

Of course before trying to do all this from my desktop I faffed about for two hours getting a pi up and running with FreeBSD. The pi wasn't able to handle the sdr without really choppy audio. Eventually while writing this up I noticed that the cable from the antenna was long enough to read my desktop. Oh well.

Look it is post 0x100

SHA1 Hash Collision

Its really windy, so windy that this plane couldn't land first try:

Google found a SHA1 Collision their blog post is much smarter than anything I could write about it.


Reading: Babylon's Ashes, Diamond Age

Know your Rockets


Reading: Crooked Little Vein

mosh NAT Script

In the past I required a custom script to mosh into my desktop, I was updating the script I use for this last night when I discovered it was no longer needed. I figured I might as well post the script here in case it helps someone else.

#!/bin/sh

# ########################################################## #
# wrapper for mosh to work with ssh's proxycommand directive #
# this only makes sense if the machine is directly reachable #
# from the internet using udp.                               #
# ########################################################## #

THISSCRIPT="`basename \"$0\"`"
REMOTE="$1"
REMOTEIP="$2"
NUM=`od -An -N1 -i /dev/random`
PORT=$((60000+NUM))

debug() {
    echo "[$THISSCRIPT] $@" >&2
}

usage() {
    debug "use me like this: $THISSCRIPT host [ip]"
}


# some default values
if [ -z "$REMOTEIP" ]; then
    if [ -z "$REMOTE" ]; then
        usage
        exit 1
    fi
    # does the remote have a hostname listed in .ssh/config
    REMOTEHOST="`grep -E -C1 \"^Host ([a-zA-Z0-9 ]+ )?$REMOTE( [a-zA-Z0-9 ]+)?$\" ~/.ssh/config | tail -n1 | gsed -r 's/\W*Hostname\W+//'`"
    if [ -z "$REMOTEHOST" ]; then REMOTEHOST="$REMOTE"; fi
    # resolve hostname
    REMOTEIP=`host -4 -t a $REMOTEHOST | head -n 1 | awk '{print $4}'`
    if [ -z "$REMOTEIP" ]; then
        debug "could not resolve hostname $REMOTE"
        exit 1
    fi
fi

debug "starting mosh-server on remote server $REMOTE $REMOTEIP:$PORT"
MOSHDATA="`ssh -t \"$REMOTE\" mosh-server new -i $REMOTEIP -p $PORT | grep '^MOSH' | tr -d \"\r\n\"`"
if [ -z "$MOSHDATA" ]; then
    debug "mosh-server could not be started"
    exit 1
fi

PORT="`echo -n \"$MOSHDATA\" | awk '{print \$4}'`"
MKEY="`echo -n \"$MOSHDATA\" | awk '{print \$5}'`"

if [ -z "$PORT" -o -z "$MKEY" ]; then
    debug "got no parseable answer"
    exit 1
fi

debug "starting local mosh-client to $REMOTEIP $PORT" 
MOSH_KEY="$MKEY" exec mosh-client "$REMOTEIP" "$PORT"

Reading: Crooked Little Vein

70cm Radio

We finally managed to get the programming software, radios and cables in the same room for the Motorola GM4340s we have. The radios are for doing 70cm packet data in Aberdeen, with them finally programmed and tested we need to make a computer radio interface.

The GM340 has an accessory connector on the rear, rather than hacking together something using the microphone jack we can use this. The connector is 0.1" pitch so we can just connect female pin headers to it.

Our connector needs to hook into audio in, audio out, PTT and ground. I soldered these connections on a strip of female pin header and connected them to two TRRS jacks that were lying around. I pulled off the PTT and a ground line to another block of female header so we could connect that to a GPIO on a pi.

With this hacked together connector we were able to do some packet between a pi and another radio.


It is Sunday, so that makes seven days of writing .

Reading: Diamond Age, Crooked Little Vein