GithubHelp home page GithubHelp logo

benjaminvialle / intel_nuc_led Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nomego/intel_nuc_led

5.0 2.0 1.0 1 MB

Intel NUC8i7HVK (Hades) LED Control for Linux

License: GNU General Public License v3.0

Makefile 2.90% C 63.47% Shell 2.31% Python 31.31%

intel_nuc_led's Introduction

DISCLAIMER

Use at your own risk! In the event that your computer breaks due to use of this software, the author will not be held responisble for any damages caused!

Intel NUC8i7HVK LED Control

This is a simple kernel module to control the LEDs on Intel NUC8i7HVK (Hades) kits.

This module is intended as a demonstration/proof-of-concept and may not be maintained further. Perhaps it can act as a jumping off point for a more polished and complete implementation. For testing and basic manipulation of the LEDs, it ought to work fine, but use with caution none the less. This has only been tested on 5.6.x kernels.

This kernel module was initially developed by Miles Peterson (https://github.com/milesp20/intel_nuc_led) for Intel NUC7i[x]BN and NUC6CAY LED Control, then forked for NIC8i[x]HVK LED control by Patrick Kullman (https://github.com/nomego/intel_nuc_led).

Requirements

Requirements:

  • Intel NUC8i7HVK
  • Latest BIOS
  • ACPI/WMI support in kernel
  • LED(s) set to SW Control in BIOS

Building

THe nuc_led kernel module supports building and installing "from source" directly or using dkms.

1. Installing Build Dependencies

Ubuntu:

sudo apt install build-essential git linux-headers-$(uname -r)

# DKMS dependencies
sudo apt install debhelper dkms

Redhat:

yum groupinstall "Development Tools"
yum install kernel-devel-$(uname -r)

# Install appropriate EPEL for DKMS if needed by your RHEL variant
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

yum install dkms

2. Fetching the module

git clone https://github.com/benjaminvialle/intel_nuc_led
cd intel_nuc_led

3a. Building and Installing Using DKMS (recommended)

sudo make dkms-install

Uninstall:

sudo make dkms-uninstall

3b. Building and Installing Using DKMS (packaged)

# Ubuntu
make dkms-deb

# RHEL
make dkms-rpm

# Install generated DEB/RPM from the folder specified in the output using system package manager

3c. Building and Installing "from source"

make clean
make install

4. Loading the module

sudo modprobe nuc_led

5. Updating the module

cd intel_nuc_led
sudo rmmod nuc_led
sudo make dkms-uninstall
git pull
sudo make dkms-install
sudo modprobe nuc_led

Usage

This driver works via '/proc/acpi/nuc_led'. To get current LED state:

cat /proc/acpi/nuc_led

Sample output:

LED 0 (Power) - Color type: RGB
  Supported indicators: Power state  HDD Activity  Ethernet  Wifi  Software  Power Limit  Disable
  Current indicator: Power state

        S0 (On): 50% Solid rgb(0,0,255) (10 dHz)
     S3 (Sleep): 100% Breathing rgb(0,0,255) (10 dHz)
     Ready mode: 0% Solid rgb(0,0,0) (0 dHz)
  S5 (Soft off): 0% Solid rgb(0,0,0) (0 dHz)


LED 2 (Skull) - Color type: RGB
  Supported indicators: Power state  HDD Activity  Ethernet  Wifi  Software  Power Limit  Disable
  Current indicator: Power state

        S0 (On): 50% Solid rgb(10,0,255) (10 dHz)
     S3 (Sleep): 100% Breathing rgb(0,0,255) (10 dHz)
     Ready mode: 0% Solid rgb(0,0,0) (0 dHz)
  S5 (Soft off): 0% Solid rgb(0,0,0) (0 dHz)


LED 3 (Eyes) - Color type: RGB
  Supported indicators: Power state  HDD Activity  Ethernet  Wifi  Software  Power Limit  Disable
  Current indicator: Power state

        S0 (On): 50% Breathing rgb(255,0,0) (3 dHz)
     S3 (Sleep): 100% Breathing rgb(0,0,255) (10 dHz)
     Ready mode: 0% Solid rgb(0,0,0) (0 dHz)
  S5 (Soft off): 0% Solid rgb(0,0,0) (0 dHz)


LED 4 (Front 1) - Color type: RGB
  Supported indicators: Power state  HDD Activity  Ethernet  Wifi  Software  Power Limit  Disable
  Current indicator: HDD Activity

  HDD LED: 50% rgb(255,0,0) Normally off, ON when active


LED 5 (Front 2) - Color type: RGB
  Supported indicators: Power state  HDD Activity  Ethernet  Wifi  Software  Power Limit  Disable
  Current indicator: Wifi

  Wifi LED: 50% rgb(0,10,250)


LED 6 (Front 3) - Color type: RGB
  Supported indicators: Power state  HDD Activity  Ethernet  Wifi  Software  Power Limit  Disable
  Current indicator: Power Limit

  Power Limit LED: Green to Red  50% rgb(0,0,255)

To change the LED state:

 echo '<action>,<led id>,<indicator id>,[setting],[value]' | sudo tee /proc/acpi/nuc_led > /dev/null
Action Description
set_indicator Change LED indicator type.
set_indicator_value Change LED indicator setting.

Example execution to set Front 2 LED (5) to Wifi indicator type (3):

echo 'set_indicator,5,3' | sudo tee /proc/acpi/nuc_led

Example execution to set the Skull LED (2), Indicator type Power state (0), setting S0 RGB color red (3) to 10:

echo 'set_indicator_value,2,0,3,10' | sudo tee /proc/acpi/nuc_led > /dev/null

Errors in passing parameters will appear as warnings in dmesg. NOTE Not all warnings are implemented and may send unsupported data, which can inactivate the LEDs (or worse!)

You can change the owner, group and permissions of /proc/acpi/nuc_led by passing parameters to the nuc_led kernel module. Use:

  • nuc_led_uid to set the owner (default is 0, root)
  • nuc_led_gid to set the owning group (default is 0, root)
  • nuc_led_perms to set the file permissions (default is r+w for group and user and r for others)

Note: Once an LED has been set to SW Control in the BIOS, it will remain off initially until a color is explicitly set, after which the set color is retained across reboots.

intel_nuc_led's People

Contributors

milesp20 avatar benjaminvialle avatar nomego avatar qmfrederik avatar ju2wheels avatar crab2313 avatar r0nd avatar michaeljmcculloch avatar milhousevh avatar trsqr avatar

Stargazers

Adam Gibson avatar SatyrDiamond avatar Ahmad Gharbeia avatar  avatar Mics avatar

Watchers

James Cloos avatar  avatar

Forkers

endever

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.