[solved] Night LED timer for wifi router for OpenWrt

Good find - dos2unix formatting.
There are some better tools for editing like notepad++ or even pasting from forum directly into vi

1 Like

fuck_microsoft

But in all seriousness, I second @maurer suggestion to use Notepad++ on Windows. Or learn the basics of vi, then you will be able to write short scripts directly in the shell of basically any Linux distribution.

2 Likes

I already completed learning vi after knowing this issue. Now i will use vi directly in linux shells. And its vi or vim ? because both works on linux shell

But in all seriousness, I second .............

Second ?

It means "I agree with this" in this context.

1 Like

thanks. Understood

Traditionally, there's been vi in proprietary UNIX operating systems, as a successor to ed. Based on that look&feel, alternative implementations have been developed over the last 45+ years of its existence, popular ones are vim (vi improved) or nvi (new vi); busybox includes a very (very) minimal implementation itself. On linux distributions, vim is the most commonly shipped vi implementation (on xBSD you are more likely to encounter nvi), as this has grown into muscle memory of many linux users, busybox provides vi and vim symlinks, both pointing to its own -very limited- busybox vi applet.

1 Like

Thanks. History is exciting

Which folders in / of openwrt write to flash which wears over time and which ones to volatile ram which doesn't wear over time ? As I don't want to wear the flash memory while configuring or writing scripts for led configuration. I want to use methods which use volatile ram

Also, does editing files in /sys/class/leds/ and storing scripts in the folder /root/ which I have currently have as leds_off and leds_on wear the flash memory too ?

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 :slight_smile:
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

1 Like

I will go for "paid lunch" then by using /tmp/ as you suggested.

Also does writing and saving commands in either 'Local Startup' tab present in 'Startup' section of 'System' subsystem of LUCI user interface, or in 'Scheduled Tasks' section of 'System' subsystem of LUCI user interface , also wear flash write cycles ?

What is the difference between setting led trigger as phy0tpt and netdev(link,rx,tx) ?

How is phy0tpt trigger different from netdev trigger ?

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

1 Like

Thanks, understood :slightly_smiling_face:

1 Like

Please open a new thread for this question

1 Like

ok done

(post must be atleast 10 characters so filled here)

Could you help me with GL-MT1300
Runing OpenWrt 23.05.2, r23630-842932a63d

None of the scripts worked

1 Like

@h8red please open a new thread for this.
@purple-shed let's mark this thread as solved so we can help others maybe ?

1 Like

Just some more task to be done and asked about, then I will post everything I did as solution so other guys like @h8red don't have to roam around and do the hard work. Wait, a last bit more though as I will ask if I need a last bit of help and then finalize everything as solution. Want to clear up this LED issue well and full. Thanks :slightly_smiling_face:

Why does cat trigger command outputs :
none timer heartbeat default-on [netdev] mt7530-0:00:link mt7530-0:00:1Gbps mt7530-0:00:100Mbps mt7530-0:00:10Mbps mt7530-0:01:link mt7530-0:01:1Gbps mt7530-0:01:100Mbps mt7530-0:01:10Mbps mt7530-0:02:link mt7530-0:02:1Gbps mt7530-0:02:100Mbps mt7530-0:02:10Mbps mt7530-0:03:link mt7530-0:03:1Gbps mt7530-0:03:100Mbps mt7530-0:03:10Mbps mt7530-0:04:link mt7530-0:04:1Gbps mt7530-0:04:100Mbps mt7530-0:04:10Mbps phy0rx phy0tx phy0assoc phy0radio phy0tpt phy1rx phy1tx phy1assoc phy1radio phy1tpt

, even though the file itself is empty as below when opened in vi ?