Barcode reader text
AnsweredHi,
How to confige a bar code reader to display product text in Nx bookmark with http event?
-
Hi Jerry,
If the HTTP event is set up correctly in the software of the barcode reader, you select Generic Event as the event in Nx Witness and select Bookmark as the action in the Nx Witness rules engine.
To get the relevant API call, you should check the /api/createEvent section of our server API. In THIS article you can read how to access the For Developers section in the WebAdmin client where you can find the server API and the other developer tools.
0 -
Is there any barcode reader with http event configuration?
0 -
Hi Jerry,
Unfortunately I don't have the answer to that question. You should ask the barcode scanner suppliers.
0 -
Jerry,
I went down a similar path trying to determine the easiest way to incorporate a barcode scan into the witness platform. Google search results brought me to this discussion. Since this post is relatively old you may have already found a solution but this could be useful for anyone else searching this topic in the future.
Generally speaking the barcode scanners are seen by computers as human input devices similar to a keyboard. The barcode scanners will vary in their form factors and what kinds of barcodes they can scan. When one scans a code it will generally be seen by the computer as input from a keyboard. If you were to open a notepad file and scan a barcode it will literally type out the barcode and send a return keystroke.
I spoke with a rep from Zebra and they weren't the most helpful in trying to find an onboard solution to generate the http get string that Witness needs to generate the generic event. I ended up with two different solutions
1) windows based PC with a light GUI and script in Autohotkey utilizing WinHttpRequest to send the http get to witness. The majority of the URL is fixed and the user input becomes a variable in the string to reflect whatever barcode is scanned.
2) Raspberry pi based solution with a similar script written in Python using the request function to generate the http get. This is a lighter headless solution that accomplishes the same goal.
Either of these solutions could be tailored to the users needs with different input devices and adjustments to the scripts.
0 -
Hi Doug,
Thank you for your comment.
Would you mind sharing the scripts?
Either here, so anyone can use it or submit it as an integration on my.networkoptix.com/#/integrations so people can reach to you and buy it from you?
0 -
This post is pretty old, but we have a similar needs, we have to read a barcode on a conveyor and create a bookmark on a camera watching the same area.
As I can see we have 2 options :
1. Using a barcode reader (BCR) that can support HTTP notification directly : not easy to find
2. Using a third party device (RPI or Windows) with script like Doug mentionned
For part 2 Norman this solution seems to be suitable : https://github.com/markusressel/barcode-server what do you think about it ?
Loïc TONON and Jordan IUNCKER any idea by your side ?
Regards
0 -
Hi Guilhem Decoux,
Regarding the Github repository; I guess that should work, but I cannot test it, due to a lack of a USB barcode scanner. I also, pinged someone who have used a USB barcode scanner with our VMS. Once I get feedback, I'll let you know.
0 -
Hello Norman
OK perfect keep us posted, we are busy on anothers Nx devs, but would love to have such solution working for logistic projects.
Regards
0 -
Hi Guilhem Decoux,
Our partner Convergence to Pixels do offer a barcode solution.
https://c2p.com/bar-code-reader
With kind regards,
0 -
Hi,
I just contacted them and wait for their feedback.
We will do some tests by our side too.
Regards
0 -
I rummaged through an old box and found the basic barcode scanner and put together a quick bash script as a proof of concept. I used the script that Norman provided for his node red project and modified it a little bit to make it work with the USB barcode scanner.
https://gitlab.com/norman.graafsma/node-red-button-panel
This demo was done with linux mint, but it should work the same on any of the debian based linux distros. Raspberry pi would be very similar. The script could be set to run after startup or however you like. I am not a programmer and this doesn't have anything in the way of error handling etc so you would want to make whatever changes are needed for your application. Hope it is of some use.
Norman: When using a script to generate a token for authentication, is it best practices to invalidate the token once the present action is complete and just generate a new one when the action is required next?
Video of script + event in Wave: https://youtu.be/zD1cZKcBMjM
#!/bin/bashclearwhile truedoread -p "Scan Barcode: " barcode#echo $input# Load environment variablesSCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"source "$SCRIPT_DIR/.env"# Step 1: Get tokenTOKEN=$(curl -k -s -X POST "$SERVER_URL/rest/v3/login/sessions" \-H "Content-Type: application/json" \-d "{\"username\":\"$BEARER_USERNAME\",\"password\":\"$BEARER_PASSWORD\",\"setCookie\":true}" | jq -r '.token')#echo "Token is: $TOKEN"# Step 2: Create the eventcurl -k -s -X POST "$SERVER_URL/api/createEvent" \-H "Authorization: Bearer $TOKEN" \-H "Content-Type: application/json" \-d '{"source": "Production Table","caption": "Barcode","description": "'$barcode'","metadata": {"cameraRefs": ["f83101b1-ee44-34a1-99e9-35ef9da24a43"]}}' >/dev/null# Step 3: Revoke the tokencurl -k -s -X DELETE "$SERVER_URL/rest/v3/login/sessions/$TOKEN"done
0 -
Hi Doug,
I was working on a barcode reader myself during the weekend, and made a first concept:
https://youtu.be/XevOnnnxNf0?si=yNHWMJ87w-cddVCz
It still contains some bugs, and some improvements came to mind, so I'll be working on it in a later stage, and once it finished, Iĺl share it here. Since I'm doing it in my spare time, it might take some time.
0 -
This looks like a clever way of implementing a barcode reader. wouldn't require any additional hardware for the end user. Glad to see there are people on the inside of NX that are also tinkering and building interesting integrations. Thanks for sharing.
0 -
Norman
Have you made any progress with your barcode project? Or do you know of any alternatives to nx?0 -
Hi Claudius,
I made progress, but still not finished, and I doubt it will be ready for production in the near future.
Our authorized reseller e-Care Security from France have developed a nice Barcode application for Nx.
You can reach out to Guilhem Decoux or Loïc TONON via support @ ecare-security dot com for more information.With kind regards.
0 -
Thanks Norman for the reply.
Claudius we published or integration direction on NXVMS : https://nxvms.com/integrations/889-barcode-http-sender
Our software simply install on Windows and with a small configuration page you can route all code scanned to NX Witness, after that all results can de displayed on live view and playback.
They are also listed in a bookmark and can be found like any other event by tiping the number you are looking for.
You can contact us directly on the email mentionned on the integration page, the price is pretty good and we can activate trial licences.
Regards
0 -
Thanks Norman
I tried contacting you via the NX integration page and am waiting for a reply. Is your software also available in English?
0 -
Hi Claudius,
Yes, I have developed an improved version of the software which is now entirely in English.
I will check with my colleagues to see why I didn't receive your message through the integration page. In the meantime, I can send this version directly to you.
Best regards,
Loïc TONON
0 -
Sounds good.
0
Please sign in to leave a comment.
Comments
19 comments