asus-linux-drivers / asus-numberpad-driver

Maintained feature-rich linux driver for NumberPad(2.0) on Asus laptops. NumberPad(2.0) is illuminated numeric keypad integrated to touchpad which appears when is done tap on top right corner of touchpad for atleast 1s by default (configurable) or slide gesture from top right/left corner to the center, the left shows calc app aswell (configurable).
GNU General Public License v2.0
268 stars 21 forks source link

[Bug]: Numberpad always on (Zenbook UX3405MA) #203

Closed danee940 closed 2 months ago

danee940 commented 2 months ago

Describe the bug

After I boot the device, the numberpad automatically turns on and I can't turn it off. It also works buggy, I can't write more than one number, it deletes the whole line.

Expected behavior

I expect to be able to turn it on and off manually.

Relevant log output

bash install.sh

groupadd: group 'numberpad' already exists
Added group numberpad to current user

Not detected package manager. Driver may not work properly because required packages have not been installed. Please create an issue (https://github.com/asus-linux-drivers/asus-numberpad-driver/issues).

groupadd: group 'input' already exists
groupadd: group 'i2c' already exists
groupadd: group 'uinput' already exists
Added groups input, i2c, uinput, numberpad to current user
uinput module loaded
i2c-dev module loaded
uinput module added to auto loaded modules
Udev rules reloaded and triggered

Testing interface i2c-0: failed
Testing interface i2c-1: success (adr 0x15)
The detection was successful. Touchpad with NumberPad found: i2c-1

In system remains config file from previous installation. Do you want replace that config with default config? [y/N]y

created virtual environment CPython3.9.4.final.0-64 in 311ms
  creator CPython3Posix(dest=/usr/share/asus-numberpad-driver/.env, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(extra_search_dir=/home/danee/.pyenv/versions/3.9.4/lib/python3.9/ensurepip/_bundled, /usr/share/python-wheels,download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/danee/.local/share/virtualenv)
    added seed packages: pip==20.2.3, setuptools==49.2.1, wheel==0.43.0
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
Collecting pip
  Downloading pip-24.2-py3-none-any.whl (1.8 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 20.2.3
    Uninstalling pip-20.2.3:
      Successfully uninstalled pip-20.2.3
Successfully installed pip-24.2
Requirement already satisfied: setuptools in /usr/share/asus-numberpad-driver/.env/lib/python3.9/site-packages (49.2.1)
Collecting setuptools
  Using cached setuptools-75.1.0-py3-none-any.whl.metadata (6.9 kB)
Using cached setuptools-75.1.0-py3-none-any.whl (1.2 MB)
Installing collected packages: setuptools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 49.2.1
    Uninstalling setuptools-49.2.1:
      Successfully uninstalled setuptools-49.2.1
Successfully installed setuptools-75.1.0
Collecting libevdev (from -r requirements.txt (line 1))
  Using cached libevdev-0.11.tar.gz (27 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting numpy (from -r requirements.txt (line 2))
  Downloading numpy-2.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (60 kB)
Collecting pyinotify (from -r requirements.txt (line 3))
  Using cached pyinotify-0.9.6.tar.gz (60 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting python-xlib (from -r requirements.txt (line 4))
  Using cached python_xlib-0.33-py2.py3-none-any.whl.metadata (6.2 kB)
Collecting smbus2 (from -r requirements.txt (line 5))
  Using cached smbus2-0.4.3-py2.py3-none-any.whl.metadata (7.1 kB)
Collecting pyasyncore (from -r requirements.txt (line 6))
  Using cached pyasyncore-1.0.4-py3-none-any.whl.metadata (3.7 kB)
Collecting pywayland (from -r requirements.txt (line 7))
  Downloading pywayland-0.4.18-cp39-cp39-manylinux_2_28_x86_64.whl.metadata (4.4 kB)
Collecting xkbcommon<1.1 (from -r requirements.txt (line 8))
  Using cached xkbcommon-1.0.1.tar.gz (79 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Installing backend dependencies: started
  Installing backend dependencies: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Collecting six>=1.10.0 (from python-xlib->-r requirements.txt (line 4))
  Using cached six-1.16.0-py2.py3-none-any.whl.metadata (1.8 kB)
Collecting cffi>=1.12.0 (from pywayland->-r requirements.txt (line 7))
  Using cached cffi-1.17.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (1.5 kB)
Collecting pycparser (from cffi>=1.12.0->pywayland->-r requirements.txt (line 7))
  Using cached pycparser-2.22-py3-none-any.whl.metadata (943 bytes)
Downloading numpy-2.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.5 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 19.5/19.5 MB 69.7 MB/s eta 0:00:00
Using cached python_xlib-0.33-py2.py3-none-any.whl (182 kB)
Using cached smbus2-0.4.3-py2.py3-none-any.whl (11 kB)
Using cached pyasyncore-1.0.4-py3-none-any.whl (10 kB)
Downloading pywayland-0.4.18-cp39-cp39-manylinux_2_28_x86_64.whl (836 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 836.1/836.1 kB 44.6 MB/s eta 0:00:00
Using cached cffi-1.17.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (445 kB)
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Using cached pycparser-2.22-py3-none-any.whl (117 kB)
Building wheels for collected packages: libevdev, pyinotify, xkbcommon
  Building wheel for libevdev (setup.py): started
  Building wheel for libevdev (setup.py): finished with status 'done'
  Created wheel for libevdev: filename=libevdev-0.11-py3-none-any.whl size=23874 sha256=23ccdfffd88c5e49a17236f5d430c5b24e4338709e81546bbbac00436a87466d
  Stored in directory: /home/danee/.cache/pip/wheels/8b/8a/36/11a54ffd503ab278732b098838a151fcb385ece50d2c1ab316
  Building wheel for pyinotify (setup.py): started
  Building wheel for pyinotify (setup.py): finished with status 'done'
  Created wheel for pyinotify: filename=pyinotify-0.9.6-py3-none-any.whl size=25325 sha256=9897c38c6882e0e2dba08714d0b39f50b7715e25e4c97090038e20d80363898a
  Stored in directory: /home/danee/.cache/pip/wheels/df/59/26/4c0156f7a9db2b0a2bd14d346a673de99632feeb8cd43914d0
  Building wheel for xkbcommon (pyproject.toml): started
  Building wheel for xkbcommon (pyproject.toml): finished with status 'done'
  Created wheel for xkbcommon: filename=xkbcommon-1.0.1-cp39-cp39-linux_x86_64.whl size=123101 sha256=2384bfb10a3c77350cb076e7453a2a87345728eb0e790027a4630d06f6cdaf67
  Stored in directory: /home/danee/.cache/pip/wheels/37/db/85/208c438931ca1cb6d3c1855fdf8d1692f50469a604dcbb5d5b
Successfully built libevdev pyinotify xkbcommon
Installing collected packages: smbus2, pyinotify, pyasyncore, six, pycparser, numpy, libevdev, python-xlib, cffi, xkbcommon, pywayland
Successfully installed cffi-1.17.1 libevdev-0.11 numpy-2.0.2 pyasyncore-1.0.4 pycparser-2.22 pyinotify-0.9.6 python-xlib-0.33 pywayland-0.4.18 six-1.16.0 smbus2-0.4.3 xkbcommon-1.0.1

NumberPad layout

The automatically recommended NumberPad layout for this laptop (ASUS Zenbook 14 UX3405MA_UX3405MA) is up5401ea. Do you want to use the up5401ea layout? (The photo of the recommended NumberPad layout can be found here https://github.com/asus-linux-drivers/asus-numberpad-driver#up5401ea) [y/N]y

Selected key layout: up5401ea

Systemctl service

Do you want install systemctl service? [y/N]y

LAYOUT_NAME: up5401ea
CONFIG_FILE_DIR_PATH: /usr/share/asus-numberpad-driver

env var DISPLAY: :0
env var WAYLAND_DISPLAY: wayland-0
env var AUTHORITY: /run/user/1000/xauth_LAbFwQ
env var XDG_RUNTIME_DIR: /run/user/1000
env var DBUS_SESSION_BUS_ADDRESS: unix:path=/run/user/1000/bus
env var XDG_SESSION_TYPE: wayland

ERROR LOG FILE: /var/log/asus-numberpad-driver/error.log

Unfortunatelly you will not be able use feature: Disabling Touchpad (e.g. Fn+special key) disables NumberPad aswell, at this moment is supported only X11
Asus numberpad driver service placed
Systemctl daemon reloaded
Asus numberpad driver service enabled
Asus numberpad driver service started

External keyboard

This is a predefined rule for changing the configuration when an external keyboard is connected/disconnected.

The application of this rule results in the following changes if an external keyboard is connected:

 - Numlock key does not activate NumberPad (config value is set to sys_numlock_enables_numpad=0)
 - Numberpad disactivation does not disable Numlock (config value is set to numpad_disables_sys_numlock=0)

In summary when an external keyboard is connected then NumberPad activation is not linked to Numlock state and vice versa.

Do you want install the rule for external keyboard? [y/N]y

Rule 90-numberpad-external-keyboard.rules applied
Udev rules reloaded and triggered

Calculator app

Do you want try to install toggling script for XF86Calculator key? [y/N]n

Power supply saver

By default is idle functionality disabled and may be manually enabled in config file later. Or by installing this rule can be enabled by every detected change of power supply mode to battery mode.

Idle mode is configured to be enabled after 10s of inactivity and to decrease 30% of brightness.

Do you want install the rule for idle functionality? [y/N]y

Rule 80-numberpad-power-supply applied
Udev rules reloaded and triggered

Installation finished succesfully

Reboot is required. Do you want reboot now? [y/N]

Desktop

danee940 commented 2 months ago

I also ran the uninstall script, the numberpad still glows up. It doesn't work, it just glows up.

ldrahnik commented 2 months ago

@danee940 Attach the driver error log and your config, please.

I can't write more than one number

It is set up intentionally set by default in config.

danee940 commented 2 months ago

This is throughout the day.. In the procees I installed it multiple times while missing dependencies were found. Could you please advise with the location of the config file?

error.log

ldrahnik commented 2 months ago

@danee940 Was used install.sh and any dependencies were missing? Which?

ldrahnik commented 2 months ago
2024-09-20 17:19:39,967 INFO Detecting keyboard from string: "N: Name="AT Translated Set 2 keyboard""
Traceback (most recent call last):
  File "/usr/share/asus-numberpad-driver/numberpad.py", line 907, in <module>
    with open('/dev/input/event' + str(keyboard), 'rb') as fd_k:
PermissionError: [Errno 13] Permission denied: '/dev/input/event3'

Run command groups and post here output, please. Also command cd /dev/input && ls -la. Me:

/dev/input$ ls -la
total 0
drwxr-xr-x  3 root root     640 Sep 20 19:25 .
drwxr-xr-x 20 root root    5320 Sep 20 19:30 ..
drwxr-xr-x  2 root root     240 Sep 20 19:25 by-path
crw-rw----  1 root input 13, 64 Sep 20 19:25 event0
crw-rw----  1 root input 13, 65 Sep 20 19:25 event1
crw-rw----  1 root input 13, 74 Sep 20 19:25 event10
crw-rw----  1 root input 13, 75 Sep 20 19:25 event11
crw-rw----  1 root input 13, 76 Sep 20 19:25 event12
crw-rw----  1 root input 13, 77 Sep 20 19:25 event13
crw-rw----  1 root input 13, 78 Sep 20 19:25 event14
crw-rw----  1 root input 13, 79 Sep 20 19:25 event15
crw-rw----  1 root input 13, 80 Sep 20 19:25 event16
crw-rw----  1 root input 13, 81 Sep 20 19:25 event17
crw-rw----  1 root input 13, 82 Sep 20 19:25 event18
crw-rw----  1 root input 13, 83 Sep 20 19:25 event19
crw-rw----  1 root input 13, 66 Sep 20 19:25 event2
crw-rw----  1 root input 13, 84 Sep 20 19:25 event20
crw-rw----  1 root input 13, 85 Sep 20 19:25 event21
crw-rw----  1 root input 13, 86 Sep 20 19:25 event22
crw-rw----  1 root input 13, 87 Sep 20 19:25 event23
crw-rw----  1 root input 13, 67 Sep 20 19:25 event3
crw-rw----  1 root input 13, 68 Sep 20 19:25 event4
crw-rw----  1 root input 13, 69 Sep 20 19:25 event5
crw-rw----  1 root input 13, 70 Sep 20 19:25 event6
crw-rw----  1 root input 13, 71 Sep 20 19:25 event7
crw-rw----  1 root input 13, 72 Sep 20 19:25 event8
crw-rw----  1 root input 13, 73 Sep 20 19:25 event9
crw-rw----  1 root input 13, 63 Sep 20 19:25 mice
crw-rw----  1 root input 13, 32 Sep 20 19:25 mouse0
crw-rw----  1 root input 13, 33 Sep 20 19:25 mouse1
crw-rw----  1 root input 13, 34 Sep 20 19:25 mouse2
crw-rw----  1 root input 13, 35 Sep 20 19:25 mouse3
ldrahnik commented 2 months ago

@danee940 So config file was default? Location of config for installed driver using install.sh is /usr/share/asus-numberpad-driver/numberpad_dev.

danee940 commented 2 months ago

To be honest, I only think that they are missing. I put the output of the install.sh into GPT and it suggested me to install a couple dependencies. I'm on a fresh install of Linux as a sidenote.

Here is the GPT chat history. https://chatgpt.com/share/66edc72c-dd10-8013-9347-3a6c8d1810ab

Config file was default, didn't change it.

❯ cat numberpad_dev
[main]
numpad_disables_sys_numlock = 1
disable_due_inactivity_time = 0
touchpad_disables_numpad = 1
key_repetitions = 0
multitouch = 0
one_touch_key_rotation = 0
activation_time = 1
sys_numlock_enables_numpad = 1
top_left_icon_activation_time = 1
top_left_icon_slide_func_activation_radius = 1200
top_left_icon_slide_func_activates_numpad = 1
top_right_icon_slide_func_activation_radius = 1200
enabled_touchpad_pointer = 3
press_key_when_is_done_untouch = 1
enabled = 0
default_backlight_level = 0x01
brightness = 0x48
top_left_icon_brightness_func_disabled = 0
distance_to_move_only_pointer = 0
idled = 0
idle_brightness = 30
idle_enabled = 1
idle_time = 10
❯ groups
danee wheel numberpad input i2c uinput
❯ cd /dev/input
❯ ls -la
total 0
drwxr-xr-x.  3 root root     460 Sep 20 15:42 .
drwxr-xr-x. 20 root root    4740 Sep 20 15:42 ..
drwxr-xr-x.  2 root root     200 Sep 20 15:42 by-path
crw-rw----.  1 root input 13, 64 Sep 20 15:28 event0
crw-rw----.  1 root input 13, 65 Sep 20 15:28 event1
crw-rw----.  1 root input 13, 74 Sep 20 15:28 event10
crw-rw----.  1 root input 13, 75 Sep 20 15:28 event11
crw-rw----.  1 root input 13, 76 Sep 20 15:28 event12
crw-rw----.  1 root input 13, 77 Sep 20 15:28 event13
crw-rw----.  1 root input 13, 78 Sep 20 15:28 event14
crw-rw----.  1 root input 13, 79 Sep 20 15:28 event15
crw-rw----.  1 root input 13, 80 Sep 20 15:28 event16
crw-rw----.  1 root input 13, 81 Sep 20 15:29 event17
crw-rw----.  1 root input 13, 66 Sep 20 15:28 event2
crw-rw----.  1 root input 13, 67 Sep 20 15:28 event3
crw-rw----.  1 root input 13, 69 Sep 20 15:28 event5
crw-rw----.  1 root input 13, 70 Sep 20 15:28 event6
crw-rw----.  1 root input 13, 71 Sep 20 15:28 event7
crw-rw----.  1 root input 13, 72 Sep 20 15:28 event8
crw-rw----.  1 root input 13, 73 Sep 20 15:28 event9
crw-rw----.  1 root input 13, 63 Sep 20 15:28 mice
crw-rw----.  1 root input 13, 33 Sep 20 15:28 mouse1
crw-rw----.  1 root input 13, 34 Sep 20 15:28 mouse2

Since the uninstall.sh didn't seem to work (numberpad was constantly lit), I ran again the install.sh. Now, the numberpad is not on, but it also doesn't work. So in a sense it was fixed, but it's not working at all.

ldrahnik commented 2 months ago

@danee940 About chatgpt recommendation install it like kernel driver chatgpt was wrong and it was useless advice. About installing pyenv you had clear instructions already in this repository, I do not know why you put it into chatgpt which can mislead you from the right path. I do not recommend you use chatgpt like this.

ldrahnik commented 2 months ago

@danee940 Do you still see in error log:

2024-09-20 17:19:39,967 INFO Detecting keyboard from string: "N: Name="AT Translated Set 2 keyboard""
Traceback (most recent call last):
  File "/usr/share/asus-numberpad-driver/numberpad.py", line 907, in <module>
    with open('/dev/input/event' + str(keyboard), 'rb') as fd_k:
PermissionError: [Errno 13] Permission denied: '/dev/input/event3'

Because you have correct rights set up. This error should not be logged anymore. I think meanwhile you uninstalled the driver? Or at least removed input group from user groups.

ldrahnik commented 2 months ago

Can be reopened.

ldrahnik commented 2 months ago

@danee940 Not toggling was discussed in this issue https://github.com/asus-linux-drivers/asus-numberpad-driver/issues/169 and fix was already commited to the master branch.