2017年11月4日土曜日

raspberry pi(アクセスランプ消灯方法)

以上をまとめると、以下3行のコマンドで両方のLEDの消灯が実現できる。

■ACT LEDを消灯させる
$ echo none | sudo tee /sys/class/leds/led0/trigger

■PWR LEDを消灯させる
$ echo none | sudo tee /sys/class/leds/led1/trigger
$ echo 0 | sudo tee /sys/class/leds/led1/brightness


再起動後も消灯する方法:

上記の消灯設定は、本体再起動をするとリセットされてしまうので
再起動時にも消灯したい場合は、"rc.local"ファイルにコマンドを追記すること

$ cat /etc/rc.local
---------------------------------------------------------------------------------------------------------------------------
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi

# Turn off LED(以下を追記する)
echo none | sudo tee /sys/class/leds/led0/trigger   
echo none | sudo tee /sys/class/leds/led1/trigger   
echo 0 | sudo tee /sys/class/leds/led1/brightness   
------------------------------------------------------------------------

0 件のコメント:

コメントを投稿

AIツール断捨離の果てに

  導入 ハード環境 : Mac Studio M4 Maxの導入。 背景 : 以前から使い倒してきたITエンジニアとして、話題のAIツール(Cursor, Zed, Void, Continue, Roo Codeなど)を片っ端から実戦投入してみたこと。 目的 : ツールをいじ...