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

    RepRap Mock server

    Scheduled Pinned Locked Moved
    Duet Web Control
    3
    8
    379
    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.
    • AndMazundefined
      AndMaz
      last edited by

      Hi

      I want to develop a HTTP client (using this spec: https://github.com/Duet3D/RepRapFirmware/wiki/HTTP-requests) and I was wondering if there's a mock server that I can use during the development?

      This would greatly ease the dev process and would help me to test my client during the high load. The latter part is specially important because in production it should be able to handle thousands of devices at the same time

      chrishammundefined 1 Reply Last reply Reply Quote 0
      • chrishammundefined
        chrishamm administrators @AndMaz
        last edited by

        @andmaz Not yet. In SBC mode we'll provide support for rr_ HTTP requests in v3.5 but until then you must use the Duet's HTTP server.

        Duet software engineer

        AndMazundefined 2 Replies Last reply Reply Quote 0
        • AndMazundefined
          AndMaz @chrishamm
          last edited by

          @chrishamm thank you for quick reply 👍

          (wishful thinking) Would be awesome to have a simple http server (could be express.js or something else) just producing some fake data while mimicking RepRap's behaviour.

          Anyway, keep up the good work 😃

          1 Reply Last reply Reply Quote 0
          • AndMazundefined
            AndMaz @chrishamm
            last edited by

            Hi @chrishamm sorry for pinging you but can you explain the rationale behind the seqs.reply value?
            The docs (https://github.com/Duet3D/RepRapFirmware/wiki/Object-Model-Documentation) are not very clear about it. The only reference that I found was:

            There is an extra value seqs.reply as well which is used notify clients about new messages (see rr_reply).
            

            My question is: How does the seq.reply increase?

            I'll try to explain what I mean.

            For example, this request /rr_gcode?gcode=M120%0AG91%0AG1%20X-10%20F6000%0AM121 , which results in the following response

            
            
            Error: G0/G1: insufficient axes homed
            
            

            increases the seq.reply by 4. Why 4?

            On the other hand, this /rr_gcode?gcode=M106%20P1%20S0.16 request, with an empty response, increases the seq.reply by 1. Why 1?

            What's the difference? How the reply counter is increasing?

            The ultimate goal for me is to understand how can I relate a /rr_gcode req. with a /rr_reply response.
            The /rr_gcode does not provide any info for this so I'm guessing that the seq.reply is the answer for this.

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

              @andmaz said in RepRap Mock server:

              For example, this request /rr_gcode?gcode=M120%0AG91%0AG1%20X-10%20F6000%0AM121 , which results in the following response

              
              
              Error: G0/G1: insufficient axes homed
              
              

              increases the seq.reply by 4. Why 4?

              It's probably causing 3 blank lines to be returned as well as the one containing the error message.

              On the other hand, this /rr_gcode?gcode=M106%20P1%20S0.16 request, with an empty response, increases the seq.reply by 1. Why 1?

              Because it is returning a single blank response line.

              The ultimate goal for me is to understand how can I relate a /rr_gcode req. with a /rr_reply response.
              The /rr_gcode does not provide any info for this so I'm guessing that the seq.reply is the answer for this.

              The only guarantee is that seq.reply will increment by at least one every time a new reply is generated.

              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

              AndMazundefined 1 Reply Last reply Reply Quote 0
              • AndMazundefined
                AndMaz @dc42
                last edited by

                @dc42 thank you for your response.

                It's probably causing 3 blank lines to be returned as well as the one containing the error message.

                Can you explain the reason for the blank lines? In what situations it returns blank lines? Can it return more that 3 blank lines?

                Overall, current API makes difficult to relate the req. to /rr_gcode and response from /rr_reply.

                It would be cool if /rr_gcode response could include the seq number (e.g., { "buff": 226, "seq": 12345 }) and the /rr_reply could include the seq in response string. This way relating req and res would be much easier.

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

                  @andmaz said in RepRap Mock server:

                  Overall, current API makes difficult to relate the req. to /rr_gcode and response from /rr_reply.

                  DWC manages it. What I think it does is to send the command via rr_gcode and then wait for the sequence number to increase, indicating that a response has been received.

                  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

                  AndMazundefined 1 Reply Last reply Reply Quote 1
                  • AndMazundefined
                    AndMaz @dc42
                    last edited by AndMaz

                    @dc42 yeah, I've been looking at DWC and the logic that's implemented there. However, I still continue to think that /rr_reply response is not consistent and could be improved (or at least documented in detail).

                    In any case, thank you for your help 👍

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