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

GPIO used #16

Open
wants to merge 54 commits into
base: master
Choose a base branch
from
Open

GPIO used #16

wants to merge 54 commits into from

Conversation

PierreGdrlt
Copy link

I want to connect my scale on GPIO 3 (DT) and GPIO 27 (SCK). How can change for use this GPIO instead of 20 and 21 ???

techman83 added 30 commits March 8, 2021 16:02
Add's workflows for release building
Update Project and Add Release workflow
techman83 and others added 16 commits April 27, 2021 18:29
After various gyrations I settled on this process for now.
The 'Sensor Not Connected' message was both long and slightly inaccurate. Which
lead to the interface jumping around whenever a string of bad readings came
through. Shortened the error to 'NaN' and documented it in the README.
Reported in #10, installation failed as RPi.GPIO was missing during
setup.
Open version file directly to avoid requiring runtime dependencies during setup - fixes #10
This typo causes the plugin to fail for new installations. If you
have already configured it, these values are not used.

Fixes #12
Fix typo in default settings
During refactoring a typo lead to default settings not being correct. Ensure our future defaults don't change without intent.

Relates to #12
@parsko41
Copy link

parsko41 commented May 8, 2021

Line 48 of init.py

<self.hx = HX711(20, 21)>

You should be able to edit this via an editor. I'm not very good at giving advice as to exactly how, but that's where it is in the code.
-Parsko

@PierreGdrlt
Copy link
Author

PierreGdrlt commented May 8, 2021

I've changed the 3 lines in Init.py :
36 clockpin=27
37 datapin=3
50 self.hx = HX711(3,27)

and the plugin always give error "Error: No filament sensor detected"
I've restart Octoprint, and Pi.

anything else ?

Edit :
I've read the issue "Plugin not getting a reading from the sensor"
I have changed in HX711.py the line 18 "GPIO.setmode(GPIO.BCM)" to GPIO.BOARD
and changed my pins 3 for 5, and 27 for 13 in init.py. The error message has disappear, but the reading is always 0g.

@parsko41
Copy link

parsko41 commented May 9, 2021

Glad you made progress! There is a calibration process, if I recall. It's been a while since I've used mine, as I have been going through printer changes. There is a chance pins are backwards, or a connection issue exists.

-Parsko

@PierreGdrlt
Copy link
Author

I checked that my sensor was working fine. I put an SD card with Raspbian in my Pi, and with a proven program (the one that runs another scale on another Pi), I was able to make sure my sensor was functional, and properly plugged in. .
So I corrected the init.py file, and restart my Pi.
The result is always the same. I have no reading in the settings of FSE.
Where should I look for ??
Snapshot_1

@parsko41
Copy link

parsko41 commented May 9, 2021

Hi,
It appears that someone is upgrading this. Can you have a look at the following link and see if that solves your problem? I've reviewed my own version of this where I changed my pin assignments, and I did not make any other changes than you have. Maybe you could also look at that. You may have Python 3 issues perhaps? I'm sorry I can't be further assistance.

OctoPrint/plugins.octoprint.org#864

-Parsko

@PierreGdrlt
Copy link
Author

Well.
Here is the latest bad news. I have tried everything. I have re-installed Octoprint at least 4 or 5 times, a few times it works, and after a few minutes it doesn't work, and sometimes it doesn't work at all.
I give up ... I will do more tests maybe in a few months, if the plugin stabilizes, or maybe other things will be released in the meantime.

Good continuation.

@parsko41
Copy link

My experience with the HX711 chips is dodgy. They do not provide stable reading, simply put. I use them professionally, and can get them to work because I am writing the software. But, even then, they give me sporatic readings that are simply wrong. Using them with a Raspberry Pi is worse than a proper microcontroller. It's a pseudo I2C protocol. It's I2C, but does not work with I2C libraries, in my experience. I have not tried again since I've gained much more experience with it. I also haven't read the datasheet to get the exact timing between edges and such. I'm sure there is one to get it to read reliably, perfectly.

A proper way to do this, IMHO, is to have a sub micro, like a RP2040 QTPY do the reading and filtering, while also maintaining the communication with the Pi. Much cleaner and more reliable. It's on my LOOONG list of things to do in the next couple years.

If it's worth anything, mine isn't hooked up right now. I would really love this integrated with the spool manager. Another item on the list....

Good luck, stay safe.

@PierreGdrlt
Copy link
Author

Thank's Parsko41

jcassel and others added 6 commits August 12, 2023 15:13
Building on @jcassel's work in #40, this publishes scale changes
to mqtt via the Octoprint-MQTT plugin.

closes #39
The code base was ported from python2 on a whim, and a lot of the code
reflects that. This tidies up the typing and linting a little more
Although the effort was done to create an average with outlier dection, it was
never actually used. This switches the function call over
The automatic releases use commit messages to generate the release notes. This
ensures the commits are correctly formmated to align with it.
Actions Checkout + Actions Python have had a bunch of improvements, time to update
them.
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

Successfully merging this pull request may close these issues.

5 participants