Coder Social home page Coder Social logo

fmor / rndu4000 Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 2.0 5.31 MB

Linux kernel module to control lcd, leds and buttons of Netgear Readynas Ultra 4

License: GNU General Public License v2.0

Makefile 4.05% Meson 5.97% C 89.98%
lcd linux module netgear readynas rndu4000

rndu4000's Introduction

rndu4000, a linux kernel module to control lcd, leds and buttons of Netgear Readynas Ultra 4.

I have installed a fresh new debian on my Netgear Ready Nas Ultra 4 and the lcd panel keep lighting so i decided to rewrite the kernel module to control lcd, buttons and leds. Before you try it, i STRONGLY encourage you to unmount your raid. It work well on my nas, but well we never know.

Please note that i have nothing to do with Netgear.

This module have been reported working on others netgear readynas models, take a look at others nas section. Please notify me by opening an issue if you have runned it on other device than the rndu4000 and wanted to add it to the list.

Contents

  1. Requirements
  2. Build
  3. Leds
  4. Buttons
  5. Lcd
  6. Others nas

Requirements

Netgear Readynas Ultra 4 (RNDU4000)

Check your nas

root@nas:~# dmidecode --type 1
# dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 2.6 present.

Handle 0x0001, DMI type 1, 27 bytes
System Information
    Manufacturer: NETGEAR
    Product Name: ReadyNAS
    Version: 05/19/2010 ReadyNAS-NVX-V2 V1.8
    Serial Number:
    Wake-up Type: Power Switch
    SKU Number:
    Family
root@nas:~# lspci -d 0x8086:0x2918
00:1f.0 ISA bridge: Intel Corporation 82801IB (ICH9) LPC Interface Controller (rev 02)
root@nas:~# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 28
model name      : Intel(R) Atom(TM) CPU D410   @ 1.66GHz

Build

meson setup build
cd build
meson compile

or

cd src
make

Leds

Each led can be constrolled by the following sysfs files :

File Description
/sys/devices/rndu4000/leds/backup Led of the backup button
/sys/devices/rndu4000/leds/power Led of power button
/sys/devices/rndu4000/leds/disk1 Led of disk 1
/sys/devices/rndu4000/leds/disk2 Led of disk 2
/sys/devices/rndu4000/leds/disk3 Led of disk 3
/sys/devices/rndu4000/leds/disk4 Led of disk 4

Acceptable values are :

Leds values

Value Description
0 off
1 on
2 blink

Example

root@nas:~# echo 2 > /sys/devices/rndu4000/leds/backup
root@nas:~# cat /sys/devices/rndu4000/leds/backup
2

Lcd

Lcd panel is 16x2 characters.

File Description
/sys/devices/rndu4000/lcd/backlight Enable/Disable Backlight of lcd panel
/dev/lcd Character device to write text on lcd

Escape commands

Command Description
\e[2J Clear the screen, return to home
\e[H Set cursor position to 0,0
\e[LC Set cursor visible
\e[Lc Set cursor invisible
\e[LB Enable cursor blink
\e[Lb Disable cursor blink
\e[L+ Enable backlight
\e[L- Disable backlight
\e[LD Enable display
\e[Ld Disable display

Example

root@nas:~# echo -en '\e[2JHello World !' > /dev/lcd

Buttons

Buttons can be configured to launch command

File Description
/sys/devices/rndu4000/buttons/backup_cmdline Command will be executed when backup button is pressed
/sys/devices/rndu4000/buttons/reset_cmdline Command will be executed when reset button is pressed

Example

root@nas:~# echo -n 'logger "Button backup has been pressed"' > /sys/devices/rndu4000/buttons/backup_cmdline
root@nas:~# cat /sys/devices/rndu4000/buttons/backup_cmdline
logger "Button backup has been pressed"

Others nas

This module have been reported working on some others models of Netgear nas. Since i don't own them, i can't garanty the module will work.

Model Url Comment Thanks to
RN314 https://github.com/psyrykh/readynas-rn314 Set LPC_DEVICE_ID to 0x3a18 in src/config.h Pavel Syrykh

rndu4000's People

Contributors

fmor avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

psyrykh albinhe

rndu4000's Issues

Loading fails on Ubuntu 22.04

Fresh install of 22.04, compiled and attempted to load. Got this error message:

[  910.953514] rndu4000: loading out-of-tree module taints kernel.
[  910.953684] rndu4000: module verification failed: signature and/or required key missing - tainting kernel
[  910.954685] rndu4000 : exclusive access to gpio registers failed

dmidecode:

root@nas:~# dmidecode --type 1
# dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 2.6 present.

Handle 0x0001, DMI type 1, 27 bytes
System Information
        Manufacturer: NETGEAR
        Product Name: ReadyNAS
        Version: 08/23/2011 ReadyNAS-NVX-V2 V1.10
        Serial Number:
        UUID: 03000200-0400-0500-0006-000700080009
        Wake-up Type: Power Switch
        SKU Number:
        Family:

lspci:

00:1f.0 ISA bridge: Intel Corporation 82801IB (ICH9) LPC Interface Controller (rev 02)

cpuinfo:

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 28
model name      : Intel(R) Atom(TM) CPU D410   @ 1.66GHz

RN314 support

Hey, @fmor!

The job you've done looks awesome! I am looking for a custom installation of Debian on my RN314. Your kernel module works great! Well Done! The only thing need to be changed is a DeviceID to 3a18.

00:1f.0 ISA bridge [0601]: Intel Corporation 82801JIB (ICH10) LPC Interface Controller [8086:3a18]
        Subsystem: Intel Corporation 82801JIB (ICH10) LPC Interface Controller [8086:3a18]
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0
        Capabilities: <access denied>
        Kernel driver in use: lpc_ich

Thanks a lot!
Pavlo.

P.S. sorry for opening an issue - I didn't find a better way to contact you.

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.