In my continued efforts to utilize minimodem to transmit data via sound over a medium (such as a radio or cell phone) has yielded some great results. I have been able to transmit an image (a gif file of several signal flags) as an actual image rather than as a text representation of the image. While this does work, it became rather slow and tedious, but has been a great learning experience!

As we know from our last post, we can only transmit data as text with minimodem (as far as I know). So we were breaking files down into hexidecimal text with the xxd command:

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

The flags.gif file then gets broken down into hex and re-assembled into a copy of itself. This works very well and was readily available on my system. So I just wanted to put minimodem into the middle of the mix, but it didn’t work. Before, I had no success with the following:

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

When reviewing the file, some chunk at the beginning would be missing. I thought that perhaps there was too much “noise” and errors had been produced. Another idea was that minimodem “signs” the beginning of the sent product. However, today I realized that there is actually some sort of buffer problem in the redirect, and that I just needed to slow it down.

First I made some smaller copies of the file.

$ convert -resize 10×10 flags.gif smflg.gif
$ convert -resize 100×100 flags.gif medflg.gif

For posterity, I then made the files into hex for file size comparisons:

$ xxd medflg.gif > xxdmedflag
$ xxd smflg.gif > xxdsmflag
$ xxd flags.gif >xxdflag

$ ls -lah x*
-rw-r–r– 1 user user 45K Jun 5 12:06 xxdflag
-rw-r–r– 1 user user 15K Jun 5 12:06 xxdmedflag
-rw-r–r– 1 user user 1.3K Jun 5 12:06 xxdsmflag

Compared to the originals:

$ ls -lah *.gif
-rw——- 1 user user 11K Aug 12 2014 flags.gif
-rw-r–r– 1 user user 3.4K Jun 5 11:51 medflg.gif
-rw-r–r– 1 user user 289 Jun 5 11:31 smflg.gif
-rw-r–r– 1 user user 11K Jun 4 09:58 stillflags.gif

Notice that the hex versions of the files are roughly 4 times larger than the original. Now I was ready to send the test files.

Sender: $ xxd smflg.gif | minimodem -t 200
Receiver: $ minimodem -r 200 -c 0.8 > xxd.dump
### CARRIER 200 @ 1250.0 Hz ###
### NOCARRIER ndata=1258 confidence=0.95 throughput=200.00 (0.0% fast) ###
Receiver: $ xxd -r xxd.dump > smallfile.gif
<<<<<<<<<<<< About 1 minute. >>>>>>>>>>>>>>>>

Sender: $ xxd medflg.gif | minimodem -t 200
Receiver: $ minimodem -r 200 -c 0.8 > xxd.dump
### CARRIER 200 @ 1250.0 Hz ###
### NOCARRIER ndata=14466 confidence=0.94 throughput=200.00 (0.0% slow) ###
Receiver: $ xxd -r xxd.dump > mediumfile.gif
<<<<<<<<<<<< About 11 minutes. >>>>>>>>>>>>>>

What we found was a perfect copy of the original file! I did not bother sending the original, as it would be a 45k transfer (45*1024*8/200/60=31 minutes.) The math is Bytes*bits/baud/60 seconds to calculate minutes. We could try faster speeds, but I have found through various attempts that more than 300 seems to produce too many errors on my laptops transmission/reception. It could be that I need to adjust the sound volumes and gains for my speakers and microphone, or that I should capture the file as audio and then use minimodem to decode it.

For example of practicality, visiting the website http://atinout.sourceforge.net/ revealed a download of 23 KBs of data (using the command line tool nload for figures). At this speed, downloading that page would constitute a little less than 16 minutes, and it is a very simple page. Sending the above photos by using jp2a to convert them to ascii art sends the pictures in meer seconds, but then they don’t look like the original, as we saw in the last post on this subject. However, this is about theory, rather than just practice, so I feel we have stepped in the right direction. Now I just need to make some scripts to automate the process for ease of use. Then we can work on programming a transmit/receive function.

Also, after visiting minimodem’s website (http://www.whence.com/minimodem/) we find that it has been developed up to version 0.21 as opposed to the version in the repositories which is version 0.8.1! So it has come a long way. It also has some nifty features in the later versions, so I’m going to download some source and try it out! Hats off to Kamal Mostafa for creating this really neat program for geeks like me!

Linux – keep it simple.

One Reply to “Transmitting data through sound with Minimodem”

Leave a Reply

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