Saturday 7 July 2018

GPredict - Radio Control FT991A (via RigCtld)

G'Day Guys,

Since getting hooked on monitoring ARISS and other satellites (aka "birds") I quickly discovered several bits of software for predicting the satellite pass and ability to control your radio to account for doppler shift in both the uplink and downlink frequencies.

The bit of software I've quickly come to enjoy is called GPredict for the following reasons:
  • Easy to Use
  • Available for multiple platforms
  • Computes and visualises multiple satellites passes
  • Ability to control radio to account for doppler shift
  • Ability to control antenna azimuth and elevation for controlling the antenna beam direction and tracking the satellite as we go from AOS to LOS
I downloaded the binary for windows and within a few minutes I had downloaded the latest  TLE and Transponder data from the internet. Out of the box it comes with a simple module with a few satellites that amateur operators can monitor and make contact through.

Next was to have GPredict control the radio uplink and downlink to account for doppler shift.  GPredict can be configured to update the TX/RX frequencies of the rig via sending "Rig Control" commands to a "Rig Control Daemon". By heading over to Rigctld you will find instruction on Downloading and compiling the Rigctrld code. However I took the easy path and downloaded the latest Windows Platform binaries.   There is further good information found at the "Hamlib Rigctld FAQ"

After downloading the binaries and installing (making sure the PATH was pointing to the bin folder) I was ready to start up an instance of RigCtld using the following command with the appropriate serial settings that suit my setup:


       
rigctld.exe -vvvvv -r \\.\com11 -m 135 -s 38400 -t 4532 -C "serial_speed=38400,stop_bits=2,rts_state=ON,dtr_state=OFF,serial_handshake=None"
       
 

!! Important Note!! when using COM PORTs above COM9 you can no longer use the syntax "-r COM10" but instead to "-r \\.\com11" as you can see I did. 

To test the ability to control the rig we can use the "rigclt" command line tool. The following example will query the rig to determine what "MODE" VFO A is in:

       
rigctl.exe -m 2 -r localhost:4532 m
       
 


Before we move on, one of the little limitation / feature lack of GPredict is when you select the different "transponder" to monitor and have GPredict track it only tracks the up and downlink frequencies. It DOES NOT automatically select / change the rig modes for both RX and TX.

To overcome this I created 3 simple commands which I run as needed to changes the modes quickly:

       
# For Voice
rigctl.exe -m 2 -r localhost:4532 M USB 0 X LSB 0
rigctl.exe -m 2 -r localhost:4532 M FM 0 X FM 0
rigctl.exe -m 2 -r localhost:4532 M USB 0 X USB 0

# For Digital Mode (ie APRS, etc)
rigctl.exe -m 2 -r localhost:4532 M PKTUSB 0 X PKTLSB 0
rigctl.exe -m 2 -r localhost:4532 M PKTFM 0 X PKTFM 0
rigctl.exe -m 2 -r localhost:4532 M PKTUSB 0 X PKTUSB 0
       
 

You will need to research the transponder for the requires mode on both up/downlink. But for the 1st command you can see I set the uplink to LSB and downlink to USB. This is for those linear transponders that each you to operation in this mode.

With RigCtrld now configured and running, we can now add a Interface to integrate with this Rigctrld instance.
  1. GPredict via Edit->Preferences->Interface add new interface and give it appropriate name (ie "FT991A")  
  2. Once saved then via Module "Down Down" Select Radio Control, Select the satellite and the transponder you wish to track.
  3. Then Click on "Track" and "Engage"
  4. You should see the frequencies start to adjust up / down accounting for doppler and be sent to the radio.

That's All Folks!!!!

73
de VK4TMZ (Mark)

OpenWebRX - CSDR Audio Stream Via IceCast (SSTV Decoding on Windows)

Guys,

With the recent ISS SSTV event, I would normally use the audio from my FT991A and leave it running with both MMSSTV and RXSSTV running for the duration of the event. However this would mean taking my OpenWebRX 2m stream offline as I'd need to use the VHF antenna.

I could easily open a web browser head over to SDR.Hu and open my OpenWebRX SDR and set the frequency to 145.8MHz and making sure the default audio is the Virtual Audio Cable input then that would be one way to do it.  But I've seen that running the OpenWebRX client to long in a web browser does consume a fair bit of memory as it build that waterfall history over time.....

But with my recent fun with using CSDR to get a audio stream for APRS decoding I thought cool lets do the same thing for SSTV.

Well creating the audio stream monitoring 145.800 MHz under Linux was easy.... but my problem was there was NO SSTV decoders that would take a audio stream piped in from STDIN.  There is QSSTV for Linux but to GUI driven / controlled.

So I thought why not stream the audio and then I can either use a Media player and pipe into a Virtual Sound Cable under windows and similar for Linux to then allow the tool of choice to decode the audio from the virtual audio cable output.

My choice of tools to achieve this was:

1. Audio from CSDR piped via STDIN into EZStream.
2. EZStream feeds to IceCast2 server
3. Windows Media Player play out to a Virtual Audio Cable In
  • VB-Audio VoiceMeeter - This will provide a mixer and Virtual Audio In and Out.
  • VB-Audio Audio Cable -  For free provide a single Virtual Audio cable. So with this and VoiceMeter you will have access to 2 Virtual Audio Cables...
4. MMSSTV and RXSSTV both running decoding the audio from the Virtual Audio Cable Out

Installing the required tools under Linux

sudo apt-get -y install mplayer
sudo apt-get -y install lame
sudo apt-get -y install ezstream
sudo apt-get -y install icecast2

Config Icecast

Please note I will be assuming you have configured the general IceCast config options. Please follow the ICECast doco to complete this. The following is the config for a "mount point":

sudo vi /etc/icecast2/icecast.xml

       

    <mount type="normal">
        <mount-name>/sstv.mp3</mount-name>
        <source-password>srcadmin</source-password>
        <password>password</password>
        <max-listeners>10</max-listeners>
        <burst-size>65536</burst-size>
        <hidden>1</hidden>
        <public>0</public>
    </mount>
       
 


Restart the Icecast Service

sudo service icecast2 restart

Config EZStream 

 Create a EZStream config file with the following contents:

       

<ezstream>
    <url>http://localhost:8000/sstv.mp3</url>
    <sourcepassword>password</sourcepassword>
    <format>MP3</format>
    <filename>stdin</filename>
    <svrinfoname>SSTV STREAM</svrinfoname>
    <svrinfourl>http://www.vk4tmz.com.au</svrinfourl>
    <svrinfogenre>Scanner</svrinfogenre>
    <svrinfodescription>The audio from OpenWebRX for SSTV Decoding</svrinfodescription>
    <svrinfobitrate>16</svrinfobitrate>
    <svrinfochannels>1</svrinfochannels>
    <svrinfosamplerate>11025</svrinfosamplerate>
    <svrinfopublic>0</svrinfopublic>
</ezstream>
       
 


CSDR and EZStream Commands to stream the ISS SSTV audio to IceCast Server


       

export SDR_SAMPLE_RATE=5000000
export SDR_GAIN=IFGR=35,RFGR=2
export AUDIO_SAMPLE_RATE=11025
export AUDIO_GAIN=0.42
export FREQ_CENTER=145500000
export FREQ_MON=145800000
export FREQ_MON_BW=12000
export FIR_DISC_FACTOR=`python -c "print float($SDR_SAMPLE_RATE)/float($AUDIO_SAMPLE_RATE)"`
export FIR_DISC_TRANS_BW=`python -c "print float($FREQ_MON_BW)/float($SDR_SAMPLE_RATE)"`
export SHFT_ADD_PIPE=/tmp/rigctrld_openwebrx_shift_pipe
export SHFT_ADD=`python -c "print float($FREQ_CENTER-($FREQ_MON))/$SDR_SAMPLE_RATE"`
export NFM_LOW_CUT_FREQ=-4000
export NFM_LOW_CUT=`python -c "print float($NFM_LOW_CUT_FREQ)/$AUDIO_SAMPLE_RATE"`
export NFM_HIGH_CUT_FREQ=4000
export NFM_HIGH_CUT=`python -c "print float($NFM_HIGH_CUT_FREQ)/$AUDIO_SAMPLE_RATE"`
export FIR_NFM_TRANS_BW=`python -c "print (float($NFM_HIGH_CUT_FREQ) - float($NFM_LOW_CUT_FREQ))/float($AUDIO_SAMPLE_RATE)"`
export FIR_DSSB_BW=4800
export SSB_LOW_CUT_FREQ=300
export SSB_LOW_CUT=`python -c "print float($SSB_LOW_CUT_FREQ)/$AUDIO_SAMPLE_RATE"`
export SSB_HIGH_CUT_FREQ=3000
export SSB_HIGH_CUT=`python -c "print float($SSB_HIGH_CUT_FREQ)/$AUDIO_SAMPLE_RATE"`
export FIR_SSB_TRANS_BW=`python -c "print (float($SSB_HIGH_CUT_FREQ) - float($SSB_LOW_CUT_FREQ))/float($AUDIO_SAMPLE_RATE)"`

# Stream ISS SSTV Audio to IceCast using EZStream
nc -v 127.0.0.1 4951 | csdr shift_addition_cc $SHFT_ADD  | csdr fir_decimate_cc $FIR_DISC_FACTOR $FIR_DISC_TRANS_BW HAMMING | csdr bandpass_fir_fft_cc $NFM_LOW_CUT $NFM_HIGH_CUT $FIR_NFM_TRANS_BW HAMMING | csdr fmdemod_quadri_cf | csdr limit_ff | csdr old_fractional_decimator_ff 1.00158333333 | csdr deemphasis_nfm_ff 11025 | csdr fastagc_ff 1024 | csdr gain_ff $AUDIO_GAIN | csdr convert_f_s16 |  /usr/bin/lame -r -s 11.025 -m m -b 16 --cbr - -  | /usr/bin/ezstream -qvc /home/drifter/sdr/stream/sstv_ezstream.xml

       
 

To Check all OK:

  1. The output of the EZStream should be displaying the stream rate ~16Kbps.  If this is not the case check for errors and correct.
  2. Goto Icecast Admin portal http://localhost:8000 and log in as admin and confirm you can see the mount point
  3. let hear it so via your favorite media player tools (ie Windows media player or  Linux - MPlayer)
mplayer http://localhost:8000/sstv.mp3

With that all working I was then able to play the audio on my Windows PC pipe it into Virtual Audio Cable and run the SSTV decoding tools just fine.

The only little thing is like most "streaming" the tool "buffers" which creates a little latency.  In this case the audio when being monitoring via MPlayer or windows is ~30s delayed.  This was fine for me so I did not need to tune Icecast to minimise the latency but may be something you need to consider.

That's All Folks!! Hope you guys find this helpful :)

73
de VK4TMZ (Mark)

Accessing OpenWebRX SDR Stream via Linux Command line and MPlayer

G'Day Guys,

In my previous posts I outlined decoding APRS using Direwolf from an audio feed extracted from my OpenWebRX Stream using the CSDR command line tools.

The following is an update on the calculations for parameters needed for the CSDR commands and I've provided an improved NFM (actually what OpenWebRX uses) as the NFM_OLD was just not 100% clear or right and I could not work it out.

I've also included USB too.


       

export SDR_SAMPLE_RATE=5000000
export SDR_GAIN=IFGR=35,RFGR=2
export AUDIO_SAMPLE_RATE=11025
export AUDIO_GAIN=0.42
export FREQ_CENTER=145500000
export FREQ_MON=145175000
export FREQ_MON_BW=12000
export FIR_DISC_FACTOR=`python -c "print float($SDR_SAMPLE_RATE)/float($AUDIO_SAMPLE_RATE)"`
export FIR_DISC_TRANS_BW=`python -c "print float($FREQ_MON_BW)/float($SDR_SAMPLE_RATE)"`
export SHFT_ADD_PIPE=/tmp/rigctrld_openwebrx_shift_pipe
export SHFT_ADD=`python -c "print float($FREQ_CENTER-($FREQ_MON))/$SDR_SAMPLE_RATE"`
export NFM_LOW_CUT_FREQ=-4000
export NFM_LOW_CUT=`python -c "print float($NFM_LOW_CUT_FREQ)/$AUDIO_SAMPLE_RATE"`
export NFM_HIGH_CUT_FREQ=4000
export NFM_HIGH_CUT=`python -c "print float($NFM_HIGH_CUT_FREQ)/$AUDIO_SAMPLE_RATE"`
export FIR_NFM_TRANS_BW=`python -c "print (float($NFM_HIGH_CUT_FREQ) - float($NFM_LOW_CUT_FREQ))/float($AUDIO_SAMPLE_RATE)"`
export FIR_DSSB_BW=4800
export SSB_LOW_CUT_FREQ=300
export SSB_LOW_CUT=`python -c "print float($SSB_LOW_CUT_FREQ)/$AUDIO_SAMPLE_RATE"`
export SSB_HIGH_CUT_FREQ=3000
export SSB_HIGH_CUT=`python -c "print float($SSB_HIGH_CUT_FREQ)/$AUDIO_SAMPLE_RATE"`
export FIR_SSB_TRANS_BW=`python -c "print (float($SSB_HIGH_CUT_FREQ) - float($SSB_LOW_CUT_FREQ))/float($AUDIO_SAMPLE_RATE)"`


# NEW NFM
nc -v 127.0.0.1 4951 | csdr shift_addition_cc $SHFT_ADD  | csdr fir_decimate_cc $FIR_DISC_FACTOR $FIR_DISC_TRANS_BW HAMMING | csdr bandpass_fir_fft_cc $NFM_LOW_CUT $NFM_HIGH_CUT $FIR_NFM_TRANS_BW HAMMING | csdr fmdemod_quadri_cf | csdr limit_ff | csdr old_fractional_decimator_ff 1.00158333333 | csdr deemphasis_nfm_ff 11025 | csdr fastagc_ff 1024 | csdr gain_ff $AUDIO_GAIN | csdr convert_f_s16 | mplayer -quiet -rawaudio samplesize=2:channels=1:rate=$AUDIO_SAMPLE_RATE -demuxer rawaudio 

# OLD NFM
nc -v 127.0.0.1 4951 | csdr shift_addition_cc $SHFT_ADD | csdr fir_decimate_cc $FIR_DISC_FACTOR $FIR_DISC_TRANS_BW HAMMING | csdr fmdemod_quadri_cf | csdr limit_ff | csdr deemphasis_nfm_ff $AUDIO_SAMPLE_RATE | csdr fastagc_ff | csdr gain_ff $AUDIO_GAIN | csdr convert_f_s16 |  mplayer -quiet -rawaudio samplesize=2:channels=1:rate=$AUDIO_SAMPLE_RATE -demuxer rawaudio -

# USB
nc -v 127.0.0.1 4951 | csdr shift_addition_cc $SHFT_ADD | csdr fir_decimate_cc $FIR_DISC_FACTOR $FIR_DISC_TRANS_BW HAMMING | csdr bandpass_fir_fft_cc $SSB_LOW_CUT $SSB_HIGH_CUT $FIR_SSB_TRANS_BW | csdr realpart_cf | csdr agc_ff | csdr limit_ff | csdr gain_ff $AUDIO_GAIN | csdr convert_f_s16 |  mplayer -quiet -rawaudio samplesize=2:channels=1:rate=$AUDIO_SAMPLE_RATE -demuxer rawaudio -