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

    Output contents of file to console

    Scheduled Pinned Locked Moved
    Firmware wishlist
    3
    5
    776
    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.
    • adavidmundefined
      adavidm
      last edited by adavidm

      Thinking about the request for help thread here:

      https://forum.duet3d.com/topic/5909/guide-for-posting-requests-for-help/11

      It occurred to me that a lot of the information gathering could be done using a macro, IF there was a way to A) Echo the contents of a file to the console with a g-code, and B) use M28 to capture output from commands.

      You could do something like:

      (Note, M930 does not exist, just using it as a placeholder for a function that echos file contents).

      M28 tech_support.txt ; Open tech_support.txt for writing
      M118 S"------------ BEGIN Technical Support Readout -----------------"
      
      M118 S"---- Main System Files Output -----"
      
      M118 S" -- /sys folder contents ---"
      M20 P"/sys"
      M118 S"--------------"
      
      M118 S"----- config.g -----"
      M930 P"/sys/config.g"
      M118 S"--------------"
      
      M118 S"----- config-override.g -----"
      M930 P"/sys/config-override.g"
      M118 S"--------------"
      
      M118 S"----- homex.g -----"
      M930 P"/sys/homex.g"
      M118 S"--------------"
      
      M118 S"----- homey.g -----"
      M930 P"/sys/homey.g"
      M118 S"--------------"
      
      M118 S"----- homez.g -----"
      M930 P"/sys/homez.g"
      M118 S"--------------"
      
      M118 S"----- homeall.g -----"
      M930 P"/sys/homeall.g"
      M118 S"--------------"
      
      M118 S"---- Diagnostics Information -----"
      M122 ; output diagnostics for platform, move, heat, gCodes. network and webserver modules
      
      M118 S"------------ END Technical Support Readout -----------------"
      M29 ; Finish SD card writing
      
      M118 S"A file called tech_support.txt has been created on the root of your SD card "
      M118 S"Please attach the file to your support request"
      
      

      Obviously there are ways to improve this - pretty-printing, adding extra files/diagnostics, verbose/concise mode, etc. There are also far more sophisticated ways of packaging the data using DWC rather than a console. The upside of this approach is that DWC doesn't have to be up-and-running, you just need an operational console connection and the ability to put a file on an SD card.

      When/If branching in gcode becomes available, a more sophisticated approach will be possible as the macro could detect kinematics/drive strategy, etc and finesse the output accordingly.

      Thoughts?

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

        Is there a reason why you don't just use the Edit or Download facility in DWC?

        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

        1 Reply Last reply Reply Quote 0
        • adavidmundefined
          adavidm
          last edited by

          This was intended to be an easy way to gather useful information for people posting problems here, as per my post in the linked thread. As with many support forums, a lot of effort is expended getting standard information from the people requesting help. I thought a simple way to gather that info would be of some use.

          My reason for advocating a generic gcode approach was to make it possible to get the info even if DWC was not available for some reason e.g. the network is not available.

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

            You can get config.g echoed to the console by sending M503.

            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

            T3P3Tonyundefined 1 Reply Last reply Reply Quote 0
            • T3P3Tonyundefined
              T3P3Tony administrators @dc42
              last edited by

              @dc42 the idea would be a single gcode to create a log file of everything and save it to the SD card for attaching on the forum

              www.duet3d.com

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