Article 6QAH4 Reading input from keyboard emulator.

Reading input from keyboard emulator.

by
evanmars
from LinuxQuestions.org on (#6QAH4)
I have a Zebra LS2208 barcode scanner.
If I use a USB cable to connect it to my computer, I can just read stdin to get the scan.
Cable here

It seems that if I use a serial cable with a serial to USB keyboard emulator cable, reading stdin doesn't work.
Cable here
Adapter here

dmesg results for keyboard emulator:
Code:[ 4.127338] usb 3-1.3: new full-speed USB device number 4 using xhci-hcd
[ 4.241357] usb 3-1.3: New USB device found, idVendor=03eb, idProduct=201d, bcdDevice= 0.25
[ 4.249933] usb 3-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4.257388] usb 3-1.3: Product: INT USB KEYBOARD EMUL
[ 4.262536] usb 3-1.3: Manufacturer: INTELLETTO
[ 4.267149] usb 3-1.3: SerialNumber: 083735343737
[ 4.322426] input: INTELLETTO INT USB KEYBOARD EMUL as /devices/platform/scb/fe9c0000.xhci/usb3/3-1/3-1.3/3-1.3:1.0/0003:03EB:201D.0001/input/input0
[ 4.399548] hid-generic 0003:03EB:201D.0001: input,hidraw0: USB HID v1.11 Keyboard [INTELLETTO INT USB KEYBOARD EMUL] on usb-fe9c0000.xhci-1.3/input0Python code for non-blocking reading of stdin:
Code: def barcode():
bc = []
while sys.stdin in select.select([sys.stdin], [], [], 0)[0]:
bc = sys.stdin.readline()
print(f'Getting barcode\nbarcode = {bc}')
if bc:
return bc
return None"Getting barcode" always gets printed, but barcode is blank.
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments