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

    Not loading macro from G-code

    Scheduled Pinned Locked Moved Solved
    General Discussion
    2
    7
    666
    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.
    • Kryckanundefined
      Kryckan
      last edited by Kryckan

      I hope I just missed something here.
      I have made a macro for the start of the print.

      ; Ready printer and calibrate bed
      M83 			; Set extruder to relative moves
      G21 			; set mm units
      G90 			; set absolute coordinates
      G28 			; Home Machine
      M561 			; Clear any bed transform
      G1 X140 Y117 F8000 	; Go to center of bed
      G1 Z10 F8000 		; Go to 10mm over bed
      G30 			; Probe bed and set Z-height
      G29 			; Run mesh compensation
      M593 F80. 		; Set Dynamic Acceleration Adjustment to 80Hz
      
      ; Extrude anchor
      M703			; Set filament parameters
      G1 X0 Y0 F5000		; Go to home origo
      G92 E0.			; Zero exreuder
      G1 Z0.6			; Move nossle down
      G1 E45. F500 		; Extrude anchor
      G92 E0.			; Zero extruder
      G1 E-1.3 F25		; Retract filament
      G1 Z10.0 F300 		; Move platform down 5mm
      G1 Y20. F3000 		; Move away from the anchor
      M99			; Go back to main program
      

      Wen I run this in console, the macro starts.

       M98 P"0:/macros/start_of_print.g"
      

      But when I have the same command in a program:

      ....
      G90
      M83
      M106 S0
      M140 S60
      M190 S60
      M104 S215 T0
      M109 S215 T0
      
      M98 P"0:/macros/start_of_print.g"
      
      ; process Process1
      ; layer 1, Z = 0.300
      T0
      ; feature skirt
      ; tool H0.300 W0.480
      G1 Z0.300 F120
      .....
      

      The duet returns:

      Warning: Macro file 0 /macros/start_of_print.g not found
      

      Any ideas?

      Board: Duet WiFi 1.02 or later
      Firmware: RepRapFirmware for Duet 2 WiFi/Ethernet 3.01-RC4 (2020-03-16b1)
      Duet WiFi Server Version: 1.23

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

        It looks like whatever is sending the "program" is stripping out the colon. How are you sending it?

        You could try: M98 P"/macros/start_of_print.g"

        BTW there is already a file "start.g" that gets called automatically at the start of a print from SD card.

        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

        Kryckanundefined 2 Replies Last reply Reply Quote 0
        • Kryckanundefined
          Kryckan
          last edited by

          Okay, so I think the error is not in Duet.
          I was trying to start the print from my Repetier Server attached to the Duet. Seems like there is something getting wrong in the fransfer.
          I think it removes the colon and maybe the quotes?
          When I upload the G-code directly to the duet, it runs fine. 😕

          1 Reply Last reply Reply Quote 0
          • Kryckanundefined
            Kryckan @dc42
            last edited by

            @dc42
            Damn! You are so fast at answering in the forum! 😄 I just love it!

            Ahh, so the start.g would be a better place to set the macro then. I will try that.
            Thanks.

            1 Reply Last reply Reply Quote 0
            • Kryckanundefined
              Kryckan @dc42
              last edited by Kryckan

              @dc42
              Turns out I don't have a Start.g in the file system. ... and the cancel.g is just a bunch of HTML? Just got a load of errors when canceling the job.

              Strange because I just flashed the Duet a week ago. Think I need to go over the file system.
              Is the Start.g supposed to be in the system folder?

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

                @Kryckan said in Not loading macro from G-code:

                Is the Start.g supposed to be in the system folder?

                Yes, in /sys. But it only gets called when you start a print from the SD card, not if you print through Repetier Server.

                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

                Kryckanundefined 1 Reply Last reply Reply Quote 0
                • Kryckanundefined
                  Kryckan @dc42
                  last edited by Kryckan

                  @dc42

                  M98 P"/macros/start_of_print.g" works in Repetier Server.

                  Thanks.

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