QR code node

388 views
Skip to first unread message

karthhic Mukil

unread,
Mar 30, 2016, 5:14:52 AM3/30/16
to Node-RED
Dear all,

I am a newbie for Node Red, I am planning to do a project using machine vision.

Is there anyway i can scan a QR code and get the data and process it to my will?

All I want is to scan QR code and convert it into commands which will control a machine.

Best Regards,
Karthhic.

Mark Setrem

unread,
Mar 30, 2016, 6:10:24 AM3/30/16
to Node-RED
If you look at http://flows.nodererd.org you can see all the downloadable nodes available for nodered. If you don't find anything there that does what you want than you could create your own node, by creating a wrapper around a npm javascript package to do what you want to do.

Julian Knight

unread,
Mar 31, 2016, 3:58:45 PM3/31/16
to Node-RED
The complexity will probably depend on how you plan to scan. If from a phone, you will need a web page that allows you to share a photo from the phone to the Node-Red web service with a file upload. If from a Raspberry Pi, you will need to be able to trigger the camera module.

Once you have the image, you will need a QR module. There are a few around. You could use that directly (reference it in your settings.js and then call from a function node), via a separate micro-service (outside NR, maybe with a file system watch) or you could wrap a custom node around it (preferred but slightly harder to get going).

Neil Kolban

unread,
Apr 13, 2016, 1:04:49 AM4/13/16
to Node-RED
I had exactly the same need and found a very appealing solution.  The core of the story is the application called "zbarcam".  Had a good google and play with it.  This is a package that examines a video input source (eg. a Webcam) and looks for bar codes and QR codes.  When it finds one, it spits it out to the stdout of the application.

With that in mind, you can then use the excellent additional node called "node-red-node-daemon" (http://flows.nodered.org/node/node-red-node-daemon).  This node starts an arbitrary command and sends that command's output onwards in the payload.  So if we start zbarcam with this node we can then capture QR codes and bar codes down stream.  Altogether awesome sauce.

Some tips:

  • Test out zbarcam directly to make sure you know how to use it and that it scans the codes correctly
  • When running under node-red, run it with the "--quiet" flag so that it doesn't "sound a bell" when a code is detected.  This bell is really just a BELL ASCII character which shows up in your output stream.

Marko S

unread,
Apr 13, 2016, 12:22:44 PM4/13/16
to Node-RED
Where did you find zbarcam Neil? I can't seem to find it in the ubuntu repository.

Dne sreda, 13. april 2016 07.04.49 UTC+2 je oseba Neil Kolban napisala:

Marko S

unread,
Apr 13, 2016, 12:23:46 PM4/13/16
to Node-RED
Nevermind found it here https://pypi.python.org/pypi/zbar

Dne sreda, 13. april 2016 18.22.44 UTC+2 je oseba Marko S napisala:

Neil Kolban

unread,
Apr 13, 2016, 12:28:36 PM4/13/16
to Node-RED
Marko,
I found zbarcam as part of the package called "zbar-tools".

$ sudo apt-get install zbar-tools



siddhant betrabet

unread,
Jun 21, 2017, 3:43:50 AM6/21/17
to Node-RED
Hi Neil!
           Could you specify what you entered in the command ,argument and other fields in that daemon node? I cant seem to call the application through daemon or exec but the zbarcam works perfectly well through the terminal(I am running this on a raspberry pi3 running raspbian)
Reply all
Reply to author
Forward
0 new messages