I would like to know if we can have both hidraw0 and hidg0 at the same time?

Detailed description :-

I have a barcode scanner, raspberry pi zero W, zero4u hub. Barcode scanner is connected to raspberry pi and when a barcode is scanned, that data is sent to a database. Also raspberry pi is connected to PC and I want raspberry pi to act as a keyboard emulator for the PC to print the scanned data from barcode to the PC.

My connection :-

I have connected the raspberry pi to the usb hub and it works fine. Barcode scanner is connected via the usb hub and raspberry pi is connected to the pc using usb cable.

My problem :-

Since the barcode scanner is connected, I get hidraw0 in /dev/ through which I can read the input from barcode scanner. But now I want raspberry pi to act as a keyboard emulator and send the input read from barcode scanner to PC using hidg0. But I don't have any hidg0 in /dev/ so I cannot move on with this step.

Does anyone know how can I have this task done?


  • are you certain that the scanner does not emulate a keyboard? ..... open a text editor on your PC .... plug in the scanner into your PC .... scan a barcode – jsotola Feb 27 at 0:53
  • Hey @jsotola, scanner does emulate as a keyboard on rpi, but what I want is to scan the code into rpi and then make rpi act as a keyboard emulator to PC so I can send the data taken into rpi from scanner to the PC. Problem is that I have hidraw0 because of barcode scanner connect to rpi but I also want hidg0 (which I am not getting currently) so that I can send data to PC. – Shreeya Patel Feb 27 at 7:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.