Tempest Weather to APRS Weather String

The Tempest weather uses an API on Weatherfunnel that can be accessed to create an APRS string. You will need to have the appropriate access token from weather funnel. A quick Google search will show you how to get that. Must have a Weatherfunnel (Tempest) account. There is some documentation as well on the Weatherfunnel API that may be worth reading.

https://weatherflow.github.io/Tempest/api

Anyways, a quick and dirty PHP commend line script to output the proper weather APRS string.

<?php
//the ######### in the following line must be your weather station ID. The xxxxxxxxxxxxxxxxxxx in the next line is your access token.

$json_string = 'https://swd.weatherflow.com/swd/rest/observations/station/########?token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';

$jsondata = file_get_contents($json_string);
$result = json_decode($jsondata, true);
//Un-Comment the next line if you want to see all of the values returned.
//print_r($result);
$tempf=round((($result['obs'][0]['air_temperature'])*1.8)+32);
$wind_speed=round($result['obs'][0]['wind_avg']*2.237);
$wind_gust=round($result['obs'][0]['wind_gust']*2.237);
//Make sure you change the Latitude/Longitude Degrees in the first part of the echo line.
//
echo "_3941.42N/10446.43W_".$result['obs'][0]['wind_direction']."/".$wind_speed."G".$wind_gust."T".$tempf."P".$result['obs'][0]['precip']."h".$resul
t['obs'][0]['relative_humidity']."b".$result['obs'][0]['barometric_pressure']."\n";
?>

My cron statement to generate a weather file for bpq32 is:

*/5 * * * * /usr/bin/php /usr/local/bpq32/weatherdecode.php > /usr/local/bpq32/current.txt

And then in bpq32.cfg find the WXFileName and set to:

WXFileName=/usr/local/bpq32/current.txt

You will need to restart the BPQ32 in order for any changes to take effect.