[{"data":1,"prerenderedAt":140},["ShallowReactive",2],{"node-red-\u002Fnode-red\u002Fperipheral\u002Fbarcodescanner":3},{"id":4,"title":5,"body":6,"description":132,"extension":133,"meta":134,"navigation":135,"path":136,"seo":137,"stem":138,"__hash__":139},"nodeRed\u002Fnode-red\u002Fperipheral\u002Fbarcodescanner.md","How to connect a barcode scanner to your Node-RED application",{"type":7,"value":8,"toc":127},"minimark",[9,17,21,26,56,63,78,84,87,93,108,114,118],[10,11,13],"h1",{"id":12},"",[14,15],"binding",{"value":16},"meta.title",[18,19,20],"p",{},"Barcode scanners, functioning as Human Interface Devices (HID) similar to keyboards, offer versatile programming options.  Variations of barcode scanners can be seen used from anything from checkout counters, logistics, and to manufacturing erp systems. In our case, we kept it basic and we used one to trigger a Node-RED flow, keeping the process straightforward and efficient.  Don't let that limit your imagination though, with QR codes, you can store just about anything including recipes in a JSON structure.",[22,23,25],"h2",{"id":24},"configuring-the-scanner-and-scanning-barcodes","Configuring the scanner and scanning barcodes",[18,27,28,29,36,37,42,43,47,48,51,52,55],{},"We revitalized an older project for this purpose, ensuring it's up-to-date. For Windows users, the setup is straightforward. Start by importing the project, ",[30,31,35],"a",{"href":32,"rel":33},"https:\u002F\u002Fflows.nodered.org\u002Fnode\u002F@gdziuba\u002Fnode-red-usbhid",[34],"nofollow","@gdziuba\u002Fnode-red-usbhid",", via the palette manager.  Import these ",[30,38,41],{"href":39,"rel":40},"https:\u002F\u002Fflows.nodered.org\u002Fflow\u002F3e08565bc0e024e81325dc028c5da792",[34],"flows"," to get started.  This initial flow identified as ",[44,45,46],"strong",{},"getHIDdevices"," will detect all devices connected to your Node-RED environment. Locate your barcode scanner  in the debug output.  You will see everything from your mouse and keyboard.  If you have just recently added the barcode scanner to your computer, it will probably be found at the end.  Once you find it note its ",[44,49,50],{},"Product ID"," and ",[44,53,54],{},"Vendor ID",".  For us, they would be identified as 1536 and 1504 respectively.",[18,57,58],{},[59,60],"img",{"alt":61,"src":62},"USB HID Node-RED","\u002Fnode-red-media\u002Fperipheral\u002Fimages\u002Fusbhid-barcode-node-red.png",[18,64,65,66,69,70,73,74,77],{},"Next, configure the ",[44,67,68],{},"HIDdevice"," node: replace the default ",[44,71,72],{},"PID"," with your scanner’s Product ID, and the ",[44,75,76],{},"VID"," with its Vendor ID.",[18,79,80],{},[59,81],{"alt":82,"src":83},"USB HID Config Node-RED","\u002Fnode-red-media\u002Fperipheral\u002Fimages\u002Fusbhid-config-node-red.png",[18,85,86],{},"Test your barcode scanner against any barcode your scanner works with and you should observe an event being triggered in Node-RED and output to debug should be the contents of the barcode.",[18,88,89],{},[59,90],{"alt":91,"src":92},"USB HID Scanned Barcode in Node-RED","\u002Fnode-red-media\u002Fperipheral\u002Fimages\u002Fusbhid-scanned-barcode.png",[18,94,95,96,101,102,107],{},"You could even take it a step further and create a ",[30,97,100],{"href":98,"rel":99},"https:\u002F\u002Fsmalldev.tools\u002Fqr-code-generator-online",[34],"QR code"," for your favorite pizza ingredients as seen here on the new ",[30,103,106],{"href":104,"rel":105},"https:\u002F\u002Fdashboard.flowfuse.com\u002F",[34],"Dashboard 2.0",".",[18,109,110],{},[59,111],{"alt":112,"src":113},"USB HID Scanned Barcode Pizza Ingredients","\u002Fnode-red-media\u002Fperipheral\u002Fimages\u002Fusbhid-qr-pizza-order.png",[22,115,117],{"id":116},"linux-setup","Linux Setup",[18,119,120,121,126],{},"Linux users might face a slightly more complicated setup, as access to communication ports isn't always granted by default, and specific drivers are needed for optimal node functionality. This is due to the security around applications having access to specific devices connected to the system. For this, we recommend following the detailed instructions available in the project's ",[30,122,125],{"href":123,"rel":124},"https:\u002F\u002Fgithub.com\u002Fgdziuba\u002Fnode-red-contrib-usbhid",[34],"GitHub"," repository.",{"title":12,"searchDepth":128,"depth":128,"links":129},2,[130,131],{"id":24,"depth":128,"text":25},{"id":116,"depth":128,"text":117},"Learn to seamlessly connect a barcode scanner to Node-RED for efficient data capture and automation.","md",{},true,"\u002Fnode-red\u002Fperipheral\u002Fbarcodescanner",{"title":5,"description":132},"node-red\u002Fperipheral\u002Fbarcodescanner","J72vEy2exLQkJ3YqC3ST_TEJURugCG8Iy9K9WdLGz_o",1780070557866]