Trigger http request from gcode?
-
I need to trigger a http request to call a service from an application backend I'm developing. This request is suposed to be triggered multiple times during the printing process to control external devices and processes.
I know this topic had been treated previously in this forum, but almost a year ago.
Just wondering if any advances in that.
I don't think Telnet would be a solution regarding the security, as I would need to integrate a telnet client inside the application and I'm not familiar with this technology.
Thanks in advance.
-
Telnet is very simple - it is essentially a TCP socket connection passing strings of characters.
Frederick
-
@carlosr you could use BtnCmd although the DWC window needs to be active for it to work.
If thats not an option, MintyTrebor also has authored some nodes for node red so that may be able to fill the gap. -
@carlosr @jay_s_uk is right I developed the Node-Red nodes with functionality specifically to intercept specially formatted M291 msgs which can be embedded in your gcode, or you can setup a monitor to watch for specific machine model variable changes. If you give me a few more details about what conditions will trigger your event, I may be able to help further.
If you want to develop your own application from scratch have a look at the Duet api's on the Duet Git repo. I used them a while ago to create a rules/event based MQTT messaging system (which you can also find on my repo, and reviewing the code may help you get to your desired goal quicker).
Both of these approaches work on the principle of establishing a unix/web socket subscription to Duet and then parsing the updates as they arrive.