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

Reporting Buffer Remaining

Scheduled Pinned Locked Moved
Firmware wishlist
http rrstatus buffer
3
6
374
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
    CliveB
    last edited by 28 Apr 2020, 05:19

    At present the only way to find out if there is space in the gcode buffer to send another command is by sending a rr_gcode command.

    NetworkGCodeInput * const httpInput = reprap.GetGCodes().GetHTTPInput();
    httpInput->Put(HttpMessage, GetKeyValue("gcode"));
    response->printf("{\"buff\":%u}", httpInput->BufferSpaceLeft());

    would it be possible to add the "buff" value into an existing rr_status or to create another one?

    Would the buffer just be read and not otherwise be affected by
    NetworkGCodeInput * const httpInput = reprap.GetGCodes().GetHTTPInput();
    response->printf("{"buff":%u}", httpInput->BufferSpaceLeft());

    I do not wish to move away from a standard build otherwise I would have a go at implementing the idea.

    Thanks

    Retirement: when you work just as hard but without financial reward!
    You only stop learning when the lid is screwed down.
    www.remap.org.uk www.kyaningacdc.org
    Prusa i3 Mk3 - my workhorse

    undefined 1 Reply Last reply 28 Apr 2020, 11:31 Reply Quote 0
    • undefined
      dc42 administrators
      last edited by dc42 28 Apr 2020, 11:10

      I think it would make more sense to either report the buffer space left in the object model, or change HttpResponder so that if you send an empty command string with rr_gcode, it doesn't try to execute the command but just returns the buffer space. I'll make that second change in the next 3.01-RC release.

      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
        chrishamm administrators @CliveB
        last edited by 28 Apr 2020, 11:31

        @CliveB For now you can send an empty rr_gcode request to get the remaining buffer space, e.g. http://ormerod/rr_gcode?gcode= is sufficient even though it looks a bit odd.

        But I agree it would make more sense to be able to omit the gcode key if it isn't used.

        Duet software engineer

        undefined undefined 2 Replies Last reply 28 Apr 2020, 13:03 Reply Quote 0
        • undefined
          dc42 administrators @chrishamm
          last edited by 28 Apr 2020, 13:03

          @chrishamm said in Reporting Buffer Remaining:

          @CliveB For now you can send an empty rr_gcode request to get the remaining buffer space, e.g. http://ormerod/rr_gcode?gcode= is sufficient even though it looks a bit odd.

          But I agree it would make more sense to be able to omit the gcode key if it isn't used.

          Currently, that will use up 1 byte of buffer space. I've changed it so that in future it won't. But if the buffer is full, it shouldn't matter anyway, the empty GCode line will get thrown away.

          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 28 Apr 2020, 14:01 Reply Quote 0
          • undefined
            CliveB @chrishamm
            last edited by 28 Apr 2020, 14:00

            @chrishamm Thank you for the response, it will make life a lot easier

            Retirement: when you work just as hard but without financial reward!
            You only stop learning when the lid is screwed down.
            www.remap.org.uk www.kyaningacdc.org
            Prusa i3 Mk3 - my workhorse

            1 Reply Last reply Reply Quote 0
            • undefined
              CliveB @dc42
              last edited by 28 Apr 2020, 14:01

              @dc42 Thank you, fully understood and will solve the problem.

              Retirement: when you work just as hard but without financial reward!
              You only stop learning when the lid is screwed down.
              www.remap.org.uk www.kyaningacdc.org
              Prusa i3 Mk3 - my workhorse

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