OpenWrt Forum Archive

Topic: DIR-300 B1 LEDs

The content of this topic has been archived on 29 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,
my DIR-300B1 was unable to control WAN led indicator, so I decided to fix this.
The only bad thing after patch - it dosnt light WAN led on cable plug at all, you need to set it manually via  /sys/class/leds/d-link:amber:wan/brightness or  /sys/class/leds/d-link:green:wan/brightness via script or luci leds triggers.

...
#define DIR_300B_GPIO_LED_WAN_AMBER    14
#define DIR_300B_GPIO_LED_WAN_GREEN    12
...

...
    , {
        .name        = "d-link:amber:wan",
        .gpio        = DIR_300B_GPIO_LED_WAN_AMBER,
        .active_low    = 1,
    }, {
        .name        = "d-link:green:wan",
        .gpio        = DIR_300B_GPIO_LED_WAN_GREEN,
        .active_low    = 1,
    },
...

these changes go to https://dev.openwrt.org/browser/trunk/t … 300-revb.c
sorry, I dont know how to exactly create a patch, so I'll post just changes and somebody maybe formalize if find it useful.

Oh, thats how unix-way works - you watch 40minutes lecture to make one 1kb patch.. tongue
I know how to diff two files, but no idea how the resulting patch will fit in openwrt's own building infrastructure.
Anyways, thank you.

why the dir-300 revb developer doesn't repair this led issue.
i cannot understand! they do not brower form?

There are more important issues than making the shiny leds blink, like making stuff work at all.
If there is no ticket yet, make one. If there is one already then wait.

I included the fix in my local trunk and ran "make". After that I upgraded my router with the latest build, but I can not control the wan leds:

root @ OpenWrt /sys/class/leds # ll
drwxr-xr-x    2 root     root           0 Jan  1  1970 .
drwxr-xr-x   17 root     root           0 Jan  1  1970 ..
lrwxrwxrwx    1 root     root           0 Jan  1  1970 d-link:amber:status -> ../../devices/platform/leds-gpio/leds/d-link:amber:status
lrwxrwxrwx    1 root     root           0 Jan  1  1970 d-link:blue:wps -> ../../devices/platform/leds-gpio/leds/d-link:blue:wps
lrwxrwxrwx    1 root     root           0 Jan  1  1970 d-link:green:status -> ../../devices/platform/leds-gpio/leds/d-link:green:status
lrwxrwxrwx    1 root     root           0 Jan  1  1970 rt2800pci-phy0::assoc -> ../../devices/platform/rt2800_wmac.0/leds/rt2800pci-phy0::assoc
lrwxrwxrwx    1 root     root           0 Jan  1  1970 rt2800pci-phy0::quality -> ../../devices/platform/rt2800_wmac.0/leds/rt2800pci-phy0::quality
lrwxrwxrwx    1 root     root           0 Jan  1  1970 rt2800pci-phy0::radio -> ../../devices/platform/rt2800_wmac.0/leds/rt2800pci-phy0::radio

Do I need to include special packages into my image to make this work?

Has somebody tried this fix? Are there any other results then mine?

The discussion might have continued from here.