Raspberry Pi – Device hooks

raspberry pi logo

Raspberry Pi and some connected USB are fine… but not if one or more devices are adressed on another /dev/device on a reboot, your program may break due to not find the correct device.


Create Symlinks using PID/VID

This only works if you do not have exactly the same devices on the Pi, thus for example we have a touchschreen (display and HID input device) and barcode reader (HID input device)

So the above configuration creates for the HID devices:

/dev/input/event1

and

/dev/input/event2

and a framebuffer for the displaylink screen

/dev/fb1

but wich is wich /input/event? and after next reboot…wich device is initialized first?

Now…to hook your devices you can use lsusb to view a list with corresponding vid/pid:

To create symlinks (aka shortcuts) you can edit the file /etc/udev/rules.d/10-local.rules

after a reboot there are symlinks created in the /dev folder wich you can use now too:

Display link: /dev/dlink

Display touch:/dev/dtouch

Barcode reader:/dev/barread