[arm-allstar] saytime.pl modification for exactly 100 degree temperature

Doug Crompton wa3dsp at gmail.com
Sun Jul 16 16:04:07 EST 2017


Lawrence,

   Good find! I has not gotten to 100 here this year yet so we are lucky.
That has been that way quite awhile. I corrected but not exactly as you did
and also since the wx_condition.sh script for this was basically copied
from saytime it is also corrected. The new wx_condition.tar.gz is up on
hamvoip.org/downloads. Both fixes will be in the next update.


*73 Doug*

*WA3DSP*

*http://www.crompton.com/hamradio <http://www.crompton.com/hamradio>*



On Sun, Jul 16, 2017 at 2:59 PM, "Lawrence Roney via arm-allstar" <
arm-allstar at hamvoip.org> wrote:

> Hi,
>
>
>
> Out here in the Nevada desert, we are using new temperature function that
> is built into the /usr/local/sbin/saytime.pl script.
>
>
>
> We found a little glitch.  If the temperature is exactly 100 degrees, it
> will only say "10 degrees"
>
>
>
> I added a few lines as a work around.  There is likely much cleaner and
> structured way to do this with an ELSE statement vs. a GOTO tag, but I will
> let the more accomplished perl programmers figure that out.
>
>
>
> Thanks Doug for everything you do to support the hobby and Allstar!
>
>
>
> Lawrence - N6YFN
>
> Henderson Amateur Radio Club
>
> www.W7HEN.com
>
>
>
> --- Previous lines snipped ---
>
> if ($localwxtemp ne "" ) {
>
>     $FNAME = $FNAME . $base . "/wx/temperature.gsm ";
>
>
>
>     if ($localwxtemp < -1 ) {
>
>         $FNAME = $FNAME . $base . "/digits/minus.gsm ";
>
>         $localwxtemp=int(abs($localwxtemp));
>
>     } else {
>
>         $localwxtemp=int($localwxtemp);
>
>     }
>
>
>
> #
>
> # Next 6 lines added if temperature is exactly 100 degrees.
>
> # Also added a goto CONCATENATE tag to skip the rest of the temperature
> parsing
>
> #
>
>     if ($localwxtemp == 100) {
>
>         $FNAME = $FNAME . $base . "/digits/" . "1" . ".gsm ";
>
>         $FNAME = $FNAME . $base . "/digits/" . "hundred" . ".gsm ";
>
>         $FNAME = $FNAME . $base . "/degrees.gsm ";
>
>         goto CONCATENATE;
>
>     }
>
>
>
>     if ($localwxtemp > 100) {
>
>         $FNAME = $FNAME . $base . "/digits/" . "1" . ".gsm ";
>
>         $FNAME = $FNAME . $base . "/digits/" . "hundred" . ".gsm ";
>
>         $localwxtemp=($localwxtemp-100);
>
>     }
>
>
>
>     if ($localwxtemp < 20) {
>
>         $FNAME = $FNAME . $base . "/digits/" . $localwxtemp . ".gsm ";
>
>     } else {
>
>         $localwxtemp10 = substr ($localwxtemp,0,1) . "0";
>
>         $FNAME = $FNAME . $base . "/digits/" . $localwxtemp10 . ".gsm ";
>
>         $localwxtemp1 = substr ($localwxtemp,1,1);
>
>         if ($localwxtemp1 > 0) {
>
>           $FNAME = $FNAME . $base . "/digits/" . $localwxtemp1 . ".gsm ";
>
>         }
>
>     }
>
>     $FNAME = $FNAME . $base . "/degrees.gsm ";
>
> }
>
> }
>
>
>
> CONCATENATE:
>
> #
>
> # Following lines concatenate all of the files to one output file
>
> #
>
> @proglist = ("cat " . $FNAME . " > " . $outdir . "/current-time.gsm");
>
> system(@proglist);
>
> #
>
> # Following lines process the output file with sox to lower the volume
>
> # negative numbers lower than -1 reduce the volume - see Sox man page
>
> # Other processing could be done if necessary
>
> #
>
> # REMOVED V1.5 - use telemetry levels
>
> #
>
> #@proglist = ("nice -19 sox --temp /tmp " . $outdir . "/temp.gsm " .
> $outdir . "/current-time.gsm vol -0.35");
>
> #system(@proglist);
>
> #
>
> # Say the time on the local node
>
> #
>
> @proglist = ("/usr/sbin/asterisk -rx \"rpt localplay " . $mynode . " " .
> $outdir . "/current-time\"");
>
> system(@proglist);
>
>
>
> # end of saytime.pl
>
>
>
> _______________________________________________
>
> arm-allstar mailing list
> arm-allstar at hamvoip.org
> http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
>
> Visit the BBB and RPi2/3 web page - http://hamvoip.org
>
>


More information about the arm-allstar mailing list