From 62b014f5d56967e12edb128ab7ad81923feca075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me?= Date: Wed, 28 Aug 2024 12:42:43 +0200 Subject: [PATCH 1/3] Allow odd timezones in sun.py (#1056) * fixes #1021 * fixes #1055 --- scripts/tools/sun.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tools/sun.py b/scripts/tools/sun.py index 37d842938..e737f23de 100755 --- a/scripts/tools/sun.py +++ b/scripts/tools/sun.py @@ -14,7 +14,7 @@ load_envbash(config_file) # Use subprocess to get the local time offset from UTC -timezone = int(subprocess.check_output('echo $(date "+%:::z") | sed "s/\\([+-]\\)0\\?/\\1/"', shell=True, text=True)) +timezone = float(subprocess.check_output('echo $(date "+%:::z") | sed "s/\\([+-]\\)0\\?/\\1/" | sed "s/:30/.5/"', shell=True, text=True)) date = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(int(sys.argv[1]) - (timezone * 60 * 60))) From 7ecf5543a563d31399346ff86c896e7aa67b153d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me?= Date: Wed, 28 Aug 2024 12:43:37 +0200 Subject: [PATCH 2/3] Fix deprecation warning in heatmap.py (#1059) * fixes #1021 * fixes deprecation message for getsize and ANTIALIAS (will be removed in Pillow 10) --- scripts/testing/heatmap.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/testing/heatmap.py b/scripts/testing/heatmap.py index 0178d0de3..8b10ff865 100755 --- a/scripts/testing/heatmap.py +++ b/scripts/testing/heatmap.py @@ -461,12 +461,13 @@ def closest_index(n, m_list, interpolate=False): def word_aa(label, pt, fg_color, bg_color): f = ImageFont.truetype(vera_path, pt*3) - s = f.getsize(label) + left, top, right, bottom = f.getbbox(label) + s = [right - left, bottom - top] s = (s[0], pt*3 + 3) # getsize lies, manually compute w_img = Image.new("RGB", s, bg_color) w_draw = ImageDraw.Draw(w_img) w_draw.text((0, 0), label, font=f, fill=fg_color) - return w_img.resize((s[0]//3, s[1]//3), Image.ANTIALIAS) + return w_img.resize((s[0]//3, s[1]//3), Image.LANCZOS) def blend(percent, c1, c2): "c1 and c2 are RGB tuples" From 8b94629a12d8b9808959ce456de3860e803ba805 Mon Sep 17 00:00:00 2001 From: Richard Creasey - AI4Y <69941625+creas002@users.noreply.github.com> Date: Wed, 28 Aug 2024 06:44:19 -0400 Subject: [PATCH 3/3] Beta development - Update dependencies/yml - added become: yes for .config ownership (#1057) * 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 * Update dependencies/yml - added become: yes for .config ownership * Update facebook_push.md - updated doc Corrected testing syntax and added a useful link to get page token --------- Co-authored-by: MihajloPi - YU4MPI --- ansible/roles/common/tasks/dependencies.yml | 1 + docs/facebook_push.md | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ansible/roles/common/tasks/dependencies.yml b/ansible/roles/common/tasks/dependencies.yml index d7264b6c3..0f92a8929 100644 --- a/ansible/roles/common/tasks/dependencies.yml +++ b/ansible/roles/common/tasks/dependencies.yml @@ -234,6 +234,7 @@ # This problem does not occur on OS Full installations - name: .config directory ownership + become: yes file: path: /home/{{ target_user }}/.config state: directory diff --git a/docs/facebook_push.md b/docs/facebook_push.md index 8c37954b3..8176beeb8 100644 --- a/docs/facebook_push.md +++ b/docs/facebook_push.md @@ -18,16 +18,16 @@ and created a Facebook page, you must then set the application permissions to be * **API Key**: `FACEBOOK_ACCESS_TOKEN=""` + The Key you are to enter is your Page Token - [See How to get a Facebook page access token in 2024](https://www.sociablekit.com/how-to-get-a-facebook-page-access-token/) + ## Testing (Optional) If you want to run a manual test to ensure the Facebook configurations are acceptable, you can run a quick test from the command line and pass an actual image file (or many) to the command like so: ```bash -./scripts/push_processors/push_facebook.sh "test annotation" \ - "/srv/images/NOAA-18-20210212-091356-MCIR.jpg" \ - "/srv/images/NOAA-19-20210311-060645-ZA.jpg" \ - "/srv/images/NOAA-19-20210311-060645-spectrogram.png" +${HOME}/raspberry-noaa-v2/scripts/push_processors/push_facebook.py "test annotation" \ + "/srv/images/NOAA-15-20240826-143009-HVCT.jpg /srv/images/NOAA-15-20240826-143009-sea.jpg /srv/images/NOAA-15-20240826-143009-polar-direction.png" ``` If all goes well and the image paths passed are files that actually exist, you should see a new post on your