dayjaby / zebra-scanner

Read barcodes in python with zebra barcode scanner
MIT License
23 stars 18 forks source link

Running "setup.py" returns IndexError #20

Closed Lazerkill closed 3 years ago

Lazerkill commented 3 years ago

I was able to run the first two install commands from the readme: sudo apt-get install libboost-dev libboost-python-dev libpugixml-dev sudo pip3 install pybind11 However, the install command for zebra-scanner failed.

I then tried to clone the repo using Git and run setup.py locally. See attached screenshot for results. Any help is much appreciated. I am running a RPi 4 with a brand new install of Raspian. screenshot

dayjaby commented 3 years ago

Hey!

Can you try to modify the faulting line in setup.py to contain this: ... if len(sys.argv)>1 and sys.argv[1]=="sdist" ...

Lazerkill commented 3 years ago

That worked! I also realized that I hadn't downloaded/installed the SDK which created a problem right afterwards. Had to run: sudo dpkg -i zebra-scanner-corescanner_4.4.1-19_armhf.deb

I am able to run test.py now. However, the program doesn't react whenever I scan a new barcode. See attached screenshot. No matter how many different barcodes I scan, the output of the console stays the same. screenshot

I've already attempted to downgrade pybind11 to 2.5.0 (per https://github.com/dayjaby/zebra-scanner/issues/16). Any other ideas?

Again I really appreciate the help!

Lazerkill commented 3 years ago

@dayjaby Progress! After combing through the documentation on the SDK page, I followed the instructions on page 4-7 ("Verifying Scanner SDK Functionality"). After scanning the barcode for SNAPI it started to behave properly.

However, I am now getting a segmentation fault when running test.py. Capture

Compared to the intended output on the readme, the print line "New Scanner Found" seems to be getting triggered 1 time too many. Not sure what this could indicate.

Again, any help is appreciated!

dayjaby commented 3 years ago

Nice progress! This segmentation fault has also been reported in https://github.com/dayjaby/zebra-scanner/issues/7. I am not the best one debugging these kind of issues, but maybe GDB could help you find the error spot. https://github.com/pybind/pybind11/issues/1931 has some interesting links.

HennethAnnun commented 3 years ago

@Lazerkill Check my comment https://github.com/dayjaby/zebra-scanner/issues/19#issuecomment-878578857

Lazerkill commented 3 years ago

@HennethAnnun I'll give that a shot! It looks like you still ran into issues in that same thread but I appreciate the advice none-the-less.

@dayjaby I haven't been able to make progress on my own, unfortunately. This segmentation_fault error is proving to be somewhat out of my scope.

dayjaby commented 3 years ago

If anyone has a spare zebra, I would be glad to help! Unfortunately zebra does not sell their OEM scanners to private customers anymore; so a reseller refused my order :(

Fixing the segmentation fault shouldn't be too big of an issue. I fixed several of them with the older zebra sdk versions as well.

dayjaby commented 3 years ago

@Lazerkill the segmentation fault problem got solved on master branch (or just pip install --upgrade zebra-scanner)