Connecting Barcode Reader Machine

Hello Guys,

I am tring to connect Barcode Reader Machine.

I tried to use serial connection but i am not able to read the data.

Please guide me how can i do that.


It would help if you would provide a few more details
1 - are any errors showing up?
2 -version of node-red and node.js (see startup log)
3 - what is the barcode reader you are using?
4 - does it have an API?
5 - what have you got for a flow so far?
6 - have you put a catch node connected to a debug node (set to display the complete msg object)

I haven't done it but there have been a number of threads here on barcodes. Try searching the forum to see if there is anything helpful there. If you have to ask here again then also tell us what hardware you are running node-red on and how the barcode is connected.

I am using 2D barcode reader which is connected to my laptop. When I open excel and scans barcode then it prints the scanned number. In windows device manager it is showing as HMI device.

I am not able to connect it with node red. Please guide.


Do you know how many different barcode readers there are in the world? I dont but there is DEFINATLY more than 1 i.e...

  • we have no idea what you are using
  • we have no idea what protocols it might support

  • You havent specfied the make or model
  • You havent provided a link to documentation for your reader
  • You havent provided any useful info whatsoever

How on earth do you think we can help you?

The only clue we do have is ...

... from which I can assume ...

  • It connects to a windows laptop (so likely USB)
  • You have possibly installed a driver (or windows detected and installed a driver)

... and even - where you said "HMI" I am pretty sure you mean "HID" - which means human_interface_device suggesting it works like a keyboard.

This tells us you will likely need to have a dashboard that the reader "prints" into a text box (like it prints text into excel) - there are a few forum threads that do this.

HOWEVER - that doesnt mean i am correct and doesn't mean there isnt a better way of communicating to the device

But with the tiny amount of information you have provided - this is almost all speculation.

Search the forum for "barcode" - there are about 40 threads

Provide some more details related to that error.

This USB device i am trying to connect in node red.

Below is the link from where i have brought it:

Yes it is getting attached to my PC as HID

Please guide me on what protocol i can get scanned data from the scanner.

As Steve already pointed out, it comes as a HID device. So there's no special protocol involved, it's acts as a keyboard, plain and simple. It will "type" the scanned data as normal text to wherever your cursor is active, could be Excel, a text editor, or a text field on the Dashboard. It will most likely send a carriage return after doing that, most of the scanners I delt with where configurable to doing this at least.

So nothing specific about Node-RED in this case if you go down the HID route. It's by far the easiest and most convenient one.

You could, however, investigate if your scanner can be configured as a serial device. That way you could interface directly with the scanner via the serial nodes. But I would suggest using the first approach, it's more flexible.

Do you require keyboard access on the system you'll be running Node-RED on or is it a headless computer (Raspberry Pi for example)?

Or do you have a Raspberry Pi you could dedicate for this purpose?

I'm thinking if you could create a script which reads anything coming from a keyboard and sends the keycodes via MQTT or http requests to Node-RED running either on a separate compurer or on the same computer (if it's running headless and you don't need keyboard access to it).

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.