-
Notifications
You must be signed in to change notification settings - Fork 46
API (for client communication)
Claudio Prezzi edited this page Jun 5, 2017
·
18 revisions
The client (webpage) communicates with lw.comm-server through websockets.
Multiple clients can connect to the same server at the same time, but the server can only connect one machine at a time via USB, Serial, Telnet or WebSocket (ESP8266).
Websocket communication is asynchonous, which means a client sends a command to server and gets the response (if any) back via websocket event.
Right after websocket connection, the client gets a bunch of response events like:
- List of supported interfaces
- List of available serial ports
- Actual port or IP (if connected)
- Actual firmware (if connected)
- Actual connect status (if connected)
- firstLoad - Get initial config data
- getInterfaces - Get list of supported interfaces
- getPorts - Get list of available serial ports
- getConnectStatus - Get the actual interface status (status & serial port+baudrate or ip:port)
- getFirmware - Get connected firmware and version
- getFeatureList - Get a list of firmware supported features (not yet implemented)
- connectTo - Connect to the machine via the given params
- runJob - Send gcode file to server and then run the code
- runCommand - Send one line of gcode to execute
- feedOverride - Increase/decrease actual feed
- spindleOverride - Increase/decrease actual spindle speed / laser power
- laserTest - Switch laser on (permanent or for given time)
- jog - Execute jog move (single axis)
- jogTo - Execute jog move (multiple axes together)
- setZero - Zero given axis (x, y, z or all)
- gotoZero - Fast move axis to zero (x, y, z or all)
- pause - Pause running job
- unpause - Resume from pause
- stop- Stop running job/command immediately
- clearAlarm - Clear controller alarm
- closePort - Close machine connection
- lsSD - Get actual SD directory listing
- cdSD - Change active SD directory
- rmSD - Remove file from SD card
- mvSD - Move/rename file
- playSD - Run file from SD card
- abortSD - Stops an SD print immediately
- uploadSD - Upload file to SD card
- progressSD - Shows progress of current SD play
- serverConfig - Config file from server
- interfaces - List of supported interfaces
- activeInterface - The active interface
- ports - List of available USB/Serial ports
- activePort - The active serial port
- activeBaudRate - The active BaudRate
- activeIP - The active IP (incl. :port)
- connectStatus - Actual connection status
- error - Error reported from server
- firmware - Firmware and version of the connected machine
- data - Data response from machine controller (ex: position data, query responses...)
- wpos - Position in work coordinates
- mpos - Position in machine coordinates
- feedOverride - Actual feed override value
- spindleOverride - Actual spindle / laser override value
- laserTest - Laser Test status (power)
- runStatus - Actual running status (run, hold, idle)
- qCount - Actual lines in queue (on the server)
More details will follow.
This project is maintained by volunteers. I am sure the developers would be thankful for any sort of donation, they put in an incredible amount of effort into this project.