Linrad as a panadapter

263 views
Skip to first unread message

Daniel Estévez

unread,
Dec 29, 2015, 11:09:31 AM12/29/15
to lin...@googlegroups.com
Hi all,

I've setup Linrad to be used as a panadapter for my FT-817ND. I'm using
a G4HUP PAT to tap the IF (68.33MHz) and an RTL dongle as the SDR.

In Linrad, I've used the "frequency converter" when setting the A/D. I
have "UPCONVERTER: LO frequency 68.33MHz. LO is above IF frequency".

Thus, in the waterfall, frequency 0Hz corresponds to the dial frequency
of the FT-817 (say 7.100MHz) and then for instance frequency -100kHz is
converted accordingly (7MHz). It would be nice to have Linrad track
continuously the dial frequency, so that 7.100MHz is displayed instead
of 0Hz. I can read the dial frequency with CAT. Where should I start to
look in the source code to try to hack this modification? Or is there
some functionality already built into Linrad that I could use?

73,

Dani EA4GPZ.

Leif Asbrink

unread,
Dec 29, 2015, 8:46:33 PM12/29/15
to lin...@googlegroups.com
Hello Daniel,

Have a look at z_USERS_HWARE.txt and z_USERS_EXTRA.c

They refer to some of these: extra.c, users.c, users_tr.c
users.h users_tr.c users_w3sz.c users_w3sz_hb9dri.c

Hopefully these files will make it fairly easy to produce
a (w)users_hwaredriver.c that would do what you want.
I will be happy to include it in the linrad package as
users_panadapter.c :-)

Others may add whatever would be needed for other radios.

73

Leif
> --
> You received this message because you are subscribed to the Google Groups "Linrad" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linrad+un...@googlegroups.com.
> To post to this group, send email to lin...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Leif Asbrink

unread,
Dec 30, 2015, 5:39:04 PM12/30/15
to lin...@googlegroups.com, softr...@yahoogroups.com
Hello All,

Linrad is slowly becoming a SDSR transceiver. Many things remain,
but I think performance will be quite good. Have a look at this
video:
https://www.youtube.com/watch?v=zhgsF-wBT2A

Here you can see Linrad in QSK CW mode with a Softrock Ensemble.
The time delay is OK for normal hand-keying. One can listen
between dots and dashes. The transmit frequency is fixed at
12 kHz from the LO in the latest version on the repo. Next step
will be to allow frequency control.

73

Leif

Michael Durkin

unread,
Dec 31, 2015, 12:50:24 AM12/31/15
to lin...@googlegroups.com
cant wait untill repeater offset and CTSC tones are in linrad too ...


Leif

Daniel Estévez

unread,
Dec 31, 2015, 11:48:46 AM12/31/15
to lin...@googlegroups.com
El 30/12/15 a las 03:42, Leif Asbrink escribió:
> Hello Daniel,
>
> Have a look at z_USERS_HWARE.txt and z_USERS_EXTRA.c
>
> They refer to some of these: extra.c, users.c, users_tr.c
> users.h users_tr.c users_w3sz.c users_w3sz_hb9dri.c
>
> Hopefully these files will make it fairly easy to produce
> a (w)users_hwaredriver.c that would do what you want.
> I will be happy to include it in the linrad package as
> users_panadapter.c :-)
>
> Others may add whatever would be needed for other radios.

Thanks Leif,

I've come up with the following code:

https://gist.github.com/daniestevez/0176f55d84b3045325bb

I'm using Hamlib to read the frequency from the radio via CAT. As I'm
also using other CAT programs, I'm using rigctld so all the programs can
share the radio happily.

The user has to run rigctld to interface to their rig and configure
Linrad to use a frequency converter according to the IF of the rig. For
the FT-817, this is an Upconverter with an LO frequency of 68.330132MHz,
with LO above IF frequency.

Other transceivers could be handled just by setting the frequency
converter accordingly, because rigctld handles the CAT protocol.

The code works fine, but I've hooked up my code to the userdefined_u()
function, so that it runs only when the user presses 'U' (uncomfortable,
because you have to press 'U' every time you change frequency on the
radio). I would like this code to run every 100ms or so. Where could I
hook my code?

73,

Dani.

Leif Asbrink

unread,
Dec 31, 2015, 12:42:14 PM12/31/15
to lin...@googlegroups.com
Hello Daniel,

Include a (w)users_extra.c and set users_extra_update_interval=0.1

This will cause calls to users_extra and users_extra_fast
every 100 ms. Those two routines are called from different
threads. Probably you should use users_extra in case
rigctld causes some delay.

users_extra is called from the screen thread and timing is
uncritical. users_extra_fast is called from a DSP thread
that should not loose much time.

73

Leif

Daniel Estévez

unread,
Jan 1, 2016, 6:19:09 AM1/1/16
to lin...@googlegroups.com
El 31/12/15 a las 19:38, Leif Asbrink escribió:
> Hello Daniel,
>
> Include a (w)users_extra.c and set users_extra_update_interval=0.1
>
> This will cause calls to users_extra and users_extra_fast
> every 100 ms. Those two routines are called from different
> threads. Probably you should use users_extra in case
> rigctld causes some delay.
>
> users_extra is called from the screen thread and timing is
> uncritical. users_extra_fast is called from a DSP thread
> that should not loose much time.

Hello Leif,

Thanks. That's just what I was looking for. I had looked at
users_extra.c, but not carefully enough. The new code is in
https://gist.github.com/daniestevez/0176f55d84b3045325bb

Now I'm quite happy with it for my own personal use. However, I think
that it would be good to include it in linrad as users_panadapter.c, as
you suggested. Other users might benefit from this code.

To do this properly, I still have to figure out how to include the
dependency for hamlib in a good way. Now I'm just hand editing the
Makefile to include -lhamlib.

I have being looking to the configure and build system used in Linrad
and I've seen that many libraries are dlopened. I'm not sure if it is
worth the effort to do dlopen in such a simple code. Also, I have zero
experience programming in Windows, so I'm not sure about the portability.

One nice thing about hamlib is that users_tr.c may benefit from a
rewrite to use hamlib. This would add support for more rigs, allow CAT
sharing with rigctld and clean up a lot of code.

73 and happy New Year,

Dani.

Leif Asbrink

unread,
Jan 1, 2016, 8:58:10 AM1/1/16
to lin...@googlegroups.com
Hi Dani,

Best would be to load libraries at run time. That is with
dlopen/LoadLibraryEx in Linux/Windows. Some small additions
would be needed in configure.in and Makefile.in Having that
in place would make it easier to rewrite/simplify
users_tr.c
Getting hamlib in place should be done outside users_extra.
I might add hamlib.c and always include it. A very small
piece of code so it would not hurt those who would not use it.


In case you do not want to do it now, I will include
your current version, but please change the installation
instructions. To install the file, rename users_panadapter_ex.c
to users_extra.c (Linux) or wusers_extra.c (Windows)
The text now mentions users_tr.c and users_extra.c
Also rename users_panadapter_hw.c to (w)users_hwaredriver.c

There should also be a hint how to modify Makefile and something
about this:
"The user has to run rigctld to interface to their rig and configure
Linrad to use a frequency converter according to the IF of the rig. For
the FT-817, this is an Upconverter with an LO frequency of 68.330132MHz,
with LO above IF frequency."

Then, on top of it all, a copyright statement with an
open source license.

73

Leif





> Thanks. That's just what I was looking for. I had looked at
> users_extra.c, but not carefully enough. The new code is in
> https://gist.github.com/daniestevez/0176f55d84b3045325bb
>
> Now I'm quite happy with it for my own personal use. However, I think
> that it would be good to include it in linrad as users_panadapter.c, as
> you suggested. Other users might benefit from this code.
>
> To do this properly, I still have to figure out how to include the
> dependency for hamlib in a good way. Now I'm just hand editing the
> Makefile to include -lhamlib.
>
> I have being looking to the configure and build system used in Linrad
> and I've seen that many libraries are dlopened. I'm not sure if it is
> worth the effort to do dlopen in such a simple code. Also, I have zero
> experience programming in Windows, so I'm not sure about the portability.
>
> One nice thing about hamlib is that users_tr.c may benefit from a
> rewrite to use hamlib. This would add support for more rigs, allow CAT
> sharing with rigctld and clean up a lot of code.
>
> 73 and happy New Year,
>
> Dani.
>

Daniel Estévez

unread,
Jan 3, 2016, 10:03:13 AM1/3/16
to lin...@googlegroups.com
El 01/01/16 a las 15:54, Leif Asbrink escribió:
> Hi Dani,
>
> Best would be to load libraries at run time. That is with
> dlopen/LoadLibraryEx in Linux/Windows. Some small additions
> would be needed in configure.in and Makefile.in Having that
> in place would make it easier to rewrite/simplify
> users_tr.c
> Getting hamlib in place should be done outside users_extra.
> I might add hamlib.c and always include it. A very small
> piece of code so it would not hurt those who would not use it.
>
> In case you do not want to do it now, I will include
> your current version,

Hi Leif,

I think that I'll send you the code for inclusion in Linrad as it is
now, with instructions to modify the Makefile manually. dlopening hamlib
properly in Linrad can be done later down the road (and I don't have
much time to do it right now).

> but please change the installation
> instructions. To install the file, rename users_panadapter_ex.c
> to users_extra.c (Linux) or wusers_extra.c (Windows)
> The text now mentions users_tr.c and users_extra.c
> Also rename users_panadapter_hw.c to (w)users_hwaredriver.c
>
> There should also be a hint how to modify Makefile and something
> about this:
> "The user has to run rigctld to interface to their rig and configure
> Linrad to use a frequency converter according to the IF of the rig. For
> the FT-817, this is an Upconverter with an LO frequency of 68.330132MHz,
> with LO above IF frequency."
>
> Then, on top of it all, a copyright statement with an
> open source license.

Sure. I had just copied the installation instructions from some other
users_* file. I have now included proper installation instructions (with
the note to modify the Makefile by hand).

I have included the same open source licence that it's used in the rest
of the Linrad code (this is a very small contribution, so it's best to
use the same licence).

I have also included the setup instructions about how to setup the
frequency converter, do the calibrations and so on. It would be nice if
someone could have a glance a these and check if they make any sense to
them.

The new version is, as always, on gist:

https://gist.github.com/daniestevez/0176f55d84b3045325bb

If you prefer, I can send you the files by email for you to include them
in Linrad.

73,

Dani.

Leif Asbrink

unread,
Jan 3, 2016, 10:42:59 AM1/3/16
to lin...@googlegroups.com
Hi Dani,

I have included your files and updated the Linrad repo:
svn checkout https://svn.code.sf.net/p/linrad/code/trunk linrad591

Thank you:-)

73

Leif

SP2BPD

unread,
Jan 20, 2022, 8:51:17 PM1/20/22
to Linrad
Has anybody been able to compile Linrad / panadapter for Windows?

I've changed the names of 2 panadapter files to wusers_extra.c and wusers_hwaredriver.c
and modified line 33 in Makefile:
WINWCC  = C:\mingw\bin\mingw32-gcc -lhamlib -march=i686 -D_FILE_OFFSET_BITS=64 -DLUSERS_DEF=0 -DWUSERS_DEF=0

After executing make.bat file I got following error (I paste only beginning end of error statement):

In file included from hwaredriver.c:56:

wusers_hwaredriver.c:139:24: hamlib/rig.h: No such file or directory

wusers_hwaredriver.c:140:28: hamlib/riglist.h: No such file or directory

In file included from hwaredriver.c:56:

wusers_hwaredriver.c:143: error: syntax error before '*' token

(…)

wusers_hwaredriver.c:224: warning: implicit declaration of function `rig_open'

mingw32-make: *** [hwaredriver.oz] Error 1

Are there any chances to compile it for Windows?

Regards

Piotr, SP2BPD


Leif Asbrink

unread,
Jan 23, 2022, 6:25:34 PM1/23/22
to lin...@googlegroups.com
Hello Piotr,

You have to make a subdirectory hamlib/ in your linrad directory
and install hamlib there.

hamlib.dll has to reside in the linrad directory or in C:\linrad\dll\

Good luck

73

Leif



> Has anybody been able to compile Linrad / panadapter for Windows?
>
> I've changed the names of 2 panadapter files to wusers_extra.c and
> wusers_hwaredriver.c
> and modified line 33 in Makefile:
> WINWCC = C:\mingw\bin\mingw32-gcc* -lhamlib* -march=i686
> -D_FILE_OFFSET_BITS=64 -DLUSERS_DEF=0 -DWUSERS_DEF=0
>
> After executing make.bat file I got following error (I paste only beginning
> end of error statement):
>
> *In file included from hwaredriver.c:56:*
>
> *wusers_hwaredriver.c:139:24: hamlib/rig.h: No such file or directory*
>
> *wusers_hwaredriver.c:140:28: hamlib/riglist.h: No such file or directory*
>
> *In file included from hwaredriver.c:56:*
>
> *wusers_hwaredriver.c:143: error: syntax error before '*' token*
>
> *(…)*
>
> *wusers_hwaredriver.c:224: warning: implicit declaration of function
> `rig_open'*
>
> *mingw32-make: *** [hwaredriver.oz] Error 1*
>
> Are there any chances to compile it for Windows?
>
> Regards
>
> Piotr, SP2BPD
>
>
> >
>
> --
> There is an excellent Linrad User Guide by Gaetan, ON4KHG, at:
> http://w3sz.com/Linrad%20Installation%20&%20Configuration%20User%20Guide%20-%20V1-0.pdf
> ---
> You received this message because you are subscribed to the Google Groups "Linrad" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linrad+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/linrad/a39493e9-cc58-40b7-af98-f02ebd30f76en%40googlegroups.com.

SP2BPD

unread,
Jan 24, 2022, 7:55:18 AM1/24/22
to Linrad
Hi Leif,

I want to make Linrad (with remote Afedri and good RX antenna in a quiet environment) follow the frequency of my K3. 

Thank you for your hints on hamlib subdirectory. But after dozen or so hours of futile efforts I came to conclusion that I'll abandon the idea of using hamlib. Linking hamlib during compilation proved to be out of my range.

I'll stick to functions already present in Linrad (wsys.c): lir_open_serport();  lir_close_serport();  lir_write_serport();  lir_read_serport().
I'll study W3SZ approach and try to remake it from "RIG following Linrad" mode to "Linrad following RIG" mode.


Kind regards

Piotr, SP2BPD

Conrad PA5Y

unread,
Jan 24, 2022, 8:05:00 AM1/24/22
to lin...@googlegroups.com

I have a similar situation.

 

On 432MHz EME I use a SDR IP with a transverter for RX, and for 144 MHz EME I use a Perseus also with a transverter.  This works fine. I want my TS-890 to follow Linrad and the existing CAT control library does not accommodate transverter offsets.

 

Can anyone help me with this?

 

I would like to get it working before the Dubus contest in March, the Linrad weak CW mode is by far the best for CW EME.

 

73

 

Conrad PA5Y

--

There is an excellent Linrad User Guide by Gaetan, ON4KHG, at:
http://w3sz.com/Linrad%20Installation%20&%20Configuration%20User%20Guide%20-%20V1-0.pdf
---
You received this message because you are subscribed to the Google Groups "Linrad" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linrad+un...@googlegroups.com.

ON4KHG

unread,
Jan 24, 2022, 4:41:00 PM1/24/22
to lin...@googlegroups.com

Dears,

 

 

I don’t know if it is what you are looking for but translated to English from French on my website below.

A transverter offset is possible. Mine is 116000 kHz => When I click on 144300 in Linrad, my transceiver moves to 144300-11600=28300.

 

 

“The CAT window allows you to set an analog transceiver to the same frequency as the one Linrad is synthesized on, through the COM (computer) and CAT (transceiver) ports. CAT means "Computer Aided Transceiver". Thanks to Pierre, ON5GN for the development and support.

 

You just have to press the "Q" key on the computer keyboard and the transceiver frequency will adjust to the one Linrad is on. This is particularly interesting, as Linrad does not have a transmit feature so far.

To get this window, proceed as described below:

 

Download the file mingw516nasmplus.zip (24 MB) from this page

Unzip the file to C:\; you will get a subdirectory named C:\MinGW (do not use a different directory!)

Download Linrad, e.g. lir04-05.zip (not wlr04-05.zip) from Leif's website here. Unzip it in C:\Linrad (or any other directory)

In the same directory where Linrad is installed, open (with notepad) the file "users_tr.c" and modify it as needed. As I use a transceiver (FT-857) already included in this file, no need to modify anything in my case. Give the name "wusers_hwaredriver.c" to this file and save it (in the same directory where Linrad is installed)

Open the DOS window (Run/cmd/cd...etc to the directory where Linrad is installed) and type "configure.exe" then Enter

Type "make.bat" then Enter. Linrad is now compiled and a file "linrad.exe" is now available in the same directory

Start "linrad.exe" and the CAT window is now available. Select the required COM port (the one on which the CAT port of the transceiver is connected to the computer) and your transceiver type. It is now possible to control the frequency of the transceiver by pressing the "Q" key on the computer keyboard.”

 

73,

 

Gaëtan, ON4KHG

Conrad PA5Y

unread,
Jan 25, 2022, 7:07:23 AM1/25/22
to lin...@googlegroups.com

Hello Gaëtan.

 

I could not achieve this. Does the Software pick up the LO frequency from the  downconverter settings? Obviously this is working fine. However my TS-890S has its own transverter settings. So when I click on 144.300 I want Linrad to send 144.300 to the TS-890S. This way the Linrad and TS-890S display is the same. Indeed I use a 28MHz IF but the TS-890S already knows this offset.

 

I could not find a way to accommodate this.

 

Regards

Francesco Cominelli

unread,
Jan 25, 2022, 8:35:16 AM1/25/22
to lin...@googlegroups.com, Conrad PA5Y
Ciao Conrad, excuse me. As per a second language man, i could misunderstand. I use Linrad on 144 and 1296. Both of them with Afedri. On 144 i use a 28 mhz converter, so on Linrad i have witten 116 mhz for downconverter.  On 1296 i use an if of 10,750 mhz(10 mhz) and on Linrad the downconverter is 1285,25. On Map65 or Wsjtx, using a Cat, i must read the correct freq. If you use IK7EZN's trackbox it would set the correct doppler of the band. If i had a misunderstanding, excuse me. 73' de IK2DDR


Il Mar, 25 Gen, 2022 alle 13:07, Conrad PA5Y
<g0...@g0ruz.com> ha scritto:

chavy levy

unread,
Dec 30, 2025, 12:40:18 PM (13 days ago) 12/30/25
to Linrad
Hello,

I am trying to use Linrad as panadapter (i.e. to follow the frequency of the radio).
I am using the following file users_panadapter.c
However, I am not using frequency converter (I have RSPduo).
What is the best way to set the center frequency of linrad?
Here is the code from users_panadapter.c which is functional but not useful to me:
converter_direction = ui.converter_mode & CONVERTER_LO_BELOW ? 1 : -1;
  converter_offset_mhz = ui.converter_mhz + 1e-6 * (ui.converter_hz - converter_direction * freq + ssb_offset);

  // needed to update frequency in linrad internals
  check_filtercorr_direction();
  sc[SC_SHOW_CENTER_FQ]++;

Thanks in advance,
Chav

chavy levy

unread,
Jan 4, 2026, 5:56:40 PM (7 days ago) Jan 4
to Linrad
OK, a short update.
I was able to roughly make Linrad follow the radio by using this code.

// The hardware frequency is calculated the following way in void frequency_readout(void):
  // hwfreq=0.001*(mix1_selfreq[0])+100*frequency_scale_offset;
  // In order to set the tune frequency correctly, we need to set mix1_selfreq[0] taking into
  // account the frequency_scale_offset
  mix1_selfreq[0] = 1000.0 * (freq / 1000.0 - 100.0 * frequency_scale_offset);
  add_mix1_cursor(0);      // update cursor position
  sc[SC_SHOW_CENTER_FQ]++; // force update of frequency display

Will cleanup a bit more and once I am happy with the result will write more here.
Reply all
Reply to author
Forward
0 new messages