[Help needed] Gpredict integration with SatNOGS DB

Hello everyone!

Gpredict is a fantastic tool written by @csete which we use extensively for simple operations and debugging of our stations. There are many HAMs and satellite enthusiasts that use Gpredict for their own operations and we would like to make sure they benefit from SatNOGS DB data.

Gpredict already has the functionality for fetching Satllite TLEs from network, and we would like to see a similar functionality for frequency data. The concept would look something like:

  • User selects “Update frequency data > from Network”
  • Gpredict fetches data from SatNOGS DB API
  • Gprefict updates local satellite frequency data

Our understanding is that someone coding in C would be able to pull this off quite easily. Any people willing to help on this?

@csete your input would be tremendously helpful too :slight_smile:

1 Like

Hi @pierros

Good idea! It would be nice to have this feature integrated and I think the concept you outline may provide the easiest integration.

My only firm request is that we do not add a bunch of new monstrous dependencies. I guess the only new dependency needed is a JSON parser, so a small, light weight and embedable C library like JSMN could be used.



I have a few questions before volunteering :wink:

Where will we host the frequency data ?
What should be the format (content) of this data ?

73’s de TA7W baris

My question was too early before reading the link you provided…

I started reading the DB API, but the second question still remains… What details should we have for the frequency definition ?

Struct in my mind is :

  • Beacon FRQ
  • Beacon Mode (CW, FSK, AFSK, Carrier, erc)
  • Radio Type (Simplex, Duplex, Transponder)
    – Simplex FRQ
    – Duplex RX FRQ
    – Duplex TX FRQ
  • Transponder RX FRQ start
  • Transponder RX FRQ end
  • Transponder TX FRQ start
  • Transponder TX FRQ end


“transmitters”: “https://db.satnogs.org/api/transmitters/” Provides :


and comments ?

gpredict holds all transceiver data in a configuration folder named trsp
In there there are different files per satellite, named as <norad_id>.trsp
In each file there is a structure to display multiple transceiver/transponder information as follows:
ps. I am putting the SatNOGS DB names of it in {}


Each file could contain as many blocks like the one above as needed (there are multiple transceivers per satellite sometimes.

We should probably amend MODE with not only {mode_id} but also with {invert} and {baud}. @csete?

So basically, Gpredict fetches info in JSON format from SatNOGS, parses them and creates/updates files in the above specified format.


I just read your explanation after finishing my ugly and fast implementation. I used mjsn as @csete offered to parse json files…
I forked gpredict to my github http://github.com/barisdinc/gpredict

I uploaded a video of the current status to youtube

I think it is a better way to follow your explanation… I need a few days to come up with a new version…

1 Like

wow, great work @ta7w! Fixing it to follow the tsrp way of doing things would be the final touch to make it perfect :slight_smile:

@csete what do you think?

Where we see the “trsp” file output in gpredict… I had to add this info to satellite information window…

What is the way of gpredict to display this information ?

Double clicking on a satellite opens a “Satellite Info” window. There are two tabs there. The second is “Transponders”. information gets displayed there, but also is used by Radio Control panel when controlling a rig (super useful).

Can be a silly stupid question, but, where this information come from originally…
I can see that if I download the required information from SATNOGS DB and put it here accordingly, everything will work fine…

Are these files I have here are STATIC files originally? I don’t want to read the code to figure it out… :sleeping:

Originally gpredict ships with some .tsrp files of some basic radio amateur satellite information. Fetching from network (SatNOGS DB) should replace existing with new information on those files and/or add new files, same way fetching from network does for TLEs.

OK… I got it… That will make my implementation much more simpler… :slight_smile:

Ideally, the mode string should be compliant with the Hamlib interface, but I think already today that is no longer the case. I have been accepting new .trsp files containing all sorts of descriptive mode strings.


Back in the old days, it seemed like a good idea to ship TLE and transponder files with gpredict, but today it is pretty silly. So we have a chance to do it right with the trsp files, then also fix it with TLE files later.

If we do it as suggested above by @pierros, I will remove the TRSP files from the repository and the distribution. In a second round we could add an option to load TRSP data from a local JSON file.

@ta7w Looks good so far :slight_smile:

@csete Which is the better way of doing this :

a) Download SatNOGS JSON transceiver files and convert them to trsp files on the fly, no modification for the rest of gpredict
b) Download SatNOGS JSON transceiver files and save them as json files, but need to modify the gpredict satellite info loader part

I think I will prefer the first one…

You raise a good point.

It’s probably best to keep the current trsp file format for compatibility reason and as you say, less change.

I think now I have a better implementation at http://github.com/barisdinc/gpredict

It deletes the old trsp files and downloads/generates new ones from SATNOGS DB

I used nxjson library (nxjson.{c,h} added to project} for json parsing

question @csete : I had problem with locales (the comma and dot delimiter for numbars), so I needed to change the locale to ‘C’ within frq-update.c , Do you have any comment ?

Files changed :


Files added:


Things to be done :

  1. Correct the locale problem
  2. Finish local file support
  3. Update MODE variable in another query
  4. Better progress indication

@pierros : What will be our next step, should I go on commiting to my own repository, or will we have a common repository (e.g. a branch to csete’s) ?

73’s de TA7W Baris

Hopefully it does not delete all files, just the ones that there is new data for?

As long as the setting is local and does not affect the rest of the application I don’t care, but where do you need this? As far as I remember, gpredict uses the frequency in Hz, so no decimal is required there.

As you may guess from my comments, I haven’t done a thorough review of the source code yet. I have too many things on my mind at the moment but I’ll be happy to check it later when you think it is ready.

I didn’t try to compare the contents… I get the full JSON file from the SATNOGS DB, so I toughed there’s no need to compare them. So what I do is, after a succesfull download of transmitters.json data, I delete the trsp files and re-generate them. Comparing will cost much more than re-generatng I think…

I will try to make it local to my part…
“baudrate” in satnogs DB is double and the delimiter is “.” e.g. :0.0 1200.0

I didn’t dive in details of nxjson library, I may correct the problem there, but quick fix was to make the locale ‘C’, I’ll fix it…

Yes I read your comments… Bu to be honest… You did a great job … The quality of the code I added can not be compared with yours, but I hope if this new function becomes useful, you may correct it…

73’s DE TA7W