• Tags
  • Documentation
  • Order
  • Register
  • Login
Duet3D Logo Duet3D
  • Tags
  • Documentation
  • Order
  • Register
  • Login

Interfacing with duet over network?

Scheduled Pinned Locked Moved
General Discussion
network rasberry pi home automation telnet http request arduino esp8266 esp32
3
8
1.4k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined
    hedeon
    last edited by 16 May 2018, 17:17

    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

    undefined 1 Reply Last reply 16 May 2018, 18:58 Reply Quote 0
    • undefined
      T3P3Tony administrators @hedeon
      last edited by 16 May 2018, 18:58

      @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

      www.duet3d.com

      1 Reply Last reply Reply Quote 1
      • undefined
        hedeon
        last edited by 16 May 2018, 19:56

        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

        undefined 1 Reply Last reply 16 May 2018, 20:44 Reply Quote 0
        • undefined
          T3P3Tony administrators
          last edited by 16 May 2018, 20:14

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

          www.duet3d.com

          undefined 1 Reply Last reply 16 May 2018, 20:53 Reply Quote 1
          • undefined
            Danal @hedeon
            last edited by 16 May 2018, 20:44

            @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.

            Delta / Kossel printer fanatic

            1 Reply Last reply Reply Quote 1
            • undefined
              hedeon @T3P3Tony
              last edited by 16 May 2018, 20:53

              @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!

              1 Reply Last reply Reply Quote 0
              • undefined
                hedeon
                last edited by hedeon 16 May 2018, 21:48

                ... 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 🙂

                undefined 1 Reply Last reply 16 May 2018, 22:56 Reply Quote 1
                • undefined
                  Danal @hedeon
                  last edited by 16 May 2018, 22:56

                  @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.

                  Delta / Kossel printer fanatic

                  1 Reply Last reply Reply Quote 2
                  7 out of 8
                  • First post
                    7/8
                    Last post
                  Unless otherwise noted, all forum content is licensed under CC-BY-SA