Skip to content

Add CrOS_EC_Python as a Hardware Controller#164

Open
Steve-Tech wants to merge 3 commits intoTamtamHero:mainfrom
Steve-Tech:main
Open

Add CrOS_EC_Python as a Hardware Controller#164
Steve-Tech wants to merge 3 commits intoTamtamHero:mainfrom
Steve-Tech:main

Conversation

@Steve-Tech
Copy link
Copy Markdown

Hi,
Parsing the output of ectool is a very inefficient way of doing things. Not just from the overhead of parsing with regex, but also since ectool was designed for debugging, ectool temps all will read each temperature from the memory map, then execute a command for each temp sensor to get it's info, and the fan speed; which is very unnecessary for this project. Unfortunately ECs are complicated and there wasn't much else you could do.

Over the past year or so, I've been working on CrOS_EC_Python, which can interact with the EC directly over /dev/cros_ec, or using the I/O ports if needed. One of the functions CrOS_EC_Python implements is cros_ec_python.commands.memmap.get_temps() which will only read the sensors from the memory map without transferring any commands.

Since CrOS_EC_Python is just another python package, this also means you won't have to worry about installing ectool. CrOS_EC_Python also supports FreeBSD, so fw-fanctrl may potentially also work on FreeBSD (with the required service configuration).

However, CrOS_EC_Python isn't the most tested library, it has only been thoroughly tested on my Framework 13 AMD 7840U, but is known to work on the Framework 13 Intel 11th Gen, and a Framework 16 (in the FW Discord). If you like this PR but are concerned about stability, feel free to drop commit 51328b1, and just make it an optional dependency.

Thanks,
Steve

@nyabinary
Copy link
Copy Markdown

cc: @leopoldhub

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.

2 participants