Filament runout

Can I add a filament runout to the server on the raspberry Pi?

Comments

  • With some programming skills. Such a solution is also already available here:

    https://github.com/Raabi91/filament_runout_Repetier

    but you can also use a lua module to query a pin and start a pause. Here an example that sends M416 when power detect pin is off for 500ms. Shoudl be easy to convert to send "@pause No Filament" when a pin signals no filament:


    rs = RepetierServer()
    local GPIO = periphery.GPIO

    local powerPin = 2
    local gpioPower = nil
    local powerOk = false -- default signal for power
    local powerFailCount = 0

    function setup()
    gpioPower = GPIO(powerPin, "in")
    -- powerOk = gpioPower:read()
    end

    local loopCounter = 0

    function sendPowerLost()
    print("Power lost detected - signaling to printer")
    pList = rs.printerList
    for _,printer in pairs(pList) do
    -- print("Printer " .. printer.slug .. " active " .. (printer.activated and 'true' or 'false'))
    if printer.activated then
    printer:injectManualCommand("M416")
    end
    end
    end

    function loop()
    if powerOk ~= gpioPower:read() then
    powerFailCount = powerFailCount + 1
    if powerFailCount == 500 then
    sendPowerLost()
    end
    else
    powerFailCount = 0
    end
    end


  • Thanks. Will have a look
Sign In or Register to comment.