Http Post from Macro
-
As mentioned in my other post, the ability to execute an http post in a macro would be very useful. In my case I want to trigger some IoT stuff on my network when my filament sensor calls pause.g so I get a notification that my print stopped and I can go fix it. This seems very straightforward considering the duet is already connected to my network and sending data all over the place. Would be great!
-
Bump
I would like to trigger a webhook so that I know when there is a jam or a print is done. -
@ericlmccormick said in Http Post from Macro:
Bump
I would like to trigger a webhook so that I know when there is a jam or a print is done.Would using Telnet be a possibility for you?
Frederick
-
@fcwilt I don't think so but I don't have too much experience with telnet. I want to be able to setup a trigger via webhook so I can have it do things like have an announcement via my google home speakers that there is a jam and on what printer.
-
you could poll printers over http parse the status and send a http request as needed, but there isn't a ready made solution that doesn't requre some coding on some level (not yet at least)
-
@ericlmccormick said in Http Post from Macro:
@fcwilt I don't think so but I don't have too much experience with telnet. I want to be able to setup a trigger via webhook so I can have it do things like have an announcement via my google home speakers that there is a jam and on what printer.
Do you have a link to a site that would explain how to use the google home API?
It would be simple enough to write a Windows app that accepted a string from the Duet Telnet connection and output to a cloud based API if it uses something like JSON.
I would likely spend more time learning to use the API then I would actually coding the application.
Something for you to think about.
Frederick
-
I don't have a site and I don't want to use/write an app on widows to act as an extra middle man. Most of the time my computer is hibernating anyways.
If the duet could trigger a webhook, then I can use IFTTT do anything such as flicker the lights when done or send me a text message if there is an error. -
@ericlmccormick
i would like to know too. i just got a webhook setup with the duet discord notification by @sindarius it works well to an extent as I see the notification from my phone but only if I were to go look for it. it doesn't come up as a pop up. -
@dc42 sorry to bump an old thread, but now that I’m on fw 3.x and there were so many changes to firmware, is there now a way (preferably g code) I can execute a simple http request on my network? As when I started this thread, I’d like my filament monitor to call an http put/get/whatever to trigger some smarthome stuff
-
@clearlynotstef best options I know of are btncmd for DWC or nodedsf for node red
-
@jay_s_uk btncmd looks like it'll go an http get based off clicking a button on dwc dashboard, but is there a way to do so automatically in a macro or in pause.g?
-
@clearlynotstef no, there isn't. Not in standalone mode anyway.
You can use nodeDSF to monitor the printer for events etc.
The other way would be to use SBC mode (if you have a duet 3 or duet 3 mini) and use one of the APIs or execonmcode -
@jay_s_uk If you are using an SBC you can use this project to execute Linux command line tools like wget:
-
@cthulhulabs I mentioned execonmcode above
-
@jay_s_uk said in Http Post from Macro:
@clearlynotstef no, there isn't. Not in standalone mode anyway.
You can use nodeDSF to monitor the printer for events etc.
The other way would be to use SBC mode (if you have a duet 3 or duet 3 mini) and use one of the APIs or execonmcodejust duet Wi-Fi 2. I could rig a cheap esp8266 to a pin and have it do the call when gcode drives the pin, just seems crazy that the duet is already on my network and communicating but I need to use a whole additional MCU to do a simple one line long http request!
-
A Shelly Uni could be a viable option for you.
The advantage is wifi capability with its own server out of the box. The interface should have the necessary options.
I use a Shelly Switch to start my printer over the network. Basically the standard functions would have been enough for me. But then I started to work with NodeRed and made my own interface for switching.
Which has also led to the fact that I now have my own smart home server....
But it also took some time to get used to it. I can understand if you do not want to go that way.... -
@diy-o-sphere for $3 I could just use an esp8266 to connect to my Wi-Fi, monitor a pin on the duet and do the call to my smarthome setup to trigger the routine. I've used Shellies for other things but the nodemcu would be simple for this one. Mostly I want to do it from duet directly and I'm honestly surprised I cannot. The duet is already on my network, already interacting with other things on my network, and RRF is so well thought out and capable I'm just shocked there's no way to tell it to send an http get/put
-
@jay_s_uk Doh! I'm sorry I missed the last word of your post.