Standard Marlin compatible G-codes can be found at the RepRap wiki: G-code.
Not all standard G-code are supported by the MP Select Mini.
See the G-code page for information about software to use and how to send G-code.
See the Extended G-code Table for G-code that is more or less specific to the MP Select Mini & Malyan printers.
{CMD:PARAM} Start byte: "{" Command string: CMD. Please reference to available command list. Divide byte: ":" Value string: PARAM End byte: "}"
CMD | PARAM | function |
---|---|---|
P | X | Cancel print |
H | Homing | |
P | Pause print | |
R | Resume print | |
M | Print cache.gc | |
C | T0000 | Set T0 temperature |
P000 | Set hotbed temperature | |
e | e | Return printing status |
J | X | Moves the X-Axis |
Y | Moves the Y-Axis | |
Z | Moves the Z-Axis | |
R | M | Return mac address |
S | I | List files on the microSD card |
V | Displays firmware versions on LCD | |
W | Deletes WiFi SSID and password | |
Moved to it's own page. Sample Web UI
function start_p(){ $.ajax({ url: "set?code=M565", cache: false }).done(function(html) { }); }
$.get("inquiry",function(data,status){ $("#rde").text(data.match(/\d+/g)[0]); $("#rdp").text(data.match(/\d+/g)[2]); var c=data.charAt(data.length-1); if (c=='I') { $("#stat").text("Status: Idle"); $("#pgs").css("width","0%"); } else if (c=='P') { $("#stat").text("Status: Printing"); $("#pgs").css("width",data.match(/\d+/g)[4]+"%"); } else $("#stat").text("Status: "); });
function cancel_p(){ $.ajax({ url: "set?cmd={P:X}", cache: false }).done(function(html) { }); }
function pad(num, size) { var s = "000" + num; return s.substr(s.length-size); } var value=pad($("#wre").val(),3); $.ajax({ url: 'set?cmd={C:T0'+value+'}', cache: false }).done(function(html) { });
$("#clrp").click(function(){ $.ajax({ url: "set?cmd={C:P000}", cache: false }).done(function(html) { }); });
1X Speed: {C:S10} 1.5X Speed: {C:S15} 5X Max
<script> var ws = new WebSocket('ws://192.168.20.164:81'); ws.onopen = function () { ws.send("G28"); } </script>
Using AJAX and REST a single line of code g-code can be sent without a socket connection.
http://192.168.2.150/set?code=G28
Send extended command though REST:
http://192.168.1.155/set?cmd={P:X}
While the MP Select Mini V1/V2 is connected to WiFi you may use the format http://PRINTERS_IP_ADDRESS/set?code=G-CODE_COMMAND
to send a single line of code g-code using a web browsers address/URL bar. See the examples in the following code block.
Format: http://PRINTERS_IP_ADDRESS/set?code=G-CODE_COMMAND
http://192.168.20.113/set?code=G1 X53 http://192.168.20.113/set?code=M563 S6 http://192.168.20.113/set?code=G1 X10 Y10
When a command is sent and received successfully the browser should display `Ok`, `OK`, or `ok`. Additional g-code commands can be sent one after another using the same format.
MM32 will response UDP broadcast or unicast on port 6000.
Command: “{e:e}” will reply with current status; “{e:M}” will echo MAC address.
Below is sample C# code for discovery MM32 in local network.
NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces(); for (int i = 0; i < interfaces.Length; i++) { if (interfaces[i].OperationalStatus != OperationalStatus.Up) continue; IPInterfaceProperties property = interfaces[i].GetIPProperties(); foreach (UnicastIPAddressInformation ip in property.UnicastAddresses) { //textBox1.Text += ip.Address + Environment.NewLine; if (ip.Address.AddressFamily == AddressFamily.InterNetworkV6) continue; if (ip.Address.GetAddressBytes()[0] == 255 || ip.Address.GetAddressBytes()[0] == 0) continue; UdpClient client = new UdpClient(new IPEndPoint(ip.Address, 0)); IPEndPoint iep = new IPEndPoint(IPAddress.Broadcast, 6000); byte[] buffer = Encoding.UTF8.GetBytes("{e:e}"); client.Send(buffer, buffer.Length, iep); Thread.Sleep(100); while (client.Available != 0) { byte[] data = client.Receive(ref iep); //textBox1.Text += Encoding.UTF8.GetString(data) + Environment.NewLine; //if (Encoding.UTF8.GetString(data).Contains("}")) textBox1.Text += iep.Address; string str = Encoding.UTF8.GetString(data); var regex = new Regex(@"\d+"); MatchCollection mc = regex.Matches(str); if (mc.Count == 4) { notifyIcon1.Text = "Extruder:" + mc[0].Value + "°C Target:" + mc[1].Value + "°C\nPlatform:" + mc[2].Value + "°C Target:" + mc[3].Value + "°C"; } toolStripComboBox1.Items.Add(iep.Address); toolStripComboBox1.SelectedIndex = 0; localIP = ip.Address; } client.Close(); } }
The printer also supports TCP interface instead of COM port to send G-code. Create a TCP socket on port 23 and send G-code as a string to receive a response.
The printer by default will accept two TCP connections. If a single connection sends a command, both connected sockets will receive same response message.
Use a program like PuTTY or another Telnet client to connect to the MP Select Mini.
NOTE: You'll need to be using at least UI Controller firmware version 42 to enable this feature.
http://PRINTERS_IP_ADDRESS/up
into a web browsers address barhttp://PRINTERS_IP_ADDRESS
http://PRINTERS_IP_ADDRESS/up
into a web browsers address barhttp://PRINTERS_IP_ADDRESS
Moved to it's own page. Sample Web UI
The printer provides a WebSocket server for integrating control panel using a Web UI. Below is sample Javascript code to send G28 command though the WebSocket:
<script> var ws = new WebSocket('ws://192.168.43.50:81'); ws.onopen = function () { ws.send("G28"); } </script>
Using JavaScript along with the WebSocket, you can create a custom Web UI.
Moved to it's own page. WebSocket Test Page