Setting up an Icom IC-9100 in Ubuntu 14.04 LTS and Linux Mint 17.1


Revised to accommodate Linux Mint 17.1 on May 7th, 2015. It should still be compatible with Ubuntu 14,04 LTS

Create a couple of scripts. they are interdependent upon each other so you really cannot begin testing them until after you have created and saved both of them.

The first script 'anchors' both of the ICOM IC9100 serial ports to always be named the same thing each and every single time (I so hated ttyusb0, ttyusb1, etc , etc. This always left me guessing if I was on the correct port.)

The first script are the udev rules that creat a couple of simlinks to wherever both of the IC-9100's twin serial ports were added to /dev/ttyUSB(x).  The purpose of this is to force the ports to always show up with the same name each and every single time your distro reboots or regardless how many times you turn your radio on and off.

Now the two serial ports for the radio will always be found at /dev/ttyIC9100A and /dev/ttyIC9100B.

Once the ports have been discovered and simlinks to them have been created, the second script is called to automatically start rigctld as a http service so that multiple applications may have access to your rig all at the same time. 

The file names themselves are not particularly relevant, but if you need to see a working copy, I suggest you avoid straying too far away from my working copies.


#/etc/udev/rules.d/49-IC-9100.rules
#command #1 - If the USB device that has just connected is not the one that this script applies to, then jump to the end of this rule. No work needs to be done.
SUBSYSTEM!="tty",GOTO="hamlib_end"

#As of January, 2015, this set of comments describes what the serial ports look like to Linux

#Icom IC-9100 USB Connection
# 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light

#Icom's Serial Port "A" the one we are looking to use

ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", ATTRS{serial}=="IC-9100 02002005 A", TEST!="/dev/ttyIC9100A", SYMLINK+="ttyIC9100A"

#Icom's Serial port "B" Not really needed for HamLib, but if we are anchoring one, we should anchor both. Consider this as 'future'
ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", ATTRS{serial}=="IC-9100 02002005 B", TEST!="/dev/ttyIC9100B", SYMLINK+="ttyIC9100B"

#So now, if the ICom Port "A" hardware was detected and the simlink created, now fire off an instance of rigctld

#start rigctld for an Icom IC-9100 Transceiver "if" the simlink to port "A" above was created
ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", ATTRS{serial}=="IC-9100 02002005 A", RUN+="/etc/init.d/ic9100_Net restart"

LABEL="hamlib_end"



This next script is the one that autostarts rigctld.
A couple of very important points to remember. 

  1. Configuration settings should never ever be 'hard coded' into the script like they are listed here.  I still need to resolve this issue.
  2. the 'status' case statement does not work.  I need to find a better way of indicating the running status of rigctld within this context.

#!/bin/bash
#/etc/init.d/ic9100_Net

# chkconfig: 35 90 12
# description: Rig Control Daemom customized to connect to Icom IC-9100 Tranceiver
#
# Get function from functions library
#. /etc/init.d/functions
# Start the service rigctld
start() {
        logger -s "Starting rigctld server..."
        # Give the ICOM serial port a chance to get comfortable with its new surroundings before attaching a service to it
        sleep 5
        # ToDo Need to figure out how to use a config file with this call
        /usr/local/bin/rigctld -m 368 -r /dev/ttyIC9100A -s 19200 None &
        ### Create the lock file ###
        touch /var/lock/rigctld
}
# Restart the service rigctld
stop() {
        logger -s "Stopping rigctld server..."
        killall rigctld
        ### Now, delete the lock file ###
        rm -f /var/lock/rigctld
}
### main logic ###
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  status)
        status rigctld
        ;;
  restart|reload|condrestart)
        stop
        start
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart|reload|status}"
        exit 1
esac

exit 0

Very IMPORTANT! Make the script executable:

  sudo chmod +x /etc/init.d/ic9100_Net


In all cases, you will need to add your login to the dialup group.

After the radio is plugged in via USB you can test the proper operation of these changes by running grig:

grig -m 2 -r localhost:4532 -p -P

If you were successful, grig will sync with whatever is currently displayed on the IC-9100 "and" PTT will work over USB.


A couple of things, I did not know where the script needed to reside.  It could have been put just as easily into /etc/rigctld for example. I did know that I wanted this script t to be accessible to any user which sort of ruled out keeping in the users /Home$ folder.

This set of scripts really needs a configuration file separate from the rigctl trigger script just in case you have some other brand of radio and need to modify this to work with something other than an ICOM IC-9100.

Enjoy
73 DE KB4LHP
Luther in Orlando

PS. This is still a work in progress which means "Your mileage WILL vary!"
Good luck



Comments

Popular posts from this blog

Recipe for building and installing "the new" WSJT-X v2.0.0 GA on Linux Mint 18.3

Kenwood TH-D74a - A D-Star Disappointment