Gpredict and ICOM 9700 connected directly with a python script

Hi,

i’m using private a small python script which directly sends the CAT CI-V commands via serial port to the ICOM 9700. its getting the doppler correction from gpredict and smoothes the control and handling.

you can set up your satellites for USB/CW/FM with a individual RIT for every satellite and mode (SSB, CW).
the correction for dopplershift is done when a offset of hertz is reached, so no update every 500ms but, when the frequence drifted more then for example 40 Hz. This reduce heave load on the interface, when the satellite is far away.
you can sweep over the transponder with the dial knob and within milliseconds the correct uplink is set. so you will hear your signal exactly back when you will whistling. And you can choose to held constant the frequency at the satellite or on the downlink.

i am using this way, because hamlib 4.1 and gpredict are not really working smooth together (like satpc32 or macDoppler) when you want to work linear satellites.

maybe you can test this script and give feedback. some of the feature would be nice, when they will find the way directly to gpredict.

Bye Andreas, DL7OAP

2 Likes

This is a good idea, the same concept is already used in the rotator controller with a variable threshold.

And thanks for the info!

This weekend I’ll probably fork you repository and write a version for the single half duplex FT817 situation.
I will add a transmit button and the possibility to add an offset in order to match better uplink and downlink.
I was wondering on directly modify the gpredict code, but the intermediate python solution is better as fast prototyping.

With the single ft-817 I’ve some issues, see my post relative to it but at the moment no replay on the problem, so I’ll try to solve by myself.

So thanks for the idea, 73 de in3aqk

73 de in3aqk

Hi,

you are welcome to use it :slight_smile:

I can only do a little bit of vba, java, python and freepascal. Unfortunately I don’t know C, otherwise I would have written a plugin for gpredict, for direct control of the IC9700 and also an update for a more rounded control of the transceiver to avoid unnecessary many CAT commands.

maybe we can optimize the python script so that new transceiver interfaces can easily be added there?

73 de DL7OAP, Andreas

Hi Andreas,
Your software is perhaps the solution to a bad issue for a longtime with IC9100 i.e. the hamlib with GPredict switch always between VFOA and VFOB. I will check it soon. IC9700 had the same behavior ???
73 de F5MDY, Nicolas

Hi,

with hamlib 3.* there was a other strang behavior on the IC9700. Look here: https://www.youtube.com/watch?v=hwzL0K0XTOA

The IC9100 should have nearly the same CI-V CAT commands so my script should work with the IC9100, too. Maybe you can test this?

But hamlib 4.0 and especially hamib 4.1 has been expanded so that gpredict work with ic910, ic9100 and ic9700 directly with hamlib 4.1.

Have a look for the notes how to configure that: https://github.com/csete/gpredict/tree/master/doc/notes

And in hamlib 4.1 the very new parameter “-x 1” helps to supress the wrong reading of the tx-frequency of gpredict (i use rigctld -m 3081 -r /dev/ic9700a -s 115200 -x 1 --set-conf=cache_timeout=0 here for the ic9700).

But even with all this new functions you get not a a smooth controll like SatPC32 and MacDopper can do it. And because i like gpredict and linux (i do not use Windows) i wrote this python-plugin-adapter that direct send the CI-V CAT commands and i can have a basic set of parameter for every satellite (like RIT, etc.).

Maybe there is somebody out there, who is familiar with C and can do a fork of gpredict and implement direct serial CAT commands for the mainly used transceivers (IC9700, IC910, IC9100, TS200, FT-817, FT-991, etc…) and do the smoothing, not to send a CAT-command evers defined millisecond, but only when a necessary and hearable offset in hertz is reached.

73 de DL7OAP

Hi,

by the way, more Details to the hamlib 4.1 -x parameter you can find here:

Bye DL7OAP, Andreas

Hallo Andreas,

Many thanks for writing the Python script for the IC-9700. Even though I do have a IC-9700, I only use it for terrestrial work. I’m using a IC-9100 on the birds. I adapted your script for the IC-9100. The IC-9100 does not have a CAT command for RIT so I had to adapt the script to adjust the main and sub VFO frequencies. But that’s easy, you did all the hard work!

I also made some other changes, including the ability to interface it with Gqrx for (up to three) panadapters. This is from the comments I included in the gp2ic9100 script that describe the changes I made:

      The original script has been adapted for use with the Icom IC-9100. The IC-9100 does 
      not support CAT control for RIT like the IC-9700 does for which the script was originally
      developed. This script will, through the ic9100.py module, adjust
      the main and sub VFO frequency for the offset read from the satellites.txt file. By 
      applying the frequency offset to the main and sub VFO's you will still be able to use
      the RIT on the radio when needed.
      This modified script also adds support for up to three Gqrx instances to act as 
      panadapters, or to use as separate receivers. The frequencies that the Gqrx instances are
      tuned to are in sync with the radio main and sub VFO's. The Gqrx ports that this script
      will send frequency information to are defined by PORT_GQRX_VHF, PORT_GQRX_UHF, and
      PORT_GQRX_SHF.
      A little extra excepton information has been added. Most print statements have been
      removed or commented out to improve performance. It probably would have been better to
      add a debug option that would print relevant info, but I'm lazy. :)
      This modified script will easily allow for Gpredict frequency updates every 250ms.
      Gpredict and the Gqrx instances will track with with the radio if the frequency on the
      IC-9100 is changed using the main dial.
      I have tested this only on a Raspberry Pi 4B (4Gb version) with FM and linear satellites.

You probably use the USB connection with the IC-9100, but I use a USB to Serial adapter and a traditional CI-V interface using the “remote” port on the radio. A problem that occurs with a traditional interface is that all commands you send to the CI-V adapter get echoed back because CI-V is a single wire bus system. So you receive whatever you send. I made a change to the receive routine to drop all the received frames but the last frame. This will prevent the script from trying to interpret the CI-V command it sends as data being received from the radio.

For anyone wanting to use my adapted version for the IC-9100 please note that CI-V transceive should be off on the radio.(Menu item 62 on the IC9100.)

I guess I should get a Github account, but if you’re curious everyone can download my IC-9100 version of your scripts here:

http://www.kr1st.com/downloads/gp2ic9100.zip

Besides for not allowing to define an offset per satellite in Gpredict, a real problem is that Gpredict puts the radio in satellite mode when it attempts to adjust for doppler. That mode should only be used for manual control of doppler, not when using CI-V control. Your script does it the right way. By enabling the satellite mode and then try to adjust the VFO’s for doppler through CI-V you end up with two algorithms that are fighting each other. One in Gpredict, and the other in the radio. Every time Gpredict sends the calculated frequency for, say, the downlink to the radio, the radio calculates a new uplink and adjusts the VFO for the uplink frequency. This makes it virtually impossible to be on the correct frequency on a linear satellite. Even if you manage to get on the correct frequency, it will last only for a very short while, and it will get frustrating very quickly.

I too was considering making changes to Gpredict, but I don’t have an environment set up for compiling and debugging the Gpredict source. Your script provided a great solution I could easily build on. I’m very grateful for your work and making it available. Of course I’m also very grateful for the Gpredict and Gqrx software! These products make it fun to use something as simple as a Raspberry Pi and turn it into a self contained satellite ground station.

Below is a screenshot of the Rpi running Gpredict, two instances of Gqrx, and gp2ic9100. On the top Gqrx instance you can see my downlink signal on CAS-4B this afternoon while CAS-4A is also in view. You can also see the FM downlink signal of PO-101 as well. As you can see on the map, it was very busy above my QTH this afternoon. The Gqrx instance below that shows the uplink. The RTL-SDR dongle on the uplink gets horribly overloaded while I’m transmitting. :slight_smile: I have three RTL-SDR dongles (HF/VHF/UHF) attached to the IC-9100 at various tap points, so I will always be able to monitor the downlink and uplink at the same time and never have to toggle between them for U/V or V/U satellites.

Sorry for the long post. :wink:

73,
–Alex KR1ST

3 Likes

Wow, great work from both of you. I guess I have no excuse not to upgrade my lowly 706MKIIG…