Monday, 11 March 2013

PSK31 on the Raspberry Pi - Part 4

With everything set up as described in Part 1Part 2 and Part 3 open a LXTerminal window and type "alsamixer" at the command prompt. Press "F5" so that you can see the controls for the input to and the output from the USB audio device. Make sure the "Auto Gain Control" and the other "Mic" are muted, and that the "Speaker" and the "L R Capture Mic" controls are set to a low level. The AlsaMixer LXTerminal window should look like this:

Now you can minimize this window and launch LinPsk. Click on the "RX" button and tune your transceiver to one of the commonly used PSK31 frequencies. Use "AlsaMixer" if necessary to adjust the "L R Capture Mic" level so that you get a good signal to noise ratio as shown in the following screen shot:

Choose a nice clean signal and click on it. By default the "RX Freq/AFC" control will be set to "Wide" and this allows LinPSK will automatically lock on to the signal.

Once locked on you should see the decoded text appearing on the screen. It is really important now that you click on the "Wide" radio button to turn the AFC off - if you don't do this, the receive frequency will drift once the transmission ends.

Keep watching the waterfall for a few minutes and choose a clear frequency to call "CQ" on. While transmitting check the "ALC" meter on your Transceiver and adjust the "Speaker" level control on "AlsaMixer" so that the "ALC" meter just reads zero. This will ensure that your transmitted signal is "clean" and does not spatter all over the band.

You can continue to call "CQ" and wait for a reply, or you can click on a nice clean transmission and wait for them to call "CQ". You may wish to turn the AFC function back on temporarily by clicking on the "Wide" radio button so that LinPSK can lock on to the received signal, but remember to turn the AFC off again before the transmission ends. When the transmitting station calls"CQ" you can answer them by choosing the appropriate macro and have a QSO with them, but always keep an eye on your transceiver's "ALC" meter and if the reading starts to increase reduce the "Speaker" level control on "AlsaMixer" accordingly.

I've had a few successful QSO's using LinPSK on the Raspberry Pi, but the software does seem to require a good clean signal to decode reliably and seems to work best at fairly low audio input levels. I would be very interested in hearing from anyone else with a similar setup running LinPSK on the Raspberry Pi.

Sunday, 10 March 2013

PSK31 on the Raspberry Pi - Part 3

Launch the "LinPSK" application and click on "Settings" on the LinPSK menu bar and then "General Settings" to display the following window:

Enter your Callsign and Locator. For the "PTT Device" enter "/dev/ttyUSB0" as shown in the above screen shot. This instructs LinPSK to use the USB to Serial converter to key your transceiver. If you want to log your contacts (highly recommended) then you'll need to enter the necessary details under "Logging". I am saving my log to the file "mylog" in the "/home/pi" folder. Click "OK" to save your settings. Please note that LinPSK should create the log file automatically, but if you find you are unable to save log entries then you may need to create a blank file with your chosen name using "File Manager".

It is a good idea to check the operation of your setup before going live on the air. Connect a dummy load to your transceiver's antenna socket and tune your transceiver to one of the commonly used PSK31 frequencies. Click on the large square "RX" button on "LinPSK"

This will set LinPSK to receive - the button should now have a green dot on it and be labelled "TX". Click on the button again and check that your transceiver switches to transmit.

The button will now have a red dot on it (warning you that you are transmitting) and be labelled "RX", and the waterfall display on the bottom left corner of the screen will disappear.

Click on the button again to switch back to receive.

Finally, you will probably want to define a few macros to save you from having to type the same information repeatedly. You will be familiar with how to do this if you've used PSK31 (or any other data mode) before, but the process is quite simple. Click on "Settings" on the LinPSK menu bar and you have a number of options available to you for creating and editing macros (such as "Add Macros", "Edit Macros" etc).

For example, the macro I created for calling CQ is as follows:

pse k

Note that the macro switches the transceiver to transmit, sends the message, and then switches back to receive. You can create macros to almost fully automate your QSO's, but some people don't like this as it makes the contact very impersonal, but there is no question that macros are useful for standard calls and replies. The macros you create appear as buttons on the bottom right of the LinPSK screen.

The large text area on the top right displays the decoded text from the received signal, but the smaller text area just under it allows you to type "free text" for transmission. When your transceiver is switched to transmit anything you type here will be encoded and transmitted as you type. When I wish to chat freely I use a macro to switch my transceiver to transmit and give my callsign:


Then I type whatever I want into the transmit text area and when I've finished I use another macro to end the transmission and switch my transceiver back to receive:

pse k

Once you have the macros set up to your satisfaction you are ready to operate PSK31 using your Raspberry Pi.

Tuesday, 5 March 2013

PSK31 on the Raspberry Pi - Part 2

In "PSK31 on the Raspberry Pi - Part 1" I looked at how to configure the Raspberry Pi to receive and decode PSK31 using the "LinPSK" application. Now I'll consider how to encode and transmit a PSK31 signal. To do this we need some way of "keying" the transceiver and setting it to transmit before sending the PSK31 signal. I suppose you could do this manually, but it would very quickly become cumbersome to operate this way. Another alternative would be to use the transceiver's "Vox" function (where by the transceiver automatically switches to transmit when an audio input is present), but this carries with it the risk of making spurious transmissions (for example when system sounds are generated).

The best way to key the transceiver is to directly control the PTT input using a serial (com) port. The Raspberry Pi does have a serial port of sorts as part of the GPIO interface, but this port uses 3.3V TTL logic and as such it can not be connected directly to other RS232 devices. This problem can be solved by using a "level shifter" device (like the MAX3232 chip) and this will be the subject of a future post.

The alternative is to use a USB to Serial converter like the one shown below which is available from Cut Price Cables.

However using a USB to Serial converter with the Raspberry Pi can be problematic depending on which chipset the converter uses, but most of the incompatability issues have been resolved with the latest release of the operating system kernel and firmware. If you do run into incompatability problems you can download and install the latest available kernel and firmware by following the instructions given in this blog post.

Another problem I encountered was that when the USB to Serial converter was connected to the Raspberry Pi via my unpowered USB hub, the behaviour of the USB keyboard and mouse became unreliable. The USB to Serial converter proved to be one device too many and overloaded the Raspberry Pi's USB port. The solution to this problem is to use a powered USB hub. As it's name suggests, the powered hub has its own power supply and therefore does not overload the Raspberry Pi's USB port. A typical powered USB hub (which is available from Cut Price Cables) is shown below:

I connected the powered USB hub to one of the ports on my Raspberry Pi and connected all the USB devices to the hub, except for the USB audio device which I connected to the other USB port on the Raspberry Pi. When the Raspberry Pi is powered up it should detect and install the hub and all the devices connected to it automatically.

Now it is just a case of connecting the "serial" end of the USB to Serial converter to your transceiver (preferably via an isolating interface) using a suitable cable. You will also need to connect the audio output from your transceiver (via an isolating interface) to the input on the the USB audio device and connect the output from the USB audio device to the auxiliary audio input on your transceiver (again via an isolating interface).

You should now have all the hardware and software you need to operate PSK31 on the Raspberry Pi. All that remains is to set up the "LinPSK" application to key your transceiver using the USB to Serial converter, write a few macros, and set up logging of contacts. I'll look at how to do this in my next post.