D
D
dobryshkin2017-03-24 21:42:24
linux
dobryshkin, 2017-03-24 21:42:24

How to read a barcode scanner device?

The problem is reading the /dev/hidraw1 device, a barcode scanner is connected to the server, the device is detected, but when scanning, the code is simply entered into the terminal window, as I wrote from the keyboard, but I should read it and send it to the thread (file, script).
so that it doesn’t interfere with what it spits out, I cut through ssh and try to read the device
read /dev/hidraw1
, it doesn’t display anything, it spits out an unreadable
cat /dev/hidraw1
format like
"$ ( "" ( "$$ ) "

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2017-03-24
@NeiroNx

showkey -s
only works for 10 seconds -
cat /dev/console
runs all the time

R
Roman Frank, 2017-03-25
@Akellacom

As a rule, scanners work in a keyboard break (text input). You can throw a script that will intercept input

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question