raspberry piでXを起動せずにhomebridgeをcliで自動起動させる

raspberry piでXを起動するとlogやリソースが何やかやと取られ重くなる

なのでXを起動させず、homebridgeをcli自動起動させる

それとhomebridge-alexaの動作logはtempfs上に入れておく

/etc/rc.localへ追加

sudo -u pi homebridge -I >/www/remote-hand/tmp/nohup.out

2020.11.22リダイレクトを/dev/nullで動作確認、以下に置き換え

sudo -u pi homebridge -I >/dev/null
exit 0

logを確認

cat /www/remote-hand/tmp/nohup.out

[11/10/2020, 4:20:27 PM] —
[11/10/2020, 4:20:53 PM] Loaded plugin: homebridge-alexa
[11/10/2020, 4:20:53 PM] Registering platform ‘homebridge-alexa.Alexa’
[11/10/2020, 4:20:53 PM] —
[11/10/2020, 4:20:53 PM] Loaded plugin: homebridge-cmd
[11/10/2020, 4:20:53 PM] Registering accessory ‘homebridge-cmd.CMD’
[11/10/2020, 4:20:53 PM] —
[11/10/2020, 4:20:53 PM] Loaded plugin: homebridge-humidity-file
[11/10/2020, 4:20:53 PM] Registering accessory ‘homebridge-humidity-file.HumidityFile’
[11/10/2020, 4:20:53 PM] —
[11/10/2020, 4:20:53 PM] Loaded plugin: homebridge-temperature-file
[11/10/2020, 4:20:53 PM] Registering accessory ‘homebridge-temperature-file.TemperatureFile’
[11/10/2020, 4:20:53 PM] —
[11/10/2020, 4:20:53 PM] Loading 1 platforms…
[11/10/2020, 4:20:53 PM] [Alexa] Initializing Alexa platform…
[11/10/2020, 4:20:53 PM] [Alexa] homebridge-alexa v0.4.74, node v11.15.0, homebridge v0.4.53
[11/10/2020, 4:20:53 PM] [Alexa] Initializing platform accessory ‘Alexa’…
[11/10/2020, 4:20:53 PM] Loading 20 accessories…
[11/10/2020, 4:20:54 PM] [ダイニング電気] Initializing CMD accessory…
[11/10/2020, 4:20:54 PM] [防犯カメラ] Initializing CMD accessory…
[11/10/2020, 4:20:54 PM] [寝室電気] Initializing CMD accessory…
[11/10/2020, 4:20:54 PM] [シーリングライト] Initializing CMD accessory…

アレクサへお願い–> 『アレクサ ダイニング電気つけて』
[11/10/2020, 5:06:46 PM] [ダイニング電気] Setting power state to on
[11/10/2020, 5:06:48 PM] [ダイニング電気] power function succeeded!

Follow me!

IOT

次の記事

Hardwareについて