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

Cleanup - unused code #1025

Closed
jp112sdl opened this issue Jul 30, 2024 · 1 comment
Closed

Cleanup - unused code #1025

jp112sdl opened this issue Jul 30, 2024 · 1 comment

Comments

@jp112sdl
Copy link
Contributor

I think, these lines are unused an can be removed

{% set meteor_suffixes = [
'-321-corrected.jpg',
'-equidistant_321.jpg',
'-mercator_321.jpg',
'-spread_321.jpg',
'-spread_123.jpg',
'-221-corrected.jpg',
'-equidistant_221.jpg',
'-mercator_321.jpg',
'-spread_221.jpg',
'-equidistant_654.jpg',
'-mercator_654.jpg',
'-spread_654.jpg',
'-Thermal_Channel_corrected.jpg',
'-spread_rain.jpg',
'-spread_IR.jpg',
'-1-122-rectified.jpg'
] %}

jp112sdl added a commit to jp112sdl/raspberry-noaa-v2 that referenced this issue Jul 30, 2024
MihajloPi added a commit that referenced this issue Aug 1, 2024
* Add toggle for coronal mass GIFs

* aarch64 support

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

* SatDump update for x64 machines

* Modified tools & dependancies

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

* Disabled - name: copy RTL-SDR udev rule

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

* rework

* Added --fill_missing option to NOAA & METEOR receive scripts

* undo "fill_missing" option from NOAA as its for GOES and METEOR only

* Hmmm somehow `--fill_missing` got lost when I switched to SatDump live decoding

* Adding updated SatDump for armhf built by Richard

* Providing support for any Debian based distro

* Setting automatic deletion to false to store 3 days worth of audio for archiving and debugging

* Fixing the log for the breakpoint

* Fixing the log for the break point

* Preventing invalid receiver_type and satellite decoders from going past the install script

* Adding fix to prevent Gtk-WARNING

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

* Widening the scope of variables to  omit when scheduling passes

* Added WAYFIRE to omit

* Update receive_meteor.sh

Backing out --fill_missing to avoid merge conflict with parent

* Update receive_noaa.sh - Backing out changes to avoid merge conflict

* add bottom - next/previous page in CAPTURE

#1002

* Ooops... Thanks Jerome!

* Updating comments

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

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")

* Filter out wxtoimg error messages for known/acceptable issue

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

* Filter out wxtoimg error messages for known/acceptable issue

* Modified dependencies to support 32-bit wxtoimg on arm64 & amd64

* Modified core.yml to support various flavors of Linux

* Removed wxtoimg 320bit support for AMD64 since we have a DEB for it already

* Update README.md

* Tuning Meteor M2-4 maps in MeteorDemod

* Define XDG_RUNTIME_DIR with proper permissions

Define XDG_RUNTIME_DIR with proper permissions

* Introduction of Verification Tool and RN2 uninstall script (#1019)

* Introduction of verification tool

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

Set 755 on verification.sh

* Ensure meteordemond working directory exists

* Set 755 on build_permissions_list.sh

* Update README.md

Introduction of new Verification Tool

* Update README.md

Reformatting Troubleshooting section from lastchange

* Update README.md

* Script to remove RN2 installation

* updated to shutdown nginx before removal

* stop php service

* Corrected php service name to stop when removing RN2

* further cleanup of services

* Tweaked some of the logging messages

* updated to remove rtl-sdr package

* install script does not install RTL-SDR when it finds source in /tmp

* Update caution_uninstall_rn2.sh

* Clean up the library cache so any dangling items are cleared & RTL-SDR changes since it is not a APT installed package (#1020)

* Clean up the library cache so any dangling items are cleared

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

* Delete db backup files that are older than 3 days

* fixes #1025

* integration for ELEKTRO-L3

* fix wrong log call

* fix thumbnail

* add missing section in noaa-v2.conf.js2 template

* add ELEKTRO_L3_FREQ in common.sh

* also show images of each channel, not only the composites

---------

Co-authored-by: Sasszem <[email protected]>
Co-authored-by: MihajloPi <[email protected]>
Co-authored-by: Richard Creasey - AI4Y <[email protected]>
@athisha1
Copy link

I think, these lines are unused an can be removed

{% set meteor_suffixes = [
'-321-corrected.jpg',
'-equidistant_321.jpg',
'-mercator_321.jpg',
'-spread_321.jpg',
'-spread_123.jpg',
'-221-corrected.jpg',
'-equidistant_221.jpg',
'-mercator_321.jpg',
'-spread_221.jpg',
'-equidistant_654.jpg',
'-mercator_654.jpg',
'-spread_654.jpg',
'-Thermal_Channel_corrected.jpg',
'-spread_rain.jpg',
'-spread_IR.jpg',
'-1-122-rectified.jpg'
] %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants