diff --git a/README.md b/README.md index bba09d8f8..25047b08b 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) diff --git a/ansible/core.yml b/ansible/core.yml index 62cd867c2..6766bfdc8 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 diff --git a/ansible/roles/common/files/rn2_uninstall.sh b/ansible/roles/common/files/rn2_uninstall.sh index eb30f7293..919fb521b 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 diff --git a/ansible/roles/common/tasks/configs.yml b/ansible/roles/common/tasks/configs.yml index 15b67cd2f..c1819d41a 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: @@ -161,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/tasks/dependencies.yml b/ansible/roles/common/tasks/dependencies.yml index eceef7965..d7264b6c3 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/ansible/roles/common/templates/noaa-v2.conf.j2 b/ansible/roles/common/templates/noaa-v2.conf.j2 index ce68d0be6..095eb2c96 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/docs/setting_sdr_source_id.md b/docs/setting_sdr_source_id.md new file mode 100644 index 000000000..e14e6f6fd --- /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 53ff7d233..9d03d23d6 --- a/scripts/receive_meteor.sh +++ b/scripts/receive_meteor.sh @@ -106,8 +106,10 @@ mode="$([[ "${!interleaving}" == "true" ]] && echo "_80k" || echo "")" if [[ "$receiver" == "rtlsdr" ]]; then gain_option="--gain" + ppm_correction="--ppm_correction" else gain_option="--general_gain" + FREQ_OFFSET="" fi if [[ "$USE_DEVICE_STRING" == "true" ]]; then @@ -169,7 +171,8 @@ 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 +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" log "Removing old bmp, gcp, and dat files" "INFO" diff --git a/scripts/receive_noaa.sh b/scripts/receive_noaa.sh index d702d09f4..4ea859a29 100755 --- a/scripts/receive_noaa.sh +++ b/scripts/receive_noaa.sh @@ -120,8 +120,10 @@ esac if [[ "$receiver" == "rtlsdr" ]]; then gain_option="--gain" + ppm_correction="--ppm_correction" else gain_option="--general_gain" + FREQ_OFFSET="" fi if [[ "$USE_DEVICE_STRING" == "true" ]]; then @@ -167,7 +169,8 @@ 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 +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" diff --git a/scripts/tools/verification_tool/config/permissions.list b/scripts/tools/verification_tool/config/permissions.list index 7eca52398..e566a4e4c 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 diff --git a/scripts/tools/verification_tool/verification.sh b/scripts/tools/verification_tool/verification.sh index f3d61c95e..d0d7d35bb 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)