Skip to content

Update freedi_hall_filament_width_sensor.py#482

Open
andreykurichev wants to merge 1 commit intoPhil1988:masterfrom
andreykurichev:master
Open

Update freedi_hall_filament_width_sensor.py#482
andreykurichev wants to merge 1 commit intoPhil1988:masterfrom
andreykurichev:master

Conversation

@andreykurichev
Copy link

@andreykurichev andreykurichev commented Feb 24, 2026

Key changes:

The _setup_adc_callbacks() method now tries 3 connections:
· Option 1: New API with 3 arguments: (time, self, callback)
· Option 2: Medium API with 2 arguments: (time, callback)
· Option 3: Your existing option with 1 argument: (callback)
The method tries each option in the queue, and as soon as one is implemented (without raising a TypeError), it uses it.
If none of them work, a clear error is thrown.
What happens now:

Old versions (with one argument): setup_adc_callback(callback)
Medium versions (with two arguments): setup_adc_callback(time, callback)
New versions (with multiple arguments): setup_adc_callback(time, self, callback)

The module should now work on any version of Klipper.

@dewi-ny-je
Copy link

I'm on mobile and I cannot easily check, but wasn't the freedi_hall module a modified version of the original hall_filament module? Have you checked what mainline klipper did with the module?

@Phil1988
Copy link
Owner

@benlye can you have a check for this as your printer seems to have a working z-offset setup and you did the recent changes?

@benlye
Copy link
Contributor

benlye commented Feb 26, 2026

@benlye can you have a check for this as your printer seems to have a working z-offset setup and you did the recent changes?

@Phil1988 - Different module - my change was to auto_z (which I don't actually use as I have a Cartographer), this is to the filament sensor.

@andreykurichev - does the current FreeDi version break in a specific Klipper build? Just wondering how I can test/verify your change?

@dewi-ny-je
Copy link

The commented line should be removed.
Otherwise the implementation seems fine.

@andreykurichev
Copy link
Author

@benlye The current version of freedi stops working with version 0.13.0-554

@benlye
Copy link
Contributor

benlye commented Feb 26, 2026

I tried this out with Klipper 0.13.0-557 on my Q1 Pro. The sensor now always reports that there is filament, even when there is not.

It was working correctly with the old code on a slightly older Klipper build (0.13.0-536).

@benlye
Copy link
Contributor

benlye commented Feb 26, 2026

I copied the recent changes made to the upstream hall_filament_width_sensor.py file and the FreeDi version now works on my machine - filament is detected correctly. I highly doubt this will be backwards compatible though.

See what I did here:
master...benlye:FreeDi:benlye-hall-sensor-fix

@benlye
Copy link
Contributor

benlye commented Feb 26, 2026

FWIW, I'm going to work on a PR to mainline Klipper to add a configuration option for hall_filament_width_sensor to disable extrusion multiplier modification and just use the sensor as a runout switch. Seems like that would be a better long term option than having to maintain this customization.

I have some testing to do, but this is what I've done:
Klipper3d/klipper@master...benlye:klipper:filament-width-sensor

It's a simple config setting to default flow compensation to off plus commands that can be used to enable or disable it on the fly.

@benlye
Copy link
Contributor

benlye commented Feb 26, 2026

PR submitted - Klipper3d/klipper#7210

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.

4 participants