Thursday, November 16, 2017

HF Noise monitoring system running from Live Ubuntu Memory stick with fully configured environment.

HF Noise monitoring system running from Live Ubuntu USB flash drive.

Ubuntu Live Noise Monitoring system with Persistence. 16Gb
I wanted a Preconfigured RF Noise monitoring system that I can run on my Laptop when ever I am not using it for something else.
I made this Ubuntu 16.04 Live memory stick .

This dongle is available from my Shop at http://www.giga.co.za/ocart/index.php?route=product/product&product_id=344

So how dose it work?
Configure your BIOS to boot from USB flash drive and you should then see the following screens.

Just pres enter to continue
If you see the error above just pres Enter  You should then get a screen where you can select how you want to boot your environment Persistent or not.
Select  the Persistent live boot.
Select the Persistent live option.
You could then see a screen for a few seconds looking like this.
Black screen before startup
This picture is of Ubunto 17.10 The Noise system is on Ubuntu 16.04
Here is some of the sunscreens of some of the functionality

HF Heat map
 Noise Graphs  (link to a live system)

Here is a link to a brochure on the RF Noise Monitoring system

Master Data correlation server http://rfnoise.amsatsa.org.za

Master Correlation Server.


Thursday, November 2, 2017

How to make a persisnt ubuntu LIve Memeory stick (16GB)

How to make a persistent live Ubuntu USB Memory stick (16GB)


16Gb Flash disk
I wanted to create a boo-table Ubuntu live flash stick that will also keep my last installed applications and not default back to standard when I reboot.

Ubuntu 17.10 Live with all my apps

You need to create two partition fat32 for the Ubuntu instillation from ISO file and a ext4 casper-rw partition for the persistent part. The compleet proses is done with a application called DUS.
Here is the process to install the DUS software
sudo add-apt-repository universe
sudo add-apt-repository ppa:mkusb/ppa
sudo apt-get update
sudo apt-get install mkusb usb-pack-efi
sudo apt-get install mkusb-nox usb-pack-efi
dus




Select the following on the screens.

1) Double-Click on the i option Install(make a boot device):
2) Double-Click on the p option Persistent Live and select the .iso file:
3) Click on the USB drive to make persistent. I want to use my 32 GB one so I mark the radio button:
4) Click Use Defaults to let mkusb choose default:
5) Enter a percentage of the drive to reserve for persistence. Mine is a large (32GB) so I allot only 20% ~ 6GB. The remaining space will be turned into an empty portable drive:
6) Double check very carefully and confirm. You don't want to mess up another drive.

Waite until 'Done' is written go and get some coffie :-)

 Here was my configuration

Cruzer Blade     sdb                                                    14.6G
                 |-sdb4 iso9660 Ubuntu 17.10 amd64         1.4G
                 |-sdb2                                                         1M
                 |-sdb5 ext4    casper-rw                             12.9G
                 |-sdb3 vfat    usbboot                                 244M
                 `-sdb1                                                        1.1M


ref : https://askubuntu.com/questions/397481/how-to-make-a-persistent-live-ubuntu-usb-with-more-than-4gb
and https://help.ubuntu.com/community/LiveCD/Persistence

Wednesday, August 30, 2017

RF Noise Monitoring system for HF

RF Noise Monitoring system on a Raspberry Pi

(This system will record RF signals and upload the results to the Server where trending graphs are created)

The New Master Correlation server (Beta) is up and running and ready to be used.
Master RF noise server. (Data correlation server)

This system is now also available on Ubuntu live memory stick.

This system software is available pre installed on a 16GB SD card from Giga Technology
Raspberry Pi OS with HF monitoring software pre installed
What do I get on the software?
I system that will record 1Mhz band with samples every 2 minutes generating Graphs and Heat-map of the hole 1 to 30Mhz band.
What hardware do I need?
The  100khz to 1.7Ghz HF dongle as in picture below Screenshot of Graph monitoring.
url of link on system http://localhost/hf_noise/graph/1Mhz_Power.php
Link to live system is here http://zr6aic.giga.co.za/hf_noise/graph/1Mhz_Power.php 
Screen shot of the HF Monitoring system

How does this system work?

Block Diagram of the HF Noise Monitoring system

How dose the HF Noise Monitoring system work

  • The HF noise monitoring system takes a 1Mhz bandwidth samples every 2 minutes using the rtl_power utility and save the measurements in a CVS fie.
  • The 2 minute scheduling is done with a Crontab calling a script in the hf_noise directory.
  • The RF Samples is taken at a 1Mhz bandwidth from 1M to 30Mhz therefore 29 of  the CVS files is created and gets appended as the measurements is made.
  • A Perl script utility is the executed from a cron scedular  to read the 29 CSV files and import there data into a RRD database.
  • The RRD database then gets interrogated by another Perl script scheduled by a cronjob to generate the graph Images and and html files and get saved in the Apache web server graph directory witch is the exposed on http://localhost/hf_noise/graph/1Mhz_Power.php
  • Link to Live system http://zr6aic.giga.co.za/hf_noise/graph/1Mhz_Power.php 
  • The RRD database will then create the Hourly, Daily,Weekly,Monthly and Yearly averages and   then generates the graphs every 2 minutes according to the parameters passed to Database.
  • The generated graphs is then displayed in a php page via a Apache web server with an php plugin on the following url http://localhost/hf_noise/graph/1Mhz_Power.php.
  • Trends can then be seen on a graphs over time.
  • The heat map is generated by a python script from different CSV files and is saved in the /var/www/hf_noise/images directory and can be accessed on the local web server on the following url http://localhost/hf_noise/images
  • Link to live system http://zr6aic.giga.co.za/vhf_heatmap/images/
  • The systems has a static IP by default on Ethernet 192.168.10.200 and 192.168.10.205 on wifi if you have wifi dongle installed. You can change it to your ip

Here is a list of RRD database management tips

  • How to backup my RRD db data?
  • use rrdtool dump hf_noise.rrd > filename.xml to export the data to XML format.
  • How to Restore my RRD db data?
  • Transfer the XML dump to the target system. Run rrdtool restore [--range-check|-r] [--force-overwrite|-f] filename.xml filename.rrd to create a new RRD from the XML dump. See rrdrestore for details.
  • How to change some of the the RRD db data?
  • Use rrdtool dump to export RRD files to XML.
    Open the XML file, find and edit the bad data.
    Restore the RRD file using rrdtool restore.

 How to generate a brand new RRD db?


There is an script in the hf_noise directory called create_rrd_db.sh
You can just run this script in the hf_directory sudo ./create_rrd_db.sh

Here is the details of the scrip.
    rrdtool create  hf_noise.rrd --start now-2d --step 120 DS:1Mhz_Power:GAUGE:120:-50:10 DS:2Mhz_Power:GAUGE:120:-40:10 DS:3Mhz_Power:GAUGE:120:-50:10 DS:4Mhz_Power:GAUGE:120:-40:10 DS:5Mhz_Power:GAUGE:120:-50:10 DS:6Mhz_Power:GAUGE:120:-40:10 DS:7Mhz_Power:GAUGE:120:-50:10 DS:8Mhz_Power:GAUGE:120:-40:10 DS:9Mhz_Power:GAUGE:120:-50:10 DS:10Mhz_Power:GAUGE:120:-40:10 DS:11Mhz_Power:GAUGE:120:-50:10 DS:12Mhz_Power:GAUGE:120:-40:10 DS:13Mhz_Power:GAUGE:120:-50:10 DS:14Mhz_Power:GAUGE:120:-40:10 DS:15Mhz_Power:GAUGE:120:-50:10 DS:16Mhz_Power:GAUGE:120:-40:10 DS:17Mhz_Power:GAUGE:120:-50:10 DS:18Mhz_Power:GAUGE:120:-40:10 DS:19Mhz_Power:GAUGE:120:-50:10 DS:20Mhz_Power:GAUGE:120:-40:10 DS:21Mhz_Power:GAUGE:120:-50:10 DS:22Mhz_Power:GAUGE:120:-40:10 DS:23Mhz_Power:GAUGE:120:-50:10 DS:24Mhz_Power:GAUGE:120:-40:10 DS:25Mhz_Power:GAUGE:120:-50:10 DS:26Mhz_Power:GAUGE:120:-40:10 DS:27Mhz_Power:GAUGE:120:-50:10 DS:28Mhz_Power:GAUGE:120:-40:10 DS:29Mhz_Power:GAUGE:120:-50:10 DS:30Mhz_Power:GAUGE:120:-40:10 RRA:AVERAGE:0.5:1:864000 RRA:AVERAGE:0.5:60:129600 RRA:AVERAGE:0.5:3600:13392 RRA:AVERAGE:0.5:86400:3660

I have still got my csv files and want to reload it into my rrd database


HF Heat map monitoring System. 


Link on local network http://localhost/hf_noise/images

link to live system http://zr6aic.giga.co.za/hf_noise/images/
Here is  a screenshot of the monitoring page and the green button
 can be used to select the frequency band of interest


Single view

Here is a view of the HF spectrum from 1Mhz to 30Mhz (activity can now be seen for the day)
Here is a view of the heat map that was selected
If you click on the image the the image will zoomed to maximum

Enlarged View

Here is a screenshot of the enlarged view.

So here is an example of the utility that generate the CSV file

Noise Recording

rtl_power -f 24M:1.7G:1M -g 50 -i 20m -1 noise-unmodded.csv

Here is the instillation instruction

hf_noise

Source code avalibe from https://github.com/antonjan/hf_noise

Alt text

Instillation Instructions


#Create user hfnoise
sudo adduser hfnoise
sudo usermod -aG sudo hfnoise

#change to hfnoise user with the following command. (dont try to install with other users)
su - hfnoise
#enter your new password
sudo apt-get update
#If you get this error below do the following
#** (appstreamcli:2761): CRITICAL **: Error while moving old database out of the way. AppStream cache update failed.
#then run this command and try again sudo chmod -R a+rX,u+w /var/cache/app-info/xapian/default
#now lets upgrade and get some coffie :-)

sudo upgrade
#We now need to install git to download the noise monitoring application
sudo apt-get install git
sudo apt install cmake
sudo apt-get install libusb-1.0-0-dev
sudo apt install python-setuptools
sudo easy_install pip
sudo pip install image
cd
#for ubuntu 17.10 do the following.
wget http://archive.ubuntu.com/ubuntu/pool/universe/i/imageinfo/imageinfo_0.04-0ubuntu11_amd64.deb
sudo dpkg -i ./imageinfo_0.04-0ubuntu11_amd64.deb
# for Ubuntu 16.04 do the following
 wget http://archive.ubuntu.com/ubuntu/pool/universe/i/imageinfo/imageinfo_0.04-0ubuntu10_amd64.deb
sudo dpkg -i ./imageinfo_0.04-0ubuntu10_amd64.deb
cd
#git clone git://git.osmocom.org/rtl-sdr.git
#Please make sure you use this repository as the osmond one dont support direct conversion mode
git clone https://github.com/keenerd/rtl-sdr.git
cd rtl-sdr/
mkdir build
cd build
cmake ../
make
sudo make install
sudo ldconfig
ls
sudo vi /etc/modprobe.d/no-rtl.conf
#add the following blacklist dvb_usb_rtl28xxu
blacklist rtl2832
blacklist rtl2830
#reboot 
#we now need to install an application that will allow us to reset the USB port where the rtl dongle is installed if it locks up for some reason (this has append when there is lightning in the aria.So what i do is motor if the csv file get updated if not I reset the usb port with this utility.
cd
git clone https://github.com/jkulesza/usbreset.git
cd usbreset
#lets compile the application
cc usbreset.c -o usbreset
#we now need to establish witch usb port is your rtl dongle installed.
sudo lsusb
#we now need to edit the shell script that monitor the csv file update with your rtl usb port details.
#now look for the device with this name "Realtek Semiconductor Corp. RTL2838 DVB-T" in my case it was "Bus 003 Device 004" to be like E.g sudo /home/hfnoise/usbreset/usbreset /dev/bus/usb/003/004
cd
git clone  https://github.com/antonjan/hf_noise.git
cd hf_noise
cd sh
vi or use your editor and check_if_file_was_updated.sh
change the line that looks like this "vi /home/anton/Downloads/usbreset/usbreset /dev/bus/usb/"
002/005" with your detail
#pull the noise monitoring system from github
git clone https://github.com/antonjan/hf_noise.git
#install Apache2 server
sudo apt-get install apache2
sudo systemctl start apache2.service
sudo systemctl enable apache2.service
sudo apt install php7.1 libapache2-mod-php7.1
sudo a2enmod php7.1
sudo systemctl restart apache2
cd /var/www/html
sudo mkdir hf_noise
sudo mkdir hf_noise/graph
sudo mkdir hf_noise/images
cd hf_noise/graph
sudo cp -r /home/hfnoise/hf_noise/*.php ./
sudo cp -r /home/hfnoise/hf_noise/*.html ./
sudo cp -r /home/hfnoise/hf_noise/*.png ./
cd /var/www/html/hf_noise/images
sudo cp -r /home/hfnoise/hf_noise/image/*.php ./

sudo cp -r /home/hfnoise/hf_noise/image/*.html ./
sudo cp -r /home/hfnoise/hf_noise/image/*.jpg ./
sudo cp -r  /home/hfnoise/hf_noise/image/thumb ./
#now test if hfnoise webserver work.
firefox http://localhost/hf_noise
#you should see the index page with no pictures.
#We now need to install the heatmap application.
#lets go to home directory and install heatmap
cd
#got hf_noise directory and install heatmap by git from github
cd hf_noise
#Get the heatmap python progrm from github
git clone https://github.com/keenerd/rtl-sdr-misc.git 
cd /home/hfnoise/hf_noise/rtl-sdr-misc/heatmap
#give the application execution writes
chmod 776 *.py
#Now we need to install the perl librareries
#CPAN, the Comprehensive Perl Archive Network, is the primary source for #publishing and fetching the latest modules
cd
sudo apt-get install perl build-essential curl
sudo apt-get install rrdtool
sudo apt-get install librrds-perl
cd /usr/local/bin
sudo wget https://raw.github.com/miyagawa/cpanminus/master/cpanm
sudo chmod +x cpanm
cd
sudo cpanm --self-upgrade --sudo
#sudo apt-get install cpanminus
sudo cpanm Text::Trim
sudo cpanm Text::CSV
sudo cpanm Date::Manip
sudo cpanm Text::Trim
# mite be only trim
sudo cpanm RRD::Simple
cd
cd hf_noise
cd sh
#run then script to generate rrd db
chmod 776 create_rrd_db.sh
./create_rrd_db.sh
#Ok now connect your HF dongel to your laptop usb port and connect to an antenna.
#Ok now everything should be ready.
#we need to enable the scripts in the crontab (scheduler)
#run the script to setup the scheduler
sudo python ./create_crontab.py

#If you want to see how the crontab was setup you can check with this command
sudo crontab -e
#Below is the what you should see
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /home/hfnoise/hf_noise/sh/create_heatmap.sh 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * * /home/hfnoise/hf_noise/sh/run_hf_noise_monitor_and_graph.sh 1,6,11,16,21,26,31,36,41,46,51,56 * * * * /home/hfnoise/hf_noise

#save file and now and we are now done.
#The images and history file should now be automatically being created every 5 minutes.
#Make sure you have along wire antenna connected to your HF rtl dongle to hf noise recordings.
#********************end******************
#How can I check that data is collected.
#run the command
ls -lrt /home/hfnoise/hf_noise
#you should see somthing lyk this
-rw-r--r-- 1 root    root          0 Nov  8 19:06 hf_monitoring_08-11-2017.cvs
-rw-r--r-- 1 root    root          0 Nov  8 19:06 hf_monitoring_graph_08-11-2017.cvs
You should also see graph images in you browser.
firefox http://localhost/hf_noise/graph/1Mhz_Power.php

File upload to Master Analytics site will be available when it goes alive.













Monday, June 5, 2017

Configuring my SA9227 with PCM5102A 32BIT / 384KHZ USB3 Hifi Audio DAC on Linux

Configuring my SA9227 with PCM5102A 32BIT / 384KHZ USB3 Hifi Audio DAC on Linux


SA9227 with PCM5102A 32BIT / 384KHZ USB3 Hifi Audio DAC 
I was looking for a high end Audio DAC for Linux and found this unit. I wanted to generate IQ moderation for a transmitter and this module would work nicely. It Unfortunately it only works on USB3 so this one cant be used on raspberry Pi 3 :-( but works fine on my Ubuntu laptop.


Description

  • Input :5 V (USB supply),
  • THD+N: <0.005% (RL = 10 kω)
  • independence: >95 dB
  • DRC: >95 dB
  • USB sample rate:16-32BIT/32-284KHZ
I first tried it on a USB 2 port but got this error when connecting the Device to the usb2 port

/var/log$ tail -f syslog
Jun  5 21:32:03 anton-SATELLITE-P755 kernel: [101544.064132] usb 2-1.2: device descriptor read/64, error -32
Jun  5 21:32:03 anton-SATELLITE-P755 kernel: [101544.240155] usb 2-1.2: new full-speed USB device number 21 using ehci-pci
Jun  5 21:32:03 anton-SATELLITE-P755 kernel: [101544.312119] usb 2-1.2: device descriptor read/64, error -32
Jun  5 21:32:03 anton-SATELLITE-P755 kernel: [101544.488089] usb 2-1.2: device descriptor read/64, error -32
Jun  5 21:32:04 anton-SATELLITE-P755 kernel: [101544.664066] usb 2-1.2: new full-speed USB device number 22 using ehci-pci
Jun  5 21:32:04 anton-SATELLITE-P755 kernel: [101545.072135] usb 2-1.2: device not accepting address 22, error -32
Jun  5 21:32:04 anton-SATELLITE-P755 kernel: [101545.144111] usb 2-1.2: new full-speed USB device number 23 using ehci-pci
Jun  5 21:32:05 anton-SATELLITE-P755 kernel: [101545.552096] usb 2-1.2: device not accepting address 23, error -32
Jun  5 21:32:05 anton-SATELLITE-P755 kernel: [101545.552269] usb 2-1-port2: unable to enumerate USB device
Jun  5 21:32:05 anton-SATELLITE-P755 gnome-session[2394]: (gnome-software:2545): Gs-WARNING **: failed to call gs_plugin_refine on appstream: Error opening file: Permission denied


I then tried it on a usb 3 port  and got the following log.

Jun  5 21:49:55 anton-SATELLITE-P755 kernel: [102616.072168] usb 3-1: new full-speed USB device number 2 using xhci_hcd
Jun  5 21:49:55 anton-SATELLITE-P755 kernel: [102616.192175] usb 3-1: device descriptor read/64, error -71
Jun  5 21:49:55 anton-SATELLITE-P755 kernel: [102616.416205] usb 3-1: device descriptor read/64, error -71
Jun  5 21:49:56 anton-SATELLITE-P755 kernel: [102616.632092] usb 3-1: new full-speed USB device number 3 using xhci_hcd
Jun  5 21:49:56 anton-SATELLITE-P755 kernel: [102616.752241] usb 3-1: device descriptor read/64, error -71
Jun  5 21:49:56 anton-SATELLITE-P755 kernel: [102616.976267] usb 3-1: device descriptor read/64, error -71
Jun  5 21:49:56 anton-SATELLITE-P755 kernel: [102617.192119] usb 3-1: new full-speed USB device number 4 using xhci_hcd
Jun  5 21:49:56 anton-SATELLITE-P755 kernel: [102617.192513] usb 3-1: Device not responding to setup address.
Jun  5 21:49:56 anton-SATELLITE-P755 kernel: [102617.396397] usb 3-1: Device not responding to setup address.
Jun  5 21:49:57 anton-SATELLITE-P755 kernel: [102617.600038] usb 3-1: device not accepting address 4, error -71
Jun  5 21:49:57 anton-SATELLITE-P755 kernel: [102617.712114] usb 3-1: new high-speed USB device number 5 using xhci_hcd
Jun  5 21:49:57 anton-SATELLITE-P755 kernel: [102617.733859] usb 3-1: New USB device found, idVendor=262a, idProduct=9227
Jun  5 21:49:57 anton-SATELLITE-P755 kernel: [102617.733864] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Jun  5 21:49:57 anton-SATELLITE-P755 kernel: [102617.733867] usb 3-1: Product: HD USB Audio
Jun  5 21:49:57 anton-SATELLITE-P755 kernel: [102617.733869] usb 3-1: Manufacturer: XENRAN Audio
Jun  5 21:49:57 anton-SATELLITE-P755 kernel: [102617.737019] input: XENRAN Audio HD USB Audio as /devices/pci0000:00/0000:00:1c.5/0000:05:00.0/usb3/3-1/3-1:1.0/0003:262A:9227.0002/input/input16
Jun  5 21:49:57 anton-SATELLITE-P755 kernel: [102617.737332] hid-generic 0003:262A:9227.0002: input,hidraw0: USB HID v1.00 Device [XENRAN Audio HD USB Audio] on usb-0000:05:00.0-1/input0
Jun  5 21:49:57 anton-SATELLITE-P755 mtp-probe: checking bus 3, device 5: "/sys/devices/pci0000:00/0000:00:1c.5/0000:05:00.0/usb3/3-1"
Jun  5 21:49:57 anton-SATELLITE-P755 mtp-probe: bus: 3, device: 5 was not an MTP device
Jun  5 21:49:57 anton-SATELLITE-P755 systemd-udevd[19211]: Process '/usr/sbin/alsactl -E HOME=/run/alsa restore 1' failed with exit code 99.
Jun  5 21:50:01 anton-SATELLITE-P755 gnome-session[2394]: (gnome-software:2545): Gs-WARNING **: failed to call gs_plugin_refine on appstream: Error opening file: Permission denied


This looked promising

I then checked if Alsa would see the device

sudo aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC269VB Analog [ALC269VB Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Audio [HD USB Audio], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: Audio [HD USB Audio], device 1: USB Audio [USB Audio #1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

and the yellow was added as a new device to be used.

I could now use the normal Alsa audio controls with this device.

Sunday, June 4, 2017

Configuring my wifi dongle on the Raspberry Pi to connect to my network router.

Configuring my wifi dongle on the Raspberry Pi to connect to my network router.

Generic Wifi dongle used on my Raspberry Pi


I had to get my router details and had to configure the following configuration files.
I wanted to give my Raspberry Pi a spear static IP so I always know what it is on my network.

I edited the following files.

/etc/wpa_supplicant/wpa_supplicant.conf

I added the following at the end. I was using WEB encryption and shared key on my router.
Change the details in yellow for your router if you use web encryption with shared key.
use your favorite editor
sudo vi /etc/wpa_supplicant/wpa_supplicant.conf

#Configeration of the file /etc/wpa_supplicant/wpa_supplicant.conf
country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
        ssid="MyRouter"  # your router ID
        key_mgmt=NONE
        wep_key0="0123456789123"  # or 13 characters, or a hexkey starting with 0x your key
        wep_tx_keyidx=0
        auth_alg=OPEN
}

Save and exit
And the change the following file

Edit the file as follows in the section configuring wlan0
I gave my Raspberry pi a spear static Ip on my network so always now what the ip is and don't use DHCP so I will not know what the Ip will be 
use your favorite editor

sudo vi /etc/network/interfaces
auto wlan0
allow-hotplug wlan0
#iface wlan0 inet dhcp
iface wlan0 inet static
address 192.168.1.205  #Static Ip
netmask 255.255.255.0 # Ip mask of network
gateway 192.168.1.254 # IP gateway of router
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

Save

And reboot Raspberry Pi  sudo shutdown -r 0

ping your new Ip on Wifi network

ping 192.168.1.205

And it should now work.





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: