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

echo commands

Scheduled Pinned Locked Moved
Firmware wishlist
3
10
428
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
    Aitor
    last edited by 29 Dec 2022, 12:48

    Good morning to all,

    I would like to request a new function for echo commands.

    Currently echo>> writes to a new line of the specified file, but I would like to be able to write to the end of the last line for example using echo>>>, this way I would have no problem writing longer lines and I think it would consume less resources than increasing the number of characters allowed in a single line.

    This could be used to write comments or in my case to generate a superlicer profile automatically from the machine.

    By the way I love the new features of the M291.

    Best regards
    Aitor

    undefined 1 Reply Last reply 30 Dec 2022, 16:02 Reply Quote 1
    • undefined T3P3Tony moved this topic from Beta Firmware 30 Dec 2022, 10:57
    • undefined
      Aitor
      last edited by 30 Dec 2022, 15:07

      Good morning @T3P3Tony,

      Thanks for moving the conversation, I didn't see that this title existed.

      I guess this is something that @DC42 should see, can you tell me if this is a good idea and if you see it possible for 3.5beta2? I have to go planning a route of changes in our machines for 2023 and knowing if this could be implemented would help me a lot.

      Greetings and happy new year to all the DUET3D team.

      Aitor

      1 Reply Last reply Reply Quote 0
      • undefined
        dc42 administrators @Aitor
        last edited by dc42 30 Dec 2022, 16:02

        @Aitor since the newline is added at the end of the string added by echo >> we would need to do it the other way round, i.e. have a variant of the echo command that does not add the newline at the end, on the assumption that you will follow it eventually with an echo command that does add the newline.

        How long is the string that you need to write as a single line?

        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
        • undefined
          Aitor
          last edited by Aitor 30 Dec 2022, 16:27

          Good morning @DC42,

          I think I have not understood well what you say, possibly the translator is confusing me a bit, so I'll explain better what I want to achieve.

          These are some of the lines of code I have to generate with which I have the problem:

          start_gcode = M190 S{first_layer_bed_temperature}\nG10 P0 S{first_layer_temperature[0]} R{temperature[0]}\nG10 P1 S{first_layer_temperature[1]} R{temperature[1]}\nM98 P"ginicioMIRROR.g"
          
          compatible_printers = "NX PRO HR-HR_Left_Left Only"; "NX PRO HR-HR_Right Only"; "NX PRO HR-HR_Dual"; "NX PRO HR-HR_Copy"; "NX PRO HR-HR_Mirror"
          
          output_filename_format = {input_filename_base}_T0_{filament_type[0]}_{nozzle_diameter[0]}_T1_{filament_type[1]}_{nozzle_diameter[1]}.gcode
          

          my idea to be able to write this in a single line, without having the problem of number of characters, would be something like this:

          echo >>"ini" "start_gcode = M190 S{first_layer_bed_temperature}"
          echo >>>"ini" "\nG10 P0 S{first_layer_bed_temperature[0]} R{temperature[0]}"
          echo >>>"ini" "\nG10 P1 S{first_layer_temperature[1]} R{temperature[1]}"
          echo >>>"ini" "\nM98 P""ginicioMIRROR.g"""
          

          to output as a single line:

          start_gcode = M190 S{first_layer_bed_temperature}\nG10 P0 S{first_layer_temperature[0]} R{temperature[0]}\nG10 P1 S{first_layer_temperature[1]} R{temperature[1]}\nM98 P"ginicioMIRROR.g"
          

          If you don't understand something let me know

          Best regards
          Aitor

          undefined 1 Reply Last reply 30 Dec 2022, 17:22 Reply Quote 0
          • undefined
            T3P3Tony administrators @Aitor
            last edited by 30 Dec 2022, 17:22

            @Aitor whats the reason fro embedding the new line characters into a single line?

            www.duet3d.com

            undefined 1 Reply Last reply 30 Dec 2022, 22:19 Reply Quote 0
            • undefined
              dc42 administrators @T3P3Tony
              last edited by 30 Dec 2022, 22:19

              @T3P3Tony I recall that some slicers expect a single line with the literal character sequence "\n" (not newline) between commands.

              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 2 Jan 2023, 08:31 Reply Quote 0
              • undefined
                Aitor @dc42
                last edited by 2 Jan 2023, 08:31

                Good morning @T3P3Tony

                It is as @DC42 says, superlicer that is this case, does not allow me to separate lines, I am also preparing the profiles of S3D-V5 and the same thing happens to me, in V4 I had no problem in separating the lines that now does not allow me to separate, although this I have landazo the consultation to S3D also, but seen what seen I do not know how long it will take.

                Is it clear what is the new functionality of the echo command that I propose? Did I explain myself correctly?

                I hope you had a good holiday season and I wish you great achievements for this new year.

                Best regards
                Aitor

                undefined 1 Reply Last reply 10 Jan 2023, 08:52 Reply Quote 0
                • undefined
                  Aitor @Aitor
                  last edited by 10 Jan 2023, 08:52

                  Good morning @DC42,

                  Sorry for the insistence, can you tell me if you see possible to implement this function of the echo command in a near version?
                  Or if it will be possible to do it?
                  Or if it is something impossible to do?

                  I would like to know, as we have many types of printers and I need to know if I should look for another alternative.

                  Best regards
                  Aitor

                  undefined 1 Reply Last reply 10 Jan 2023, 10:25 Reply Quote 0
                  • undefined
                    dc42 administrators @Aitor
                    last edited by 10 Jan 2023, 10:25

                    @Aitor I have implemented this in the RRF 3.5 source code. So it should be available in RRF 3.5beta2. The use of echo >>>file ... will append to the file and not add a terminating newline, so you can use further echo commands to append to the same line. The final one should use echo >>file ... so as to include a newline.

                    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 11 Jan 2023, 08:31 Reply Quote 1
                    • undefined
                      Aitor @dc42
                      last edited by 11 Jan 2023, 08:31

                      Good morning @DC42,

                      Thank you very much, you don't know how glad I am to hear it, I'm looking forward to try beta2, I'll be preparing my codes to test it.

                      It's really wonderful to work with you

                      Best regards
                      Aitor

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