Yesterday’s post was rather long, but was intended for mostly technical audiences outside of amateur radio. This post serves as a brain dump of volatile memory before I go to sleep for the night. (Human conscious memory is more like D-RAM than one might realise.)
So, many in our group use packet radio TNCs already, with a good number using the venerable Kantronics KPC3. These have a DB9 port that connects to the radio and a second DB25 RS-323 port that connects to the computer.
My proposal: we make an audio interface that either plugs into that DB9 port and re-uses the interface cables we already have, or directly into the radio’s data port.
This should connect to an audio interface on the computer.
For EMI’s sake, I’d recommend a USB sound dongle like this, or these, or this as that audio interface. I looked on Jaycar and did see this one, which would also work (and burn a hole in your wallet!).
If you walk in and the asking price is more than $30, I’d seriously consider these other options. Of those options, U-Mart are here in Brisbane; go to their site, order a dongle then tell the site you’ll come and pick it up. They’ll send you an email with an order number when it’s ready, you just need to roll up to the store, punch that number into a terminal in the shop, then they’ll call your name out for you to collect and pay for it.
Scorptec are in Melbourne, so you’ll have to have items shipped, but are also worth talking to. (They helped me source some bits for my server cluster when U-Mart wouldn’t.)
USB works over two copper pairs; one delivers +5V and 0V, the other is a differential pair for data. In short, the USB link should be pretty immune from EMI issues.
At worst, you should be able to deal with it with judicious application of ferrite beads to knock down the common mode current and using a combination of low-ESR electrolytic and ceramic capacitors across the power rails.
If you then keep the analogue cables as short as absolutely possible, you should have little opportunity for RF to get in.
I don’t recommend the TigerTronics Signalink interfaces, they use cheap and nasty isolation transformers that lead to serious performance issues.
For the receive audio, we feed the audio from the radio and we feed that via potentiometer to a 3.5mm TRS (“phono”) plug tip, with sleeve going to common. This plugs into the Line-In or Microphone input on the sound device.
Push to Talk and Transmit audio
I’ve bundled these together for a good reason. The conventional way for computers to drive PTT is via an RS-232 serial port.
We can do that, but we won’t unless we have to.
Unless you’re running an original SoundBLASTER card, your audio interface is likely stereo. We can get PTT control via an envelope detector forming a minimal-latency VOX control.
Another 3.5mm TRS plug connects to the “headphone” or “line-out” jack on our sound device and breaks out the left and right channels.
The left and right channels from the sound device should be fed into the “throw” contacts on two single-pole double-throw toggle switches.
The select pin (mechanically operated by the toggle handle) on each switch thus is used to select the left or right channel.
One switch’s select pin feeds into a potentiometer, then to the radio’s input. We will call that the “modulator” switch; it selects which channel “modulates” our audio. We can again adjust the gain with the potentiometer.
The other switch first feeds through a small Schottky diode then across a small electrolytic capacitor (to 0V) then through a small resistor before finally into the base of a small NPN signal transistor (e.g. BC547). The emitter goes to 0V, the collector is our PTT signal.
This is the envelope detector we all know and love from our old experiments with crystal sets. In theory, we could hook a speaker to the collector up to a power source and listen to AM radio stations, but in this case, we’ll be sending a tone down this channel to turn the transistor, and thus or PTT, on.
The switch feeding this arrangement we’ll call the “PTT” switch.
By using this arrangement, we can use either audio channel for modulation or PTT control, or we can use one channel for both. 1200-baud AFSK, FreeDV, etc, should work fine with both on the one channel.
If we just want to pass through analogue audio, then we probably want modulation separate, so we can hold the PTT open during speech breaks without having an annoying tone superimposed on our signal.
It may be prudent to feed a second resistor into the base of that NPN, running off to the RTS pin on an RS-232 interface. This will let us use software that relies on RS-232 PTT control, which can be added by way of a USB-RS232 dongle.
The cheap Prolific PL-2303 ones sold by a few places (including Jaycar) will work for this. (If your software expects a 16550 UART interface on port 0x3f8 or similar, consider running it in a virtual machine.)
Ideally though, this should not be needed, and if added, can be left disconnected without harm.
There are a few “off-the-shelf” packages that should work fine with this arrangement.
Shouldn’t need a separate PTT channel, it should be sufficient to make the pre-amble long enough to engage PTT and rely on the envelope detector recognising the packet.
FreeDV provides an open-source digital voice platform system for Windows, Linux and MacOS X.
This tool also lets us send analogue voice. Digital voice should be fine, the first frame might get lost but as a frame is 40ms, we just wait before we start talking, like we would for regular analogue radio.
For the analogue side of things, we would want tone-driven PTT. Not sure if that’s supported, but hey, we’ve got the source code, and yours truly has worked with it, it shouldn’t be hard to add.
Not sure who maintains EasyPal these days, not Eric VK4AES as he’s no longer with us (RIP and thank-you). Here, we might need an RS-232 PTT interface, which as discussed, is not a hard modification.
Most is covered by FLDigi. Modes with a fairly consistent duty cycle will work fine with the VOX PTT, and once again, we have the source, we can make others work.
Custom software ideas
So we can use a few off-the-shelf packages to do basic comms.
- We need auditability of our messaging system. Analogue FM, we can just use a VOX-like function on the computer to record individual received messages, and to record outgoing traffic. Text messages and files can be logged.
- Ideally, we should have some digital signing of logs to make them tamper-resistant. Then we can mathematically prove what was sent.
- In a true emergency, it may be necessary to encrypt what we transmit. This is fine, we’re allowed to do this in such cases, and we can always turn over our audited logs for authorities anyway.
- Files will be sent as blocks which are forward-error corrected (or forward-erasure coded). We can use a block cipher such as AES-256 to encrypt these blocks before FEC. OpenPGP would work well here rather doing it from scratch; just send the OpenPGP output using FEC blocks. It should be possible to pick out symmetric key used at the receiving end for auditing, this would be done if asked for by Government. DIY not necessary, the building blocks are there.
- Digital voice is a stream, we can use block ciphers but this introduces latency and there’s always the issue of bit errors. Stream ciphers on the other hand, work by generating a key stream, then XOR-ing that with the data. So long as we can keep sync in the face of bit errors, use of a stream cipher should not impair noise immunity.
- Signal fade is a worse problem, I suggest a cleartext (3-bit, 4-bit?) gray-code sync field for synchronisation. Receiver can time the length of a fade, estimate the number of lost frames, then use the field to re-sync.
- There’s more than a dozen stream ciphers to choose from. Some promising ones are ACHTERBAHN-128, Grain 128a, HC-256, Phelix, Py, the Salsa20 family, SNOW 2/3G, SOBER-128, Scream, Turing, MUGI, Panama, ISAAC and Pike.
- Most (all?) stream ciphers are symmetric. We would have to negotiate/distribute a key somehow, either use Diffie-Hellman or send a generated key as an encrypted file transfer (see above). The key and both encrypted + decrypted streams could be made available to Government if needed.
- The software should be capable of:
- Real-time digital voice (encrypted and clear; the latter being compatible with FreeDV)
- File transfer (again, clear and encrypted using OpenPGP, and using good FEC, files will be cryptographically signed by sender)
- Voice mail and SSTV, implemented using file transfer.
- Radioteletype modes (perhaps PSK31, Olivia, etc), with logs made.
- Analogue voice pass-through, with recordings made.
- All messages logged and time-stamped, received messages/files hashed, hashes cryptographically signed (OpenPGP signature)
- Operation over packet networks (AX.25, TCP/IP)
- Standard message forms with some basic input validation.
- Ad-hoc routing between interfaces (e.g. SSB to AX.25, AX.25 to TCP/IP, etc) should be possible.
- The above stack should ideally work on low-cost single-board computers that are readily available and are low-power. Linux support will be highest priority, Windows/MacOS X/BSD is a nice-to-have.
- GNU Radio has building blocks that should let us do most of the above.