Skip to content

Commit

Permalink
bulk:
Browse files Browse the repository at this point in the history
- multi-hub support
- cpu temperature profiles
- gpu temperature profiles
- rgb per device
- static temperature profiles
- WebUI and API changes
- automatic profile generation
- simplified configuration
  • Loading branch information
jurkovic-nikola committed Jun 30, 2024
1 parent d1af4af commit ac3105f
Show file tree
Hide file tree
Showing 121 changed files with 24,257 additions and 2,972 deletions.
237 changes: 27 additions & 210 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# OpenLinkHub interface for Linux
Open source interface for iCUE LINK Hub device and Linux with built-in API for overview and device control.
Open source Linux interface for iCUE LINK Hub and other devices.

![Build](https://github.com/jurkovic-nikola/OpenLinkHub/actions/workflows/go.yml/badge.svg)

Expand All @@ -9,27 +9,13 @@ Open source interface for iCUE LINK Hub device and Linux with built-in API for o
- This project was created out of own necessity to control fans and pumps on workstations after switching everything to Linux.
- I take no responsibility for this code at all. Use this at your own risk.
- Most of the devices are actually tested on live hardware.
- OpenLinkHub supports multiple devices.
- Take care and have fun!
## Supported hubs
## Supported devices

| Device | VID | PID |
|----------------------|--------|--------|
| iCUE LINK System Hub | `1b1c` | `0c3f` |

## Operating Modes
### Software operating mode
OpenLinkHub supports two operating modes:
- Standalone mode will automatically monitor your CPU temperature and adjust fan and pump speeds based on the defined temperature curve.
- Manual mode will allow you to use the REST to control devices.
- This mode can be used to integrate this into your custom UI application.
- You will have full control over fans and pumps.

### Fan operating modes
- Fans support 2 different operating modes:
- Mode 0: Speed is controlled via percentage (from 20-100).
- Mode 1: Speed is controlled via RPM (from 400-2400+).
### Pump operating modes:
- Pump speed can be controlled only via percentage.
| Device | VID | PID | Sub Devices |
|------------------------|--------|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| iCUE LINK System Hub | `1b1c` | `0c3f` | QX Fan<br />RX Fan<br/>RX RGB Fan<br/>H100i<br/>H115i<br/>H150i<br/>H170i<br/>XC7 Elite<br/>XG7<br/>XD5 Elite<br/>XD5 Elite LCD | |

## Installation
### Requirements
Expand Down Expand Up @@ -60,52 +46,14 @@ sudo udevadm control --reload-rules && sudo udevadm trigger
## Configuration
```json
{
"vendorId": "1b1c",
"productId": "0c3f",
"standalone": true,
"listenPort": 27003,
"defaultFanValue": 50,
"defaultPumpValue": 80,
"listenAddress": "127.0.0.1",
"pullingIntervalMs": 1000,
"serial": "5C126A3EB51A39569ABADC4C3A1FCF54",
"headers": [
{ "key":"Content-Type", "value": "application/json" }
],
"cpuSensorChip": "k10temp-pci-00c3",
"cpuPackageIdent": "Tctl",
"templateList": "overview.html"
"cpuPackageIdent": "Tctl"
}
```
- vendorId: ID of device vendor
- productId: ID of a device
- standalone: The program will independently monitor CPU temperature and adjust fan and pump speed based on temperatureCurve array.
- listenPort: HTTP server port.
- defaultFanChannelSpeed: Default percentage of fan speed when the application is running.
- defaultPumpChannelSpeed: Default percentage of pump speed when the application is running.
- listenAddress: Address for HTTP server to listen on.
- pullingIntervalMs: How often data is pulled from a device (rpm, temperature) in milliseconds
- serial: Device serial number (iSerial bellow)
```bash
$ lsusb -d 1b1c:0c3f -v

Bus 003 Device 007: ID 1b1c:0c3f Corsair iCUE LINK System Hub
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x1b1c Corsair
idProduct 0x0c3f
bcdDevice 1.00
iManufacturer 1 Corsair
iProduct 2 iCUE LINK System Hub
iSerial 3 2EFBD3CFCADF4050A3557CBC5159A599
```
- headers: Default http headers
- cpuSensorChip: CPU sensor chip for temperature
```bash
$ sensors
Expand All @@ -116,46 +64,33 @@ Tccd1: +33.8°C
Tccd2: +31.2°C
```
- cpuPackageIdent: CPU package key (see sensors above)
- templateList: HTML templates
## temperatures.json
- temperaturePullingIntervalMs: How ofter temperature is read from CPU sensor (in milliseconds)
- temperatureCurve: Array of temperature curves for fan and pump speed.
- min / max: Range of CPU temperature
- mode:
- 0: Percent
- 1: RPM
- fans: fan speed
- pump: pump speed
- channelIds: list of channel IDs for which a temperature curve applies.
- This is useful to ramp up other fans when a certain temperature is reached. If left empty, speed setting will be applied to all channels by default.
- You can use this ability to create positive pressure in case and reduce dust.
- For AIO, usually fans and pump
- For custom loop, Pump/Res combo and fans
- color: RGB color for specified temperature range.
- This is useful when the temperature reaches critical level on your system.
- Making color array empty will disable RGB changes via temperature level.
- It Can be used to modify your device color per temperature range
## custom.json
- useCustomChannelIdColor: if set to true, default color will be ignored, and you will be able to define color for each device
- config example contains multiple channelIds, aka "1", "13", "14" and "15"
- those IDs are from `curl http://127.0.0.1:27003 --silent | jq` under devices section.
- Each ID is channelId connected to a iCUE Link Hub
- This mode will be ignored if rgbMode is defined
- useCustomChannelIdSpeed: is set to true, each device will have a static speed defined in config.
- In this mode, a standalone flag is ignored and CPU monitoring is not enabled.
### How to identify channels?
- In most cases, your channel will have a name
- In cases of FANs, the best way to identify a channel is to set custom color on each channel.

## Device Dashboard
- Simple Device Dashboard is accessible by browser via link `http://127.0.0.1:27003/`
- Device Dashboard:
- System Overview
- Device Overview:
- Change temperature profile per channel
- Change RGB mode per device
- RGB Overview:
- Update existing RGB modes
- Temperature Overview:
- Create new profiles
- Update existing profiles
- Delete existing profile
- General dashboard settings
- You should use Device Dashboard for any configuration
- Bootstrap 5 Dark Admin template

## RGB Modes
- RGB configuration is located at `rgb.json` file.
- RGB configuration is located at `database/rgb.json` file.
### Configuration
- defaultColor: Default RGB color for all devices in integer format
- 255,255,255, 0.1 - White with 10 % of brightness
- 255,255,255, 0.5 - White with 50 % of brightness
- 255,255,255, 1 - White with 100 % of brightness
- Note: Setting brightness to 0 will result in no color on a device
- This mode will be ignored if rgbMode is defined
- useRgbEffects: Trigger usage of custom RGB effects
- rgbMode: This will enable custom RGB mode for all devices.
- If this mode is enabled, REST API color modification is not possible.
- rgbModes: Custom RGB mode data
Expand All @@ -177,7 +112,6 @@ Tccd2: +31.2°C
- flickering
- colorwarp
- snipper
- heartbeat
- `rainbow` - Self explanatory, rainbow colors
- `watercolor` - Self explanatory, water colors
- `colorshift` - Shifts color from field `start` to `end`
Expand All @@ -187,127 +121,10 @@ Tccd2: +31.2°C
- `flickering` - Will randomly turn LEDs off per cycle
- `colorwarp` - Will warp two colors on every device
- `snipper` - Single LED spinning around all devices
- `heartbeat` - Heartbeat

## Device Dashboard
- Simple Device Dashboard is accessible by browser via link `http://127.0.0.1:27003/ui`
- Device Dashboard is currently WIP (basic system and device overview)
- Bootstrap 5 Dark Admin template
## API
- OpenLinkHub ships with built-in HTTP server for device overview and control.
### Overview
```bash
$ curl http://127.0.0.1:27003 --silent | jq
{
"code": 200,
"device": {
"Manufacturer": "Corsair",
"Product": "iCUE LINK System Hub",
"Serial": "2EFBD3CFCADF4050A3557CBC5159A599",
"Firmware": "2.4.438",
"devices": {
"1": {
"channelId": 1,
"deviceId": "0100282F8203582BFB00018643",
"name": "QX Fan",
"rpm": 962,
"temperature": 27.8
},
"2": {
"channelId": 2,
"deviceId": "0100136032035898E90000555B",
"name": "QX Fan",
"rpm": 967,
"temperature": 28.9
},
"3": {
"channelId": 3,
"deviceId": "0292D70F00AEA4610336A80000",
"name": "H150i",
"rpm": 1564,
"temperature": 27.9
},
"4": {
"channelId": 4,
"deviceId": "0100136032035898E900007609",
"name": "QX Fan",
"rpm": 966,
"temperature": 29.3
}
}
}
}
```
### List of devices
```bash
$ curl http://127.0.0.1:27003/devices --silent | jq
{
"code": 200,
"devices": {
"1": {
"channelId": 1,
"deviceId": "0100282F8203582BFB00018643",
"name": "QX Fan",
"rpm": 1207,
"temperature": 28.1
},
"2": {
"channelId": 2,
"deviceId": "0100136032035898E90000555B",
"name": "QX Fan",
"rpm": 1213,
"temperature": 29
},
"3": {
"channelId": 3,
"deviceId": "0292D70F00AEA4610336A80000",
"name": "H150i",
"rpm": 1908,
"temperature": 27.9
},
"4": {
"channelId": 4,
"deviceId": "0100136032035898E900007609",
"name": "QX Fan",
"rpm": 1210,
"temperature": 29.4
}
}
}
```
### Modify device speed by percent
```bash
$ curl -X POST http://127.0.0.1:27003/speed -d '{"channelId":1,"mode":0,"value":80}' --silent | jq
{
"code": 200,
"message": "Device speed successfully changed"
}
```
### Modify device speed by RPM
```bash
$ curl -X POST http://127.0.0.1:27003/speed -d '{"channelId":1,"mode":1,"value":1800}' --silent | jq
{
"code": 200,
"message": "Device speed successfully changed"
}
```
### Modify device color - specific channel
```bash
$ curl -X POST http://127.0.0.1:27003/color -d '{"channelId":1,"color": {"red": 255, "green": 0, "blue": 0, "brightness": 1}}' --silent | jq
{
"code": 200,
"message": "Device color successfully changed"
}
```
### Modify device color - all channels
```bash
$ curl -X POST http://127.0.0.1:27003/color -d '{"channelId":0,"color": {"red": 255, "green": 0, "blue": 0, "brightness": 1}}' --silent | jq
{
"code": 200,
"message": "Device color successfully changed"
}
```

- Documentation is available at `http://127.0.0.1:27003/docs`
## Automatic startup
### systemd config
- This is a plain basic systemd example to get you running. You can create systemd service how you like.
Expand Down
6 changes: 6 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"listenPort": 27003,
"listenAddress": "127.0.0.1",
"cpuSensorChip": "k10temp-pci-00c3",
"cpuPackageIdent": "Tctl"
}
17 changes: 0 additions & 17 deletions configs/config.json

This file was deleted.

Loading

0 comments on commit ac3105f

Please sign in to comment.