#codehell 2 – THERMAL RUNAWAY Errors on Prusa i3 MK2 3D Printer

This time we’re trying to work through a hardware bug!

Without warning, my printer would stop it’s current print and display “THERMAL RUNAWAY” on the display screen:

This would happen once every couple of prints or so.

According Prusa’s Docs a common cause of this is problems with the thermistor connection. They show a graph that has very erratic readings from the sensor:

 This seemed like a good place to start so I re-seated the connector and used octoprint to generate my own graph:

No erratic readings, the temp would drop off and then start heating back up.

The problem ended up being the connection between the terminal lug and the wire on the heater in the hotend. To fix this, I cut off the crimp lug and stripped away some insulation. I put this into the screw terminal block. I’ve done a couple of prints and had no issues after making this modification.

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone. Proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.

#codehell 1 – Electron cannot be started from an SSH session

Update: If you run export DISPLAY=:0 in the terminal prior to npm start, the application runs just fine on the remote device. Thank you Alex!


In working on an project for work, I have figured out the hard way that Electron has to be started from a terminal session on your target device (ie the computer it is to be viewed on). I am developing an embedded system based on the Raspberry Pi that does not take user input but displays information on a screen.

Upon downloading the electron-quick-start example, everything installs correctly without error and can be done remotely via SSH. Upon running with npm start, the following error is thrown.

I spent most of the evening trying to debug npm ERR! code ELIFECYCLE to no avail. On a lark, I connected a keyboard to the device and ran npm start and it ran without error. Sigh.

The remote development alternative for doing this is to use Remote Desktop Connection a client comes bundled in with windows. The software can be installed on the remote system (the Raspberry Pi) using apt-get install xrdp. Upon connecting, opening up a shell in the RDP client, and running npm start, the example application works just fine.

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone. Proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.