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

    Event trigger via M code?

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    3
    5
    799
    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.
    • genebundefined
      geneb
      last edited by

      I've gone through the list of M codes on the wiki and I haven't seen something that meets my needs...

      Since there doesn't seem to be anything specific for sending data out of the Duet via M code, I was thinking about using one of the fan outputs.

      The idea is to wire a fan output to an Arduino (of some sort) via an analog input. Then based on what the PWM level is set on the fan, the Arduino could take one or more different actions based on the input "voltage". I understand that I'll need a voltage divider circuit to keep from cooking the Arduino at the 12v the fan output can provide.

      Is there a better way of doing this?

      tnx!

      g.

      1 Reply Last reply Reply Quote 0
      • resamundefined
        resam
        last edited by

        You can use M118 https://duet3d.dozuki.com/Wiki/Gcode#Section_M118_Send_Message_to_Specific_Target to send a simple text message to DWC/USB/Telnet/UART.

        1 Reply Last reply Reply Quote 0
        • genebundefined
          geneb
          last edited by

          That's excellent! The problem is that there's no hint in the description for setting a baud rate (for serial) or a target address (for http or telnet)...

          g.

          1 Reply Last reply Reply Quote 0
          • dc42undefined
            dc42 administrators
            last edited by

            I didn't implement M118, but my understanding is this:

            • For the USB port, no baud rate is required
            • For the aux port, see M575
            • If the target it Telnet, the message will be sent to whatever Telnet client has logged on
            • If the target is HTTP, the message will be sent to all HTTP clients

            Duet WiFi hardware designer and firmware engineer
            Please do not ask me for Duet support via PM or email, use the forum
            http://www.escher3d.com, https://miscsolutions.wordpress.com

            genebundefined 1 Reply Last reply Reply Quote 0
            • genebundefined
              geneb @dc42
              last edited by

              @dc42 Ah, ok. Thanks.

              g.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Unless otherwise noted, all forum content is licensed under CC-BY-SA