It was a few years ago that I configured my Windows desktop to download NOAA weather maps for testing purposes. I used an antenna (DIY'd) in the attic and an RG6 cable to the office PC. It worked but was a bit kludgy.
This experiment and radio can be used to receive wireless information from a variety of wireless sensors for use with Homeseer. I will post a DIY on how to do this. There is a plugin using LUA for the Domoticz open source automation program that already does this. You can read wireless electric meters, water meters et al. (Temperature sensors et al)
Someone wrote a DIY in 6 steps to configure a RPI to do this.
Tweaking base here using Apache2 and PHP to post sound files and images on the Wheezy website. Someone is doing this in South Africa.
Note the endeavor is being done via bash scripts / command line utilities. Last time I tried this used Windows SDR utilities.
Here my current RPi2 in the attic is running Wheezy and functions as a ZNet like device, one wire hub and test Domotiz server. I added the NOAA download map functions to it over the last few days.
Here is a list of Hardware pieces necessary.
Total guesstimate Price = $100.00
OPTIONAL
Note here with my testing using the current RPi2 running Wheezy in the attic via a POE connection. It is doing other stuff today:
1 - ZNet like ethernet connected ZWave device
2 - One-Wire combo temperature and humidity hub for 2nd floor and attic space readings using Digitemp and OWFS.
3 - testing Domoticz open source automation program
4 - and now a NOAA SDR radio satellite mapping capture device.
Future testing may connect another SDR radio (have a spare) to do custom rf remote sensor captures as this is today a plugin for Domoticz already being tested and written in LUA or Python. What I am writing about is that you do not need to purchase another RPi if you already have one available for use.
[ATTACH]65521[/ATTACH]
Step 1: Prepare the Raspberry Pi
he first step is getting the Raspberry Pi up and running. I’m using Wheezy
There are plenty of tutorials on getting Raspbian set up and booting on the Raspberry Pi. You should have no difficulty in finding one.
Once you have the Raspbian image copied to your micro SD card, boot the Raspberry Pi. You'll need to get it on the network and enable SSH. You can certainly use either a wired Ethernet connection, or wireless. I'm using wireless, as I don't have a wired connection in my attic.
Enable SSH using the Raspberry Pi Configuration utility in the Preferences menu. You may want to set it to boot to CLI while you are in there. Since this is going to be a headless setup, there is no need to waste resources on a GUI.
Next we want to make sure the Raspberry Pi is fully up-to-date. Issue the following commands:
sudo apt-get update
sudo apt-get upgrade
sudo reboot
Step 2: Install the Necessary Software
The first thing we need is the USB drivers for the RTL dongle:
sudo apt-get install libusb-1.0
Since we need to build the latest version of rtl-sdr to actually make use of the RTL dongle, we'll need to install cmake:
sudo apt-get install cmake
We need to make sure the Raspberry Pi doesn't load any SDR kernel modules that will interfere with the rtl-sdr sofware.
Using your favorite text editor, create a new file named /etc/modprobe.d/no-rtl.conf and put the following text in the file. You need to run that text editor as sudo (i.e. 'sudo vi' or 'sudo nano' etc) to write to the modprobe.d directory:
blacklist dvb_usb_rtl28xxu
blacklist rtl2832
blacklist rtl2830
Install the most recent build of rtl-sdr:
cd ~
git clone hxxps://github.com/keenerd/rtl-sdr.git
cd rtl-sdr/
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo ldconfig
cd ~
sudo cp ./rtl-sdr/rtl-sdr.rules /etc/udev/rules.d/
sudo reboot
The sox audio toolkit is needed in order to manipulate the received audio stream:
sudo apt-get install sox
We need a way to schedule the captures to happen as the satellites pass overhead. Install the at scheduler:
sudo apt-get install at
We need a way to know when the satellites will pass overhead. We'll use an application called predict:
sudo apt-get install predict
Finally, we'll need wxtoimg to convert the captured audio stream to an actual image:
cd ~
wget hxxp://www.wxtoimg.com/beta/wxtoimg-armhf-2.11.2-beta.deb
sudo dpkg -i wxtoimg-armhf-2.11.2-beta.deb
Step 3: Testing Things Out
Once all the software is installed, make sure your USB dongle is connected and run the following command:
sudo rtl_test
You should see the following output:
CS-ZNet ~ $ sudo rtl_test
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001
Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
Sampling at 2048000 S/s.
Info: This tool will continuously read from the device, and report if
samples get lost. If you observe no further output, everything is fine.
Reading samples in async mode...
Next you want to check the PPM which is the frequency lock. Write this number as we will need it in one or the three scripts.
ICS-ZNet ~ $ rtl_test -p
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001
Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
Sampling at 2048000 S/s.
Reporting PPM error measurement every 10 seconds...
Press ^C after a few minutes.
Reading samples in async mode...
real sample rate: 2047936 current PPM: -31 cumulative PPM: -31
real sample rate: 2048011 current PPM: 6 cumulative PPM: -12
real sample rate: 2048009 current PPM: 5 cumulative PPM: -6
real sample rate: 2047989 current PPM: -5 cumulative PPM: -6
real sample rate: 2047979 current PPM: -10 cumulative PPM: -7
real sample rate: 2048000 current PPM: 0 cumulative PPM: -6
real sample rate: 2048012 current PPM: 6 cumulative PPM: -4
real sample rate: 2048012 current PPM: 6 cumulative PPM: -3
real sample rate: 2047969 current PPM: -15 cumulative PPM: -4
real sample rate: 2048012 current PPM: 6 cumulative PPM: -3
real sample rate: 2047981 current PPM: -9 cumulative PPM: -3
real sample rate: 2048016 current PPM: 8 cumulative PPM: -3
real sample rate: 2047988 current PPM: -5 cumulative PPM: -3
real sample rate: 2048002 current PPM: 1 cumulative PPM: -2
real sample rate: 2048004 current PPM: 2 cumulative PPM: -2
real sample rate: 2048001 current PPM: 1 cumulative PPM: -2
real sample rate: 2047986 current PPM: -7 cumulative PPM: -2
real sample rate: 2048016 current PPM: 8 cumulative PPM: -2
^CSignal caught, exiting!
-2 seems like a good number and I used -1 for the P variable in a coming described script.
If you receive any error messages, you'll need to troubleshoot them before continuing. If your RTL Dongle isn't working at this point, it won't do any good to continue.
You need to run predict one time to set your ground station location. To do that you'll need your latitude and longitude. You can get your latitude and longitude from google maps by searching for your address, the right clicking on the pointer and selecting "What's Here". One thing to note is that Google displays North as positive and East as positive numbers. Predict uses North as positive but WEST as positive. Make sure to adjust accordingly, or your predictions will be no good.
Run predict from the command line, and select option 'G'. Enter your ground station information and exit the program.:
predict
G should come up first which is your ground station information:
Note here that you DO NOT USE a negative value for your Station Longitude if you station is in the Midwest.
You need to run wxtoimg once to accept the terms and conditions.
wxtoimg
You need to tell wxtoimg where your base station is at, so it can properly generate an overlay map. You do so by creating a file in your home directory named ~/.wxtoimgrc. In this file, North is positive, as with predict, however EAST is positive, which is the opposite of what predict uses. Make sure to adjust your values appropriately.
Using your favorite text editor, create a new file named ~/.wxtoimgrc and put the following text in the file, substituting your values:
Latitude: 41.7169
Longitude: -72.7271
Altitude: 25
NOTE here you utilize a negative number for Longitude if you are in the midwest.
Step 4: The Scripts
Now that you've got a working RTL dongle on your Raspberry Pi, it's time to actually make it receive some weather maps. Make sure your antenna is connected and located as best as possible. I've got mine mounted in my attic and it works fairly well from there. If you can mount it outside, that would be even better. Get it as high as possible.
We are going to need to create a few scripts to automate everything. This is where that Linux familiarity is going to come in.
First we'll create a couple directories to hold our files:
cd ~
mkdir weather
cd weather
mkdir predict
cd predict
Next we'll make the two scripts that kick off the scheduling. The first is 'schedule_all.sh'. This script will be called nightly at midnight. It downloads satellite pass information from celestrak and creates a TLE file for predict to use. Then it removes all AT jobs from the system, so no passes get double scheduled. Finally, it calls the second script 'schedule_satellite.sh' for each satellite we are interested in.
Using your favorite text editor, create a new file in ~/weather/predict named schedule_all.sh and put the following code in the file:
Note here the we get hxxps did not work and changed it to hxxp.
The second script, 'schedule_satellite.sh', recurses through each pass of the given satellite for the current day. It determines if the maximum elevation is 20 degrees or greater. If it is, then it calculates the length of the pass, and schedules the recording and processing of the pass. If the maximum elevation is less than 20 degrees, the pass is ignored, as it generally won't produce a decent image.
Using your favorite text editor, create a new file in ~/weather/predict named schedule_satellite.sh and put the following code in the file:
When the time comes for a give pass to be recorded and processed, at kicks off the final script 'receive_and_process_satellite.sh'. When this script is called, it uses rtl_fm to receive the audio from the satellite pass, and sends that audio to sox for processing. Sox saves the audio to a file. Once the pass is complete, wxmap is called to generate an overlay map for the image. Finally, wxtoimg is called to generate the actual image and place the overlay map on it.
Using your favorite text editor, create a new file in ~/weather/predict named receive_and_process_satellite.sh and put the following code in the file:
Here made a couple of changes to the above script.
sudo timeout $6 rtl_fm -f ${2}M -s 60k -g 45 -p 55 -E wav -E deemp -F 9 - | sox -t wav - $3.wav rate 11025
playing with the -g value which is gain and the -p value that I got from testing above and have used -p 0 or -p 1
Added more pictures adding the following stuff:
changing this section:
to this:
Type wxtoimg --help
-e <enh> enhancement option (histeq, MSA, MCIR, HVCT, sea, ZA, ...)
ZA = NOAA general purpose meteorological IR enhancement option. Increases contrast by saturating the very low and very high temperature regions where there is typically very little information. This enhancement option is temperature normalised.
NO = NOAA colour IR contrast enhancement option. Greatly increases contrast in the darker land/sea regions and colours the cold cloud tops. Allows fine detail in land and sea to be seen and provides a very readable indication of cloud top temperatures. This enhancement option is temperature normalised.
MCIR = Colours the NOAA sensor 4 IR image using a map to colour the sea blue and land green. High clouds appear white, lower clouds gray or land/sea coloured, clouds generally appear lighter ,but distinguishing between land/sea and low cloud may be difficult. Darker colours indicate warmer regions.
MSA = Multispectral analysis. Uses a NOAA channel 2-4 image and determines which regions are most likely to be cloud, land, or sea based on an analysis of the two images. Produces a vivid false-coloured image as a result. This enhancement takes up to three options separated from the enhancement name by colons. The first option is the sea to land adjustment. The default value is 50 with the valid range being 0 to 100. This should be decreased if land appears blue, and increased if water appears green. The second option is the land to cloud adjustment. The
default value is 50 with the valid range being 0 to 100. This should be decreased if cloud appears green and increased if land appears gray or white. The final option should be 0 to indicate warm or summertime analysis or 1 to indicate there are large cold regions. Note that perfect colouring is difficult to obtain, especially with low illumination angles. This enhancement does not use a palette nor is it temperature normalised.
Once all three scripts have been created, we need to make the executable, by issuing the following commands:
chmod +x schedule_all.sh
chmod +x schedule_satellite.sh
chmod +x receive_and_process_satellite.sh
Now, the last step in automating the reception is to schedule the first script to run just after midnight. Run the following command:
crontab -e
It will open a text editor of your choice to edit the cron file. Simply add the following line to the bottom of this file and save:
1 0 * * * /home/pi/weather/predict/schedule_all.sh
Now, at 00:01 the schedule will start. (if you don't want to wait, simply run the following command once to kick the process off
/home/pi/weather/predict/schedule_all.sh
Step 5: Check Things Out
To see upcoming satellite passes that are scheduled to be processed, run the following command:
atq
Check the ~/weather directory for your results. Each pass will generate three files:
NOAA1820170105-181147-map.png <-- Map overlay file
NOAA1820170105-181147.png <-- The final image file
NOAA1820170105-181147.wav <-- The raw audio file
The format of the file name is the satellite name, followed by the date (YYYYMMDD) and time (HHMMSS) of the start of the pass. There are several filters that wxtoimg can use when generating the image file. I've had different luck with different satellites and passes on each filter. Feel free to play around with wxtoimg on the original map and audio files and see what you come up with.
One thing to note, the receiver can only receive one satellite at a time. If two satellites are passing overhead at the same time, the first one to start recording will "win" and be recorded. The second recording will error out and stop.
Here is a first attempt. Need to adjust antenna and wave file conversion. Basically it works like a fax reception. The application takes the wave file and converts it to a picture.
[ATTACH]65522[/ATTACH]
The math involved in antenna length of 53.4 CM
L(m) = 147 / F(MHz)
L(m) = 147 / 137.5
L = 1.068 m = 106.8cm
Each leg = 53.4 cm
This experiment and radio can be used to receive wireless information from a variety of wireless sensors for use with Homeseer. I will post a DIY on how to do this. There is a plugin using LUA for the Domoticz open source automation program that already does this. You can read wireless electric meters, water meters et al. (Temperature sensors et al)
Someone wrote a DIY in 6 steps to configure a RPI to do this.
Tweaking base here using Apache2 and PHP to post sound files and images on the Wheezy website. Someone is doing this in South Africa.
Note the endeavor is being done via bash scripts / command line utilities. Last time I tried this used Windows SDR utilities.
Here my current RPi2 in the attic is running Wheezy and functions as a ZNet like device, one wire hub and test Domotiz server. I added the NOAA download map functions to it over the last few days.
Here is a list of Hardware pieces necessary.
- Raspberry Pi 3 Model B or Raspberry Pi 2 $35.00 USD (Amazon)
- MicroUSB Power Supply (option 1) $5.00 USD
- POE power splitter $15.00 USD
- Generic Raspberry Pi 3 Case $10.00 USD
- 16 or 32 GB Micro SD Card $10.00 USD
- NooElec SDR Dongle (part of Ebay or Amazon Kit) $26.00
- V-Dipole Antenna (part of Ebay or Amazon Kit)
Total guesstimate Price = $100.00
OPTIONAL
- DIY'd Quadrifilar Helix (QFH) Antenna PVC = $10.00
- Amplifier ~ $10.00 on Amazon
- FM Filter ~ $16.00 on Amazon
- SMA connectors - F-Type to SMA, SMA couplers
Note here with my testing using the current RPi2 running Wheezy in the attic via a POE connection. It is doing other stuff today:
1 - ZNet like ethernet connected ZWave device
2 - One-Wire combo temperature and humidity hub for 2nd floor and attic space readings using Digitemp and OWFS.
3 - testing Domoticz open source automation program
4 - and now a NOAA SDR radio satellite mapping capture device.
Future testing may connect another SDR radio (have a spare) to do custom rf remote sensor captures as this is today a plugin for Domoticz already being tested and written in LUA or Python. What I am writing about is that you do not need to purchase another RPi if you already have one available for use.
[ATTACH]65521[/ATTACH]
Step 1: Prepare the Raspberry Pi
he first step is getting the Raspberry Pi up and running. I’m using Wheezy
There are plenty of tutorials on getting Raspbian set up and booting on the Raspberry Pi. You should have no difficulty in finding one.
Once you have the Raspbian image copied to your micro SD card, boot the Raspberry Pi. You'll need to get it on the network and enable SSH. You can certainly use either a wired Ethernet connection, or wireless. I'm using wireless, as I don't have a wired connection in my attic.
Enable SSH using the Raspberry Pi Configuration utility in the Preferences menu. You may want to set it to boot to CLI while you are in there. Since this is going to be a headless setup, there is no need to waste resources on a GUI.
Next we want to make sure the Raspberry Pi is fully up-to-date. Issue the following commands:
sudo apt-get update
sudo apt-get upgrade
sudo reboot
Step 2: Install the Necessary Software
The first thing we need is the USB drivers for the RTL dongle:
sudo apt-get install libusb-1.0
Since we need to build the latest version of rtl-sdr to actually make use of the RTL dongle, we'll need to install cmake:
sudo apt-get install cmake
We need to make sure the Raspberry Pi doesn't load any SDR kernel modules that will interfere with the rtl-sdr sofware.
Using your favorite text editor, create a new file named /etc/modprobe.d/no-rtl.conf and put the following text in the file. You need to run that text editor as sudo (i.e. 'sudo vi' or 'sudo nano' etc) to write to the modprobe.d directory:
blacklist dvb_usb_rtl28xxu
blacklist rtl2832
blacklist rtl2830
Install the most recent build of rtl-sdr:
cd ~
git clone hxxps://github.com/keenerd/rtl-sdr.git
cd rtl-sdr/
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo ldconfig
cd ~
sudo cp ./rtl-sdr/rtl-sdr.rules /etc/udev/rules.d/
sudo reboot
The sox audio toolkit is needed in order to manipulate the received audio stream:
sudo apt-get install sox
We need a way to schedule the captures to happen as the satellites pass overhead. Install the at scheduler:
sudo apt-get install at
We need a way to know when the satellites will pass overhead. We'll use an application called predict:
sudo apt-get install predict
Finally, we'll need wxtoimg to convert the captured audio stream to an actual image:
cd ~
wget hxxp://www.wxtoimg.com/beta/wxtoimg-armhf-2.11.2-beta.deb
sudo dpkg -i wxtoimg-armhf-2.11.2-beta.deb
Step 3: Testing Things Out
Once all the software is installed, make sure your USB dongle is connected and run the following command:
sudo rtl_test
You should see the following output:
CS-ZNet ~ $ sudo rtl_test
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001
Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
Sampling at 2048000 S/s.
Info: This tool will continuously read from the device, and report if
samples get lost. If you observe no further output, everything is fine.
Reading samples in async mode...
Next you want to check the PPM which is the frequency lock. Write this number as we will need it in one or the three scripts.
ICS-ZNet ~ $ rtl_test -p
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001
Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
Sampling at 2048000 S/s.
Reporting PPM error measurement every 10 seconds...
Press ^C after a few minutes.
Reading samples in async mode...
real sample rate: 2047936 current PPM: -31 cumulative PPM: -31
real sample rate: 2048011 current PPM: 6 cumulative PPM: -12
real sample rate: 2048009 current PPM: 5 cumulative PPM: -6
real sample rate: 2047989 current PPM: -5 cumulative PPM: -6
real sample rate: 2047979 current PPM: -10 cumulative PPM: -7
real sample rate: 2048000 current PPM: 0 cumulative PPM: -6
real sample rate: 2048012 current PPM: 6 cumulative PPM: -4
real sample rate: 2048012 current PPM: 6 cumulative PPM: -3
real sample rate: 2047969 current PPM: -15 cumulative PPM: -4
real sample rate: 2048012 current PPM: 6 cumulative PPM: -3
real sample rate: 2047981 current PPM: -9 cumulative PPM: -3
real sample rate: 2048016 current PPM: 8 cumulative PPM: -3
real sample rate: 2047988 current PPM: -5 cumulative PPM: -3
real sample rate: 2048002 current PPM: 1 cumulative PPM: -2
real sample rate: 2048004 current PPM: 2 cumulative PPM: -2
real sample rate: 2048001 current PPM: 1 cumulative PPM: -2
real sample rate: 2047986 current PPM: -7 cumulative PPM: -2
real sample rate: 2048016 current PPM: 8 cumulative PPM: -2
^CSignal caught, exiting!
-2 seems like a good number and I used -1 for the P variable in a coming described script.
If you receive any error messages, you'll need to troubleshoot them before continuing. If your RTL Dongle isn't working at this point, it won't do any good to continue.
You need to run predict one time to set your ground station location. To do that you'll need your latitude and longitude. You can get your latitude and longitude from google maps by searching for your address, the right clicking on the pointer and selecting "What's Here". One thing to note is that Google displays North as positive and East as positive numbers. Predict uses North as positive but WEST as positive. Make sure to adjust accordingly, or your predictions will be no good.
Run predict from the command line, and select option 'G'. Enter your ground station information and exit the program.:
predict
Code:
--== PREDICT v2.2.3 ==-- Released by John A. Magliacane, KD2BD May 2006 --==[ Main Menu ]==-- [P]: Predict Satellite Passes [I]: Program Information [V]: Predict Visible Passes [G]: Edit Ground Station Information [S]: Solar Illumination Predictions [D]: Display Satellite Orbital Data [L]: Lunar Predictions [U]: Update Sat Elements From File [O]: Solar Predictions [E]: Manually Edit Orbital Elements [T]: Single Satellite Tracking Mode [B]: Edit Transponder Database [M]: Multi-Satellite Tracking Mode [Q]: Exit PREDICT
Code:
Ground Station Location Editing Utility * Station Callsign : W1AW Station Latitude : 41.7169 [DegN] Station Longitude : 72.7271 [DegW] Station Altitude : 25 [m] Enter the callsign or identifier of your ground station
You need to run wxtoimg once to accept the terms and conditions.
wxtoimg
You need to tell wxtoimg where your base station is at, so it can properly generate an overlay map. You do so by creating a file in your home directory named ~/.wxtoimgrc. In this file, North is positive, as with predict, however EAST is positive, which is the opposite of what predict uses. Make sure to adjust your values appropriately.
Using your favorite text editor, create a new file named ~/.wxtoimgrc and put the following text in the file, substituting your values:
Latitude: 41.7169
Longitude: -72.7271
Altitude: 25
NOTE here you utilize a negative number for Longitude if you are in the midwest.
Step 4: The Scripts
Now that you've got a working RTL dongle on your Raspberry Pi, it's time to actually make it receive some weather maps. Make sure your antenna is connected and located as best as possible. I've got mine mounted in my attic and it works fairly well from there. If you can mount it outside, that would be even better. Get it as high as possible.
We are going to need to create a few scripts to automate everything. This is where that Linux familiarity is going to come in.
First we'll create a couple directories to hold our files:
cd ~
mkdir weather
cd weather
mkdir predict
cd predict
Next we'll make the two scripts that kick off the scheduling. The first is 'schedule_all.sh'. This script will be called nightly at midnight. It downloads satellite pass information from celestrak and creates a TLE file for predict to use. Then it removes all AT jobs from the system, so no passes get double scheduled. Finally, it calls the second script 'schedule_satellite.sh' for each satellite we are interested in.
Using your favorite text editor, create a new file in ~/weather/predict named schedule_all.sh and put the following code in the file:
Note here the we get hxxps did not work and changed it to hxxp.
Code:
#!/bin/bash # Update Satellite Information [B]wget -qr http://www.celestrak.com/NORAD/elements/weather.txt -O /home/pi/weather/predict/weather.txt[/B] grep "NOAA 15" /home/pi/weather/predict/weather.txt -A 2 > /home/pi/weather/predict/weather.tle grep "NOAA 18" /home/pi/weather/predict/weather.txt -A 2 >> /home/pi/weather/predict/weather.tle grep "NOAA 19" /home/pi/weather/predict/weather.txt -A 2 >> /home/pi/weather/predict/weather.tle grep "METEOR-M 2" /home/pi/weather/predict/weather.txt -A 2 >> /home/pi/weather/predict/weather.tle #Remove all AT jobs for i in `atq | awk '{print $1}'`;do atrm $i;done #Schedule Satellite Passes: /home/pi/weather/predict/schedule_satellite.sh "NOAA 19" 137.1000 /home/pi/weather/predict/schedule_satellite.sh "NOAA 18" 137.9125 /home/pi/weather/predict/schedule_satellite.sh "NOAA 15" 137.6200
Using your favorite text editor, create a new file in ~/weather/predict named schedule_satellite.sh and put the following code in the file:
Code:
#!/bin/bash PREDICTION_START=`/usr/bin/predict -t /home/pi/weather/predict/weather.tle -p "${1}" | head -1` PREDICTION_END=`/usr/bin/predict -t /home/pi/weather/predict/weather.tle -p "${1}" | tail -1` var2=`echo $PREDICTION_END | cut -d " " -f 1` MAXELEV=`/usr/bin/predict -t /home/pi/weather/predict/weather.tle -p "${1}" | awk -v max=0 '{if($5>max){max=$5}}END{print max}'` while [ `date --date="TZ=\"UTC\" @${var2}" +%D` == `date +%D` ]; do START_TIME=`echo $PREDICTION_START | cut -d " " -f 3-4` var1=`echo $PREDICTION_START | cut -d " " -f 1` var3=`echo $START_TIME | cut -d " " -f 2 | cut -d ":" -f 3` TIMER=`expr $var2 - $var1 + $var3` OUTDATE=`date --date="TZ=\"UTC\" $START_TIME" +%Y%m%d-%H%M%S` if [ $MAXELEV -gt 19 ] then echo ${1//" "}${OUTDATE} $MAXELEV echo "/home/pi/weather/predict/receive_and_process_satellite.sh \"${1}\" $2 /home/pi/weather/${1//" "}${OUTDATE} /home/pi/weather/predict/weather.tle $var1 $TIMER" | at `date --date="TZ=\"UTC\" $START_TIME" +"%H:%M %D"` fi nextpredict=`expr $var2 + 60` PREDICTION_START=`/usr/bin/predict -t /home/pi/weather/predict/weather.tle -p "${1}" $nextpredict | head -1` PREDICTION_END=`/usr/bin/predict -t /home/pi/weather/predict/weather.tle -p "${1}" $nextpredict | tail -1` MAXELEV=`/usr/bin/predict -t /home/pi/weather/predict/weather.tle -p "${1}" $nextpredict | awk -v max=0 '{if($5>max){max=$5}}END{print max}'` var2=`echo $PREDICTION_END | cut -d " " -f 1` done
Using your favorite text editor, create a new file in ~/weather/predict named receive_and_process_satellite.sh and put the following code in the file:
Code:
#!/bin/bash # $1 = Satellite Name # $2 = Frequency # $3 = FileName base # $4 = TLE File # $5 = EPOC start time # $6 = Time to capture sudo timeout $6 rtl_fm -f ${2}M -s 60k -g 45 -p 55 -E wav -E deemp -F 9 - | sox -t wav - $3.wav rate 11025 PassStart=`expr $5 + 90` if [ -e $3.wav ] then /usr/local/bin/wxmap -T "${1}" -H $4 -p 0 -l 0 -o $PassStart ${3}-map.png /usr/local/bin/wxtoimg -m ${3}-map.png -e ZA $3.wav $3.png fi
sudo timeout $6 rtl_fm -f ${2}M -s 60k -g 45 -p 55 -E wav -E deemp -F 9 - | sox -t wav - $3.wav rate 11025
playing with the -g value which is gain and the -p value that I got from testing above and have used -p 0 or -p 1
Added more pictures adding the following stuff:
changing this section:
Code:
if [ -e $3.wav ] then /usr/local/bin/wxmap -T "${1}" -H $4 -p 0 -l 0 -o $PassStart ${3}-map.png /usr/local/bin/wxtoimg -m ${3}-map.png -e ZA $3.wav $3.png fi
Code:
if [ -e $3.wav ] then /usr/local/bin/wxmap -T "${1}" -H $4 -p 0 -l 0 -o $PassStart ${3}-map.png /usr/local/bin/wxtoimg -m ${3}-map.png -e ZA $3.wav $3.png /usr/local/bin/wxtoimg -m ${3}-map.png -e NO $3.wav ${3}.NO.png /usr/local/bin/wxtoimg -m ${3}-map.png -e MCIR $3.wav ${3}.MCIR.png /usr/local/bin/wxtoimg -m ${3}-map.png -e MSA $3.wav ${3}.MSA.png fi
-e <enh> enhancement option (histeq, MSA, MCIR, HVCT, sea, ZA, ...)
ZA = NOAA general purpose meteorological IR enhancement option. Increases contrast by saturating the very low and very high temperature regions where there is typically very little information. This enhancement option is temperature normalised.
NO = NOAA colour IR contrast enhancement option. Greatly increases contrast in the darker land/sea regions and colours the cold cloud tops. Allows fine detail in land and sea to be seen and provides a very readable indication of cloud top temperatures. This enhancement option is temperature normalised.
MCIR = Colours the NOAA sensor 4 IR image using a map to colour the sea blue and land green. High clouds appear white, lower clouds gray or land/sea coloured, clouds generally appear lighter ,but distinguishing between land/sea and low cloud may be difficult. Darker colours indicate warmer regions.
MSA = Multispectral analysis. Uses a NOAA channel 2-4 image and determines which regions are most likely to be cloud, land, or sea based on an analysis of the two images. Produces a vivid false-coloured image as a result. This enhancement takes up to three options separated from the enhancement name by colons. The first option is the sea to land adjustment. The default value is 50 with the valid range being 0 to 100. This should be decreased if land appears blue, and increased if water appears green. The second option is the land to cloud adjustment. The
default value is 50 with the valid range being 0 to 100. This should be decreased if cloud appears green and increased if land appears gray or white. The final option should be 0 to indicate warm or summertime analysis or 1 to indicate there are large cold regions. Note that perfect colouring is difficult to obtain, especially with low illumination angles. This enhancement does not use a palette nor is it temperature normalised.
Once all three scripts have been created, we need to make the executable, by issuing the following commands:
chmod +x schedule_all.sh
chmod +x schedule_satellite.sh
chmod +x receive_and_process_satellite.sh
Now, the last step in automating the reception is to schedule the first script to run just after midnight. Run the following command:
crontab -e
It will open a text editor of your choice to edit the cron file. Simply add the following line to the bottom of this file and save:
1 0 * * * /home/pi/weather/predict/schedule_all.sh
Now, at 00:01 the schedule will start. (if you don't want to wait, simply run the following command once to kick the process off
/home/pi/weather/predict/schedule_all.sh
Step 5: Check Things Out
To see upcoming satellite passes that are scheduled to be processed, run the following command:
atq
Check the ~/weather directory for your results. Each pass will generate three files:
NOAA1820170105-181147-map.png <-- Map overlay file
NOAA1820170105-181147.png <-- The final image file
NOAA1820170105-181147.wav <-- The raw audio file
The format of the file name is the satellite name, followed by the date (YYYYMMDD) and time (HHMMSS) of the start of the pass. There are several filters that wxtoimg can use when generating the image file. I've had different luck with different satellites and passes on each filter. Feel free to play around with wxtoimg on the original map and audio files and see what you come up with.
One thing to note, the receiver can only receive one satellite at a time. If two satellites are passing overhead at the same time, the first one to start recording will "win" and be recorded. The second recording will error out and stop.
Here is a first attempt. Need to adjust antenna and wave file conversion. Basically it works like a fax reception. The application takes the wave file and converts it to a picture.
[ATTACH]65522[/ATTACH]
The math involved in antenna length of 53.4 CM
L(m) = 147 / F(MHz)
L(m) = 147 / 137.5
L = 1.068 m = 106.8cm
Each leg = 53.4 cm
Comment