I have built a large-format pen plotter running via a BlackBox with the CONTROL software. I've written my own python software to output g-code files that I load and run via CONTROL. Everything works great. Now I want to develop a way to send commands/g-code to CONTROL in real-time from an external application, as if you were to paste commands into the serial console one at a time and press the send button. What is a good way to do this? I'm thinking I could access it through the built-in web server similar to how the mobile jog access works. I'm guessing that there would be some URL endpoint that I could POST data to, but I can't find it in the javascript. Alternately I suppose I could access the BlackBox directly via Grbl 1.1 protocol, but that seems like more work. Any suggestions or pointers?
You can tie into the Websocket interface on port 3000. Websocket emits for runCommand and runJob etc (see websocket.js)