Icom rig control over CI-V using a serial terminal - Need Help

Discussion in 'Amateur Radio Software' started by KA1YBS, Apr 13, 2021.

ad: L-HROutlet
ad: l-rl
ad: MessiPaoloni-1
ad: L-Geochron
ad: L-MFJ
ad: abrind-2
ad: Left-3
ad: Left-2
ad: HRDLLC-2
  1. KA1YBS

    KA1YBS XML Subscriber QRZ Page

    Hello fellow hams.

    I am trying to write a small app that wakes my IC-7610 from standby, and also puts the rig in standby when I want to.

    A simple rig on/off application for Windows.

    Like many, I use WSJT, a logger, etc. None of these pieces of software sends a wake/shutdown command over CI-V. It is frustrating when I have to use RS-BA1 just to wake the rig.

    I found an old application called "CI-V test" by DF4OR, which I am able to use to wake and sleep my rig with. I am using the USB port on the back of the radio, and not the separate CI-V port. I am doing perfectly with the USB port, so this is not the issue.

    Now I want to learn how to write my own hexadecimal string to play with CI-V.

    I have downloaded and read through the Icom 7610 CI-V reference manual. I think I am not fully understanding the data structure. Unfortunately, CI-V test does not display the full hexadecimal string that it sends to the radio, otherwise, this might be easier for me to tackle.

    To wake the radio, you send: 98E01801
    To sleep, its: 98E01800
    S-Meter read: 98E01502
    and so 0n...

    I am using a terminal program, similar to the classic "Hyperterminal", called YAT. I am able to connect to the radio, however, no echo of the result of the strings I send.

    I believe my issue lies with the HEX preamble. Icom lists it as "FEFE" in the manual, however, more "FE"s may be required at high baud rates (4800 and up). CI-V Test does not show the preamble (FE) or EOT code (FD), so I am unable to decipher further.

    Has anyone played with a terminal program to read/write CI-V commands? If so, please report your findings.

    Thanks and 73
  2. G8FXC

    G8FXC XML Subscriber QRZ Page

    I think that the trouble you are having is that these are hexadecimal strings you need to send and the average terminal emulator only expects to send ASCII characters. There's no single key on the keyboard that will generate a 0xFE character - it's not an official ASCII character. You may be able to send escape sequences keyed from the keyboard, but this will be slow and error prone at best and close to impossible at worst.

    I have been experimenting on doing something similar using Microsoft Visual Basic - to send a few macro command sequences to my IC7300. I've only just started - yesterday afternoon, actually - but I have some code fragments that I could send you to get you started. I have a form with one button on it - click it and the code sends the CI-V command to get the current operating mode of the radio and reads the result back... Ping me a message with an email address if you are interested...

  3. KA1YBS

    KA1YBS XML Subscriber QRZ Page

    Hi Martin, Thanks for your reply. I PM'd you via QRZ. I could email you direct if you like.

    What a great heads-up. I found an interesting terminal application called "RealTerm" that sends HEX. I had no idea what was going on until your advice.
  4. KA1YBS

    KA1YBS XML Subscriber QRZ Page

    Hello QRZ,

    I learned a few tricks over the last day.

    I was using the wrong type of terminal and/or the wrong string character sequencing. Using RealTerm, I was finally able to send and receive HEX with the IC-7610.

    Martin, G8FXC, helped me with some VB code. I tried writing it in VBS, however, VBS does not support all the functionality needed. I am now learning Python as a result, and I made a crude Python script that actually works.

    Maybe one day I will make a GUI for it and release it along with source code. My implementation would plainly be for turning the rig on or off with options to set serial port, baud, radio ID, etc.

    KF2M likes this.
  5. K8AC

    K8AC XML Subscriber QRZ Page

    When you want to know what's really going on on a serial port, you use a serial port monitor program to trace the messages in each direction. I use the Eltima Serial Port Monitor, which is capable of tracing activity on real serial ports or virtual serial ports and it can monitor both ends of a virtual cable. CI-V protocols are unlike those used by other CAT implementations and the idea of sending hex data was abandoned by other manufacturers a decade or two ago.

    73, K8AC
  6. RN2FA

    RN2FA Ham Member QRZ Page

    Hi Tim
    Everything is so complicated with ICom. Each team has to fight. For my Icom7300 I am writing a program in Delphi, leisurely.
    Maybe you will be interested in what I have already done.
    You can download it here: http://rw2f.narod.ru/7300FA.rar
    Alex RN2FA, CN2FA

    I saw the button "download file" )) I'll try to do it here.
    Not. EXE files cannot be loaded here.
  7. KF5FEI

    KF5FEI Ham Member QRZ Page

    IIRC, the Icoms also have a device number, so you can have multiple radios on one serial port. Not sure if this applies to the USB ports as well.

    Be *VERY* careful dinking around with this, as you could inadvertently send a command that does some sort of factory thing and bricks the radio.

    Having a serial monitor and watching what working software sends is the best recommendation.
  8. M5BOP

    M5BOP Ham Member QRZ Page

    Hi Tim - any chance I could have an e-mail copy of your rough-and-ready Python source code, just to give me a starting point for something similar I want to do with my IC-9700. Won’t hold you to any support, just want a ground zero on how to start. My e-mail is as on QRZ.

    Many thanks,
    Mark, M5BOP
    Ipswich, England
  9. KA1YBS

    KA1YBS XML Subscriber QRZ Page

    Here it is for all:
    #! /usr/bin/python3
    # ICOM Power On for IC-7610
    #Python console adaptation by KA1YBS
    import serial
    import struct
    import sys
    #import time
    #from time import sleep
    baudrate = 19200
    #serialport = "COM4"
    serialport = "COM4"
    ser = serial.Serial(serialport, baudrate, timeout=2)
    ser.setDTR(False) # prevent TCVR cw send if USB key is set on DTR
    ser.setRTS(False) # prevent TCVR going transmit if USB Send is set on RTS
    # Define the string for TURN ON
    string_on = ["0xfe","0xfe","0x98","0xe0","0x18","0x01","0xfd"]
    # Define the string for TURN OFF
    string_off = ["0xfe","0xfe","0x98","0xe0","0x18","0x00","0xfd"]
    # Where fefe is start sequance, 98 is icom address, e0 is computer address, next n groups
    # represents function code (18 00=OFF; 18 01=ON), and fd is execute data
    string_set = 0
    if str(sys.argv[1]) == "0":
    print ('Turning Radio OFF...')
    while(string_set < 7):
    senddata = int(bytes(string_off[string_set], 'UTF-8'), 16)
    ser.write(struct.pack('>B', senddata))
    string_set +=1
    if str(sys.argv[1]) == "1":
    print ('Turning Radio ON...')
    while(string_set < 7):
    senddata = int(bytes(string_on[string_set], 'UTF-8'), 16)
    ser.write(struct.pack('>B', senddata))
    string_set +=1
    #baudrate = 9600
    #serialport = "/dev/ttyUSB0"
    M5BOP likes this.
  10. KA1YBS

    KA1YBS XML Subscriber QRZ Page

    Make sure your Python IDE uses the "Serial" library, and it's PATH is correct.

    There are a few things I am improving on, but am delayed in doing so. One is a simple GUI, the other is actual feedback from the rig, that is indeed ON or OFF.

    let me know how you make out.
    M5BOP likes this.

Share This Page