nbovee / shop-prototype

Dockerized Django with Postgres, Gunicorn, and Traefik or Caddy (with auto renew Let's Encrypt)
MIT License
0 stars 5 forks source link

Barcode/QR scanner integration #5

Open nbovee opened 6 months ago

nbovee commented 6 months ago

research available packages to hook/intercept barcode scanner results

Palacios1337 commented 5 months ago

So throughout my research, I learned two things. One, the barcode scanner acts like a keyboard which is just inputs. Two is that it is possible to intercept barcode scans if it's connected to the Ipad and needs information to the raspberry pi.

So first, if information needed to be scanned from the barcode to the IPAD then the result of the barcode is just a string of keyboard inputs. So I was thinking just having the results of the barcode given with a string is just needed. Then having code correlate the string with the database and returning what is needed on a specific page. Then once having checked out it would have code again and return changes to the database on what needed to be removed.

There is one youtube video that uses python to be able to do this and could follow through how they did it. Then also below is the github code that we could also go by off and learn.

https://www.youtube.com/watch?v=zU7YVKnwTdo https://github.com/vpatron/barcode_scanner_python

I do think that most of the code would be once scanning the barcode. Then it would most likely send a request to the database and return the name of the product. Which then displays what the product is. Then once they check out, it will show how many items were scanned and see how many need to be removed from inventory. Or if they want to add stuff into inventory with the barcode, they could use the barcode scanner just to scan the string and store it.

Other than that I do not think a library is needed for it but there are youtube videos explaining more about it. And basic functionalities of it with code as well I believe. It also tests with their own database in which we could possibly just adjust the code to work with ours.

https://www.youtube.com/watch?v=ywakseuir-o https://piddlerintheroot.com/barcode-scanner/#google_vignett

Another thing I realized was that the barcode works with bluetooth as well as a cord. However, In the case they do want to work with the bluetooth on the tablets, and if needed access from the raspberry pi. This would work on intercepting bluetooth signals.

https://www.youtube.com/watch?v=dsZN0dqh81k https://ubertooth.sourceforge.net/hardware/one/ https://www.kismetwireless.net/