jekhokie / raspberry-noaa-v2

V2 of the fantastic Raspberry Pi NOAA setup
GNU General Public License v3.0
553 stars 101 forks source link

aarch64 support (#1031) #1032

Closed MihajloPi closed 3 months ago

MihajloPi commented 3 months ago

Fixed typo in README Modified dependencies.yml to support 64-bit Predict and Satdump New script strach_perms.sh to correct /run/user/${UID} after reboot New script set_os_config_kernel8.sh to modify kernel so wxtoimg will run New DEB file for 64-bit predict New DEB file for 64-bit satdump

Modified dependancies in support of : wxtoimg libraries on ARM64 wxtoimg symbolic link for ARM64 predict on ARM64

Modified tasks in support of : wxtoimg kernel8 Fixing /run/user/uid permissions on reboot

We have an intermittant conflict from dualing UDEV rule files. They are identifical, but sometimes cause Satdump not to be able to open RTL-SDR receiver when executed as a non-root user.

/usr/lib/udev/rules.d/60-librtlsdr0.rules is installed from OSMON's it clone RTL-SDR software" , which puts /lib/udev/rules.d/60-librtlsdr0.rules in place

Modified schedule.sh to unset XTERM variables which would cause NOAA annotations to fail when passes were scheduled via VNC using lxterminal.

Backing out --fill_missing to avoid merge conflict with parent

https://github.com/jekhokie/raspberry-noaa-v2/issues/1002

Modified polar_plot.py to resolve warning when generating AZ/EL & Direction images.

Example of warnings...

UserWarning: marker is redundantly defined by the 'marker' keyword argument and the fmt string "o" (-> marker='o'). The keyword argument will take precedence. p.plot(az_at_max_elev, max_elev, 'o', marker="*", markersize=12, label="Max El")

Since the source code to WXTOIMG is not available I used gdc (w/o symbols) and strace and see what is causing the 'free invalid pointer' error. I determined that it happens on application clean up after successfully processing the map overlay file into the final image. Everything is working correctly except the clean up of a 3rd memory location which is failing because it was already removed by the kernel I believe.

strace snippet: munmap(0xef6b8000, 20533248) = 0 munmap(0xee323000, 20533248) = 0 munmap(0xecf8e000, 20533248) = 0 writev(2, [{iov_base="free(): invalid pointer", iov_len=23}, {iov_base="\n", iov_len=1}], 2) = 24

The first two munmap calls worked and the third munmap fails as its already deallocated.

The munmap() system call deletes the mappings for the specified address range, and causes further references to addresses within the range to generate invalid memory references. The region is also automatically unmapped when the process is terminated. On the other hand, closing the file descriptor does not unmap the region.

At this point I'm happy to know it successfully allocated those memory slots for processing

mmap2(NULL, 20533248, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xef6b8000 mmap2(NULL, 20533248, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xee323000 mmap2(NULL, 20533248, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xecf8e000

but it was freeing up memory on the last address that it threw the error. This modification to receive_noaa.sh is to filter out the 'free invalid pointer' and 'Aborted' messages before its written out to the RN2 log

Define XDG_RUNTIME_DIR with proper permissions

The verification tool can be used to help identify RN2 installation/configuration issues which may potentially prevent proper functioning f capture/decode/processing of APT telemetry data.

Execute the verification script by passing the required argument [ quick | full ]

$HOME/raspberry-noaa-v2/scripts/tools/verification.sh

Argument required: ./verification.sh quick or ./verification.sh full (~ 1 minute) (~ 5 minutes)

#########

NOTES

#########

Dryrun of binaries includes executing :

nxing web page returned 200 OK status to confirm Web Portal is up.

satdump live capture for 1 second to ensure it runs without error.

wxmap generates an overlay map image which can be found : $HOME/raspberry-noaa-v2/scripts/tools/verification_tool/test_files/wxtoimg-map-output.png

wxtoimg generates MCIR enhanced image which can be founnd : $HOME/raspberry-noaa-v2/scripts/tools/verification_tool/test_files/wxtoimg-mcir-output.jpg

meteordemod -h is executed to ensure it runs without error.

When FULL mode is choosen meterdemod fully decodes a staged cadu file :

meteordemod generates a full set of images which can be found : $HOME/raspberry-noaa-v2/scripts/tools/verification_tool/test_files/tmp

Set 755 on verification.sh

Introduction of new Verification Tool

Reformatting Troubleshooting section from lastchange

commit 806663a83a01c91a74f214a15d9b2d7b2500f1e7 Author: Richard Creasey - AI4Y 69941625+creas002@users.noreply.github.com Date: Tue Jul 30 07:41:41 2024 -0400

Corrected variable name

commit cd010e0053f8dbe32421e65bd12dae501f879978 Author: Richard Creasey - AI4Y 69941625+creas002@users.noreply.github.com Date: Tue Jul 30 07:15:51 2024 -0400

Since verifcation tool is added to install script, conditionally execute from upgrade script

commit 8c6ea4e755f5ff469b1463eacb10f6a5f9cb70b7 Author: Richard Creasey - AI4Y 69941625+creas002@users.noreply.github.com Date: Tue Jul 30 06:38:18 2024 -0400

Removed /etc/modprobe.d/rtlsdr.conf

commit a5b7821479bf74f9b7c0d0a67998424fde30e642 Author: Richard Creasey - AI4Y 69941625+creas002@users.noreply.github.com Date: Mon Jul 29 21:24:29 2024 -0400

Updated to remove reboot dependency and execute Verification Tool

Verification script had 1 failure after Fresh OS install and install_and_upgrade.sh executed. Reboot would resolve the USB udev permission issue, but reloading udev rules and trigger resolves it without a reboot.  I left the code block to execute verification tool on fresh installs, so it only happens the first time. Users can call Verification Tool anytime the need to such as part of support.sh script.

commit 3c50ae76316a823174ced50e0d68c1bbf2189949 Author: Richard Creasey - AI4Y 69941625+creas002@users.noreply.github.com Date: Mon Jul 29 17:17:12 2024 -0400

Added error handling and Improved text in echo for moving RN2 tree

commit b375303f75d62f22d852cfd18162fc9bebe1fcdd Author: Richard Creasey - AI4Y 69941625+creas002@users.noreply.github.com Date: Mon Jul 29 17:07:59 2024 -0400

Moved git clone command to start of script

Moved git clone command to start of script before destructive tasks are performed in case user passed a bad URL or Branch name

commit 5552f61a62d15f7f9413a6b8b1d99336a2a9c135 Author: Richard Creasey - AI4Y 69941625+creas002@users.noreply.github.com Date: Mon Jul 29 12:03:14 2024 -0400

Stop and RN2 AT processes that might be running during uninstall

# kill any RN2 AT processes as part of clean up, otherwise danglers
# may have the RTL-SDR open and verification dry run test for satdump will fail

commit edd0f4ef45b20aceeccc708729023fb5d9afbc8e Author: Richard Creasey - AI4Y 69941625+creas002@users.noreply.github.com Date: Mon Jul 29 11:36:23 2024 -0400

Corrected /srv restore/Unstage permissions

commit 7d91bd16a8cb249e3519b474ea0561624f7d82b4 Author: Richard Creasey - AI4Y 69941625+creas002@users.noreply.github.com Date: Mon Jul 29 11:18:53 2024 -0400

Script was renamed to rn2_uninstall.sh and moved to .rn2_utils

commit 8c0c56d2ba6ead61105450204862fa665116bf9b Merge: a007035 bb0d497 Author: Richard Creasey - AI4Y 69941625+creas002@users.noreply.github.com Date: Mon Jul 29 10:49:02 2024 -0400

Merge branch 'aarch64-support' of https://github.com/creas002/raspberry-noaa-v2 into aarch64-support

commit a00703542ffb999d18f5fe423971e96782408066 Author: Richard Creasey - AI4Y 69941625+creas002@users.noreply.github.com Date: Mon Jul 29 10:48:21 2024 -0400

Added tee -a  for appending to log file

commit bb0d497e96c28a9e260439e3bc46e11766a644d9 Author: Richard Creasey - AI4Y 69941625+creas002@users.noreply.github.com Date: Mon Jul 29 10:27:38 2024 -0400

Resolve merge conflict

commit a83fda3a95650a5906deeb03b8e8a1851a257ce9 Merge: acb9fc5 3fd34b1 Author: Richard Creasey - AI4Y 69941625+creas002@users.noreply.github.com Date: Mon Jul 29 10:16:48 2024 -0400

Merge branch 'aarch64-support' of https://github.com/creas002/raspberry-noaa-v2 into aarch64-support

commit acb9fc53b8462b90561532eed28bb110efe4a6f2 Author: Richard Creasey - AI4Y 69941625+creas002@users.noreply.github.com Date: Mon Jul 29 10:14:45 2024 -0400

Script was rename to rn2_uninstall.sh and moved to .rm2_utils

commit 3fd34b17f5d79f00e2ec9bb24ade1cc958bf3ee2 Author: Richard Creasey - AI4Y 69941625+creas002@users.noreply.github.com Date: Mon Jul 29 10:08:22 2024 -0400

Update README.md - In-Situ Upgrade

commit 4f97fae0760b4fd1f0d02078bda68a8d495cc161 Author: Richard Creasey - AI4Y 69941625+creas002@users.noreply.github.com Date: Mon Jul 29 09:55:59 2024 -0400

Introduction of In-situ RN2 upgrade

#          1) Backup/Stage RN2 key directories
#          2) Uninstall existing RN2 installation
#          3) git clone new repository
#          4) Restore/UnStage RN2 key directories
#          5) install_and_upgrade
#          6) verification tool

commit b252da5d5319a318af317b0eb5b124733f5da073 Author: Richard Creasey - AI4Y 69941625+creas002@users.noreply.github.com Date: Mon Jul 29 09:10:58 2024 -0400

Fix -  DB Backup directory not cleaned up #1021

commit ad5555d760191e5e4e37cf7508b5d6f57de5e2cb Author: Richard Creasey - AI4Y 69941625+creas002@users.noreply.github.com Date: Sun Jul 21 11:43:43 2024 -0400

RTL-SDR changes since it is not a APT installed package

commit d967486f8a9f5e1e98f7bacffdf995af52974121 Author: Richard Creasey - AI4Y 69941625+creas002@users.noreply.github.com Date: Sun Jul 21 09:22:53 2024 -0400

Clean up the library cache so any dangling items are cleared

1) Backup/Stage RN2 key directories

2) Uninstall existing RN2 installation

3) git clone new repository

4) Restore/UnStage RN2 key directories

5) install_and_upgrade

6) verification tool

kill any RN2 AT processes as part of clean up, otherwise danglers # may have the RTL-SDR open and verification dry run test for satdump will fail

Moved git clone command to start of script before destructive tasks are performed in case user passed a bad URL or Branch name

Verification script had 1 failure after Fresh OS install and install_and_upgrade.sh executed. Reboot would resolve the USB udev permission issue, but reloading udev rules and trigger resolves it without a reboot. I left the code block to execute verification tool on fresh installs, so it only happens the first time. Users can call Verification Tool anytime the need to such as part of support.sh script.

1) Backup/Stage RN2 key directories

2) Uninstall existing RN2 installation

3) git clone new repository

4) Restore/UnStage RN2 key directories

5) install_and_upgrade

6) verification tool

kill any RN2 AT processes as part of clean up, otherwise danglers # may have the RTL-SDR open and verification dry run test for satdump will fail

Moved git clone command to start of script before destructive tasks are performed in case user passed a bad URL or Branch name

Verification script had 1 failure after Fresh OS install and install_and_upgrade.sh executed. Reboot would resolve the USB udev permission issue, but reloading udev rules and trigger resolves it without a reboot. I left the code block to execute verification tool on fresh installs, so it only happens the first time. Users can call Verification Tool anytime the need to such as part of support.sh script.