MoonSked and Ubuntu 18.04LTS

Recently I was indoctrinated into the world of 6m EME when a few club members and I decided to give it a try on something of a whim. With a bit of encouragement from Lance W7GJ we raided and cherry picked our way through a few fellow club members shacks and sheds and pieced together a “small” portable 6m EME station. You can read about the activation on our club website once it’s published (click). The picture below speaks volumes;

The moon at moon set (4am) with our 6m EME station – photo by Scott VK5TST

While looking at various Apps and trying to work out how this EME thing works, I discovered MoonSked written by David GM4JJJ.

At first glance it appeared to be a cross platform application that would help me plan and understand how this EME thing works without wasting too many late nights outside. What I liked most is I could run it on both Windows or Linux. My main computer in the shack still runs Windows (for reasons), however for laptop(s) and servers I prefer various flavours of Linux. So the installation of MoonSked on my main shack computer was straight forward, however things rapidly fell apart when I tried the same on my Laptop that runs Ubuntu 18.04LTS. I downloaded the zip file, placed it in my home directory and then tried to run it, sigh it didn’t work.

After a quick check of the website I noticed the last version of Ubuntu that MoonSked was built to run on was 9.10 (karmic koala) which went end of life years ago (2013). Being a binary distribution means recompiling and linking this against 64-bit libraries was not an option, sigh; we had to do this the old fashioned hard way.

So having grown up using Linux for more years than I’d care to admit I had a fair idea that this would be the classic “shared library dependency problem”. I wasn’t to be disappointed and even learnt a little about how the new linux multiarch (well new to me) system worked.

So the crux of the problem was MoonSked was compiled against 32-bit binary libraries and my Ubuntu 18.04LTS distro is entirely 64-bit. It is little wonder that MoonSked couldn’t run. So the place to start with any dependency problem is the infamous ‘ldd utility’. Let’s poke inside MoonSked and see what libraries are under the hood;

legend@HP-ShackBook:~/MoonSked$ ldd MoonSked
linux-gate.so.1 (0xf7f48000)
libgtk-x11-2.0.so.0 => not found
libgdk-x11-2.0.so.0 => not found
libgmodule-2.0.so.0 => not found
libglib-2.0.so.0 => not found
libgthread-2.0.so.0 => not found
libgobject-2.0.so.0 => not found
libgdk_pixbuf-2.0.so.0 => not found
libpango-1.0.so.0 => not found
libpangocairo-1.0.so.0 => not found
libpangoft2-1.0.so.0 => not found

libpthread.so.0 => /lib32/libpthread.so.0 (0xf7f07000)
libdl.so.2 => /lib32/libdl.so.2 (0xf7f02000)
libXi.so.6 => not found
libXext.so.6 => not found
libX11.so.6 => not found

libstdc++.so.6 => /usr/lib32/libstdc++.so.6 (0xf7d7c000)
libm.so.6 => /lib32/libm.so.6 (0xf7cb1000)
libgcc_s.so.1 => /usr/lib32/libgcc_s.so.1 (0xf7c93000)
libc.so.6 => /lib32/libc.so.6 (0xf7aba000)
/lib/ld-linux.so.2 (0xf7f4a000)
libcairo.so.2 => not found

Ok so there are a few libraries missing and thankfully I can see some of the lib32 libraries are being found. What is not immediately apparent is that 32-bit libraries can be installed separately and sit alongside the very same 64-bit libraries. The multiarch features of the latest linux kernel and GNU tools is what confuses MoonSked trying to find it’s libraries. So to get MoonSked we need to solve the shared library dependencies separately. So watch the following carefully.

We start by double checking that we are in fact running a full 64-bit system;

legend@HP-ShackBook:~/MoonSked$ uname -m
x86_64
legend@HP-ShackBook:~/MoonSked$ dpkg --print-architecture
amd64

Excellent the kernel is 64-bit and we are using the 64-bit package repository that should be linked against 64-bit libraries. Now we check the following;

expert@HP-ShackBook:~/MoonSked$ dpkg --print-foreign-architectures
i386

Ah Ha ! This is excellent as it means that we can install the 32-bit libraries with the dpkg/apt tools without having to configure dpkg. If you find that i386 isn’t defined as a foreign architecture you’ll need to use dpkg to enable it. There are plenty of websites on the net that can assist here (YMMV), Ubuntu 18.04LTS comes pre-configured for 32-bit and 64-bit multiarch out of the box.

So now we can simply use apt-get to install the dependencies. I simply use a process of elimination to work out what is missing. First I’d use apt-cache and the name of the shared lib to search for library names or resort to the internet, then I’d use apt-get to install it and then re-run ldd again to see the result. The following line works well when the output from ‘ldd’ gets more than a page or two;

$ ldd MoonSked | grep "not found"

This will basically print out any library dependency that was not found to the display. Slowly but surely you work your way through to the end of your list, making notes as you go for your blog (*grin*). Rather than document all of the above steps I’ll just give you the short list;

sudo apt-get install libc6:i386 libpango-1.0:i386 libcairo2:i386 libpangocairo-1.0:i386 libgtk2.0-0:i386 libcanberra-gtk-module:i386 libatk-adaptor:i386 gtk2-engines-murrine:i386 libdlm3:i386

Now the observant will notice at the end of each package is a colon and i386. This tells apt/dpkg to install the 32-bit library and not the default 64-bit package. Depending on what apps you have on your linux machine already some of these packages may already be installed and up to date. If you do find this is the case then simply drop the name off the list above and keep trying.

As I wrote at the very beginning of this post, these are the steps that worked for me on my Ubuntu 18.04LTS installation. I’m hoping that the process used to seek and destroy the missing dependencies makes sense it’s certainly not the only way to do it, works for me YMMV.

At least now I can fire up MoonSked on Ubuntu 18.04LTS and continue my 6m EME experiments. Thanks again to David GM4JJJ for writing MoonSked !

HP Cellular Modem for HP 5320m

After pulling the bottom cover off my second-hand HP Probook 5320m a couple of times I was pleased to discover a PCI-E slot for a HP un2420 mobile broadband modem.  It appears that the Cellular antennas are already built within the lid (or screen) of the laptop.   A light bit of reading also suggested that these modules were capable of decoding GPS signals too.

I just had to try one.

So for the princely sum of $35 I procured a HP un2420 Gobi 2000 module from a local eBay seller.  There are suppliers on eBay that are selling these HP Gobi 2000 modems out of China for $11, which is an absolute bargain. YMMV.  I didn’t want to wait until after Christmas to try one so I purchased one at the higher price.

Now of course I want this to work in my shiny new Ubuntu 16.04 LTS laptop.  Oh well I’ve always welcomed a challenge.   I’ll detail the steps I took to get to a working solution.

First we should check we can see the module;

#$ lsusb
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 05c8:0403 Cheng Uei Precision Industry Co., Ltd Webcam
Bus 001 Device 003: ID 03f0:241d Hewlett-Packard Gobi 2000 Wireless Modem
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I’ve highlight what we’re looking for (in blue) which is the “HP Gobi 2000 wireless modem”.  You can tell that this device is currently un-programmed as the product ID is “241d” and changes to “251d” once the firmware is loaded.   You also need to check that /dev/ttyUSB0 exists and that your user that starts the 3G cellular modem is in group dialout.  This isn’t necessary right now but does simplifies things later.

Now you’re going to require a Microsoft Windows machine, sorry there is no other easy way around this.  Some have managed to pull apart MSI files in wine, I didn’t get that lucky.  The Qualcomm Gobi modems down load the firmware into the modem at power on, once the firmware has been download the modems will work.   I was lucky to have the same laptop with Windows 10 installed, so I simply installed the driver on this second machine and then stole the files I needed on a USB stick.  I had to install the un2420 module in the Windows machine to get the drivers to load.

From within the Windows driver there are two directories from which we need three files;

  • ….\Qualcomm\Images\HP\UMTS\amss.mbn
  • ….\Qualcomm\Images\HP\UMTS\apps.mbn
  • ….\Qualcomm\Images\HP\6\uqcn.mbn

You’ll need to work out where the drivers get placed depending on your version of windows, it will be installed in the program directories there somewhere.  I found them in the Program Files (x86) directory on Windows 10.   The files above are what you require for a Generic UMTS modem (6) that is not vendor network specific or locked.  This worked nicely for my unlocked module and Telstra pre-paid SIM. YMMV.

Now once you have these files on a USB stick you can start work on the Linux machine.

#$ sudo apt-get install gobi-loader

This will get the udev helper we need to load the firmware into the modem.  Once this is installed copy the files from the windows machine into this directory, watching file permissions of course;

#$ sudo cp /mnt/usbstick/* /lib/firmware/gobi

As mentioned we want all three “mbn” files above in that directory.  Now you might like to check that the udev rules for QDL modems are correct in the following file;

#$ less /lib/udev/rules.d/77-mm-qdl-device-blacklist.rules

Your looking to check that the following two lines exist;

#HP un2420 Gobi QDL Device
ATTRS{idVendor}=="03f0", ATTRS{idProduct}=='241d", \ ENV{ID_MM_DEVICE_IGNORE}="1"

These lines will prevent ModemManager in Ubuntu from trying to take control of this device at boot up before the udev helper gobi_loader gets a change to load the firmware.   Now if all is going well reboot the machine and then check the following in a terminal;

#$ lsusb
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 05c8:0403 Cheng Uei Precision Industry Co., Ltd Webcam
Bus 001 Device 003: ID 03f0:251d Hewlett-Packard Gobi 2000 Wireless Modem
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

You should notice that the product ID has changed from 241d to 251d, meaning that firmware is now loaded in the 3G modem.  I tried not rebooting this machine which turned out to be a mistake.  ModemManager is a pernickety piece of software that won’t do anything unless everything is 100% right.  I wasted a number of hours chasing my tail trying to get services shutdown and restarting stuff.

You should also see that there are now three tty USB devices attached to the system;

#$ ls /dev/ttyUSB*
/dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2

If you don’t see these three devices then there is something wrong.  I’d suggest you start with dmesg and searching your way through syslog to find out why what’s gone wrong.  It can take a while.  When you do get things right about 13-15 seconds after the kernel loads you should see the firmware loaded into the modem and the additional USB serial ports being created.   If the firmware doesn’t load you will find error messages in syslog.

Now you should be able to configure the NetworkManager to actually use the Modem.  I simply went into NetworkManager -> Edit Connections and created a mobile broadband connection from scratch.   The APN we want to use for Telstra is “telstra.internet” and the rest is pretty much a vanilla install.

Once you’ve got the connection, done you should be able to connect to the internet via the cellular modem.

Oh and don’t forget to plug your SIM into the slot in the battery case.   Now you can sit back and enjoy Cellular Mobile data without any external USB dongle to snap off, or get left behind.

Yay !