Hi Yvan, On Wed, 16 Mar 2016 18:21:18 +0100, [email protected] wrote: > First, please apologize: I don't know if what I experience is really a > bug or just me that do not understand how to use this tool.
Perhaps a bit of both ;-). > I am trying to use an Orbit MS7120 barcode scanner (RS232), which works > well using "cat /dev/ttyS0". So I take it you'd like to use inputattach so that the barcode scanner is treated like a keyboard, is that correct? > # inputattach -lk /dev/ttyS0 > -> writes garbage in every windows -> works as expected because the > "mode" is not the right one By "every windows", do you mean that scanning something causes characters to be sent to all windows simultaneously, or do they go to the window which has focus, whichever it is? > # inputattach --daemon -lk /dev/ttyS0 > -> same as before but daemonize -> works as expected > > # inputattach --baud 9600 --dump /dev/ttyS0 > -> writes good scanned data only to the current terminal -> I suppose it > should also write to other terminals / windows > Sample output: > 30 (0) 35 (5) 31 (1) 31 (1) 32 (2) 32 (2) 31 (1) 39 (9) > 39 (9) 33 (3) 33 (3) 32 (2) 0d (x) 0a (x) This is as expected. The documentation for --dump is misleading (I'll fix that...): instead of attaching the device to the input subsystem, it dumps the characters it receives in the format above. It's intended for debugging new devices. In this instance I take it you scanned the barcode for 051122199332... > # inputattach --daemon --baud 9600 --dump /dev/ttyS0 > -> same as before, but never goes to background -> I suppose it should > daemonize --daemon is effectively ignored in --dump mode. (I'll document that too.) > Also, the last 2 commands do NOT add an entry in > /proc/bus/input/devices. That's expected (but undocumented). > All of that makes me think that the "dump" "mode" is only for testing > purposes. > Am I right? If so, what to do if other "modes" are not correct for this > peripheral? That is correct. As far as I'm aware there isn't an appropriate mode for your device... Adding a new mode requires support in the kernel and inputattach. Since it would be useful generally, I'll add a feature to inputattach so new modes can be tried using command-line parameters, then you can try to find a mode which works ;-). Alternatively, you may have more luck with https://launchpad.net/serial-text which continuously reads input from a serial port and injects it into the input subsystem. If that works I can perhaps add it to the inputattach package, or package it directly. Regards, Stephen
pgpMg8BQ0mOWZ.pgp
Description: OpenPGP digital signature

