Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikelpsv/barcode-scan-mod
Golang module for working with a barcode scanner
https://github.com/mikelpsv/barcode-scan-mod
barcode libusb scanner usb
Last synced: about 1 month ago
JSON representation
Golang module for working with a barcode scanner
- Host: GitHub
- URL: https://github.com/mikelpsv/barcode-scan-mod
- Owner: mikelpsv
- License: apache-2.0
- Created: 2023-03-16T07:48:43.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-19T14:03:24.000Z (9 months ago)
- Last Synced: 2024-03-20T14:34:36.168Z (9 months ago)
- Topics: barcode, libusb, scanner, usb
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Barcode scanner module
Golang module for working with a barcode scannerYou must first install libusb-1.0. This is pretty straightforward on linux. The cgo package should be able to find it if you install it in the default manner or use your distribution's package manager. For Ubuntu:
```
$ sudo apt-get install libusb-1.0-0-dev
```You may need to grant the current user access to the USB device. This is usually done by adding a file to /etc/udev/rules.d called 50-usb-scale.conf and contents like this:
```
SUBSYSTEM=="usb", ATTR{idVendor}=="HEX1", ATTR{idProduct}=="HEX2", MODE="0666"
```
Where `HEX1` and `HEX2` are replaced by the Vendor and Product ID respectively.Instead, to match the interface type, you can try replacing ATTR{idVendor}=="HEX1", ATTR{idProduct}=="HEX2" with a match for `bInterfaceClass` equal to 03 (HID):
```
SUBSYSTEM=="usb", ATTR{bInterfaceClass}=="03", MODE="0666"
```Then apply udev rules and reboot the platform:
```
$ sudo udevadm control --reload-rules && udevadm trigger
```