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
Scanner wedge mode #437
Scanner wedge mode #437
Conversation
- Allow user to choose which barcode scanner to use
Unfortunately i have no idea how to compile the source code into an apk. |
- Required some tweaks to other code
So it took some figuring out on my end. I had to put the scanner into "Keyboard Mode" and set the Terminator to the Enter Key. It was that last part I had missed and was driving me crazy as it didn't seem to work at all. I can see in debug logs that its working but I only had the demo server to test at the moment. I tried to scan a part label but kept getting "No match found".
It clearly is scanning the barcode correctly. And im connected to the demo server on the device and on my pc where I generated the part label. So shouldn't it be able to find the part? idk. It's late and I may just be missing something silly at this point. If im missing something and should try another way to test it, please let me know. |
So I tried doing "assign barcode" on some random part and I scanned the same barcode ["PART"; 940 ], that worked. Then I went back to the main screen, clicked on the scanner at the bottom, scanned the same barcode, and it took me to the random part. So I guess this is working??? But what then is the intended behavior of the barcodes? Do I need to create barcodes for everything and assign the barcodes? Can I not just use the barcodes generated by Inventree? I am a bit confused here. |
Should be working with normal barcodes (or QR Codes) generated by InvenTree as well. |
@lfg-seth I'm amazed that it works so well right out of the gate :) For the "native InvenTree barcodes", it looks like the scanner is changing the raw barcode data: You are getting:
But it should read:
Until this is fixed, the InvenTree server will not recognize the data! Are there any settings in your scanner to address this? |
Interesting. So when I scan the barcode in a text box or in the scanners test scan app, it shows up as {"part": 940}. Could it be something with the debug? or something with the library? I'm not 100 percent certain but I do not think it's an issue with the scanner. |
Not even sure if this is the right library....But it almost sounds like this might be going on shaxxx/flutter_barcode_listener#34 |
It looks like that is the right track - all the "errors" in the data equate to alternate keyboard keys due to incorrect "SHIFT" usage |
Frustratingly, we cannot even test this behaviour automatically - due to a similar limitation in the flutter unit testing framework: |
- https://github.com/fuadreza/flutter_barcode_listener - Fork of https://github.com/shaxxx/flutter_barcode_listener - Properly handles key "case" issues (shift, essentially) - Verified that it works correctly for multiple character types
Ok, some progess! To get this to work, I had to use this fork which correctly handles all these characters. It is not available on pub.dev so had to pin the git commit, but it does work! Tested that the following string scans correctly: (As I did not have a barcode scanner on hand, managed to hack one together with an esp32 as a fun learning exercise!) |
@lfg-seth when you get a chance, please check with the latest updates |
Success! It seems to be working now @SchrodingersGat. Thanks for the support here! |
I think this would warrant a short blog and social media post. |
Hello together, glad to hear It's working now. Thanks a lot for the quick Implementation. Great work :) |
App release is now out, lmk how it works for you guys |
@SchrodingersGat this feature works fine for me with an android 10 Tablet and a datalogic usb scanner with an otg cable. Thank you, very appreciated 👍 |
@42CrMo4 glad to hear that it is working well :) The home page features should be possible. Please open a new issue so if doesn't get lost |
Implements "wedge scanning" functionality for barcode scanning, as an alternative to the internal camera. Allows use with external barcode readers, or with dedicated scanning devices (typically android)
Closes #364
Implements the code_scan_listener library
Note: I don't currently have access to a test device to check if this works correctly - if anyone can test, that would be greatly appreciated so we can push out a release ASAP