Netgear R6700v3 - Night Mode - Turn off leds

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
Baja
DD-WRT Novice


Joined: 22 Dec 2008
Posts: 35

PostPosted: Sun May 10, 2020 22:16    Post subject: Netgear R6700v3 - Night Mode - Turn off leds Reply with quote
Hi,

DD-WRT v3.0-r43099 std (05/09/20)

Anyone have Night Mode working on their R6700v3 by chance?

Netgear AC1750 R6700v3:

https://wiki.dd-wrt.com/wiki/index.php/Netgear_R6700v3

(nearly identical to r6400v2)

https://wiki.dd-wrt.com/wiki/index.php/Netgear_R6400v2

I've looked over a few posts that may help lead the way, although they are for different routers:

https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1147012

https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1144793


For the R7000:

https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1061304
Sponsor
Baja
DD-WRT Novice


Joined: 22 Dec 2008
Posts: 35

PostPosted: Sun May 10, 2020 23:42    Post subject: Reply with quote
I've had some success with the following:
Code:

for i in 1 2 8 9 12 13 ; do gpio enable $i; done
for i in 10 11 ; do gpio disable $i ; done


I'll have to play around with the numbers a bit, however, as some are being shut off, whereas others are not.

I get an error with this:
Code:

for i in 1 2 8 9 12 13 ; do gpio enable $i; done
for i in 10 11 ; do gpio disable $i ; done
et robowr 0x0 0x16 0x0


/tmp/custom.sh: line 3: et: not found
Baja
DD-WRT Novice


Joined: 22 Dec 2008
Posts: 35

PostPosted: Mon May 11, 2020 3:34    Post subject: Reply with quote
This is a work in progress. I'll update again after more discovery and testing.

Lights in order from left to right based on router itself

Code:


GPIO #    LED       Notes
0
1      Power      Enable/Disable LED (gpio enable 1 turns led off)
2      Power      Toggle Led Coler (White/Amber)
3
4
5      Reset      Full Reset (gpio disable 5 resets router - or maybe it was enable, I forget now; requires user/password update; not an led, obviously)
6      Internet   Enable/Disable Led (gpio enable 6 turns led off)
7      Internet   Toggle Led Color (White/Amber)

?      Ethernet 1
?      Ethernet 2
?      Ethernet 3
?      Ethernet 4

8      2.4 GHz      Enable/Disable Led (gpio enable 8 turns led off)
9      5 GHz      Enable/Disable Led (gpio enable 9 turns led off)
12      Guest WiFi    Enable/Disable Led (gpio enable 12 turns led off)
13      USB 3.0      Enable/Disable Led (gpio enable 13 turns led off)
10      WiFi On/Off   Enable/Disable Led (gpio disable 10 turns led off)
11      WPS         Enable/Disable Led (gpio disable 11 turns led off)


Last edited by Baja on Mon May 11, 2020 17:14; edited 8 times in total
Baja
DD-WRT Novice


Joined: 22 Dec 2008
Posts: 35

PostPosted: Mon May 11, 2020 3:36    Post subject: Reply with quote
jxm wrote:
Put this in your startup script on the Administration / Commands tab

#!/bin/sh
#
for i in 2 3 8 9 12 13 17 18 ; do gpio enable $i ; done
for i in 14 15 ; do gpio disable $i ; done
et robowr 0x0 0x18 0x1ff
et robowr 0x0 0x18 0x0
et robowr 0x0 0x1a 0x0
et robowr 0x0 0x16 0x0

Save and reboot.

Cheers


Thanks jxm!

I submitted my last before I saw your post. Going to give this a go.
Baja
DD-WRT Novice


Joined: 22 Dec 2008
Posts: 35

PostPosted: Mon May 11, 2020 4:37    Post subject: Reply with quote
Okay, This is what's working so far, based on my above discovery:

Code:

#!/bin/sh
#
for i in 1 6 8 9 12 13 ; do gpio enable $i ; done
for i in 10 11 ; do gpio disable $i ; done


The following still gives me errors:
Code:

et robowr 0x0 0x18 0x1ff
et robowr 0x0 0x18 0x0
et robowr 0x0 0x1a 0x0
et robowr 0x0 0x16 0x0


I assume those are for the Eth. ports 1-4? I've yet to get those turned off.

@jxm enable 17, 18 and disable 14, 15 did nothing.
Baja
DD-WRT Novice


Joined: 22 Dec 2008
Posts: 35

PostPosted: Mon May 11, 2020 5:50    Post subject: Reply with quote
Since et wasn't included in the build I'm using (and why my initial error), I grabbed it from here:

https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1181821 (I'm attaching a copy for convenience and future reference.)

Initially I tried installing et to /tmp but, it was gone on reboot so, I turned on and cleaned JFFS and rebooted per the following instructions (I had plenty of space)

https://wiki.dd-wrt.com/wiki/index.php/JFFS_File_System#Directions_for_.28normal.29_users:_using_Web-GUI_Interface

After wget the et file into the /jffs directory and chmod +x it and setting the path in the startup script etc. all seems to be working well:

Code:
#!/bin/sh
#
for i in 1 6 8 9 12 13 ; do gpio enable $i ; done
for i in 10 11 ; do gpio disable $i ; done
/jffs/et robowr 0x0 0x18 0x1ff
/jffs/et robowr 0x0 0x18 0x0
/jffs/et robowr 0x0 0x1a 0x0
/jffs/et robowr 0x0 0x16 0x0



et.zip
 Description:

Download
 Filename:  et.zip
 Filesize:  5.25 KB
 Downloaded:  228 Time(s)



Last edited by Baja on Wed Nov 10, 2021 3:18; edited 2 times in total
@m0eb@
DD-WRT User


Joined: 26 Dec 2015
Posts: 289

PostPosted: Sun Aug 09, 2020 3:26    Post subject: LAN1 light neved goes OFF Reply with quote
Connect your ethernet cable to LAN connection 1. Let the light be ON indicating that there is a connection.

Then run your commands.Does the LAN1 LED go off?
Have you checked this? (Because when no cable is connected, this light is naturally off, and the commands will seem to work.)

This light never goes off - even after running the commands you posted and that is my specific problem for past 2 years. Not a big problem, but something I am yet to see a solution for.

And if you are using Kong's dd-wrt, et is included by default.

_________________
PROFESSIONAL STUDENT
my.Mistakes my.Learning ... provided I have the patience & persistence to learn
Baja
DD-WRT Novice


Joined: 22 Dec 2008
Posts: 35

PostPosted: Sun Aug 09, 2020 3:53    Post subject: Re: LAN1 light neved goes OFF Reply with quote
@m0eb@ wrote:
Connect your ethernet cable to LAN connection 1. Let the light be ON indicating that there is a connection.

Then run your commands.Does the LAN1 LED go off?
Have you checked this? (Because when no cable is connected, this light is naturally off, and the commands will seem to work.)

This light never goes off - even after running the commands you posted and that is my specific problem for past 2 years. Not a big problem, but something I am yet to see a solution for.

And if you are using Kong's dd-wrt, et is included by default.


I think you're right about Lan Port 1. It's orange and flashing when something is plugged in, where as the other 3 are turned off.

Can I assume this is the line for the first lan port?
Code:
/jffs/et robowr 0x0 0x18 0x1ff


Perhaps it's not correct? Would be nice to have it turned off as well but, currently I'm only using three ports, so I lucked out.

I'm using DD-WRT v3.0-r43099 std (05/09/20) and if I remember correctly, why I had to add et manually.
Baja
DD-WRT Novice


Joined: 22 Dec 2008
Posts: 35

PostPosted: Tue Nov 09, 2021 19:32    Post subject: Reply with quote
I recently updated to the latest build on my r6700v3 and had some issues getting the Ethernet leds to turn off at all, so I did some testing and I think I have it working really well now. Including the shut off of Ethernet Port 1 Led too, which is awesome! - I can use that port again lol.

Anyway, here is a gist of my discovery, including comments (which gives more context to what I'm writing here)

https://gist.github.com/Natetronn/1dbfaa6831796440bb8c2c6da14455fa

---

Changes for the et robowr commands:

What I was using in the past looked like the following, although Eth port 1 led never shut off:

Code:

/jffs/et robowr 0x0 0x18 0x1ff
/jffs/et robowr 0x0 0x18 0x0
/jffs/et robowr 0x0 0x1a 0x0
/jffs/et robowr 0x0 0x16 0x0


For this latest build (netgear-r6700v3-webflash-11-05-2021-r47618.bin) I'm now only using these two lines like so, and Eth Port 1 shuts off (hurray!):

Code:

/jffs/et robowr 0x0 0x18 0x0
/jffs/et robowr 0x0 0x1a 0x0


Note: /jffs/et robowr 0x0 0x18 0x0 - makes all 4 eth ports start to quickly flash white and this /jffs/et robowr 0x0 0x1a 0x0 turned them all off, including eth port 1.

Also note: this new two line method may work on the previous builds (I was on netgear-r6700v3-webflash-05-09-2020-r43099.bin previously) but, I didn't test it and can't say.

gpio changes:

Things that change between the above discoveries listed in this thread and this new gist that I'm linking to now...

Either the above lists were wrong and this new gist was right or stuff got flipped at some point between builds.

6 and 7 got flipped (7 now used in place of 6 in the for loop)
8 and 9 got flipped (no actual change to the for loops)
10 and 11 got flipped (no actual change to the for loop)


Anyway, the gist I linked to above has the updated commands for those looking for full night mode.


Last edited by Baja on Wed Nov 10, 2021 0:19; edited 1 time in total
Baja
DD-WRT Novice


Joined: 22 Dec 2008
Posts: 35

PostPosted: Tue Nov 09, 2021 23:43    Post subject: Reply with quote
set_led_settings() from /urs/lib/libacos_shared.so from R6700v3-V1.0.4.120_10.0.91 (Netgear's latest firmware at time of writing.)




Code:

undefined4 set_led_settings(int param_1)

{
  int iVar1;
  char acStack88 [64];
 
  iVar1 = acosNvramConfig_match("board_id","U12H332T77_NETGEAR");
  if (iVar1 != 0) {
    iVar1 = open("/dev/wps_led",2);
    if (iVar1 < 0) {
      puts("\n open wps led device failed ");
    }
    else {
      ioctl(iVar1,0xc0045716,0);
      close(iVar1);
    }
  }
  if (param_1 == 2) {
    send_wps_led_cmd(0xc0045714,0);
    system("et robowr 0x0 0x18 0x1ff");
    system("et robowr 0x0 0x1a 0x1ff");
    system("et robowr 0x0 0x10 0x0301");
    system("et robowr 0x0 0x12 0x022");
    FUN_0002d45c(2);
  }
  else {
    if (param_1 == 3) {
      send_wps_led_cmd(0xc0045715,0);
      system("et robowr 0x0 0x18 0x0");
      system("et robowr 0x0 0x1a 0x0");
      sprintf(acStack88,"gpio %d 0",0xb);
      system(acStack88);
    }
    else {
      if (param_1 != 1) {
        return 0;
      }
      send_wps_led_cmd(0xc0045713,0);
      system("et robowr 0x0 0x18 0x1ff");
      system("et robowr 0x0 0x1a 0x1ff");
      system("et robowr 0x0 0x10 0x3000");
      system("et robowr 0x0 0x12 0x0078");
      FUN_0002d45c(1);
    }
  }
  iVar1 = acosNvramConfig_match("board_id","U12H332T77_NETGEAR");
  if (iVar1 != 0) {
    restore_guest_led();
  }
  return 0;
}


Last edited by Baja on Wed Nov 10, 2021 17:32; edited 1 time in total
Zyxx
DD-WRT Guru


Joined: 28 Dec 2018
Posts: 739

PostPosted: Wed Nov 10, 2021 10:45    Post subject: Reply with quote
Some additional information might be found here:

https://github.com/mirror/dd-wrt/blob/bacd5befcbbd942b77d6e1e791fc8cfdd19edbb4/src/router/libutils/libutils/ledconfig.c

"ledconfig.c" is in charge for mapping LEDs in DD-WRT.

Maybe useful?
Baja
DD-WRT Novice


Joined: 22 Dec 2008
Posts: 35

PostPosted: Wed Nov 10, 2021 17:30    Post subject: Reply with quote
For the r6700v3 (r6400 and r6400v2), these lines in particular:

https://github.com/mirror/dd-wrt/blob/bacd5befcbbd942b77d6e1e791fc8cfdd19edbb4/src/router/libutils/libutils/ledconfig.c#L1568-L1581

I'm not familiar with ledconfig.c, how it works or what it does. Are those cfg's now available to run from the terminal or something?
Zyxx
DD-WRT Guru


Joined: 28 Dec 2018
Posts: 739

PostPosted: Wed Nov 10, 2021 19:47    Post subject: Reply with quote
This config describes how a gpio has to be set to enable or disable a LED

e.g

To disable the Power LED on my R7800 I have to issue:
gpio disable 0

to enable it again, I issue gpio enable 0.
Baja
DD-WRT Novice


Joined: 22 Dec 2008
Posts: 35

PostPosted: Wed Nov 10, 2021 20:07    Post subject: Reply with quote
I see. I guess I assumed gpio itself was all that was needed for the commands to work, similar to how I assumed et and its command were working.
mache
DD-WRT User


Joined: 11 Apr 2010
Posts: 311
Location: San Francisco Bay Area

PostPosted: Fri Jan 06, 2023 18:00    Post subject: Reply with quote
Baja wrote:

Code:
#!/bin/sh
#
for i in 1 6 8 9 12 13 ; do gpio enable $i ; done
for i in 10 11 ; do gpio disable $i ; done
/jffs/et robowr 0x0 0x18 0x1ff
/jffs/et robowr 0x0 0x18 0x0
/jffs/et robowr 0x0 0x1a 0x0
/jffs/et robowr 0x0 0x16 0x0


This also works for the R7000 as long as you download et and place it in /jffs.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum