In my free time I have been involved in a little side project involving sound, data, and communications. The end goal is to transmit data wirelessly via a cellular phone by using audio during a phone call. I know, quite a mouthful and a pretty interesting project. My “theory to practice” project is just in the beginning stages, but I have had some fun so far and thought I would share. Ultimately, I know that the theory of it is sound, but in practice will never be practical. There is a reason that most of us have moved away from dial up modems!

So I needed a tool to convert an input to an audio sound, and a quick search online led me to minimodem. This program is really cool! It allows the user to input something, which is converted to a sound, output through the speakers, and can be input via microphone on another computer and converted back into data. I downloaded from the repository, it is readily available in Debian.

# aptitude install minimodem -y

You also may need to start pulseaudio if it is not already started. Do this as a normal user.

$ pulseaudio –start

Once it was installed, I then got to work using it at the transmitting computer:

$ minimodem -t 300

After you press enter, you now are going to transmit anything you type at a baud rate of 300. Whatever you type will be translated into an audible tone that sounds like the old dial up modems. On the receiving computer, you type:

$ minimodem -r 300

Note that the number is the baud rate. Technically, you could set the baud rate to just about anything, however, it recommends under 1200 at the developer website due to noise interference. So now, as I type things like “hello” and press enter, that is then displayed on the receiving computer. At least, it was supposed to. I realized that I needed to adjust the microphone and speaker settings. This actually took a while. Too much gain, and the signal would break up with errors in it. Too little gain, and you wouldn’t receive anything. Audible transmissions were doing pretty well, but not at a faster baud rate than 250.

The audible tone is also really annoying to listen to for any length of time. So I scrounged around and found an audio cable, and plugged one computers headphone jack into the other computers microphone jack. This not only allowed me to work in silence, but it also reduced background noise, static, and increased the speed. I could now receive and transmit at a baud rate of 1200 which really sped things up!

Now that the connection was working fairly solid, I could then play with delivery. Rather than hand typing messages, I used a pipe to direct input into minimodem:

$ man minimodem |minimodem -t 1200

Which gave me an output of:

$ minimodem -r 1200
### CARRIER 1200 @ 1200.0 Hz ###
.*….5(1) MINIMODEM(1)

minimodem – software audio Bell-type or RTTY FSK modem

minimodem –tx [options] {baudmode}
minimodem –rx [options] {baudmode}
……….. (abreviated) ……………….

Great! Now I felt like I was really getting somewhere! As you can see from the picture, I had some fun with another program called jp2a, which converts pictures into ascii text. This allowed me to send myself pictures over my new found communication medium. As you can see, I utilized xterm with a black background to really help the pictures stand out.

Sender: $ jp2a debian_vs_ubuntu.png |minimodem -t 250
Receiver: $ xterm -fg red -bg black
Receiver: $ minimodem -r 250

In case you are wondering, I did try the –color option to jp2a, but the characters do not come out at all that way over minimodem.

As far as I can tell, minimodem doesn’t take anything other than text and converts it into a signal and back again. So I now needed a way to convert things into text so I could pass them over minimodem. I thought an easy one might be xxd, which converts files into hex. I decided to try it out locally before transmitting.

$ xxd flags.gif
0000000: 4749 4638 3961 db00 2b02 b300 00ff ffff GIF89a..+…….
0000010: 0033 ffcc 0066 ffff 00ff 0066 ffcc 0000 .3…f…..f….
0000020: 66ff 0000 ffff cc33 ffff 3300 33cc 0066 f……3..3.3..f
0000030: ccff 0000 ff00 33cc 0033 0000 0021 fe15 ……3..3…!..
0000040: 4749 4620 536d 6172 7453 6176 6572 2056 GIF SmartSaver V
0000050: 6572 312e 3100 2c00 0000 00db 002b 0200 er1.1.,……+..
0000060: 04fe f0c9 496b 0835 57c0 bbff 6028 8e64 ….Ik.5W…`(.d
0000070: 596a 68aa 3e66 ebbe b0c7 b681 51df caad Yjh.>f……Q…
……….. (abreviated) ……………….

$ xxd flags.gif | xxd -r > stillflags.gif

That was a success. It essentially made a copy of the file. So I decided to try it with minimodem:

Sender: $ xxd flags.gif |minimodem -t 1200
Receiver: $ minimodem -r 1200 | xxd -r > flags.gif

Unfortunately it didn’t work. After transmitting and receiving, the file was not readable. So I made several attempts with text files and found a few slight problems. First, if there is any noise, then errors appear in the text. Second, when sending information, minimodem appears to append some sort of character set at the beginning of the transmission. Something that tells the receiver to “pick up”. Somewhat like a calling card or signature, minimodem marks the transmission. So, I will have to play with it to see if I can choose a setting that allows me not to have that, or to have a delay afterword, which could also be programmed on the other end.

Either way, it has been really fun trying this out so far. I look forward to playing with it some more.

Linux – keep it simple.

3 Replies to “Minimodem: Sending digital information via analog sound!”

  1. I don’t know a whole lot about it, but I believe the Ham Radio operators have been doing this sort of thing for years to tx/rx data to/from remote locations, and it is even possible to connect to the internet via ham radio relays if you know what you are doing. I believe all of the tools are free software. With a quick search in the Jessie repos, I saw “gmfsk” and “soundmodem” as two packages you might be interested in. I think some of the guys on the aklug list are experts at this.

Leave a Reply

Your email address will not be published. Required fields are marked *