M122 does not work from DWC console

  • I have seen an occasional failure of M122 to give a response in the DWC g-code console. With the current firmware and DWC (2.02rc1 and 1.22.3), M122 will cause a pause, disconnect, and immediate reconnect. This usually happens when I return to the printer some time after the print has finished. I can connect with YAT, and I get a response to M122 - this is the output: 0_1536068880847_20180904m122 from yat.txt
    This output does not relate to the completed print, so presumably the M122 from DWC was processed to some extent. Interestingly, the DWC g-code console is still responsive to some commands - I can send an M999 reset for example. Have seen this with previous versions of firmware/DWC.

  • administrators

    Are you saying that after the problem occurs, most commands sent from the GCode Console don't work?

    A few commands (from memory M112 and M122, I can't remember about M999) are recognised early and bypass the normal command queue.

  • @dc42 my impression is that quite a few commands do work. I will do a more comprehensive check next time it happens

  • I tried again today, and the output of the DWC g-code console is here:
    0_1536253098443_20180906m122 from dwc.txt
    M122 just over 1hr after the print finished did not give a response, although there was no disconnect/reconnect this time. I then tried M665, M666, head movement, homing and adjusted the hot end temperature, and listed the sd card with M20 - all seemed to work. Re trying M122 worked this time. Simply retrying M122 has not previously worked. Will check again when I get the full disconnect response to M122.

  • administrators

    Added to my list to look at.

  • Here's a traffic capture when M122 fails on DWC (but works on serial & telnet).

    T 2018/09/08 23:46:05.963684 -> [AP] #47
    GET /rr_gcode?gcode=M122 HTTP/1.1.
    Accept-Encoding: gzip, deflate.
    Connection: keep-alive.
    Accept: application/json, text/javascript, */*; q=0.01.
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/602.2.14 (KHTML, like Gecko) Version/10.0.1 Safari/602.2.14.
    Accept-Language: en-us.
    X-Requested-With: XMLHttpRequest.
    T 2018/09/08 23:46:05.969594 -> [AP] #48
    HTTP/1.1 200 OK
    Cache-Control: no-cache, no-store, must-revalidate
    Pragma: no-cache
    Expires: 0
    Access-Control-Allow-Origin: *
    Content-Type: application/json
    Content-Length: 12
    Connection: close

  • administrators

    That response means that you have already sent some commands to be executed from DWC, that are waiting to be executed, and the input pipeline is full. So the M122 command has probably not completed. Perhaps you need to make more rr_reply calls to retrieve the M122 response.

  • M122 still not working consistently from dwc using 2.02rc4/1.22.5. As before, usually works after one print, but subsequently causes no response but a brief disconnection /reconnect. M122 works from yat. Tried M122 from android app, and this also gave disconnect/reconnect response, seen simultaneously on the pc dwc.

  • administrators

    How many clients are logged on to the Duet when you send M122? I'm wondering whether it could by running out of buffers if you have multiple web clients logged on.

  • @dc42 I get the problem with just a windows 10 pc running Firefox connected. Incidentally, only M122 seems to be affected - I can continue printing with no obvious problems.

  • administrators

    I have never seen this for a particular code like M122. But there is a known issue that occurs when you run two or more instance of DWC on the same device/IP: In this case only one of the DWC instances will actually receive the G-code reply and the others will just print an empty/successful response. Please verify this again.

  • @chrishamm I have uninstalled 'find my duet' from my phone, and the only instance of dwc I have running is on my win10/Firefox pc. Still get the same problem - there is a 10 second pause after sending M122, then a disconnect /reconnect. Just trying another print without rebooting the duet.

  • @adrian52 Print completed fine. M122 from YAT gave this . M122 from DWC gave
    alt text
    The earlier two disconnects were responses to M122 before the print.

Log in to reply