Interfacing with duet over network?



  • Hi

    Is there anyway, or what is the best way of interfacing with Duet board over the network, but not through Web Control?
    I play a bit with simple projects around IOT/Home Automation and I have few ideas I would like to implement:

    • I am using MotionEye network camera server. It has an ability to add buttons on the overlay of a video stream which then executes a custom script on server side. I would like to add buttons to for example pause print, or turn on LED strips.
    • Create simple RGB led ring project, controlled by esp8266/32 which would show the progress of the print.
    • Add ability to my Home Assistant server to display some basic stats of current print, plus make some basic controls like pause, cancel the print. Through it I could make my Google Home speakers announce that the print is completed 😆 Or create different automation interactions.

    I have quickly tested telnet connection using M408, and it seems to be working fine, but I am unsure about using telnet for such tasks. Is there another way? HTTP GET, POST? Some WebSockets maybe?
    Mind you, I am unsure what I am talking here about, as I used HTTP GET in maybe two projects, mainly with some online tutorial. But need some recommendations so I can start googling like a crazy 🙂

    Thanks for advice


  • administrators

    @hedeon The http requests that you can use to interface with the Duetwebserver directly are documented in the DWC readme.md:
    https://github.com/chrishamm/DuetWebControl



  • This is exactly the article that prompted my question 🙂 It says that DWC uses HTTP requests to communicate with the firmware, so I wasn't sure it is not only for internal communication between chips on the board (although I was surprised that HTTP protocol is used but, I know that I do know nothing).
    So if I am able to control printer form any device able to send HTTP requests, this is really interesting.

    To the reading then!
    Thanks


  • administrators

    Yep this is the external interface presented by the firmware. The internal communications use SPI



  • @hedeon Yes, HTTP from anything that can generate it. You can play around by typing the requests into your browser, or using 'curl' from the command line, or 'curl' from simple scripts in any scripting language.



  • @t3p3tony said in Interfacing with duet over network?:

    Yep this is the external interface presented by the firmware. The internal communications use SPI

    😄 This is something I am actually more familiar with ☺

    @danal said in Interfacing with duet over network?:

    @hedeon Yes, HTTP from anything that can generate it. You can play around by typing the requests into your browser, or using 'curl' from the command line, or 'curl' from simple scripts in any scripting language.

    Curl! So simple bash script will be able to do it!



  • ... and it is not so easy...

    Sending commands seems to be working fine, but when trying to get some info back.... 😕
    Using rr_gcode?gcode=M408 it does not return any information. Not to curl, but it instead responds in the open browser window....
    Same as in this topic.

    Any way around that?

    Edit: Sorry, got excited, hyperactivity kicked in, and I missed the part about rr_status?type=XXX. This should be enough 🙂



  • @hedeon When multiple connections exist, that are all "actively polling", only the first one to poll gets the direct response.

    rr_status is mostly the answer to this.



Looks like your connection to Duet3D was lost, please wait while we try to reconnect.