# Connecting Barcode Reader Machine

**URL:** <https://discourse.nodered.org/t/connecting-barcode-reader-machine/33459>\
**Category:** Hardware\
**Created:** [28 September 2020 16:32 UTC](https://discourse.nodered.org/t/connecting-barcode-reader-machine/33459 "2020-09-28T16:32:12Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chetan\_001](https://avatars.discourse-cdn.com/v4/letter/c/eb8c5e/32.png) [@Chetan\_001](https://discourse.nodered.org/u/Chetan_001)\
**Post date:** [28 September 2020 16:32 UTC](https://discourse.nodered.org/t/connecting-barcode-reader-machine/33459/1 "2020-09-28T16:32:13Z")

</div>

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.

Regards,  
Chetan

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [28 September 2020 17:46 UTC](https://discourse.nodered.org/t/connecting-barcode-reader-machine/33459/2 "2020-09-28T17:46:39Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [28 September 2020 17:47 UTC](https://discourse.nodered.org/t/connecting-barcode-reader-machine/33459/3 "2020-09-28T17:47:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Chetan\_001](https://avatars.discourse-cdn.com/v4/letter/c/eb8c5e/32.png) [@Chetan\_001](https://discourse.nodered.org/u/Chetan_001)\
**Post date:** [29 September 2020 20:37 UTC](https://discourse.nodered.org/t/connecting-barcode-reader-machine/33459/4 "2020-09-29T20:37:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [29 September 2020 21:20 UTC](https://discourse.nodered.org/t/connecting-barcode-reader-machine/33459/5 "2020-09-29T21:20:50Z")

</div>

@Chetan_001

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 ...

> [@Chetan\_001](#):
>
> When I open excel and scans barcode then it prints the scanned number. In windows device manager it is showing as HMI device.

... 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](https://en.wikipedia.org/wiki/USB_human_interface_device_class) 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

---

<div class="post-metadata">

**Author:** ![zesid](https://avatars.discourse-cdn.com/v4/letter/z/3ab097/32.png) [@zesid](https://discourse.nodered.org/u/zesid)\
**Post date:** [30 September 2020 05:53 UTC](https://discourse.nodered.org/t/connecting-barcode-reader-machine/33459/6 "2020-09-30T05:53:38Z")

</div>

Provide some more details related to that error.

---

<div class="post-metadata">

**Author:** ![Chetan\_001](https://avatars.discourse-cdn.com/v4/letter/c/eb8c5e/32.png) [@Chetan\_001](https://discourse.nodered.org/u/Chetan_001)\
**Post date:** [30 September 2020 06:22 UTC](https://discourse.nodered.org/t/connecting-barcode-reader-machine/33459/7 "2020-09-30T06:22:03Z")

</div>

![WhatsApp Image 2020-09-30 at 11.44.34 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/e/ae9056aa2f89433d7ca64b34677d01c6226b6664.jpeg)

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

Below is the link from where i have brought it:

> **[NETUM CCD 1D USB Wired Handheld Barcode Reader Scanner Compatible for Mobile...](https://www.amazon.in/Barcode-Scanner-Handheld-Compatible-Computer/dp/B07T48SK49/ref=asc_df_B07T48SK49/?tag=googleshopdes-21&linkCode=df0&hvadid=413005565720&hvpos=&hvnetw=g&hvrand=14929279854501671649&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9301869&hvtargid=pla-867308992292&psc=1&ext_vrnc=hi)**
>
> NETUM W3 Wired CCD Barcode Scanner - Handheld 1D Bar Code Reader Imager for Mobile Payment Computer Screen Scan for POS Mac Windows System. Features: 1. This model can only read 1d bar code ( can not ...

Yes it is getting attached to my PC as HID

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

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [30 September 2020 06:31 UTC](https://discourse.nodered.org/t/connecting-barcode-reader-machine/33459/8 "2020-09-30T06:31:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ristomatti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ristomatti/32/5857_2.png) [@ristomatti](https://discourse.nodered.org/u/ristomatti)\
**Post date:** [30 September 2020 07:35 UTC](https://discourse.nodered.org/t/connecting-barcode-reader-machine/33459/9 "2020-09-30T07:35:34Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [29 November 2020 07:35 UTC](https://discourse.nodered.org/t/connecting-barcode-reader-machine/33459/10 "2020-11-29T07:35:37Z")

</div>

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