RPi2 Edit

基本情報 Edit

  • uname -a
    Linux raspberrypi 3.18.7-v7+ #755 SMP PREEMPT Thu Feb 12 17:20:48 GMT 2015 armv7l GNU/Linux
    
  • free
                 total       used       free     shared    buffers     cached
    Mem:        949328     213180     736148          0      18740     143268
    -/+ buffers/cache:      51172     898156
    Swap:       102396          0     102396
    
  • /proc/cpuinfo
    processor       : 0
    model name      : ARMv7 Processor rev 5 (v7l)
    BogoMIPS        : 38.40
    Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
    CPU implementer : 0x41
    CPU architecture: 7
    CPU variant     : 0x0
    CPU part        : 0xc07
    CPU revision    : 5
    
    …省略…(4core分続く)
    
    Hardware        : BCM2709
    Revision        : a21041
    Serial          : ********
    
  • df
    ファイルシス   1K-ブロック    使用   使用可 使用% マウント位置
    rootfs            15071704 2848724 11560336   20% /
    /dev/root         15071704 2848724 11560336   20% /
    devtmpfs            470368       0   470368    0% /dev
    tmpfs                94936     236    94700    1% /run
    tmpfs                 5120       0     5120    0% /run/lock
    tmpfs               189860       0   189860    0% /run/shm
    /dev/mmcblk0p1       57288   14728    42560   26% /boot
    

設定メモ Edit

  • 使用イメージ
    • raspbian jessie lite 2015-11-21版
  • raspi-config
    • 1 Expand Filesystem
    • 4 Internationalisation Options
      • I1 Change Locale
        以下を選択。
        ただし、文字化けするので日本語フォントをインストールしてから行ったほうが良い
        en_GB.UTF-8 UTF-8
        ja_JP.UTF-8 UTF-8 ← defaultにロケールに設定
        
      • I2 Change Timezone
        アジア→Tokyo
        
      • I3 Change Keyboard Layout
        Generic 105-key (Intl) PC → Other → Japanese
        
  • /boot/config.txt に追記
    • 以下の設定でUSBポートから1.2Aまでの電流を流せるようになるとのこと。
      safe_mode_gpio=4
      max_usb_current=1
      
  • update & install
    • 最新のfirmwareにupdate
      $ sudo rpi-update
      $ sudo shutdown -r now
      
    • パッケージのインストール
      $ sudo update
      $ sudo upgrade
      $ sudo apt-get install emacs24-nox screen
      $ sudo apt-get install wicd-curses
      
  • WiFiネットワーク
  • BUFFALO 無線LAN子機 コンパクトモデル 11n技術・11g/b対応 WLI-UC-GNM(amazonで714円)
  • WIFi接続はwicd-cursesで行う
  • IPv6無効化
    • /etc/sysctl.conf
      net.ipv6.conf.all.disable_ipv6 = 1
      
    • 設定反映
      # sysctl -p
      

アプリ Edit

  • install
    $ sudo apt-get install nginx monit
    $ sudo apt-get sqlite3 libdbi-perl libdbd-sqlite3-perl libjson-xs-perl libdbd-sybase-perl
    $ sudo apt-get libdatetime-perl
    
  • monit
    • /etc/monit/monitrc に以下を追加
      set httpd port 2812 and
         use address localhost
         allow admin:monit
      
    • /etc/nginx/conf.d/monit.conf
      server {
        listen 80;
        location /monit/ {
          rewrite ^/monit/(.*) /$1 break;
          proxy_pass http://localhost:2812;
          proxy_redirect  http://localhost:2812/monit  /monit/;
          proxy_set_header Host $host;
        }
      }
      
    • datafetch.plというスクリプトを作成しmonit監視対象にする場合の設定
      • /etc/monit/conf.d/datafetch.conf
        check process datafetch matching "detafetch"
          start program = "/home/pi/detafetch/bin/datafetch.pl -log" as uid pi and gid pi
          stop  program = "/usr/bin/pkill datafetch.pl" as uid pi and gid pi
          if 5 restarts within 5 cycles then unmonitor
        
  • freetds
    • /etc/freetds/freetds.conf
    • [global]に以下を追加
      [global]
              port = 1433
              tds version = 8.0
              client charset = UTF-8
      

memo Edit


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2015-02-14 (土) 16:01:09 (3357d)