Added support for adafruit EMC2101 #480

Merged
JeremyLaurenson merged 3 commits from master into master 2025-05-01 17:15:39 +01:00
JeremyLaurenson commented 2022-02-17 15:28:38 +00:00 (Migrated from github.com)

Added temperature sensor support for Adafruit 2101
Added output support to change fan speed on Adafruit 2101

Added temperature sensor support for Adafruit 2101 Added output support to change fan speed on Adafruit 2101
mym0T (Migrated from github.com) approved these changes 2022-09-17 04:26:17 +01:00
Vaarlion commented 2023-09-15 16:08:57 +01:00 (Migrated from github.com)

have you try setting up the clock to match the requirement of 25Khz for some fan ?
Screenshot from 2023-09-15 17-00-29
https://4donline.ihs.com/images/VipMasterIC/IC/SMSC/SMSCS00913/SMSCS00913-1.pdf

have you try setting up the clock to match the requirement of 25Khz for some fan ? ![Screenshot from 2023-09-15 17-00-29](https://github.com/vitormhenrique/OctoPrint-Enclosure/assets/59558433/8913c543-d187-402a-96a0-5ae6dde665a7) https://4donline.ihs.com/images/VipMasterIC/IC/SMSC/SMSCS00913/SMSCS00913-1.pdf
Vaarlion commented 2023-09-27 21:35:49 +01:00 (Migrated from github.com)

sadly, this wasn't a working branch for me, i've done a lot of tweak to bring it to a working state but i haven't tested everything yet.
You can find this work here for now: https://github.com/Vaarlion/OctoPrint-Enclosure/commits/master
I'll try to think to edit that link when i move all commit to a branch.

One thing that i don't quite understand about the pwm temperature logic is that it seam to override all other logic
No "off when not printing, on when printing, and keep on after for a while to cool down" for example.
Maybe I've missed something but for me this lake some "warm up the enclosure" and "cool down the enclosure" step.

I also have a huge doubt with this one : 234be72615
It seam to me that some control of PWM output never did anything more than write the wanted duty cycle to the output state, without actually changing the pin duty cycle ?

sadly, this wasn't a working branch for me, i've done a lot of tweak to bring it to a working state but i haven't tested everything yet. You can find this work here for now: https://github.com/Vaarlion/OctoPrint-Enclosure/commits/master I'll try to think to edit that link when i move all commit to a branch. One thing that i don't quite understand about the pwm temperature logic is that it seam to override all other logic No "off when not printing, on when printing, and keep on after for a while to cool down" for example. Maybe I've missed something but for me this lake some "warm up the enclosure" and "cool down the enclosure" step. I also have a huge doubt with this one : https://github.com/Vaarlion/OctoPrint-Enclosure/commit/234be7261528d78f171e0118211827063c91e321 It seam to me that some control of PWM output never did anything more than write the wanted `duty cycle` to the output state, without actually changing the pin duty cycle ?
jacopotediosi (Migrated from github.com) reviewed 2025-05-12 10:05:23 +01:00
jacopotediosi (Migrated from github.com) commented 2025-05-12 10:05:23 +01:00

calculated_duty remains undefined if you have not added an emc output, because the for loop does not perform any iterations.
This causes the following crash:

octoprint.plugins.enclosure - WARNING - An exception of type UnboundLocalError occurred on log_error. Arguments:
("local variable 'calculated_duty' referenced before assignment",)
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.9/site-packages/octoprint_enclosure/__init__.py", line 1461, in handle_emc_linked_temperature
    cmd = [sys.executable, script, str(int(calculated_duty))]
UnboundLocalError: local variable 'calculated_duty' referenced before assignment
`calculated_duty` remains undefined if you have not added an emc output, because the `for` loop does not perform any iterations. This causes the following crash: ``` octoprint.plugins.enclosure - WARNING - An exception of type UnboundLocalError occurred on log_error. Arguments: ("local variable 'calculated_duty' referenced before assignment",) Traceback (most recent call last): File "/home/pi/oprint/lib/python3.9/site-packages/octoprint_enclosure/__init__.py", line 1461, in handle_emc_linked_temperature cmd = [sys.executable, script, str(int(calculated_duty))] UnboundLocalError: local variable 'calculated_duty' referenced before assignment ```
jacopotediosi commented 2025-05-12 10:07:03 +01:00 (Migrated from github.com)

This PR is actually dangerous because it introduces a crash if no emc output is configured in the plugin.
The plugin crash causes the heater to turn on randomly, if one is configured, and the risk of melting the enclosure.

This PR is actually dangerous because it introduces a crash if no emc output is configured in the plugin. The plugin crash causes the heater to turn on randomly, if one is configured, and the risk of melting the enclosure.
Vaarlion commented 2025-05-12 10:11:51 +01:00 (Migrated from github.com)

i was confuse to see this merged as for me it didn't work at the time... but it could also be me making a mistake.
I never created a merge request because i've only tweak stuff without truly understanding it all in my "fork", but it does work, and have been for over a year and a half
https://github.com/Vaarlion/OctoPrint-Enclosure/commits/master

i was confuse to see this merged as for me it didn't work at the time... but it could also be me making a mistake. I never created a merge request because i've only tweak stuff without truly understanding it all in my "fork", but it does work, and have been for over a year and a half https://github.com/Vaarlion/OctoPrint-Enclosure/commits/master
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Gandalf/OctoPrint-Enclosure#480