Filament monitor - how it notifies filament runout ?

  • Hello,

    I am designing an expansion board for my printer to use custom TFT screen. I want to use Atmega2560 to communicate using UART with Duet just like the original PanelDue.
    How can I tell the Atmega that the filament has run out or jammed ? I've done some tests and it seems like no info is passed to the UART as there is no info in the log, and as far as I know there is no way to run custom macro when event is detected.
    I figured that when filament event is detected, monitor pauses print and information about this is sent to the log. So, I could use M591 Dx to check whether the filament event occurred every time the pause is detected, but I wonder if there is more elegant way to do this ? I'm using the rotary encoder sensor, so setting up a trigger for endstop will not work for me.
    How it is done on PanelDue ?


  • administrators

    When the filament runs out and pauses the print, the firmware will send a message to PanelDue to notify the user, assuming that PanelDue or whatever is emulating it sends the correct M408 status poll commands.

    RepRapFirmware 3 will include the filament monitor status in the object model, so it will be possible to query it directly.

  • @dc42 Got it working thanks ! Another problem emerged though.
    While the UART seems to be working fine, some of the commands are not working. I cannot check the network status with M552 or list SD files with M20 even though M20 S2 command works fine and reports JSON style info.
    Is there any setting that prevents Duet from executing some of the commands or is it some kind of bug in either of the firmwares? Everything works fine when sent through USB or Web Interface.
    I'm running firmware version 2.02 on Duet Ethernet v1.05.

    Edit : When enabling debug mode with M111 S1 P3, it seems that duet receives all the commands, but doesn't care at all. I'm pretty sure there is no bug in my firmware since it's just a few lines of code that pass data from Serial1 to Serial0 and the other way round, and most of the gcodes work without any problem.

    Here is my current code, I'm sending gcodes manually from PC terminal :

    void setup() {
    void loop() {
      if (Serial1.available()) {
        char inChar =;
      if (Serial.available()) {
        char inChar =;

  • administrators

    You need to send M408 commands to retrieve the responses from commands such as M552.

Log in to reply