LibUsbDotNet Barcode scanner - barcode-scanner

I have a barcode scanner. and i successfully generated the .inf for my scanner, and it install successfully. and i tried sample code, but i keep getting IoTimedOut:IoTimedOut:No more bytes! . Is it because of my configuration, interface or endpoint problem?
Thanks you
this is my scanner configuration from the LibUSBDotNet, scanner.jpg

That sample code will timeout after 5 seconds if no input was read. In other words, you did not scan a barcode within 5 seconds of starting the application.

Related

Python3.10.4 serial readline() not displaying prompts

Right now, I am connecting to a device using Tera Term and manually running over 50 tests. My goal is to automate these tests. Currently I am trying to do this through python using the pyserial library. The issue I am running into is readline() will display everything until the login prompt appears. It stops on the line before.
What it should look like
Booting: 2022.08
CPU: cpu_id
In: serial
OUT: serial
Normal Boot
Hit any key to stop autoboot: 0
Starting Kernel ...
Enter your credentials
cpu_id login:
what readline() is displaying:
Booting: 2022.08
CPU: cpu_id
In: serial
OUT: serial
Normal Boot
Hit any key to stop autoboot: 0
Starting Kernel ...
Enter your credentials
Here is the code I am currently playing with:
Any insight would help. Or, if you know of another way to run tests through a serial port, I'm all ears.Thanks!
Thanks to the comments of #ShadowRanger I was able find a work around. I ended the readline() loop the line before the login prompt. I then logged in and ran a test blind then started reading again afterwards. Here is the code I used:
This is not the cleanest code but it explains the process well enough.

Bluetooth SPP to a Raspberry returns looping weird values

I'm running out of ideas, I finally got a connection to a Bluetooth Barcode Scanner via SPP, but once I'm listening to the connection with
sudo cat /dev/rfcomm0
It's repeating the scanned code, everytime prepending some ^JJJ values:
^J^JJ^JJJJ^J^4000539103766
^J^JJ^JJJJ^J^4000539103766
^^J^JJ^JJJJ^J^4000539103766
^J^J^JJ^JJJJ^J^4000539103766
^^J^J^JJ^JJJJ^J^4000539103766
J^^J^J^JJ^JJJJ^J^4000539103766
and this continues, sometimes till it stop by itself or till I kill it.
Anyone has ever seen this?

Make one time only activation code to python code, and make updates available?

I'm coding a program to do some action with webdriver and Autoit in python, I want to do two things before I start selling my code:
Add onetime activation code to my software on one PC, like to make the program works only on one pc.
Make my program able to receive updates from the internet once I add to the code some more features or correct some others.
is it possible only with Python? or what is the method statement to do it?
On client side you need use hard-disk serial or/and uuid of partition or Operational System timestamp + something to generate serial code .
On server side , you need a API to store hard disk serial to validate if this is a computer valid . And you client on load check if activaction is valid .
The second question i can't answer .
Regarding the second part of your question:
Create a text file with the latest version of your application and put it on your webserver e.g. http://download.example.com/example-app-version.txt to get and read its value later.
On your python code download and read the text (for Python 3+ use 'import urllib.request' and urllib.request.urlretrieve) when your app runs and compare it against the installed version (if statement).
E.g.
if latestVer > installedVer:
#update
else:
#application continues

PyUSB Barcode Scanner without Button by Honeywell

I have a Honeywell N5600 that I'm trying to use, but I don't get it to scan anything.
The device is recognized as /dev/hidraw1, but as it does not have any button to press, I cannot trigger the scan and thus, when I try to read from it, it just waits forever.
I started creating a python program, that seems to be able to communicate with it (different return values):
VENDOR_LEGO = 0x0c2e
PRODUCT_EV3 = 0x0967
device = usb.core.find(idVendor=VENDOR_LEGO, idProduct=PRODUCT_EV3)
device.detach_kernel_driver(0)
#"TRGMOD8." would - when scanned (which I cannot do, at this point) - activate a permanent scanning mode
device.ctrl_transfer(0x21, 0x9, wValue=0x200, wIndex=0x00, data_or_wLength='TRGMOD8.')
#8 is returned
device.ctrl_transfer(0x21, 0x9, wValue=0x200, wIndex=0x00, data_or_wLength='PAPSPC.')
#7 is returned
Unluckily the link given in this post is not reachable anymore. It seems like it would have solved my problem.
How can I activate the scanning?
The document on Honeywell N5600 is as follows.
N5600 OEM 2D Imager Data Sheet
N56XX Decoded Engine User's Guide
You need a Windows PC that can connect to the Internet, but there is a tool called EZConfig-Scanning that configures and maintains the scanner.
EZConfig Device Management Data Sheet
Perhaps the recognition device /dev/hidraw1 is probably because the scanner is set to USB HID Bar Code Scanner mode.
If you change the setting to USB Keyboard(PC/Mac), it is always readable and the barcode you read will be notified as keyboard input.
By changing the setting to USB Serial, reading start/stop can be controlled by SerialPort command transmission. The barcode read is notified by receiving data from SerialPort.

"An invalid handle was specified" on OpenCV VideoCapture creation

I trying to get video from a webcam using OpenCV 2.4.5 and Visual C++ 2010, but when I try to initializate the VideoCapture
VideoCapture cap(1);
I get this error:
0xC0000008: An invalid handle was specified.
The camera is connected and working. I tryied with 0 and -1 as parameters, with the same result. If I continue the excecution of the program, ignoring the error, the cap variable is null.
According to what I've read somwhere else, if I excecute the generated .exe, the program works OK. But obviously I need to work inside Visual to debug properly.
Thanks in advance!
Please go through the cvSetCaptureProperty and also try to give the video input through the cvCaptureFromCAM, because cvCaptureFromCAM is specific api for camera.

Resources