klintkrossa
Posts: 81
Joined: Tue Nov 10, 2015 3:06 pm

Turn RPi into a python3 kiosk when usb bar-code reader is plugged in

Tue Jul 31, 2018 7:57 pm

Hello

How to turn RPi into a python3 kiosk when usb bar-code reader is plugged in?
I have the bar code reader program that I would like to test.
Where I have the problem is that if the program is not running if the bar code reader reads a bar code it put it where ever the text can go.
A web page would be a big disaster.
Thanks
This is not like any other bulletin boards that I have been on. Been flamed on other BB's so bad I was afraid to ask.

All my Raspberry Pi's are like the Hessian artilleryman of Sleepy Hollow.

User avatar
topguy
Posts: 5685
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Turn RPi into a python3 kiosk when usb bar-code reader is plugged in

Wed Aug 01, 2018 2:28 pm

In what kind of environment does your Pi live if you cant control if someone plugs in the reader and starts scanning stuff ?
Is there a problem with running the program without the barcode reader plugged in ?
How is your program reading the scanned codes from the scanner ? Is it a GUI program that needs to be in "focus"/"on top" for it to work ? Or is it reading directly from the "evdev" device.

I assume that the barcodescanner works as a Keyboard ( HID-device ), have you checked if the scanner also can work as a serialport device ?
If the pi could see the scanner as a serialport then it will not interfere with programs like a browser.
You could also check if you can prevent X-Windows for using the scanner as a Keyboard.

klintkrossa
Posts: 81
Joined: Tue Nov 10, 2015 3:06 pm

Re: Turn RPi into a python3 kiosk when usb bar-code reader is plugged in

Sat Aug 04, 2018 4:20 am

Thanks for the reply

I am looking to make the scanner focus on an input for a python3 script to log the upc. That way I can log the food in and use. I was hopping that when i plug in the upc reader It would bring up the python3 script and run the logging. there is a upc look up part to the script to.
Thanks
This is not like any other bulletin boards that I have been on. Been flamed on other BB's so bad I was afraid to ask.

All my Raspberry Pi's are like the Hessian artilleryman of Sleepy Hollow.

DarkElvenAngel
Posts: 152
Joined: Tue Mar 20, 2018 9:53 pm

Re: Turn RPi into a python3 kiosk when usb bar-code reader is plugged in

Mon Aug 20, 2018 7:08 pm

You have a few options for this, I have a setup for starting a hotspot when a Wi-Fi device is installed but changing it for an HID device is simple enough.

You need to write a udev rule to detect your scanner and create a symlink say barcodescanner then you can write a service and a path file for systemd to watch for that device to be add. The service file can start your script and off you go.

Return to “Advanced users”