adafruit / Adafruit_CircuitPython_EMC2101

CircuitPython driver for EMC2101 brushless fan controller
MIT License
3 stars 9 forks source link

Problem with LUT example on Raspberry Pi 4 (64bit) #8

Closed asmagill closed 3 years ago

asmagill commented 3 years ago

When I run the example emc2101_lut_example.py on a Raspberry Pi 4 with 64bit Raspberry Pi OS (https://www.raspberrypi.org/forums/viewtopic.php?p=1668160, but updated via apt to latest available), I get the following error:

amagill@portal:~:%0:$ python3 ./emc2101_lut_example.py 
Traceback (most recent call last):
  File "./emc2101_lut_example.py", line 15, in <module>
    emc.lut[27] = 25
  File "/usr/local/lib/python3.7/dist-packages/adafruit_emc2101.py", line 142, in __setitem__
    self._set_lut(self.lut_values)
  File "/usr/local/lib/python3.7/dist-packages/adafruit_emc2101.py", line 193, in _set_lut
    getattr(self, "_fan_lut_t%d" % (idx + 1)).__set__(self, current_temp)
AttributeError: 'int' object has no attribute '__set__'

Manual setting (i.e. the simple test) works fine, but I haven't tried the PWM test.

I don't have another Pi 4 running 32 bit to test against, but I'll try on a Pi 3 tonight to see if that makes a difference. Or I might be able to build a new SD card running the 32bit OS and try that on the 4, if I have any currently free -- I'll post my findings, when I get a chance tonight.

rpavlik commented 3 years ago

There's a bug in the LUT that I literally just figured out and fixed - see #9

asmagill commented 3 years ago

I'll clone the repository and merge the pull requests in later tonight and let you know how it goes!

asmagill commented 3 years ago

I can confirm pull #9 fixes my issue, thanks!

caternuson commented 3 years ago

Yep. Thanks for the fix! Merged it in.