-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot open connection with OPN-2001 scanner? #64
Comments
Hello @alittle Do you have some, so I can check what are the specifications of the underlying serial port? Regards Xavier |
Hi @xseignard - thank you for offering to take a look. I'm working in large part from python project code for a scanner that uses the same protocol here, otherwise all example code for the device is provided in wrapper libraries in objective-c and .net: https://github.com/fazalmajid/cs1504! It looks like some of this may be configurable though in the device itself by scanning particular barcode sequences, according to the details in this PDF manual, starting from page "U7" http://www.opticonusa.com/pdf/Manuals/Universal_Menu_Book.pdf! So tomorrow I may try a few of those reset codes for different Parity or Stop Bits but so far I am able to open a connection with the OPN-2001 device using either the python script above or node-serialport code and my Windows 10 machine. |
According to this: https://github.com/fazalmajid/cs1504/blob/master/cs1504.py#L130-L135 It seems the serial port should be configured as 8-Odd-1, and from what I see, you configured it with: Maybe you could try to configure the serial port with: serial.open(
{ parity: 1, dtr: false },
(successMsg) => { /*...*/ },
(errorMsg) => { /*...*/ }
); Let me know if it solves your problem. Regards |
But according to the manual (U7). It seems the bold options are the default ones, and then it would be: serial.open(
{ dtr: false },
(successMsg) => { /*...*/ },
(errorMsg) => { /*...*/ }
); |
Any updates? |
Cough, cough, cough :) |
Thanks for checking back in with me. Unfortunately while it may have taken slightly longer for the error message to appear, after simplifying the port configuration it still resulted in the same error message as before. Slight changes to the configuration could cause the application to quit unexpectedly so it feels like I'm still on the right track. I think my next step is to figure out how to read the error/crash logs around the time when it's trying to make the serial connection and see if any potential culprits appear there. I'm trying to figure how to do adb-over-wifi connections to the phone so that I can have the OTG device connected at the same time as I am monitoring activity and will post any findings I glean from those tests back here. |
After connecting to the device via wifi and watching the logs I'm seeing the following activity when attempting to connect to the scanner:
I'm unsure with the "Serial port opened!" message how it hits the ControlTransfer issue and then fails so quickly but perhaps things don't bubble up in the logs in the same order or an initial handshake is successful but something soon after that but before the success callbacks are invoked fails. The success callback never appears to get called so I don't think I could be messing anything up yet by passing in funky .write data. Omitting the |
Sorry for the (very) late reply... |
Greetings, I've been testing a few cordova plugins for nfc and barcode-reading via device camera and was excited to see this plugin available as well. I'm hoping to pull scanned data from a tiny thumb-scanner using an HTC One running Android 6, an OTG cable and this plugin.
I've tried various combinations with VID/PID specified and the
ProlificSerialDriver
that it should be using but it appears consistently unable to connect hitting the first error callback with the message:I believe everything is in place to specify the connection, rather than assuming the defaults, even though it should pretty much match those but have yet to successfully connect with the device. I'd certainly appreciate any pointers if there is something simple I'm missing.
The request looks something like:
The text was updated successfully, but these errors were encountered: