Raspberry Pi NOAA and Meteor-M 2 Receiver

Introduction: Raspberry Pi NOAA and Meteor-M 2 Receiver

This instructable will help you set up a receiving station for not just APT from NOAA-15, 18 and 19, but also Meteor-M 2.

It's really just a small follow-on project to haslettj's great "Raspberry Pi NOAA Weather Satellite Receiver" project.

Step 1: Start With Haslettj's Instructable

Before you follow haslettj's Instructable, note these changes first:

The old address for wxtoimg is no longer up. You can now use this address instead in the wget command:

https://www.wxtoimgrestored.xyz/beta/wxtoimg-linux-armhf-2.11.2-beta.tar.gz

I also had to make a change to the "receive_and_process_satellite.sh" script, because rtl_fm apparently does not actually output "wav" format audio. But it's no problem, sox can handle it. So I changed this line:

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

To this (but remember to replace the "-g 0" gain setting and "-p 68" PPM frequency error setting with something that works for your hardware):

sudo timeout $6 rtl_fm -f ${2}M -s 48k -g 0 -p 68 -E dc -A fast -F 9 - | sox -t raw -r 48000 -es -b16 -c1 -V1 - $3.wav rate 11025

In the same script, you may also want to change the wxtoimg argument "-e ZA" to "-e MSA" to get nice color images, like this:

/usr/local/bin/wxtoimg -m ${3}-map.png -e MSA $3.wav $3.png

Now go do the Instructable!

http://media.nbcmontana.com/id/Raspberry-Pi-NOAA...

Step 2: Install GnuRadio and Blocks for RTL-SDR

The Meteor-M 2 receiver uses GnuRadio. To install what you need, do this:

sudo apt install gnuradio

sudo apt install gr-osmosdr

Step 3: Download GnuRadio Scripts

If you're not familiar, GnuRadio includes a graphical tool called GnuRadio-Companion which can be used to build flow graphs and compile them into Python code which is then executed.

I have forked "otti-soft"s "meteor-m2-lrpt" receiver by modifying some of the parameters to improve performance and using RTL-SDR instead of Airspy. Download it from here:

https://github.com/NateDN10/meteor-m2-lrpt

The .grc files can be opened with GnuRadio-Companion, but they're not executable scripts - they're there for your reference and to play around with. To just get it working, copy the file "rtlsdr_m2_lrpt_rx.py" into your /home/pi/weather/predict directory, and make sure it's executable:

chmod +x rtlsdr_m2_lrpt_rx.py

You'll also want to change the frequency offset:

self.rtlsdr_source_0.set_freq_corr(69, 0)

And gain to whatever works for your setup:

self.rtlsdr_source_0.set_gain(4, 0)

Step 4: Download the Decoder

Download "artlav"s Meteor LRPT decoder from here - you want the Linux ARM version:

http://orbides.org/page.php?id=1023

You can accomplish this on the Raspberry Pi using these commands:

cd /home/pi/weather

wget https://orbides.org/etc/medet/medet_190825_arm.tar.gz
mkdir medet; cd medet
tar xvzf ../medet_190825_arm.tar.gz

You should now have a directory called "medet" within your "weather" directory, and inside it should be a "medet_arm" executable.

Step 5: Download Other Tools

To fix the aspect ratio of the images we're going to use dbdexter's "meteor_rectify" Python tool from Github.

If you don't already have git and ImageMagick installed:

sudo apt install git
sudo apt install imagemagick

Then clone the repository:

cd /home/pi/weather

git clone  https://github.com/dbdexter-dev/meteor_rectify.gi...

You may also need the "pillow" and "numpy" Python libraries:

pip3 install numpy

pip3 install pillow

Step 6: Update the Scripts

First, add the following line to the end of "schedule_all.sh":

/home/pi/weather/predict/schedule_satellite.sh "METEOR-M 2" 137.1000

Then, in "schedule_satellite.sh", change this block:

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

To this:

if [ $MAXELEV -gt 19 ]; then
    echo ${1//" "}${OUTDATE} $MAXELEV

    if [ "$1" == "METEOR-M 2" ]
      then
        echo "/home/pi/weather/predict/receive_and_process_meteor.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"`
      else
        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
fi

Finally, create a new script called "receive_and_process_meteor.sh" with the following contents:

#! /bin/bash
# $1 = Satellite Name
# $2 = Frequency
# $3 = FileName base
# $4 = TLE File
# $5 = EPOC start time
# $6 = Time to capture

cd /home/pi/weather

timeout $6 predict/rtlsdr_m2_lrpt_rx.py $1 $2 $3

# Winter
#medet/medet_arm ${3}.s $3 -r 68 -g 65 -b 64 -na -S

# Summer
medet/medet_arm ${3}.s $3 -r 66 -g 65 -b 64 -na -S

rm ${3}.s

if [ -f "${3}_0.bmp" ]; then
	#rm ${3}.s

	dte=`date +%H`

	# Winter
	#convert ${3}_1.bmp ${3}_1.bmp ${3}_0.bmp -combine -set colorspace sRGB ${3}.bmp
        #convert ${3}_2.bmp ${3}_2.bmp ${3}_2.bmp -combine -set colorspace sRGB -negate ${3}_ir.bmp

	# Summer
	convert ${3}_2.bmp ${3}_1.bmp ${3}_0.bmp -combine -set colorspace sRGB ${3}.bmp

	meteor_rectify/rectify.py ${3}.bmp

	# Winter only
	#meteor_rectify/rectify.py ${3}_ir.bmp

	# Rotate evening images 180 degrees
	if [ $dte -lt 13 ]; then
		convert ${3}-rectified.png -normalize -quality 90 $3.jpg

                # Winter only
		#convert ${3}_ir-rectified.png -normalize -quality 90 ${3}_ir.jpg
	else
		convert ${3}-rectified.png -rotate 180 -normalize -quality 90 $3.jpg
                # Winter only
                #convert ${3}_ir-rectified.png -rotate 180 -normalize -quality 90 ${3}_ir.jpg
	fi

	rm $3.bmp
	rm ${3}_0.bmp
	rm ${3}_1.bmp
	rm ${3}_2.bmp
	rm ${3}-rectified.png

	# Winter only
	#rm ${3}_ir.bmp
	#rm ${3}_ir-rectified.png
fi

Make it executable:

chmod +x receive_and_process_meteor.sh

And that's it! Next time your existing cron job runs to schedule satellites, Meteor-M 2 will be scheduled also. The decoder will output a .bmp using APID 66 for red, 65 for green, and 64 for blue.

The standard output from the scripts, when they're run by the scheduler, is appended to /var/mail/pi. To read it, use this command:

less /var/mail/pi

And to erase old messages, do this:

> /var/mail/pi

6 People Made This Project!

Recommendations

  • Anything Goes Contest

    Anything Goes Contest

58 Comments

0
damiconi
damiconi

2 months ago

Hi

is there update script for receive_and_process_meteor.sh? is there an update procedure for receiving Meteor M2?

Nico

1
WessexWeather
WessexWeather

4 months ago

Since the beginning of July 2022, a 'constellation mismatch' has prevented decoding of MeteorM2 using the methods in this Instructable. Apparently using PC software such as Orbitron, Meteorgis and SDR# is unaffected, and the developer of SDR++ has found a workaround.
This is beyond my level of expertise but I wonder whether Nate could help, or someone else with greater understanding of the problem?

Regards,

Simon, WessexWeather

1
ke8aff
ke8aff

1 year ago on Step 6

On the Meteor Side of things, where would one be able to specify a RTL-SDR Device Index in order to use a separate rtl-sdr device to decode Meteor M 2 ?

0
aaz.off
aaz.off

Reply 1 year ago

I have the same question

0
guidocioni
guidocioni

Reply 8 months ago

Took me some time to figure this out but u can pass the device ID when calling osmosdr.source, like this self.rtlsdr_source_0 = osmosdr.source(args="numchan=1 rtl=00000978")

0
MauriceD43
MauriceD43

Question 8 months ago on Step 6

Following the 6 step process to add Meteor M2 to my NOAA receiver. In Step 5 it asks for git clone of meteor_rectify.py When doing the git clone it asks for password. Where to I get that?

0
ocellaris
ocellaris

Question 2 years ago

Kudos for the great write-up. I'm close to having it working, but having some trouble with the receive_and_process_meteor.sh script. On line 10, the script successfully creates the .s file:

-rw-r--r-- 1 pi pi 139485184 Oct 25 10:06 METEOR-M220201025-095055.s

On line 13, the medet_arm command creates the following 3 files:

-rw-r--r-- 1 pi pi 2911286 Oct 25 10:10 METEOR-M220201025-095055_0.bmp
-rw-r--r-- 1 pi pi 2911286 Oct 25 10:10 METEOR-M220201025-095055_1.bmp
-rw-r--r-- 1 pi pi 2911286 Oct 25 10:10 METEOR-M220201025-095055_2.bmp

Line 20 is an if statement that checks for the existence of "${3}.bmp". In my case ${3} is "METEOR-M220201025-095055" so the if statement is checking for "METEOR-M220201025-095055.bmp" which does not exist. Therefore the argument to the if statement is false. Is this a script error? Should the if statement be checking for one of the files that was generated?

Next I tried manually converting the generated .bmp files using commands from the script, but receive the following errors:

pi@satellite:~/weather/data/tmp$ convert METEOR-M220201025-095055_1.bmp METEOR-M220201025-095055_1.bmp METEOR-M220201025-095055_0.bmp -combine -set colorspace sRGB METEOR-M220201025-095055.bmp
convert-im6.q16: length and filesize do not match `METEOR-M220201025-095055_1.bmp' @ warning/bmp.c/ReadBMPImage/839.
convert-im6.q16: length and filesize do not match `METEOR-M220201025-095055_0.bmp' @ warning/bmp.c/ReadBMPImage/839.

pi@satellite:~/weather/data/tmp$ convert METEOR-M220201025-095055_0.bmp METEOR-M220201025-095055_1.bmp METEOR-M220201025-095055_2.bmp -combine -set colorspace sRGB METEOR-M220201025-095055.bmp
convert-im6.q16: length and filesize do not match `METEOR-M220201025-095055_0.bmp' @ warning/bmp.c/ReadBMPImage/839.
convert-im6.q16: length and filesize do not match `METEOR-M220201025-095055_1.bmp' @ warning/bmp.c/ReadBMPImage/839.
convert-im6.q16: length and filesize do not match `METEOR-M220201025-095055_2.bmp' @ warning/bmp.c/ReadBMPImage/839.

Any comments or suggestions would be greatly appreciated.



0
NateDN10
NateDN10

Answer 1 year ago

Check out the latest update to the script. This issue should be fixed now.

0
solaria137
solaria137

Answer 2 years ago

"@ warning/bmp.c/ReadBMPImage/839."

It's the BMP files that medet creates that cause the message, but it's just a warning, so it can be ignored. Did the BMP's look OK otherwise?

I've noticed that output files generated by medet also have more black lines than the same S-file decoded using LRPT_Decoder_v56 (Windows). Need a better decoder I guess.

1
WessexWeather
WessexWeather

Reply 1 year ago

Hello, thanks for sharing this. Would you care to share how you managed to get MeteorDemd installed, and the modifications you made to receive_and_process_meteor.sh?

0
mardex1234
mardex1234

Answer 1 year ago

yes, working for me

1
tecibob
tecibob

Question 2 years ago

Hi,
WXTOIMG images seem to work fine, however when I install the meteor stuff wxtoimg seems to not be able to get any pictures at all.
When the meteor satellite goes over a new file is created however, no end image is created. It is a file with a .s extension.

I am using raspberry pi 4 2gb and a Nooelec RTL-SDR USB device.

Thanks all!

1
mardex1234
mardex1234

Answer 1 year ago

I have the same problem now. Could you solve same?

0
mardex1234
mardex1234

Question 1 year ago

Good day,
anyone an idea why my meteor images are all grey and this of a guy not far from me are coloured. Am I doing wrong decoding ? and what could be the solution=
Thanks

tecibob
tecibob

Answer 2 years ago

Meteor m2-2 had a collision with a micro meteorite or some space debris and the 137mhz LRPT broadcast has been disabled.

0
NateDN10
NateDN10

Answer 2 years ago

Meteor M2-2 is no longer transmitting LRPT. It was struck by a micrometeorite and its cooling system and batteries were damaged. It still transmits HRPT in the daylight, at L-band.