adafruit / adafruit/LS2208-USB-Barcode-Scanner

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

Open
#1 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
28
Forks
10
PR merge metrics
No merged PRs in 30d

Description

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: : 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
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: : 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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with test.py and trace get_scanners in scanner.py into HID.py, especially OpenDevices, HIDDevice, and connect where the traceback reaches HidD_GetAttributes. Reproduce the failure on the reported Windows and Python setup, then compare the handle and ctypes call behavior; done means device enumeration no longer stops with this ArgumentError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.