Linux kernel platform driver for ASUSTOR NAS hardware (leds, buttons)

Overview

asustor-platform-driver

Linux kernel platform driver for ASUSTOR NAS hardware (leds, buttons).

On many systems, ASUSTOR uses a mix of IT87 and CPU GPIOs to control leds and buttons. Adding support for more systems should be fairly trivial, but may require some reverse engineering to figure out which GPIOs are responsible for what.

WARNING: Changing GPIO input/outputs (as done by this module) without knowledge of their effects can be dangerous and lead to instability, corrupted data or a broken system. Use at your own risk.

Dependencies

Note: All dependencies used by this module are part of the mainline linux kernel, if they're not included by your distribution you may need to compile them yourself.

  • gpio-it87 (AS6, AS61, AS62)
  • gpio-ich (AS6)

Optional

  • it87 (AS6, AS61, AS62)
    • May require adding acpi_enforce_resources=lax to kernel boot arguments for full functionality
    • Temperature monitoring (lm-sensors)
    • Fan speed regulation via pwm1
    • Front panel LED brightness adjustment via pwm3

Compatibility

  • AS6204T
  • AS6104T (NOT TESTED!)
  • AS604T

Features

  • LEDs (front panel, disk)
  • Buttons
    • USB Copy Button
    • Power Button (AS6)

Installation

git clone https://github.com/mafredri/asustor-platform-driver
cd asustor-platform-driver
make
sudo make install

Tips

it87 and PWM polarity

You may want to use patches/001-ignore-pwm-polarity-it87.patch for the it87 kernel module if it complains about PWM polarity. In this case, it's possible to use fix_pwm_polarity=1, however, it may reverse the polarity which is unwanted (i.e. high is low, low is high). It works fine when left as configured by the firmware.

Misc

  • blue:power and red:power can be turned on simultaneously for a pink-ish tint
  • green:status and red:status can be turned on simultaneously for a orange-ish tint

Support

If you would like additional hardware to be supported, pull requests are more than welcome. Alternatively, you can install these prerequisites:

sudo apt-get install -y gpiod

And then open an issue and attach outputs from the following commands:

sudo dmesg
sudo dmidecode -s system-manufacturer
sudo dmidecode -s system-product-name
sudo dmidecode -s bios-vendor
sudo dmidecode -s bios-version
sudo dmidecode -s bios-release-date
sudo dmidecode -s bios-revision
sudo gpioinfo

NOTE: If gpioinfo does not return anything, you may need to figure out which (if any) gpio drivers to load. Also keep in mind that your distribution may not ship with all gpio- drivers, so you may need to compile them yourself.

TODO

  • Add DKMS support
  • Support variable amount of disk LEDs
  • Create a new led trigger driver so that we can blink disk LEDs individually, the existing disk-activity trigger always blinks all LEDs on activity from any disk
  • Release a modified gpio-it87.c for figuring out the firmware configuration of IT87 GPIOs (could be useful when adding new devices)
Issues
  • Thank you.

    Thank you.

    No issue just wanted to say thank you for this driver package it works!. Can confirm pwm and lcd control work as intended on the AS5202T after pwm fix. Unfortunately speed fan inverses the fan control high is low and such meaning I’m stuck using fixed rpm otherwise as the NAS gets hot the fan turns off. You should really try and promote your driver package again now that Asustor customers have been hit with deadbolt on adm one of the big hold backs for people moving to another OS is fan control and led.

    Had to create a startup script in /etc/init.d to launch the pwm fix at boot. Didn’t really understand the patch script you had looking at the git.

    #!/bin/sh

    rmmod it87 && modprobe it87 fix_pwm_polarity=1

    And a startup service script under /run/systemd/generator.late/

    [Unit] Documentation=man:systemd-sysv-generator(8) SourcePath=/etc/init.d/pwmfix.sh Before=multi-user.target Before=multi-user.target Before=graphical.target After=apport.service After=preload.service After=hddtemp.service After=slapd.service After=nut-client.service After=lightdm.service

    [Service] Type=forking Restart=no TimeoutSec=5min IgnoreSIGPIPE=no KillMode=process GuessMainPID=no RemainAfterExit=yes ExecStart=/etc/init.d/pwmfix.sh start ExecStop=/etc/init.d/pwmfix.sh stop

    also modified the fancontrol.service under /lib/systemd/system/ changed it so my script runs after the lm-sensors.service so it doesn’t conflict with the fancontrol gui by https://github.com/Maldela/fancontrol-gui

    [Unit] Description=fan speed regulator

    Run pwmconfig to create this file.

    ConditionFileNotEmpty=/etc/fancontrol After=lm-sensors.service After=pwmfix.service Documentation=man:fancontrol(8) man:pwmconfig(8)

    [Service] ExecStartPre=/usr/sbin/fancontrol --check ExecStart=/usr/sbin/fancontrol PIDFile=/run/fancontrol.pid

    [Install] WantedBy=multi-user.target

    opened by Nullvoid3771 43
Owner
Mathias Fredriksson
Mathias Fredriksson
Linux kernel module for Onion Omega2 to control WS2811/WS2812 LEDs

omega2-ws2811-lkm Linux kernel module for Onion Omega2 to control WS2811/WS2812 LEDs. It's using a bit-banging, so you can use any GPIO pin. Also, it

Alexey 'Cluster' Avdyukhin 15 Jun 7, 2022
Allows for multiple SwitchBot buttons and curtains to be controlled via MQTT sent to ESP32. ESP32 will send BLE commands to switchbots and return MQTT responses to the broker. Also supports Meter/Temp Sensor

SwitchBot-MQTT-BLE-ESP32 Switchbot local control using ESP32. no switchbot hub used/required. works with any smarthub that supports MQTT https://githu

null 270 Jul 31, 2022
A small arcade game utilizing the Raspberry Pi Pico and 20 arcade buttons!

Pico Light Arcade This is the code for the Pico Light Arcade game that can be seen here: https://twitter.com/ghidraninja/status/1422900329369178113 Ha

stacksmashing 28 Feb 21, 2022
x64 Windows kernel driver mapper, inject unsigned driver using anycall

anymapper x64 Windows kernel driver mapper, inject unsigned driver using anycall This project is WIP. Todo Fix: Can't make API calls from IAT nor func

Kento Oki 68 Jun 22, 2022
Hygieia, a vulnerable driver traces scanner written in C++ as an x64 Windows kernel driver.

Hygieia The Greek goddess of health, her name is the source for the word "hygiene". Hygieia is a windows driver that works similarly to how pagewalkr

Deputation 69 Jul 27, 2022
SinMapper - usermode driver mapper that forcefully loads any signed kernel driver

usermode driver mapper that forcefully loads any signed kernel driver (legit cert) with a big enough section (example: .data, .rdata) to map your driver over. the main focus of this project is to prevent modern anti-cheats (BattlEye, EAC) from finding your driver and having the power to hook anything due to being inside of legit memory (signed legit driver).

null 107 Jul 28, 2022
A clock with 241 RGB LEDs

LEDCircleClock A clock with 241 RGB LEDs. Description The clock shows the hands in diferent colors on the grid of LEDs. To make it more beautiful hand

null 17 Feb 26, 2022
Raspberry Pi Pico AutoHotkey Streamdeck / Keyboard with LEDs

Raspberry Pi Pico AutoHotkey Streamdeck / Keyboard with LEDs

Build Comics 18 Jul 15, 2022
Wortuhr mit ESP8266 WeMos D1 mini und NeoPixel WS2812B LEDs mit mp3 Sounds, Animationen, Transitions, Events und Spiele

Wortuhr_ESP8266 Wortuhr mit ESP8266 WeMos D1 mini und NeoPixel WS2812B LEDs mit mp3 Sounds, Animationen, Transitions, Events und Spiele, Webzugriff So

null 24 Jul 11, 2022
Non-blocking blinking patterns and smooth fade effects for your LEDs and buzzers.

Arduino-Blinkenlight Featured on hackster.io! ?? Supercharge your status-LEDs ?? This library gives you non-blocking blinking patterns and smooth fade

Thomas Feldmann 19 Jul 11, 2022
Connected Santa Claus hat based on an ESP32, 8x8 matrices and LEDs stripped communicating over the internet with MQTT.

Protobonnet What is it? A connected Santa Claus hat! What is it called? Le ProtoBonnet! Why? This hat has been created entirely for the Noël des proto

Audrey Cigolotti 2 Dec 27, 2021
A simple program to control the status LEDs of your Raspberry Pi!

ledcontrol is a program which was developed especially for the Raspberry Pi. With the help of this program you can easily turn on or off the status leds of your Raspberry Pi. Or even let them blink in different rythm!

Strawberry Software Industries 6 Jun 24, 2022
PP-Speaker is a linux kernel alsa driver (parallel port audio, covox)

// SPDX-License-Identifier: GPL-2.0-or-later PP-Speaker driver for Linux Copyright (C) 2022-2022 ariel/KotCzarny ([email protected]) Small FAQ: Q: What

null 3 May 30, 2022
A software serial driver package by using the hardware timer capture / comparison functionality.

Soft serial 1.简介 Soft serial 是利用硬件定时器捕获/比较功能实现软件模拟串口的软件包。 1.1目录结构 Soft serial 软件包目录结构如下所示: soft_serial ├───inc // 头文件目录 │

齐永忠 2 Jul 14, 2022
Filter driver which support changing DPI of mouse that does not support hardware dpi changing.

Custom Mouse DPI Driver 하드웨어 DPI 변경이 불가능한 마우스들의 DPI 변경을 가능하게 하는 필터 드라이버 경고: 해당 드라이버는 완전히 테스트 되지 않았습니다 Install 해당 드라이버는 서명이 되어있지않습니다. 드라이버를 사용하려면 tests

storycraft 3 Jun 9, 2022
A kernel module that patches Linux kernel "on-the-fly" to skip TASK_RSS_EVENTS_THRESH check in check_sync_rss_stat

split-rss-counting-patch A kernel module that patches Linux kernel "on-the-fly" to skip TASK_RSS_EVENTS_THRESH check in check_sync_rss_stat. Why? Read

Bao-Hiep Le 3 Mar 6, 2022
The source for the Linux kernel used in Windows Subsystem for Linux 2 (WSL2)

Introduction The WSL2-Linux-Kernel repo contains the kernel source code and configuration files for the WSL2 kernel. Reporting Bugs If you discover an

Microsoft 5.9k Aug 2, 2022
Driver leap - Self-sustainable fork of SteamVR driver for Leap Motion controller with updated vendor libraries

Driver Leap Self-sustainable fork of SteamVR driver for Leap Motion controller with updated vendor libraries Installation (for users) Install Ultralea

null 46 Jul 28, 2022
A guide that teach you build a custom version of Chrome / Electron on macOS / Windows / Linux that supports hardware / software HEVC decoding.

enable-chromium-hevc-hardware-decoding A guide that teach you build a custom version of Chrome / Electron on macOS / Windows / Linux that supports har

Sta Zhu 210 Aug 5, 2022