SD-Card Error
I have from time to time an SD-Card read error. When this happens the printer stops and stay at the same place with temperature on. That is a problem, if I print overnight. Can I change the code, that the printer goes to a certain position and motors and hotend stop?
Has someone an idea? Thanks for any input!
Has someone an idea? Thanks for any input!
Comments
I found "SD read error" only in this part of the code of in gcode.cpp.
So what to add?!:
....
if(n == -1)
{
Com::printFLN(Com::tSDReadError);
UI_ERROR("SD Read Error");
// Kill hotend and bed temperature
GCode::executeFString(PSTR("M104 S0/nM140 S0"));
// Second try in case of recoverable errors
sd.file.seekSet(sd.sdpos);
n = sd.file.read();
if(n == -1)
{
Com::printErrorFLN(PSTR("SD error did not recover!"));
sd.sdmode = 0;
break;
}
UI_ERROR("SD error fixed");
}
...
Is that correct?
Sorry for my poor programming capabilities!
My Kossel did the same thing last evening. I was very shocked when I saw the SD error message on the LCD this morning with the heating elements still switched on the whole night o_O
I would change something at the suggested code:
....
if(n == -1)
{
Com::printFLN(Com::tSDReadError);
UI_ERROR("SD Read Error");
// Second try in case of recoverable errors
sd.file.seekSet(sd.sdpos);
n = sd.file.read();
if(n == -1)
{
Com::printErrorFLN(PSTR("SD error did not recover!"));
sd.sdmode = 0;
// Kill hotend, bed temperature and re-home
GCode::executeFString(PSTR("M104 S0\nM140 S0\nG28"));
break;
}
UI_ERROR("SD error fixed");
}
...
Your solution was set at the first error. As you can see the printer tries to read from the SD card a second time below. If this try would succeed the printer would continue printing with switched off heating elements.
Also I added a G28 to get the nozzle away from the print.
Any ideas what could be done different or additionally?
The re-homing could be dangerous for a printer that homes the z-axis on the printbed. So here is a new version (from my own 0.92.8 version):
...
if(n == -1)
{
Com::printFLN(Com::tSDReadError);
UI_ERROR("SD Read Error");
// Second try in case of recoverable errors
sd.file.seekSet(sd.sdpos);
n = sd.file.read();
if(n == -1)
{
Com::printErrorFLN(PSTR("SD error did not recover!"));
sd.sdmode = 0;
Printer::kill(false);
#if DRIVE_SYSTEM == DELTA
Printer::homeAxis(true, true, true);
#else
Printer::homeAxis(true, true, false);
#endif
break;
}
UI_ERROR("SD error fixed");
}
...