How to implement node.js and RFID? - node.js

Does anyone know how do I go about implementing this?
http://www.youtube.com/watch?v=adF-H9mLuFs&feature=youtu.be
It will be great if anyone can provide me with step by step implementation.
Thanks in advance!

The RFID reader must have some kind of documentation for how you can use it.
There is probably a smarter way that you can link it to nodejs but one method would be to have the rfid reader write the data to a csv file and have nodejs watch that file via fs.watch. (See fs.watch in docs)
You would fire an event that reads the file each time it is written and then do whatever you like. You can update the browser using websockets. (See http://socket.io/)

Related

How to communicate Node JS and Kinect?

I want to do some stuff using kinect and my research took me to two libs, libfreenect and OpenNi, the first one apparently just extract video data, am I right? The second one was acquired by Apple and dissolved, however some of the binary data and documentation was recovered by structure.io and this library does give the complete Kinect data. My idea is to use a socket.io server to process the Kinect input data and send it to the browser, then use JavaScript to process it on the client. My question is, does anyone here has achieved such thing? And if so, could you give me some guidance on how to achieve this or where to start please?
For Kinect for Windows V2 =>
https://www.npmjs.com/package/kinect2 [I've used it]
For kinect v1 =>
https://github.com/nguyer/node-kinect
http://metaduck.com/09-kinect-browser-node.html
http://blog.whichlight.com/post/53241512333/streaming-kinect-data-into-the-browser-with-nodejs
http://depthjs.media.mit.edu/
This library achieves something similar to what you were looking to do. It uses Kinect2 (mentioned in another response) to get the Kinect data, but also lets you stream it to another browser.
https://github.com/kinectron/kinectron

Kdb+ drivers for NodeJS

I'd like to use NodeJS to implement a simple REST interface to pull data from Kdb+.
Does anyone know of any existing driver or a project to implement a Kdb+ driver for NodeJS?
Not that I know of... but shouldn't be too hard, really. You could simply use the http interface to create calls to kdb and parse the result into json with Arthur's json implementation
There is https://github.com/michaelwittig/node-q
I've used it in my project and works great.

Use Socket.IO to update data in real-time?

I am writing a nodejs / express / mongodb based web application and all is working great.
What I've made for learning purposes is a twitter clone.
People can tweet whatever they want and it will show up on their profile and anyone who follows them stream.
On my home page it shows everyone who you are followings posts.
I want this stream to automatically update when someone they are following posts something new.
So they can just sit their on the home page and see all new posts come in in real time.
I've worked with Socket.IO in the past and loved it for it's awesome simplicity of use.
But is Socket.IO an appropriate use for this sort of situation?
Are their better options I can use, perhaps going with a simpler approach of AJAX polling would be more efficient for scalability?
So basically what is the best to use for an application like this?
I need:
Realtime updates to the client
Scalability and effeciency
Thanks!
You have multiple option
My firstoption RacerJS
and Socket.IO
Get data from mongodb and send through racerjs or socket.io
RacerJS is synchronization model built on top of ShareJS, which has underlying technique called Operational Transformation, this is used to do collaborative work on the same data in real-time (like Google docs) I guess it does not really apply to your case or its not the case where it should be used. Because ShareJS does a lot of work to keep clients able to edit at the same time on the same data. This is not the case with Activity streams like your case.
A good option would be Meteor

How can I receive external program events in a node.js app and affect current Socket.IO connections?

I'm using a program (pianobar) that has the option to run a program when certain events happen. I want to get the information from these events into my node.js application so I can send it to clients that are connected over socket.io.
The best idea I've come up with so far is to have a middleware program that takes the input from pianobar and writes it to a file. I can then watch the file using fs.watchFile.
Is there a better/cleaner/more direct way to do this?
Depending upon how much data is involved, the cleanest solution is to follow tjameson's advice and POST the data to your node.js application. That way you can just use standard HTTP in your application and do not need to resort to using a one-off file approach. And you can use standard tools such as cURL to quickly and cleanly write the client program.

How do I get a live stream of deltas from Meteor collection, for use outside of a webapp?

How do I get a live stream of deltas from Meteor collection, for use outside of a webapp?
I'm looking for an initial result set, plus a series of operations on that result set, delivered as the happen.
Thanks,
Chris.
The Meteor protocol is called DDP. It does exactly what you're asking for: you send a "subscribe" message that says what data you want to get, and then you get back the initial result set and then a stream of create/update/delete messages.
So what you need is a DDP client for whatever language the other program is written in. Since Meteor is so new, these don't exist yet. But a lot of people already written in to say that they want to write them. If you're interested in getting involved with that you should send a message to contact#meteor.com.
They just added a small python command-line tool for talking to a Meteor DDP server.
Geoff is right, but as I searched for the same solution I just found two working with Javascript
depends on jQuery https://github.com/eddflrs/meteor-ddp (recommended)
a light standalone solution https://github.com/bmcmahen/ddp-sockjs-client
hopefully both are working with the specifications for ddp https://github.com/meteor/meteor/blob/master/packages/livedata/DDP.md

Resources