Does a remote MDI terminal/interface exist?

I fully understand that your needs may differ. The underlying point I was attempting to convey is that it is possible to send commands using websockets. The implementation does not have to be limited to a browser extension. And while this may not be fully sufficient for your needs, it seemed it might potentially be compatible with this statement.

Basically, I’m looking for the functionality of the MDI tab, but accessible through SSH or web API.

Python proof of concept.

In this case, I took the cookie value directly from a browser. This would need to be addressed in a stand-alone solution. But it does work to send GCode to the controller.

EDIT: Modified example to remove need for cookie, thanks to @suprak.

hello.py

import asyncio
import websockets

async def hello():
    uri = "ws://10.0.2.132/websocket"
	
    async with websockets.connect(uri) as websocket:
        command = "G0 X100 Y100"
		
        await websocket.send(command)
        print(f">>> {command}")
		
        message = await websocket.recv()
        print(f"<<< {message}")

asyncio.get_event_loop().run_until_complete(hello())

Execute:

PS C:\Users\Matthew\scripts> py ./hello.py
>>> G0 X100 Y100
<<< {"bitDiameter": 6.35, "9va": 0, "2lw": 2, "qvt": 0, "a_min": 0, "fvv": 0, "0sa": 1.8, "1tc": 1, "8vt": 0, "selected_time": 1699413186.581628, "plan_time": 0, "evv": 0, "0me": true, "3h": true, "1me": true, "3xs": 0, "3max": 44.1325, "3ls": 0, "0zb": 0.9, "6vr": 0, "motor_overload": false, "shunt_overload": false, "v": 0, "3ho": 4, "2tv": 1.997, "0tv": 1.997, "uvv": 0, "fvt": 0, "3tm": 0, "5vv": 0, "2sa": 1.8, "eom": 0, "3lm": 8, "ovt": 0, "pwr_flags": 0, "1tm": 816, "1df": 0, "nvv": 0, "avr": 0, "gvr": 0, "xc": 66, "0xs": 0, "cva": 0, "motor_voltage_sense_error": false, "offset_a": 0, "1om": 0, "kvv": 0, "dva": 0, "3me": true, "metric": true, "1dc": 2.8, "power_shutdown": false, "vf": 0, "0vt": 0, "mvv": 0, "2vm": 10, "1homed": 1.0, "7vv": 0, "3tn": -160, "load1_shutdown": false, "speed": 0, "svr": 0, "5va": 0, "2df": 0, "hvt": 0, "0tr": 16, "kvt": 0, "2om": 0, "fo": 1000, "kva": 0, "5vt": 0, "8va": 0, "1lv": 0.1, "3jm": 1000, "load1": 0.0, "lvr": 0, "mva": 0, "1tn": 0, "qvr": 0, "dvt": 0, "0lv": 0.1, "0sp": 200, "c_max": 0, "1vm": 10, "bp": 0, "3am": 750, "uvt": 0, "2xs": 0, "cp": 0, "2sp": 200, "messages": [], "xp": 0, "svt": 0, "0min": 0.0, "jva": 0, "2xw": 2, "bvr": 0, "kvr": 0, "dos": 2, "imperial": false, "over_current": false, "vva": 0, "offset_b": 0, "4vv": 0, "1sa": 1.8, "pa": 3.133, "3lw": 2, "0lw": 2, "2sv": 1.688, "mvr": 0, "dvr": 0, "offset_z": 0, "max_arc_error": 0.005, "vdd": 0.7, "1am": 750, "2lb": 5, "9vr": 0, "demo": false, "pt": 1, "if": 0.01, "0vr": 0, "yp": 0, "so": 1000, "0h": true, "5vr": 0, "uva": 0, "0mi": 16, "er": "OK", "over_voltage": false, "hb": false, "0tm": 1220, "fos": 2, "2vt": 0, "2mi": 16, "motor": 0.62, "vvv": 0, "0home": 0.0, "sva": 0, "3va": 0, "2lv": 0.1, "1an": 1, "qva": 0, "1tv": 1.997, "hm": 0, "avt": 0, "cvt": 0, "6vt": 0, "ma": 0, "hvv": 0, "1min": 0.0, "1os": 2, "7va": 0, "0lm": 8, "shunt_error": false, "evt": 0, "pvt": 0, "7vr": 0, "0vm": 10, "qvv": 0, "sc": 250, "avv": 0, "pv": 10, "3vt": 0, "1vv": 0, "svv": 0, "3rv": false, "pvr": 0, "2dc": 2.8, "3sa": 1.8, "b_min": 0, "vin": 37.05, "dp": true, "6va": 0, "2os": 2, "evr": 0, "gvt": 0, "fom": 0, "xx": "READY", "vvt": 0, "0ho": 3, "load2_shutdown": false, "uvr": 0, "1lb": 5, "0vv": 0, "2rv": false, "tvr": 0, "0va": 0, "lvv": 0, "rva": 0, "0tn": 0, "2me": true, "cr": 0, "lvt": 0, "c_min": 0, "0sv": 1.688, "sid": "d6fb31a0-f1fd-47bf-8df8-c73f6eb52cc9", "gvv": 0, "1vt": 0, "mw": false, "9vt": 0, "2zb": 1.5, "jvt": 0, "1lm": 8, "1jm": 1000, "1vr": 0, "st": 2, "hid": "363033375539-05-0010-000a", "1rv": false, "2lm": 8, "3tr": 10, "3vr": 0, "pw": 1, "cvr": 0, "2ho": 3, "fa": false, "offset_y": 0, "ava": 0, "lva": 0, "0ls": 0, "2ic": 1, "1va": 0, "4vt": 0, "0tc": 1, "1ic": 1, "2h": false, "a_max": 0, "sx": 24000, "2va": 0, "ovv": 0, "3an": 2, "tos": 2, "jvv": 0, "eoa": false, "et": 1, "nvt": 0, "3df": 0, "toa": false, "0lb": 5, "4va": 0, "load1_sense_error": false, "offset_x": 0, "hx": 400, "doa": false, "nva": 0, "7vt": 0, "3zb": 1, "un": 0, "3tc": 1, "2jm": 1000, "b_max": 0, "gva": 0, "motor_under_voltage": false, "tom": 0, "dvv": 0, "sr": true, "feed": 100.0, "2an": 1, "tva": 0, "2tr": 10, "offset_c": 0, "2tn": 0, "3lb": 5, "2tc": 1, "0max": 409.57853661380545, "2ls": 0, "1zb": 7.184, "pvv": 0, "tvt": 0, "3vm": 7, "sd": 5, "3tv": 1.997, "ovr": 0, "eos": 2, "dom": 0, "8vr": 0, "hi": 1, "3vv": 0, "3sp": 200, "mx": 1, "8vv": 0, "1xw": 2, "hvr": 0, "0homed": 1.0, "1ho": 3, "md": 99.99, "1ls": 0, "0xw": 2, "jvr": 0, "1home": 0.0, "1max": 381.00383496421756, "1oa": false, "0jm": 1000, "vvr": 0, "2homed": false, "nvr": 0, "hq": 3000, "1h": true, "id": 16, "1sv": 1.688, "bvv": 0, "2vr": 0, "load2": 0.0, "ivv": 0, "sm": 6000, "pva": 0, "3lv": 0.1, "selected": "air-handler-base.ngc", "2vv": 0, "pi": false, "3mi": 16, "3homed": 1.0, "4vr": 0, "0am": 750, "0ic": 1, "0an": 0, "3sv": 0.675, "rpi_temp": 52, "ew": 1, "tvv": 0, "fva": 0, "es": false, "rvt": 0, "ap": 0, "3ic": 1, "rvv": 0, "ivr": 0, "3xw": 2, "3dc": 2.8, "1sp": 200, "ivt": 0, "0dc": 2.8, "cycle": "idle", "rvr": 0, "ss": 0, "bvt": 0, "nd": 1, "vdd_current_sense_error": false, "3home": 0.0, "foa": false, "load2_sense_error": false, "6vv": 0, "cvv": 0, "under_voltage": false, "2am": 750, "temp": 28, "mvt": 0, "files": ["air-handler-base.ngc", "filter-base.ngc", "lanterns-8910.ngc", "plugs.ngc"], "dt": 0, "1lw": 2, "line": 1, "zp": 0, "3min": 0.0, "sense_error": false, "1tr": 10, "0rv": false, "pr": "Switch found", "2tm": 816, "tool": 0, "2oa": false, "pwr_version": 6, "s": 0, "eva": 0, "0df": 0, "fvr": 0, "vout": 37.06, "iva": 0, "1mi": 16, "hva": 0, "9vv": 0, "mb": 0, "ova": 0, "bva": 0, "1xs": 0, "motor_current_sense_error": false}
1 Like