Giter Club home page Giter Club logo

Comments (38)

dflipo avatar dflipo commented on August 15, 2024 1

Thanks!!! version 4.2.0 works perfectly for me.

from asus-numberpad-driver.

ldrahnik avatar ldrahnik commented on August 15, 2024

@dflipo Please attach the driver error log.

from asus-numberpad-driver.

dflipo avatar dflipo commented on August 15, 2024

Sorry, I do not see any error, I just notice that the touchpad doesn't work (as numberpad only) and check the status of the systemctl command which says the driver didn't start... Should I enable a debug mode or so?

from asus-numberpad-driver.

ldrahnik avatar ldrahnik commented on August 15, 2024

@dflipo Can you please post that error file here because usually Is service restarted when driver returns error code 1, thank you (enabling DEBUG mode Is not necessarry as it does not hide errors)

Eliminate error in driver you can also by running driver directly via file /usr/bin/env python3 /usr/share/asus-numberpad-driver/numberpad.py up5401ea /usr/share/asus-numberpad-driver/, please try it. Also Is necessarry reboot laptop after install)

from asus-numberpad-driver.

dflipo avatar dflipo commented on August 15, 2024

Thanks for your help! When I run
flipo% /usr/bin/env python3 /usr/share/asus-numberpad-driver/numberpad.py up5401ea /usr/share/asus-numberpad-driver/ python3:
the error is
can't open file '/usr/share/asus-numberpad-driver/numberpad.py': [Errno 2] No such file or directory

For some unknown reason the file numberpad.py was not copied, the directory only includes 2 subdirectories:
flipo% ll /usr/share/asus-numberpad-driver/
drwxr-xr-x 2 root root 4096 29 déc. 12:38 scripts/
drwxr-xr-x 2 root root 4096 29 déc. 12:45 udev/

So I add numberpad.py manually, then
flipo% ls -la /usr/share/asus-numberpad-driver/
-rwxr-xr-x 1 flipo flipo 65644 10 déc. 08:04 numberpad.py*
drwxr-xr-x 2 root root 4096 29 déc. 12:38 scripts/
drwxr-xr-x 2 root root 4096 29 déc. 12:45 udev/

and run the command again:
flipo% /usr/bin/env python3 /usr/share/asus-numberpad-driver/numberpad.py up5401ea /usr/share/asus-numberpad-driver/
python3:
2023-12-30 09:54:47,435 ERROR Numpad layout *.py from dir layouts is required as first argument. Re-run install script or add missing first argument (valid value is b7402, e210ma, g533, gx551, gx701, up5401ea, ..).

I rerun the install script and answer 'y' to all questions, i end up with
Installation finished succesfully

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

I will reboot and tell you what happens, THANKS again!

from asus-numberpad-driver.

dflipo avatar dflipo commented on August 15, 2024

After rebooting, the touchpad still doesn't work as numberpad (only as traditional touchpad, touching the upper right corner doesn't switch the number pad on). So I run again

flipo% /usr/bin/env python3 /usr/share/asus-numberpad-driver/numberpad.py up5401ea /usr/share/asus-numberpad-driver/
2023-12-30 10:04:58,823 INFO Detecting keyboard from string: "N: Name="AT Translated Set 2 keyboard""
2023-12-30 10:04:58,824 INFO Set keyboard 0 from H: Handlers=kbd leds event0
2023-12-30 10:04:58,836 INFO Detecting touchpad from string: "N: Name="ASUE140D:00 04F3:31B9 Touchpad""
2023-12-30 10:04:58,836 INFO Set touchpad device id 1 from S: Sysfs=/devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-1/i2c-ASUE140D:00/0018:04F3:31B9.0001/input/input23
2023-12-30 10:04:58,836 INFO Set touchpad id 11 from H: Handlers=mouse1 event11
2023-12-30 10:04:58,836 INFO Touchpad min-max: x 0-3880, y 0-2299
2023-12-30 10:04:58,836 INFO Numpad min-max: x 200-3680, y 200-2219
Traceback (most recent call last):
File "/usr/share/asus-numberpad-driver/numberpad.py", line 522, in
udev = dev.create_uinput_device()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/libevdev/device.py", line 752, in create_uinput_device
d._uinput = UinputDevice(self._libevdev, uinput_fd)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/libevdev/_clib.py", line 936, in init
raise OSError(-rc, os.strerror(-rc))
PermissionError: [Errno 13] Permission denied

I changed the ownership of contents of /usr/share/asus-numberpad-driver/ to flipo:root but it doesn't help.
flipo% ll /usr/share/asus-numberpad-driver/
drwxr-xr-x 3 flipo root 4096 30 déc. 09:56 layouts/
-rwxr-xr-x 1 flipo root 65644 30 déc. 09:56 numberpad.py*
drwxr-xr-x 2 flipo root 4096 29 déc. 12:38 scripts/
drwxr-xr-x 2 flipo root 4096 29 déc. 12:45 udev/

Thanks for any hints!

from asus-numberpad-driver.

ldrahnik avatar ldrahnik commented on August 15, 2024

Change ownership back it is necessarry. I do not why you did that. Service run under current user.

Then please try reboot after installing because now it looks like your user is just not in uninput group yet (reboot Is required when are changed user groups in this case)

And then (if was NumberPad started successfully or even when not please repeat the installing), run bash ./uninstall.sh and then again bash install.sh + necessarry reboot and then check whether it works and post here entire output from installing. Install attempt is every time even logged to file located in dir /var/log/asus-num..

from asus-numberpad-driver.

dflipo avatar dflipo commented on August 15, 2024

Following your instructions, I first uninstalled, reboot, then install again, reboot. The numberpad still doesn't work, I append the files error.log and install.lo found in /var/log/asus-numberpad-driver

error.log.zip
install-30-12-2023-10-37-02.log.zip

from asus-numberpad-driver.

ldrahnik avatar ldrahnik commented on August 15, 2024

Put here please output of the command $ groups

from asus-numberpad-driver.

dflipo avatar dflipo commented on August 15, 2024

flipo% groups
flipo cdrom floppy sudo audio dip video plugdev users input netdev bluetooth lpadmin scanner i2c numberpad uinput

from asus-numberpad-driver.

ldrahnik avatar ldrahnik commented on August 15, 2024

And $ ls -l /dev/uinput?

from asus-numberpad-driver.

dflipo avatar dflipo commented on August 15, 2024

flipo% ls -l /dev/uinput
crw------- 1 root root 10, 223 30 déc. 10:38 /dev/uinput

from asus-numberpad-driver.

ldrahnik avatar ldrahnik commented on August 15, 2024

This is the problem why driver does not run. It should be:

$ ls -l /dev/uinput
crw-rw---- 1 root uinput 10, 223 Dec 30 11:21 /dev/uinput

from asus-numberpad-driver.

ldrahnik avatar ldrahnik commented on August 15, 2024

In driver is used the same command as is posted and even described why it is needed here https://tkcheng.wordpress.com/2013/11/11/changing-uinput-device-permission/

from asus-numberpad-driver.

ldrahnik avatar ldrahnik commented on August 15, 2024

The command which changes the group (second root in output of ls, first is an owner) to uinput should solve it for you

$ sudo chown :uinput /dev/uinput

from asus-numberpad-driver.

ldrahnik avatar ldrahnik commented on August 15, 2024

Please confirm it works even between reboots :)

from asus-numberpad-driver.

dflipo avatar dflipo commented on August 15, 2024

What works on my system (Debian 12):
root# chown :uinput /dev/uinput
root# chmod g+rw /dev/uinput
flipo% systemctl restart --user [email protected]
The the number pad then works as expected :-) Great thanks for your very efficient support!!!

Btw. you should mention that the user must have the directory "/usr/sbin" listed in his/her $PATH (for i2cdetect, i2ctransfer).
I still wonder if this is safe…

What fails on my system:
after reboot, the permissions on /dev/uinput are wrong, they are reset to:
crw------- 1 root root 10, 223 Dec 30 11:59 /dev/uinput

Adding /etc/udev/rules.d/99-input.rules doesn't help on Debian, the rules are in /usr/lib/udev/rules.d/ but adding 99-input.rules in this directory doesn't provide the expected permissions on /dev/uinput after reboot. What am I missing?

from asus-numberpad-driver.

dflipo avatar dflipo commented on August 15, 2024

Regarding the PATH, i would suggest to change the error message about INTERFACES in install_device_check.sh from

"No i2c interface can be found. Make sure you have installed libevdev packages"

to something like

"No i2c interface can be found. Make sure you have installed libevdev packages AND that your PATH includes /usr/sbin"

from asus-numberpad-driver.

ldrahnik avatar ldrahnik commented on August 15, 2024

Adding /etc/udev/rules.d/99-input.rules doesn't help on Debian, the rules are in /usr/lib/udev/rules.d/ but adding 99-input.rules in this directory doesn't provide the expected permissions on /dev/uinput after reboot. What am I missing?

From Debian udev wiki:

...
The rules files (which amount to more configuration for udevd) are taken from /run/udev/rules.d, /etc/udev/rules.d or /lib/udev/rules.d....
...

from asus-numberpad-driver.

ldrahnik avatar ldrahnik commented on August 15, 2024

@dflipo

Btw. you should mention that the user must have the directory "/usr/sbin" listed in his/her $PATH (for i2cdetect, i2ctransfer).
I still wonder if this is safe…

Can you be more specific about what risk you see? I think your distribution does have sbin in $PATH by default and you changed it by yourself. Is it documented somewhere in case I am wrong? Can you provide doc link, please?

from asus-numberpad-driver.

ldrahnik avatar ldrahnik commented on August 15, 2024

Adding /etc/udev/rules.d/99-input.rules doesn't help on Debian, the rules are in /usr/lib/udev/rules.d/ but adding 99-input.rules in this directory doesn't provide the expected permissions on /dev/uinput after reboot. What am I missing?

From Debian udev wiki:

...
The rules files (which amount to more configuration for udevd) are taken from /run/udev/rules.d, /etc/udev/rules.d or /lib/udev/rules.d....
...

You can test whether was the rule applied like this (--verbose, crwxrwxr-x has been changed to crw-rw----):

$ ls -l /dev/uinput
crwxrwxr-x 1 root uinput 10, 223 Dec 30 13:16 /dev/uinpu

$ echo 'KERNEL=="uinput", GROUP="uinput", MODE:="0660"' | sudo tee /etc/udev/rules.d/99-input.rules >/dev/null

$ sudo udevadm control --reload-rules && sudo udevadm trigger --verbose --sysname-match=uinput

$ ls -l /dev/uinput
crw-rw---- 1 root uinput 10, 223 Dec 30 13:23 /dev/uinput

from asus-numberpad-driver.

dflipo avatar dflipo commented on August 15, 2024

Can you be more specific about what risk you see? I think your distribution does have sbin in $PATH by default and you changed it by yourself. Is it documented somewhere in case I am wrong? Can you provide doc link, please?

I have been administrator of my Uni lab's network (I am retired now), at that time only administrators had /sbin and /usr/sbin in their PATH. Otherwise, what is the point of splitting binaries between /usr/bin and usr/sbin? (for me s stands for system).

As of Debian, sorry, I see nothing in my installation scripts that exclude /usr/sbin from the users' PATH.

In /usr/sbin I see programs like unix_chkpwd, update-grub, update-secureboot-policy, etc., not really meant for standard users imho...

from asus-numberpad-driver.

ldrahnik avatar ldrahnik commented on August 15, 2024

Can you be more specific about what risk you see? I think your distribution does have sbin in $PATH by default and you changed it by yourself. Is it documented somewhere in case I am wrong? Can you provide doc link, please?

I have been administrator of my Uni lab's network (I am retired now), at that time only administrators had /sbin and /usr/sbin in their PATH. Otherwise, what is the point of splitting binaries between /usr/bin and usr/sbin? (for me s stands for system).

As of Debian, sorry, I see nothing in my installation scripts that exclude /usr/sbin from the users' PATH.

In /usr/sbin I see programs like unix_chkpwd, update-grub, update-secureboot-policy, etc., not really meant for standard users imho...

I agree best practice is to use the Python library (smbus2), could you please test this branch (where I removed usage of i2c-transfer from sbin, important is this commit, first one only adds pip3) because unfortunately I do not have my laptop with NumberPad now (reclamation).

from asus-numberpad-driver.

ldrahnik avatar ldrahnik commented on August 15, 2024

Adding /etc/udev/rules.d/99-input.rules doesn't help on Debian, the rules are in /usr/lib/udev/rules.d/ but adding 99-input.rules in this directory doesn't provide the expected permissions on /dev/uinput after reboot. What am I missing?

From Debian udev wiki:

...
The rules files (which amount to more configuration for udevd) are taken from /run/udev/rules.d, /etc/udev/rules.d or /lib/udev/rules.d....
...

You can test whether was the rule applied like this (--verbose, crwxrwxr-x has been changed to crw-rw----):

$ ls -l /dev/uinput
crwxrwxr-x 1 root uinput 10, 223 Dec 30 13:16 /dev/uinpu

$ echo 'KERNEL=="uinput", GROUP="uinput", MODE:="0660"' | sudo tee /etc/udev/rules.d/99-input.rules >/dev/null

$ sudo udevadm control --reload-rules && sudo udevadm trigger --verbose --sysname-match=uinput

$ ls -l /dev/uinput
crw-rw---- 1 root uinput 10, 223 Dec 30 13:23 /dev/uinput

Have you had time to check where (how) can be the udev rule applied to your distro?

from asus-numberpad-driver.

dflipo avatar dflipo commented on August 15, 2024

I agree best practice is to use the Python library (smbus2), could you please test this branch (where I removed usage of i2c-transfer from sbin, important is this commit, first one only adds pip3) because unfortunately I do not have my laptop with NumberPad now (reclamation).

Installation with this new branch brings another error message:
flipo% bash install.sh
[sudo] Mot de passe de flipo :
groupadd : le groupe 'numberpad' existe déjà
Added group numberpad to current user

Lecture des listes de paquets…
Construction de l'arbre des dépendances…
Lecture des informations d'état…
ibus est déjà la version la plus récente (1.5.27-5).
libevdev2 est déjà la version la plus récente (1.13.0+dfsg-1).
curl est déjà la version la plus récente (7.88.1-10+deb12u5).
xinput est déjà la version la plus récente (1.6.3-1).
i2c-tools est déjà la version la plus récente (4.3-2+b3).
python3-dev est déjà la version la plus récente (3.11.2-1+b1).
python3-pip est déjà la version la plus récente (23.0.1+dfsg-1).
libxml2-utils est déjà la version la plus récente (2.9.14+dfsg-1.3~deb12u1).
0 mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour.

error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.

See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
pip dependencies via file requirements.txt cannot be loaded correctly.

I don't understand what is going on (I have no experience at all with python), I don't know which "environment is externally managed"...

I have installed the Debian package python3-smbus2, and tried again, => same error message.

from asus-numberpad-driver.

dflipo avatar dflipo commented on August 15, 2024

Have you had time to check where (how) can be the udev rule applied to your distro?

Yes, but with no success yet :-(

flipo% ls -l /dev/uinput
crw------- 1 root root 10, 223 30 déc. 18:57 /dev/uinput
flipo% echo 'KERNEL=="uinput", GROUP="uinput", MODE:="0660"' | sudo tee /etc/udev/rules.d/99-input.rules >/dev/null
flipo% sudo udevadm control --reload-rules && sudo udevadm trigger --verbose --sysname-match=uinput
flipo% ls -l /dev/uinput
crw------- 1 root root 10, 223 30 déc. 18:57 /dev/uinput
flipo% sudo udevadm control --reload-rules && sudo udevadm trigger --verbose --sysname-match=uinput
flipo% ls -l /dev/uinput
crw------- 1 root root 10, 223 30 déc. 18:57 /dev/uinput

I have noticed in other rules on Debian that the MODE is defined with MODE="0660" instead of MODE:="0660" (in your command), so I tried it again with MODE="0660" 'without the colon), same result... I have to investigate what goes wrong on my system.

from asus-numberpad-driver.

ldrahnik avatar ldrahnik commented on August 15, 2024

I agree best practice is to use the Python library (smbus2), could you please test this branch (where I removed usage of i2c-transfer from sbin, important is this commit, first one only adds pip3) because unfortunately I do not have my laptop with NumberPad now (reclamation).

Installation with this new branch brings another error message:
flipo% bash install.sh

Bad idea to mix two branches. Can you please try it now? Thank you and sorry!

from asus-numberpad-driver.

dflipo avatar dflipo commented on August 15, 2024

I tried it right now. My udev rules problem being unsolved, after rebooting I had to do
root# chown :uinput /dev/uinput
root# chmod g+rw /dev/uinput
to get
root# ll /dev/uinput
crw-rw---- 1 root uinput 10, 223 Dec 31 17:04 /dev/uinput
then I tried to start your driver:
root# systemctl restart --user [email protected]
Failed to connect to bus: No medium found

I append the error.log file (zipped) in case it helps.
error.log.zip

from asus-numberpad-driver.

ldrahnik avatar ldrahnik commented on August 15, 2024

As summary what has to be done in this issue:

root# chown :uinput /dev/uinput
root# chmod g+rw /dev/uinput
to get
root# ll /dev/uinput
crw-rw---- 1 root uinput 10, 223 Dec 31 17:04 /dev/uinput

from asus-numberpad-driver.

ldrahnik avatar ldrahnik commented on August 15, 2024

@dflipo Could you please look here? chrippa/ds4drv#93 (comment)

from asus-numberpad-driver.

dflipo avatar dflipo commented on August 15, 2024

@dflipo Could you please look here? chrippa/ds4drv#93 (comment)

I added file /etc/modules-load.d/uinput.conf, it seems to fix the udev rules permissions: after reboot I get
flipo% ll /dev/uinput
crw-rw---- 1 root uinput 10, 223 3 janv. 16:34 /dev/uinput

Unfortunately installation through https://github.com/asus-linux-drivers/asus-numberpad-driver/tree/replaced-i2c-transfer-tool-to-usage-of-python-lib still fails for ./install_device_check.sh:
ligne 5: i2cdetect : command not found
No i2c interface can be found. Make sure you have installed libevdev packages

If I add PATH="${PATH}:/usr/sbin" in line4, the installation completes successfully but with an error in error.log:
2024-01-03 16:34:18,011 INFO Detecting keyboard from string: "N: Name="AT Translated Set 2 keyboard""
2024-01-03 16:34:18,011 INFO Set keyboard 0 from H: Handlers=sysrq kbd leds event0
2024-01-03 16:34:18,036 INFO Detecting touchpad from string: "N: Name="ASUE140D:00 04F3:31B9 Touchpad""
2024-01-03 16:34:18,036 INFO Set touchpad device id 1 from S: Sysfs=/devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-1/i2c-ASUE140D:00/0018:04F3:31B9.0001/input/input24
2024-01-03 16:34:18,036 INFO Set touchpad id 12 from H: Handlers=mouse1 event12
2024-01-03 16:34:18,036 ERROR Can't open the I2C bus connection (id: 1)

from asus-numberpad-driver.

ldrahnik avatar ldrahnik commented on August 15, 2024

Unfortunately installation through https://github.com/asus-linux-drivers/asus-numberpad-driver/tree/replaced-i2c-transfer-tool-to-usage-of-python-lib still fails for ./install_device_check.sh:
ligne 5: i2cdetect : command not found
No i2c interface can be found. Make sure you have installed libevdev packages

Commit ca4ef6c

from asus-numberpad-driver.

ldrahnik avatar ldrahnik commented on August 15, 2024

I added file /etc/modules-load.d/uinput.conf, it seems to fix the udev rules permissions: after reboot I get
flipo% ll /dev/uinput
crw-rw---- 1 root uinput 10, 223 3 janv. 16:34 /dev/uinput

Commit bf9df36

from asus-numberpad-driver.

ldrahnik avatar ldrahnik commented on August 15, 2024

Adding /etc/udev/rules.d/99-input.rules doesn't help on Debian, the rules are in /usr/lib/udev/rules.d/

Commit (now it is consistent with udev rule for external keyboard, was already installed to /usr/lib/udev/rules.d/) 9ed83f7

from asus-numberpad-driver.

ldrahnik avatar ldrahnik commented on August 15, 2024

I have noticed in other rules on Debian that the MODE is defined with MODE="0660" instead of MODE:="0660"

Commit cc2e39c

from asus-numberpad-driver.

ldrahnik avatar ldrahnik commented on August 15, 2024

2024-01-03 16:34:18,036 ERROR Can't open the I2C bus connection (id: 1)

Commit 089fe6a

from asus-numberpad-driver.

ldrahnik avatar ldrahnik commented on August 15, 2024

@dflipo ping

from asus-numberpad-driver.

ldrahnik avatar ldrahnik commented on August 15, 2024

@dflipo Merged, can be reopened

from asus-numberpad-driver.

Related Issues (20)

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.