These are the notes we made during another attempt at replacing the windows netbook running supersid v1.2.2 with a raspberry pi project.
This would hopefully use less power (up to $0.36/kwh during peak time of use here at upto 40 watts all year long comes out as $82/year), hopefully not loose a days worth of data if the data logger stopped, stop the ever decreasing Y axis power intensity over time, and we hoped to get better graphing than our own ‘R’ code was doing.
Sample screen capture of power density averaging negative over time

In the end this failed, we think to multiple complex library dependencies failing to install.

Sunday 2020 Feb 16
* supersidpi project

From Eric Gibert
https://github.com/ericgibert/supersid

Objectives
Monitoring the Sudden Ionospheric Disturbances (SID) is an easy yet exciting Home Based Radio Astronomy Project. This project is an implementation of Stanford SOLAR Center’s SuperSID.

The default SuperSID project software runs on Windows OS to record the pre-amplified signal received by the antenna with a “SuperSID Monitor”.

This SuperSID project is an Open Source implementation that runs on Linux and Windows. The scripts are executable by Python 2.7 and Python 3, at your choice.

This SuperSID includes a text mode which allows to turn your Raspberry Pi in a SID monitor (tested on Raspbian Wheezy & Pidora distro). TkInter in the default GUI to ensure Python 2 and 3 compatibility (but wxPython is still supported for Python 2 only).

supersid.py:
More options in the [configuration file (.cfg)] (docs/ConfigHelp.md)
Continue recording after interruption
Auto adjustment of the interval period for better accuracy
New extended file format with time stamp to the 1.000th of second
sidfile.py can be used as a utility to manipualte SID files

supersid_plot.py:
Accepts multiple files to display up to 10 days in continue (wildcards possible)
Can connect to NOAA to draw the day’s events
Can send the graph as PDF by email

pi@supersidpi:~/supersid $ pwd
/home/pi/supersid
pi@supersidpi:~/supersid $ ls -l
total 144
drwxrwxrwx 2 pi pi 4096 Jan 5 09:28 backup
drwxrwxrwx 2 pi pi 4096 Jan 5 09:41 Config
-rw-rw-rw- 1 pi pi 5287 Jan 5 09:42 confighelp.txt
-rw-rw-rw- 1 pi pi 12085 Jan 5 09:48 config.py
drwxrwxrwx 2 pi pi 4096 Jan 5 09:29 Data
-rw-rw-rw- 1 pi pi 5090 Jan 5 09:49 ftp_to_stanford.py
-rw-rw-rw- 1 pi pi 985 Jan 5 09:47 _getch.py
-rw-rw-rw- 1 pi pi 4941 Jan 5 09:49 logger.py
-rw-rw-rw- 1 pi pi 6599 Jan 5 09:50 NOAA_flares.py
-rwxrwxrwx 1 pi pi 1439 Jan 5 09:25 Note.txt
drwxrwxrwx 9 pi pi 4096 Jan 5 09:34 pyaudio
-rwxrwxrwx 1 pi pi 4703 Jan 5 09:25 ReleaseNotes.txt
-rw-r–r– 1 pi pi 10819 Jan 5 09:51 sampler.py
-rw-r–r– 1 pi pi 26754 Jan 5 09:52 sidfile.py
-rw-r–r– 1 pi pi 5426 Jan 5 09:52 sidtimer.py
-rw-rw-rw- 1 pi pi 1384 Jan 5 09:43 supersidonraspi3.txt
-rw-rw-rw- 1 pi pi 10512 Jan 5 09:45 supersid.py
drwxrwxrwx 2 pi pi 4096 Jan 5 09:45 v1.2.2

pi@supersidpi:~/supersid $ python supersid.py
Traceback (most recent call last):
File “supersid.py”, line 21, in
from matplotlib.mlab import psd as mlab_psd
ImportError: No module named matplotlib.mlab

Time synchro over the Internet: ”” sudo apt-get install ntpdate ntp ”” Follow tutorial at https://victorhurdugaci.com/raspberry-pi-sync-date-and-time
Virtualenv management for Python:
sudo apt-get install virtualenv
This Raspi 3 is dedicated to SuperSid or you do not plan to mix various libraries: install at system level all the libraries.
sudo apt-get install python3-matplotlib
sudo apt-get install libasound2-dev
sudo pip3 install pyalsaaudio
pip install matplotlib

many minutes go by

The configuration file is a simple text file formatted as a classic ‘.ini’ structure i.e. sections with squared brackets and a list of pairs ‘key=value”
The supported sections are:
PARAMETERS
STATION_x where x is a number in [1..n]
Capture
Email
FTP
Monitor Identification
contact: email or phone number of the SuperSID owner. Mandatory
site_name: unique identification of the SuperSID monitor. Mandatory
monitor_id: unique id to distinguish the monitors running on one site
longitude: in decimal form
latitude: in decimal form
utc_offset:
time_zone:
Log Parameters
audio_sampling_rate: 48000 or 96000 (you can experiment with other value as long as your card support them)
log_interval: number of second between two reading. Default is ‘5’ seconds. Reading/sound capture last one second.
log_type: filtered or raw. When filtered is indicated, bema_wing function is called to smoothen raw data before writting the file else in raw mode, captured data are written ‘as is’. Note that sidfile.py can be used as an utility to apply ‘bema_wing’ function to an existing file (raw or not) to smoothen its data.
data_path: fully qualified path where files will be written. If not mentionned then ‘../Data/’ is used.
log_format:
sid_format: one file per station with first data column as timestamp and second data column as captured value
supersid_format: one file for all station. No timestamp but one data column per station. Each line is log_interval seconds after the previous, first line at 0:00:00UTC.
supersid_extended: one file for all station. First data column is extended timestamp HH:MM:SS.mmmmm and following data column as one per station.
hourly_save: yes / no (default). If yes then a raw file is written every hour to limit data loss.

FTP to Standford server
Version 1.4: FTP information are no longer part of the [PARAMETERS] section. Refer to the [FTP] section below.

Extra
scaling_factor:
mode: [ignored] Server, Client, Standalone (default) . Reserved for future client/server dev.
viewer: text for text mode light interface, wx for wxPython GUI or tk for TkInter GUI (default)
bema_wing: beta_wing parameter for sidfile.filter_buffer() calculation. Default is ‘6’.
number_of_stations: specify the number of stations to monitor. Each station is described within its own section.
## [STATION_x] ## Each station to monitor is enumerated from 1 till n=*number_of_stations*. For each station, one must provide: * call_sign: Station ID (various VLF station lists exist like [AAVSO’s] (http://www.aavso.org/vlf-station-list) and [Wikipedia’s] (http://en.wikipedia.org/wiki/Very_low_frequency#List_of_VLF_transmissions)) * frequency: emission frequency in Hz * color: [rgbyw] to draw multiple graph together in *SuperSID_plot.py*.
## [Capture] ## This section can be omitted if you plan to use the ‘pyaudio’ library. If you want to use the “alsaaudio” library then you can declare: * Audio: python library to use **alsaaudio** or **pyaudio** (default), **server** reserved for client/server future dev. * Card: [for alsaaudio only] card name for capture. Default is ‘External’. * PeriodSize: [for alsaaudio only] period size for capture. Default is ‘128’.
## [Email] ## The ‘supersid_plot.py’ program can send you an email with the attached plot as a PDF file. In order to use this feature, you must provide the information necessary to contact your email server as well as which email to use. * from_mail: sender’s emai * to_mail: recipient’s email * email_server: email server to use (SMPT) * email_login: [optional] if your server requires a login for identification * email_password: [optional] if your server requires a password for identification
## [FTP] ## Group all parameters to send data to an FTP server i.e. Standford data repository. * automatic_upload: [yes/no] if set to ‘yes’ then trigger the FTP data upload * ftp_server: URL of the server (sid-ftp.stanford.edu) * ftp_directory: target folder on the FTP server where files should be written (on Standford’s server: /incoming/SuperSID/NEW/) * local_tmp: local temporary directpry used to write the files before their upload * call_signs: list of recorded stations to upload. Not all recorded stations might be of interrest: list only the most relevant one(s).
supersid.cfg
[PARAMETERS]
viewer = text
site_name = EXAMPLE
monitor_id = SAMPLE1
contact=ericgibert@yahoo.fr
longitude = 103.8
latitude = 1.367
utc_offset = +08:00
time_zone = SGT
audio_sampling_rate = 48000
log_interval = 5
log_format=sid_format
log_type = filtered
scaling_factor = 1.0
hourly_save = YES
data_path = /tmp/Data
number_of_stations = 2
[STATION_1]
call_sign = NWC
color = y
frequency = 19800
[STATION_2]
call_sign = VTX3
color = k
frequency = 18200
[Capture]
Audio=alsaaudio
#Card=External
Card=ICH7
PeriodSize = 128
[FTP]
automatic_upload = no
ftp_server = sid-ftp.stanford.edu
ftp_directory = /incoming/SuperSID/NEW/
local_tmp = /tmp
call_signs = NWC
pi@supersidpi:~/supersid $ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 14G 5.8G 7.6G 44% /
devtmpfs 459M 0 459M 0% /dev
tmpfs 464M 0 464M 0% /dev/shm
tmpfs 464M 6.3M 457M 2% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 464M 0 464M 0% /sys/fs/cgroup
/dev/mmcblk0p1 253M 53M 200M 21% /boot
tmpfs 93M 0 93M 0% /run/user/1000

python supersid.py
pi@supersidpi:~/supersid $ python supersid.py
Traceback (most recent call last):
File “supersid.py”, line 21, in
from matplotlib.mlab import psd as mlab_psd
File “/home/pi/.local/lib/python2.7/site-packages/matplotlib/__init__.py”, line 133, in
from matplotlib.rcsetup import defaultParams, validate_backend, cycler
File “/home/pi/.local/lib/python2.7/site-packages/matplotlib/rcsetup.py”, line 31, in
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
File “/home/pi/.local/lib/python2.7/site-packages/matplotlib/fontconfig_pattern.py”, line 28, in
from backports.functools_lru_cache import lru_cache
ImportError: No module named functools_lru_cache

pi@supersidpi:~ $ pip install “backports-functools_lru_cache”
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting backports-functools_lru_cache
Using cached https://files.pythonhosted.org/packages/da/d1/080d2bb13773803648281a49e3918f65b31b7beebf009887a529357fd44a/backports.functools_lru_cache-1.6.1-py2.py3-none-any.whl
Installing collected packages: backports-functools-lru-cache
Successfully installed backports-functools-lru-cache

try again 11:51
python supersid.py
failed
ImportError: No module named functools_lru_cache

pi@supersidpi:/ $ find . -iname functools*
./usr/lib/pypy/lib-python/2.7/__pycache__/functools.pypy-41.pyc
./usr/lib/pypy/lib-python/2.7/functools.py
./usr/lib/python2.7/functools.pyc
./usr/lib/python2.7/functools.py
./usr/lib/python3/dist-packages/mypy/typeshed/stdlib/2/functools.pyi
./usr/lib/python3/dist-packages/mypy/typeshed/stdlib/3/functools.pyi
./usr/lib/python3.7/__pycache__/functools.cpython-37.pyc
./usr/lib/python3.7/functools.py
./home/pi/.local/lib/python2.7/site-packages/backports/functools_lru_cache.pyc
./home/pi/.local/lib/python2.7/site-packages/backports/functools_lru_cache.py

sudo cp -auvx python2.7/* /usr/local/lib/python2.7/
sudo pip install lru_cache
pi@supersidpi:~/supersid $ sudo pip install functools_lru_cache
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting functools_lru_cache
Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: https://pypi.org/simple/functools-lru-cache/
sudo pip install backports_functools_lru_cache
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting backports_functools_lru_cache
Downloading https://files.pythonhosted.org/packages/da/d1/080d2bb13773803648281a49e3918f65b31b7beebf009887a529357fd44a/backports.functools_lru_cache-1.6.1-py2.py3-none-any.whl
Installing collected packages: backports-functools-lru-cache
Successfully installed backports-functools-lru-cache
failed failed failed

start ALL over
Latest image downloaded as .ZIP: 2017-09-07-raspbian-stretch.zip Download and use the easy tool to write this image etcher. Highly recommended. Boot on the new micro-SD card, follow normal process for any fresh system install.
Execute the classic:
firmware upgrade
apt-get update and upgrade
This Raspi 3 is dedicated to SuperSid or you do not plan to mix various libraries: install at system level all the libraries.

““
sudo apt-get install python3-matplotlib
sudo apt-get install libasound2-dev
sudo pip3 install pyalsaaudio

remove microsd card and place into anker usb adapter. run balena etcher, select s:\2018-10-09-raspbian-stretch-lite
flash
reassembled back in observatory
dhcp new address of
raspberrypi 192.168.1.23

* supersid pi – new install of raspbian stretch lite with balena etcher onto 16GB microsd
raspiconfig, enable vnc and ssh, reinstall in scgo and turn on
remote ssh to 192.168.1.23
change password to house
sudo apt-get update
sudo apt-get upgrade
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 15G 1.3G 13G 9% /
devtmpfs 460M 0 460M 0% /dev
tmpfs 464M 0 464M 0% /dev/shm
tmpfs 464M 12M 452M 3% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 464M 0 464M 0% /sys/fs/cgroup
/dev/mmcblk0p1 44M 23M 21M 52% /boot
tmpfs 93M 0 93M 0% /run/user/1000
reboot
ssh 192.168.1.23

sudo apt-get install libasound2-dev
sudo apt-get install ntpdate ntp
ok
sudo pip3 install pyalsaaudio
pip3 not installed
sudo apt-get install python3-matplotlib
pip3 not installed
sudo apt-get install python-pip
still no pip3
try again
sudo apt-get install python3-pip
get supersid-master.zip
unzip supersid-master.zip
cd supersid/Config
vi supersid.cfg
cd supersid
python supersid.py
pi@supersidpi:~/supersid/supersid $ python supersid.py
Traceback (most recent call last):
File “supersid.py”, line 23, in
from matplotlib.mlab import psd as mlab_psd
ImportError: No module named matplotlib.mlab
sudo apt-get remove python3-matplotlib
sudo apt-get install python3-matplotlib

pi@supersidpi:~/supersid/supersid $ python supersid.py
Traceback (most recent call last):
File “supersid.py”, line 23, in
from matplotlib.mlab import psd as mlab_psd
ImportError: No module named matplotlib.mlab
sudo pip install matplotlib
RuntimeError: Python version >= 3.5 required.
—————————————-
Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-oaTHq2/matplotlib/

$ sudo rm python
pi@supersidpi:/usr/bin $ sudo ln -s python python3.5
ln: failed to create symbolic link ‘python3.5’: File exists
pi@supersidpi:/usr/bin $ sudo ln -s python3.5 python
sudo pip install matplotlib
Requirement already satisfied: matplotlib in /usr/lib/python3/dist-packages
pi@supersidpi:/usr/bin $ sudo pip remove matplotlib

pi@supersidpi:~/supersid/supersid $ python supersid.py
Reading supersid.cfg …[‘../Config/supersid.cfg’]
SuperSID initialization

———————————————————————-
Site: SCO Monitor: 9193
———————————————————————-
F) save Filtered buffers
R) save Raw buffers
E) save Extended raw buffers
———————————————————————-
C) list the Config file(s) parameters
V) Version
?) display this menu
X) eXit (without saving)
———————————————————————-
ALSA lib confmisc.c:767:(parse_card) cannot find card ‘ICH7’
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned error: No such device
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error: No such device
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such device
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such device
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM sysdefault:CARD=ICH7
From Sampler object instance:
Could not open capture device. Please cError alsaaudio
No such device [sysdefault:CARD=ICH7]
To debugg: remove the try/except clause to get detail on what exception is triggered.
Traceback (most recent call last):

FAILED FAILED FAILED…
put it all back on a shelf