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 ?

    [[language]]
    SENDING:M408 S0 R0
    {"status":"I","heaters":[21.9,21.7],"active":[0.0,0.0],"standby":[0.0,0.0],"hstat":[0,2],"pos":[0.000,0.000,382.468],"sfactor":100.00,"efactor":[100.00],"babystep":-0.100,"tool":0,"probe":"0","fanPercent":[0.00,100.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00],"fanRPM":0,"homed":[0,0,0],"msgBox.mode":-1}
    
    
    [[language]]
    SENDING:M408 S0 R1
    {"status":"I","heaters":[21.9,21.7],"active":[0.0,0.0],"standby":[0.0,0.0],"hstat":[0,2],"pos":[0.000,0.000,382.468],"sfactor":100.00,"efactor":[100.00],"babystep":-0.100,"tool":0,"probe":"0","fanPercent":[0.00,100.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00],"fanRPM":0,"homed":[0,0,0],"msgBox.mode":-1,"seq":0,"resp":""}
    
    


  • Take a look here (same question):
    https://www.duet3d.com/forum/thread.php?id=319#p3064

    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:
    Send:
    M408 S0 R0\n
    Received:
    {"status":"I",…..,"msgBox.mode":-1}\n
    Send:
    M115\n
    Send:
    M408 S0 R0\n
    Received:
    {"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:
    Send:
    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.

    Andre


  • 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)


Locked
 

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