いちいちコマンドしないでカメラ見れるようにしたい。。
昨日失敗しので、トライ!!!
これをコピー??なのかな???
/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) || trueif [ "$_IP" ]; then printf "My IP address is %s\n" "$_IP"fi #ここから追加sh /home/user/mjpg-streamer/start_server.sh &#ここまで追加 exit 0 |
ここで指定する起動用のスクリプトはmjpegの実行パスを絶対パスに修正しておきます。なので、、、
$ /home/pi/mjpg-streamer
$ vi start_server.sh
#!/bin/sh PORT="8080" #ポート番号ID="user" #IDPW="passwd" #パスワードSIZE="320x240" #画面サイズFRAMERATE="2" #フレームレートMJPEGDIR=/home/user/mjpg-streamerexport LD_LIBRARY_PATH=/usr/local/lib$MJPEGDIR/mjpg_streamer \ -i "input_uvc.so -f $FRAMERATE -r $SIZE -d /dev/video0 -y -n" \ -o "output_http.so -w /usr/local/www -p $PORT -c $ID:$PW" |
これで、Raspberry Pi(Linux)を再起動すると、Mjpegが自動起動します。
本当かな????
やってみるかーーーーーー。
# reboot
・・・・・
・・・・・
・・・・・うーーーーん、ダメ。。。なぜかしらーーーーー??
(もとに戻しておこう)
以上