This is in contrast to the “traditional” request/response model of a web application, which form the core of django, RubyOnRails, and most other web frameworks. In the request/response model, the unit of interaction is the HTTP request: the browser sends one to the server to request the page at a particular URL, then the server looks at its database and sends an HTTP response containing an HTML page with the resources that the client asked for. The connection between client and server only lasts long enough to finish transferring the page, after which the connection is closed, preventing the server from “pushing” more data to the client. If the client wants more data, the user has to refresh the page in the browser.
You could say that in a real-time web app, the unit of interaction is a message, passed over a websocket or other kind of long-standing communication channel, in either direction. This means that the server can, for example, notify the user whenever a manufacturing robot finishes another piece of the part it’s building, or even continuously send updates of its position to the client.
MANUFACTUING ROBOTS ON YOUR DESKTOP
CNC manufacturing robots were developed so that folks could bring mechanical designs they had made on computers into real world (http://en.wikipedia.org/wiki/Numerical_control). The language that CNC manufacturing robots speak is Gcode (http://en.wikipedia.org/wiki/G-code). An example Gcode is G0 X10 Y15. If you send it to a CNC mill, the mill would move to the point (10,15).
Arduino (http://www.arduino.cc/) is an easy to use micro-controller that has made electronics substantially more accessible. GRBL (https://github.com/grbl/grbl/wiki) makes it possible for Arduinos to understand Gcode. The RepRap (http://www.reprap.org) effort to bring 3D printers onto the desktop adapted GRBL to control 3D printers (http://reprap.org/wiki/G-code). The Arduino Mega-based (http://arduino.cc/en/Main/ArduinoBoardMega) motor controller on the Ultimaker 3D printer (http://www.ultimaker.com/) that we’re adapting for pick and place understands RepRap Gcodes.
Here is the code and instructions for how to use it: https://github.com/tempoautomation/nodejs-gcode. Note that there isn’t anything Gcode-specific about it. It just allows you to send strings (which can happen to be Gcodes) over a serial connection (which can happen to be connected to a CNC manufacturing robot).
If parts of the documentation are unclear or you are having other problems with the code let me (firstname.lastname@example.org) know. If you have ideas for improving the code, don’t hesitate to commit them to the repository.
Update: 5/17. Thanks to Ted Blackman (https://github.com/belisarius222) for his wonderful guidance in cleaning up the code and fixing a variety of issues. A primary fix he helped with was the problem where the software could only handle only handle 14 gcodes at a time before the buffer would fill up and the motor controller would start ignoring commands. Kliment on RepRap IRC identified the cause of the issue and Ted did a great job of fixing it. See the repository for the latest code.