2 things to check.
Can you run this manually from the command line.
Normally you might find this a matter of ownership/permissions of the script file in question.
All permissions are set and I assume that Asterisk has root permission. I can run the script from the command line with sudo. Still no joy getting a DTMF function to fire the script.
As I noted above, the “asterisk” process does NOT run as the “root” user. It runs as the “asterisk” user and does not have the “I can read/write any file” permissions. Your script looks to be writing into your own home directory and I’m guessing that it is not writable by the “asterisk” user.
Try your script again but, instead, write to “/tmp/test.out”.
I am following the instructions in setting up Skywarn Plus on ASL3. Of course, there is nothing in the instructions on setting the proper permissions. I just banging my head against the wall trying to get this to work. So far all I have is a headache and the wall is not looking too good either.
I have SkywarnPlus installed on one of my nodes and I just followed the written instructions. All just worked (for me).
Here, it looks like you are experimenting with app_rpt “functions”. Yes, there’s a bit of learning curve re: where to put files and executables, filesystem permissions, etc. But, once you’ve got everything in place you should be good.
SkywarnPlus author here. I’ve looked into this and have found the issue to in fact be permissions based and only applied only to ASL3 installations - where Asterisk 20 no longer runs as the root user.
The main SkywarnPlus.py script does not have an issue running, because pretty much everyone adds it to the crontab while logged in as root - thus the main script is always executed from roots crontab.
However, the SkyDescribe.py and SkyControl.py scripts are normally added as functions to rpt.conf, and are thus executed by Asterisk as the asterisk user. The asterisk user does not have permission to access any files owned/created by the root user. This can be seen when manually executing the scripts as the asterisk user:
root@ASL3:~# sudo -u asterisk /usr/local/bin/SkywarnPlus/SkyDescribe.py 1
Traceback (most recent call last):
File "/usr/local/bin/SkywarnPlus/SkyDescribe.py", line 82, in <module>
FH = logging.FileHandler(LOG_PATH)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/logging/__init__.py", line 1181, in __init__
StreamHandler.__init__(self, self._open())
^^^^^^^^^^^^
File "/usr/lib/python3.11/logging/__init__.py", line 1213, in _open
return open_func(self.baseFilename, self.mode,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/tmp/SkywarnPlus/SkyDescribe.log'
root@ASL3:~# sudo -u asterisk /usr/local/bin/SkywarnPlus/SkyControl.py enable toggle
Traceback (most recent call last):
File "/usr/local/bin/SkywarnPlus/SkyControl.py", line 234, in <module>
with open(str(CONFIG_FILE), "w") as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/usr/local/bin/SkywarnPlus/config.yaml'
A possible workaround could be to add asterisk as a passwordless sudoer, and simply place sudo in front of any SWP functions in rpt.conf - but this is less than ideal for obvious reasons.
You are correct, I was completely overthinking it.
I just updated the official SkywarnPlus installation instructions for ASL3 compatibility. For users that have already installed SkywarnPlus on their ASL3 node, the “patch” is as follows:
Modify existing crontab entry to execute SkywarnPlus as the asterisk user:
# Run `crontab -e` and insert 'asterisk' into the line as shown
* * * * * asterisk /usr/local/bin/SkywarnPlus/SkywarnPlus.py
I do not know what I am doing wrong. I followed the instructions step by step. I still cannot get SkyDescribe.py to launch using DTMF commands either through Supermon or a keypad on a radio. SkyDescribe.py works fine from the command line.
Has anyone gotten the scripts to run via DTMF? If anyone has been successful, could you post your rpt.conf file?
Did you reinstall SkywarnPlus using the new installer and/or new manual installation instructions? The asterisk user must have the correct permissions for the scripts to work properly on ASL3. The new SkywarnPlus installer will assist you in making sure SkywarnPlus is installed properly so that asterisk is able to access the files.
It’s works. I did a fresh install of ASL from image and ran ‘the script’ to install SkywarnPlus. DTMF is working from the HT keypad and Supermon. Now I can safely visit Yellowstone monitoring for Volcano Alerts.
(It’s always a permissions issue with Linux, en-it?)