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

DietPi-Software | RPi-Monitor: Fix CPU temperature meter #5232

Merged
merged 6 commits into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Fixes:
- DietPi-Software | OpenBazaar: Since the original project has been taken down, we migrated to a fork which keeps up the marketplace for the community: https://github.com/MichaIng/DietPi/issues/5213
- DietPi-Software | X.Org X Server: Resolved an issue where VMs without KMS/DRM support failed to start the X server, e.g. Hyper-V. The classic framebuffer DDX is now installed when no KMS/DRM support is detected on VMs.
- DietPi-Software | Box86/Box64: Resolved an issue where the install failed when a kernel upgrade has just been done so that the "binfmt_misc" kernel module cannot be found for the loaded kernel.
- DietPi-Software | RPi-Monitor: Resolved an issue where the CPU temperature was not shown. Many thanks to @KamikazeePL for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=10001

As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/5229

Expand Down
26 changes: 14 additions & 12 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ INDEX_BROWSER=$INDEX_BROWSER"
software_id=66

aSOFTWARE_NAME[$software_id]='RPi-Monitor'
aSOFTWARE_DESC[$software_id]='Web interface for Raspberry Pi real time monitoring'
aSOFTWARE_DESC[$software_id]='Web interface for Raspberry Pi real-time monitoring'
aSOFTWARE_CATX[$software_id]=8
aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/system_stats/#rpi-monitor'
# RPi only
Expand Down Expand Up @@ -8795,10 +8795,13 @@ _EOF_
# Update APT package status
G_EXEC /usr/share/rpimonitor/scripts/updatePackagesStatus.pl

# Fix issue to display CPU temperature correctly: https://github.com/XavierBerger/RPi-Monitor/issues/374
# shellcheck disable=SC2016
G_CONFIG_INJECT 'dynamic.1.postprocess=' 'dynamic.1.postprocess=int($1/10 + 0.5)/100' /etc/rpimonitor/template/temperature.conf

# USB drive stats implementation by Rich
if [[ ! -f '/etc/rpimonitor/template/usb_hdd.conf' ]] && findmnt -S /dev/sda1 > /dev/null
if [[ $G_ROOTFS_DEV != '/dev/sda2' && ! -f '/etc/rpimonitor/template/usb_hdd.conf' ]] && findmnt -S /dev/sda1 > /dev/null
then
G_EXEC sed -i '\|include=/etc/rpimonitor/template/sdcard.conf|a\include=/etc/rpimonitor/template/usb_hdd.conf' /etc/rpimonitor/data.conf
cat << '_EOF_' > /etc/rpimonitor/template/usb_hdd.conf
########################################################################
# Extract USB HDD (sda1) information
Expand All @@ -8808,30 +8811,29 @@ _EOF_
# - USBHDD1 used - yes - yes
########################################################################
static.10.name=usbhdd_total
static.10.source=df -t ext4
static.10.regexp=sda1\s+(\d+)
static.10.postprocess=$1/1024
static.10.source=df -m
static.10.regexp=^/dev/sda1\s+(\d+)

dynamic.14.name=usbhdd_used
dynamic.14.source=df -t ext4
dynamic.14.regexp=sda1\s+\d+\s+(\d+)
dynamic.14.postprocess=$1/1024
dynamic.14.source=df -m
dynamic.14.regexp=^/dev/sda1\s+\d+\s+(\d+)
dynamic.14.rrd=GAUGE

web.status.1.content.9.name=USB HDD
web.status.1.content.9.icon=usb_hdd.png
web.status.1.content.9.line.1="<b>/sda1</b> Used: <b>"+KMG(data.usbhdd_used,'M')+"</b> (<b>"+Percent(data.udbhdd_used,data.usbhdd_total,'M')+"</b>) Free: <b>"+KMG(data.usbhdd_total-data.usbhdd_used,'M')+ "</b> Total: <b>"+ KMG(data.usbhdd_total,'M') +"</b>"
web.status.1.content.9.line.1="<b>/sda1</b> Used: <b>"+KMG(data.usbhdd_used,'M')+"</b> (<b>"+Percent(data.usbhdd_used,data.usbhdd_total,'M')+"</b>) Free: <b>"+KMG(data.usbhdd_total-data.usbhdd_used,'M')+ "</b> Total: <b>"+ KMG(data.usbhdd_total,'M') +"</b>"
MichaIng marked this conversation as resolved.
Show resolved Hide resolved
web.status.1.content.9.line.2=ProgressBar(data.usbhdd_used,data.usbhdd_total)

web.statistics.1.content.9.name=USB HDD
web.statistics.1.content.9.graph.1=usbhdd_total
web.statistics.1.content.9.graph.2=usbhdd_used
web.statistics.1.content.9.ds_graph_options.usbhdd_total.label=USB HDD total space (MB)
web.statistics.1.content.9.ds_graph_options.usbhdd_total.label=USB HDD total space (MiB)
web.statistics.1.content.9.ds_graph_options.usbhdd_total.color="#FF7777"
web.statistics.1.content.9.ds_graph_options.usbhdd_used.label=USB HDD used space (MB)
web.statistics.1.content.9.ds_graph_options.usbhdd_used.label=USB HDD used space (MiB)
web.statistics.1.content.9.ds_graph_options.usbhdd_used.lines={ fill: true }
web.statistics.1.content.9.ds_graph_options.usbhdd_used.color="#7777FF"
_EOF_
G_EXEC sed -i '\|include=/etc/rpimonitor/template/sdcard.conf|a\include=/etc/rpimonitor/template/usb_hdd.conf' /etc/rpimonitor/data.conf
fi

fi
Expand Down