CQ-monitor alert sounds

17 posts / 0 new
Last post
9H1ZZ
CQ-monitor alert sounds

Hi,
Being a relative newcomer to Linux (I am using Mint 18.2 Cinnamon) i have successfully installed CQRLOG and JTDX. They work fine together, but now I would like to use CQ-monitor to provide audible alerts. I have studied the document CqrlogAdditions2, but I need something more explicit (for a newbie) about how to install the sounds. What exactly is "my" script and how/where do I install it?
Thanks for any help in guiding me.
Robin, 9H1ZZ

oh1kh
CQ-monitor alert sounds

Hi !

A place for alert scripts is hidden directory under your home directory.
Use
cd ~/.config/cqrlog/voice_keyer
at console, or put the string without "cd" to your favorite file browser to get there.

Script needed there is called:
voice_alert.sh

This script starts the alerting. When you have written this remember to use console command
chmod a+x voice_alert.sh
to make it executable. You can set (usually) exec-bit also with your file browser I you prefer using it.

Content of script may be:

#!/bin/bash
# //audio file name (prefix) played on alert
# //can be:'my'  = ansver to my cq,
# //       'loc' = new main grid,
# //       'text'= text found from monitor line 
# //       'call'= text fits to the callsign
# // create files you want to be played

# scirpt is seeking names with '.wav' suffix! Change if needed    

  #select audio card(if needed) and play alert message
aplay ~/.config/cqrlog/voice_keyer/$1.wav

But that is just an example. Actually you can do almost anything with script. Start your coffee maker, turn of/on your ham shack lights... anything.

The Idea is that cqrlog will call this way named script (voice_alert.sh) with parameter after script name.
The parameter can be one of these: my, loc, text, call
So the cqrlog sends "voice_alert.sh my", "voice_alert.sh loc", etc. depending on what alert is detected.

Inside the script the parameter of calling line can be read with $1. That is the first parameter.
$2 is second, $3 third and so on, but here we need only the first.

So the script will call program "aplay" that can play audio files. And aplay has first parameter as the path to audio file that has name
$1.wav. So it can be "my.wav", "loc.wav" and so on.
Audio files can be placed to any directory. In this example they exist in same directory as the voice_alert.sh.

It is up to you what you put into "my.wav", "loc.wav" etc. I just recommend that you should not play whole song of your favorite artist. Instead very short audio, like 150wpm CW saying just "my" for content of my.wav. Or something as short as that.

If you do not have program aplay you have to install it. Or use any other player that can play sound file as first parameter from console command line. Also the player has to be small so that it starts fast when it is called.

Remember also that you must have second audio card for this. If your rig has built in audio card as many modern rigs do, or you have some kind of digital-mode USB interface that includes sound card, you can use PC's own audio card for playing alerts.
Consult aplay man page, or any other used player's man page to find out how sound is redirected to PC sound card instead of rig's one.

I hope this clears a bit of alerting function.

--
Saku
OH1KH

--
Saku
OH1KH

9H1ZZ
CQ-monitor alert sounds

Hi Saku,
Thanks for the extra details.... I will work my way through your instructions and hopefully get CQ-Monitor to make suitable noises when it should.

73 Robin, 9H1ZZ

9H1ZZ
CQ-monitor alert sounds

Hi Saku,
Sorry to come back again...I need more help!
I have 4 .wav files installed in the folder voice_keyer. I can play them using the command aplay. So the sound path is working fine when the JTDX and CQRLOG are running from the rig.
I understand the principle you use for calling the alert sounds, which depends on the script in voice_alert.sh (in the folder voice_keyer). But what is the syntax?
I have tried many combinations, but no success in getting it to work.
At present my (executable) script file is:

#!bin/bash
'my' = __Trumpet
'loc' = __New_Grid
'text' = __Siren
'call' = _Calling_You

aplay ~./.config/cqrlog/voice_keyer/$1.wav

I have tried (for the first time) running FT8 on 40 meters, so have many potential alert conditions. But no sounds. I don't know how to trace the fault. Can you help?
Thanks for your time
Robin, 9H1ZZ

9H1ZZ
CQ-monitor alert sounds

Hello again Saku,

I spent all last night experimenting and trying to work out how this should be setup. Finally at 05:30 this morning I found the right combination!
The executable script now only contains the following:

#!bin/bash
aplay ~./.config/cqrlog/voice_keyer/$1.wav

and the voice_keyer folder contains the sound files, which are now named my.wav, loc.wav, text.wav, call.wav

That was the information I was missing. Probably perfectly obvious to Linux aficionados!
Apologies for taking up your time on such a simple matter.

73
Robin, 9H1ZZ

oh1kh
CQ alerts

Ah!
Maybe the reason was that I forgot to tell that comment lines in script file have always # as first character.
Then linux bash ignores all text after that and does not try to do any action with rest of line's text.

--
Saku
OH1KH

oh1kh
CQ alerts

Sorry I could not state enough clear that $1 will be replaced with my, loc, text or call when cqrlog issues call to script and that produces my.wav ... Etc..

Fine that you foud it out. You have now a bit more 'linux guru' than before!
Always good advice is to put corresponding words to google search.
In many linux related cases there is lot of information to be tested to solve problem.

--
Saku
OH1KH

--
Saku
OH1KH

9H1ZZ
CQ Monitor

Thanks Saku. I appreciate your comments.

In view of my experience, might I suggest that, instead of expecting a new user to be able to understand the complexities of the software design and its capabilities, CQRLOG simply comes with a default configuration that does what most users will be wanting (common alarms to default audio outputs). Then provide detailed information for those Linux geeks who may want to switch on coffee machines or floodlight their antennas when working Antarctica or whatever. It is always simpler to modify existing working software than to start right from the original concept when you are unfamiliar with the program commands/language !
Just a suggestion!
73
Robin, 9H1ZZ

db5fp
No Sound is played

Hello,

I've the same problem, more or less.
No sound is played.

I've some debug Imformation attached :
I monitor LZ1JZ in CALL or I put country as TEXT to monitor

CQ LZ1JZ KN22
Orig:67 Re:64
Memo Lines count is now:20
Time-Result:075900 index of msg:7
Mode-Result:~ index of msg:9
Cq1-Result:CQ index of msg:12
Cq2-Result:LZ1JZ index of msg:18
CHR Count now:1 len,num,chr:5,FALSE,TRUE
CHR Count now:2 len,num,chr:5,FALSE,TRUE
CHR Count now:3 len,num,chr:5,TRUE,TRUE
CHR Count now:4 len,num,chr:5,TRUE,TRUE
CHR Count now:5 len,num,chr:5,TRUE,TRUE
Call LZ1JZ valid: TRUE
msgCQ2>2(lrs+num) is Call-Result:LZ1JZ index of msg:18
DIR-CQ-call after CQ2:FALSE
Loc-Result:KN22 index of msg:23
DIR-CQ-call after old std DX:FALSE
LOCATOR IS:KN22
Start adding richmemo lines
Start WkdCall
call query: select count(callsign) as 'sum' from cqrlog_main where callsign='LZ1JZ' and band='30M' and mode='FT8'union all select count(callsign) from cqrlog_main where callsign='LZ1JZ' and band='30M'union all select count(callsign) from cqrlog_main where callsign='LZ1JZ'

0
0
0
WkdCall is:0
Start WkdGrid
loc query: select count(loc) as 'sum' from cqrlog_main where loc like 'KN22%' and band='30M' and mode='FT8'union all select count(loc) from cqrlog_main where loc like 'KN22%' and band='30M'union all select count(loc) from cqrlog_main where loc like 'KN22%'union all select count(loc) from cqrlog_main where loc like 'KN%' and band='30M' and mode='FT8'union all select count(loc) from cqrlog_main where loc like 'KN%' and band='30M'union all select count(loc) from cqrlog_main where loc like 'KN%'

0
0
1
2
2
6
WkdGrid is:3
My continent is:EU His continent is:EU
SELECT id_cqrlog_main FROM cqrlog_main WHERE adif=212 AND band='30M' AND qsl_r='Q' AND mode='FT8' LIMIT 1

SELECT id_cqrlog_main FROM cqrlog_main WHERE adif=212 AND band='30M' AND mode='FT8' LIMIT 1

SELECT id_cqrlog_main FROM cqrlog_main WHERE adif=212 AND band='30M' LIMIT 1

SELECT id_cqrlog_main FROM cqrlog_main WHERE adif=212 LIMIT 1

Looking this>N< from:New band country!!
Text-LZ1JZ-compare with:LZ1JZ:results:call
Setting UDP decode to LoSpeed
Setting UDP decode to HiSpeed
Header position:1 Schema number:2 Message type:0 HeartBeat Id:WSJT-X
Setting UDP decode to LoSpeed
Setting UDP decode to HiSpeed
Header position:1 Schema number:2 Message type:1 Status Id:WSJT-X
Qrg :10.136
Band :30M
Mode:FT8 wLoSpeed:500
Call :TF1A
Report: -15
TXmode: FT8
TXEnabled: FALSE
Transmitting: FALSE
Setting UDP decode to LoSpeed
Setting UDP decode to HiSpeed
Header position:1 Schema number:2 Message type:1 Status Id:WSJT-X
Qrg :10.136
Band :30M
Mode:FT8 wLoSpeed:500
Call :TF1A
Report: -15
TXmode: FT8
TXEnabled: FALSE
Transmitting: FALSE
Setting UDP decode to LoSpeed
Setting UDP decode to HiSpeed
Header position:1 Schema number:2 Message type:2 Decode Id:WSJT-X
New decode:
075915
snr:-3
delta time: 4.5918701801743319E+018
DeltaFreq:1349
~

But no sound is played!!!!!!

~/.config/cqrlog/voice_keyer $ ls -la
insgesamt 320
drwxr-xr-x 2 pi pi 4096 Mär 3 17:59 .
drwxr-xr-x 12 pi pi 4096 Mär 4 08:50 ..
-rw-r--r-- 1 pi pi 43728 Apr 25 2017 call.wav
-rw-r--r-- 1 pi pi 191292 Apr 25 2017 loc.wav
-rw-r--r-- 1 pi pi 8408 Apr 25 2017 my.wav
-rw-r--r-- 1 pi pi 56716 Apr 25 2017 text.wav
-rwxr-xr-x 1 pi pi 436 Mär 3 17:59 voice_keyer.sh

#!/bin/bash
# //audio file name (prefix) played on alert
# //can be:'my' = ansver to my cq,
# // 'loc' = new main grid,
# // 'text'= text found from monitor line
# // 'call'= text fits to the callsign
# // create files you want to be played

# scirpt is seeking names with '.wav' suffix! Change if needed

#select audio card(if needed) and play alert message
aplay /home/pi/.config/cqrlog/voice_keyer/$1.wav

Any suggestions?

best regards
Frank

DB5FP

oh1kh
No Sound is played

"I monitor LZ1JZ in CALL or I put country as TEXT to monitor"

Do you mean you type "LZ1JZ" to text alert box, or type "country" to text alert box?

I tested both call and country. They work, but there is something broken with comma separation of several alert words and also with asterisk (TEXT* or *TEXT) handling.
So only one word in text alert box seems to work.

I have to check this!
Did you remember to press "alert" button after text typing (turns green) to activate the alert?

And we are talking now version 2.2.0, not earlier ones.

--
Saku
OH1KH

--
Saku
OH1KH

db5fp
Hello Saku,

Hello Saku,

I tried both ANY CALL like LZ1JZ or simple word like "country" or "QSL" (for QSL needed).

Yes I pressed the button and the word alert went into bold text.

And yes ist Version 2.2.0

I also monitored if aplay was open, but it was not open to play the sounds.

73

Frank
DB5FP

oh1kh
No Sound is played

Hi !
There is nothing wrong with alerts. I just should RTFM sometimes myself, too :D :D :D

I had completely forgotten that button "text" had to be pressed when call alerts are needed.
Then it turns to "CALL" and only when it is in "CALL" several strings can be typed with comma separation and asterisk used (if needed).
When button is "Text" comma separation does not work.

I had to look this from source code, but lot more easier would have been to read it from manual !

Remember "alert" button must be green for "Text" or "Call" alerts to be active!

For testing actual alert open console and type:
(change "saku" to your username below!!!)

/home/saku/.config/cqrlog/voice_keyer/voice_alert.sh call

and hit enter.
You should hear alert. Cqrlog does not be running, but it can be.
If nothing heard, was there any error text in console after command?

If there is like this:
Playing WAVE '/home/saku/.config/cqrlog/voice_keyer/call.wav' : Signed 16 bit Little Endian, Rate 11025 Hz, Mono

But no sound, the sound goes to wrong audio card (to rig?)
You have to find out how to use right audio card (depending your settings) for "aplay" that is used to play alert sound.
Use Google for seeking info!!!

If you have:
No such file or directory
There is no script file at all or somewhere is typing error.

Or if you have:
Permission denied
You do not have execution bit set for script file. Then give command:

chmod a+x /home/saku/.config/cqrlog/voice_keyer/voice_alert.sh
(again replace "saku" with your username)

And try again.

Any help from these?

--
Saku
OH1KH

File: 

--
Saku
OH1KH

db5fp
Hello Saku,

Hello Saku,

sorry for not giving all the Information to you !!
I tried the skript myself bevor I posted in the forum and yes I can hear the sound. ~/.config/cqrlog/voice_keyer $ ./voice_keyer.sh call
Wiedergabe: WAVE '/home/pi/.config/cqrlog/voice_keyer/call.wav' : Signed 16 bit Little Endian, Rate: 11025 Hz, mono

~/.config/cqrlog/voice_keyer $ ls -la
insgesamt 320
drwxr-xr-x 2 pi pi 4096 Mär 3 17:59 .
drwxr-xr-x 12 pi pi 4096 Mär 4 10:48 ..
-rw-r--r-- 1 pi pi 43728 Apr 25 2017 call.wav
-rw-r--r-- 1 pi pi 191292 Apr 25 2017 loc.wav
-rw-r--r-- 1 pi pi 8408 Apr 25 2017 my.wav
-rw-r--r-- 1 pi pi 56716 Apr 25 2017 text.wav
-rwxr-xr-x 1 pi pi 436 Mär 3 17:59 voice_keyer.sh

So the problem in my opinion is that the skript is not called from CQRLOG or the Monitor-window.

73

Frank / DB5FP

oh1kh
Hello Saku,

Ok.

Set alert to "Call" and type into box ZS*,EA*,*CLM and activate "alert" .

Check debug text. Every time a new line is added to CQ-monitor you should find this kind of text:

Split text search >ZS*,EA*,*CLM[4]=ZS*
Left-ZS-compare with:ZS:results:
Split text search >EA*,*CLM[4]=EA*
Left-EA-compare with:EA:results:call
Split text search >*CLM[0]=*CLM
Right-*CLM-compare with:CLM:results:call

If any of "results:" say "call" that means alert hit and you should see also:
Command line: bash ~/.config/cqrlog/voice_keyer/voice_alert.sh call

Script name is fixed to source code as voice_keyer/voice_alert.sh so if cqrlog is running in default directory ~/.config/cqrlog the script should start.

--
Saku
OH1KH

oh1kh
No Sound is played

Forgot to say that explanation in help page(shown in image) is somewhat confusing. Text will be fixed with next pull requests I make. (is now already fixed in my cqrlog-devel GitHub)

--
Saku
OH1KH

db5fp
SOLED !!!

Hallo Saku,

I got it!
The problem was the missnamed skript file :

In this post it was named voice_keyer.sh so I made a file with this name and the right name is voice_alert.sh

Thanks
Frank / DB5FP

oh1kh
[SOvLED] !!!

Hi!

Good !
voice_keyer is used when in phone modes and it can play "CQ" and other things to rig just like CW memories when in cw mode.

--
Saku
OH1KH