Open ataa opened 4 years ago
On my unit the NIC led blinks with network activity, I would assume it's wired to the NIC itself and linux is not controlling it at all. And power is constantly on.
In their published source, there are 12 LEDs to control instead of 10
What published source?
Someone has decompiled TerraMaster binary and found the addresses below, He mentioned that he managed to control Lan LED, not sure if the hardware for F5-221 and F4-220 is identical or not. On my F5-221, there are 5 two color LEDs and two green LEDs for Power and Network activity. I wanted to add two extra addresses to your module but couldn't figure out how to do it.
static phys_addr_t map_addrs[12] = {
0xfed0d1b8,
0xfed0d028,
0xfed0d0b8,
0xfed0d0d8,
0xfed0d088,
0xfed0d0a8,
0xfed0d048,
0xfed0d068,
0xfed0d018,
0xfed0d038,
0xfed0d058,
0xfed0d098
};
right now I am using your module to show service status and a simple bootup/shutdown light patterns. Also researching on how to make a simple VU meter using mpd fifo output. so being able to control two extra leds would be nice. Thank you
You could try increasing the size of hddledDevices
and hddleds
arrays at the top by one. If that works it will most likely handle NIC and power as a single bi-color LED so you will have to treat one of them as the green and the other as the red color by piping [0-3]
into /dev/hddled6
.
Thanks for quick reply, I changed them to 6 and increased the version number then build the module with dkms, now piping 0-3 to /dev/hddled6 changes LED 1 and 2. What about adding LED 11,12 addresses to the code? Does it calculate them automatically?
That actually makes sense. As is explained in the README, there are 10 addresses, the first 5 are the green LEDs and the second 5 are the red ones. So by adding another index to the array we start looking in the red LED area, my bad.
I get the base address of whatever is controlling the LEDs by calling read_base()
(this is the only code I copied straight from the source I got from Terramaster and I don't really understand it). Then to find the first green LED by adding the magic number 0xC505B8
(again, something I found in the original source). To get the first red LED I can add 0x28
to the address of the respectable green LED. Then add 0x8
to get the next green LED. This is explained a little better in the README.
I'm not sure where exactly in the address space the power and nic LEDs are though.
Hi
I believe this can help you: https://github.com/stroyan/led-drv-f4-220
I'm having issues compiling both modules on OpenMediaVault 5.6. Alhtough they work on 5.4
Thanks, I already tried that driver on my F5-221 (J3355), it does not work on mine, later found that the hardware in F4-220 (J1800) is different than mine (tmj33). With minor change in Arnarg code, I was able to compile it in kernel 5.6 upto 5.7.1, I can only control 5 HDD LEDs. Have you managed to control power/nic LED?
Thanks
Just forked it : https://github.com/cinzas/led-drv-f4-220
I can now compile on omv 5.6.
I can control the nic led.
Someone has decompiled TerraMaster binary and found the addresses below, He mentioned that he managed to control Lan LED, not sure if the hardware for F5-221 and F4-220 is identical or not. On my F5-221, there are 5 two color LEDs and two green LEDs for Power and Network activity. I wanted to add two extra addresses to your module but couldn't figure out how to do it.
static phys_addr_t map_addrs[12] = { 0xfed0d1b8, 0xfed0d028, 0xfed0d0b8, 0xfed0d0d8, 0xfed0d088, 0xfed0d0a8, 0xfed0d048, 0xfed0d068, 0xfed0d018, 0xfed0d038, 0xfed0d058, 0xfed0d098 };
right now I am using your module to show service status and a simple bootup/shutdown light patterns. Also researching on how to make a simple VU meter using mpd fifo output. so being able to control two extra leds would be nice. Thank you
Can you share those scripts you have? I am looking to do something similar on mine.
TerraMaster source listed 2 extra LEDs, how can I add them to your modules?
In their published source, there are 12 LEDs to control instead of 10: