Giter Club home page Giter Club logo

Comments (17)

SoundGuy avatar SoundGuy commented on May 27, 2024

Any news on this bug?

from octoprint-mqtt.

foosel avatar foosel commented on May 27, 2024

I have my hands full with core OctoPrint development and haven't had a chance to look into this yet.

from octoprint-mqtt.

SoundGuy avatar SoundGuy commented on May 27, 2024

i'm still getting this error flooding my log.

2018-10-11 17:42:22,490 - octoprint.printer.standard - ERROR - Exception while adding temperature data point to callback <mqtt.MqttPlugin object at 0xb307b030>
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/printer/standard.py", line 167, in _sendAddTemperatureCallbacks
callback.on_printer_add_temperature(data)
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_mqtt/init.py", line 204, in on_printer_add_temperature
or abs(value["actual"] - self.lastTemp[key]["actual"]) >= threshold
TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'

just curious if this is serious or not. my octoprint crashes every once in a while (week-two) and it did once in mid print and this flood of errors is making it hard to find anything else

from octoprint-mqtt.

jneilliii avatar jneilliii commented on May 27, 2024

@SoundGuy, I just checked this on my OctoPrint 1.3.9 running on OctoPi 0.14.0 and am not getting this temperature error. Not sure if this is a conflict with IFTT or maybe something was fixed between version 1.3.8 and 1.3.9 of OctoPrint that resolves this issue.

from octoprint-mqtt.

SoundGuy avatar SoundGuy commented on May 27, 2024

from octoprint-mqtt.

jneilliii avatar jneilliii commented on May 27, 2024

Do you get the same noise in your log with the ifttt plugin disabled?

from octoprint-mqtt.

sidddy avatar sidddy commented on May 27, 2024

Hi,

I'm getting the same error messages as SoundGuy on my Octoprint server with Klipper firmware on the connected printer. From what I can see, the reason for the error is the following:

  • As background information: Klipper firmware is divided in two parts: One part running on the same raspberry host as octoprint, the other part running on the MCU of the printer. Octoprint connects to the host-software part, not the MCU.

  • When the Klipper host software starts, the MCU might still be offline (i.e. raspberry powered up, printer powered down). In that case. when Octoprint send an M105 to get the temperature information, klipper responds with an "ok T:0". Note: No bed information is in that initial response.

  • Later on the printer is powered up and the MCU is properly connected to the host software. If Octoprint sends an M105 now, Klipper will properly respond with "ok T0:23.2 /0.0 B:24.3 /0.0", i.e. Bed information is included now

  • It looks to me like the Octoprint MQTT plugin cannot handle this case that the Bed (or any other additional temperature sensor) is added in the M105 responses over the lifetime of a connection to a printer. The calculation of the temperature-delta will fail with the given error message.

from octoprint-mqtt.

jneilliii avatar jneilliii commented on May 27, 2024

If that's the case I wonder if this issue might be a larger problem related to the temperature polling of OctoPrint itself. The MQTT plugin just hooks into the function in order to publish the information. During this time are there issues with the temp graph? @SoundGuy are you also using Klipper firmware?

from octoprint-mqtt.

sidddy avatar sidddy commented on May 27, 2024

@jneilliii : The temperature graph handles it properly: After "host-only" startup the graph shows only the tool temperature (off). Once the MCU goes online, the bed temperature line appears.

image

from octoprint-mqtt.

tedder avatar tedder commented on May 27, 2024

On it. Aside from this error, there's a really subtle error that I didn't see at first:

        if key not in self.lastTemp or \
            or abs(value["actual"] - self.lastTemp[key]["actual"]) >= threshold \
            or value["target"] != self.lastTemp[key]["target"]:

4 internet points to whoever spots it :)

from octoprint-mqtt.

tedder avatar tedder commented on May 27, 2024

doh- actually I did that when I was doing some debugging, that's not the committed version.

from octoprint-mqtt.

jneilliii avatar jneilliii commented on May 27, 2024

Double or?

from octoprint-mqtt.

tedder avatar tedder commented on May 27, 2024

Yeah, fun times eh?

I have the fix committed, I'll make a PR after 0.8 ships.

from octoprint-mqtt.

jneilliii avatar jneilliii commented on May 27, 2024

Let's merge the fix into 0.8, less prs that way?

from octoprint-mqtt.

tedder avatar tedder commented on May 27, 2024

I'd rather roll this into 0.8.1 with other minor fixes. That way we can get the other stuff out the door first.

(can you tell I do devops/release management for a career?)

from octoprint-mqtt.

jneilliii avatar jneilliii commented on May 27, 2024

No problem. I barely understand git and have never worked with other programmers on a team, so if you see me doing something wrong on this project, or you guys want to manage it differently I'm all ears. This one is a little different because it was left over from before, I just made minor tweaks directly to devel branch. Moving forward I guess we should come up with a development workflow, let me know your thoughts.

from octoprint-mqtt.

sidddy avatar sidddy commented on May 27, 2024

@tedder: as far as I can see, there's a little copy-paste-error in your commit, see 9fc3e60#r31176383

With that proposed change, your coding is working fine for me, the exception is gone and temperatures are properly reported via mqtt.

btw: thanks for very quick resolution!! :-D

from octoprint-mqtt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.