<p>When you download the latest version of <a href="https://github.com/prusa3d/Prusa-Firmware/archive/v3.2.0.zip" rel="nofollow noreferrer">your firmware</a> you find the implementation of all the codes in <code>Marlin_main.cpp</code>. Here you see that the M406 is not implemented! Hence it does not work. </p>

CC BY-SA 4.0
2018-05-15T14:01:14.450Z
this is original Prusa - so marlin is not used!
profesor79
CC BY-SA 4.0
2018-05-15T14:15:37.553Z
@profesor79 Download the software from Prusa itself and you will see that it does have the Marlin_main.cpp file! https://github.com/prusa3d/Prusa-Firmware/blob/MK3/Firmware/Marlin_main.cpp
0scar
CC BY-SA 4.0
2018-05-15T14:16:53.643Z
ok got that, another bit it the puzzles sorted :)
profesor79
CC BY-SA 4.0
2018-05-15T14:17:56.630Z
@profesor79 Always glad to teach the professor ;)
0scar
CC BY-SA 4.0
2018-05-15T14:42:53.227Z
Interesting. So why doesn't M117 work either?
Bas
CC BY-SA 4.0
2018-05-15T19:35:46.913Z
@Bas I can't tell for sure, Prusa has implemented M117 differently (with a higher priority?). Maybe this does not work flawlessly.
0scar
CC BY-SA 4.0
2018-05-15T13:41:34.727Z
2018-05-15T13:41:34.727Z
0scar
<p>As per github PR this is not implemented - see <a href="https://github.com/prusa3d/Prusa-Firmware/issues/594" rel="nofollow noreferrer">this PR</a> for details
Please check if your printer is processing M406 by issuing it manually.</p>

<p>In meantime, a sticker on the sensor will help you to print :)</p>

CC BY-SA 4.0
2019-05-08T14:59:52.853Z
Professor79 Could you give a little more detail on how to use a sticker to stop the filament sensor issue? Maybe a photograph or specific placement advice? Left to my own devices I will continue to avoid the issue by printing my shiny filaments in total darkness. There has to be a better way. Thanks, from the peanut gallery
Winky42
CC BY-SA 4.0
2019-05-09T11:32:30.157Z
@Winky42 that depends if you have a mechanical or optical sensor. if is optical then just cover the lenses, if is mechanical put down the lever.
profesor79
CC BY-SA 4.0
2018-05-15T13:38:16.323Z
2018-05-15T13:38:16.323Z
profesor79
<p>I have a spool of translucent PLA filament that doesn't work well with the filament sensor on my Prusa i3 MK3. The translucency trips up the sensor, making it think the filament ran out. I thought I'd create a filament profile in Slic3r and disable the sensor in the "Start G-code" block that gets inserted at the beginning of the exported gcode file. </p>

<p>I've got the following code:</p>

<pre><code>M900 K{if printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}200{else}30{endif}; Filament gcode
M406 ; Disable filament sensor
M117 Filament sensor OFF
</code></pre>

<p>The first line is provided by Prusa's default PLA profile. The second line should disable the sensor, and the third line should print the "Filament sensor OFF" message. If I look in the gcode, it's there:</p>

<pre><code>G92 E0.0
M221 S95
M900 K30; Filament gcode
M406 ; Disable filament sensor
M117 Filament sensor OFF
G21 ; set units to millimeters
G90 ; use absolute coordinates
M83 ; use relative distances for extrusion
;BEFORE_LAYER_CHANGE
</code></pre>

<p>But if I print this gcode file, I see no message, and when checking the sensor in the "Tune" menu while printing, the sensor is still on.</p>

<p>I thought I might have a problem with line endings, but looking at the file in a hex editor, all the lines seem to end with a <code>0A</code> line feed character, including mine. </p>

<p>Why isn't my printer doing anything with the M406 and M117 messages? Full gcode file <a href="https://pastebin.com/YDTN2Qes" rel="nofollow noreferrer">here</a>.</p>

<prusa-i3><g-code><slic3r>
What is wrong with my "disable sensor" gcode?
Bas
# What is wrong with my "disable sensor" gcode?

(Asked by: username_0 on 2018-05-15)

I have a spool of translucent PLA filament that doesn't work well with the filament sensor on my Prusa i3 MK3. The translucency trips up the sensor, making it think the filament ran out. I thought I'd create a filament profile in Slic3r and disable the sensor in the "Start G-code" block that gets inserted at the beginning of the exported gcode file. 
I've got the following code:
M900 K{if printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}200{else}30{endif}; Filament gcode
M406 ; Disable filament sensor
M117 Filament sensor OFF

The first line is provided by Prusa's default PLA profile. The second line should disable the sensor, and the third line should print the "Filament sensor OFF" message. If I look in the gcode, it's there:
G92 E0.0
M221 S95
M900 K30; Filament gcode
M406 ; Disable filament sensor
M117 Filament sensor OFF
G21 ; set units to millimeters
G90 ; use absolute coordinates
M83 ; use relative distances for extrusion
;BEFORE_LAYER_CHANGE

But if I print this gcode file, I see no message, and when checking the sensor in the "Tune" menu while printing, the sensor is still on.
I thought I might have a problem with line endings, but looking at the file in a hex editor, all the lines seem to end with a 0A line feed character, including mine. 
Why isn't my printer doing anything with the M406 and M117 messages? Full gcode file here.

**Tags:** prusa-i3, g-code, slic3r

---

## 2 answers

### Answer by username_1 on 2018-05-15. Score: 1 | Accepted answer

When you download the latest version of [your firmware](https://github.com/prusa3d/Prusa-Firmware/archive/v3.2.0.zip) you find the implementation of all the codes in `Marlin_main.cpp`. Here you see that the M406 is not implemented! Hence it does not work.

> **Comments:**
> **username_2**: this is original Prusa - so marlin is not used!  
> **username_1**: @profesor79 Download the software from Prusa itself and you will see that it does have the Marlin_main.cpp file! https://github.com/prusa3d/Prusa-Firmware/blob/MK3/Firmware/Marlin_main.cpp  
> **username_2**: ok got that, another bit it the puzzles sorted :)  
> **username_1**: @profesor79 Always glad to teach the professor ;)  
> **username_0**: Interesting. So why doesn't M117 work either?  
> **username_1**: @Bas I can't tell for sure, Prusa has implemented M117 differently (with a higher priority?). Maybe this does not work flawlessly.  

---

### Answer by username_2 on 2018-05-15. Score: 1

As per github PR this is not implemented - see [this PR](https://github.com/prusa3d/Prusa-Firmware/issues/594) for details
Please check if your printer is processing M406 by issuing it manually.

In meantime, a sticker on the sensor will help you to print :)

> **Comments:**
> **username_3**: Professor79 Could you give a little more detail on how to use a sticker to stop the filament sensor issue? Maybe a photograph or specific placement advice? Left to my own devices I will continue to avoid the issue by printing my shiny filaments in total darkness. There has to be a better way. Thanks, from the peanut gallery  
> **username_2**: @Winky42 that depends if you have a mechanical or optical sensor. if is optical then just cover the lenses, if is mechanical put down the lever.  

---

