LaserWeb / LaserWeb4

Collaborative effort on the next version of LaserWeb / CNCWeb
GNU Affero General Public License v3.0
712 stars 192 forks source link

Retry the laser status remotely #674

Open magostinelli opened 1 week ago

magostinelli commented 1 week ago

Anyone knows if is ti possible to know the engraving process status remotely? Like an API top call, or otherwise a command from ssg that return the current status?

Thanks.

cprezzi commented 1 week ago

There is a qCount Event sent from server to client every 500ms whilst a job is running, but this does only tell how many gcode lines are in the server queue. This is not exact, because the firmware also has an own queue. See https://github.com/LaserWeb/lw.comm-server/wiki/API-(for-client-communication)

cprezzi commented 1 week ago

PS: You can connect to the server from multiple clients (or your own websocket app) at the same time.

magostinelli commented 1 week ago

Thanks for reply, in the link posted there is runStatus how can i use it?

I'm looking at something like thie: curl -s http://laserweb.local/status -> idle|ingraving|stopped

cprezzi commented 1 week ago

There is no http API. You need to connect to the server by websocket (socket.io). Unfortunately I can't help with that. You eventually can find out by reviewing the lw frontend code in https://github.com/LaserWeb/LaserWeb4/blob/dev-es6/src/components/com.js.