From f7bdd1218bcdb67a7af1c85bfa51596de018fe5f Mon Sep 17 00:00:00 2001 From: Richard Creasey - AI4Y <69941625+creas002@users.noreply.github.com> Date: Wed, 7 Aug 2024 11:49:30 -0400 Subject: [PATCH 1/7] Update core.yml - Simply getting OS Release (#1038) Update core.yml - Simply getting OS Release Goal was to work on as many as Debian Distro's as possible even if they are using local repo's --- ansible/core.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/core.yml b/ansible/core.yml index 62cd867c..6766bfdc 100644 --- a/ansible/core.yml +++ b/ansible/core.yml @@ -5,7 +5,7 @@ gather_facts: no pre_tasks: - name: get os release - shell: grep -E "^deb http://raspbian.raspberry.org/raspbian|^deb http://raspbian.raspberrypi.org/raspbian|^deb http://deb.debian.org/debian|^deb https://deb.debian.org/debian" /etc/apt/sources.list /etc/apt/sources.list.d/official-package-repositories.list 2> /dev/null | head -n 1 | awk '{print $3}' + shell: cat /etc/os-release | grep -E "^DEBIAN_CODENAME|^VERSION_CODENAME" | awk -F"=" '{print $NF}' | sort | head -1 register: raspbian_version check_mode: no changed_when: no From fb5b46f0c545cbc1203277bd759dbadeb877f97d Mon Sep 17 00:00:00 2001 From: Richard Creasey - AI4Y <69941625+creas002@users.noreply.github.com> Date: Mon, 12 Aug 2024 06:56:48 -0400 Subject: [PATCH 2/7] Update README.md (#1043) --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bba09d8f..25047b08 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,8 @@ consistent time and language handling. 4. It's not recommended to use the default user "pi" and the default password "raspberry". While it is not recommended that you expose a Pi instance to the public internet for access (unless you have a VERY strict process about security patching, and even then it would still be questionable), updating your Pi user password is a decent first step for security. +5. When you perform the operating system install, please ensure the account name you choose for installing the RN2 software under is 9 characters or less. +This character limit is due to a known constraint with predict scheduling tool. ## Install @@ -198,7 +200,7 @@ Want to switch your existing RN2 installation to a different Github branch witho **Introduction of RN2 Upgrade tool** - `${HOME}/.rn2_utils/rn2_upgrade.sh https://github.com/jekhokie/raspberry-noaa-v2.git -b beta-development` + ${HOME}/.rn2_utils/rn2_upgrade.sh https://github.com/jekhokie/raspberry-noaa-v2.git -b beta-development Just point to the branch you want to switch to by modifying the above line as needed. @@ -231,7 +233,7 @@ The verification tool can be used to help identify RN2 installation/configuratio Execute the verification script by passing the required argument [ quick | full ] - `$HOME/raspberry-noaa-v2/scripts/tools/verification_tool/verification.sh quick` + $HOME/raspberry-noaa-v2/scripts/tools/verification_tool/verification.sh quick Argument required: ./verification.sh quick or ./verification.sh full (~ 1 minute) (~ 5 minutes) From 0f45098402f4d721f4c6de9eb6c3b98ec8bacd15 Mon Sep 17 00:00:00 2001 From: Richard Creasey - AI4Y <69941625+creas002@users.noreply.github.com> Date: Mon, 12 Aug 2024 06:57:54 -0400 Subject: [PATCH 3/7] Update rn2_uninstall.sh (#1045) Commenting out systemctl disable service because disable causes it to remain disabled even after the service is removed and reinstalled by Ansible Commenting out the disable command has no impact since it will be removed when removing packages --- ansible/roles/common/files/rn2_uninstall.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ansible/roles/common/files/rn2_uninstall.sh b/ansible/roles/common/files/rn2_uninstall.sh index eb30f729..919fb521 100644 --- a/ansible/roles/common/files/rn2_uninstall.sh +++ b/ansible/roles/common/files/rn2_uninstall.sh @@ -87,8 +87,12 @@ remove_services() { do loggit "INFO" "Stopping and removing ${svc} service" - sudo sudo systemctl stop ${svc} - sudo sudo systemctl disable ${svc} + sudo systemctl stop ${svc} + # Disable causes it to remain disabled even after the service is removed and reinstalled by Ansible + # this is because disable removes /etc/systemd/system/multi-user.target.wants/nginx.service and is not added back when Ansible installs it. + # If Ansible had issued an systemctl enable nsinx enable it would worked. + # Commenting out the disable command because disabling the service is no impact since it will be removed when removing packages + # sudo systemctl disable ${svc} done From 023cd181089d1403e5af444884c9be35baec49c7 Mon Sep 17 00:00:00 2001 From: Richard Creasey - AI4Y <69941625+creas002@users.noreply.github.com> Date: Mon, 12 Aug 2024 06:58:40 -0400 Subject: [PATCH 4/7] Update verification.sh (#1046) Ooops... I had hard coded /home/richard , fixed with ${HOME} --- scripts/tools/verification_tool/verification.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/tools/verification_tool/verification.sh b/scripts/tools/verification_tool/verification.sh index f3d61c95..d0d7d35b 100644 --- a/scripts/tools/verification_tool/verification.sh +++ b/scripts/tools/verification_tool/verification.sh @@ -241,9 +241,9 @@ loggit "INFO" "*************************************************" loggit "INFO" "*** Checking RN2 crontab jobs ***" loggit "INFO" "*************************************************" -cronjob1="1 0 * * * /home/richard/raspberry-noaa-v2/scripts/schedule.sh -t" -cronjob2="@reboot /home/richard/raspberry-noaa-v2/scripts/schedule.sh" -cronjob3="@reboot /home/richard/raspberry-noaa-v2/scripts/tools/scratch_perms.sh" +cronjob1="1 0 * * * ${HOME}/raspberry-noaa-v2/scripts/schedule.sh -t" +cronjob2="@reboot ${HOME}/raspberry-noaa-v2/scripts/schedule.sh" +cronjob3="@reboot ${HOME}/raspberry-noaa-v2/scripts/tools/scratch_perms.sh" cron1=$(crontab -l | grep -v "^#" | grep -F "${cronjob1}" | wc -l) cron2=$(crontab -l | grep -v "^#" | grep -F "${cronjob2}" | wc -l) cron3=$(crontab -l | grep -v "^#" | grep -F "${cronjob3}" | wc -l) From d4603c84a63c08bc2237feebd037c66e2e66fb4e Mon Sep 17 00:00:00 2001 From: Richard Creasey - AI4Y <69941625+creas002@users.noreply.github.com> Date: Tue, 13 Aug 2024 07:00:30 -0400 Subject: [PATCH 5/7] Beta development - Setting SDR Device ID, Fixed Receive scripts to pass PPM Offset, Fixed dependancies to work on OS Lite versions (#1049) * Setting SDR Device ID * Update setting_sdr_source_id.md * Update setting_sdr_source_id.md * Update setting_sdr_source_id.md - fixed mispelling * Update setting_sdr_source_id.md - Fixed 2nd typo * Update setting_sdr_source_id.md - Fixed more typo's (SMH) * Update setting_sdr_source_id.md - Reformatting * Update setting_sdr_source_id.md * beta-development - Pass missing --ppm_correction parameter to satdump Tested PPM Offset was passed and processed by satdump correctly when receive scripts were called from AT jobs with settings.yml values of : noaa_15_freq_offset: -2 noaa_18_freq_offset: -1 noaa_19_freq_offset: 0 meteor_m2_3_freq_offset: 1 meteor_m2_4_freq_offset: 2 * beta-development - bug fix - OS Lite versions Bookworm 64 & Bullseye 32 OS Lite versions Bookworm 64 & Bullseye 32 fail on fresh OS install I have tested this fix on Bookworm 64-bit full & lite as well as Bullseye 32-bit Full/lite OS Lite versions do not have .config, but when its created as as part of the .config/meteordemod task below The .config ownership of top directory is root:root 755 when this happens and it needs to be target_user:target_user 700 * Clean up Bogus config/annotation directory created under $HOME RN2 installs have been placing a second config/annotation directory under ${HOME} which is not used. As part of this clean up the verification tool permissions list has this directory and is sub directory removed from being checked. * Removed unneeded task --- ansible/roles/common/tasks/configs.yml | 7 - ansible/roles/common/tasks/dependencies.yml | 13 ++ docs/setting_sdr_source_id.md | 195 ++++++++++++++++++ scripts/receive_meteor.sh | 2 +- scripts/receive_noaa.sh | 2 +- .../verification_tool/config/permissions.list | 2 - 6 files changed, 210 insertions(+), 11 deletions(-) create mode 100644 docs/setting_sdr_source_id.md mode change 100755 => 100644 scripts/receive_meteor.sh diff --git a/ansible/roles/common/tasks/configs.yml b/ansible/roles/common/tasks/configs.yml index 15b67cd2..75f9252c 100644 --- a/ansible/roles/common/tasks/configs.yml +++ b/ansible/roles/common/tasks/configs.yml @@ -104,13 +104,6 @@ enabled: yes when: (wifi_powermgmt_script.changed or wifi_powermgmt_service.changed) and (disable_wifi_power_mgmt|bool) -- name: annotation directory - file: - path: /home/{{ target_user }}/config/annotation - state: directory - owner: "{{ target_user }}" - group: "{{ target_user }}" - mode: 0755 - name: annotation file (sample for modification) copy: diff --git a/ansible/roles/common/tasks/dependencies.yml b/ansible/roles/common/tasks/dependencies.yml index eceef796..d7264b6c 100644 --- a/ansible/roles/common/tasks/dependencies.yml +++ b/ansible/roles/common/tasks/dependencies.yml @@ -228,6 +228,19 @@ # state: present # update_cache: no +# OS Lite versions do not have .config, but when its created as as part of the .config/meteordemod task below +# The .config ownership of top directory is root:root 755 when this happens and it needs to be target_user:target_user 700 +# +# This problem does not occur on OS Full installations + +- name: .config directory ownership + file: + path: /home/{{ target_user }}/.config + state: directory + owner: "{{ target_user }}" + group: "{{ target_user }}" + mode: 0700 + - name: Check if MeteorDemod is installed stat: path: /usr/local/bin/meteordemod diff --git a/docs/setting_sdr_source_id.md b/docs/setting_sdr_source_id.md new file mode 100644 index 00000000..e14e6f6f --- /dev/null +++ b/docs/setting_sdr_source_id.md @@ -0,0 +1,195 @@ +![Raspberry NOAA](../assets/header_1600_v2.png) + +# Setting SDR Device ID + +Good news - If you are using more than 1 SDR Dongle in your RN2 configuration and you wish to assign a particular SDR Dongle/Antenna pair to a satellite, you can! + + Work flow: + + #1 - Assign a unique serial # to each RTL-SDR Dongle that you wish to specitically assign to a satellite + #2 - Update settings.yml + #3 - Execute install_and_upgrade.sh + #4 - After the scheduled job executes for the satellite you assigned a unique device id to, confirm correct device ID was used. + + These example instructions are for RTL-SDR Dongles. + + Step #1 - Assign a unique serial # to each RTL-SDR Dongle + + RTL Serial# programmed into the SDR and the sdr_device_id in settings.yml must not have any leading ZERO's. + The serial number must be no more than 8 characters and it must be an integer and must not have any leading ZERO's. + +For example it can be **0** or it can be set as high as **99999999** It cannot have leading ZERO's **00007777** + + +Check currect serial# of installed SDR Dongle's + + rtl_test -t + Found 2 device(s): + 0: RTLSDRBlog, Blog V4, SN: 00000001 + 1: RTLSDRBlog, Blog V4, SN: 00000001 + +Change the SDR serial #, when prompted, select 'y' to change +Since our SDR Device ID's must fall between 0-99999999 For this example we will update both SDR Dongles with serial #'s 1 & 2, +so remove all but the one of the SDR's whose serial # you want to update before running rtl_eeprom utility. + + rtl_eeprom -s 1 + Found 1 device(s): + 0: Generic RTL2832U OEM + + Using device 0: Generic RTL2832U OEM + Found Rafael Micro R828D tuner + RTL-SDR Blog V4 Detected + + Current configuration: + __________________________________ + Vendor ID: 0x0bda + Product ID: 0x2838 + Manufacturer: RTLSDRBlog + Product: Blog V4 + Serial number: 00000001 + Serial number enabled: yes + IR endpoint enabled: yes + Remote wakeup enabled: no + __________________________________ + + New configuration: + __________________________________ + Vendor ID: 0x0bda + Product ID: 0x2838 + Manufacturer: RTLSDRBlog + Product: Blog V4 + Serial number: 1 + Serial number enabled: yes + IR endpoint enabled: yes + Remote wakeup enabled: no + __________________________________ + Write new configuration to device [y/n]? y + + Configuration successfully written. + Please replug the device for changes to take effect. + + +After removing and reinstalling the SDR Dongle, Confirm the serial #1 written is correct + + rtl_test + Found 1 device(s): + 0: RTLSDRBlog, Blog V4, SN: 1 + +Now remove that SDR Dongle and insert the second SDR Dongle which we will assign serial #2 + + rtl_eeprom -s 2 + Found 1 device(s): + 0: Generic RTL2832U OEM + + Using device 0: Generic RTL2832U OEM + Found Rafael Micro R828D tuner + RTL-SDR Blog V4 Detected + + Current configuration: + __________________________________________ + Vendor ID: 0x0bda + Product ID: 0x2838 + Manufacturer: RTLSDRBlog + Product: Blog V4 + Serial number: 00000001 + Serial number enabled: yes + IR endpoint enabled: yes + Remote wakeup enabled: no + __________________________________________ + + New configuration: + __________________________________________ + Vendor ID: 0x0bda + Product ID: 0x2838 + Manufacturer: RTLSDRBlog + Product: Blog V4 + Serial number: 2 + Serial number enabled: yes + IR endpoint enabled: yes + Remote wakeup enabled: no + __________________________________________ + Write new configuration to device [y/n]? y + + Configuration successfully written. + Please replug the device for changes to take effect. + + +After removing and reinstalling the second SDR Dongle, Confirm the serial #2 written is correct + + rtl_test + Found 1 device(s): + 0: RTLSDRBlog, Blog V4, SN: 2 + + +Now insert all the SDR dongles and ensure they show up as Serial #1 & #2 + + rtl_test + Found 2 device(s): + 0: RTLSDRBlog, Blog V4, SN: 1 + 1: RTLSDRBlog, Blog V4, SN: 2 + + + Step #2 - Update settings.yml + +Make a backup before changing settings.yml, just in case... + + cp -p ${HOME}/raspberry-noaa-v2/config/settings.yml ${HOME}/raspberry-noaa-v2/config/settings.yml.pre_device_id_change + +In settings.yml you must to enable use_device_string + + use_device_string: true + +For each satellite that you want to assign a specific device id for, you must update its respective value. + + Example only... + noaa_15_sdr_device_id: 1 + noaa_18_sdr_device_id: 1 + noaa_19_sdr_device_id: 1 + + meteor_m2_3_sdr_device_id: 2 + meteor_m2_4_sdr_device_id: 2 + + + Step #3 - Execute install_and_upgrade.sh + + cd ${HOME}/raspberry-noaa-v2 + ./install_and_upgrade.sh + + Step #4 - After the scheduled job executes for the satellite you assigned a unique device id to, confirm that the correct device ID was used. + + + view /var/log/raspberry-noaa-v2/output.log + +Search for source_id by typing `/source_id` with each repeating forward `/` you type it should search through the file for occurances. + +Here you can see satdump saw both serial #1 & serial #2, since I set NOAA 15 to use Serial #1, that is what it used for source_id : "1" + + [15:24:52 - 12/08/2024] ^[[36m(D) Device RTLSDRBlog Blog V4 #1 + [15:24:52 - 12/08/2024] ^[[36m(D) Device RTLSDRBlog Blog V4 #2 + [15:24:52 - 12/08/2024] ^[[36m(D) Device RTL-TCP + [15:24:52 - 12/08/2024] ^[[36m(D) Device SDR++ Server + [15:24:52 - 12/08/2024] ^[[36m(D) Device SpyServer + Found Rafael Micro R828D tuner + RTL-SDR Blog V4 Detected + [15:24:53 - 12/08/2024] ^[[36m(D) Set RTL-SDR samplerate to 1024000 + [15:24:53 - 12/08/2024] ^[[36m(D) Set RTL-SDR frequency to 137620000 + [15:24:53 - 12/08/2024] ^[[36m(D) Set RTL-SDR Bias to 0 + [15:24:53 - 12/08/2024] ^[[36m(D) Set RTL-SDR AGC to 0 + [15:24:53 - 12/08/2024] ^[[36m(D) Set RTL-SDR Gain to 49 + [15:24:53 - 12/08/2024] ^[[36m(D) Set RTL-SDR PPM Correction to -3 + [15:24:53 - 12/08/2024] ^[[36m(D) Parameters : + [15:24:53 - 12/08/2024] ^[[36m(D) - autocrop_wedges : true + [15:24:53 - 12/08/2024] ^[[36m(D) - baseband_format : "cf32" + [15:24:53 - 12/08/2024] ^[[36m(D) - buffer_size : 1000000 + [15:24:53 - 12/08/2024] ^[[36m(D) - frequency : 137620000 + [15:24:53 - 12/08/2024] ^[[36m(D) - gain : 49.6 + [15:24:53 - 12/08/2024] ^[[36m(D) - ppm_correction : -3 + [15:24:53 - 12/08/2024] ^[[36m(D) - samplerate : 1024000 + [15:24:53 - 12/08/2024] ^[[36m(D) - satellite_number : 15 + [15:24:53 - 12/08/2024] ^[[36m(D) - save_wav : true + [15:24:53 - 12/08/2024] ^[[36m(D) - sdrpp_noise_reduction : true + [15:24:53 - 12/08/2024] ^[[36m(D) - source : "rtlsdr" + [15:24:53 - 12/08/2024] ^[[36m(D) - source_id : "1" + +Good luck! + diff --git a/scripts/receive_meteor.sh b/scripts/receive_meteor.sh old mode 100755 new mode 100644 index 53ff7d23..25bbf159 --- a/scripts/receive_meteor.sh +++ b/scripts/receive_meteor.sh @@ -169,7 +169,7 @@ polar_direction=0 log "Recording ${NOAA_HOME} via $receiver at ${METEOR_FREQUENCY} MHz using SatDump record " "INFO" audio_temporary_storage_directory="$(dirname "${RAMFS_FILE_BASE}")" -$SATDUMP live meteor_m2-x_lrpt${mode} "$audio_temporary_storage_directory" --source $receiver --samplerate $samplerate --frequency "${METEOR_FREQUENCY}e6" $sdr_id_option $SDR_DEVICE_ID $gain_option $GAIN $bias_tee_option $finish_processing --fill_missing --timeout $CAPTURE_TIME >> $NOAA_LOG 2>&1 +$SATDUMP live meteor_m2-x_lrpt${mode} "$audio_temporary_storage_directory" --source $receiver --samplerate $samplerate --ppm_correction ${FREQ_OFFSET} --frequency "${METEOR_FREQUENCY}e6" $sdr_id_option $SDR_DEVICE_ID $gain_option $GAIN $bias_tee_option $finish_processing --fill_missing --timeout $CAPTURE_TIME >> $NOAA_LOG 2>&1 mv "$audio_temporary_storage_directory/meteor_m2-x_lrpt${mode}.cadu" "${RAMFS_AUDIO_BASE}.cadu" log "Removing old bmp, gcp, and dat files" "INFO" diff --git a/scripts/receive_noaa.sh b/scripts/receive_noaa.sh index d702d09f..e27c30ed 100755 --- a/scripts/receive_noaa.sh +++ b/scripts/receive_noaa.sh @@ -167,7 +167,7 @@ daylight=$((SUN_ELEV > SUN_MIN_ELEV ? 1 : 0)) #start capture log "Recording ${NOAA_HOME} via ${RECEIVER_TYPE} at ${freq} MHz via SatDump live pipeline" "INFO" audio_temporary_storage_directory="$(dirname "${RAMFS_FILE_BASE}")" -$SATDUMP live noaa_apt $audio_temporary_storage_directory --source $receiver --samplerate $samplerate --frequency "${NOAA_FREQUENCY}e6" --satellite_number ${SAT_NUMBER} --sdrpp_noise_reduction $sdr_id_option $SDR_DEVICE_ID $gain_option $GAIN $bias_tee_option $crop_topbottom --start_timestamp $PASS_START --save_wav $finish_processing --timeout $CAPTURE_TIME >> $NOAA_LOG 2>&1 +$SATDUMP live noaa_apt $audio_temporary_storage_directory --source $receiver --samplerate $samplerate --ppm_correction ${FREQ_OFFSET} --frequency "${NOAA_FREQUENCY}e6" --satellite_number ${SAT_NUMBER} --sdrpp_noise_reduction $sdr_id_option $SDR_DEVICE_ID $gain_option $GAIN $bias_tee_option $crop_topbottom --start_timestamp $PASS_START --save_wav $finish_processing --timeout $CAPTURE_TIME >> $NOAA_LOG 2>&1 rm "$audio_temporary_storage_directory/dataset.json" "$audio_temporary_storage_directory/product.cbor" >> $NOAA_LOG 2>&1 log "Files recorded" "INFO" diff --git a/scripts/tools/verification_tool/config/permissions.list b/scripts/tools/verification_tool/config/permissions.list index 7eca5239..e566a4e4 100644 --- a/scripts/tools/verification_tool/config/permissions.list +++ b/scripts/tools/verification_tool/config/permissions.list @@ -2,8 +2,6 @@ directory 700 $USER $USER /home/$USER/.ansible/tmp directory 700 $USER $USER /home/$USER/.config directory 755 $USER $USER /home/$USER directory 755 $USER $USER /home/$USER/.ansible -directory 755 $USER $USER /home/$USER/config -directory 755 $USER $USER /home/$USER/config/annotation directory 755 $USER $USER /home/$USER/.config/meteordemod directory 755 $USER $USER /home/$USER/.config/meteordemod/kernels directory 755 $USER $USER /home/$USER/.config/meteordemod/ShapeFiles From e7ef2d7b1ff282d052d01d0054897615b60c402f Mon Sep 17 00:00:00 2001 From: MihajloPi - YU4MPI Date: Tue, 13 Aug 2024 14:11:08 +0200 Subject: [PATCH 6/7] Fix to be tested for RTL-SDR PPM correction (#1051) * Fixing filling issue for SatDump Meteor images * Fix to be tested --- scripts/receive_meteor.sh | 5 +++-- scripts/receive_noaa.sh | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/receive_meteor.sh b/scripts/receive_meteor.sh index 25bbf159..07997ec9 100644 --- a/scripts/receive_meteor.sh +++ b/scripts/receive_meteor.sh @@ -106,9 +106,10 @@ mode="$([[ "${!interleaving}" == "true" ]] && echo "_80k" || echo "")" if [[ "$receiver" == "rtlsdr" ]]; then gain_option="--gain" + ppm_correction="--ppm_correction" else gain_option="--general_gain" -fi +fii if [[ "$USE_DEVICE_STRING" == "true" ]]; then sdr_id_option="--source_id" @@ -169,7 +170,7 @@ polar_direction=0 log "Recording ${NOAA_HOME} via $receiver at ${METEOR_FREQUENCY} MHz using SatDump record " "INFO" audio_temporary_storage_directory="$(dirname "${RAMFS_FILE_BASE}")" -$SATDUMP live meteor_m2-x_lrpt${mode} "$audio_temporary_storage_directory" --source $receiver --samplerate $samplerate --ppm_correction ${FREQ_OFFSET} --frequency "${METEOR_FREQUENCY}e6" $sdr_id_option $SDR_DEVICE_ID $gain_option $GAIN $bias_tee_option $finish_processing --fill_missing --timeout $CAPTURE_TIME >> $NOAA_LOG 2>&1 +$SATDUMP live meteor_m2-x_lrpt${mode} "$audio_temporary_storage_directory" --source $receiver --samplerate $samplerate $ppm_correction ${FREQ_OFFSET} --frequency "${METEOR_FREQUENCY}e6" $sdr_id_option $SDR_DEVICE_ID $gain_option $GAIN $bias_tee_option $finish_processing --fill_missing --timeout $CAPTURE_TIME >> $NOAA_LOG 2>&1 mv "$audio_temporary_storage_directory/meteor_m2-x_lrpt${mode}.cadu" "${RAMFS_AUDIO_BASE}.cadu" log "Removing old bmp, gcp, and dat files" "INFO" diff --git a/scripts/receive_noaa.sh b/scripts/receive_noaa.sh index e27c30ed..10c8a1aa 100755 --- a/scripts/receive_noaa.sh +++ b/scripts/receive_noaa.sh @@ -120,6 +120,7 @@ esac if [[ "$receiver" == "rtlsdr" ]]; then gain_option="--gain" + ppm_correction="--ppm_correction" else gain_option="--general_gain" fi @@ -167,7 +168,7 @@ daylight=$((SUN_ELEV > SUN_MIN_ELEV ? 1 : 0)) #start capture log "Recording ${NOAA_HOME} via ${RECEIVER_TYPE} at ${freq} MHz via SatDump live pipeline" "INFO" audio_temporary_storage_directory="$(dirname "${RAMFS_FILE_BASE}")" -$SATDUMP live noaa_apt $audio_temporary_storage_directory --source $receiver --samplerate $samplerate --ppm_correction ${FREQ_OFFSET} --frequency "${NOAA_FREQUENCY}e6" --satellite_number ${SAT_NUMBER} --sdrpp_noise_reduction $sdr_id_option $SDR_DEVICE_ID $gain_option $GAIN $bias_tee_option $crop_topbottom --start_timestamp $PASS_START --save_wav $finish_processing --timeout $CAPTURE_TIME >> $NOAA_LOG 2>&1 +$SATDUMP live noaa_apt $audio_temporary_storage_directory --source $receiver --samplerate $samplerate $ppm_correction ${FREQ_OFFSET} --frequency "${NOAA_FREQUENCY}e6" --satellite_number ${SAT_NUMBER} --sdrpp_noise_reduction $sdr_id_option $SDR_DEVICE_ID $gain_option $GAIN $bias_tee_option $crop_topbottom --start_timestamp $PASS_START --save_wav $finish_processing --timeout $CAPTURE_TIME >> $NOAA_LOG 2>&1 rm "$audio_temporary_storage_directory/dataset.json" "$audio_temporary_storage_directory/product.cbor" >> $NOAA_LOG 2>&1 log "Files recorded" "INFO" From 3d23c34a85fcf1b31c381ef8ccceae6969fe18cc Mon Sep 17 00:00:00 2001 From: Richard Creasey - AI4Y <69941625+creas002@users.noreply.github.com> Date: Wed, 14 Aug 2024 10:36:02 -0400 Subject: [PATCH 7/7] Beta development - modified receive scripts to pass PPM & Offset based on receiver type (#1052) * Setting SDR Device ID * Update setting_sdr_source_id.md * Update setting_sdr_source_id.md * Update setting_sdr_source_id.md - fixed mispelling * Update setting_sdr_source_id.md - Fixed 2nd typo * Update setting_sdr_source_id.md - Fixed more typo's (SMH) * Update setting_sdr_source_id.md - Reformatting * Update setting_sdr_source_id.md * beta-development - Pass missing --ppm_correction parameter to satdump Tested PPM Offset was passed and processed by satdump correctly when receive scripts were called from AT jobs with settings.yml values of : noaa_15_freq_offset: -2 noaa_18_freq_offset: -1 noaa_19_freq_offset: 0 meteor_m2_3_freq_offset: 1 meteor_m2_4_freq_offset: 2 * beta-development - bug fix - OS Lite versions Bookworm 64 & Bullseye 32 OS Lite versions Bookworm 64 & Bullseye 32 fail on fresh OS install I have tested this fix on Bookworm 64-bit full & lite as well as Bullseye 32-bit Full/lite OS Lite versions do not have .config, but when its created as as part of the .config/meteordemod task below The .config ownership of top directory is root:root 755 when this happens and it needs to be target_user:target_user 700 * Clean up Bogus config/annotation directory created under $HOME RN2 installs have been placing a second config/annotation directory under ${HOME} which is not used. As part of this clean up the verification tool permissions list has this directory and is sub directory removed from being checked. * Removed unneeded task * Reverting PPM changes to receive scripts ppm_correction should only be used for RTPSDR and RTL-TCP, there may be other receivers that can use it but unknown * Update noaa-v2.conf.j2 This was left out of ansible/roles/common/templates/noaa-v2.conf.j2 template file which caused an error for anyone enabling it. # Coronal mass ejection activity ENABLE_CORONAL={{ enable_coronal|lower }} * modified receive scripts to pass PPM & Offset based on receiver type Modified receivenoaa.sh & receive_meteor.sh scripts to pass PPM & Offset based on receiver type. Also added a log statement so everybody can see whats getting sent to satdump from output.log /home/richard/raspberry-noaa-v2/scripts/receive_noaa.sh "NOAA 18" NOAA-18-20240813-153343 /home/richard/raspberry-noaa-v2/tmp/orbit.tle 1723563223 3 32 Southbound E # I added setting FREQ_OFFSET="" when its not an rtlsdr receiver to prevent the Offset being passed to satdump if [[ "$receiver" == "rtlsdr" ]]; then gain_option="--gain" ppm_correction="--ppm_correction" else gain_option="--general_gain" FREQ_OFFSET="" fi I tested it for NOAA 18 and you can see PPM and Offset was passed to satdump as desired: richard@raspberrypi:~$ /home/richard/raspberry-noaa-v2/scripts/receive_noaa.sh "NOAA 18" NOAA-18-20240813-153343 /home/richard/raspberry-noaa-v2/tmp/orbit.tle 1723563223 3 32 Southbound E INFO : The system has enough space to store a NOAA pass on RAM INFO : Free : 7454 ; Required : 50 INFO : Direction Southbound INFO : Cropping SatDump NOAA images enabled INFO : Recording /home/richard/raspberry-noaa-v2 via rtlsdr at MHz via SatDump live pipeline INFO : /usr/bin/satdump live noaa_apt . --source rtlsdr --samplerate 1.024e6 --ppm_correction 0 --frequency 137.9125e6 --satellite_number 18 --sdrpp_noise_reduction --gain 49.6 --autocrop_wedges --start_timestamp 1723563313 --save_wav --timeout 3 INFO : Files recorded INFO : Resampling down audio INFO : Producing pristine image INFO : Bulding pass map Satdump log shows ppm was passed 14:08:43 - 13/08/2024] (D) Parameters : [14:08:43 - 13/08/2024] (D) - align_timestamps : true [14:08:43 - 13/08/2024] (D) - audio_samplerate : 50000.0 [14:08:43 - 13/08/2024] (D) - autocrop_wedges : true [14:08:43 - 13/08/2024] (D) - baseband_format : "cf32" [14:08:43 - 13/08/2024] (D) - buffer_size : 1000000 [14:08:43 - 13/08/2024] (D) - frequency : 137912500 [14:08:43 - 13/08/2024] (D) - gain : 49.6 [14:08:43 - 13/08/2024] (D) - max_crop_stddev : 3500 [14:08:43 - 13/08/2024] (D) - ppm_correction : 0 [14:08:43 - 13/08/2024] (D) - samplerate : 1024000 # Since I don't have another SDR receiver type, I flipped the logic to test that neither --ppm_correction or Offset values were passed to setdump using: if [[ "$receiver" == "rtlsdr" ]]; then gain_option="--general_gain" FREQ_OFFSET="" else gain_option="--gain" ppm_correction="--ppm_correction" fi richard@raspberrypi:~$ /home/richard/raspberry-noaa-v2/scripts/receive_noaa.sh "NOAA 18" NOAA-18-20240813-153343 /home/richard/raspberry-noaa-v2/tmp/orbit.tle 1723563223 3 32 Southbound E INFO : The system has enough space to store a NOAA pass on RAM INFO : Free : 7452 ; Required : 50 INFO : Direction Southbound INFO : Cropping SatDump NOAA images enabled INFO : Recording /home/richard/raspberry-noaa-v2 via rtlsdr at MHz via SatDump live pipeline INFO : /usr/bin/satdump live noaa_apt . --source rtlsdr --samplerate 1.024e6 --frequency 137.9125e6 --satellite_number 18 --sdrpp_noise_reduction --general_gain 49.6 --autocrop_wedges --start_timestamp 1723563313 --save_wav --timeout 3 ^CINFO : Files recorded INFO : Resampling down audio INFO : Producing pristine image INFO : Bulding pass map Satdump log shows ppm & offset was not passed [14:11:17 - 13/08/2024] (D) Parameters : [14:11:17 - 13/08/2024] (D) - align_timestamps : true [14:11:17 - 13/08/2024] (D) - audio_samplerate : 50000.0 [14:11:17 - 13/08/2024] (D) - autocrop_wedges : true [14:11:17 - 13/08/2024] (D) - baseband_format : "cf32" [14:11:17 - 13/08/2024] (D) - buffer_size : 1000000 [14:11:17 - 13/08/2024] (D) - frequency : 137912500 [14:11:17 - 13/08/2024] (D) - general_gain : 49.6 [14:11:17 - 13/08/2024] (D) - max_crop_stddev : 3500 [14:11:17 - 13/08/2024] (D) - samplerate : 1024000 I modified receive_metoer.sh and performed the same testing /home/richard/raspberry-noaa-v2/scripts/receive_meteor.sh "METEOR-M2 4" METEOR-M2-4-20240813-194754 /home/richard/raspberry-noaa-v2/tmp/orbit.tle 1723578474 3 83 Northbound W I tested it for M2-4 and you can see PPM and Offset was passed to satdump as desired: INFO : The system has enough space to store a Meteor pass on RAM INFO : Free : 7462 ; Required : 10 INFO : Direction Northbound INFO : I'll flip this image pass because FLIP_METEOR_IMG is set to true and PASS_DIRECTION is Northbound INFO : Recording /home/richard/raspberry-noaa-v2 via rtlsdr at 137.9000 MHz using SatDump record INFO : /usr/bin/satdump live meteor_m2-x_lrpt . --source rtlsdr --samplerate 1.024e6 --ppm_correction 0 --frequency 137.9000e6 --gain 49.6 --fill_missing --timeout 3 INFO : Removing old bmp, gcp, and dat files INFO : Running MeteorDemod to demodulate OQPSK file, rectify (spread) images, create heat map and composites and convert them to JPG INFO : Waiting for files to close Satdump log shows ppm was passed [14:32:22 - 13/08/2024] (D) Parameters : [14:32:22 - 13/08/2024] (D) - baseband_format : "cf32" [14:32:22 - 13/08/2024] (D) - buffer_size : 1000000 [14:32:22 - 13/08/2024] (D) - cadu_size : 8192 [14:32:22 - 13/08/2024] (D) - constellation : "oqpsk" [14:32:22 - 13/08/2024] (D) - derandomize : true [14:32:22 - 13/08/2024] (D) - fill_missing : true [14:32:22 - 13/08/2024] (D) - frequency : 137900000 [14:32:22 - 13/08/2024] (D) - gain : 49.6 [14:32:22 - 13/08/2024] (D) - nrzm : true [14:32:22 - 13/08/2024] (D) - ppm_correction : 0 [14:32:22 - 13/08/2024] (D) - rs_dualbasis : false [14:32:22 - 13/08/2024] (D) - rs_i : 4 [14:32:22 - 13/08/2024] (D) - rs_type : "rs223" [14:32:22 - 13/08/2024] (D) - rs_usecheck : true [14:32:22 - 13/08/2024] (D) - samplerate : 1024000 # Since I don't have another SDR receiver type, I flipped the logic to test that neither --ppm_correction or Offset values were passed to setdump using: NFO : The system has enough space to store a Meteor pass on RAM INFO : Free : 7463 ; Required : 10 INFO : Direction Northbound INFO : I'll flip this image pass because FLIP_METEOR_IMG is set to true and PASS_DIRECTION is Northbound INFO : Recording /home/richard/raspberry-noaa-v2 via rtlsdr at 137.9000 MHz using SatDump record INFO : /usr/bin/satdump live meteor_m2-x_lrpt . --source rtlsdr --samplerate 1.024e6 --frequency 137.9000e6 --general_gain 49.6 --fill_missing --timeout 3 INFO : Removing old bmp, gcp, and dat files INFO : Running MeteorDemod to demodulate OQPSK file, rectify (spread) images, create heat map and composites and convert them to JPG INFO : Waiting for files to close Satdump log shows ppm & offset was not passed [14:35:06 - 13/08/2024] (D) Parameters : [14:35:06 - 13/08/2024] (D) - baseband_format : "cf32" [14:35:06 - 13/08/2024] (D) - buffer_size : 1000000 [14:35:06 - 13/08/2024] (D) - cadu_size : 8192 [14:35:06 - 13/08/2024] (D) - constellation : "oqpsk" [14:35:06 - 13/08/2024] (D) - derandomize : true [14:35:06 - 13/08/2024] (D) - fill_missing : true [14:35:06 - 13/08/2024] (D) - frequency : 137900000 [14:35:06 - 13/08/2024] (D) - general_gain : 49.6 [14:35:06 - 13/08/2024] (D) - nrzm : true [14:35:06 - 13/08/2024] (D) - rs_dualbasis : false [14:35:06 - 13/08/2024] (D) - rs_i : 4 [14:35:06 - 13/08/2024] (D) - rs_type : "rs223" [14:35:06 - 13/08/2024] (D) - rs_usecheck : true [14:35:06 - 13/08/2024] (D) - samplerate : 1024000 * Ensure ownership/permissions are set correctly for key scripts * Ensure ownership/permissions are set correctly for key scripts --------- Co-authored-by: MihajloPi - YU4MPI --- ansible/roles/common/tasks/configs.yml | 32 +++++++++++++++++++ .../roles/common/templates/noaa-v2.conf.j2 | 3 ++ scripts/receive_meteor.sh | 4 ++- scripts/receive_noaa.sh | 2 ++ 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/ansible/roles/common/tasks/configs.yml b/ansible/roles/common/tasks/configs.yml index 75f9252c..c1819d41 100644 --- a/ansible/roles/common/tasks/configs.yml +++ b/ansible/roles/common/tasks/configs.yml @@ -154,4 +154,36 @@ owner: "{{ target_user }}" group: "{{ target_user }}" mode: 0755 + +- name: receive_noaa.sh ownership permissions + file: + path: /home/{{ target_user }}/raspberry-noaa-v2/scripts/receive_noaa.sh + state: file + owner: "{{ target_user }}" + group: "{{ target_user }}" + mode: 0755 + +- name: receive_meteor.sh ownership permissions + file: + path: /home/{{ target_user }}/raspberry-noaa-v2/scripts/receive_meteor.sh + state: file + owner: "{{ target_user }}" + group: "{{ target_user }}" + mode: 0755 + +- name: schedule.sh ownership permissions + file: + path: /home/{{ target_user }}/raspberry-noaa-v2/scripts/schedule.sh + state: file + owner: "{{ target_user }}" + group: "{{ target_user }}" + mode: 0755 + +- name: common.sh ownership permissions + file: + path: /home/{{ target_user }}/raspberry-noaa-v2/scripts/common.sh + state: file + owner: "{{ target_user }}" + group: "{{ target_user }}" + mode: 0755 ... diff --git a/ansible/roles/common/templates/noaa-v2.conf.j2 b/ansible/roles/common/templates/noaa-v2.conf.j2 index ce68d0be..095eb2c9 100644 --- a/ansible/roles/common/templates/noaa-v2.conf.j2 +++ b/ansible/roles/common/templates/noaa-v2.conf.j2 @@ -161,6 +161,9 @@ NTP_SERVER={{ ntp_server }} # Satellite Visualization ENABLE_SATVIS={{ enable_satvis|lower }} +# Coronal mass ejection activity +ENABLE_CORONAL_GIF={{ enable_coronal|lower }} + # Web Server Configuration WEB_SERVER_NAME={{ web_server_name }} WEBPANEL_PORT={{ web_port }} diff --git a/scripts/receive_meteor.sh b/scripts/receive_meteor.sh index 07997ec9..9d03d23d 100644 --- a/scripts/receive_meteor.sh +++ b/scripts/receive_meteor.sh @@ -109,7 +109,8 @@ if [[ "$receiver" == "rtlsdr" ]]; then ppm_correction="--ppm_correction" else gain_option="--general_gain" -fii + FREQ_OFFSET="" +fi if [[ "$USE_DEVICE_STRING" == "true" ]]; then sdr_id_option="--source_id" @@ -170,6 +171,7 @@ polar_direction=0 log "Recording ${NOAA_HOME} via $receiver at ${METEOR_FREQUENCY} MHz using SatDump record " "INFO" audio_temporary_storage_directory="$(dirname "${RAMFS_FILE_BASE}")" +log "$SATDUMP live meteor_m2-x_lrpt${mode} $audio_temporary_storage_directory --source $receiver --samplerate $samplerate $ppm_correction ${FREQ_OFFSET} --frequency ${METEOR_FREQUENCY}e6 $sdr_id_option $SDR_DEVICE_ID $gain_option $GAIN $bias_tee_option $finish_processing --fill_missing --timeout $CAPTURE_TIME" "INFO" $SATDUMP live meteor_m2-x_lrpt${mode} "$audio_temporary_storage_directory" --source $receiver --samplerate $samplerate $ppm_correction ${FREQ_OFFSET} --frequency "${METEOR_FREQUENCY}e6" $sdr_id_option $SDR_DEVICE_ID $gain_option $GAIN $bias_tee_option $finish_processing --fill_missing --timeout $CAPTURE_TIME >> $NOAA_LOG 2>&1 mv "$audio_temporary_storage_directory/meteor_m2-x_lrpt${mode}.cadu" "${RAMFS_AUDIO_BASE}.cadu" diff --git a/scripts/receive_noaa.sh b/scripts/receive_noaa.sh index 10c8a1aa..4ea859a2 100755 --- a/scripts/receive_noaa.sh +++ b/scripts/receive_noaa.sh @@ -123,6 +123,7 @@ if [[ "$receiver" == "rtlsdr" ]]; then ppm_correction="--ppm_correction" else gain_option="--general_gain" + FREQ_OFFSET="" fi if [[ "$USE_DEVICE_STRING" == "true" ]]; then @@ -168,6 +169,7 @@ daylight=$((SUN_ELEV > SUN_MIN_ELEV ? 1 : 0)) #start capture log "Recording ${NOAA_HOME} via ${RECEIVER_TYPE} at ${freq} MHz via SatDump live pipeline" "INFO" audio_temporary_storage_directory="$(dirname "${RAMFS_FILE_BASE}")" +log "$SATDUMP live noaa_apt $audio_temporary_storage_directory --source $receiver --samplerate $samplerate $ppm_correction ${FREQ_OFFSET} --frequency "${NOAA_FREQUENCY}e6" --satellite_number ${SAT_NUMBER} --sdrpp_noise_reduction $sdr_id_option $SDR_DEVICE_ID $gain_option $GAIN $bias_tee_option $crop_topbottom --start_timestamp $PASS_START --save_wav $finish_processing --timeout $CAPTURE_TIME" "INFO" $SATDUMP live noaa_apt $audio_temporary_storage_directory --source $receiver --samplerate $samplerate $ppm_correction ${FREQ_OFFSET} --frequency "${NOAA_FREQUENCY}e6" --satellite_number ${SAT_NUMBER} --sdrpp_noise_reduction $sdr_id_option $SDR_DEVICE_ID $gain_option $GAIN $bias_tee_option $crop_topbottom --start_timestamp $PASS_START --save_wav $finish_processing --timeout $CAPTURE_TIME >> $NOAA_LOG 2>&1 rm "$audio_temporary_storage_directory/dataset.json" "$audio_temporary_storage_directory/product.cbor" >> $NOAA_LOG 2>&1 log "Files recorded" "INFO"