Ok so I have entered with SSH and I have typed watch gpio redall. The GPIO4 state was 1 and as soon I have pushed the filament trough the sensor it became 0. So the sensor works great and the gpio pin respect the changings on the sensor.
Now, as I start the print, the processor was at about 30% and the IN and CS columns were at about 1314 and 470. Off course the printer was jittering but the values were normal. Then, as i have took off the filament, the state of GPIO changed to 1 but suddently the processor went to about 95% and IN and CS values to 80732 and 24391. The printer stopped printing after about 8 seconds but the values remained the same.
Then, I have inserted the filament into the sensor but the values remained the same. GPIO pin changed from 1 to 0. And when I pressed Resume button in octoprint interface, the processor stayed the same at about 98% and the values of IN and CS dropped to about 1114 122. Also the interface was showing attempt to reconnect and everything crashed.
When I typed STRACE-C on putty I have received only one syscall (read) and in about 10 seconds I have received about 30 syscall (read) witch is weird I think.
This makes me think that the octoprint is corrupt or the plugin itself is making octoprint to go crazy when it receive different states from the gpio pins.
Ah, btw everything I say is on octopi 0.16 and octoprint 1.3.10