luc-github / ESP3D

FW for ESP8266/ESP8285/ESP32 used with 3D printer
GNU General Public License v3.0
1.76k stars 466 forks source link

[Question]How to Send G-code Commands via HTTP API in ESP3D Version 2.x #1059

Open userosos opened 3 days ago

userosos commented 3 days ago

Hello, I’m using ESP3D version 2.x and want to send G-code commands like G28 Z and M114through the HTTP API. I've tried requests in the format http://<IP>/command?cmd=M114, but I keep getting an Invalid command error. Could you clarify the correct way to format these requests for version 2.x? Also, if a password is needed, how do I set and include it in the requests?

Thank you for your help!

github-actions[bot] commented 3 days ago

Thank your for submiting, please be sure you followed template or your issue may be dismissed. if you deleted the template it is here

luc-github commented 2 days ago

Sorry seems there was a typo in https://esp3d.io/ESP3D/Version_2.1.X/documentation/api/ it is not cmd= but commandText=

userosos commented 2 days ago

Sorry seems there was a typo in https://esp3d.io/ESP3D/Version_2.1.X/documentation/api/ it is not cmd= but commandText=

Work, thx! If i send g-code - M114 (get current coordinate) - it return only ok bit i want get coordinate like in gcode. For example X0 Y0 Z0. Can i do it ftom http request?

luc-github commented 2 days ago

http command does only [ESPXXX]Responses not others commands

Printer response go to Web socket

if you want same chanel for query/answer you better use the raw tcp whci has default port 8888

userosos commented 2 days ago

if you want same chanel for query/answer you better use the raw tcp whci has default port 8888

Hmm. How i can use tcp 8888 port? I create connect from node-red (tcp request node) and it has error and i can see answer. I inject to the node M114.

luc-github commented 2 days ago

that is depending of you language and API - it is just tcp socket

userosos commented 2 days ago

that is depending of you language and API - it is just tcp socket

Hm. I can`t connect to the flow. I can see disconnect.

luc-github commented 2 days ago

be sure also 8888 is right port - check your settings in webui

userosos commented 2 days ago

be sure also 8888 is right port - check your settings in webui

Where i can see it in web UI? In sources i can see port 8888.

luc-github commented 2 days ago

in settings and in status https://esp3d.io/ESP3D-WebUI/Version_2.X/showcase/

userosos commented 1 day ago

in settings and in status https://esp3d.io/ESP3D-WebUI/Version_2.X/showcase/ I has nosee the port:

изображение изображение

luc-github commented 1 day ago

well this is because you are not using ESP3D, you are using ESP3DLib for Marlin so that a big difference https://esp3d.io/ESP3DLib/Version_1.X/features/

ESP3DLib V1.0 does not have Data port (Telnet) support So in that case you must use WebSocket to get Marlin responses like done in WebUI

userosos commented 1 day ago

well this is because you are not using ESP3D, you are using ESP3DLib for Marlin so that a big difference https://esp3d.io/ESP3DLib/Version_1.X/features/

ESP3DLib V1.0 does not have Data port (Telnet) support So in that case you must use WebSocket to get Marlin responses like done in WebUI

Oh. Thx! Can i upgrade the board? I use https://github.com/makerbase-mks/MKS-TinyBee

luc-github commented 1 day ago

yes sure