Coder Social home page Coder Social logo

ls2208-usb-barcode-scanner's Introduction

Python code for reading raw HID packets from a LS2208 (and similar?) USB barcode scanner. Windows only, hopefully someone can adapt HID code for linux/mac? 

VID/PID hardcoded, change if necessary for other scanners

Requires win32 extension for Python. Tested with python 2.5 only. May not work with other versions.

ls2208-usb-barcode-scanner's People

Contributors

ladyada avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ls2208-usb-barcode-scanner's Issues

ctypes.ArgumentError: argument 1: <type 'exceptions.OverflowError'>: long int too long to convert

Hello,
I am using a Symbol LS2208 barcode scanner and trying to read the data from it using python. I downloaded your package, and attempted to use your script to connect to it but I ran into this error:
ctypes.ArgumentError: argument 1: <type 'exceptions.OverflowError'>: long int too long to convert

For reference, here is the entire Traceback to the error:

Traceback (most recent call last):
  File "C:/Users/PycharmProjects/practice_project/LS2208-USB-Barcode-Scanner-master/test.py", line 6, in <module>
    scanners = get_scanners()
  File "C:\Users\PycharmProjects\practice_project\LS2208-USB-Barcode-Scanner-master\scanner.py", line 53, in get_scanners
    targets = HID.OpenDevices(VENDORID,PRODUCTID)
  File "C:\Users\PycharmProjects\practice_project\LS2208-USB-Barcode-Scanner-master\HID.py", line 162, in OpenDevices
    temp = HIDDevice(handle)
  File "C:\Users\PycharmProjects\practice_project\LS2208-USB-Barcode-Scanner-master\HID.py", line 191, in __init__
    self.connect()
  File "C:\Users\PycharmProjects\practice_project\LS2208-USB-Barcode-Scanner-master\HID.py", line 202, in connect
    hid.HidD_GetAttributes(self.handle,byref(attrib))
ctypes.ArgumentError: argument 1: <type 'exceptions.OverflowError'>: long int too long to convert

I know this package is old and only tested in python 2.5. I am using 2.7 (on Windows 10) and perhaps this is a compatibility issue? When looping through every HID device it can't get past the first one because of this issue.

I would really appreciate any help, thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.