| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision |
| docs:guide-user:base-system:led_configuration [2020/06/14 08:18] – [Network Activity] New parameter: interval . sopalajoarrierez | docs:guide-user:base-system:led_configuration [2022/02/07 22:45] – [Leds section] clean-up palebloodsky |
|---|
| ====== LED configuration /etc/config/system ====== | ====== LED Configuration ====== |
| The LED configuration is located in **system** uci subsystem, and written in the **///etc/config/system//** file. | The LED configuration is located in **system** uci subsystem, and written in the **///etc/config/system//** file. |
| |
| ===== Leds section ===== | ===== Led section ===== |
| The leds section contains settings that apply to non-default leds\\ | The led section contains settings that apply to non-default leds.\\ |
| (default leds are usually "power connected" led, "system alive" led, leds showing ethernet port activity and leds showing wifi radio status. Their settings are defined somewhere else, see development guides) | Default leds are usually power on, ethernet port activity, usb port activity, and wifi radio activity. |
| |
| This is an example of leds on a tp-link router with usb port. | This is an example of leds on a tp-link router with usb port. |
| |//sysfs// |string |yes |//(none)//|LED device name | | |//sysfs// |string |yes |//(none)//|LED device name | |
| |//port_mask//|integer|no |0 |Hexadecimal bit mask that encodes the regarded switch ports | | |//port_mask//|integer|no |0 |Hexadecimal bit mask that encodes the regarded switch ports | |
| | |//speed_mask//|integer |no |//(none)//|Hexadecimal bit mask that filters ethernet speeds | |
| |//trigger// |string |yes |//(none)//|//switch0// | | |//trigger// |string |yes |//(none)//|//switch0// | |
| |
| Consider for example a ''port_mask'' of ''0x1e'', which is ''00011110'' in binary. From right to left, this excludes CPU, includes four switch ports and sets the remaining bits to 0 to exclude further ports (e.g. because there are no more physical ports). | Consider for example a ''port_mask'' of ''0x1e'', which is ''00011110'' in binary. From right to left, this excludes CPU, includes four switch ports and sets the remaining bits to 0 to exclude further ports (e.g. because there are no more physical ports). |
| |
| | ''speed_mask'' assigns a bit for standard BASE-T speeds. With this it's possible to trigger an LED only on specific speeds, for example amber for 100mbps and green for gigabit. |
| | |
| | Bit assignments for ''speed_mask'' are as follows: |
| | * [0] 0x01 - Unknown speed or cable/link problem |
| | * [1] 0x02 - 10BASE-T |
| | * [2] 0x04 - 100BASE-T |
| | * [3] 0x08 - 1000BASE-T |
| | * bits 4-7 reserved for future expansion and dont do anything. |
| | |
| | For example a ''speed_mask'' of ''0x0C'', which is ''00001100'' in binary, will only trigger the LED when the speed is 100BASE-T or 1000BASE-T. We can then apply the inverse ''0x03'' (binary ''00000011'') to another LED, effectively getting different colors/leds to flash depending on the connection speed. |
| ==== Timer ==== | ==== Timer ==== |
| The LED blinks with the configured on/off frequency.\\ | The LED blinks with the configured on/off frequency.\\ |
| |//sysfs// |string |yes |//(none)//|LED device name | | |//sysfs// |string |yes |//(none)//|LED device name | |
| |//trigger//|string |yes |//(none)//|//netdev// | | |//trigger//|string |yes |//(none)//|//netdev// | |
| |//interval//|? |? |//(none)//|FIXME Example value: '50' | | |//interval//|integer|no |//(none)//|The duration of the LED blink in milliseconds. For example: //50//| |
| |
| ==== WiFi Activity triggers ==== | ==== WiFi Activity triggers ==== |