Temperature info not parsed correctly

@rapotjau Think of 3D printing as the wild, wild west. Foosel is the local sheriff in town and the printer manufacturer is like that traveling guy who sells snake oil remedies and you bought one of them.

Sometimes this isn't easy. I get that you'd like to not re-flash your new printer's firmware but some of these vendors truly don't know what they're doing. I contracted for a big manufacturer here in San Diego and their understanding of the software would just make you shake your head. How could they be so utterly clueless? And yet, few of these manufacturers know the software side of the business like they (hopefully) do understand the hardware.

Fast-forward a year from now and you'll probably agree with me. It wouldn't hurt to learn how to re-flash your printer's firmware. Learn how to do it and you can re-flash it back to Creality's compiled firmware if you didn't like the experience.

1 Like

Fyi, same issue discussed here

And branch supporting these machines with the touchscreen that doesn't have a protocol issue

1 Like

I don't have much time to understand how to publish a plugin to the repository, but here is one that does the job.

Create the file /home/pi/.octoprint/plugins/CrealityTemperature.py with this content

# coding=utf-8

import octoprint.plugin
import re

class CrealityTemperatureFixPlugin(octoprint.plugin.OctoPrintPlugin):
	def log(self, comm_instance, line, *args, **kwargs):
		if re.match("^(ok)?\s*==T", line):
			fix = re.sub("==", "", line)
			return fix
		return line

__plugin_name__ = "Creality Temperature Fix"
def __plugin_load__():
	global __plugin_implementation__
	__plugin_implementation__ = CrealityTemperatureFixPlugin()

	global __plugin_hooks__
	__plugin_hooks__ = {
		"octoprint.comm.protocol.gcode.received": __plugin_implementation__.log
	}
2 Likes

I put the CrealityTemperature.py file in the correct location ( /home/pi/.octoprint/plugins/) but I don't see it listed in the installed plugins side-bar location...

Is there another step needed to actually activate the plugin or will it simply run in the background as long as the plugin file is in the plugins directory?

According to this tutorial, simply placing the Python file into the correct spot and restarting OctoPrint is all it takes.

I did get the plugin to work - what threw me for a loop was that there is no indication in OctoPrint that the plugin was installed. However, it did make the temperature graph work again!

Thanks everyone - and thanks jcheger for the plugin/fix!

1 Like

It helps to add a logger line in there to self-announce that's it's been loaded. (See the tutorial.) Glad to hear it's working for you.

Sorry I have looked at the tutorial but still don't understand how to add this to get my CR-X working. Can someone please write a step by step process to do this.

  • Use ssh pi@octopi.local or the equivalent command in PuTTY to remote into your Raspberry Pi computer (noting that the default password is "raspberry").
  • Run the command touch /home/pi/.octoprint/plugins/CrealityTemperature.py
  • Run the command nano /home/pi/.octoprint/plugins/CrealityTemperature.py
  • Copy and paste the content as provided above for the Python code, making sure to add an extra Enter (hard return) at the end of the file. Press Ctl-X and follow the prompts to save the content to the same file.
  • Run sudo reboot to reboot your Raspberry Pi computer.

When OctoPrint is again available, give it a test to see if this fixes the temperature.

1 Like

OutsourcedGuru,

You are the man, Thanks that worked and I'm seeing temps.
Thanks again

1 Like

do you know what modification I have to make to the code if I am running multiple session of Octoprint in the same Pi?

"Do I know what modification I have to make to the code...?" No. What I'd do is dedicate one Raspi per printer.

Seriously, I intimately know how much processing OctoPrint and printing takes on a Raspberry Pi 3B computer. I've written an interface to monitor its performance, even. It is unwise to try to run more than one printer from one OctoPrint install, (in my humble opinion).

1 Like

thanks for the feedback. I can do that. could you point me to a tutorial on how to run multiple ones on the same network? just install and follow each ID? change the host name to something different from default?

It sounds like you have the right idea already: each needs its own hostname. You can change it by running sudo raspi-config, it's under "Network Options".

You could go with a Star Wars theme or almost anything for a naming convention. Just remember that they can be referenced as hostname.local where "hostname" was originally octopi.

1 Like

Can you explain what board and firmware this is supposed to help with?
Does this affect CR-10S3/4 users with the Arduino 2560 upgrade board as well?
Is this for the bed or hot end temp?
When you stated you compared it to the old CR-10 output what firmware version were you comparing to?

This solution worked for me very well, until the Phyton Update. Now it does not show temp graph again :frowning:

Are you using the script or this plugin?

I used the script and another plugin, and now this plugin, and no graph

If you got a spare sd card try just the plugin on a fresh image.

The provided solution doesn't work on a newer installation of OctoPi, and likely other more current installations, due to the switch to Python3 as the default interpreter. Although the code will work with both Python 2.7 and Python 3, the compatibility string inherited from the class assumes Python 2 support. This fixes the issue and sets a couple of other informational strings:

# coding=utf-8

import octoprint.plugin
import re

class CrealityTemperatureFixPlugin(octoprint.plugin.OctoPrintPlugin):
    def log(self, comm_instance, line, *args, **kwargs):
        if re.match("^(ok)?\s*==T", line):
            fix = re.sub("==", "", line)
            return fix
        return line

__plugin_name__ = "Creality Temperature Fix"
__plugin_version__ = "0.1.0"
__plugin_description__ = "Fix Creality CR-X Temperature Monitoring"
__plugin_pythoncompat__ = ">2.7,<4"

def __plugin_load__():
    global __plugin_implementation__
    __plugin_implementation__ = CrealityTemperatureFixPlugin()

    global __plugin_hooks__
    __plugin_hooks__ = {