aleksamagicka / aquacomputer_d5next-hwmon

Linux hwmon driver for select Aquacomputer devices. Partly mainlined.
GNU General Public License v2.0
60 stars 8 forks source link

Adding support for High Flow Next #8

Closed pladux closed 2 years ago

pladux commented 2 years ago

Would it be possible to add support for the High Flow Next flow meter?

https://github.com/medevil84/FanControl.AquacomputerHighFlowNext might be helpful.

aleksamagicka commented 2 years ago

Looks doable, just need to be careful with the offsets. Though I'd like someone to test the code once it's implemented, as I don't have one.

For the record, product ID is 0xF012.

pladux commented 2 years ago

I'd be glad to help where I can. I have already tried to add support by myself but I got stuck on getting the offsets.

aleksamagicka commented 2 years ago

Thanks. I'll create a separate branch for this when I start working on it (this month or the next one, most likely, because of college finals). It's going to require some bigger changes to the driver, because right now it assumes that voltages and power come together with fans and fan speed, and the High Flow Next provides values directly, since it has no fans. Not a problem per se, just have to separate those and of course, confirm that the offsets are OK.

aleksamagicka commented 2 years ago

I've created a new branch called highflownext for this. Please have a look and test, and report back if there are any issues or segfaults. I've exposed some of the values as fans to make it easier to test and see if they're usable, and the rest as temperature/power/voltage.

Here is the schema I've been looking at, looks correct to me (judging by the first two sections, at least):

IsValid, offset: 0
Version, offset: 1
Serial, offset: 3
Hardware, offset: 7
DeviceType, offset: 9
Bootloader, offset: 11
Firmware, offset: 13

SystemState, offset: 15
Features, offset: 19
Time, offset: 20
PowerCycles, offset: 24
RuntimeTotal, offset: 28
_Unknown00, offset: 32
Language, offset: 34

_Unknown00, offset: 35
_Unknown01, offset: 47
_Unknown02, offset: 63
FlowRaw, offset: 71
FlowCalibration, offset: 75
_Unknown03, offset: 77
SensorDiff, offset: 79
FlowWithoutUserCompensation, offset: 81
Flow, offset: 83
TemperatureWater, offset: 85
TemperatureExt, offset: 87
WaterQuality, offset: 89
Power, offset: 91
ConductivityUncompensate, offset: 93
Conductivity, offset: 95
Vcc5, offset: 97
Vcc5usb, offset: 99
Volume, offset: 101
ImpulseCounter, offset: 105
CounterTime, offset: 109
_Unknown04, offset: 113
_Unknown05, offset: 117
CurrentProfile, offset: 121
_Unknown06, offset: 122
_Unknown07, offset: 126
_Unknown08, offset: 130
_Unknown09, offset: 132
_Unknown10, offset: 148
pladux commented 2 years ago

Thanks. I'll try it out by the end of next week.

aleksamagicka commented 2 years ago

Just leaving this image from hwinfo64 forums here so I have an overview of value units for later:

pladux commented 2 years ago
$ sensors
highflownext-hid-3-13
Adapter: HID adapter
Vcc5:                          4.77 V  
Vcc5usb:                       4.98 V  
FlowRaw:                     32767 RPM
FlowCalibration:              935 RPM
SensorDiff:                  32767 RPM
FlowWithoutUserCompensation: 10000 RPM
Flow:                           0 RPM
WaterQuality:                 477 RPM
ConductivityUncompensate:       7 RPM
Conductivity:                26035 RPM
TemperatureWater:             +35.8°C  
TemperatureExt:                   N/A  
Power:                         0.00 W

Voltage and temperatures seems to be working. I'm unsure about the RPM values. Flow should be around 94 L/h.

aleksamagicka commented 2 years ago

Thanks. So usable ones seem to be:

Not sure what's going on with Power, maybe it's too small or the offset is somehow wrong.

I think RPM readings in hwmon don't support fractions, so I believe that the solution is that we note the units as they are shown. For example, Conductivity should be Conductivity [nS/cm], if I'm not mistaken. I'll write here once I've pushed the changes.

aleksamagicka commented 2 years ago

I've pushed a new commit, removing non-useful sensors. I've also added printing the raw power value that's read from the sensor report into the debugfs call for showing the serial number, just for the High Flow Next. You can find debugfs under /sys/kernel/debug as root, there will be a directory for the device. Please test and report back.