nneves / 3DPrinterInterface

3D Printer Interface
15 stars 3 forks source link

Need to implement a new functionality to get data from Printer via Serial Port #2

Closed nneves closed 11 years ago

nneves commented 11 years ago

At the moment there is no way to get the printer (serial port) data response from the node.js application directly into the client (browser) due to the initial necessity to make te all process quick and asynchronous. Every client request is done via XHR and node.js will respond with an 'ACK' (updated to {"result": true} for every request, independently if printer communicaties or not! (response is related to the http request and not to async serial port communication)

It is required to pass some of the printer serial port data back to the client:

nneves commented 11 years ago

Implementing core.js functionality to support the upper level json message broadcast (into client/browser). Core.js module already implements json messages via oStream interface. Also exported in the mainapp.js:outputStreamPrinter (from exported core.js:oStreamPrinter). Rest.js higher level layer module is now listening to the mainapp.js:outputStreamPrinter stream hooked up with a json-stream listener to map the json messages that will be sent to client/browser.

nneves commented 11 years ago

Added support to WebSockets communication via Socket.io to broadcast printer messages up to the client/browser. Implemented the socket.io functionality in the rest.js module (REST/API and now realtime communication module), added a routing rule on app.js for the UI to fetch the socket.io.js resource.

UI is now showing the printer messages (in a very elementar form that will need an extra work).