DWC Json rr_status percent complete



  • Hi all
    Im working on home automation and including 3d printer and looking for some help.
    My goal is to change the print area lighting to different colours depending on print status (heating, printing, paused completion).
    At the moment I am polling the json generated from rr_status?type=3 to get details of print status, temperatures etc.

    This is working great however I can't determine a successful print from the output . The fractionPrinted object resets to 0.0 on print completion.
    I have looked however cant seem to find (in any of the status types) a print status that shows the file is complete.

    Also on a somewhat related note would it be possible to have a status object for filament sensor status?

    Thanks Nigel



  • I think the only way you could tell if a print is complete is by keeping track of the status and looking for a transition from "printing" to "idle".

    If the filament sensor is connected to an endstop, you should be able to look at the "endstops" value in a type 2 status request.



  • I did consider that however if I abort a print then it will be a false positive. May be something that I just deal with.
    Also may have a look at the DWC source to see if its something in my limited knowledge I can figure out 🙂

    I was able to see end stops in type 2 however it has a value of 20, I'm not sure how to read this.
    Do you know if this also reports laser / magnetic type filament sensors?

    Thanks again



  • @incogizmo said in DWC Json rr_status percent complete:

    I was able to see end stops in type 2 however it has a value of 20, I'm not sure how to read this.
    Do you know if this also reports laser / magnetic type filament sensors?

    Thanks again

    It's a bitmap so 20 would be 00010100. The endstops are then counted from the right starting at 0 so in this case, endstops 2 and 4 are hit.

    The "endstops" value doesn't have any idea about what's connected to the pins. It just reports whether it's "hit" or not.



  • @gtj0 awesome thanks for all the info thats really helped. makes sense of the number.

    After doing some prints and triggering filament out unfortunately it appears the laser filament sensor does not trigger an endstop. So no way of capturing a filament out scenario from the json output. For now I will use the stopped state as a trigger however would be ideal if the json was able to report the state or laser/magnetic sensors.



  • Does the DWC report the sensor? If so, then it has to be in the json somewhere. To which pins on the Duet is the sensor physically connected?



  • I have it connected to Endstop for E0.
    DWC does not report the sensor, but it does appear in M112:

    === Filament sensors ===
    Extruder 0: pos -1.74, ok, measured min 61% avg 76% max 96% over 3368.6mm, errs: frame 6 parity 0 ovrun 0 pol 0 ovdue 0
    

    Im assuming since its not a switch and a laser filament sensor its not reporting as expected in the json.

    All good will try and work around it.


 

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