rpimonitor and spin off external hard drive

Recommended Posts



orange pi +2e with

Distribution: Ubuntu 16.04.2 LTS

Kernel version: Linux 3.4.113-sun8i armv7l

rpimonitor installed with sudo armbianmonitor -r


I use Rpimonitor to control temperature, upgradable packages and cpu frequency, nice tool !

Unfortunately it looks that rpimonitor has access to my external external hard drives, so no spin off .

I change rpimonitor config files

sudo nano /etc/rpimonitor/data.conf



sudo nano /etc/rpimonitor/template/Allwinner_H3_Extended_Mainline.conf

#dynamic.7.postprocess=sprintf("%.1f", $1/1000)

#dynamic.8.postprocess=sprintf("%.1f", $1/1000)


But no success

Only if I stoped rpimonitor service, my hard disks spin off.


Can anybody help


Bye nepo


@edit: With only armbianmonitor -m no problems

Edited by nepo

Share this post

Link to post
Share on other sites

There's a helper script running in the background (IIRC rpimonitor-helper or such) where the relevant code line that writes to /tmp/disktemp should be accompanied by excessive comments how to prevent the issues (search for hdparm there, check manually and adjust). Feedback welcome!

Share this post

Link to post
Share on other sites



Services rpimonitor and rpimonitor-helper.service runs

but no information in /tmp/disktemp nor /tmp/externaltemp (the files exists), also by editing to the orig. conf-files.

sudo hdparm /dev/sda

 multcount     = 16 (on)
 readonly      =  0 (off)
 readahead     = 256 (on)
 geometry      = 60801/255/63, sectors = 976773168, start = 0

sudo hdparm -I /dev/sda1


ATA device, with non-removable media
	Model Number:       TOSHIBA MQ01UBD050                      
	Serial Number:      54R5TCLYT
	Firmware Revision:  AX001U  
	Transport:          Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6
	Supported: 8 7 6 5 
	Likely used: 8
	Logical		max	current
	cylinders	16383	16383
	heads		16	16
	sectors/track	63	63
	CHS current addressable sectors:   16514064
	LBA    user addressable sectors:  268435455
	LBA48  user addressable sectors:  976773168
	Logical  Sector size:                   512 bytes
	Physical Sector size:                  4096 bytes
	Logical Sector-0 offset:                  0 bytes
	device size with M = 1024*1024:      476940 MBytes
	device size with M = 1000*1000:      500107 MBytes (500 GB)
	cache/buffer size  = 8192 KBytes
	Form Factor: 2.5 inch
	Nominal Media Rotation Rate: 5400
	LBA, IORDY(can be disabled)
	Queue depth: 32
	Standby timer values: spec'd by Standard, no device specific minimum
	R/W multiple sector transfer: Max = 16	Current = 16
	Advanced power management level: 254
	DMA: sdma0 sdma1 sdma2 mdma0 mdma1 *mdma2 udma0 udma1 udma2 udma3 udma4 udma5 
	     Cycle time: min=120ns recommended=120ns
	PIO: pio0 pio1 pio2 pio3 pio4 
	     Cycle time: no flow control=120ns  IORDY flow control=120ns
	Enabled	Supported:
	   *	SMART feature set
	    	Security Mode feature set
	   *	Power Management feature set
	   *	Write cache
	   *	Look-ahead
	   *	Host Protected Area feature set
	   *	WRITE_BUFFER command
	   *	READ_BUFFER command
	   *	NOP cmd
	   *	Advanced Power Management feature set
	    	SET_MAX security extension
	   *	48-bit Address feature set
	   *	Device Configuration Overlay feature set
	   *	Mandatory FLUSH_CACHE
	   *	SMART error logging
	   *	SMART self-test
	   *	General Purpose Logging feature set
	   *	64-bit World wide name
	   *	{READ,WRITE}_DMA_EXT_GPL commands
	   *	Gen1 signaling speed (1.5Gb/s)
	   *	Gen2 signaling speed (3.0Gb/s)
	   *	Native Command Queueing (NCQ)
	   *	Host-initiated interface power management
	   *	Phy event counters
	   *	Idle-Unload when NCQ is active
	    	DMA Setup Auto-Activate optimization
	    	Device-initiated interface power management
	   *	Software settings preservation
	   *	SMART Command Transport (SCT) feature set
	   *	SCT Write Same (AC2)
	   *	SCT Error Recovery Control (AC3)
	   *	SCT Features Control (AC4)
	   *	SCT Data Tables (AC5)
	Master password revision code = 65534
	not	enabled
	not	locked
	not	frozen
	not	expired: security count
		supported: enhanced erase
Logical Unit WWN Device Identifier: 0000000000000000
	NAA		: 0
	IEEE OUI	: 000000
	Unique ID	: 000000000
Checksum: correct



Share this post

Link to post
Share on other sites

I was talking about Checking/adjusting the GetDiskTemp function in /usr/local/sbin/rpimonitor-helper.sh. Most probably switching to hddtemp might already solve it (but hddtemp refuses to work with an amazing lot of USB-to-SATA bridges so test manually first)

GetDiskTemp() {
	# get disk temperate using hddtemp (doesn't wake up sleeping disks and knows how to deal
	# with different disks due to an included database with known disk models).
	# RawTemp=$(/usr/sbin/hddtemp -n ${1} 2>/dev/null)
	RawTemp=$(/sbin/hdparm -C ${1} | egrep -q "standby|sleeping" || /usr/sbin/smartctl -d sat -a ${1} | awk -F" " '/Temperature_Cel/ {printf ("%0.0f",$10); }')
	if [ "X${RawTemp}" = "X" ]; then
		# drive is sleeping, we return 0
		echo 0
		echo ${RawTemp} | awk '{printf ("%0.0f",$1*1000); }'
	# The commented smartctl call below is meant as an alternative and an example for USB 
	# disks in external enclosures that are able to answer S.M.A.R.T. queries since they're 
	# SAT capable:
	# /usr/sbin/smartctl -d sat -a ${1} | awk -F" " '/Temperature_Cel/ {printf ("%0.0f",$10); }'
	# You should be aware that not every enclosure supports that and that some USB-to-SATA 
	# bridges require different parameters (eg. '-d usbjmicron' -- have a close look at
	# https://www.smartmontools.org/wiki/Supported_USB-Devices and test with smartctl to
	# get the correct value of the correct attribute).
	# You should also be aware that a query by smartctl always wakes up sleeping disks. So 
	# in case you want to query an external USB disk only if it's neither standby nor sleeping
	# and in case the enclosure is SAT capable think about prefixing the smartctl call with 
	# something like:
	# /sbin/hdparm -C ${1} | egrep -q "standby|sleeping" || /usr/sbin/smartctl ...
	# In case you try to query multiple disks you might end up with something like
	# case ${1} in
	#     /dev/sda) /usr/sbin/hddtemp -n ${1} ... ;;
	#     /dev/sdb) /usr/sbin/smartctl -d usbprolific -a ${1} ... ;;
	#     /dev/sdc) /sbin/hdparm -C ${1} | egrep -q "standby|sleeping" || /usr/sbin/smartctl -d sat ... ;;
	# esac
} # GetDiskTemp


Share this post

Link to post
Share on other sites
1 hour ago, tkaiser said:

but hddtemp refuses to work with an amazing lot of USB-to-SATA bridges

It doesn't work :(


Is the helper-service necessary ? Without rpimonitor runs and hard drive spin down.

Share this post

Link to post
Share on other sites
3 hours ago, nepo said:

Is the helper-service necessary


Collects some data. Simply comment the GetDiskTemp call and you're done.

Share this post

Link to post
Share on other sites
1 hour ago, tkaiser said:

Simply comment the GetDiskTemp call and you're done

Works :D


thank you for your help !


Bye nepo!

Share this post

Link to post
Share on other sites
This topic is now closed to further replies.