Saytime not announcing weather

I have run the script to have saytime.pl announce the time and weather on the hour. I get the time announcement, but not the weather.

I can test run it from terminal using

"sudo perl /usr/local/sbin/saytime.pl " and it functions fine, including weather.

I have installed this command line under functions in rpt.conf as

"81 = cmd,perl /usr/local/sbin/saytime.pl " and all I get is the time when I run the command.

How to I make it announce the weather? I am confused as to if asl3 uses crontab or not and where the command to run saytime.pl is triggered from.

Thanks

This may help

[2026-05-02 19:00:18.043] WARNING[3190]: file.c:832 openstream_internal: File /tmp/current-time does not exist in any format
[2026-05-02 19:00:18.044] WARNING[3190]: file.c:1342 ast_streamfile: Unable to open /tmp/current-time (format (slin)): No such file or directory

This error message comes up on the hour, not when the command is run from bash commands or dtmf.

Change word perl to sudo in that function.

And make sure saytime.pl is in sudoers file.

Also that function must include zip code and node number.

In rpt.conf
81=cmd,/usr/local/sbin/saytime.pl 97479 57540
97479 is your zip
57540 is your Node number

I had already changed it to the line you suggested;

"81 = cmd,/usr/local/sbin/saytime.pl xxxxx xxxxx"

The *81 DTMF command triggers a time announcement, but no weather. There are no errors showing in Asterisk like there are on the hour.

I found the command in crontab, edited it to include "sudo -u asterisk" and I hope that fixes in when it announces on the hour. I'll know in 40 minutes. I am guessing that not having that in there explains why I was getting error messages saying the temp file could not be found.

Changes in crontab;

From: "00 00-23 * * * (/usr/bin/nice -19 /usr/bin/perl /usr/local/sbin/saytime.pl xxxxx xxxxx >/dev/null)"

To: "00 00-23 * * * (/usr/bin/nice -19 /usr/bin/sudo -u asterisk /usr/bin/perl /usr/local/sbin/saytime.pl xxxxx xxxxx > /dev/null)"

No clue why it does time but not weather with the *81 command. Fingers crossed I hear the weather on the hour now.

EDIT:, Yes, I am including my zip and node in the proper locations.

RESULT: On the hour, still not announcing weather with the time. Still showing this error;

[2026-05-03 20:00:13.548] WARNING[4803]: file.c:832 openstream_internal: File /tmp/current-time does not exist in any format
[2026-05-03 20:00:13.548] WARNING[4803]: file.c:1342 ast_streamfile: Unable to open /tmp/current-time (format (slin)): No such file or directory

EDIT: More info. The permissions are not right?

root@Allstarxxxxx:~# sudo -u asterisk /usr/bin/perl /usr/local/sbin/saytime.pl xxxxx xxxxx
Unable to access the running directory (Permission denied). Changing to '/' for compatibility.

This manual command makes it work. But has the error on permissions.

change your cronjob time that it runs. say one minute before or one minute after, any time really other than top of the hour. it turns out that the servers where the weather is retrieved get hammered at the top of the hour and can handle only so many requests. I did this and now it works flawlessly.

UPDATE

I have figured out what the problems are. I was adding/editing the commands in root cron instead of asterisk cron. This is what was causing the error messages. And as already mentioned, the weather server just gets overloaded with requests on the hour. I have it set to announce every 15 minutes right now, and it works great at 00:15 and 00:45, occasionally at 00:30, and rarely at 00:00. Ham Crusader posted a video yesterday with a fix for hamvoip, hopefully one for ASL3 will come out soon.

I still cant get the weather to announce with a DTMF command, I'll post another follow up if I get it fixed.

saytime_weather_rb has multiple providers without jumping threw all the hoops. Keep things simple no need for an api based weather script that takes 15 minutes to setup when you can do it in a minute with multiple providers.