Category Archives: Linux

Installing Zenmap in Ubuntu 22.04

There are a few tutorials out there claiming to instruct one on installing Zenmap in newer versions of Ubuntu, unfortunately all the ones I have found simply do not work. The big problem is that Python 2  and pyGtk have been completely phased out and are no longer available in Ubuntu. Attempting to install any currently available .deb packages will result in failure.

FEAR NOT!!!! The nmap team has updated their code to Python 3 and the entire nmap suite can be installed quite easily from source. Zenmap, with a minor tweak to the config file will  work on Ubuntu 22.04 (LTS)!

OK, let’s get into it!

This install will be performed from the command line so get started by opening a terminal…

1: Install prerequisites

$ sudo apt install build-essential checkinstall zlib1g-dev libssl-dev libcurl4-openssl-dev

2: Get the source code from github

$ cd ~/Downloads
$ wget https://github.com/nmap/nmap/archive/refs/heads/master.zip -O nmap.zip
$ unzip nmap.zip

$ cd nmap

3: Fix Zenmap config file

There is an error in the current Zenmap config file and if not fixed Zenmap will not be able to find your nmap binary.

$ nano zenmap/share/zenmap/config/zenmap.conf

Navigate to line 60 and fix the [paths] section. Change this:

[paths]
nmap_command_path = ../nmap
ndiff_command_path = ../ndiff/ndiff

To this:

[paths]
nmap_command_path = nmap
ndiff_command_path = ndiff

If you have already gotten everything installed but Zenmap can’t find nmap, you can do the same fix on the file in your home folder:

~/.zenmap/zenmap.conf

4: Compile and install

$ ./configure
$ make
$ sudo make install

5: Run Zenmap

For full functionality of Zenmap, it is recommended to be run as root.

$ sudo zenmap

Happy Hacking!

MyDIYCNC Desktop CNC Machine $20 GRBL Resurrection

About 8 years before the writing of this article i purchased a CNC machine from Amazon created by a company called MyDIYCNC. I was interested in the technology and the price was right at only $250.

It was easy enough to assemble and get working with Linux using their FabCAM software. Well, so it seemed at first…

When the z-carriage would retract, it would skip some steps once in a while and eventually drive the tool head into whatever I was trying to mill. While the company’s customer support was responsive I could never figure the issue out and the project got shelved.

Long story short the company is no longer around but the machine was. Sitting on my shelf, sadly doing nothing.

Then one day while shopping for 3D Printer upgrades, I ran across this Arduino kit on amazon that will replace the proprietary brains, motor controllers, and software with a well supported open source system, GRBL.

I put the Arduino and drivers into this 3D Printed enclosure:

I used the power supply that came with the MyDiyCNC kit as well as the original spindle relay. The two wires on the right go to the spindle pins on the Stepper Hat:

I soldered some female plugs from jumper wires onto my motor wires and attached them to the motor driver output. Color order from top (reset button side of board, see photo) is Blue, Red, Black, Green:

I hooked the 12V+/- output from the power supply to (yellow+, black-) to the controller hat. This is also where I pulled 12V for the 40mm enclosure fan.

Don’t forget to put a jumper on the enable pins (right of reset button).

Once everything was all hooked up I adjusted the motor controllers amperage to 400mA (for the stock motors that came with the kit, your mileage may vary) using this guide.

Now you just need to flash GRBL to your Arduino and get some software for your computer. Here are some helpful links and files that go me through the rest of the setup phase including jumper settings for microstepping:

The last tweaks to get it to work correctly was to set the X, Y, Z max speed to 350mm/min (Firmware Settings) and 1/4 micro-stepping (Jumper under motor driver).

Now you can calculate your steps per millimeter here.

Finally, the software to control it.

I have been using OpenBuilds Control and their integrated CAM software. It works fairly well, though the GUI is prone to crashing. Upside is that when the GUI does crash, the job still completes. Unfortunately he crashed GUI can make it difficult to find perfect zero again.

Universal Gcode Sender will definitely play with GRBL and control the machine. However I have yet to use it to actually run a job. I will post updates after I give it a try.

Feel free to post any questions in the comments section below!

Kenwood TS-440S IC-10 Upgrade and DIY CAT Control for Linux

My radio club, SFARC, has helped me get into an HF rig, namely the Kenwood TS-440S. This radio is a bit old (1986ish) but, IMHO, this thing is awesome. It has a fairly compact form factor, runs of my 12V off grid power without issue, and with the following upgrades will talk to my computer.

I first purchased a digimode cable that has opto-isolated audio input/output as well as a USB PTT coupler which is allowing me to experiment with digital modes on this transceiver. While this is great, I would like to be able to view and control the frequency of my radio from FLDIGI via HamCAT or hamlib. Turns out this will require a little bit of hacking (awesome!) to get it working.

Kenwood TS-440 Digital Interface Cable

Issue #1: The 13 pin DIN, ACC 2, only provides audio and PTT functions. If I want to provide a serial interface I need to use the 6pin DIN, ACC 1, interface. I need to build an interface cable.

Issue #2: This interface is a serial connection using TTL voltage (5.5v) but with the same logic as a standard serial port. I need an FTDI breakout board with inverted logic.

Issue #3: The 440 requires an upgrade kit (IC-10) to provide serial communication capabilities. This kit is semi-rare and costs about 50 bucks.

In this article issue #1 will be addressed with a six pin din plug ordered from amazon.

Issue #2 will be handled by an FTDI USB board I already have on hand and an XP virtual machine running FD_PROG to invert the logic. Unfortunately this makes this solution NOT 100% Linux. To resolve this I will use the command line Linux program ftdi_eeprom to clone my firmware and post it here so Linux only users can use ftdi_eeprom or flashrom to program their FTDI boards with ease.

Issue #3 is easily resolved by ordering the chips individually or by purchasing one of my $15 IC-10 kits from eBay.

IC-10 Chipset for Kenwood TS-440 / R5000

#1: Build the plug.

After receiving the plug from Amazon, I repurposed a shielded USB cable to build the plug. I hooked up all the wires even though CTS/RTS were not required. RFU style as it were. Perhaps adding flow control in the future would speed things up. I don’t know I haven’t tried. Anyway….

Disassembled Plug

These are the pin numbers as viewed from the solder side:

  1. GND
  2. TXD
  3. RXD
  4. CTS
  5. RTS

Here is how I hooked up the 5 wire USB cable:

  1. GND -> Cable shield
  2. TXD -> Green
  3. RXD -> White
  4. CTS -> Black
  5. RTS -> Red
Wiring Diagram

#2: Install the chips.

After I received my chips, I installed them following this guide. To sum up, remove the top and bottom cover from the radio. Then remove the face-plate screws and then loosen the 5 small screws for the metal grounding plate so it may be removed. Once this is done the chip slots will be exposed ( they are the only two empty slots on the back of the face-plate ). You will need to use a flat surface to bend the pins slightly inwards so that they will line up with the sockets when you insert them. Pay close attention and make sure the chips are fully seated properly into the sockets.

Once this is done reassemble the radio and ensure that it is working properly. Now the ACC 1 port has serial com capabilities.NICE!

#3: Hook Up the FTDI Breakout Board

The only pins required for communication are GND, TRX, and RTX. You supposedly can use a 5 wire connection using CTS/RTS flow control but it is not necessary. The FTDI breakout I used for this project only made CTS and DTS readily available so I went with the three wire setup. There may be advantages to having flow control and I would be interested to hear input on this in the comments.

My Notes

Attach the TX from your rig to the RX on the FTDI and the RX from the rig to the TX on the FTDI. GND goes to GND.

FTDI on the proto board

#4: Program the FTDI Board

Although the wiring is done, we still need to invert the logic on the FTDI board. There is no linux app to easily do this so I ran the FD_PROG utility using an XP virtualbox install to run this program. There are multiple drivers available from FTDIChip, make sure you use the correct driver for your system.

If you don’t have a windows install to program your FTDI chip, you can flash the following firmware to your FTDI chip using ftdi_eeprom. This firmware has the inverted logic necessary to communicate with your rig.

  1. FTDI Firmware File
  2. ftdi_eeprom Config File

Download both files to the same location, plug in the FTDI and program it. Something like this:

ftdi_eeprom --flash-eeprom ftdi.config

#5: Time to play radio!

You can now use FLDIGI or similar to read/send the frequency and PTT key your radio. Software config is beyond the scope of this article, but this is what it looks like:

If you enjoyed this article you can support me by subscribing to my YouTube channel and/or visiting some links from my sponsors. Thanks!

References:

  1. FTDI Chip Utilities
  2. FTDI Chip Drivers
  3. Installing an IC-10 kit into a Kenwood TS-440S/AT HF Radio
  4. TS 440 Serial Communications Interface
  5. TS-440 SAT Modifications
  6. Kenwood TS-440 mods reviews software and diagrams
  7. Build an Easy USB Computer Interface for Your Old Kenwood Rig

Use Pulse Audio to Pipe Audio Streams Between Programs

Looking for a way to pipe audio from one program to another without using JACK? Pulse Audio, default sound system for Ubuntu can do this and it’s really not that hard.

1. Install pavucontrol

sudo apt install pavucontrol

2. Set up a null sink

pactl load-module module-null-sink sink_name=virtual-cable

3. Connect aps via the null sink

In this example I will use QSSTV to listen to the output of GQRX. You can use any programs you want.

Run Pulse Audio Volume Control (pavucontrol)

In the “output devices” tab, set the audio output for the program you want to monitor or record to Null Output.

In the “recording” tab, set the capture from for the “recording” program to Monitor of Null Output

And that’s about it! Enjoy!

Viewing ISS SSTV Images Using GQRX and QSSTV and RTL Dongle on Ubuntu 20.20

When the International Space Station passes overhead it is still possible to view the SSTV (Slow Scan Television) images they are sending on 145.800Mhz using your Linux computer and a Realtek SDR USB Dongle. I did this on Ubuntu 20.20 but it should work on any Linux running pulse audio.

NOTE 1:  12-31-2020 is the last day the ISS will be transmitting images (for now). This tutorial can still help you get GQRX sending audio to QSSTV or any other “recording” app.

Step 1: Install and configure GQRX

First, get GQRX running using this How To: https://gqrx.dk/download/install-ubuntu

NOTE: When I installed GQRX on Ubuntu 20.20 only the myriadrf repos worked. Your mileage may vary.

You now need to run GQRX and configure it to work with your dongle. This is out of the scope of this howto and much info is available via Google. Once you can listen to radio via GQRX it’s time to move to the next steps.

Here is what my settings for the ISS look like:

Step 2: Install and configure QSSTV

I followed this guide to get QSSTV working, however, I found that howto a bit over complicated and many of the steps unnecessary if you already have GQRX installed. I was simply able to install QSSTV like this:

sudo apt install qsstv

Run QSSTV and in the configuration for sound set input and output to Pulse Audio.

Step 3: Install Pulse Audio Volume Control

Now that you have both your apps, you need to install some stuff to get pulse to make them play together. First install pavucontrol:

sudo apt install pavucontrol

Step 4: Invoke the NULL Sink

Finally it’s time to make a dummy sink. This is the glue that puts it all together. Using pavucontrol, any app can be outputted to the null sink and then any other app can record from this null sink.

pactl load-module module-null-sink sink_name=virtual-cable

Step 5: Connect the Programs

Once this null sink is created open up Pulse Audio Volume Control, GQRX and QSSTV. In the recording tab, set the input for QSSTV to Monitor of Null Output.

Finally in the output devices tab, set GQRX to Null Output.

That should be about it.

Find out when the space station is passing overhead and then tune GQRX to 145.800… QSSTV will do the rest. Feel free to post any questions you may have.

NOTE: You can use this technique to pipe audio from any program to another.

Enjoy!

Installing Chirp in Ubuntu 20.04

If you have been using the PPA to get the Chirp dailies, you will quickly find out that this no longer works in Ubuntu 20.04 Focal.

Python 2 is getting phased out and whatever is running the GUI for Chirp has been phased out completely. This makes getting Chirp to run a little more difficult than before.

UPDATE: It looks like major progress has been made with the Python 3 upgrade and Chirp is available in Groovy (20.10)! This article will likely be outdated soon. 

As of this writing, there are a few options:

  1. Wait until the python 3 version of Chirp is finished (NOT!)
  2. Install via the Snap: This gives a warning against doing so
  3. Install via flatpak: WINNAR!

A Flatpak is a self contained package that includes all necessary libraries. Similar to a Snap, but this uses a package directly from the author. I like the flatpak option because I don’t need to manually install a bunch of deprecated libs or add some PPA that wasn’t even meant for Ubuntu.

Note from user: If you already have Chirp installed, you will need to remove it first. See comments section for details.

First thing you need to do is download the latest .flatpak file from here:

https://trac.chirp.danplanet.com/chirp_daily/LATEST/

Rest of the work is from the terminal.

First, install Flatpak:

$ sudo apt install flatpak

The other howtos seem to have missed this next step. You need to use flatpak to install the “freedesktop” platform. First update flatpak and your paths.

$ flatpak update -v

This will give you a warning about paths, something like:

Note that the directories

'/var/lib/flatpak/exports/share'
'/home/[username]/.local/share/flatpak/exports/share'

are not in the search path set by the XDG_DATA_DIRS environment variable, so applications installed by Flatpak may not appear on your desktop until the session is restarted.

Since we now have to log out anyway, now might be a good time to make sure you are in the dialout group.

Use  the groups command to list your active groups. If the group “dialout” does not appear, add yourself to the group (replace [username] with your username):

$ sudo usermod -aG dialout [username]

Now restart your session (or computer) and return to the terminal.

~$ flatpak update -v
Looking for updates…
Nothing to do.

Don’t worry about installation directory warnings if you haven’t installed anything yet. Those will be created later. Important is that we got rid of the path warning. Moving on….

Now you need to get the Freedesktop repository installed:

$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

and then install the Freedesktop Platform:

$ flatpak install flathub org.freedesktop.Platform//19.08

This might take a while its a big (~0.5Gb) download. Grab some coffee and make some QSO’s….. Maybe check out my club’s website: http://w6ek.org

Finally we can install Chirp!  (replace .flatpack filename with your downloaded version)

$ flatpak install Downloads/chirp-daily-20201014.flatpak

You’re done! You can run chirp from your applications menu or from the command like like this:

$ flatpak run com.danplanet.chirp

Remember, this is only a temporary solution until the Python 3 conversion of Chirp has been completely rolled out. However, in the interim if you want to easily update the flatpak, or automate it with a cron job, here is a script that works for me:


#!/bin/bash
#
#
# This script updats chirp flatpak to latest daily build
# Add this to root's crontab for automatic updates
# If run as standard user, you will get a popop asking for admin password
#
#
#Make download folder if doesn't exist
mkdir -p ~/Downloads/ChirpFP
#Move to Download folder
cd ~/Downloads/ChirpFP
#Remove previously downloaded flatpaks
rm *.flatpak
#Pull link from download page and download latest flatpak
wget `lynx -dump https://trac.chirp.danplanet.com/chirp_daily/LATEST/ | awk '/http/{print $2}' | grep flatpak`
#Install the file
flatpak install -y --noninteractive *.flatpak

If you found this article helpful, please support me by subscribing to my YouTube channel! https://youtube.com/piratesinteepees

73 – KK6VHH

Boot Partition in Ubuntu Keeps Running out of Space After Upgrade to 18.04

After I upgraded to the latest LTS from Ubutnu, namely 18.04, I was finding I could never have more than two kernels installed at a time. /boot kept running out of space and updates would fail. Running sudo apt autoremove && sudo apt autoclean would resolve the issue until the next upgrade. This was tolerable until I needed to install both a generic and a low-latency kernel.

Looking at my df output it almost seemed as if the upgrade swapped my efi and boot partitions. My efi partition was 500MB and my boot partition only 250MB! The solution I found was to resize the partitions to make the efi partition 100MB and the boot partition 650MB. This process wasn’t as easy or smooth as I initially thought, so I figured I would document what it took to make it work.

Step 1 – Boot a Live USB

First thing you need is to have a liveUSB from ubuntu that you can boot into:

Create a Bootable USB Drive in Ubuntu

Boot into this drive, selecting “Try Ubuntu Without Installing”

Step 2 – Resize the Drives

After Ubuntu boots, open a terminal and type sudo gparted. In gparted, resize your efi drive to 100MB first, then resize your boot partition into the remaining space. Make sure no flags are set for the boot partition and the boot,esp flags are set for the EFI partition.

When you resize the EFI System Partition, it will change to fat16. This needs to be reformatted back to fat32 to work. Once this is done right click on efi partition, and select New UUID. Once this is done apply all settings and quit gparted.

Step 3 – Install and Run Boot Repair

Now you need to install and run boot repair from withing the live USB environment.

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair

Once boot repair loads, click the recommended repair button and follow onscreen instructions.

Once you are done, reboot!