[SOLVED] Not Working on N76VZ

Asked by bill on 2013-12-24

Can't control keyboard backlight using function keys, and light is out on wake from sleep. Debian Testing.

My light control is at /sys/devices/platform/asus-nb-wmi/leds/asus::kbd_backlight/brightness
... so I modified BRIGHTNESS and MAX in /etc/acpi/asus-kbd-backlight.py and restarted daemons, but still doesn't work.

I got this working once, but have lost that backup. Have struggled with this now for weeks and can't get my backlight on resume. I have to manually:
echo 2 > /sys/devices/platform/asus-nb-wmi/leds/asus\:\:kbd_backlight/brightness
... which is the only thing that works.

Question information

Language:
English Edit question
Status:
Solved
For:
ASUS Keyboard Backlight Edit question
Assignee:
No assignee Edit question
Solved by:
Fabien LOISON
Solved:
2014-01-15
Last query:
2014-01-15
Last reply:
2014-01-15
bill (merc1984) said : #1

Really?

Launchpad Janitor (janitor) said : #2

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Fabien LOISON (flozz) said : #3

Hello,

If the paths are right in /etc/acpi/asus-kbd-backlight.py, you can try to run the following commands:

    sudo /etc/acpi/asus-kbd-backlight.py up
    /etc/acpi/asus-kbd-backlight.py down

If it does not works → there is a problem with this scipt.
If it works → the problem is maybe located in the bindings with ACPID (files /etc/acpi/events/asus-kb-brightness-down and /etc/acpi/events/asus-kb-brightness-up)

Regards,

bill (merc1984) said : #4

Thank you Fabien. I find that you have made these scripts and I've installed your .deb file. It did give the following on Debian Testing:
`update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
insserv: warning: current start runlevel(s) (2) of script `asus-kbd-backlight' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (empty) of script `asus-kbd-backlight' overrides LSB defaults (0 1 6).
h`

I don't know whether this is significant or not. I may attempt to convert these to systemd. And whether I give the up or down command, I get this:
`/etc/acpi/asus-kbd-backlight.py up

(asus-kbd-backlight.py:16352): libnotify-WARNING **: you must call notify_init() before showing
**
libnotify:ERROR:notification.c:568:notify_notification_show: code should not be reached
Aborted`

I don't understand this. I can control the backlight manually with:
`echo 2 > /sys/devices/platform/asus-nb-wmi/leds/asus\:\:kbd_backlight/brightness`

bill (merc1984) said : #5

I now understand this better. I had to change these lines in /etc/acpi/asus-kbd-backlight.py:

`MAX_BRIGHTNESS_FILE = "/sys/devices/platform/asus-nb-wmi/leds/asus::kbd_backlight/max_brightness"
BRIGHTNESS_FILE = "/sys/devices/platform/asus-nb-wmi/leds/asus::kbd_backlight/brightness"`

And the commands work to control brightness, but I get:

`# /etc/acpi/asus-kbd-backlight.py down

(asus-kbd-backlight.py:10978): libnotify-WARNING **: you must call notify_init() before showing
**
libnotify:ERROR:notification.c:568:notify_notification_show: code should not be reached
Aborted

# /etc/acpi/asus-kbd-backlight.py up

(asus-kbd-backlight.py:10981): libnotify-WARNING **: you must call notify_init() before showing
**
libnotify:ERROR:notification.c:568:notify_notification_show: code should not be reached
Aborted`

Also I can't sort out the keyboard bindings. I don't know of a tool that will read out the characters received when a key is pressed, and when in XFCE I set Settings|Keyboard|AppShortcuts /etc/acpi/events/asus-kb-brightness-down and up it shows these keys are labeled XF86KbdBrightnessDown and Up, but searching on those I can't locate where they are defined. It's not in /etc or /home.

And finally, the process which I actually came here before, I cannot find the proper way to relight the keyboard after a Resume from Suspend.

Fabien LOISON (flozz) said : #6

Hello,

You can ignore the « libnotify-WARNING »... It is just for the notifications, it will have no impact...

If it does not work when you press your keys, it is a binding issue with the ACPI event. Can you give me the ACPI events corresponding to your brightness buttons (execute the "acpi_listen" command and press the brightness up/down keys) ?

Regards,

bill (merc1984) said : #7

Hello Fabien,

Oddly, it's the same code whether I press keyboard bright up, or down.
Here I pressed down three times, up three times, down three times, and
up three times:

/# acpi_listen
 PNP0C14:01 000000ff 00000000
 PNP0C14:01 000000ff 00000000
 PNP0C14:01 000000ff 00000000
 PNP0C14:01 000000ff 00000000
 PNP0C14:01 000000ff 00000000
 PNP0C14:01 000000ff 00000000
 PNP0C14:01 000000ff 00000000
 PNP0C14:01 000000ff 00000000
 PNP0C14:01 000000ff 00000000
 PNP0C14:01 000000ff 00000000
 PNP0C14:01 000000ff 00000000
 PNP0C14:01 000000ff 00000000

I triple-checked to make sure I was pressing the right keys.

On Tue, Jan 14, 2014, at 4:01, Fabien LOISON wrote:

Your question #241242 on ASUS Keyboard Backlight changed:

[1]https://answers.launchpad.net/asus-keyboard-backlight/+question/2412
42

    Status: Open => Needs information

Fabien LOISON requested more information:

Hello,

You can ignore the « libnotify-WARNING »... It is just for the

notifications, it will have no impact...

If it does not work when you press your keys, it is a binding issue
with

the ACPI event. Can you give me the ACPI events corresponding to your

brightness buttons (execute the "acpi_listen" command and press the

brightness up/down keys) ?

Regards,

--

To answer this request for more information, you can either reply to

this email or enter your reply at the following page:

[2]https://answers.launchpad.net/asus-keyboard-backlight/+question/2412
42

You received this question notification because you asked the question.

References

1. https://answers.launchpad.net/asus-keyboard-backlight/+question/241242
2. https://answers.launchpad.net/asus-keyboard-backlight/+question/241242

--
http://www.fastmail.fm - A no graphics, no pop-ups email service

Fabien LOISON (flozz) said : #8

Hello,

In "/etc/acpi/events/asus-kb-brightness-down", can you replace:

    event=hotkey (ATKD|HOTK) 000000c5

by:

    event=PNP0C14:01 000000ff 00000000

and then restart acpid:

    sudo service acpid restart

Does the brightness change when you press the buttons?

bill (merc1984) said : #9

Yes! Brightness goes down with the down key, but of course it doesn't
go up. So I put the same line in asus-kb-brightness-up and brightness
came back up but now the down key doesn't work.

On Tue, Jan 14, 2014, at 10:51, Fabien LOISON wrote:

Your question #241242 on ASUS Keyboard Backlight changed:

[1]https://answers.launchpad.net/asus-keyboard-backlight/+question/2412
42

    Status: Open => Needs information

Fabien LOISON requested more information:

Hello,

In "/etc/acpi/events/asus-kb-brightness-down", can you replace:

    event=hotkey (ATKD|HOTK) 000000c5

by:

    event=PNP0C14:01 000000ff 00000000

and then restart acpid:

    sudo service acpid restart

Does the brightness change when you press the buttons?

--

To answer this request for more information, you can either reply to

this email or enter your reply at the following page:

[2]https://answers.launchpad.net/asus-keyboard-backlight/+question/2412
42

You received this question notification because you asked the question.

References

1. https://answers.launchpad.net/asus-keyboard-backlight/+question/241242
2. https://answers.launchpad.net/asus-keyboard-backlight/+question/241242

--
http://www.fastmail.fm - The way an email service should be

Fabien LOISON (flozz) said : #10

Hello,

I patched the scripts for you. The code was pushed here:

    https://code.launchpad.net/~flozz/asus-keyboard-backlight/asus-keyboard-backlight_0.1-N76VZ

If you want to try it, do this:

    # Remove the previous version
    sudo apt-get remove asus-kbd-backlight

    # Install Bazaar (for downloading the code)
    sudo apt-get install bzr

    # Download the source code
    bzr branch lp~flozz/asus-keyboard-backlight/asus-keyboard-backlight_0.1-N76VZ

    # Go to the source directory
    cd asus-keyboard-backlight_0.1-N76VZ

    # Install Asus Keyboard Backlight
    sudo ./install.sh -i

    # Restart ACPId
    sudo service acpid restart

Now if you press the brightness up/down keys, it should cycle the keyboard backlight (0, 1, 2, 3, 0, 1, 2, 3,...)

Regards,

Fabien LOISON (flozz) said : #11

Hum... I forget something...

Instead of:

    sudo apt-get remove asus-kbd-backlight

do

    sudo apt-get remove --purge asus-kbd-backlight

If its too late, remove the event files manually:

    sudo rm -rfv /etc/acpi/events/asus-kb-brightness-down
    sudo rm -rfv /etc/acpi/events/asus-kb-brightness-up

Regards,

bill (merc1984) said : #12

It works! Although I get a popup error for each time I use the keys:
http://postimg.org/image/6w9xcg5y9/

Now if I could only figure out my original problem, turning on the
keyboard backlight on wake from sleep.

On Tue, Jan 14, 2014, at 12:51, Fabien LOISON wrote:

Your question #241242 on ASUS Keyboard Backlight changed:

[1]https://answers.launchpad.net/asus-keyboard-backlight/+question/2412
42

    Status: Open => Answered

Fabien LOISON proposed the following answer:

Hello,

I patched the scripts for you. The code was pushed here:

    [2]https://code.launchpad.net/~flozz/asus-keyboard-backlight/asus-

keyboard-backlight_0.1-N76VZ

If you want to try it, do this:

    # Remove the previous version

    sudo apt-get remove asus-kbd-backlight

    # Install Bazaar (for downloading the code)

    sudo apt-get install bzr

    # Download the source code

    bzr branch

    lp~flozz/asus-keyboard-backlight/asus-keyboard-backlight_0.1-N76VZ

    # Go to the source directory

    cd asus-keyboard-backlight_0.1-N76VZ

    # Install Asus Keyboard Backlight

    sudo ./install.sh -i

    # Restart ACPId

    sudo service acpid restart

Now if you press the brightness up/down keys, it should cycle the

keyboard backlight (0, 1, 2, 3, 0, 1, 2, 3,...)

Regards,

--

If this answers your question, please go to the following page to let
us

know that it is solved:

[3]https://answers.launchpad.net/asus-keyboard-backlight/+question/2412
42/+confirm?answer_id=9

If you still need help, you can reply to this email or go to the

following page to enter your feedback:

[4]https://answers.launchpad.net/asus-keyboard-backlight/+question/2412
42

You received this question notification because you asked the question.

References

1. https://answers.launchpad.net/asus-keyboard-backlight/+question/241242
2. https://code.launchpad.net/~flozz/asus-keyboard-backlight/asus-
3. https://answers.launchpad.net/asus-keyboard-backlight/+question/241242/+confirm?answer_id=9
4. https://answers.launchpad.net/asus-keyboard-backlight/+question/241242

--
http://www.fastmail.fm - The way an email service should be

Best Fabien LOISON (flozz) said : #14

Hello,

For the popup, it was caused because you have assigned a binding to the brightness keys in your graphical environment... So there is two solutions:

    1. Remove this binding,
    2. Create empty event files ( sudo touch /etc/acpi/events/asus-kb-brightness-{down,up} )

> Now if I could only figure out my original problem, turning on the
> keyboard backlight on wake from sleep.

This should work too. Asus Keyboard Backlight should remember the last state and restore it on reboot/resume. The script was here:

    http://bazaar.launchpad.net/~flozz/asus-keyboard-backlight/asus-keyboard-backlight_0.1-N76VZ/view/head:/code/asus-kbd-backlight_resume.sh

But maybe I missed something (I havn't an Asus laptop anymore, so I can't test :s)

Regards,

bill (merc1984) said : #15

Thanks Fabien LOISON, that solved my question.

bill (merc1984) said : #16

Indeed you care correct again, on both counts. Thanks for your able
help Fabien.

On Wed, Jan 15, 2014, at 3:01, Fabien LOISON wrote:

Your question #241242 on ASUS Keyboard Backlight changed:

[1]https://answers.launchpad.net/asus-keyboard-backlight/+question/2412
42

    Status: Needs information => Answered

Fabien LOISON proposed the following answer:

Hello,

For the popup, it was caused because you have assigned a binding to the

brightness keys in your graphical environment... So there is two

solutions:

    1. Remove this binding,

    2. Create empty event files ( sudo touch

    /etc/acpi/events/asus-kb-brightness-{down,up} )

Now if I could only figure out my original problem, turning on the

keyboard backlight on wake from sleep.

This should work too. Asus Keyboard Backlight should remember the last

state and restore it on reboot/resume. The script was here:

    [2]http://bazaar.launchpad.net/~flozz/asus-keyboard-backlight/asus-

keyboard-backlight_0.1-N76VZ/view/head:/code/asus-kbd-

backlight_resume.sh

But maybe I missed something (I havn't an Asus laptop anymore, so I

can't test :s)

Regards,

--

If this answers your question, please go to the following page to let
us

know that it is solved:

[3]https://answers.launchpad.net/asus-keyboard-backlight/+question/2412
42/+confirm?answer_id=13

If you still need help, you can reply to this email or go to the

following page to enter your feedback:

[4]https://answers.launchpad.net/asus-keyboard-backlight/+question/2412
42

You received this question notification because you asked the question.

References

1. https://answers.launchpad.net/asus-keyboard-backlight/+question/241242
2. http://bazaar.launchpad.net/~flozz/asus-keyboard-backlight/asus-
3. https://answers.launchpad.net/asus-keyboard-backlight/+question/241242/+confirm?answer_id=13
4. https://answers.launchpad.net/asus-keyboard-backlight/+question/241242

--
http://www.fastmail.fm - Faster than the air-speed velocity of an
                          unladen european swallow