Wednesday, March 22, 2017

Receiving NOAA weather satellite images with a RTL dongle and a Turnstile crossed dipole automatically.

Receiving NOAA weather satellite images with a RTL dongle and a Turnstile crossed dipole automatically. 
NOAA19-HVCT 2017-03-18 15:40 Taken with this system
What do you need to setup a automatic NOAA APT Weather station configuration.
The necessary licences for your region. FCC ...
Here is a Link to Automated NOAA weather satellite System In Bassonia South Africa.


Hardware requirement diagram.

How dose this system work?

  • The system consists of 3 shell scripts that tai 5 applications together.
  • The shell scrip will fetch the satellite TLE keps data from celestrack. http://www.celestrak.com/NORAD/elements/weather.txt
  • The NOAA satellite TLE data is then passed to the predict satellite positioning software.
  • The predict software calculate when the next satellite will be above your radio station.
  • The result of the calculations for the next 24 hours is then send to a scheduler program call "at".
  • The "at" scheduler will then start and stop the rtl_fm receiver at the required time, frequency and record the audio in the recording directory from the NOAA satellite.
  • The Audio files is not in the correct format for wxtoimg utility to convert it to images and need to be converted to the correct format using the SOX until.
  • The converted recordings is then passed to wxtoimg utility to generate the Satellite images.
  • The images is then exposed via a Apache web server with a php plugin to the internet.

Hardware

  • Raspberry PI and power supply
  • RTL dongle with USB cable and MCX connector adaptor.
  • RG58 Coaxial cable with connectors or better cable. Max 4m
  • Turnstile crossed dipole Antenna.
  • All Hardware and software is available from Giga Technology

Software

  • Predict - Utility to calculate satellite azimuth and elevation using TLE Kep elements
  • rtl_fm - SDR fm Demodulation Utility to decode your ATP Satellite signal to audio file.
  • Sox - To convert row Audio file into format for wxtoimg to convert to Satellite Image.
  • Shell script to calculate the schedule for enabling the rtl receiver.
  • wxtoimg - Utility that converts ATP Audio files into Satellite Images.
  • Apache server to expose the images to the internet.
Software Functional Block diagram


The following software need to be installed on Raspberry Pi or Linux server.

sudo apt-get install predict
sudo apt-get install rtl-sdr
sudo apt-get install sox
sudo apt-get install wxtoimg
sudo apt-get install git
sudo apt-get install apache2
sudo apt-get install php
sudo apt-get install libapache2-mod-php
sudo apt-get install php-mcrypt
sudo apt-get install php-mysql

Create a directory sh in hour home directory.
cd
mkdir sh
cd sh
Create a wxsat directory in your home directory
cd
mkdir wxsat
cd wxsat
Create a images directory in wxsat directory
mkdir images
Create a recordings directory.
mkdir recordings
Create a thumb directory inside the images directory.
cd images
mkdir thumb


cd to sh directory and download the following scripts from github using the git command below
cd ~/sh
git clone https://github.com/antonjan/noaa_weather.git
it will create a directory noaa_weather in the sh directory
Inside the directory there will be three scripts. (the index.php will need to be moved later)
noaa_sat_scheduler.sh
noaa_scheduler.sh
create_thumbnail.sh
index.php
Readme.me

You will need to change your stations GPS coordinates in the following files

Edit the file noaa_sat_schedule.sh and change the following details to your coordinates.
The last one is altitude in meters.

/usr/local/bin/wxmap -a -T "NOAA ${bird}" -H ~/wxsat/weather.txt -L "-26.17/-28.03/1700" -p0 -o "\$mapdate" ~/wxsat/noaa${bird}map.png
/usr/local/bin/wxmap -a -T "NOAA ${bird}" -H ~/wxsat/weather.txt -L "-26.17/-28.03/1700" -p0 -o "\$mapdate" ~/wxtoimg/maps/noaa${bird}map.png

and save the file.
Then you need update the predict program with your station coordinates.
Run the command sudo predict
Select the G to change your ground station position details.
and enter to get to next position. ESC to exit. ant then Q to exit.




Setup crontab to run the scrip at midnight
using the command sudo crontab -e
add the following at the bottom of the crontab file

1 0 * * * ~/sh/noaa_weather/noaa_scheduler.sh

You can run the script manually now to see if it works.
sudo ~/sh/noaa_weather/noaa_scheduler.sh
it should create schedules to run for the next 24 hours.
type the command sudo at -l witch should list the scheduled tasks
You should see something like this.
94 Thu Mar 23 02:13:00 2017 a root
95 Thu Mar 23 14:43:00 2017 a root
88 Thu Mar 23 05:30:00 2017 a root
92 Thu Mar 23 05:49:00 2017 a root
89 Thu Mar 23 17:53:00 2017 a root

There also should be at least 4 files in the ~/wxsat directory

noaa15.at
noaa18.at
noaa19.at
weather.txt

If you got here all went ok.
Connect the rtl dongle to your raspberry pi or Linux (ubuntu) computer.
Connect the coaxial cable to the Turnstile crossed dipole at wate for the first scheduled task as in the list above. sudo at -l

If you want to remove a previous task you can run the following command.
Make sure you always only have one task for the same time.
sudo atrm [task number]   EG sudo atrm 94

Go and look in the ~/wxsat/images  directory and your satellite images should be there for the day.
cd ~/wxsat/images

Ok now we need to get your image exposed on the Apache2 web server.

You now will need the full path to your wxsat directory.
cd ~/wxsat
pwd
/home/anton/wxsat
So in my case the full path is /home/anton/wxsat
Create a link between the apache server and you images.
go to directory /var/www
cd /var/www
sudo ln -s /home/anton/wxsat ./wxsat

if you goto you webserver on raspberry or linux you should see your images.
Take your browser on the Raspberry or linux server and goto http://localhost/wxsat/images
You will see a directory with file names of all the satellite images.
If you cant see the images you might have to make a small change to your apache2.conf file.

make sure you have the following in you /etc/apache2/apache2.conf file
change or add this

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

Then restart Apache2
sudo systemctl restart apache2



Image file list

Ok So you want to see thumbnail images and the click on image to view full image the copy the file index.php from the git repository into your images directory.
cp ~/sh/noaa_weather/index.php ~/wxsat/images/

Ok check your image directory in your web browser again and it should now have index page with thumbnails. You can change the index.php content of this page to add your details.

http://localhost/wxsat/images

Thumbnail Image index page




Here is a Link to Automated NOAA weather satellite System In Bassonia South Africa.

My Satellite Antennas
Notes:
The following config files is used by default
(The wxtoimg and wxmap command line will look in both places for a config file)
  • /usr/local/etc/wxtoimg.cfg
  • ~.wxtoimgrc
Example of the config file.

#
# WXtoImg configuration file written by WXtoImg.
# "man wxtoimg" or wxtoimg.html for details.
# WXtoImg version 2.11.2 beta
#
#
Registration Name: WXtoImg Professional
Registration Email: Anton.janovsky@gmail.com
Registration Key: TRLQ-KGKH-7M7!-U96U-CBQ1
Signal Type: APT
Expert Mode: false
Status Info Size: 0
Large Pixmap Support: false
Prompt on Exit: true
Decode in Record: true
Scroll in Record: true
Direction: northbound
Sample Rate: 11025.00
#Resurs Sample Rate: 11025.0
#Meteor3 Sample Rate: 11025.0
#Meteor2 Sample Rate: 11025.0
#SICH1M Sample Rate: 11025.0
#SICH Sample Rate: 11025.0
#Okean Sample Rate: 11025.0
#NOAA Sample Rate: 11025.0
#Meteosat Sample Rate: 11025.0
#GOES Sample Rate: 11025.0
#GMS Sample Rate: 11025.0
#MTSAT Sample Rate: 11025.0
Set Sample Rate: false
Sharpen: 0.6
JPEG Quality: 90
AVI Codec: RGB
AVI Transparent: false
AVI Quality: 85
AVI Scale: 0.5000
Max Frames: 16
Frame Rate: 1.000
Image Format: JPEG
Anaglyph Image Format: png
Composite Image Format: png
Messages: normal
Resync: enabled
Noise Filter: 0
Noise Threshold: 44
Crop: disabled
Contrast: var
Illumination Compensation: none
Gamma: 1.40
Despeckle: 2.00
No Signal Fill: true
Audio Directory: /home/anton/wxtoimg/audio
Image Directory: /home/anton/wxtoimg/raw
Save Directory: /home/anton/wxtoimg/images
Map Directory: /home/anton/wxtoimg/maps
Thumbnail Directory: /home/anton/wxtoimg/thumbnails
Template for Audio: false
Filename Info: UTC YYYYMMDDHHMM
Temperature Units: C
Distance Units: km
Enhancement: HVCT
Auto Image Template: %s-%f-%e
Auto Image Enhancements: "-" "contrast -a" "contrast -b" "NO" "HVCT" "MSA" "MCIR"
Record Type: A
Record Name Format: %Y%m%d%H%M
BMPs for DA: false
Record Bits: 16
Record Level: 25
Record Delay: 60
Record Rate: 11025
Record Only Active: enabled
Record Elevation: 20
Record Above: 8
Record Disable Info: false
Record Add: -N
Record Device: 0
Record Modes: ARD
Recording Forces Location: false
Receiver Type: none
Receiver Port: /dev/ttyS0
Receiver Baud: 0
Rotor Type: none
Rotor Port: /dev/ttyS0
Rotor Baud: 0
Park Elevation: 90.0
Park Azimuth: 180.0
GPS Port: /dev/ttyS1
GPS Baud: 4800
GPS Use: false
GPS Set Clock: false
Pass List Hours: 168
Process Time: 300
Use Alternate Memory Model: false
Delete Audio After: 999
Delete Maps After: 999
Delete Raw Images After: 999
Delete Images After: 999
Flip Meteor 3: disabled
Map Build: enabled
Map Overlay: enabled
Map Population: 0
Map Antialias: true
Map Thick Lines: false
Map Land-Sea: enabled
Map Lakes: disabled
Map Rivers: disabled
Map Country Borders: enabled
Map State Borders: enabled
Map Ground Station: enabled
Map Grid: 10
Map Offset Northbound: 0
Map Offset Southbound: 0
Map Land Color: light-green
Map Lake Color: light-green
Map River Color: light-green
Map Country Border Color: yellow
Map State Border Color: yellow
Map Ground Station Color: yellow
Map City Color: orange
Map Grid Color: red
Ground Station: Johannesburg, South Africa
Latitude: -26.170
Longitude: 28.030
Altitude: 1700.0
NOAA\ 12 Is Active: false
NOAA\ 14 Is Active: false
NOAA\ 15 Is Active: true
NOAA\ 16 Is Active: false
NOAA\ 17 Is Active: false
NOAA\ 18 Is Active: true
NOAA\ 19 Is Active: true
Meteor\ 3-5 Is Active: false
Meteor\ 2-21 Is Active: false
Resurs\ O1-N4 Is Active: false
Okean-O Is Active: false
SICH-1 Is Active: false
SICH1M Is Active: false
GOES Is Active: false
GMS Is Active: false
MTSAT Is Active: false
Meteosat Is Active: false
NOAA\ 12 Frequency: 137.5000
NOAA\ 14 Frequency: 137.6200
NOAA\ 15 Frequency: 137.6200
NOAA\ 16 Frequency: 137.6200
NOAA\ 17 Frequency: 137.5000
NOAA\ 18 Frequency: 137.9125
NOAA\ 19 Frequency: 137.1000
Meteor\ 3-5 Frequency: 137.3000
Meteor\ 2-21 Frequency: 137.4000
Resurs\ O1-N4 Frequency: 137.8500
Okean-O Frequency: 137.4000
SICH-1 Frequency: 137.3800
SICH1M Frequency: 137.4000
GOES Frequency: 137.5000
GMS Frequency: 137.5000
MTSAT Frequency: 137.5000
Meteosat Frequency: 137.5000
NOAA\ 12 Priority: 1
NOAA\ 14 Priority: 1
NOAA\ 15 Priority: 1
NOAA\ 16 Priority: 1
NOAA\ 17 Priority: 1
NOAA\ 18 Priority: 1
NOAA\ 19 Priority: 1
Meteor\ 3-5 Priority: 2
Meteor\ 2-21 Priority: 1
Resurs\ O1-N4 Priority: 1
Okean-O Priority: 1
SICH-1 Priority: 1
SICH1M Priority: 1
GOES Priority: 5
GMS Priority: 5
MTSAT Priority: 5
Meteosat Priority: 5
NOAA 19 Catalogue Number: 33591
Auto-Decode: true
Alt Sensor: 0
MSA 1: 50
MSA 2: 50
MSA 3: 0
Atmospheric Compensation: false
Auto Save Options: true
Save Temperature Data: false
Check for New Version: true
Update Sat Info: true
Auto Record: false
Auto Update Keplers: false
Last Kepler Update: 0
Geometry: 1301x715+65+24
Pass List Geometry: 843x618+483+131
Help Geometry: 783x512+510+117
Own Colormap: true
Use UTC: true
Tearoff Menus: false
Image Set Background: false
Maximum Thumbnails: 25
Log Messages: false
Help Language: EN
Help Font Size: +0
Date Format: %Y-%m-%d %H:%M
Date Format with Seconds: %Y-%m-%d %H:%M:%S
Show All: false
Text Mode 1: 0
Text Mode 2: 0
Text String 1:
Text String 2:
Text Size 1: 26
Text Size 2: 18
Text on Movies: true
Text on Composites: false
Temp Scale: false
Temp Black: false
Projection: -
Projection Reference Latitude:
Projection Reference Longitude:
Projection Bound North:
Projection Bound South:
Projection Bound West:
Projection Bound East:
Projection Resampling: bicubic
Projection Scale: 1.000
Projection Min Fill: 0.1
Movie Projection Reference Latitude:
Movie Projection Reference Longitude:
Movie Projection Bound North:
Movie Projection Bound South:
Movie Projection Bound West:
Movie Projection Bound East:
Movie Projection Scale: 1.000
Auto Movie Template: %g-%e
Auto Movie Enhancements: "contrast -b" "MCIR"
Composite Projection Reference Latitude:
Composite Projection Reference Longitude:
Composite Projection Bound North:
Composite Projection Bound South:
Composite Projection Bound West:
Composite Projection Bound East:
Composite Projection Scale: 0.750
Auto Composite Template: %g-%@%Y%m%d-%p-%e
Auto Composite Enhancements: "MSA" "MCIR" "HVCT"
Composite Min Solar Elevation: 0.0
Web Page Template: /usr/local/lib/wx/template1.html
Web Page Enhancement: MSA,MCIR,veg,Pristine
Web Composite Enhancement:
Web Page Thumbnail Size: 20.0
Web Page Filename: index.html
Web Page FTP Publish: false
Web Page FTP Passive: true
Web Page FTP Host: myisp.someplace.net
Web Page FTP User:
Web Page FTP Passphrase:
Web Page FTP Directory: wxtoimg
Web Page Folder Publish: true
Web Page Folder: /home/anton/wxtoimg/web
Web Page Add All: false
Minimum Solar Elevation: 0.0
Exclude from Composites:
Exclude from Web:
Minimum Scan Lines: 0
Use MCIR if MSA fails: false
Kepler Host: www.celestrak.com
Kepler Login:
Kepler Passphrase:
Use Proxy: false
Proxy Host:
Proxy Port: 8080



ref:

1 comment: