Setting up Soundmodem in a Terminal Environment

You need a simple manual to jump into packet radio networking with soundmodem? You have the radios and your data cables ready at your hand with boards and everything? Just follow this guide thoroughly and you should have no problem.

What you need for both sides:

  • Any linux machine with two USB ports and a Linux based operating system with FTDI USB-Uart driver. During the development we have used Alix 2d13 from PcEngines. And during development we have installed Voyage-Linux on them. Note that soundmodem is not yet compatible with Bifrost OS due to the current lack of alsa drivers.
  • Any 70 cm (433 MHz) or 2m (144 MHz) band amateur radio which you can interface through a data cable (more on this later on this page). During development we have tested MAAS AHT-2-UV and Yaesu FT-8900 radios.
  • Interface card for the radios. These cards are not sold anywhere but you can build one very easily on your own. The schematic and a photo of such a card is below. I haven’t drawn a PCB since it is a very easy-to-build circuit.
  • A USB TTL UART cable that allows CTS/RTS signalling with 3.3 V or 5 V signal level. We prefer using FTDI cables for the purpose.
  • A USB Audio Fob which can be bought for a very cheap price. We have used a simple generic alsa compatible CM108 based audio fob. If you google you can find one easily and for very cheap price. Here is an example amazon search for it.
  • A matched antenna for whichever band you prefer to use. For the 2m (144 MHz) band we used  Yaesu CR-8900 Antenna and for the 70cm (433 MHz) band we used the built-in antenna of the MAAS handheld radio.
  • And finally you have to install the soundmodem software from the apt-get repository.
sudo apt-get install soundmodem
  • And optionally you need the aplay tools and alsamixer to check the configuration of the sound card.
sudo apt-get install aplay alsamixer
Simple audio leveler and push-to-talk circuit
Simple audio leveler and push-to-talk circuit
Photo of a Simple audio leveler and push-to-talk circuit
Photo of a Simple audio leveler and push-to-talk circuit

Hardware Setup:

  • Note that this hardware setup manual is only valid for the devices that I have used. If you have the same or similar devices keep going. But you should at least read it to get the idea of it.
  • I have built a circuit with several patch cables, which allows the user to switch radio types and use the same board.
  • For handhelds the cable connections should be as below picture. The red connector is `Audio Out From USB Audio To Audio In of Radio`. The green connector is `Audio In To Usb Audio From Audio Out of Radio`. The yellow connector is the ground connection. The white connector is the Push-to-Talk connection. The usb serial (FTDI cable) should be connected to the 6-pin connector with the black stripe. The black stripe represents the ground line.
from_pc_side_board1
from pc side soundmodem interface board
from radio side interface board
from radio side interface board
  • I have built 2 interface cards, unfortunately they are not exactly the same due to lack of equipment at hand. On of these boards has a 4-wire connection for Yaesu and the other has 6-wire connection for Yaesu. In the end 2 of the extra wires are not actually used, but the color differences make it rather confusing to set it up. See image below.
from radio side interface board #2
from radio side interface board #2
  • For the board with 6 wires, colors of the cables, their functions and the end-points are in the image below and table below. Table is taken from YAESU FT8900R Operating Manual. Note that the colors in the operating manual do NOT match our cable’s colors.
yaesu interface table
yaesu interface table
radio data interface cable
radio data interface cable
  • For the other board (with 4 wires), the colors are the same except for black and yellow cable. In the board with 4 wires, the black cable stands for ground and the yellow stands for PTT.
  • Now, you are ready for software setup. In any case; be sure that both radios’ output volume setting is adjusted to a mean level. For handhelds, this was three stripes turn for me.
  • Finally, needless to say but you MUST set both stations to the same frequency.

 Software Setup:

  • First we are going to find out the card number of the usb audio fob that we plug in. This command will list the sound cards that your system sees.
sudo aplay -l
**** List of PLAYBACK Hardware Devices ****
card <span style="color: #ff0000;">0</span>: Intel [HDA Intel], device 0: STAC92xx Analog [STAC92xx Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card <span style="color: #ff0000;">0</span>: Intel [HDA Intel], device 1: STAC92xx Digital [STAC92xx Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
  • My system was using its own soundcard, so I will be using card 0 from now on. But if you have a CM108 based audio card you should be able to identify it since it’s label will contain ‘C-Media Audio’ or something like that.
  • After that you should open the audio settings for that card using alsamixer to set the audio levels.
sudo alsamixer --card 0
  • These settings are up to you but my working settings were speaker output 100% and mic output setting to 0%. After that you should press tab and get into the audio capture settings. My setting for audio capture (mic input) was 25% (6 dB).
  • Now for good practice you should set the right permissions for the USB Uart cable for read/write permissions. Assuming that your USB Uart cable is mounted to /dev/ttyUSB0:
sudo chmod 666 /dev/ttyUSB0
  • A very little configuration is left. Now it is time to set the soundmodem settings. If you have a window system (remote or local), you should have a utility called soundmodemconfig. This tool eases the job a lot, but it is possible to configure soundmodem without this tool. And for now we assume that we don’t have this tool. But in any case I have posted here sample screenshots of the utility.
sudo nano /etc/ax25/soundmodem.conf
  • A sample soundmodem.conf file is like below
<?xml version="1.0"?> <modem>
 
<configuration name="alp"> <channel name="Channel 0">
 
<mod mode="afsk" bps="1200" f0="1200" f1="2200" diffenc="1" inlv="8" fec="3" tunelen="32" synclen="32" filter ="hamming"/>
 
<demod mode="afsk" bps="1200" f0="1200" f1="2200" diffdec="1" inlv="8" fec="3" mintune="16" minsync="16" filt er="hamming"/>
 
<pkt mode="MKISS" ifname="sm6" hwaddr="TA2IAS-6" ip="10.0.0.6" netmask="255.255.255.0" broadcast="10.0.0.255"
 
file="/dev/soundmodem0" unlink="1"/>
</channel>
<chaccess txdelay="400" slottime="200" ppersist="40" fulldup="0" txtail="10"/> <audio type="alsa" device="plughw:1,0" halfdup="1" capturechannelmode="Mono"/> <ptt file="/dev/ttyUSB0" gpio="0"/>
 
</configuration>
  • The <mod> and “<demod>” tags should be the same as example. You shouldn’t modify them.
soundmodemconfig modulator
soundmodemconfig modulator
  • The <pkt> tag’s mode should be `MKISS` as in the example. `ifname` is the interface name. This name will be the name in ifconfig. `hwaddr` should be a unique callsign (based on your amateur radio callsign). `ip` should be a unique IP address in the network you want to set. `netmask` should stay the same as in the example. And finally the `broadcast` should be set according to the `ip`. The rest of the settings need not to be touched.
soundmodemconfig packetio
soundmodemconfig packetio
  • The `<chaccess>` tag is also very important. If you are going to use Yaesu radios the `txdelay should be 150 and `slottime` should be 100. But if you are going to use the MAAS handhelds the `txdelay` should be 400 and `slottime` should be 200. The rest of the settings need not to be touched.
soundmodemconfig channelaccess
soundmodemconfig channelaccess
  • The `<audio>` tag should be set according to the usb audio. `type` is always `alsa`. `device` is set according to the card number(let’s say X). So the `device` should be `plughw:X,0`. The rest of the settings need not to be touched.
soundmodemconfig io
soundmodemconfig io
  • Finally `<ptt>` tag should be set according the usb serial (FTDI cable). The `file` setting should be set to the `/dev/ttyUSB0`. The rest of the settings need not to be touched.
  • Now we are going to set the settings for axports file. This file is used by applications which DOESN’T use IP layer on top of AX.25 (e.g. aprx, xastir). This is a very simple file with only one line with it.
sudo nano /etc/ax25/axport
#/etc/ax25/axports #
# The format of this file is: #
# name callsign speed axport6 TA2IAS-6 1200
paclen window 255 7
description
144.8 MHz APRS (1200 bps)
  • The `name` should be something that you define it will be required by applications like aprx or xastir. The `callsign` MUST be the same callsign that you entered in the `soundmodem.conf`. The speed, paclen, window and description need not to be changed.
  • Now you are ready to start the soundmodem. You can start soundmodem by typing `soundmodem &`. After that check that your interface has showed up in ifconfig by typing `ifconfig`.
  • When you see the ifname that you typed in earlier (which was sm6 for me), in the interfaces list, it means you are good to go.
  • One important note is that you should NOT try pinging to test the connection. This radio based connection is a very slow and a half-duplex one. Pinging it without appropriate parameters will only result in failure. If you want to ping to test the connection you should give at least 20 seconds between each ping and 30 seconds of timeout for each ping packet.
  • In my experience best way to test connection is to use xastir to message between two stations. I will not be telling about it here, there are a lot of resources out there. But basically, the levels of verification are like below:
  1. Check that you can actually speak to a person between two stations. If you cannot understand or hear each other, don’t expect to computers to do that. This probably means you have a bad transmission/reception between stations, you can try a radio with more power, or you can check your antenna gains, or you can replace the locations of your antennas for better line of sight
  2. Check that when you run soundmodem on one side, the other side is getting something (it will sound like an old 56k modem dialing up). You -yourself- won’t be able to understand if it’s proper or not but if you can’t hear it don’t expect to go on. In this case you probably have problem with your audio levels, try playing around with audio levels in your radio and/or in your interface card and/or alsamixer. You should know that getting the right levels is a tedious and patience-requiring. Don’t expect to find the right levels in a minute. It can take hours. If you have a window system best way to debug audio levels is to use the soundmodemconfig utility which comes with a bunch of diagnostics utilities such as audio oscilloscope, audio frequency spectrum and simple modem.
soundmodemconfig scope
soundmodemconfig scope
soundmodemconfig spectrum
soundmodemconfig spectrum
soundmodemconfig modem
soundmodemconfig modem
  1. (Optional) If you know how to use xastir and have a window system, you can try using amateur radio messaging system that comes with APRS system to check that you can transmit digital messages.
  2. If you are here and still having problems, my best guess is that your delay settings are not enough. Most radios put a delay between the time you press push-to-talk and the time transmission actually starts. Sometimes you can feel this delay when you are talking with a walkie-talkie. The problem is; if you don’t put enough txDelay your computer may and probably will start “speaking” before actual transmission begins. Which means every packet that you transmit will be cut off from the beginning. To solve this, you can try setting the txDelay in chaccess setting in soundmodem.conf to a relatively high level (like 600 ms). And decreasing it until you find a hot-spot. Same problem sometimes also occurs when transmission ends. If that might be the case increase the txTail setting in chaccess setting in soundmodem.conf to 50. 50 milliseconds of tail time is usually more than enough and mostly harmless to solve this issue.

After you have a connection:

  • If you wan’t to use sensd to reach your sensor data. I would suggest using the original sensd project. It has a built-in javascript extension in it. So what you can basically do is to set up a simple web server and run the original sensd project as susggested. This way; even if it would extremely slow you can reach the latest wireless sensor network data in a visually nice way. And it’s fairly easy to set it up.

Finally; remember that there isn’t much documentation about this on the internet. So if you have a question, ask it below and I’ll try to answer. In such way we can build up a knowledge base.

One thought on “Setting up Soundmodem in a Terminal Environment

  • August 10, 2015 at 3:07 pm
    Permalink

    Unfortunately it is. When I was working on this, every resource that I could find was suggesting to use an analog leveler to adjust the signal levels to an optimal state. I was using a very cheap usb audio fob which wasn’t helping the issue. But chances are you’re gonna have more quality if you use an actual sound card. The general rule is though, even if you have the most advanced digital signal processing, it’s useless if you don’t obtain a proper analog signal first.

Comments are closed.