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

Scale configuration continued further... Support for second HX711 #421

Merged

Conversation

FabianSperrle
Copy link
Contributor

This PR continues the work by @maunsen and @einarhauks by adding support for a second HX711 board.
We introduce a new config flag in userConfig.h to define whether a single HX711 or two HX711 boards are connected.
Other than that, there is some further extensions of the calibration and tare logic to support a second HX711.

When running the calibration, I remove the drip tray cover and calibrate both scales individually, before putting the cover back.
Seems to be working reasonably well.

@FabianSperrle
Copy link
Contributor Author

For me, enabling the libraries flag for ESP32 made quite the difference in reading consistency -- see 0ba62c9.
Independent on how things go with the second pin for HX711, I believe this is worthwhile on the master branch.

This was referenced Jan 14, 2024
@FabianSperrle FabianSperrle force-pushed the scaleConfiguration_continued branch 3 times, most recently from 5fbad55 to 4c5fb23 Compare January 19, 2024 21:02
src/MQTT.h Outdated Show resolved Hide resolved
src/MQTT.h Outdated Show resolved Hide resolved
src/MQTT.h Outdated Show resolved Hide resolved
src/scalevoid.h Outdated Show resolved Hide resolved
src/scalevoid.h Outdated Show resolved Hide resolved
@FabianSperrle FabianSperrle force-pushed the scaleConfiguration_continued branch 2 times, most recently from d82f445 to aa4b55c Compare January 22, 2024 14:06
data/html/index.html Outdated Show resolved Hide resolved
data/js/app.js Outdated Show resolved Hide resolved
data/js/app.js Outdated Show resolved Hide resolved
data/js/app.js Outdated Show resolved Hide resolved
src/EmbeddedWebserver.h Outdated Show resolved Hide resolved
src/main.cpp Outdated Show resolved Hide resolved
src/main.cpp Outdated Show resolved Hide resolved
src/main.cpp Outdated Show resolved Hide resolved
src/pinmapping.h Outdated Show resolved Hide resolved
src/scalevoid.h Outdated Show resolved Hide resolved
maunsen and others added 5 commits January 26, 2024 22:03
Added Option for tare and calibration through mqtt and display

removed empty line

added toggles for tare and calibration to web frontend

Added Toggles for tare and Calibration to Web:
Prepared data for KnownWeight and calibrationValue to be added

Made scaleCalibration and scaleKnownWeight editable in Web

Moved Scale Settings to own card

reverted local changes in platform.ini and pinmapping to standard

fixed merge conflicts and corrected naming of variables

fixed bug when brewtime switches to 0 when brewing for weight
Remove extra comma

Improve calbration progress messges

Don't tare the scale while the calibration load is very likely still on it

Add tare and calibrate buttons to MQTT

Fix wrong section IDs in web page

Only include scale handlers in webserver if scale is enabled

Remove scale related code from time-based brewing mode

Exclude scale related code when scale is not enabled in userconfig

Minor formatting fixes
e8d7458
author Fabian Sperrle <[email protected]> 1702580259 +0100
committer Fabian Sperrle <[email protected]> 1705696789 +0100

Start configuration for second HX711

WIP: start cleanup

Fix startup of second HX711

Brew by weight should not stop when time is reached

Bugfix: Set correct calibration weights for scale 2 and clean up output

Enable HX711 library feature for more consistent readings on ESP32

tldr: ESP32 is too fast for the library in default mode, so they added a flag that introduces timeouts and makes the readings more realiable
Starting point for further reading: olkal/HX711_ADC#35

Fix compile error for single HX711

Fix debug message: calibration instead of tare

Config override causes issues with pin numbers for some reason? disable for now

re-introduce constant for timeout and tare to avoid duplication

If we show decimal seconds we can also show decimal grams

Remove superfluous space

Re-add HX711 config flags and move scale interrupt up in main to avoid messing with timestamps
Bugfix: Actually toggle calibration on button click
fiendie
fiendie previously approved these changes Jan 26, 2024
src/main.cpp Outdated
Comment on lines 2009 to 2022
#if SCALE_TYPE == 0
editableVars["SCALE2_CALIBRATION"] = {
.displayName = F("Calibration factor scale 2"),
.hasHelpText = false,
.helpText = "",
.type = kFloat,
.section = sScaleSection,
.position = 32,
.show = [] { return true; },
.minValue = -100000,
.maxValue = 100000,
.ptr = (void *)&scale2Calibration
};
#endif
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one has to stay though, right? Otherwise we always show both on the website, which is not great either...

@LoQue90 LoQue90 merged commit 8d9242c into rancilio-pid:master Jan 26, 2024
1 check passed
@FabianSperrle FabianSperrle deleted the scaleConfiguration_continued branch January 27, 2024 16:06
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