FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
123 views 3 comments
by anonymous
RUTX50  RUTX_R_00.07.03

I have searched the forum apologies if this has been answered before.

I use the rutx50 in the same room I sleep in - currently i mainly disable the LED's at night but this is getting tiresome. i would like them to go off at 22:00 and on again at 7 every morning.

I realize the power light cannot go off which is fine.

Could anyone suggest a snippet of code or cron entry i could use to achieve this with all the other LEDS ?

Thank you

1 Answer

0 votes
by anonymous

Hi,

You can turn off the LEDS via command line. Also, you can put those commands into crontab to execute at your desired times.

The following two commands stop and start LED service on the device, respectively:

  • /etc/init.d/ledman stop
  • /etc/init.d/ledman start

Two commands to disable and enable LED on port 1 of the device (port 0, you can change to 1, 2, etc.):

  • swconfig dev switch0 port 0 set led 0
  • swconfig dev switch0 port 0 set led 2

To add these commands to crontab, execute the following command:

  • crontab -e

It will open in text editor. Press 'i' to start editing. To run disable LEDs at 22 PM and enable them at 7 AM, add the following:

0 22 * * * /etc/init.d/ledman stop >/dev/null 2>&1

0 7 * * * /etc/init.d/ledman start >/dev/null 2>&1

0 22 * * * swconfig dev switch0 port 0 set led 0 >/dev/null 2>&1

0 7 * * * swconfig dev switch0 port 0 set led 2 >/dev/null 2>&1

Save your changes by pressing  'esc' button, typing ':wq' and pressing 'enter'

You can change the times if you want. More information about crontab can be found here. You can also use crontab generator like the one here.

Kind Regards,

Andzej

by anonymous
Superb thank you, Andzej!, i will try this today.
by anonymous
This worked ,thank you.
by anonymous
Hi,

You're welcome. Happy to hear that it is working for you.

Kind Regards,

Andzej