WSJTX CQ Monitor

3 posts / 0 new
Last post
K5VJZ
WSJTX CQ Monitor

Hello
I need some help. I have been trying to get a script running to alert me when someone calls me on WSJTX CQ Monitor. I have been using this script as
a model, but I just don't understand it. Every line is commented out. here is the Script (It's rather OLD !)

#!/bin/bash
# Use script name ~/.config/cqrlog/voice_keyer/voice_alert.sh
#
# //audio file name (prefix) played on alert. Parameter comes from cqrlog as 1st parameter string that can be:
# // my = ansver to me
# // loc = new main grid
# // text = text found from monitor line
# // call = text fits to the callsign
# // create files you want to be played using these as filename prefixes
#(I.E my.wav or my.mp3 ... etc Note:! use low case letters in names)

If someone has a working script that works, I would be most appreciative if you would share it with me !

73 de Tom K5VJZ

oh1kh
WSJTX CQ Monitor

Hi Tom!
Script name is hard coded in software.
~/.config/cqrlog/voice_keyer/voice_alert.sh
It should be in your home directory/.config/cqrlog/voice_keyer and it must have execute bit set.

chmod a+x voice_alert.sh

Cqrlog will call script using parameter my, loc, text, call

I did seek github source code but it seems that voice_alert.sh has dropped away from source, I'll check that again from my pc and fix it.

My opinion that there was one uncommented line at the end of script.
That one line does the job.

If you have command line player called mpeg123 the scrpt line goes something like

mpeg123 $1.mp3

Then you need 4 short audio files
my.mp3 loc.mp3 text.mp3 and call.mp3

Cqrlog starts script (if locator alerts):
voice_alert.sh loc
( you can use this line in command terminal to test script)

Script places 'loc' in place of '$1' and executes
mpeg123 loc.mp3

The idea using script is that user can use what ever player program he wants and also create sound files using what ever audio format he wants.

I have working script in every day use. I can put it here when I open my PC. I can not reach that from my kitchen tablet.

--
Saku
OH1KH

oh1kh
WSJTX CQ Monitor

OK, here is my working script.
At the moment I am using version QT5_(122) Alpha and I do not remember when the parameters of voice_alert.sh have upgraded.
How ever the first parameter does always carry the alert reason: call, text, loc, my

I was right (almost) about having only one (last) line doing the whole job. In my script it looks a bit different than what I said in last message.
Script goes like this:

[saku@hamtpad ~]$ cat ~/.config/cqrlog/voice_keyer/voice_alert.sh

#!/bin/bash
echo $1 $2 $3>>/tmp/alerts.txt

# Use script name as ~/.config/cqrlog/voice_keyer/voice_alert.sh
#
# //audio file name (prefix) played on alert. Parameter comes from cqrlog as 1st parameter string that can be:
# // my = ansver to me
# // loc = new main grid
# // text = text found from monitor line
# // call = text fits to the callsign
# // create files you want to be played using these as filename prefixes
#(I.E my.wav or my.mp3 ... etc Note:! use low case letters in names)

# This scirpt is seeking names with '.wav' suffix! Change if needed (below)
# select audio card(if several cards and selection is needed) here:

# next line does the whole job! $1 is replaced by cqrlog to prefixes listed at top of this script
# you need to have aplay installed if you use this, but you can define your own script, too.

#message=$(echo $2 | sed -r 's/[ ]+/_/g')
#export $message
#/home/saku/.config/cqrlog/sendbot.sh $message

mpg123 ~/.config/cqrlog/voice_keyer/$1.mp3

[saku@hamtpad ~]$

The last line does the alert.
At third line from top there is a "logging" line that saves alerts to /tmp/alerts.txt
It is mostly for debug purposes.
The /tmp/ alerts look like this (I made a "text" alert from letter "T" to make some contents:

[saku@hamtpad ~]$ cat /tmp/alerts.txt
text DD1MAT jn 58 Federal Republi LE EU:Confirmed country
text ON9KAT jo 21 Belgium E EU:Confirmed country
text DD1MAT jn 58 Federal Republi LE EU:Confirmed country
[saku@hamtpad ~]$

First parameter, $1, is the alert reason, second, $2, is the callsign and third, $3, is the rest of CQ monitor alerting line

If you look at lines 23-25 (commented out as not in use now) there are creation of $message variable and launch of other script "sendbot.sh" using $message as parameter.
The other script "sendbot.sh" launches Telegram bot message that can be received with Telegram App in smart phone.

[saku@hamtpad ~]$ cat .config/cqrlog/sendbot.sh

#!/bin/sh
message=$1
api_key="1459684915:ADSJS-4543-230mojfdsasddfdöfksdfsd"
chat_id="1248343278"
curl -s "https://api.telegram.org/bot$api_key/sendMessage?chat_id=$chat_id&text=$message"

[saku@hamtpad ~]$
You have to create a "bot" in Telegram and get API key and bot_id (changed to random here) to access your bot with "curl" program.
Telegram has good explanations how to create own bot.

When I want Telegram alerts I remove comment hashes from voice_alert.sh

But as earlier said the last line of voice_alert.sh does the alerting calling mpg123.
- you must have execute bits set in scripts
- you must have 4 audio files my.mp3, text.mp3, call.mp3 loc.mp3 in some folder. You can add the full path to last alerting line like I did. Files can be other audio format than mp3. Then just edit the last line again.
- you can test voice_alert.sh from command terminal:
~/.config/cqrlog/voice_keyer/voice_alert.sh my
~/.config/cqrlog/voice_keyer/voice_alert.sh text
~/.config/cqrlog/voice_keyer/voice_alert.sh call
~/.config/cqrlog/voice_keyer/voice_alert.sh loc

- you must check audio mixer so that output of mpg123, or what ever player program you use, directs sound to PC speakers. Not to rig's audio input.

--
Saku
OH1KH