Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Request for paralet port output

Featured Replies

Hello,

 

 

my server have 3 standard fans that run all the time.

would it be nice to have them turn off when all hard drive spin down ?

 

if some one can write a scrip or code to do just that it would be really great.

it would reduce 4W of power consumption and wear and tear on the fans and noise

 

There is a small relay that take about 2mA @5V to turn on. this relay could in turn use to turn on the hard drive cooling fan.

 

basic operation: 

when all hard drive have spin down then send all zero to LPT1.

if a hard drive spin up then send all 1 to LPT1.

 

 

it's that simple.

 

in return I can send you a circuit board fully populated with relay and connector to make you time worth while.

Try this:

 

But, verify first that these two commands turn your relay off and on:

 

echo -n -e '\xff' > /dev/lp0
echo -n -e '\x00' > /dev/lp0

 

Run it through user scripts on whatever cron schedule you want (every hour / 5 minutes / whatever)

 

#!/usr/bin/php
<?PHP
$spinDownAllowed = 0;   # Set this to the maximum number of drives allowed to be spundown in order to switch

function startsWith($haystack, $needle) {
  return $needle === "" || strripos($haystack, $needle, -strlen($haystack)) !== FALSE;
}

$disks = parse_ini_file("/var/local/emhttp/disks.ini",true);
foreach ($disks as $disk) {
  if ( startsWith($disk['color'],"grey") ) { continue; }
  if ( startsWith($disk['name'],"cache") ) { continue; }
  if ( ! strpos($disk['color'],"on") ) {
    ++$spunDown;
  }
}

if ( $spinDownAllowed >= $spunDown ) {
  exec("echo -n -e '\x00' > /dev/lp0");
} else {
  exec("echo -n -e '\xff' > /dev/lp0");
}
?>

 

Edited by Squid

  • 9 months later...
  • Author

Hello Squid,

 

Thanks for the code.

 

Sorry about the belay response. I didn't have time to work on it until now.

 

I build the pcb board and ready to test it out. when I try you code above, echo -n -e '\xff' > /dev/lp0

nothing happen. the root@tower: command prompt return right away. So I figured that the parallel port was not enable in the BIOS.

I shut down the server and go into BIOS setup and enable LPT1 as standard LPT.

Reboot again. start the server and log on and run the echo script again. 

This time the command line hang and would not return root@tower:#

I have to do a control C for it to return.

 

any idea why ?.

 

thanks

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.