Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ELEKTRO-L3 Support #1027

Merged
merged 74 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
01de0c4
Add toggle for coronal mass GIFs
Sasszem Mar 8, 2024
8724880
Initial bugfixes
MihajloPi Jun 27, 2024
2da30a8
Merge branch 'jekhokie:master' into master
MihajloPi Jul 4, 2024
fa5e57a
Beta development
MihajloPi Jul 4, 2024
ef65cfa
Fix for the buggy update
MihajloPi Jul 4, 2024
7805199
aarch64 support
creas002 Jul 4, 2024
f93c5f4
Merge pull request #995 from creas002/aarch64-support
MihajloPi Jul 4, 2024
3455dfc
Aarch64 support
MihajloPi Jul 5, 2024
84e5f0a
SatDump update for x64 machines
MihajloPi Jul 5, 2024
6276cd6
Modified tools & dependancies
creas002 Jul 5, 2024
9f38a71
Disabled - name: copy RTL-SDR udev rule
creas002 Jul 5, 2024
23e0959
rework
creas002 Jul 5, 2024
76e46bc
Merge pull request #997 from creas002/aarch64-support
MihajloPi Jul 5, 2024
de4c567
Added --fill_missing option to NOAA & METEOR receive scripts
creas002 Jul 5, 2024
45b56da
undo "fill_missing" option from NOAA as its for GOES and METEOR only
creas002 Jul 5, 2024
1cc3e6c
Hmmm somehow `--fill_missing` got lost when I switched to SatDump liv…
MihajloPi Jul 6, 2024
ab701d6
Hmmm somehow `--fill_missing` got lost when I switched to SatDump liv…
MihajloPi Jul 6, 2024
729b15d
Adding Richard's arm64 updates
MihajloPi Jul 6, 2024
58646d7
Adding updated SatDump for armhf built by Richard
MihajloPi Jul 6, 2024
42db15d
Adding updated SatDump for armhf built by Richard
MihajloPi Jul 6, 2024
fe4cca3
Providing support for any Debian based distro
MihajloPi Jul 8, 2024
ad4e436
Providing support for any Debian based distro
MihajloPi Jul 8, 2024
05834ae
Setting automatic deletion to false to store 3 days worth of audio fo…
MihajloPi Jul 8, 2024
6ff32ea
Setting automatic deletion to false to store 3 days worth of audio fo…
MihajloPi Jul 8, 2024
867819f
Fixing the log for the breakpoint
MihajloPi Jul 8, 2024
9706169
Fixing the log for the break point
MihajloPi Jul 8, 2024
b69e2f9
Fixing logs for the breakpoint if invalid `$RECEIVER_TYPE` variable i…
MihajloPi Jul 8, 2024
659c820
Preventing invalid receiver_type and satellite decoders from going pa…
MihajloPi Jul 8, 2024
c65774c
Preventing invalid receiver_type and satellite decoders from going pa…
MihajloPi Jul 8, 2024
899e3a6
Adding fix to prevent Gtk-WARNING
creas002 Jul 9, 2024
fd845f2
Widening the scope of variables to omit when scheduling passes
creas002 Jul 9, 2024
aeaf43f
Added WAYFIRE to omit
creas002 Jul 9, 2024
17a7ef8
Update receive_meteor.sh
creas002 Jul 9, 2024
9f9bcd2
Update receive_noaa.sh - Backing out changes to avoid merge conflict
creas002 Jul 9, 2024
9865b22
Fixing GTK issues preventing annotations from displaying
MihajloPi Jul 9, 2024
3172aec
Add toggle for coronal mass GIFs
MihajloPi Jul 9, 2024
afa1853
Pulling the latest changes including GTK annotations fix
MihajloPi Jul 9, 2024
370013b
add bottom - next/previous page in CAPTURE
creas002 Jul 10, 2024
48ed175
Merge branch 'aarch64-support' of https://github.com/creas002/raspber…
creas002 Jul 10, 2024
d62bfaf
Ooops... Thanks Jerome!
MihajloPi Jul 11, 2024
87a77a1
Fixing `use_device_string` to `USE_DEVICE_STRING` for bash scripts
MihajloPi Jul 11, 2024
8b6d4a7
Updating comments
MihajloPi Jul 11, 2024
3874bd8
Updating comments
MihajloPi Jul 11, 2024
97b716e
Modified polar_plot.py to resolve warning when generating AZ/EL & Dir…
creas002 Jul 11, 2024
4af3565
Merge pull request #1012 from creas002/aarch64-support
MihajloPi Jul 11, 2024
8b09fa8
Filter out wxtoimg error messages for known/acceptable issue
creas002 Jul 11, 2024
da2ab9f
Filter out wxtoimg error messages for known/acceptable issue
creas002 Jul 12, 2024
12d7440
Merge pull request #1013 from creas002/aarch64-support
MihajloPi Jul 12, 2024
32d2b16
Modified dependencies to support 32-bit wxtoimg on arm64 & amd64
creas002 Jul 13, 2024
f58f1b7
Modified core.yml to support various flavors of Linux
creas002 Jul 13, 2024
9784b73
Removed wxtoimg 320bit support for AMD64 since we have a DEB for it a…
creas002 Jul 13, 2024
7991902
Merge branch 'aarch64-support' into aarch64-support
MihajloPi Jul 13, 2024
689bb6c
Aarch64 support - Modified dependencies & core to support 32-bit wxto…
MihajloPi Jul 13, 2024
08b7cf3
Pulling the latest updates
MihajloPi Jul 13, 2024
519d43d
Update README.md
MihajloPi Jul 14, 2024
0ca8d25
Updating the README file
MihajloPi Jul 14, 2024
5fdc95f
Pulling the latest changes
MihajloPi Jul 14, 2024
36db7a2
Tuning Meteor M2-4 maps in MeteorDemod
MihajloPi Jul 18, 2024
7f54040
Tuning Meteor M2-4 maps in MeteorDemod
MihajloPi Jul 18, 2024
28aa9c8
Define XDG_RUNTIME_DIR with proper permissions
creas002 Jul 20, 2024
3ae6a4e
Merge branch 'aarch64-support' of https://github.com/creas002/raspber…
creas002 Jul 20, 2024
8f62604
Merge pull request #1018 from creas002/aarch64-support
MihajloPi Jul 20, 2024
05c3d3c
Introduction of Verification Tool and RN2 uninstall script (#1019)
creas002 Jul 21, 2024
916ce30
Clean up the library cache so any dangling items are cleared & RTL-SD…
creas002 Jul 23, 2024
59ed2c2
Delete db backup files that are older than 3 days
jp112sdl Jul 29, 2024
d558c43
fixes #1025
jp112sdl Jul 30, 2024
f663b34
integration for ELEKTRO-L3
jp112sdl Jul 30, 2024
44d5549
Merge branch 'jekhokie:master' into dev_ELEKTRO-L3
jp112sdl Jul 30, 2024
97f37be
fix wrong log call
jp112sdl Jul 30, 2024
12bfe67
fix thumbnail
jp112sdl Jul 30, 2024
f179743
add missing section in noaa-v2.conf.js2 template
jp112sdl Jul 31, 2024
f4bc988
add ELEKTRO_L3_FREQ in common.sh
jp112sdl Jul 31, 2024
73b3077
also show images of each channel, not only the composites
jp112sdl Jul 31, 2024
219b7b2
Merge branch 'elektro-l3-support' into dev_ELEKTRO-L3
MihajloPi Aug 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ansible/roles/common/templates/noaa-v2.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ METEOR_M2_4_SCHEDULE_SUN_MIN_ELEV={{ meteor_m2_4_schedule_sun_min_elevation }}
METEOR_M2_4_SAT_MIN_ELEV={{ meteor_m2_4_sat_min_elevation }}
METEOR_M2_4_80K_INTERLEAVING={{ meteor_m2_4_80k_interleaving|lower }}

# ELEKTRO-L3 Configuration
ELEKTRO_L3_SCHEDULE={{ elektro_l3_schedule|lower }}
ELEKTRO_L3_SDR_DEVICE_ID={{ elektro_l3_sdr_device_id }}
ELEKTRO_L3_FREQ_OFFSET={{ elektro_l3_freq_offset }}
ELEKTRO_L3_ENABLE_BIAS_TEE="{% if elektro_l3_enable_bias_tee|lower == 'true' %}-T{% endif %}"
ELEKTRO_L3_GAIN={{ elektro_l3_gain }}
ELEKTRO_L3_SUN_MIN_ELEV={{ elektro_l3_sun_min_elevation }}

# Memory and Cleanup
NOAA_MEMORY_THRESHOLD={{ noaa_memory_threshold }}
METEOR_M2_MEMORY_THRESHOLD={{ meteor_m2_memory_threshold }}
Expand Down
7 changes: 7 additions & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ meteor_m2_4_sun_min_elevation: 6
meteor_m2_4_sat_min_elevation: 30
meteor_m2_4_80k_interleaving: false

elektro_l3_schedule: true
elektro_l3_sdr_device_id: 0
elektro_l3_freq_offset: 0
elektro_l3_enable_bias_tee: false
elektro_l3_gain: 29.7
elektro_l3_sun_min_elevation: 6

# how many days to schedule passes - note this MUST be an even integer,
# and the current day counts as "1" - passes will be scheduled until midnight
# of the `days_to_schedule_passes` final day
Expand Down
16 changes: 16 additions & 0 deletions config/settings_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@
"minimum": 0,
"maximum": 90
},
"elektro_l3_schedule": { "type": "boolean" },
"elektro_l3_sdr_device_id": { "type": "number" },
"elektro_l3_freq_offset": { "type": "number" },
"elektro_l3_enable_bias_tee": { "type": "boolean" },
"elektro_l3_gain": { "type": "number" },
"elektro_l3_sun_min_elevation": {
"type": "number",
"minimum": -90,
"maximum": 90
},
"noaa_memory_threshold": { "type": "number" },
"meteor_m2_memory_threshold": { "type": "number" },
"use_device_string": { "type": "boolean" },
Expand Down Expand Up @@ -266,6 +276,12 @@
"meteor_m2_4_gain",
"meteor_m2_4_sun_min_elevation",
"meteor_m2_4_sat_min_elevation",
"elektro_l3_schedule",
"elektro_l3_sdr_device_id",
"elektro_l3_freq_offset",
"elektro_l3_enable_bias_tee",
"elektro_l3_gain",
"elektro_l3_sun_min_elevation",
"noaa_memory_threshold",
"meteor_m2_memory_threshold",
"use_device_string",
Expand Down
1 change: 1 addition & 0 deletions scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ METEOR_M2_4_FREQ="137.9000"
NOAA15_FREQ="137.6200"
NOAA18_FREQ="137.9125"
NOAA19_FREQ="137.1000"
ELEKTRO_L3_FREQ="1691.0000"

# current date and time
export START_DATE=$(date '+%d-%m-%Y %H:%M')
3 changes: 3 additions & 0 deletions scripts/push_processors/push_pushover.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ for singlefile in $FILELIST; do
if [[ $singlefile == *"MCIR"* ]]; then
push_attachment_file=$singlefile
fi
if [[ $singlefile == *"msu_gs_rgb_Natural_Color"* ]]; then
push_attachment_file=$singlefile
fi
done

push_attachment=""
Expand Down
240 changes: 240 additions & 0 deletions scripts/receive_elektro.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
#!/bin/bash
#
# Purpose: Receive and process ELEKTRO captures.
#
# Input parameters:
# 1. Name of satellite "ELEKTRO-L3"
# 2. Filename of image outputs
# 3. Duration of capture (seconds)
# 4. epoch start time

# input params
export SAT_NAME=$1
export FILENAME_BASE=$2
export CAPTURE_TIME=$3
export EPOCH_START=$4

#time keeping
TIMER_START=$(date '+%s')

# import common lib and settings
. "$HOME/.noaa-v2.conf"
. "$NOAA_HOME/scripts/common.sh"
capture_start="$START_DATE $(date '+%Z')"

PID_FILE=${NOAA_HOME}/tmp/${EPOCH_START}_${SAT_NAME}.pid
if [ -f $PID_FILE ]; then
log "PID file already exists. Exiting!"
exit 0
fi
touch ${PID_FILE}
log "Created PID file ${PID_FILE}" "INFO"

GAIN=$ELEKTRO_L3_GAIN

case "$RECEIVER_TYPE" in
"rtlsdr")
samplerate="1.024e6"
receiver="rtlsdr"
;;
"airspy_mini")
samplerate="3e6"
receiver="airspy"
;;
"airspy_r2")
samplerate="2.5e6"
receiver="airspy"
;;
"airspy_hf_plus_discovery")
samplerate="192e3"
receiver="airspy"
;;
"hackrf")
samplerate="4e6"
receiver="hackrf"
;;
"sdrplay")
samplerate="2e6"
receiver="sdrplay"
;;
"mirisdr")
samplerate="2e6"
receiver="mirisdr"
;;
*)
log "Invalid RECEIVER_TYPE value: $RECEIVER_TYPE" "INFO"
exit 1
;;
esac

if [[ "$receiver" == "rtlsdr" ]]; then
gain_option="--gain"
else
gain_option="--general_gain"
fi

if [[ "$USE_DEVICE_STRING" == "true" ]]; then
sdr_id_option="--source_id"
else
sdr_id_option=""
SDR_DEVICE_ID=""
fi

if [ "$BIAS_TEE" == "-T" ]; then
bias_tee_option="--bias"
else
bias_tee_option=""
fi

RAMFS_AUDIO_BASE="${RAMFS_AUDIO}/${FILENAME_BASE}"
audio_temporary_storage_directory="$(dirname "${RAMFS_AUDIO_BASE}")"
decoded_images=${audio_temporary_storage_directory}/IMAGES/ELEKTRO*/*/*.png

log "Cleanup artifacts of previous decode"
rm -rf ${audio_temporary_storage_directory}/IMAGES
rm -rf ${audio_temporary_storage_directory}/LRIT
rm -rf ${audio_temporary_storage_directory}/elektro_lrit.cadu
rm -rf ${audio_temporary_storage_directory}/.composite_cache_do_not_delete.json

log "Starting satdump... recording to ${audio_temporary_storage_directory}/elektro-${EPOCH_START}" "INFO"
$SATDUMP live elektro_lrit "$audio_temporary_storage_directory" --source $receiver --samplerate $samplerate --frequency ${ELEKTRO_L3_FREQ}e6 $sdr_id_option $SDR_DEVICE_ID $gain_option $GAIN $bias_tee_option --finish_processing --timeout $CAPTURE_TIME >> $NOAA_LOG 2>&1

push_file_list=""

got_an_image=false
if compgen -G ${decoded_images} > /dev/null; then
got_an_image=true
for file in ${decoded_images}; do
image_filename=$(basename "$file")
#remove timestamp from L3_* files
if [[ ${image_filename} == "L3_"* ]]; then
image_filename=`awk -F_ '{print $1"_"$2".png"}' <<< ${image_filename}`
fi
new_image=${FILENAME_BASE}-${image_filename}
mv "$file" "${IMAGE_OUTPUT}/${new_image}"
${IMAGE_PROC_DIR}/thumbnail.sh 300 "${IMAGE_OUTPUT}/${new_image}" "${IMAGE_OUTPUT}/thumb/${new_image}" >> $NOAA_LOG 2>&1
push_file_list="$push_file_list ${IMAGE_OUTPUT}/${new_image}"
done
fi

if [[ $got_an_image == "true" ]]; then
log "Valid ELEKTRO-L3 image(s) received!" "INFO"
# pass start timestamp and sun elevation
PASS_START=$(expr "$EPOCH_START" + 90)
export SUN_ELEV=$(python3 "$SCRIPTS_DIR"/tools/sun.py "$PASS_START")
export SUN_MIN_ELEV=$ELEKTRO_L3_SUN_MIN_ELEV

# determine if pass is in daylight
daylight=0
if [ "${SUN_ELEV}" -gt "${SUN_MIN_ELEV}" ]; then daylight=1; fi

# insert or replace in case there was already an insert due to the spectrogram creation
$SQLITE3 $DB_FILE "INSERT OR REPLACE INTO decoded_passes (pass_start, file_path, daylight_pass, sat_type, has_spectrogram, has_polar_az_el, has_polar_direction, gain) \
VALUES ($EPOCH_START, \"$FILENAME_BASE\", $daylight, 2, 0, 0, 0, $GAIN);" >> $NOAA_LOG 2>&1

pass_id=$($SQLITE3 $DB_FILE "SELECT id FROM decoded_passes ORDER BY id DESC LIMIT 1;")
$SQLITE3 $DB_FILE "UPDATE predict_passes \
SET is_active = 0 \
WHERE (predict_passes.pass_start) \
IN ( \
SELECT predict_passes.pass_start \
FROM predict_passes \
INNER JOIN decoded_passes \
ON predict_passes.pass_start = decoded_passes.pass_start \
WHERE decoded_passes.id = $pass_id \
);" >> $NOAA_LOG 2>&1


# determine if auto-gain is set - handles "0" and "0.0" floats
gain=$GAIN
if [ $(echo "$GAIN==0"|bc) -eq 1 ]; then
gain='Automatic'
fi

# create push annotation string (annotation in the email subject, discord text, etc.)
# note this is NOT the annotation on the image, which is driven by the config/annotation/annotation.html.j2 file
push_annotation=""
if [ "${GROUND_STATION_LOCATION}" != "" ]; then
push_annotation="Ground Station: ${GROUND_STATION_LOCATION}"
fi
push_annotation="${push_annotation} ${SAT_NAME} ${capture_start} "
push_annotation="${push_annotation} Gain: ${gain}"

# handle Pushover pushing if enabled
if [ "${ENABLE_PUSHOVER_PUSH}" == "true" ]; then
pushover_push_annotation=""
#if [ "${GROUND_STATION_LOCATION}" != "" ]; then
# pushover_push_annotation="Ground Station: ${GROUND_STATION_LOCATION}<br/>"
#fi
pushover_push_annotation="${pushover_push_annotation}<b>Start: </b>${capture_start}<br/>"
pushover_push_annotation="${pushover_push_annotation} <a href=${PUSHOVER_LINK_URL}?pass_id=${pass_id}>BROWSER LINK</a>";
pushover_push_annotation="${pushover_push_annotation}<b>Gain: </b>${gain}<br/>"
log "Call pushover script with push_file_list: $push_file_list" "INFO"
${PUSH_PROC_DIR}/push_pushover.sh "${pushover_push_annotation}" "${SAT_NAME}" "$push_file_list" >> $NOAA_LOG 2>&1
fi

# handle Slack pushing if enabled
if [ "${ENABLE_SLACK_PUSH}" == "true" ]; then
${PUSH_PROC_DIR}/push_slack.sh "${push_annotation} <${SLACK_LINK}?pass_id=${pass_id}>\n" $push_file_list >> $NOAA_LOG 2>&1
fi

# handle Twitter pushing if enabled
if [ "${ENABLE_TWITTER_PUSH}" == "true" ]; then
log "Pushing image enhancements to Twitter" "INFO"
${PUSH_PROC_DIR}/push_twitter.sh "${push_annotation}" $push_file_list >> $NOAA_LOG 2>&1
fi

# handle Facebook pushing if enabled
if [ "${ENABLE_FACEBOOK_PUSH}" == "true" ]; then
log "Pushing image enhancements to Facebook" "INFO"
python3 ${PUSH_PROC_DIR}/push_facebook.py "${push_annotation}" "${push_file_list}" >> $NOAA_LOG 2>&1
fi

# handle Mastodon pushing if enabled
if [ "${ENABLE_MASTODON_PUSH}" == "true" ]; then
log "Pushing image enhancements to Mastodon" "INFO"
python3 $PUSH_PROC_DIR}/push_mastodon.py "${push_annotation}" ${push_file_list} >> $NOAA_LOG 2>&1
fi

# handle Instagram pushing if enabled
if [ "${ENABLE_INSTAGRAM_PUSH}" == "true" ]; then
log "Pushing image enhancements to Instagram" "INFO"
$CONVERT "${IMAGE_FILE_BASE}${suffix}" -resize "1080x1350>" -gravity center -background black -extent 1080x1350 "${IMAGE_FILE_BASE}-instagram.jpg"
python3 ${PUSH_PROC_DIR}/push_instagram.py "${push_annotation}" $(sed 's|/srv/images/||' <<< "${IMAGE_FILE_BASE}-instagram.jpg") ${WEB_SERVER_NAME} >> $NOAA_LOG 2>&1
rm "${IMAGE_FILE_BASE}-instagram.jpg"
fi

# handle Matrix pushing if enabled
if [ "${ENABLE_MATRIX_PUSH}" == "true" ]; then
log "Pushing image enhancements to Matrix" "INFO"
${PUSH_PROC_DIR}/push_matrix.sh "${push_annotation}" $push_file_list >> $NOAA_LOG 2>&1
fi

# handle email pushing if enabled
if [ "$ENABLE_EMAIL_PUSH" == "true" ]; then
log "Emailing images" "INFO"
for i in $push_file_list
do
${PUSH_PROC_DIR}/push_email.sh "${EMAIL_PUSH_ADDRESS}" "$i" "${push_annotation}" >> $NOAA_LOG 2>&1
done
fi

# handle Discord pushing if enabled
if [ "${ENABLE_DISCORD_PUSH}" == "true" ]; then
log "Pushing images to Discord" "INFO"
for i in $push_file_list
do
${PUSH_PROC_DIR}/push_discord.sh "$DISCORD_METEOR_WEBHOOK" "$i" "${push_annotation}" >> $NOAA_LOG 2>&1
done
fi
else
log "No ELEKTRO-L3 image received!" "INFO"
fi

# calculate and report total time for capture
rm ${PID_FILE}
log "Deleted PID file ${PID_FILE}" "INFO"
TIMER_END=$(date '+%s')
DIFF=$(($TIMER_END - $TIMER_START))
PROC_TIME=$(date -ud "@$DIFF" +'%H:%M.%S')
log "Total processing time: ${PROC_TIME}" "INFO"
4 changes: 4 additions & 0 deletions scripts/schedule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ if [ "$METEOR_M2_4_SCHEDULE" == "true" ]; then
log "Scheduling Meteor-M2 4 captures..." "INFO"
$NOAA_HOME/scripts/schedule_captures.sh "METEOR-M2 4" "receive_meteor.sh" $TLE_OUTPUT $start_time_ms $end_time_ms >> $NOAA_LOG 2>&1
fi
if [ "$ELEKTRO_L3_SCHEDULE" == "true" ]; then
log "Scheduling ELEKTRO-L3 captures..." "INFO"
$NOAA_HOME/scripts/schedule_captures.sh "ELEKTRO-L3" "receive_elektro.sh" >> $NOAA_LOG 2>&1
fi
log "Done scheduling jobs!" "INFO"

# Check if the variable is set and true
Expand Down
Loading