Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hidraw0 not correct one. #9

Open
Saentist opened this issue Aug 28, 2022 · 2 comments
Open

hidraw0 not correct one. #9

Saentist opened this issue Aug 28, 2022 · 2 comments

Comments

@Saentist
Copy link

hidraw0 is not correct device all time.
What happens if PC used have Touch screen?
What if have also attached UPS?

# ll /dev/hidraw*
crw-rw-rw- 1 root plugdev 240, 0 юли 30 23:58 /dev/hidraw0
crw-rw-rw- 1 root plugdev 240, 1 юли 30 23:58 /dev/hidraw1
crw-rw-rw- 1 root plugdev 240, 2 юли 30 23:58 /dev/hidraw2

what is what

#!/bin/bash

FILES=/dev/hidraw*
for f in $FILES
do
  FILE=${f##*/}
  DEVICE="$(cat /sys/class/hidraw/${FILE}/device/uevent | grep HID_NAME | cut -d '=' -f2)"
  printf "%s \t %s\n" $FILE "$DEVICE"
done

in case

# ./hid.sh
hidraw0          American Power Conversion  Smart-UPS C 1500 FW:UPS 10.0 / ID
hidraw1          STMicroelectronics HID in FS Mode
hidraw2          HID TOUCH HID Touch Panel

# lsusb
Bus 001 Device 007: ID 13d3:5129 IMC Networks USB2.0 UVC VGA WebCam
Bus 001 Device 005: ID 058f:6366 Alcor Micro Corp. Multi Flash Reader
Bus 001 Device 002: ID 04ca:f001 Lite-On Technology Corp. TvTUNER
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 002: ID 1bfd:1688 TouchPack Resistive Touch Screen
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 0665:5161 Cypress Semiconductor USB to Serial  <<< INVERTER
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 051d:0003 American Power Conversion UPS
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Is it possible to have some automation for this cases?

@MindFreeze
Copy link
Owner

There are links to devices based on there IDs somewhere under /dev/usb . You can fork the repo and change the config to use that.

@Saentist
Copy link
Author

Saentist commented Aug 29, 2022

If is so simple this will be PR not FR

https://matoking.com/blog/2015/12/29/writing-touchscreen-driver-python/
some sources how to detect something with python attached to hidraw
/някой не е прочел последния ред ;) /

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants