Raspberry Pi & Ham Radio

So I’ve played around a bit with the Raspberry Pi embedded computer and a USB sound card (Soundblaster) in an attempt to use the soundmodem software TNC for APRS tracking. My initial impressions are that my current implementation (Raspbian “wheezy”) is not entirely up to the task. It appears that soundmodem is not able to reliably demodulate incoming AFSK data – perhaps due to an overloaded processor.

I’m working to optimize the current distribution I am using in the hopes that I can trim as much fat as possible – freeing up precious clock cycles for software decoding. In reality, this software solution should work without a hitch as the Raspberry Pi has more than enough processing power to FFT the audio and decode it that way. The reality is mostly missed frames at this point.

I have no doubt that the Raspberry Pi is a fantastic platform using an external stand-alone TNC, acting as an iGate or digipeater. My hope is to have a purely software implementation (aside from the sound card for audio input). I will keep plugging away at the kernel and peripheral modules – there has got to be a way to reliably decode packets in software!

Posted in General | 6 Comments

.. APRS with a what kind of pie?!

So I’ve been using Xastir (linux) to provide a sound-card modem for packet radio with quite a bit of success, however, it is kind of hackish and inconvenient to lug around a netbook for the sole purpose of APRS tracking.

TNC-X dedicated hardware TNC

TNC-X dedicated hardware TNC

To solve the problem of the kludgy netbook I tried a TNC-X which is a hardware TNC. I was quite happy to assemble the kit but quickly noticed a number of disappointments. With what appeared to be such a well thought out design, how in the heck did the author overlook galvanic isolation of the PTT circuitry?! Well, sure enough … the PTT no longer works so until I bother digging around in the circuit, I have a receive-only TNC. Total crap!

I got to thinking that perhaps I could just build my own damn TNC using an Arduino. I looked for some Bell 202 Modem ICs and keep coming up dry (or looking at a WAY over-priced MX614 IC). I know that it is possible to use the processing power of the Arduino to do “zero-crossing” frequency decoding, however, I am not sure how much I like that thought. Perhaps I’ll look at this sort of project as an academic endeavour.

Raspberry Pi development board

Raspberry Pi development board

Then the solution leaped out at me! I was staring blankly at a Raspberry Pi development board. If you haven’t heard of these yet, you surely will soon enough. The embedded ARM processor will happily run Linux thus allowing for a ton of flexibility – for free! In a form-factor little larger than a credit card, and at a price point of $35 you get the following:

  • 700MHz processor
  • 256MB ram
  • HDMI & composite video outputs
  • 2 x USB ports
  • Ethernet connectivity
  • SD Card (“hard drive”)
  • A ton of GPIO pins for hardware development
Raspberry Pi form factor

Raspberry Pi form factor

So, pop in a USB soundcard and it looks like I have a very capable soundcard modem TNC which can perform a myriad functions. Oh, and it draws a measly 3.5W (full load – ie. network, etc)

Holy crap! So, $35 for the embedded computer, $15 for a USB soundcard and $10 for an 8GB SD card. That is a $60 TNC-extraordinaire!

I’ll report back with the details soon enough!

Posted in Project | Tagged , , , , , , | 3 Comments

Yaesu FT-857D CAT control library for the Arduino

Well … I did it!

I managed to write and document an entire CAT control library for the Arduino (Wires) development platform. The library is very straight-forward and covers 95% of the functions available for CAT control.

For the time being, I have deliberately omitted the clarifier frequency control since I never use that function. I will however be adding that functionality in a maintenance release of the library. I’m just too pooped to care about it at this point.

I’ll clean up the code a bit tomorrow and then post a zip file with the complete library in the Downloads section of my blog site.

73s for now!

Posted in Project | Tagged , , , , , | Leave a comment

CAT control & ALC sensing complete!

I’ve finally managed to finish my Arduino CAT control project! Woo hoo!

The project took longer than anticipated due to a number of reasons, one of which being the fine weather we’ve enjoyed this summer (and all the camping that goes with it). The other reason was my focus on other things, namely, healing up well.

Leg in hard cast

Leg in hard cast

A few weeks ago, I fully ruptured my Achilles tendon while playing a spirited game of squash. (It turns out that racket sports account for the greatest percentage of Achilles tendon damage.) I opted for the surgical repair and went under the knife on Aug 2nd. I’m currently in a below-the-knee cast and will remain as such for the foreseeable future. The surgery went well and my wound site has healed extremely quickly (pic: 8 days post op) so I remain optimistic. I will be off work for the next little bit so I’ll have some time to look at radio projects!

RX and TX displays

RX and TX displays
External meter jack on FT-857D

External meter jack on FT-857D

The LCD display will indicate whether the radio is in RX mode (and hence the signal strength) or TX mode (the ALC level). This is all made possible because the FT-857D has an external meter port on the bottom of the front display. The ouput of the meter jack goes from 0V to 5V which is perfect for sampling with a simple 10-bit ADC such as that found in the Arduino. By mapping the values of voltage (0V = 0, 5V = 1024) to a smaller range (such as 0-128) we can display the data on a 16×2 LCD display quite nicely while retaining vital data.

To tell whether the radio is in RX or TX mode, I am passing the command:

boolean checkTX(){
  boolean TX = 0;
  byte cmdOut[5]= {0x00,0x00,0x00,0x00,0xf7};
  rigCat.flush(); // clear incoming serial buffer
  for (byte i=0; i<5; i++) {
    rigCat.write(cmdOut[i]);
  }

And then I wait for the resulting data to come back via:

  byte bytesIn = 1;  // only collect the first byte
  for(byte j=0; j<bytesIn; j++){
    cmdData[j] = rigCat.read();
  }

In all cases, unless the radio is actually transmitting, the data that comes back in cmdData[0] is = 255 so, we can simply finish with:

  if (cmdData[0] != 255) TX = true;
  return TX; // return the result to the function call
}

I am currently working on creating an Arduino library so that others may benefit from my bit-banging. Ideally, you will be able to declare a radio much like you would a variable and then pass commands to it via the FT857D library (and hence CAT commands).

A list of support functions is as follows:

  • lock on / off
  • PTT on / off
  • Set frequency
  • Set operating mode
  • Clarifier on / off
  • Clarifier frequency
  • VFO A / B swapping
  • Split operation on / off
  • Repeater offset direction (+, -, simplex)
  • Repeater offset frequency
  • CTCSS / DCS modes (encode, decode, encode & decode, off)
  • CTCSS tone / DCS code
  • Read RX status (squelch status, ctcss / dcs matching, disc. centr., S-meter data)
  • Read TX status (PTT, SWR status, split status, PO-meter data)
  • Read RX frequency & mode
Posted in Project | Tagged , , , , , | 3 Comments