Temperature info not parsed correctly


#1

What is the problem?
temperature values are not read from terminal for the graph

What did you already try to solve it?
search, but this is a new printer model with maybe wonky firmware

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, octoprint.log, serial.log or output on terminal tab, ...)

okay, so on my old printer (CR-10) the terminal output for temperature looks like this

Recv: ok T:210.31 /210.00 B:45.47 /45.00 @:71 B@:0
and everything works fine.

on the new printer (CR-X) the output looks like this:

Recv: ==T:145.66 /210.00 ==B:60.15 /60.00 @:127 B@:0

so instead of ok there is a ==

I'm assuming their new firmware does things differently and the output isn't parsed correctly.

Any way I can twist some nuts and bolts to make this work again? vesion is Octoprint 1.3.9
I'm not too hopeful for near-term firmware upgrades from Creality

Thanks


Can't display Hotend and bed Version 1.3.9!
#2

i think it is because your printer is still heating up


#3

If you do an M115 in the Terminal tab, you can indicate to us the firmware description.


#4
Send: M115
Recv: FIRMWARE_NAME:Marlin Ver 1.10.0  (Creality3D) SOURCE_CODE_URL:https://github.com/MarlinFirmware/Marlin PROTOCOL_VERSION:1.0 MACHINE_TYPE:www.cxsw3d.com EXTRUDER_COUNT:2 UUID:cede2a2f-41a2-4748-9b12-c55c62f367ff

don't think it's only duing the heat up periode.I've had prints finish on this machine like this.


#5

It looks like a standard version of Marlin, just several versions back. There's a working profile in the Guide for the CR-10S but not the CR-X so far. Perhaps @foosel could advise.


#6

the firmware which the ender 3 uses wants arduino 1.0.5

which was released 19 Sep 2013

I would update to stock marlin ...
Could be something arround Marlin 1.0.1


#7

Let me correct you here - your printer vendor broken the firmware or rather the M105 output format in the new release. I suggest to scream a bit at your printer vendor, they can't just start changing output formats if they feel like it, they have to adhere to the established protocol if they expect interoperability with existing solutions on the market.


#8

First of all, I think it seems like Octoprint is working correctly, and the Creality 3D CR-X is breaking the protocol.

When I compare Creality 3D's firmware to the original Marlin firmware, it seems like they have changed a lot in the Marlin 1.1.0 code, and it seems like line number 7445 in marlin_main.cpp should be deleted:
SERIAL_PROTOCOLCHAR(" ==");
(sourcecode available here: https://www.creality3donline.com/blog/download-b0034.html)

That being said, and due to the fact that I am a CR-X owner, I need a solution while Creality 3D and Octoprint fights about the protocol, and I'm not very keen to change firmware on my newly bought printer at the moment.

My very dirty solution is to add the following 4 lines between the "##~~ busy protocol handling" and "##~~ debugging output handling" sections of the /home/pi/oprint/lib/python2.7/site-packages/octoprint/util/comm.py on my octopi (line number 1559).

                            ## Fix Creality 3D CR-X breaking with standards
                            findBadTempReply = re.search(r"^((ok)*)\ ==(T|B):([0-9\.]*)\ /([0-9\.]*)\ .*$",line)
                            if findBadTempReply:
                                    line = line.replace(" =="," ")

I'm no python programmer, and might just have broken every rule in all the good the books, but hey - now I got a temperature readig. :slight_smile:
(The fix will most likely be overwritten whenever I update Octoprint)

Maybe someone could translate this to a plugin called "Fix very broken CR-X firmware replies" or something like that, so we can move on with our lives while Creality fixes their broken firmware?

Best regards
Tobias


#9

I think it would be more convenient by uploading a proper firmware...


#10

@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.


#11

Fyi, same issue discussed here

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


#12

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
	}

#13

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?


#14

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


#15

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!


#16

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.


#17

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.


#18
  • 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.


#19

OutsourcedGuru,

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