Source code for LED control on WNR3500L

4 posts / 0 new
Last post
Evil.2000
Evil.2000's picture
Source code for LED control on WNR3500L
/* Control the LEDs on the WNR3500L Router
 * (C) David Schueler, 2010, [email protected]
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307USA
 *
 *
 */

#include 
#include 
#include 
#include 
#include 
#include 

/* linux stuff */
typedef u_int64_t uint64;
typedef u_int32_t uint32;
typedef u_int16_t uint16;
typedef u_int8_t uint8;

#include 

#define WLAN	0	/* WLAN led */
#define WPS	1	/* WPS button led */
#define WAN	2	/* i led (green if on, orange if off) */
#define PWRGRN	3	/* Power led (green if on) */
#define PWRRED	7	/* Power led (orange if on) */

void
print_usage()
{
	printf("ledctl power_orange|power_green|wan_green|wlan|wps on|off|1|0\n");
	exit(0);
}

int
main(int argc, char **argv)
{
	int fd, i;
	uint16 pin, sta;
	struct gpio_ioctl gpioioc;

	if (argc 
Evil.2000
Evil.2000's picture
Testet with Openwrt Kamikaze
Testet with Openwrt Kamikaze (2.4.35.4 Kernel)

Or you may download the IPK from
http://evil.madrax.de/ledctl_0.1-1_mipsel.ipk

Sourcecode package for you own build:
http://evil.madrax.de/ledctl_0.1.tar.gz

Place in packages folder of openwrt build environment
run "make menuconfig" and select
Utilities  --->
 ledctl..................... Tool for controlling leds on WNR3500L
Evil.2000
Evil.2000's picture
No, Yes, No, No ;-)

No, Yes, No, No ;-)

What do you mean with Reset and USB LED? The WNR3500L does not have any USB or Reset LED.

As you can see on the source code its only WLAN, WPS, WAN and POWER LED at the moment. I did not go any deeper into the details. Maybe later.

Evil.2000
Evil.2000's picture
The WNR3500L definitely does

The WNR3500L definitely does not have any USB led.

The LAN/Ethernet LEDs are driven by the BCM53115S ethernet chip directly. It has an internal register to set the color and blinking of the LEDs. But at the moment i'm not able to control it.

So little time, too much code ;-)