Git Product home page Git Product logo

mamin27 / ecomet_i2c_raspberry_tools Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 7.0 114.9 MB

Raspberry Tool for managing I2C modules. EEPROM (24c01-1024), PWM LED/Motor driver (PCA9632), I/O driver (PCA9557), Temp/Humid sensor (HDC1080, HTU21D), Fan controller with a PWM (EMC2301), Pressure sensor(MS5637), Display (SSD1306), Current Voltage Power measurement (INA226, INA260), PMU (AXP209), i2cdetect

License: GNU General Public License v3.0

Python 70.70% Pascal 29.30%
i2c raspberry eeprom hdc1080 pca9632 htu21d emc2301 i2cdetect ms5637 pca9557

ecomet_i2c_raspberry_tools's People

Contributors

mamin27 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ecomet_i2c_raspberry_tools's Issues

Generate fan_type.py

Hi,

So I used your code for a Pi board called BitPiRat with an emc2302 on it :
https://github.com/philippebourcier/bitpirat_fanctrl
๐Ÿ˜Ž

It uses a 5V 4-Pin PWM fan headers, like most Pi CM4 boards and since a NF-A8 seems a bit overkill, I got myself a NF-A4x20.

Question is :

Do you think fan_type.py needs to be updated for the NF-A4x20 or will it work "as is" ?
The specs : https://noctua.at/en/nf-a4x20-pwm/specification

If so, how do I generate a new fan_type.py file ?
I can't see the relation about the specs on the NF-A8 page (ie: max RPM 2200) and the values on fan_type.py. ๐Ÿคทโ€โ™‚๏ธ

Right now everything works, but still, I'm asking, just to be sure (and smarter, in the end). ๐Ÿ˜…

Add documentation to each function and data type of function variables

For somebody reading everything for the first time it quiet hard to follow.
Therefor, I recommend to add a short description to each function with the data type of the input and return variables and what they mean.

def function-a(self, a: int, b: float) -> bool:
    """
    Function description here

    :param a: int, random integer
    :param b: str, random float
    :return: bool, true if 1th parameter is bigger than the 2nd
    """
    if a > b:
        return True
    else:
        return False

Missing ~/.comet/config.yaml

When trying to run test.py or a specific hdc1080_i2c_test.py I get the following error:

FileNotFoundError: [Errno 2] No such file or directory: '/home/xxx/.comet/config.yaml'
  1. Install on Raspberry Pi 3 Model b+ running Raspbian 11 (Kernel 6.1.21-v7+)
pip3 install ecomet-i2c-sensors
  1. Run test.py from git
python3 test.py
  1. Get error
FileNotFoundError: [Errno 2] No such file or directory: '/home/xxx/.comet/config.yaml'

Cannot seem to find information about the config.yaml and what SMD information is needed.

Hope you find time to help me with this issue/bug.

Best regards,
Tim.

Problem Reading RPM from EMC2301

Hi,

I have been trying to get an EMC2301 to work with a Noctua NF-8A PWM Fan (fan specs).

Using a Raspberry PI over i2c, I can control the speed the fan using the EMC2301 using the following two commands:

i2cset -y 1 0x2f 0x30 0xff
i2cset -y 1 0x2f 0x30 0x00

However, I am unable to reliably read the fan RPM. I have used the open source test script (Test Script) and pasted its output below.

As you can see below, the RPM values being printed are not sane. I am assuming its a configuration issue and would love guidance to that effect. Thank you so much.

Regards,
S.

pi@raspberrypi:~/fan/emc2301 $ sudo python3 emc2301_i2c_test.py
3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110]
ecomet.emc2301: INFO Start logging ...
:TEST_PASSED:
ecomet.emc2301: INFO PRODUCT Read correct
ecomet.emc2301: INFO PRODUCT ID: 37
ecomet.emc2301: INFO MANUFACTURER Read correct
ecomet.emc2301: INFO MANUF ID: 5D
ecomet.emc2301: INFO REVISION Read correct
ecomet.emc2301: INFO REVISION ID: 80

{'CONF': {'MASK': 'UNMASKED', 'DIS_TO': 'DISABLED', 'WD_EN': 'DISABLED', 'DR_EXT_CLK': 'CLK_INPUT', 'USE_EXT_CLK': 'INTERNAL', 'EN_ALGO': 'DISABLED', 'RANGE': '500>1', 'EDGES': '5>2POLE>1', 'UPDATE': '100ms', 'EN_RRC': 'ENABLED', 'GLITCH_EN': 'DISABLED', 'DER_OPT': 'BASIC_DERIVATE', 'ERR_RNG': '0RPM', 'GAIND': '4x', 'GAINI': '4x', 'GAINP': '4x'}, 'FAN_STAT': {'WATCH': 'NOT_SET', 'DRIVE_FAIL': 'REACH', 'FAN_SPIN': 'SPIN', 'FAN_STALL': 'STALL', 'FAN_INT': 'NO_ALERT', 'FAN_SETTING': 0.0}, 'SPIN': {'FAN_SPIN_UP_DRIVE_FAIL_CNT': 'DISABLE', 'FAN_SPIN_UP_NOKICK': 'SPIN', 'FAN_SPIN_UP_LVL': '60%', 'FAN_SPIN_UP_TIME': '500ms', 'FAN_MAX_STEP': 16, 'FAN_MIN_DRIVE': 40.0}, 'PWM': {'PWM_POLARITY': 'NORMAL', 'PWM_OUTPUT': 'OPEN-DRAIN', 'PWM_BASE': '26.00kHz', 'PWM_DIVIDE': 1}, 'TACH': {'TACH_COUNT': 7840, 'FAN_FAIL_BAND': 0, 'TACH_TARGET': 8191, 'TACH_READ': 5647}, 'ID': {'PRODUCT_ID': '37', 'MANUF_ID': '5D', 'REVISION_ID': '80'}, 'LOCK': 'UNLOCKED'}

********* Changing Speed To: 0 **********

computing speed
res: 4022
poles: 2
edges: 5
mul: 1
tach: 32768
output: 977
977 RPM

computing speed
res: 6890
poles: 2
edges: 5
mul: 1
tach: 32768
output: 570
570 RPM

computing speed
res: 3949
poles: 2
edges: 5
mul: 1
tach: 32768
output: 995
995 RPM

computing speed
res: 3981
poles: 2
edges: 5
mul: 1
tach: 32768
output: 987
987 RPM

computing speed
res: 3962
poles: 2
edges: 5
mul: 1
tach: 32768
output: 992
992 RPM

********* Changing Speed To: 50 **********

computing speed
res: 3804
poles: 2
edges: 5
mul: 1
tach: 32768
output: 1033
1033 RPM

computing speed
res: 9
poles: 2
edges: 5
mul: 1
tach: 32768
output: 436906
436906 RPM

computing speed
res: 14
poles: 2
edges: 5
mul: 1
tach: 32768
output: 280868
280868 RPM

computing speed
res: 9
poles: 2
edges: 5
mul: 1
tach: 32768
output: 436906
436906 RPM

computing speed
res: 9
poles: 2
edges: 5
mul: 1
tach: 32768
output: 436906
436906 RPM

********* Changing Speed To: 100 **********

computing speed
res: 9
poles: 2
edges: 5
mul: 1
tach: 32768
output: 436906
436906 RPM

computing speed
res: 4
poles: 2
edges: 5
mul: 1
tach: 32768
output: 983040
983040 RPM

computing speed
res: 4
poles: 2
edges: 5
mul: 1
tach: 32768
output: 983040
983040 RPM

computing speed
res: 4
poles: 2
edges: 5
mul: 1
tach: 32768
output: 983040
983040 RPM

computing speed
res: 7
poles: 2
edges: 5
mul: 1
tach: 32768
output: 561737
561737 RPM

********* Changing Speed To: 160 **********

computing speed
res: 4
poles: 2
edges: 5
mul: 1
tach: 32768
output: 983040
983040 RPM

computing speed
res: 4
poles: 2
edges: 5
mul: 1
tach: 32768
output: 983040
983040 RPM

computing speed
res: 4
poles: 2
edges: 5
mul: 1
tach: 32768
output: 983040
983040 RPM

computing speed
res: 4
poles: 2
edges: 5
mul: 1
tach: 32768
output: 983040
983040 RPM

computing speed
res: 4
poles: 2
edges: 5
mul: 1
tach: 32768
output: 983040
983040 RPM
Speed: 200

computing speed
res: 4
poles: 2
edges: 5
mul: 1
tach: 32768
output: 983040
983040 RPM

computing speed
res: 4
poles: 2
edges: 5
mul: 1
tach: 32768
output: 983040
983040 RPM

********* Changing Speed To: 255 **********

computing speed
res: 8191
poles: 2
edges: 5
mul: 1
tach: 32768
output: 480
480 RPM

computing speed
res: 2658
poles: 2
edges: 5
mul: 1
tach: 32768
output: 1479
1479 RPM

computing speed
res: 8191
poles: 2
edges: 5
mul: 1
tach: 32768
output: 480
480 RPM

computing speed
res: 8191
poles: 2
edges: 5
mul: 1
tach: 32768
output: 480
480 RPM

computing speed
res: 6217
poles: 2
edges: 5
mul: 1
tach: 32768
output: 632
632 RPM


Raspberry PI CM4 Support?

Hi, is your work only compatible with the Raspbery PI3+?

Since the ComputModule4 has on the IO Board an EMC2301 on /dev/i2c-10 (as 0x2F)
My question is where do I have to change the BUS from i2c-1 (Rapsberry PI 3+) to i2c-10 (CM4 IO Board)

Best Regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.