Open samster395 opened 7 months ago
an esp32 some code and api calls to spoolman and this is done. nothing which spoolman itself has to provide.
(working an such a scale with integrated NFC reader, lets me update remaining weight if needed)
an esp32 some code and api calls to spoolman and this is done. nothing which spoolman itself has to provide.
(working an such a scale with integrated NFC reader, lets me update remaining weight if needed)
Surely it doesn't make sense to use another device like an esp32 when the raspberry pi already has the capability of reading the load cell, not to mention the plugin I provided is also written in python like spoolman.
I understand your point that it means there needs to be no edits to spoolman but it's not exactly the best solution.
I guess your solution makes sense if you're not running spoolman/klipper on a raspberry pi and instead a Linux server or something because then you wouldn't have GPIO.
Spoolman itself doesn't really do the changing of the spool's weight, it is done by the moonraker's spoolman component requesting it. It is also the component in moonraker that knows which is the active spool for the printer.
I agree with rufInus, it would be better to have it in a separate program. As you said, it doesn't make sense if you don't run spoolman on the printer's rpi, it makes even less sense if you have multiple printers connected to one Spoolman installation. Spoolman sometimes run in docker, then its a bit of a PITA to get access to the rpi's IO.
That external program can ask moonraker about the current active spool and then send the updated weight to spoolman. Both have REST APIs for it that are easy to use.
The moonraker component should perhaps then also be updated so it is possible to turn off the reporting of used filament to Spoolman, otherwise there will be a bit of double reporting. That would be a simple thing to fix.
Would be good to get functionality like Filament Scale for octoprint proivides where you use a HX711-based load cell to read out the current weight of the remaining filament which would then use the empty spool weight to give you the actual weight.
https://github.com/techman83/Filament-Scale-Enhanced