HTTP Connection thru async C#.
stevenim last edited by
I'm making HTTP GET requests over Ethernet with my Duet 3 MB6HC v1.01 board running with Firmware version 3.1.1 and I'm trying to send GCode commands with the "/rr_gcode?gcode=" command but I'm seeing that not all my requests are making it to the board. For example, in my case I need to set the output of all 9 of my GPIO pins simultaneously and I try to do this by making 9 GET requests in parallel with HttpClient async operations in C# which, while looking in Wireshark, takes a total of ~800ms from setting the first GPIO pin to the last one thru 9 individual M42 commands.
So I was wondering if this was a timing issue in that I would add a delay of some sort between requests (I noticed that adding 300ms between requests that all my requests actually register with the board)? Or could this be a driving issue where I drive too many individual GET requests in such a short amount of time? How can I achieve making a sizable amount of GET requests at a time while also having the board actually respond to those requests? Should I format my code such that it looks at failed responses since I occasionally see out-of-order packets and reset flags within the TCP layer (but not all the time). Heck, sometimes I see that all 9 of my requests go through with no issue in Wireshark but not all get registered on the board since after making a "rr_model?key=state.gpOut", I see that not all are set even after I saw that all requests got thru with an OK status (Note that this is still within the ~800ms I make all requests).
Thank you for your time.
Have you tried sending all M42 commands in a single line? For example:
M42 P0 S1 M42 P1 S0.5 M42 P2 S0
Max GCode line length for Duet 3 is 200 chars AFAIR.
PS - I suspect the issue is that the Duet web server can respond to a maximum of 4 HTTP requests concurrently.