dieki-n / Octoprint-Filament-Scale

48 stars 31 forks source link

Python 3 version #13

Open parsko41 opened 3 years ago

parsko41 commented 3 years ago

Hi all,

I've gone through and figured out how to get this going with Octoprint that has Python 3 installed. There are a few things that were deprecated when going from 2 to 3. One is the print statement, the other is the long statement. I went through the python script and updated those elements. I also included the changes suggested in the other issues, specifically addressing the pin allocation. This has changed from BCM to BOARD in my code. It seems maybe the powers that be have not converged with a standard? I'm not sure, I'm still getting into it this deep.

So, after getting it working, I'm curious if the behavior I am seeing makes sense.

  1. I'm not sure it does much outside of the settings menu. Is there a GUI front end? There are some javascript files in the repository. I write python code, and that stuff was easy to debug from the log file, but I am still mostly clueless with Java. I think there is a frontend because of what I can kind of decode from the java files that make the front end stuff.

  2. The spool weight doesn't do anything? I see the value, I can type into it to update it, but that's it. It's cool, as it saves what the value is, but I would have thought it would be tied into everything more, or am I not seeing something important?

This post helped: https://github.com/dieki-n/Octoprint-Filament-Scale/issues/11#issuecomment-744584116

And this post helpd: https://github.com/dieki-n/Octoprint-Filament-Scale/issues/12#issuecomment-728385562

Attached are my python 3 files. I've added a comment # UPDATED where I updated things.

hx711_python3.zip

I'd love to hear back from anyone else about if there is supposed to be more in the front end GUI on OctoPrint, and if what I did makes sense.

-Parsko

Wayfinder624 commented 3 years ago

Thanks for the fixes. I can now see the plugin and calibrate. Though the "Filament Remaining: " in the State window toggles between NaNg and Sensor is not connected.

Is there a GUI front end? it shows in the STATE window for your printer.

avr12345 commented 3 years ago

Thanky Parsko! My sensor is working perfectly. Is there a chance to connect more then one sensor? I have 4 sensors/spools in line with switchable RJ45 plugs. but its not that accurate because of the calibration. would be awesome to have 4 independent sensors connected