• Tags
  • Documentation
  • Order
  • Register
  • Login
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.
  • undefined
    geneb
    last edited by 24 Apr 2018, 15:15

    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
    • undefined
      resam
      last edited by 24 Apr 2018, 16:24

      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
      • undefined
        geneb
        last edited by 24 Apr 2018, 20:53

        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
        • undefined
          dc42 administrators
          last edited by 24 Apr 2018, 21:01

          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

          undefined 1 Reply Last reply 24 Apr 2018, 21:06 Reply Quote 0
          • undefined
            geneb @dc42
            last edited by 24 Apr 2018, 21:06

            @dc42 Ah, ok. Thanks.

            g.

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