Grig and IC-7410 (2)

passband

Here I am trying to change first the mode, and then the passband width (=filter). What happens is that the mode changes alright, but not the passband width.

% grig -d 5 -m 367 -r /dev/ttyUSB0 -s 19200 2> grig.log

I found that the debug level of 5 is necessary to gather all the traffic between grig and IC-7410.

% cat grig.log | colrm 1 40 | colrm 40 | grep "fe fe" | uniq | egrep 'e0 04|e0 06|80 04|80 06' 
            
fe fe 80 e0 06 00 fd <- Send operating mode LSB                  
fe fe 80 e0 04 fd <- Read operating mode                      
fe fe e0 80 04 00 02 fd <- mode is LSB and FIL2               
                
fe fe 80 e0 06 01 fd <- Send operating mode USB                   
fe fe 80 e0 04 fd <- Read operating mode                      
fe fe e0 80 04 01 02 fd <- mode is USB and FIL2                
                
fe fe 80 e0 06 02 fd <- Send operating mode AM                   
fe fe 80 e0 04 fd <- Read operating mode                      
fe fe e0 80 04 02 02 fd <- mode is AM and FIL2              
                
fe fe 80 e0 06 03 fd <- Send operating mode CW                   
fe fe 80 e0 04 fd <- Read operating mode                      
fe fe e0 80 04 03 02 fd <- mode is CW and FIL2               
               
fe fe 80 e0 06 04 fd <- Send operating mode RTTY                   
fe fe 80 e0 04 fd <- Read operating mode                      
fe fe e0 80 04 04 02 fd <- mode is RTTY and FIL2                

(so far so good, now I'm trying to change the passband width (=filter).)
               
fe fe 80 e0 06 04 fd <- Send operating mode RTTY                   
fe fe 80 e0 04 fd <- Read operating mode                      
fe fe e0 80 04 04 02 fd <- mode is RTTY and FIL2               

fe fe 80 e0 06 04 fd <- Send operating mode RTTY                   
fe fe 80 e0 04 fd                      
fe fe e0 80 04 04 02 fd                

fe fe 80 e0 06 04 fd <- Send operating mode RTTY                   
fe fe 80 e0 04 fd                      
fe fe e0 80 04 04 02 fd                

fe fe 80 e0 06 04 fd <- Send operating mode RTTY                   
fe fe 80 e0 04 fd                      
fe fe e0 80 04 04 02 fd                

It seems only the first parameter (Operating mode) is sent, but not the second parameter (Filter setting). Is that the cause of the problem?

opmode

Grig and IC-7410

Let’s see what grig and IC-7410 are talking each other.

% grig -d 4 -m 367 -r /dev/ttyUSB0 -s 19200 2> grig.log

dataFormat

Before looking into the log file, we need to know the data format. The line that starts with “fe fe 80 e0” is from grig to IC-7410, and with “fe fe e0 80” from IC-7410 to grig.

% grep "fe fe" grig.log | colrm 1 40 | colrm 40 | uniq
fe fe 80 e0 03 fd <- read operating frequency                       
fe fe e0 80 03 80 91 01 07 00 fd <- 0007019.180kHz   
fe fe 80 e0 04 fd <- read operating mode                      
fe fe e0 80 04 01 02 fd <- USB, FIL2               
fe fe 80 e0 1a 03 fd <- read the selected filter width                 
fe fe e0 80 1a 03 34 fd <- 3000Hz                
fe fe 80 e0 14 0a fd <- read RF PWR position                   
fe fe e0 80 14 0a 00 01 fdm            
fe fe 80 e0 15 02 fd <- read S-meter level                   
fe fe e0 80 15 02 00 55 fd           
fe fe 80 e0 15 12 fd <- read SWR meter                  
fe fe e0 80 15 12 00 00 fd             
fe fe 80 e0 15 13 fd <- read ALC meter                  
fe fe e0 80 15 13 00 00 fd             
fe fe 80 e0 16 12 fd <- read AGC                   
fe fe e0 80 16 12 02 fd <- AGC is MID               
fe fe 80 e0 11 fd <- read ATT                      
fe fe e0 80 11 00 fd <- ATT is OFF                   
fe fe 80 e0 16 02 fd <- read Preamp                  
fe fe e0 80 16 02 00 fd <- Preamp is OFF               
fe fe 80 e0 14 01 fd <- read AF position                  
fe fe e0 80 14 01 00 54 fd             
fe fe 80 e0 14 02 fd <- read RF position                  
fe fe e0 80 14 02 02 55 fd             
fe fe 80 e0 14 03 fd <= read SQL position                  
fe fe e0 80 14 03 00 00 fd             
fe fe 80 e0 14 06 fd <- read NR position                 
fe fe e0 80 14 06 01 04 fd             
fe fe 80 e0 14 0d fd <- read NOTCH position                  
fe fe e0 80 14 0d 01 19 fd             
fe fe 80 e0 14 07 fd <- read inner TWIN PBT position                  
fe fe e0 80 14 07 01 28 fd             
fe fe 80 e0 14 08 fd <- read outer TWIN PBT position                  
fe fe e0 80 14 08 01 28 fd             
fe fe 80 e0 14 09 fd <- read CW PITCH position                   
fe fe e0 80 14 09 01 28 fd <- position is center            
fe fe 80 e0 14 0c fd <- read KEY SPEED position                 
fe fe e0 80 14 0c 01 11 fd             
fe fe 80 e0 14 0f fd <- read BK-IN DELAY                  
fe fe e0 80 14 0f 01 27 fd             
fe fe 80 e0 14 10 fd <- undefined command                 
fe fe e0 80 fa fd <- NG response                     
fe fe 80 e0 1a 03 fd <- read selected filter width                 
fe fe e0 80 1a 03 34 fd                
fe fe 80 e0 14 16 fd <- read VOX gain                  
fe fe e0 80 14 16 00 25 fd             
fe fe 80 e0 14 0e fd <- read COMP position                   
fe fe e0 80 14 0e 00 11 fd             
fe fe 80 e0 14 0b fd <- read read MIC position                  
fe fe e0 80 14 0b 00 00 fd             
fe fe 80 e0 16 50 fd <- read Dial Lock Function                  
fe fe e0 80 16 50 00 fd <- the function is off               
fe fe 80 e0 16 12 fd <- read AGC                   
fe fe e0 80 16 12 02 fd <- AGC is MID              
fe fe 80 e0 16 22 fd <-read Noise Blanker                  
fe fe e0 80 16 22 00 fd <- off               
fe fe 80 e0 16 44 fd <- read Speech Compressor                  
fe fe e0 80 16 44 00 fd <- off              
fe fe 80 e0 16 46 fd <- read VOX function                  
fe fe e0 80 16 46 00 fd <- off               
fe fe 80 e0 16 42 fd <- read Repeater tone                  
fe fe e0 80 16 42 00 fd <- off               
fe fe 80 e0 16 43 fd <- read Tone squelch                   
fe fe e0 80 16 43 00 fd <- off               
fe fe 80 e0 16 47 fd <- read BK-IN function                  
fe fe e0 80 16 47 00 fd <- off               
fe fe 80 e0 16 47 fd <- read BK-IN function                  
fe fe e0 80 16 47 00 fd <- off                
fe fe 80 e0 16 41 fd <- read Auto Notch function                   
fe fe e0 80 16 41 00 fd <- off               
fe fe 80 e0 16 40 fd <- read Noise Reduction                 
fe fe e0 80 16 40 00 fd <- off                
fe fe 80 e0 16 45 fd <- read Monitor Function                   
fe fe e0 80 16 45 00 fd <- off               
fe fe 80 e0 16 48 fd <- read Manual Notch function                  
fe fe e0 80 16 48 00 fd <- off                
fe fe 80 e0 16 50 fd <-read Dial Lock function                  
fe fe e0 80 16 50 00 fd <- off               
fe fe 80 e0 16 4c fd <-read VSC function                  
fe fe e0 80 16 4c 00 fd <- off                
fe fe 80 e0 14 0e fd <- read comp positon                  
fe fe e0 80 14 0e 00 11 fd             
fe fe 80 e0 14 01 fd <- read AF position                  
fe fe e0 80 14 01 00 54 fd             
fe fe 80 e0 15 02 fd <- read S-meter Level                  
fe fe e0 80 15 02 00 00 fd             
fe fe 80 e0 03 fd  <- read operating frequency                     
fe fe e0 80 03 80 97 01 07 00 fd       
fe fe 80 e0 14 06 fd <- read NR position                  
fe fe e0 80 14 06 01 04 fd             
fe fe 80 e0 14 0d fd <- read Notch positon                  
fe fe e0 80 14 0d 01 19 fd
(stuff deleted)            
 % grep "fe fe 80 e0" grig.log | colrm 1 40 | colrm 40 | uniq | sort | uniq -c
      2 fe fe 80 e0 03 fd                      
      1 fe fe 80 e0 04 fd                      
      1 fe fe 80 e0 11 fd                      
      2 fe fe 80 e0 14 01 fd                   
      1 fe fe 80 e0 14 02 fd                   
      1 fe fe 80 e0 14 03 fd                   
      2 fe fe 80 e0 14 06 fd                   
      1 fe fe 80 e0 14 07 fd                   
      1 fe fe 80 e0 14 08 fd                   
      1 fe fe 80 e0 14 09 fd                   
      1 fe fe 80 e0 14 0a fd                   
      1 fe fe 80 e0 14 0b fd                   
      1 fe fe 80 e0 14 0c fd                   
      2 fe fe 80 e0 14 0d fd                   
      2 fe fe 80 e0 14 0e fd                   
      1 fe fe 80 e0 14 0f fd                   
      1 fe fe 80 e0 14 10 fd  <- undefined command                  
      1 fe fe 80 e0 14 16 fd                   
      2 fe fe 80 e0 15 02 fd                   
      1 fe fe 80 e0 15 12 fd                   
      1 fe fe 80 e0 15 13 fd                   
      1 fe fe 80 e0 16 02 fd                   
      3 fe fe 80 e0 16 12 fd                   
      2 fe fe 80 e0 16 22 fd                   
      2 fe fe 80 e0 16 40 fd                   
      2 fe fe 80 e0 16 41 fd                   
      2 fe fe 80 e0 16 42 fd                   
      2 fe fe 80 e0 16 43 fd                   
      2 fe fe 80 e0 16 44 fd                   
      2 fe fe 80 e0 16 45 fd                   
      2 fe fe 80 e0 16 46 fd                   
      2 fe fe 80 e0 16 47 fd                   
      2 fe fe 80 e0 16 48 fd                   
      2 fe fe 80 e0 16 4c fd                   
      3 fe fe 80 e0 16 50 fd                   
      2 fe fe 80 e0 1a 03 fd

So as far as we see here, it looks almost OK.

Use the Source, Luke! (2)

IC-7410product

So let’s see how IC-7410 is supported by Hamlib.

% dpkg -l | grep hamlib
ii  libhamlib-dev   1.2.15.3-1ubuntu4 amd64 Development library to control radio transceivers and receivers
ii  libhamlib-utils 1.2.15.3-1ubuntu4 amd64 Utilities to support the hamlib radio control library
ii  libhamlib2      1.2.15.3-1ubuntu4 amd64 Run-time library to control radio transceivers and receivers

First, we have to download the source code from here.

% ls -l ~/Downloads/hamlib-1.2.15.3/icom/*.h
-rw-r--r-- 1 user1 user1  1507 11月  2  2012 icom/frame.h
-rw-r--r-- 1 user1 user1  9525 11月  2  2012 icom/icom.h
-rw-r--r-- 1 user1 user1 14342 11月  2  2012 icom/icom_defs.h
-rw-r--r-- 1 user1 user1  2208 11月  2  2012 icom/optoscan.h

% ls ~/Downloads/hamlib-1.2.15.3/icom/*.c
delta2.c  ic471.c   ic707.c   ic728.c  ic7410.c  ic761.c   ic7800.c  ic9100.c  icr20.c    icr8500.c  omni.c
frame.c   ic475.c   ic718.c   ic735.c  ic746.c   ic765.c   ic781.c   ic92d.c   icr7000.c  icr9000.c  optoscan.c
ic1275.c  ic7000.c  ic7200.c  ic736.c  ic751.c   ic7700.c  ic820h.c  ic970.c   icr71.c    icr9500.c  os456.c
ic271.c   ic703.c   ic725.c   ic737.c  ic756.c   ic775.c   ic821h.c  icom.c    icr72.c    icrx7.c    os535.c
ic275.c   ic706.c   ic726.c   ic738.c  ic7600.c  ic78.c    ic910.c   icr10.c   icr75.c    id1.c

A little bit surprising, because I thought all the rig dependent definitions are in ic*.h

 % wc *.h ic7410.c
   38   234  1507 frame.h
  252  1273  9525 icom.h
  394  2271 14342 icom_defs.h
   65   289  2208 optoscan.h
  233   751  7880 ic7410.c
% cat ic7410.c     <--- excerpt

/*
 *  Hamlib CI-V backend - description of IC-7410
 *  Copyright (c) 2011 by Stephane Fillod
 */

/*
 * Guess from IC7600
 */
#define IC7410_STR_CAL { 16, \
        { \
        {   0, -54 }, /* S0 */ \
        { 124,   0 }, /* S9 */ \
        { 246,  60 } /* S9+60dB */  \
        } }

/*
 * IC-7410 rig capabilities.
 *
 * TODO: complete command set (esp. the $1A bunch!) and testing..
 */
static const struct icom_priv_caps ic7410_priv_caps = {
                0x80,   /* default address */
                0,              /* 731 mode */
                ic756pro_ts_sc_list
};

Note that the source code is also available at:
https://github.com/N0NB/hamlib/blob/master/icom/ic7410.c

% cat icom_defs.h     <--- excerpt
/*
 *  Hamlib CI-V backend - defines for the ICOM "CI-V" interface.
 *  Copyright (c) 2000-2010 by Stephane Fillod
 */

/*
 * Set mode data (C_SET_MODE) sub commands
 */
#define S_LSB   0x00            /* Set to LSB */
#define S_USB   0x01            /* Set to USB */
#define S_AM    0x02            /* Set to AM */
#define S_CW    0x03            /* Set to CW */
#define S_RTTY  0x04            /* Set to RTTY */
#define S_FM    0x05            /* Set to FM */
#define S_WFM   0x06            /* Set to Wide FM */
#define S_CWR   0x07            /* Set to CW Reverse */
#define S_RTTYR 0x08            /* Set to RTTY Reverse */
#define S_AMS   0x11            /* Set to AMS */
#define S_PSK   0x12            /* 7800 PSK USB */
#define S_PSKR  0x13            /* 7800 PSK LSB */

/* filter width coding for newer ICOM rigs with 3 filter width */
#define PD_WIDE_3       0x01    /* Wide */
#define PD_MEDIUM_3     0x02    /* Medium */
#define PD_NARROW_3     0x03    /* Narrow */

The above definitions match well with the following descriptions in the operation manual:

icomremote

http://www.icom.co.jp/world/support/download/manual/pdf/IC-7410_ENG_1.pdf

Now that you have the source, if anything goes wrong, it’s your fault!

Flrig

flrig

Flrig is a rig control program that cooperates with fldigi. It is almost OK with my IC-7410, but the mode change sometimes does not work properly. Perhaps some configuration parameters are wrong, I suspect.

CQRLOG and rigctld

cqrlogRigctld

Both fldigi and CQRLOG work fine with IC-7410. The only problem is that rigctld does not start automatically with CQRLOG, and I have to run rigctld manually.

dialout

If you try:

% cqrlog --debug=1

you will get

rigctld1

So let’s change all but the serial speed parameters to be default.

rigctld4

Now it runs!

rigctld2

Hamlib and grig

grig
grig3
grig4

Grig works with IC-7410, but some functions are faulty. Of course, you can fix it by yourself if you really need to.

Grig is free software licensed under the GNU General Public License. This gives you the freedom to use and modify grig to suit your needs.

grig2

Hamlib and rigctl

rigctl

You can control your rig directly from your program, but sometimes it is easier to use existing libraries.

fldigi

Rig control is also possible from fldigi using Hamlib.

The followings are the configuration for IC-7410.

fldigi2

fldifi3