CQ Monitor alerts not working

16 posts / 0 new
Last post
9H1ZZ
CQ Monitor alerts not working

I have used CQ monitor audible alerts on my Mint 18 for several years now for both WSJTX and JTDX, and it has been perfect. All four sound selections worked.
I just changed to a more recent distro (MXLinux 19) in order to run WSJTX 2.2.2 and JTDX 2.2. Everything is working again including all features of CQRLOG interfacing with WSJTX (and JTDX), except there are no sound alerts generated. All settings are the same... the voice_keyer script is identical and is executable. The .wav sound files all play correctly. The address is 127.0.0.1 port 2237 for CQRLOG and matches WSJTX. UDP is enabled. I have changed OS and I have changed the versions of WSJTX/JTDX, and the log is empty, so all CQ calls are green and 'New' , otherwise everything else seems identical. Any idea where I should be looking for the problem?

Robin, 9H1ZZ

oh1kh
CQ Monitor alerts not working

HI Robin!

First test with modified voice_alert. script:

add one line to beginning of your script:
echo $1 >> /tmp/alert.txt
and start using. After a while peek file /tmp/alert.txt.
You should see there "my", "loc", "text" or "call" strings depending what has alerted.

If that seems to be ok then try to run your script from console:
/home/username/.config/cqrlog/voice_alert/your_script_name my
Change "my" also to other possible strings "loc", "text" or "call"
Does it work from console?

do you have those .wav files? "my.wav" "loc.wav", "text.wav" or "call.wav" present ?

Checking these three things should pinpoint the problem:
1)either cqrlog does not activate script (perhaps wrong path or filename) or does not send the parameter string for script
2)your scipt does not work from console (it always should!)
3) your .wav files are missing

Knowing these we can continue.

--
Saku
OH1KH

oh1kh
CQ Monitor alerts not working

Here is my script:

#!/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)

# 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.

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

--
Saku
OH1KH

9H1ZZ
Thanks for your reply.

Thanks for your reply. Running FT8 on JTDX with continuous stream of decodes available for testing
First - echo $1>> /tmp/alert.txt at the start of voice_alert.sh did not generate any data in the file /tmp/alert.txt
Second - I replaced $1 with my , call , text or loc audio files and ran voice_alert.sh. All sounds worked.
To check if the problem is in the new OS (MXLinux) I wiped it out and replaced it with Mint 20. Same result.
Could it be that because I am installing CQRLOG from the .deb release rather than from source or ppa that might influence the generation of alerts?

oh1kh
CQ Monitor alerts not working

HI Robin!

Fine!. Now we are getting forward.

Wsjt alert script name and path is hard coded in source:

procedure TfrmMonWsjtx.RunVA(Afile: string);
const
cAlert = 'voice_keyer/voice_alert.sh';
var
AProcess: TProcess;
begin
if not FileExists(dmData.HomeDir + cAlert) then
exit;

That means that it must be ~/.config/cqrlog/voice_keyer/voice_alert.sh none other paths or filenames will work.
It that ok?

I do not think you run cqrlog with sudo (sudo cqrlog). In that case the home directory may point to /root even when your homedirectory (without sudo) is /home/username.

Next step is to start cqrlog from console with:
cqrlog debug=1 > /tmp/debug.txt

After there should have been alerts stop cqrlog and dig the /tmp/debug.txt. You should find lines like:

----

Looking this>N< from:New country!!
All written in AddCq. Next alerts

AProcess.Executable: /home/saku/.config/cqrlog/voice_keyer/voice_alert.sh Parameters: text

-----------------------decode end-----------------------------------
-----------------------decode start---------------------------------

----

Here the alert was produced in new empty log as Text alert seeking word "New".
From dump you can see the full path where cqrlog expects to find alert script.
Is that correct and the script can be found?

--
Saku
OH1KH

9H1ZZ
Hi Saku, Thanks for taking

Hi Saku, Thanks for taking the time to explore this with me!

The path is correct
~/.config/cqrlog/voice_keyer/voice_alert.sh

I launch cqrlog with my user name. Not root or sudo.

When I start with the command (copied and paste) you suggest, the result is:

robin@robin-desktop:~$ cqrlog debug=1 > /tmp/debug.txt
[1] 4363
bash: gt: command not found
bash: /tmp/debug.txt: Permission denied
robin@robin-desktop:~$
Cqrlog Ver:2.4.0 (001) Date:2019-10-27
**** DEBUG LEVEL 1 ****

OS:
Linux version 5.4.0-48-generic (buildd@lcy01-amd64-010) (gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2)) #52-Ubuntu SMP Thu Sep 10 10:58:49 UTC 2020
SSL libraries:
libssl.so
libcrypto.so
......etc, etc.

Nothing appears in /tmp/debug.txt when CQ calls are detected
Examining the debug information in the terminal, I have located a CQ call that should have generated an alert. Here is an extract from the screen:

Looking this>N< from:New country!!
All written in AddCq. Next alerts

AProcess.Executable: /home/robin/.config/cqrlog/voice_keyer/voice_alert.sh Parameters: text

-----------------------decode end-----------------------------------
-----------------------decode start---------------------------------

However further down in the same decode time slot, other CQ calls are reported as:

Looking this>N< from:New country!!
All written in AddCq. Next alerts

-----------------------decode end-----------------------------------
-----------------------decode start---------------------------------

Since the log is empty, all CQ calls are green and generate New in the text.
The text box is set to look for New, and Alert button is green
However no sound.

The .wav sound files (which I put in voice_keyer folder) can all be played correctly.
Replacing $1.wav in voice_alert.sh by one of the sound files (e.g. my.wav) and running voice_alert.sh also generates the correct sound.

This setup used to work when the computer was running Mint 18.3 and cqrlog was installed from the ppa.
Now I am running Mint 20 and cqrlog (latest version) is installed from the .deb release. As far as I can tell all settings of the OS are the same as before.
Also the JTDX is a new version.

Hope the above helps you to locate where the problem is so we can correct it.
Thanks again,

Robin, 9H1ZZ

oh1kh
CQ Monitor alerts not working

Hi Robin !

As you have found debug line
AProcess.Executable: /home/robin/.config/cqrlog/voice_keyer/voice_alert.sh Parameters: text

You should get alert.
open that file (use copy / paste from debug text to be sure you are on right file)
nano /home/robin/.config/cqrlog/voice_keyer/voice_alert.sh

Make 3 first lines to be as:

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

Save file and check with:
ls -l /home/robin/.config/cqrlog/voice_keyer/voice_alert.sh

That you have execute bit "x" set for at least for owner (your username).

[saku@hamtpad ~]$ ls -l /home/saku/.config/cqrlog/voice_keyer/voice_alert.sh
-rwxrwxr-x. 1 saku saku 870 4.10. 11:09 .config/cqrlog/voice_keyer/voice_alert.sh

Then start cqrlog, wsjtx remote and wsjtx and wait alerts. After few periods you should have /tmp/alerts.txt content as:
[saku@hamtpad ~]$ cat /tmp/alerts.txt
text
text
[saku@hamtpad ~]$

You get one line of alert parameter for period (only one alert for period, see help)
After testing remove at least line "exit" or you do not get any alerts as exit halts the script.

I can not see any other reason for defunct that you do not have execution bit set for script. (but then it should not work from command line, what it does !!?!) You can set it from console:

chmod 775 /home/robin/.config/cqrlog/voice_keyer/voice_alert.sh

More rare reason would be that your Linux has some kind of protect (apparmor? etc.??) that prevents running program execute a child program.
In this case you should not be able to start rigctld from cqrlog start or start wsjtx when remote is set on.
I am not very well aware of that kind of protections with different Linuxes.

--
Saku
OH1KH

9H1ZZ
CQ Monitor alerts not working

Hi Saku,
I do not have much experience with Linux myself, so apologies for any mistakes in my interpretation!

When there is a valid text match, CQRLOG correctly generates the line:
AProcess.Executable: /home/robin/.config/cqrlog/voice_keyer/voice_alert.sh Parameters: text

I confirm that this file has following permissions:
-rwxrwxr-x 1 robin robin 89 Oct 4 13:26 /home/robin/.config/cqrlog/voice_keyer/voice_alert.sh

The folder voice_keyer :
robin@robin-desktop:~$ ls -l ~/.config/cqrlog/voice_keyer
total 140
-rw-r--r-- 1 robin robin 34346 Oct 12 2012 call.wav
-rw-r--r-- 1 robin robin 41222 Oct 12 2012 loc.wav
-rw-r--r-- 1 robin robin 25982 Feb 16 2011 my.wav
-rw-r--r-- 1 robin robin 23904 Feb 17 2011 text.wav
-rwxrwxr-x 1 robin robin 89 Oct 4 13:26 voice_alert.sh
-rw-rw-r-- 1 robin robin 307 Oct 2 18:21 voice_keyer.sh

The four .wav files all play audio correctly

Currently voice_alert.sh contains
robin@robin-desktop:~$ cat /home/robin/.config/cqrlog/voice_keyer/voice_alert.sh
#!/bin/bash

echo $1 >>/tmp/alerts.txt

exit

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

(Previously I ran it without the exit and also without the echo command)
When running CQ Monitor (either WSJTX or JTDX) with valid Text matches, no sound is generated and no file /tmp/alerts.txt.
If I create an empty ~/tmp/alerts.txt file.... it still remains empty.
So it looks to me that $1 is never processed in voice_alert.sh. Does this mean that bash is not working properly?

I checked the permissions for /bin/bash and see that it is only root. Could this be a problem?
Does this operation require the user to be in some Group? Mint has very few groups by default (example: dialout not included).

There has to be something logical here, because it worked with an earlier Mint (was 18.3, now 20) and earlier CQRLOG version

Thanks for your expert time
Robin 9H1ZZ

oh1kh
CQ Monitor alerts not working

Hi Robin!

Fine job.Yo have searched all needed information and it really looks out that bash child thread started by cqrlog does not run.
Because you can start the script from console bash should start properly.
Bash file is owned by root and group root (root.root) but it has execute bits "x" for owner, group and others (3 times). That is the way it should look out with ls -l

I think your Mint has AppArmor for security profile. Perhaps that is preventing cqrlog to launch bash script.
I have never worked with AppArmor. Just made a quick Google search.
Here https://www.cyberciti.biz/faq/ubuntu-linux-howto-disable-apparmor-commands/ is sample where mysqld server's AppArmor profile is disabled.
You should look similar way is there a profile also for cqrlog.
If you find it, then disable it and test alerts again (but remove then at least the line "exit" from voice_alert.sh to let aplay start to make sound)

Everything seems to be ok with your setup, so it must be some kind of security setting that prevents voice_alert.sh to start when cqrlog tries to start it.

--
Saku
OH1KH

9H1ZZ
CQ Monitor alerts not working

Success Saku! Kippis.

This is a brand-new install of Mint 20 on an Intel i3 NUC. The only programs installed and operating are WSJTX (and JTDX) and CQRLOG. The only system change to the defaults that I have made was to add my username to the group 'dialout'.

Before diving into the complexities of Apparmor, I tried one last thing.
I had noticed that my username was not included in the group 'root' and wondered if that could be why bash was not working properly.
So I added myself to group 'root'..........and it worked.... Correct sounds and info in /tmp/alerts.txt. when an alert occurred.

Just to be sure this was indeed the problem, I then deleted myself from 'root'. And restarted the PC. Would you believe it, the alerts were still processed correctly now, even without the 'root' entry. I must have shaken up a few dormant bits/bytes.

In your opinion, should the user be a member of 'root' when running CQRLOG?

Thanks for your patience in helping me. Much appreciated

Best

Robin 9H1ZZ

oh1kh
CQ Monitor alerts not working

Hi Robin!

You should not keep your username in root group permanently. Doing so and started cqrlog it did now something, I think it changed some security setting that was not allowed for regular user to do.
Now when it is done cqrlog can start child process also with regular user account.

I still think it was the AppArmor cqrlog security profile that needed fixing (or disable), but now it was done a bit different way than adjusting the profile manually, hi.

Just continue using cqrlog as regular user that is not member of root group.
This was very good innovation that maybe can be used also by others (I just wish forum search engine would be more intelligent to help users in trouble)

Thanks for reporting this all until it was finally solved.

--
Saku
OH1KH

9H1ZZ
CQ Monitor alerts working

Thanks for your help/advice, Saku. I took a quick look at Apparmor in my system, and cannot find any profile related to CQRLOG.
It must be something deep inside Mint, and I am certainly not competent (or interested) enough to go into that!

Just happy that it is working again and not questioning any further!

73 Robin

9H1ZZ
CQ Monitor alerts

Saku,
A final note.... if the problem was not in Mint security itself, then it must be in the install process, which would also be a problem, since it might result in other failures, not yet evident. I realised that, although I had verified the .iso download, I had not checked the validity of the boot USB Memory stick. Sure enough, on checking that, there was 1 reported error! So I took the decision to wipe out the present installation and start yet again. So I have downloaded from another reflector and used a USB2 memory stick (previously a USB3). All verified! Now to reload the applications and ensure that 'bash: Permission denied' is no longer present with CQRLOG..
Robin, 9H1ZZ

oh1kh
CQ Monitor alerts

OK Robin!

Isn't there a network install choice for Mint?. I always prefer that because you get the latest updates at one go and you do not need to upload whole iso filled with programs you do not need.
Network install just starts minimal linux that handles the core install and fetch of needed packages directly from repository.

--
Saku
OH1KH

9H1ZZ
CQ Monitor alerts

Hi Saku. I don't find an install Mint from network choice, only from USB or DVD.

At the second attempt the install went fine. But now I again have no sound, regardless of the user group settings! I do not see the message 'bash: Permission denied' either.

I have re-checked everything and all permissions.
The program does correctly detect the condition for the alerts, and debug shows messages such as:
AProcess.Executable: /home/robin/.config/cqrlog/voice_keyer/voice_alert.sh Parameters: text

I left the testing code in voice_alert.sh
echo $1 >> /tmp/alerts.txt
However still no sounds and no entry in /tmp/alerts.txt.

I then tried manually entering the following in the terminal:
robin@shack:~$ /home/robin/.config/cqrlog/voice_keyer/voice_alert.sh text
This caused the correct sound file (text) to play and terminal shows the message
Playing WAVE '/home/robin/.config/cqrlog/voice_keyer/text.wav' : Signed 16 bit Little Endian, Rate 11025 Hz, Mono.
And the /tmp/alerts.txt now has a one line entry
text

Does this help to identify the source of the problem?
Thanks again for your assistance
Robin, 9H1ZZ

oh1kh
CQ Monitor alerts

Hi Robin!

I tried to install MInt 20/Mate from iso to virtual machine.
How ever installation does not start. I try to download another image (xfce) later to see if that works.
Maybe then I can get the same problem to test with.

--
Saku
OH1KH