Welcome to the new FlexRadio Community! Please review the new Community Rules and other important new Community information on the Message Board.
If you are having a problem, please refer to the product documentation or check the Help Center for known solutions.
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.

Announce: experimental CAT/DAX clients for Linux

Andrew Rodland
Andrew Rodland Member ✭✭
edited May 2020 in Third-Party Software
Hi all,

I'd like to announce the creation of some early-stage, "works for me" implementations of CAT and DAX for Linux (and potentially other systems, including BSD, OSX, and even Windows, but I have no intention of competing with the existing apps on OSX and Windows). They're written in Go, and tentatively the apps are called nCAT and nDAX, and the library is simply "flexclient". nCAT supports the hamlib network protocol (rigctl model 2), and nDAX interfaces with PulseAudio. That works for the majority of Linux ham apps. Only SmartSDR v3 protocol is supported and I have no intention to go back and support the older versions.

This is some pretty early-stage stuff — I've been working on them for just over a week, since I got my 6400 — but I've made QSOs with it using wsjtx, fldigi, and qsstv, as well as using the CAT support during WPX weekend so that my logger (tlf) knew which band/frequency I was on, and it's worked through all of that.

CAT caveats:
  • No discovery yet — you'd better know your radio's IP address.
  • No SmartLink yet, only local network.
  • If you power down your radio or the network drops, the app will crash and you'll have to re-launch it.
  • Only about 5-10% of the hamlib protocol is implemented so far (set/get frequency, set/get mode, set/get PTT, TUNER, and RFPOWER. TUNER maps to the TUNE button, not the ATU button; I haven't figured out how I want to support both within the hamlib protocol yet, and my Flex doesn't have an ATU :)
  • Only a single hamlib VFO is supported so far — no split mode, and no mapping different slices to VFOA and VFOB.
  • Like the official CAT, it connects to an existing SmartSDR/Maestro/M GUI session and controls that session's slices. In the future I would like to make a "headless" mode that uses up one of the radio's GUI slots and allows doing digi stuff without the need for a GUI client, but I'm not there yet.
Most of this should improve in the future, it's just a lot of work!

DAX caveats:
  • No discovery yet.
  • No SmartLink yet.
  • It will crash if you power down the radio or the network drops.
  • Only a single slice is supported so far (you can run multiple instances for multiple slices, though).
  • It doesn't create the PulseAudio devices by itself yet (you need to know what "pacmd load-module module-null-sink" means).
  • It will always be streaming audio both ways regardless of whether any clients have the audio devices open.
  • Right now it's opening a pipe to "pacat" instead of using a proper Go PulseAudio client... you will need that installed on your system and findable in PATH.
  • I'm not *completely* sure what's going on with levels and the correct range of the float32 samples. Most of the time, passing things through unmodified to PulseAudio seems correct, but then sometimes qsstv's transmit levels are incredibly low. Is anyone aware of any documentation from FlexRadio that says what to expect when it comes to DAX audio?
All that said... it works for me, and I thought it was time to share, to let the adventurous start playing with it, and to welcome any contributions, suggestions, or fixes.

nCAT: https://github.com/arodland/nCAT
nDAX: https://github.com/arodland/nDAX
flexclient library: https://github.com/arodland/flexclient

- Andrew KC2G
«1345

Comments

  • N0AW - Jeremy
    N0AW - Jeremy Member
    edited April 2020
    Yes!

    - N0AW
  • Mark_WS7M
    Mark_WS7M Member ✭✭✭
    edited April 2020
    Go get 'em JT
  • HB9EDM - Marco
    HB9EDM - Marco Member ✭✭
    edited April 2020
    Andrew! thks for your work! I will follow your progress with interest.

    Best 73
    HB9EDMarco
  • juan garcia
    juan garcia Member
    edited April 2020
    ANIMO POR FIN LINUX DIOS
  • Chris WX7V
    Chris WX7V Member ✭✭
    I got this working tonight - impressive!
  • arodland
    arodland Member ✭✭
    > @cdub89 said:
    > I got this working tonight - impressive!

    Thanks :) Hope you're enjoying, and please do comment with any impressions or suggestions for improvements, either here or on the GitHub project.
  • Lou KI5FTY
    Lou KI5FTY Member ✭✭

    Looks great - is this still an active project for you? And thank you for supporting linux!

  • arodland
    arodland Member ✭✭
    Yes it is, Lou. I'm a bit busy right now (I'm moving house this very week) so development pace is slowed down, but I absolutely intend to keep improving, and the more feedback I get from users, the more likely that is :)

    For release updates I recommend using the "Watch" button on the GitHub repos; you will find out more quickly than watching the thread here.
  • Chris WX7V
    Chris WX7V Member ✭✭
    @arodland a few suggestions - its difficult figuring out what port to set up - not sure in nCAT on nDAX would be the right place to log it. Also- a clear option to set the slice on the Flex radio into DAX as primary transmit mode (versus having to set it up from SmartSDR). Finally a quick end to end how to configure with WSJTX would be nice, I’ve been proceeding with trial and error!
  • @arodland Very very nice work! Thank you so much for doing this.

    My goal is to be have a one-press setup for PSK reporting FT8 contacts and to be able to run WSPR listener unattended as well when I'm not using my regular station, and this fills in many of the missing pieces. I'm aiming to set up a private website on a ZeroTier VPN that will set everything up automatically so I can get propagation information for my station during idle time.

    I'm using a headless raspberry pi 4 with a minimal starting package.

    For those looking for setup details, here is what I did to get everything running

    curl -L https://github.com/kc2g-flex-tools/nCAT/releases/download/v0.0-20200623.0/nCAT-linux-arm -O
    curl -L -O https://github.com/kc2g-flex-tools/nDAX/releases/download/v0.0-20200817.0/nDAX-linux-arm
    chmod +x ./nCAT-linux-arm
    chmod +x ./nDAX-linux-arm
    sudo apt-get install pulseaudio
    pulseaudio &
    ./nDax-linux-arm &
    ./nCat-linux-arm &
    
    
    

    I'm using VNC and fluxbox window manager to keep everything tidy and minimal

    inside WSXTJ, you set the radio as hamlib, and the server as localhost:4532. Everything seems to work from there..

    you can also install pavuacontrol and use that to adjust DAX levels and whatnot.

    Was able to make a contact on FT8 on 20m just a few minutes ago.

    A couple of things not done or I can't figure out:

    • How to build nCAT and nDAX from source (can't figure out how to make go install dependencies. probably some web searching and reading would solve this)
    • Why I can't run nCAT and nDAX from inside a docker container
    • Getting the whole slice, Dax etc setting automated so the the whole flex setup can be headless
    • Making WSXTJ fully headless


  • Hacked on this a bit more today, and realized that the nCAT and nDAX clients appear to silently fail if they cannot bind to port 4992/udp for the flexradio discovery protocol. The following worked to get nCAT working inside docker:

    Dockerfile:
       EXPOSE 5900 4532/tcp 4991/tcp 4991/udp 4992/udp 4992/tcp
    
    Shell:
       sudo docker run -p 5900:5900 -p 4532:4532 -p 4991:4991/udp -p 4992:4992/udp --name bb raspi-vnc:1.0
    
    
  • Lou KI5FTY
    Lou KI5FTY Member ✭✭

    @Jeremy Gilbert KC1JZE great work! Do you have the rest of the dockerfile you can share?

  • Hi @Lou KI5FTY -

    I don't have it all assembled yet into a fully working Dockerfile. I've been starting with one I found here https://registry.hub.docker.com/r/psharkey/rpi-novnc, which sets up a VNC server. I modified it to make it work with the RPi4 and latest Debian but it still has cruft. From there I've manually added packages to get WSXTJ working. So consider this a work in progress that I'll eventually upgrade to include a bunch of the related ham software.

    pi@qth:~/docker-exp $ more Dockerfile
    FROM balenalib/rpi-raspbian:stretch
    
    # Setup demo environment variables
    ENV HOME=/root \
    	DEBIAN_FRONTEND=noninteractive \
    	LANG=en_US.UTF-8 \
    	LANGUAGE=en_US.UTF-8 \
    	LC_ALL=C.UTF-8 \
    	DISPLAY=:0.0 \
    	DISPLAY_WIDTH=1024 \
    	DISPLAY_HEIGHT=768
    
    # Install git, supervisor, VNC, & X11 packages
    RUN apt-get update && apt-get install -y \
    	bash \
    	fluxbox \
    	git \
    	net-tools \
    	openssh-client \
    	socat \
    	strace \
    	telnet \
    	supervisor \
    	x11vnc \
    	xterm \
    	xvfb \
      --no-install-recommends && \
      rm -rf /var/lib/apt/lists/*
    
    
    
    COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
    
    EXPOSE 5900 4532/tcp 4991/tcp 4991/udp 4992/udp 4992/tcp
    
    CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
    
    
    


    Good luck!

    Jeremy

  • arodland
    arodland Member ✭✭
    Thrilled to see some more interest! Thought I'd leave a project update. I moved house a month ago, so there hasn't been any development going on, but I finally got a desk set up in the new house and I've started to spread my radio equipment across it, so in a few more days I'll have a Flex to play with again :)

    In the meantime, suggestions, documentation PRs, and whatever else are welcome!
  • K6HN
    K6HN Member ✭✭

    Thanks for the work on this and for sharing. I will be installing both and trying them out soon.

    Gary

    K6HN

  • Chris WX7V
    Chris WX7V Member ✭✭
    @arodland I've used nCAT and nDAX daily (UBUNTU 20.04 LTS) and don't know why Flex doesn't host or sponsor these little utilities on your behalf. I've made nearly 200 QSOs on WSJTX thanks to your support!

    I appreciate you making these available as I don't like running virtualbox to emulate windows.
  • arodland
    arodland Member ✭✭

    Thanks! That's fantastic to hear. To be honest I haven't asked Flex to support my work in any way (other than providing the public API, which they've been good enough to do). Maybe if I was creating a full-on SmartSDR type app they would be interested, but I've never been all that great when it comes to developing GUI apps. I've thought about bringing it to their attention but I've never been quite sure what to say. In any case I'm happy enough with the current situation.

    As for the apps themselves, rest assured that I'm not dead. I've been doing some work that will, with a little luck, result in a more stable nDAX without the "[INTERNAL]" halves of the loopback pairs. It's not quite ready yet, but I should be able to push a beta release soonish.

    As always, usage reports are welcome, comments and suggestions are welcome, and if any devs want to lend a hand that would be nice too. Some possible places where an interested party could help out:

    • Implement the metering protocol in the flexclient library, and hook up "l RFPOWER_METER", "l SWR", etc. in nCAT (useful for people who like JTDX's output power gauge, or want to use some kind of app like grig and get meters.
    • Write an "nSPOT" that connects to a cluster and posts spots to the Flex using the "spot add" API command (this is a pretty easy job for someone who understands the cluster protocol, which I don't. I'll get around to it someday if no one else does).
    • Come up with a sensible proposal for how to map multiple slices to hamlib VFOs in nCAT for split operation.
  • Alan
    Alan Member ✭✭✭✭

    arodland

    I have watched your posts with interest and want to give nDAX and nCAT a try.

    What are some examples of functionality gained by using nDAX and nCAT on a Raspberry Pi? I see where we can also run WSJT-X on Linux. Are there others that need Flex CAT and DAX?

    Could you publish a "Guide for Novice" Linux persons (like me) to install, configure and run nDAX/nCAT. Here is a link to the guide to install, confiture and use FRStack on a Linux (Raspberry Pi). This example shows the type and level of instructions that we Novices can understand.


    Alan

    WA9WUD

  • Ted  VE3TRQ
    Ted VE3TRQ Member ✭✭✭
    edited November 2020

    Just a comment on why DAX and CAT on Linux are useful to me personally. My shack computer is an Intel NUC running Ubuntu Linux, and my radio is a Flex6600M, right next to the computer. I normally only run the K3 with my shack computer, but with the addition of Dax and Cat for Linux, I can now operate digital modes on myFlex in the shack, instead of going to my Mac elsewhere in the house. (Edit: As an aside, I do not run Windows unless it is unavoidable.)

  • Alan
    Alan Member ✭✭✭✭

    Ted

    Questions

    What do you mean "K3"?

    Do you use something like VNC viewer on the Mac to view the Linux NUC Desktop?

    Alan

  • Ted  VE3TRQ
    Ted VE3TRQ Member ✭✭✭

    “K3” - my other HF radio :-) I have two radios in the shack, an Elecraft and a Flex. So far I have been unable to use the shack Linux computer with the 6600M, only the Elecraft K3 with a SignaLink USB. I could use VNC or another remote tool to get to the Mac, but that does not do multi-monitor well.

  • arodland
    arodland Member ✭✭

    A new release of nDAX is out: existing users please read the release notes at GitHub (https://github.com/kc2g-flex-tools/nDAX/releases/tag/0.1-20201115.0) as some configuration options have changed. Overall this should be a better release with fewer things to go wrong.

  • Alan
    Alan Member ✭✭✭✭

    Arodlane

    Could you do a user manual for installation and for configuration?

    Alan. WA9WUD

  • arodland
    arodland Member ✭✭

    No installation required, and there are instructions in the README. For the most part, just download and run.

  • Alan
    Alan Member ✭✭✭✭

    arodland.....you assume a level of knowledge, perhaps, I do not have. I need a little "hand holding" to get the hang of this.

    I tried following the read me and here are my results. I could use some help.

    Am I creating a hidden text file on the home directory named nDAX? It did not work. I also tried it with "sudo" I need help please. Here are the screenshots.

    Command failed:

    Next:

    I downloaded the file using "sudo wget" command. Is this the correct file? What is a "binary"?:

    "and ran the "chmod +x nDAX. Looks good, right??

    Please help me up to this point. What am I doing wrong?

    Then, could you provide some explanation on how to use these setups?

    Alan

    WA9WUD

  • Alan,

    Speaking from a purely linux point of view, (I know nothing of this software as yet) you do not have a program named nDax in that directory. You are trying to execute "nDax" when you issue ./nDax

    The nDax-linux-arm might be a package that contains the nDax executable, or it might be the executable itself, but with that different name. You could try ./nDax-linux-arm in place of nDax and see if that works.
    If it does, using the mv command as follows: mv nDax-linux-arm nDax would rename it. Or likely you could right click on the name in the file manager and change it there.

    73,
    Pierre VE3KTB
  • Alan
    Alan Member ✭✭✭✭

    Pierre, Thanks.

    I am still "lost". Hoping arodland is willing to help, otherwise, I may not be able to use this great app.

    Alan. WA9WUD

  • Lou KI5FTY
    Lou KI5FTY Member ✭✭

    Alan - you need to rename the nDax-linux-arm to nDax. Then take a look at the readme file on github, he details the command line to execute on this page:


    ./nDAX -station station_name -slice A -daxch 1 -source flex.sliceA.rx -sink flex.sliceA.tx
    

    where station_name is the flex name for your ssdr instance running on some machine

  • Alan
    Alan Member ✭✭✭✭

    Thanks Lou and others.

    Making progress, but not there yet.

    I renamed and ran the command with station name "Maestro. I got a response:

    Next, tried to enter audio settings into WSJT-X running on the same Raspberry Pi and did not see the audio in/out devices on the pull down menu. Also, on startup received several alarm messages, including:

    Alan. WA9WUD

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.