node server for talking to XY Plotter
✓ Published0🌍 Public
Aaman-tiwari
Last edited Jun 17, 2016
Created on Jun 17, 2016
A Node.js server translates incoming JSON coordinates from a web client into GCODE commands for a serial-connected XY plotter. It listens on port 8999, parses POST requests with `x` and `y` floats, flips the coordinate system, and writes movement commands like `G1 X... Y...` via the `serialport` library. The server also issues pen-up/down commands (`M2 U/D`) and homes the plotter after each point, with optional CORS headers enabled. The code uses `body-parser` for JSON handling and logs serial port data.
AI-generated description