Discussion:
[OpenWrt-Users] LED support for WIFI
Farid Farid
2015-02-18 20:13:01 UTC
Permalink
Hi Everyone,
I have a question about LED pattern for WIFI. I am using Openwrt Barrier Breaker - kernel 3-10-xx
Is there anyway to tie a GPIO' Led to hostapd or wpa_supplicant in order to have proper LED pattern for WIFI?Do these utility drive any GPIO ?
I am using hostapd-20130807
And  another question :
I know there is LED support in Kernel  ( kmod-leds) . In my system I do have all LEDs defined in /sys/class/gpio/gpioxx/
How can I map kernel LED driver on  my LED lines?
Thanks for the help,Farid
Pavel Volkov
2015-03-02 16:56:07 UTC
Permalink
Post by Farid Farid
Hi Everyone,
I have a question about LED pattern for WIFI. I am using
Openwrt Barrier Breaker - kernel 3-10-xx
Is there anyway to tie a GPIO' Led to hostapd or wpa_supplicant
in order to have proper LED pattern for WIFI?Do these utility
drive any GPIO ?
I am using hostapd-20130807
I know there is LED support in Kernel ( kmod-leds) . In my
system I do have all LEDs defined in /sys/class/gpio/gpioxx/
How can I map kernel LED driver on my LED lines?
For my router I've put this into /etc/config/system:

config led wlan_led
option name 'WLAN'
option sysfs 'bcm47xx:blue:wlan'
option trigger 'netdev'
option dev 'wlan0'
option mode 'link tx rx'

You should replace with your LED's name from /sys.
Farid Farid
2015-03-03 17:43:52 UTC
Permalink
Thanks Pavel for your reply.
What is option sysfs means? Is it the path to /sys/class/leds/?
Post by Farid Farid
ls   /sys/class/leds/wifired
brightness      device          max_brightness  subsystem       trigger         uevent

what should I put in sysfs for this LED?
Here is the content of trigger for this LED. I am wonder if it is correct.
Post by Farid Farid
cat /sys/class/leds/wifired/trigger
[none] nand-disk mmc0 timer oneshot heartbeat backlight gpio cpu0 default-on transient


Thanks again.
Farid
Post by Farid Farid
Hi Everyone,
I have a question about LED pattern for WIFI. I am using
Openwrt Barrier Breaker - kernel 3-10-xx
Is there anyway to tie a GPIO' Led to hostapd or wpa_supplicant
in order to have proper LED pattern for WIFI?Do these utility
drive any GPIO ?
I am using hostapd-20130807
I know there is LED support in Kernel  ( kmod-leds) . In my
system I do have all LEDs defined in /sys/class/gpio/gpioxx/
How can I map kernel LED driver on  my LED lines?
For my router I've put this into /etc/config/system:

config led wlan_led
        option name 'WLAN'
        option sysfs 'bcm47xx:blue:wlan'
        option trigger 'netdev'
        option dev 'wlan0'
        option mode 'link tx rx'

You should replace with your LED's name from /sys.
Pavel Volkov
2015-03-03 19:22:32 UTC
Permalink
Post by Farid Farid
What is option sysfs means? Is it the path to /sys/class/leds/?
Yes, in your case it will be 'wifired'.
Post by Farid Farid
Here is the content of trigger for this LED. I am wonder if it is correct.
cat /sys/class/leds/wifired/trigger
[none] nand-disk mmc0 timer oneshot heartbeat backlight gpio
cpu0 default-on transient
You don't have "netdev" listed as a trigger so I think you should install
kmod-ledtrig-netdev first.
Mine looks like this:
# cat /sys/class/leds/bcm47xx\:blue\:wlan/trigger
none nand-disk timer default-on [netdev] phy0rx phy0tx phy0assoc phy0radio
Farid Farid
2015-03-03 19:56:03 UTC
Permalink
Thanks Pavel.
I can't even see any phy0xx in trigger. Where do they come from?
I do have kmod-ledtrig-netdev installed.( at least  opkg list shows the package) 
Here is also the device tree for that LED:
  user {            label ="wifired"            gpios = <&gpio5 23 0>            default-state ="on"             linux,default-trigger = "netdev"}
Thanks,Farid
Post by Farid Farid
What is option sysfs means? Is it the path to /sys/class/leds/?
Yes, in your case it will be 'wifired'.
Post by Farid Farid
Here is the content of trigger for this LED. I am wonder if it is correct.
cat /sys/class/leds/wifired/trigger
[none] nand-disk mmc0 timer oneshot heartbeat backlight gpio
cpu0 default-on transient
You don't have "netdev" listed as a trigger so I think you should install
kmod-ledtrig-netdev first.
Mine looks like this:
# cat /sys/class/leds/bcm47xx\:blue\:wlan/trigger
none nand-disk timer default-on [netdev] phy0rx phy0tx phy0assoc phy0radio
Pavel Volkov
2015-03-04 06:26:17 UTC
Permalink
Post by Farid Farid
Thanks Pavel.
I can't even see any phy0xx in trigger. Where do they come from?
I do have kmod-ledtrig-netdev installed.( at least opkg list
shows the package)
user { label ="wifired" gpios = <&gpio5
23 0> default-state ="on"
linux,default-trigger = "netdev"}
Thanks,Farid
Hmm, I don't know what else to suggest, maybe it's not supported by your
hardware.
I also run another OpenWRT both with a different chip (Atheros, not
Broadcom).
These are its selected LED triggers:

# cat /sys/class/leds/tp-link\:green\:wlan/trigger
none timer default-on netdev gpio heartbeat morse oneshot phy0rx phy0tx
phy0assoc phy0radio [phy0tpt]

# cat /sys/class/leds/tp-link\:green\:lan/trigger
none timer default-on [netdev] gpio heartbeat morse oneshot phy0rx phy0tx
phy0assoc phy0radio phy0tpt

Wiki is not very detailed about it:
http://wiki.openwrt.org/doc/uci/system#wifi_activity

Loading...