I had always wanted to try and receive a signal from a satellite using my scanner. After some research I found that I may actually be able to pick up the NOAA Weather Satellites as they pass overhead.
Now, during normal operation of my scanner, it is usually just hooked up to my TV antenna which is affixed to the roof of my two story house. For normal operation, I’ve actually found this to work quite well. I’m able to pickup pretty much anything I’d like with reasonable quality… Except for the NOAA Weather Satellites.
The Meteostat JSON API provides simple access to a large archive of historical weather and climate data. The records are queried by weather station or geo location and can be filtered by specifying a date range and other optional parameters. The API is available via this URL:
Access to the API requires users to send their API key along with every request. All API endpoints return a JSON object that contains two properties: meta and data. The meta object provides general information about the data output and debugging information. For instance, the source string which holds the names of the organizations which provided the raw data. The data property is either an object or an array that contains the actual data output.
All API endpoints are accessible using HTTP Get requests. For debugging, please utilize the HTTP status code of the response.
!/bin/bash
#
# (c) Frank Matthieß 2020
#
#
NAME=$(basename $0)
info() { echo "$*">&2; }
error() { info "ERROR: $*"; }
APIURL=https://api.opensensemap.org/boxes
TMPFILE=$(mktemp)
STIDFILE=$(mktemp)
trap 'rm -f ${TMPFILE} ${STIDFILE} ' INT EXIT
# At the map, click on an station icon and you get, for example, this url:
# https://opensensemap.org/explore/5b4d11485dc1ec001b5452c7
#
# Add the id tring at the end of the url with a proper name to the sensor id list
# Sensor id list
cat<<EOSTIDS>$STIDFILE
5c22ef44919bf8001a10acc7 Berlin Charlottenburg
5a9c2087bc2d4100191d6ff9 Stuttgart Unteraichen (A8)
5b4d11485dc1ec001b5452c7 München Fakultät Informatik
EOSTIDS
#
#
# Adjust the field length of the output
llen=0
while read stid location; do
l=$(wc -c <<< "$location")
if [ $llen -lt $l ]; then
llen=$l
fi
done < $STIDFILE
#
# .. and get the need values via opensensemap api
#
while read stid location; do
curl -sL ${APIURL}/${stid} > ${TMPFILE}
reallocation=$(jq .name < ${TMPFILE})
temperature=$(jq '.sensors[] | select(.title|test("Temperatur")) | .title, .lastMeasurement.value, .unit' < ${TMPFILE} | xargs )
humidity=$(jq '.sensors[] | select(.title|test("rel. Luftfeuchte")) | .title, .lastMeasurement.value, .unit' < ${TMPFILE} | xargs )
rawcoordinates=$(jq '.currentLocation.coordinates[]' < ${TMPFILE} | xargs )
coordinates=$(while read lon lat heigh; do echo "https://www.openstreetmap.org/?mlat=${lat}&mlon=${lon}#map=12/${lat}/$lon"; done <<< "${rawcoordinates}")
#
printf "%-${llen}s:\n\tStationsname : %s\n\t%s\n\t%s\n\tOpenstreetmap: %s\n" \
"${location}" \
"${reallocation//\"/}" \
"${temperature}" \
"${humidity}" \
"${coordinates}"
done < $STIDFILE
# vim:set ts=8 sts=8 sw=8 ft=sh ai tw=80: