Amateur (Ham) Radio (Yaesu FT-991A) in Digital Mode (FLDigi) on Mac OSX (Yosemite)

I picked up transceiver radios several years as a new hobby, well OK the year was 2008. The impetus was really the Katrina storm event, seeing all communications grid disrupted except for radio and satellite communications.

I have no satellite equipment and thought that would be too specialized and limited in usage. I wanted a general purpose way to communicate during normal and emergency times that could reach most of the population in the USA. Naturally, I gravitated to Amateur Radio, commonly known as Ham Radio. Ham Radios can communicate globally, and as I found out, surprisingly they can also communicate via satellite.

You don’t need a license to get a radio and listen to Ham Radio, but you must have a license to transmit using Ham Radio. There is an exception that allows the use of Ham Radio without a license in life/death emergency situation to call for help.

My license is categorized as a “General” license. Simply put it allows me to use a larger amount of frequency than a “Technician” might have (which is an entry level license). “Extra” license gives you all the frequencies Amateur Radio operators may operate in.

I made my first contact with voice a long time ago. From Seattle,WA area to Sacramento, CA. It was a tremendous feeling to have that freedom to talk with someone a long ways away and free too!

My first contact suggested I try digital mode communications. That is where the voice signal is converted into a digital signal, transmitted, received, and decoded back to a voice signal to be heard by the receiver.

The advantage is lesser power is required to communicate. The disadvantage is it’s comparatively slower than speech. There are many digital modes in use today but the most popular is PSK31.

I tried it for a while but could not make a good contact with anyone. At the time, digital mode was achieved with a string and tin cans …

I’ve since sold my initial rig (that’s what radios are called in Ham Radio) and purchased a rig that has more capabilities and has an audio receiver & transmitter board in it. I no longer have to create wires from the computer to the radio to achieve digital mode.

Equipment configuration:

  1. Yaesu FT-991A transceiver radio
  2. A BuddiPole used vertically, aka BuddiStick (40m: 2 regular arms then 2 regular coils with no taps, 2 regular whip sections out, then tune either with the radio’s internal tuner or with MFJ-269 antenna analyzer)
  3. MFJ-269 antenna tuner. I connect this to the end jack that is to connect to the radio. I use a duplexer, do not connect to the jack prior to the duplexer, the results are misleading. I set the tuner to 7.000 MHz (or whatever frequency you like) and look at the SWR meter. Pull or push on the whip section to lengthen or shorten it. The longer the whip, the lower in frequency you go and vice versa. Anyway tune the whip section until you get an SWR reading of 1.5-3. After this I let the radio’s internal tuner tune it more if necessary
  4. or an alternative is to hook up the antenna and use FT0991A’s internal tuner.
  5. FLDigi software to perform encoding and decoding of the digital signal from the radio
  6. MacBook to run FLDigi on

The radio and FLDigi need to be configured.

FT-991A radio SETUP using MENU/SETUP button:

BEFORE ANYTHING ELSE, CONNECT YOUR ANTENNA TO YOUR RADIO. Accidentally transmitting without an antenna could ruin your radio.

This enables the radio control:

  • 031 cat rate  9600bps
  • 032 cat tot 100 msec

This enables data communication (use DATA-USB mode)

  • 059 cw freq display DIRECT
  • 062 data mode OTHERS
  • 064 other dsp ssb 1500hz
  • 065 other shift ssb 1500hz
  • 066 data lcut freq OFF
  • 068 data hcut freq OFF
  • 070 data in select REAR
  • 071 data ptt select rts
  • 072 data port select USB
  • 073 data out level 70

This enables data in FM mode (use DATA-FM mode)

  • 074 fm mic select REAR
  • 075 fm out level 70
  • 076 fm pkt ptt select RTS
  • 077 fm pkt port select USB

You also need to set the DT MAIN configuration. Press F-MList button, the press FWD on the display until you see DT MAIN. Tap it and then use the knob on the bottom right of the display, turn it to 4 first. Now set the METER setting to ALC, it will show ALC value on the top of the display, As we turn the DT MAIN knob higher, we want to see ALC only a little, turn it just until you see ALC, then turn it back one step.

Before connecting the FT-991A to the Mac, you must install USB drivers on the Mac first. These can be found at:

Once the driver is installed, you can connect the USB cable.

When you are configuring FLDigi and asked for a Device in RigCat, use the serial port named /dev/cu/SLAB_USBtoUART.

FLDigi configuration:

When you first run FLDigi it shows an FLDigi configuration wizard which walks you through the setup steps.

If you’ve already stepped through that and wondering how to run it again, whoops there isn’t a way to do so. There is actually, just run Terminal which by default opens in your home folder, and run this command to be sure cd ~. Once you’re in your home folder issue this command rm -r .fldigi that should remove the configuration folder. Close FLDigi and reopen it and the wizard should appear again.

On the other hand you might just follow the steps below to configure FLDigi.

First, fill out the Operator form from menu item Configure , then UI, then Operator, provide information about the operator, it is used for digital mode. These are optional for voice and CW operation. It is however strongly recommended for digital mode. Of specific importance are:

  • Station QTH, provide your geographic location here. I live in the vicinity of Seattle, WA. USA. So I use Seattle, WA.
  • Station locator using grid square coordinates. You can find where you are and provide the locator using this site by David K2DSL: http://www.levinecentral.com/ham/grid_square.php
  • Operator Callsign. This is your callsign that was assigned when your license was issued to you.
  • Antenna. This is optional, but I like to provide it as information.

Second, we configure our Audio section. You can get here from menu item Configure then Sound Card. Set checkmarks for PortAudio and Device Supports Full Duplex. Then select USB Audio CODEC for both Capture and Playback settings.

To control our radio using the FLDigi software, we select the Configure menu item, then select Rig Control menu item, and then you’ll see the screen shown below.

Enter the values marked by red boxes as shown. Make sure you click Save.

For Rig Description file, get the file from here: https://sourceforge.net/projects/fldigi/files/xmls/yaesu/FT-991.xml/download

and place it in your ~/.fldigi/rigs folder, select it for Rig description file.

If you had the USB cable plugged in earlier, unplug it now, this is to reset the serial port driver on the Mac. FLDigi will sometimes not connect to the radio and you’ll see the frequency display mismatched.

  • Close the FLDigi application.
  • Connect the USB cable from the radio to the Mac.
  • Power on the radio.
  • Launch FLDigi.

If all went well, the frequency display on your radio should match the frequency display on FLDigi.

Final step is to choose the Operating mode. Use menu item Op Mode, then PSK, then BPSK-31.

The frequency that is commonly used for PSK in the 40m band is 7.080.15 MHz USB in the morning USA Pacific time. When you tune around there, you’ll hear a bunch of squealing noises that PSK31 makes. You’ll also see yellow streaks on the waterfall display. A yellow streak is one conversation going on.

Click your mouse on one of the yellow streaks and FLDigi should decode and display the conversation.

I recently came across forked-daapd, forget what the name means. If you’ve ever setup your iTunes app as a music server, well this is a clone of that.

This means you can use a remote on your iPhone, iPad, or Android device to control the iTunes music server to play music on remote speakers (with the use of Apple’s Airport Express WiFi device).

I started with a scratch Raspberry Pi install, this time around I’m using the latest distribution of Raspbian named Stretch.

You can use instructions on this page to install Stretch on your Raspberry Pi:

https://www.raspberrypi.org/documentation/installation/installing-images/README.md

Once that is done, you’ll then want to install what is called a repository key. A repository is basically a server that contains applications you can install. A gpg key is a digital signature used to authenticate the repository.

The command to get the repository key is:

wget -q -O – http://www.gyfgafguf.dk/raspbian/forked-daapd.gpg | sudo apt-key add –

Then we want to add the following line to /etc/apt/sources.list, make sure it is the first line in the file, otherwise it will pick up an old version of forked-daapd. This adds the repository that contains forked-daapd to our software install list so we can install forked-daapd.

deb http://www.gyfgafguf.dk/raspbian/forked-daapd/ stretch contrib

Note that if you have Raspbian Jessie, you can replay the word stretch above with “jessie”.

Now we can install forked-daapd with this command, it takes about a minute or so:

sudo apt update && sudo apt install forked-daapd

Once installed, you have to configure forked-daapd’s configuration file:

sudo nano /etc/forked-daapd.conf

Look for the line that looks like: directories = { “/srv/music”}

Replace the directory “/srv/music/” with wherever you have your music located.

That’s all you have to do with this configuration file.

I have in a USB drive in a directory named “Music” so I first mount the USB drive by editing /etc/fstab file (so it’ll mount everytime the Pi reboots) like so:

/dev/sda1       /media  vfat    defaults,ro     0       0

Note the “ro” parameter, it means read only so you don’t accidentally write over your music files.

Mounting the USB drive is achieved by issuing this command:

sudo mount -a

So, now you have forked-daapd installed, music mounted, time to make it work:

# start forked-daapd
sudo service forked-daapd start

# check status to see if it started successfully
sudo service forked-daapd status

You should see something like this (sorry for the blur, it’s WordPress’ doing):

You can also check this file to see how forked-daapd file is doing:

sudo less /var/log/forked-daapd.log

I hope everything went well. If so, it’s time to add our remote.

For Apple devices, download the Remote app.

For Android devices, I have the best experience with TunesRemote+ app.

To pair your devices with forked-daapd use the following page, starting with Pairing with Remote on iPod/iPhone:

https://github.com/ejurgensen/forked-daapd/blob/master/README.md

With TunesRemote+ I found the pairing instructions above not working. Fortunately there is a workaround by adding the music library manually (i.e. enter the ip address of the forked-daapd server).

forked-daap has a very helpful and responsive help thread here:

https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=49928&hilit=forked+daapd

 

Raspberry Pi as a Mac OSX file server

Update 1/5/2017, I’ve made configuration adjustments to /etc/netatalk/afpd.conf (2nd section below) and /etc/netatalk/AppleVolumes.default (third section below). I also added a section to enable the firewall.

Update 1/4/2017, previously I was unable to make this work with Samba (Windows file sharing for Linux) but after I rebuilt the Pi and followed my own instructions I was able to make this work.

This time I want my Raspberry Pi server to behave as another Mac sharing its files. It is incredibly easy. I use the latest image of Raspberry Pi Raspbian OS Jessie with PIXEL dated 2016-11-25.

First, we install netatalk (this software provides the functionality of an AFP file server used by Macs to share files).

sudo apt-get update
sudo apt-get install netatalk
sudo service avahi-daemon restart
sudo service netatalk restart

Second, I adjust the /etc/netatalk/afpd.conf file and use the following line at the end

– -tcp -noddp -uamlist uams_dhx2.so -nosavepassword -mimicmodel RackMac

Third, now from my Mac’s Finder I can see my raid5 tinypute appear as a shared PC, I can click it, and “Connect As” my tinypute user “pi” using its password and connect to pi’s home directory.

Fourth, if I wanted to add /mnt/raid5/storage to Mac’s file share I would edit /etc/netatalk/AppleVolumes.default. At the end of the file add the following

/mnt/raid5/storage  “RAID 5 Storage”   dperm:0750 fperm:0660 umask:7007

Then update the configuration of /mnt/raid5/storage so users can access it

sudo chgrp -R users /mnt/raid5/storage  #change the group to users (pi is a member of it)
sudo chmod -R ug+r+w,o-rwx /mnt/raid5/storage # change permissions (so pi can access it)

Fifth, install ufw if not already

sudo apt-get install ufw
sudo ufw allow 548
sudo ufw allow 5353

Sixth, restart the whole stack

sudo service avahi-daemon restart
sudo service netatalk restart
sudo service smbd restart

That’s it!

 

Raspberry Pi 2B RAID 5 build – Part 4 – Final

Now we install Samba which is a file sharing program for Linux, it is Linux’s implementation of the SMB file protocol used by Windows. Once installed we can connect to shared folder on the tinypute from other machines.

First, install Samba:

sudo apt-get install samba
sudo apt-get install libpam-smbpass

Second, configure /etc/samba/smb.conf as follows:

# Maximum number of usershare. 0 (default) means that usershare is disabled.
usershare max shares = 100 #Uncomment this line (remove the first character “;”)

[homes]
   comment = Home Directories
   browseable = no
# By default, the home directories are exported read-only. Change the
# next parameter to ‘no’ if you want to be able to write to them.
   read only = no

Third, create a folder for users to share

sudo mkdir /mnt/raid5/storage
sudo chmod ug+rwx /mnt/raid5/storage

Fourth, configure smb to share the folder, add the following line to /etc/samba/smb.conf

[storage]
   comment = RAID 5 storage folder
   path = /mnt/raid5
   guest ok = no
   browseable = yes
   create mask = 0600
   directory mask = 0700

Restart the smbd service

sudo service smbd restart

Fifth, we install ufw (uncomplicated firewall) so we can open ports required by Samba.

sudo apt-get install ufw
sudo ufw allow 135
sudo ufw allow 137
sudo ufw allow 138
sudo ufw allow 139
sudo ufw allow 445
sudo ufw enable

Sixth, now we connect to the share we created before in /mnt/raid5 (i.e. storage folder)

Before connecting the user that will access the share must be created.

sudo smbpasswd -a pi #pi is the user that will connect to the shared folder

smbpasswd

The shared folder can be connected from another PC now.

On my Mac OSX Yosemite using Finder -> Go -> Connect To Server and enter smb://raid5/storage. A password prompt will be provided, enter as Registered User pi with the SMB password you provided before.

That’s it! New folders can be created, renamed, deleted. The same goes for files, you can edit them too.

Raspberry Pi 2B RAID 5 build – Part 3

Alright lets continue with our stock Raspberry Pi – Jessie build. It’s a long post, hang on to the handle bars!

First, install mdadm using the following commands:

sudo apt-get update #Updates our repository list
sudo apt-get install mdadm #
Accept the prompt during the installation.

Second, we’ll assume the disks are intended for a built from scratch RAID 5 array, so we’ll destroy all data on the disk (technically all we’re doing is remove previous partition table and formatting information, it could still be recovered  with data recovery software, many available on the Internet).

We’ll also assume 3 disks. More can be used, but not less than 3 for a RAID 5 array, that’s a requirement. In my case I have 3 powered external USB disks directly plugged in to the Pi.

Third, identify the disks using lsblk -o NAME,SIZE,FSTYPE,TYPE,MOUNTPOINT 

lsblk

Here are my three disks, sda1, sdb1 and sdc1 (a through c denoting the sequence of the disks). My disks are partitioned already in the above picture (we’ll talk about that below) so they have numeric sequencing for their disks (the number 1 as all use the first partition). If they never partitioned then you’ll see sda, sdb, sdc and need to partition them before use.

Be very careful and verify that the disks identified are indeed disks that you intend to use! Once we proceed all previous data will be erased!

Fourth, we’ll start by partioning them using the command sudo parted. Once launched you’ll see a prompt with (parted). We’ll enter the following commands at this prompt. Start creating the partitions.

select /dev/sda
mklabel gpt
mkpart primary ext4 1049KB 3TB

select /dev/sda selects the first disk to be partitioned.
mklabel creates a partition table of type gpt (specifically needed for Linux and large multi Terabyte disks).
mkpart creates the partition. In this case I am starting at 1049KB (never mind the reasoning …) and ending at 3TB as that is the size of the disks I have (a 3TB external USB drive).

Proceed to the other disks (sdb and sdc replacing sda) the same way.
Enter quit to exit out of parted.

Fifth, we create the RAID 5 array using the following commands. This will prevent from the array created with spares (which we don’t want, we want to use all the disks for the maximum capacity we can get, we’re already losing 1/3 of the total disk space for parity information).

sudo mdadm –create –verbose –force –assume-clean /dev/md0 –level=5 \
–raid-devices=3 /dev/sda1 /dev/sdb1 /dev/sdc1

Check that they’re running with the following command

cat /proc/mdstat

You should see:

mdstat

Lets create the filesystem (this is what most resembles the Format command in Windows).

sudo mkfs.ext4 -F /dev/md0

You should see:

mkfs

It is now ready to mount so we can access it

sudo mkdir -p /mnt/raid5

You can now mount it using

sudo mount /dev/md0 /mnt/raid5

and see it’s content by

ls -al /mnt/raid5

mount

You can also confirm its capacity by (note /dev/md0 with 5.5T of size).

df -h -x devtmpfs -x tmpfs

mount

We’ll save the configuration in /etc/mdadm/mdadm.conf so it starts up at boot time automatically.

sudo mdadm –detail –scan | sudo tee -a /etc/mdadm/mdadm.conf

Update the initial file system (Raspberry Pi uses a RAM disk image when booting up and we want to include our array).

sudo update-initramfs -u

We’ll add the drive array to our filesystem table also so it will be mounted automatically when booting up.

echo ‘/dev/md0 /mnt/raid5 ext4 defaults,nofail,discard 0 0’ | sudo tee -a /etc/fstab

Finally confirm the array gets mounted by rebooting the Pi.

sudo reboot

You should see the following when it has booted.

ls

If “lost+found” entry isn’t listed there is more work to do (which I had to do with my Pi).

Edit /etc/rc.local file

sudo pico /etc/rc.local

Add the following line right before the line containing “exit 0”

/usr/local/bin/raid5 &

Then we create a shell script at /usr/local/bin/raid5

sudo pico /usr/local/bin/raid5

Enter the following lines in it

#!/bin/bash
# Sleep for 20 seconds after boot to make all the disks available for array assembly
sleep 20
sudo mdadm –assemble –scan # Assemble the RAID 5 array

Then set the execute permissions for the file

sudo chmod +x /usr/local/bin/raid5

Now reboot and the raid array should mount automatically. If it still doesn’t then add the following to /usr/local/bin/raid5

mount -a

Once mounted run the following command so I can start populating the /mnt/raid5 folder.

sudo chmod ug+wrx /mnt/raid5

That’s it!

Next I’ll setup samba (SMB Windows shares for Linux) and share out the folder so I can connect to it from other machines …

Next move on to part 4, the end of the journey: https://caesarsamsi.wordpress.com/2017/01/03/raspberry-pi-2b-raid-5-build-part-4/

Raspberry Pi 2B RAID 5 build – Part 2

Now we’re ready to do the semi difficult parts.

Write the Raspbian Linux OS image to the micro SD card. I use a Mac so I use the following instructions: https://www.raspberrypi.org/…/inst…/installing-images/mac.md

Note that when you are in the Mac’s System Report window, expand Hardware -> USB -> USB2.0 Hub -> USB 2.0 Hub then click on USB Storage. Or whatever you do, find that USB Storage node. In the details panel below on the right you’ll find “BSD Name”, in my case it is disk5, that’s the micro SD card we’re writing the image to (the Pi instructions missed this very tiny important detail).

system-reporthardware

If you use Windows then use the following instructions:
https://www.raspberrypi.org/…/…/installing-images/windows.md

For Macs, when you use the sudo dd command to write the image to the micro SD card, a progress update won’t be displayed. Instead press Control-T to see a status update when you want.

The process takes about 4.5 minutes on my Mac. It’ll be roughly the same on other computers as the time is dependent on the USB 2.0 port and microSD speed. I have a Class 10 micro SD card, which is pretty fast at the time this is posted.

Once you’re done with writing the Raspbian Linux OS image, boot up the Pi.

It is already preconfigured to provide X Window for a GUI display, and the network is preconfigured to use DHCP.

It’s now a ready to use Linux desktop, though I like the term tinypute myself

Next we’ll install and build the RAID 5 array itself …

On to Part 3 of the journey https://caesarsamsi.wordpress.com/2017/01/03/raspberry-pi-2b-raid-build-part-3/

Raspberry Pi 2B RAID 5 build – Part 1

First, you need a Raspberry Pi 2B computer. You can purchase it anywhere. It’s home is here: https://www.raspberrypi.org/

Remember to purchase a micro USB cable with a power charger which is used as the Pi’s power supply, also remember to purchase an HDMI cable.

The HDMI cable is used to display the Pi’s video output on an HDTV monitor (1080p). I’ve only used the HDMI display once to find the IP address of the Pi, after that I typically use the terminal/ssh to connect and work with the Pi.

In case they don’t come with the USB 2.0 cable (they should), also remember to buy 4 USB 2.0 cables.

Second, you need 4 USB 2.0 external hard disks. The Pi has 4 USB 2.0 ports so up to 4 disks can be connected directly. You can use more disks but you’ll have to use a USB hub. Using a hub to use more than 4 USB disks will degrade performance as a single USB 2.0 connection is shared amongst many disks.

Third, you’ll need a micro SD card, 8GB will do. This will be the Pi’s Linux OS hard disk.

Fourth, you’ll need to download the OS (it’s called Raspbian and is actually Linux in the Debian distribution form. Get it? Rasp(berry) and (De)bian .

You can download it from here: https://www.raspberrypi.org/downloads/raspbian/

Next we’ll write the image to the SD Card …

On to part 2 of the journey https://caesarsamsi.wordpress.com/2016/12/31/raspberry-pi-2b-raid-build-part-2/