Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging single sensor #9

Open
axelnagel opened this issue Feb 1, 2023 · 0 comments
Open

Debugging single sensor #9

axelnagel opened this issue Feb 1, 2023 · 0 comments

Comments

@axelnagel
Copy link

axelnagel commented Feb 1, 2023

First of all, thanks for sharing!
I had trouble getting something to show up in the UI.
So by luck I went down the rabbit hole and the called the plugin code manually which presented me the error:

Traceback (most recent call last): File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_emc2101/EMC2101.py.bck", line 50, in <module> print('{0:0.1f} | {1:0.1f}'.format(temperature, fanspeed)) NameError: name 'temperature' is not defined

1.) logged in as pi

2.) activated python
source oprint/bin/activate

3.) tested the script
python /home/pi/oprint/lib/python3.7/site-packages/octoprint_emc2101/EMC2101.py 0 0

4.) copied the script and played around (not a python guy)

I changed the following code block:

itemperature = emc.internal_temperature
etemperature = emc.external_temperature
fanspeed = emc.fan_speed

if internal==0:
	temperature=itemperature
else:
	temperature=etemperature

to

    if internal==0:
	temperature = emc.internal_temperature
else:
	temperature = emc.external_temperature
    
fanspeed = emc.fan_speed

Now the script reports the temperature, bypassing the external or internal temperature call depending on the given flag, which failed in my case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant