Remove or comment out this. It overrides the standard functions in /etc/rc.common
responsible for creating/removing the symlinks in /etc/rc.d
.
Oo my god, it solved the symlink issue after me trying for so long. You are genius
Thank you so much
Becuase of this :
when I used
rc.local
and the executed script sends LED off commands to all 5 LEDs (lan
,wan
,power
,wlan-2
,wlan-5
) after reboot, only lan and wan LEDs turn off but no effect onpower
,wlan-2
andwlan-5
LEDs (they remain on).
Oo my god, it solved the symlink issue after me trying for so long. You are genius
Thank you so much
If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.
Thanks!
Ye, yes offcourse, but let me verify all things are correctly working and final as I do always before closing anything. Last time when I decided to close this issue, I checked and found that somethings were not working, then i was glad that I didn't close the issue. After final check and all working as it should, I will close this issue.
Also, one question, earlier I was able to edit & add a prefix of [Solved] in the title of this thread but now there is no edit option for me even though I opened this thread so how will I close this thread when I will do later ?
Marking it solved should be enough.
Even afterwards You can unmark it or open a new thread and refference this one so no big issue if you change your mind
@maurer unable to mark as 'Solved' becuase of this :
earlier I was able to edit & add a prefix of [Solved] in the title of this thread but now there is no edit option for me even though I opened this thread
@purple-shed , my post has nothing to do with the topic title. Please mark as solution the reply of someone who spent much more time on this and who helped you the most in finding a way to turn off the LEDs.
Credits (in chronological order) go to the following people in solving multiple issues encountered at each seemingly easy but difficult stages of this thread:
Contributors to full & final solution for TP-Link Archer C6 AC1200 HWv3.2 by:
..................
@elbertmai for writing the whole initial script, commands, for full patient initial explanation to me:
Note: I have not tested any of this, since I don't own your particular device. Write this script and store in /root/leds_on: #!/bin/sh cd /sys/class/leds/green:lan echo netdev > trigger echo br-lan > device_name echo 1 > link echo 1 > tx echo 1 > rx cd /sys/class/leds/green:wan echo netdev > trigger echo wan > device_name echo 1 > link echo 1 > tx echo 1 > rx Write this script and store in /root/leds_off: #!/bin/sh cd /sys/class/leds/green:lan echo none > trigger cd /sys/class/leds/green:w…
Why? I applaud your initiative and persistence, but this works best if you understand what you are doing first before executing random lines like this. The error message vanishes because cd= does not change any directory. All it does is assign whatever is on the right hand side to a variable called cd. That's why you're seeing all those files in /root, because it's not writing them into the correct directories. No, they are supposed to be directories. If they're actually files, then somethin…
...............
@maurer for providing an alternate set of commands for bypassing encountered : No such file or directory cd to ...
error if it remains uncorrected, for patiently resolving my backend working related queries, for providing the significant time sync script:
alright (and happy new year!) let's try an approach based on my working commands and @elbertmai 's scripts: Write this script and store in /root/leds_on: #!/bin/sh /bin/echo "1" > /sys/class/leds/green:lan/brightness /bin/echo "1" > /sys/class/leds/green:wan/brightness Write this script and store in /root/leds_off: #!/bin/sh /bin/echo "0" > /sys/class/leds/green:lan/brightness /bin/echo "0" > /sys/class/leds/green:wan/brightness Do chmod +x on both scripts. Verify that the scripts do wha…
alright let's try exactly as it works for me: fill /etc/crontabs/root with (adjusting the times per your needs): # enable all LEDs at 7am 0 7 * * * /bin/echo "1" > /sys/class/leds/green:lan/brightness ; /bin/echo "1" > /sys/class/leds/green:wan/brightness # disable all LEDs at 9pm 0 21 * * * /bin/echo "0" > /sys/class/leds/green:lan/brightness ; /bin/echo "0" > /sys/class/leds/green:wan/brightness hopefully that should do it
For point 1 you need the script in post 3 For point 2 - no the leds will be on (defaults) so you need to issue another off command let's say 5minutes after the router rebooted
Good find - dos2unix formatting. There are some better tools for editing like notepad++ or even pasting from forum directly into vi
Writing in /root wear the flash but survives reboots. Writing in /tmp doesn't wear the flash but doesn't survive reboots - no "free lunch" as you can see Writing in /sys/class/leds doesn't wear the flash nor survive reboots If you want to test scripts you can write in tmp and move to root after done testing
Yes it does but I wouldn't worry to much about editing a few files. Just keep in mind to write test scripts i to tmp and move to root(or luci) once are fully tested/working
Actually more expensive ones (like turris omnia) does have such an option
..............................
@slh , @ncompact for providing their part of help during this journey
...............
@pavelgl for solving the final and biggest issue in my Initscript of runtime error causing no symlink creation on enabling it
Remove or comment out this. It overrides the standard functions in /etc/rc.common responsible for creating/removing the symlinks in /etc/rc.d.
.........................
Lastly, Noob me for solving the : No such file or directory cd to ...
error finally, for summing up elbertmai's and maurer's codes in Initscript which had runtime error causing no symlink creation due to my personal error and insufficient knowledge:
Finally I found reason for this error of " can't find cd to directory..." coming when executing script over ssh and now I can execute scripts over ssh to continue forward to solve LED timing feature. Look here in these 2 photos : Script created in Windows Notepad & viewed in Windows Notepad : [Screenshot 2024-01-03 231357] Script created in Windows Notepad & viewed in Linux Vim : [Screenshot 2024-01-03 231234] I then edited the script in Linux Vim by omitting " ^M " from end of each line,…
Same issue as this: My Initscript: #!/bin/sh /etc/rc.common START=97 enable() { start } disable() { stop } start() { ntpd -q -p openwrt.pool.ntp.org if [[ $(date +%H) -ge 21 || $(date +%H) -lt 3 ]] then echo none > /sys/class/leds/green:lan/trigger echo none > /sys/class/leds/green:wan/trigger echo none > /sys/class/leds/green:wlan-2/trigger echo none > /sys/class/leds/green:wlan-5/trigger echo 0 > /sys/class/leds/green:power/brightness else stop fi } stop() { /etc/init…
Apologies if I missed someone, message me so that I can include them
Thank you everyone for joining & helping me in this long journey
Done
Thank you everyone
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.