M408 Response sequence number

  • Hi there,

    I'm playing with M408 on my usb/serial port. I'm wondering how to use the Rnnn parameters and how to get the seq & req json attributes.
    As far as I tried, I can't get any of these when I do M408 S3 Rnnn (I've tried 000, 999 and several random values for nnn)

  • administrators

    Start with zero. If there is a new response, any response with that number or higher will be returned in the response, along with its sequence number

  • Can you provide a working example please ?
    M408 S3 R0 => no seq/req
    M122 => does ouput stuff
    M408 S3 R0 => still no seq/req

  • administrators

    The R parameter only applies to M408 S0 and M408 S1.

  • how can I use it ?

    SENDING:M408 S0 R0
    SENDING:M408 S0 R1

  • Take a look here (same question):

    Could be interesting for you. I had the same problem.
    On the WebUI it will not be functional.

    Here is an example of my Monitor on the UART lines:
    M408 S0 R0\n
    M408 S0 R0\n
    {"status":"I",.....,"msgBox.mode":-1,"seq":1,"resp":"FIRMWARE_NAME: RepRapFirmware for Duet FIRMWARE_VERSION: 1.19.2 ELECTRONICS: Duet 0.85 FIRMWARE_DATE: 2017-09-01"}\n

    because you now received sequence-number: 1, the next M408 is:
    M408 S0 R1\n

    and so on. Everytime you receive a new sequence-number, you will use it in the next M408 command.
    Hope it helps.


  • administrators

    I don't think the R parameter will work on the USB port, and it isn't needed anyway because responses are sent directly to that port.

  • ok, thanks to you both for your answers.

    I'm still working on my http2usb proxy to get rid of the WIFI/webserver stack, is it possible to configure the USB port so that it acts as the paneldue serial port ? I'd rather use the usb port as I think I can use higher speed rate.

    Otherwise I'll implement the seq/resp attributes in my proxy.
    how is the seq attribute increased ? 1 by 1 ? (looking at the http communications, it doesn't seem to)
    is seq max value really UINT32_MAX ?
    What's the behavior when the seq counter overflows ? (looking at https://github.com/chrishamm/DuetWebControl/blob/742fa9138ff4fb32be068b1172535678c1d85fa5/core/js/comm.js#L568 it doesn't matter)


Looks like your connection to Duet3D was lost, please wait while we try to reconnect.