Openwrt MT7628 wifi 指示灯设置

1.需求

         openwrt系统下,将普通GPIO和wifi关联起来

         wifi启动,灯亮  wifi有数据传输,灯闪烁   wifi关闭,灯灭

2.设置

       1.dts配置gpio

gpio-leds {
          compatible = "gpio-leds";
 
          wlan {
              label = "openwrt:red:wlan";
              gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
          };
      };

     2.将GPIO和wifi关联起来,修改/etc/config/system

config led 'led_wifi_led'
        option name 'wifi'
        option sysfs 'openwrt:red:wlan'
        option trigger 'netdev'
        option mode 'link tx rx'
        option dev 'ra0'     

备注:

     ra0对应的网络的接口

你可能感兴趣的:(Openwrt)