WSJTX on the Beaglebone Black

 

BEAGLEBONE RUNNING WSJTX

 

Someone on one of the email lists to which I belong asked for help re: putting wsjtx on a Beaglebone Black. Here is my recipe, that worked with no significant issues. Suggested improvements are welcome.  What is below is accurate information as of March 28, 2015.

 Note that there is a precompiled version of wsjt-x available for the Beaglebone Black.  You can download and install it by doing sudo apt-get install wsjtx.  I would definitely recommend that you try this and if it works for you, great, and you need to go no further on this page.  However, I found that the decoding speed of this version on the Beaglebone Black was very slow, sometimes taking the entire period of the next exchange, and also that the input of audio data would also stop after several minutes requiring me to quit wsjtx and then restart it.  The details of  this installation were: Wsjtx v1.1 r3496.  Audio settings in wsjtx with my system: 3 32 Alsa pulse for both input and output. 

The version that I ended up compiling from source as described below is v 1.5.0-devel.  The audio settings in wsjtx for it with my system are sysdefault:CARD=USB, for both input and output.  This version decodes quickly, and I ran it for 10 hours with no stops or crashes before I went on to other things.

For testing both the old and the new versions I used for my audio input and output a venerable EMU 0202 USB audio interface.  Debian recognized the device, so that there was no need to mess with drivers.  For the radio providing audio input I used an openHPSDR Hermes, running a modifed version of KissKonsole on a Windows 8.1 machine.

Other than the usual "recipe" items it was necessary to update wheezy to jessie and to add a swapfile. No big deal, and everything went smoothly once those items were addressed.  I added below [and tested] a modification to the procedure to avoid the need to make a swapfile.  Making this modification also substantially speeds up the build process.

Here is the list of instructions:


NOTE THAT IF YOU DON'T HAVE A NEW ENOUGH VERSION OF DEBIAN INSTALLED ON YOUR BEAGLE BONE BLACK, YOU CANNOT INSTALL WSJTX, WHICH REQUIRES G++ VERSION AT LEAST 4.8. THE OLDER DEBIAN VERSIONS (wheezy and older) WON'T LET YOU UPGRADE G++ TO A NEW ENOUGH VERSION.

YOU CAN CHECK BY DOING "lsb-release -a". You should see something like:
No LSB modules are available.

Distributor ID: Debian

Description: Debian GNU/Linux 8.0 (jessie)

Release: 8.0

Codename: jessie

IF YOU SEE "jessie", then you are OK.
IF INSTEAD OF "jessie" YOU SEE "wheezy" OR ANOTHER, OLDER VERSION (SQUEEZE, LENNY, ETCH, SARGE, WOODY, POTATO, SLINK, HAMM, BO, REX, OR BUZZ) THEN YOU NEED TO INSTALL A NEW VERSION OF DEBIAN BEFORE DOING ANYTHING ELSE. THIS IS A TRIVIAL UNDERTAKING. BESIDES, YOU WANT A NEWER VERSION OF DEBIAN ANYWAY.

IF YOU NEED TO INSTALL A NEW DEBIAN VERSION, PROCEED AS BELOW. OTHERWISE, PROCEED TO THE NEXT SECTION.
TO USE MY INSTRUCTIONS YOU NEED TO HAVE A REV C. OR NEWER BBB, SO THAT YOUR EMMC FLASH IS 4GB.
YOU ALSO NEED AT LEAST A 4 GB MICROSD CARD.

THE REASON THAT YOU NEED TO HAVE JESSIE OR NEWER IS BECAUSE DURING INSTALLATION OF WSJTX AT THE STEP:
CMAKE --build .
THE INSTALLATION FAILS IF g++ IS 4.6 or older, because 4.8 or newer is necessary to prevent an error
of the form: cc1plus: error: unrecognized command line option "-std=c++11"
AND VERSIONS OF DEBIAN BEFORE JESSIE WON'T LET YOU INSTALL A NEWER VERSION OF g++.

First download a flash image of jessie from:
http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Jessie_Snapshot
At the time I wrote this, that page gave this URL for download:
https://rcn-ee.com/rootfs/bb.org/testing/2015-03-15/lxqt-4gb/BBB-eMMC-flasher-debian-jessie-lxqt-4gb-armhf-2015-03-15-4gb.img.xz

Then follow the instructions here: http://beagleboard.org/getting-started
to put that onto a microSD card [I used my laptop's SDcard reader/writer] and then flash the Beaglebone Black with the new image.
DON'T DOWNLOAD THE OLD OUTDATED "WHEEZY" DEBIAN IMAGE THEY GIVE THERE, THOUGH. START WITH STEP #2, INSTALL COMPRESSION UTILITY UNDER THE HEADING "Update board with latest software" INSTEAD.

Note that while the SDcard is flashing your Beaglebone Black, the user LEDs will constantly cycle back and forth from right to left and then left to right with one LED on at a time, just as if the LEDs are doing the wave. If instead of this, you get the usual somewhat random-appearing flashing of the LEDs, then your Beaglebone did not go into flash mode, and you need to power it off and then power it on again while holding down the user button again. It took me 4 tries before this worked. If it doesn't work, then your Beaglebone Black will come up with the new version of Debian running, but it will be running directly from the SDcard, and will not have flashed the eMMC. So if you remove the SD card and reboot under those circumstances, you will be back running the old version of Debian.

Once you have successfully flashed the Beaglebone Black, power down and remove the SDcard and then power up again.
If you don't have ethernet and USB access the first time you boot up, then remove power and reboot. If you still don't have ethernet access, then you will need to set up the eth0 Ethernet socket, by modifying the network interfaces file as I outline below. I use the editor "nano" but you can use any editor you want whenever an editor is needed at any point in these instructions.

If you have internet access via the Ethernet port, you can skip to the next session at this point.
If you don't have internet access via the Ethernet port, then do the following:
cd /etc/network
nano interfaces
add:
auto eth0
iface eth0 inet static
address 192.168.10.9 [pick an appropriate address for your network]
netmask 255.255.255.0
gateway 192.168.10.160 [use your gateway]
dns-nameservers 129.250.35.250 [you will need to change these for your system]
dns-nameservers 129.250.35.251 [ditto]
Save your changes.
Then reboot. You should now have internet access via the ethernet port.
------------------------

Once you have a command prompt, type
uname -a
and you should see that the new software is successfully installed.
Here i see:
Linux beaglebone 3.14.35-ti-r55 #1 SMP PREEMPT Wed Mar 11 22:15:55 UTC 2015 armv7l GNU/Linux

and when I do:
g++ --version
I see:
g++ (Debian 4.9.2-10) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.

Then do
sudo apt-get update
sudo apt-get dist-upgrade
and you will be ready to proceed with the installation of WSJTX.

END OF INSTRUCTIONS FOR INSTALLING A NEW VERSION OF DEBIAN
------------------------------------------------------

There is a roadmap for installing wsjt-x on Beaglebone Black at the URL BELOW, but I SUGGEST NOT FOLLOWING IT BECAUSE SOME OF HIS SUGGESTIONS CAN LEAD TO
SERIOUS TROUBLE FOR YOU:
http://hajos-kontrapunkte.blogspot.com/2014/04/silent-whisper-jt9-on-cubie-truck.html
I LIST IT HERE ONLY SO THAT YOU KNOW TO AVOID USING IT. OTHERWISE YOU MIGHT DISCOVER IT AND TRY IT WITH BAD OUTCOME.  I DID NOT MAKE THE URL A HYPERLINK BECAUSE YOU DO NOT WANT TO GO THERE.
DO NOT FOLLOW HIS INSTRUCTIONS FOR INSTALLING QTBASE5-DEV AND OTHER RELATED PROGRAMS! INSTEAD SEE BELOW.
DO NOT FOLLOW HIS INSTRUCTIONS TO INSTALL LIBHAMLIB-DEV. INSTEAD SEE BELOW.
DO NOT DO ANYTHING ELSE HE SAYS. INSTEAD SEE BELOW.

START HERE AND INSTALL PREREQUISITES (some may already be installed on your BBB):
sudo apt-get install gcc
sudo apt-get install g++
sudo apt-get install gfortran
sudo apt-get install make
sudo apt-get install libfftw3-dev
sudo apt-get install libpulse-dev
sudo apt-get install pulseaudio
sudo apt-get install subversion
sudo apt-get install libgfortran3
sudo apt-get install libc6
sudo apt-get install cmake
sudo apt-get install automake
sudo apt-get install texinfo
sudo apt-get install qtbase5-dev
sudo apt-get install qtmultimedia5-dev
sudo apt-get install libqt5multimedia5-plugins
sudo apt-get install libqt5serialport5-dev

I DID NOT INSTALL ASCIIDOC AS IT WOULD TAKE AN EXTRA 1.274 GIGABYTES OF DISK SPACE!!
IT IS NOT NEEDED IF YOU FOLLOW WHAT I HAVE WRITTEN BELOW. YOU CANNOT AFFORD TO WASTE 1+ GB OF SPACE ON A BEAGLEBONE BLACK!!

---------------------------------------------
NOW IT IS TIME TO DOWNLOAD AND INSTALL WSJTX:

--------------from INSTALL in the wsjtx directory--------------
[Next you will create the Hamlib library]
The Hamlib library is required. Currently WSJT-X needs to be built
using a forked version of the Hamlib git master. This fork contains
patches not yet accepted by the Hamlib development team which are
essential for correct operation of WSJT-X. To build the Hamlib fork
from sources something like the following recipe should suffice:

mkdir ~/hamlib-prefix
cd ~/hamlib-prefix
git clone git://git.code.sf.net/u/bsomervi/hamlib src
cd src
git checkout integration
mkdir ../build
cd ../build
../src/autogen.sh --prefix=$HOME/hamlib-prefix \
--disable-shared --enable-static \
--without-cxx-binding --disable-winradio \
CFLAGS="-fdata-sections -ffunction-sections" \
LDFLAGS="-Wl,--gc-sections"
make
make install

This will build a binary hamlib package located at ~/hamlib-prefix so
you will need to add that to your CMAKE_PREFIX_PATH variable in your
WSJT-X build. On Linux that is probably the only path you have on
CMAKE_PREFIX_PATH unless you are using a locally installed Qt
installation. [IT IS THE ONLY ONE YOU NEED IF YOU ARE FOLLOWING THESE
INSTRUCTIONS FOR A BEAGLEBONE BLACK].


To get the sources either download and extract a source tarball from
the project web site or preferably fetch the sources directly from the
project's subversion repository. The project svn repository has a
non-standard layout in that the WSJT-X project is not on the trunk,
instead the main code line is in a branch at ^/branches/wsjtx
[FOLLOW THE STEPS BELOW. THE THIRD LINE BELOW DOWNLOADS THE SOURCE].

mkdir -p ~/wsjtx-prefix/build
cd ~/wsjtx-prefix
svn checkout svn://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx src

To build WSJT-X you will need CMake and asciidoc installed.

[To install asciidoc would have added 1 GB of additional files, so I did not install it. We already installed cmake above.]

Then proceed as below:

cd ~/wsjtx-prefix/build

cmake -D CMAKE_PREFIX_PATH=~/hamlib-prefix \

    -D WSJT_INCLUDE_KVASD:BOOL=ON \

    -D WSJT_SKIP_MANPAGES:BOOL=ON \

   -D  WSJT_EMBED_SAMPLES:BOOL=OFF \

    ~/wsjtx-prefix/src


And then do:
[don't forget the "."; without it, cmake won't work]


cmake --build .

Then do:


cmake --build . --target install

That's it! wsjtx is now installed at:
/usr/local/bin
where you should see the filenames:
bayes.rb fort.12 jt65code jt9code
jekyll jt9 kramdown kvasd listen
posix-spawn-benchmark redcarpet rigctl-wsjtx
rigctld-wsjtx safe_yaml sass sass-convert
scss summarize.rb
config-pin wsjtx

 

Note that the above instructions do not create any sample files.  This is because creating the sample files during the build uses a lot of virtual memory, and requires the creation of a swap file.  This is really not a problem, but to make the instructions easier, the build was changed as noted.

 

If you want to create the sample files during your build, then remove the following line from the build instructions:

   -D  WSJT_EMBED_SAMPLES:BOOL=OFF \

If you want to do this build and create the sample files, you will need to perform the following steps before the build:

Make a 512K Swap file, following instructions from here [I also write out the steps below]:
http://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/

Do:
dd if=/dev/zero of=/swapfile1 bs=1024 count=524288


[BBB thought for a few minutes and then printed:]
524288+0 records in

524288+0 records out

536870912 bytes (537 MB) copied, 41.8547 s, 12.8 MB/s

Then do:
chown root_root /swapfile1
chmod 0600 /swapfile1
mkswap /swapfile1
swapon /swapfile1

Then, if you want swapfile to stick around after you reboot, do:
edit /etc/fstab by adding following line:
/swapfile1 none swap sw 0 0

Once you have done this, then do the modified build instructions:

 

cmake -D CMAKE_PREFIX_PATH=~/hamlib-prefix \

    -D WSJT_INCLUDE_KVASD:BOOL=ON \

    -D WSJT_SKIP_MANPAGES:BOOL=ON \

    ~/wsjtx-prefix/src


And then do:
[don't forget the "."; without it, cmake won't work]
cmake --build .
THIS WILL Take A LOOOOONG TIME BUT I WAITED IT OUT AND IT COMPLETED SUCCESSFULLY. IT TOOK SO LONG THAT I THOUGHT PERHAPS THE BBB HAD "HUNG", AND I THOUGHT ABOUT REBOOTING. IT IS GOOD I DIDN'T MAKE THAT MISTAKE. DON'T YOU MAKE IT!

Then do:
cmake --build . --target install

and as before, you are done.

 

April 3, 2015 Addendum:  After writing the above, I paid Amazon $6.49 (with free shipping) for a Syba SD-CM-UAUD USB Stereo Audio Adapter with a C-Media Chipset.  This works great and is tiny; about the same volume (though a different shape) as a memory stick.  I also got a 7 inch HDMI monitor from eBay for about $65.  It has good quality image and suits the BBB.  Below is a picture of it while hooked up to the BBB which is running WSJTX.  You can also see the Syba USB audio adapter hooked to the left side of the red USB hub.  For scale, note the coax adapter and the trackball.

7 inch TFT HDMI Monitor with BBB running WSJTX


Here is an article on audio device performance on the Beaglebone Black:
http://lac.linuxaudio.org/2014/papers/32.pdf

 

WSJTonBBB-Display

73,

Roger Rehr
W3SZ

Brought to you by the folks at W3SZ