dieki-n / Octoprint-Filament-Scale

48 stars 31 forks source link

any chance update to python v3 #12

Open fredfred41 opened 4 years ago

fredfred41 commented 4 years ago

hi, I just wired and install everything on my pi, and your plugin don't work with python >3 , so disappointed.. Is there a chance you update it? Or, do you have an alternative?

Thanks

joshuariney commented 4 years ago

I second that motion. Would be good if we could update to python3.

joshuariney commented 4 years ago

Hey I'm not a developer. I don't know if I should even say this but I got it working for me by doing this:

  1. CD /home/pi/oprint/lib/python3.7/site-packages/octoprint_filament_scale
  2. edit the hx711.py file and change line 125 from print value to print(value)
  3. edit the __init__.py file find __plugin_name__="Filament_Scale" near the bottom and insert this line on the line right below that: __plugin_pythoncompat__ = ">=2.7,<4"
n3roGit commented 3 years ago

Unfortunately, your adjustment has not been successful with me. The plugin remains deactivated. I hope there will be an update here soon

parsko41 commented 3 years ago

For the record, I did what @joshuariney did and it allowed the plugin to activate. I can see it in the settings menu. I did perform changes mentioned in another issue as well, but I am not able to read the sensor. Another issue.

Prior to making the changes above, I could not see the plugin or use it.

joshuariney commented 3 years ago

@n3roGit @parskofamily Sorry I forgot to update when the same thing happened to me! I was able to get it working basically it looks like Python3 doesn't support the long() function anymore so if you search through hx711.py file and replace long( with int( along with my adjustments above then everything starts working. Again I'm not a developer but I wanted to make this work so I just did my own research and tried things. I hope I'm not offending Dieki by messing with his code.

n3roGit commented 3 years ago

@joshuariney could you make a pull request on the repo?

joshuariney commented 3 years ago

@joshuariney could you make a pull request on the repo?

@n3roGit Again, not a developer so I don't know what that is but I clicked on it and it looks like I need to select a fork and there are not any so I guess I can't do that.

n3roGit commented 3 years ago

hmm okay too bad. So I have now made all the changes as described. unfortunately without success :(