Intel EdisonのGetting startedその2.(Arduino IDEからの転送,Edison初期設定)

Getting Started Edison

  • このエントリは以下の2つの事項について説明します.

    • Arduino IDEからのプログラムの書き込み方法
    • Edisonの初期設定(デバイス名,パスワード,WiFi設定)を行う方法
  • これも公式の訳+アルファです.

  • 購入してからファームウェアを更新していない場合は,1つ前のエントリを参考にしてファームウェアの更新を行ってください.

step 1. Connectiong Edison

  • 箱から出したedisonをボードに接続する.順番としては前回エントリのファームウェア更新よりも前ですね〜

step 2. Download Edison Arduino IDE

step 2-1. Edison 用Arduino IDEのインストール

  • 公式ページから,Edison用のArduino IDEをダウンロードしてインストール
    • Macの場合,アプリ名が”Arduino.app”となっており,本家Arduinoと競合するので,”Arduino edison.app”とかにでもリネームしておきましょう.

step 2-2. テストとしてBlinkプログラムをEdisonへ書き込む

HWでのHello, World!であるBlink(LED点滅)プログラムを書き込みます.

  1. Arduino IDEを起動して,File -> Examples -> Basics -> Blink を開く
  2. Tools -> Board で”Intel Edison”を選択
  3. Tools -> Serial Portで,”/dev/cu.usbmodemxxxx”を選択

    • xxxx部分は各環境により異なります.
    • ttyではなくcuのものを選択します.
  4. IDE左上のチェックマークのアイコンをクリックしてビルドする

  5. チェックマークアイコンの隣の矢印アイコンを押してEdisonへプログラムを転送する

    • No, such file or directory というエラーが出たら指定しているSerial Portが間違っているので,3に戻ってSerial Portの選択を行います
  6. Arduinoボード上のLEDが点滅すればOKです.

    • Break out boardの場合は該当するGPIOにLEDつないで確認するのかな?未確認です!

Step 4. 初期設定(デバイス名,SSID名,パスワード,Wifi設定)

  • edisonの設定を行うために,”configure_edison”というコマンドが提供されている.さらに,setupオプションを付けることで初期設定を一括でできる.
# 初期設定の実施
 # configure_edison --setup
# これで実行される設定は以下の3つ.
# 1. デバイス名の設定.これはSSIDとしても利用されるようです.
# 2. rootパスワードの設定.これはSSIDパスワードとしても利用されるようです.
# 3. WiFiの設定.初回は失敗したけど,2回目でAPが見えるようになりました.
# 最後に表示されるIPかURLを使ってブラウザからアクセスするとEdisonに関する情報が確認できます.
# 各設定で間違えたら,以下の補足にあるようにconfigure_edisonコマンドのオプションを変えて実行しましょう.

補足

ちなみに,”configure_edison”コマンドのオプションは以下のようになっている.

# configure_edison --help
usage: configure_edison [-h] [--server]
                        [[--setup | --name | --password | --wifi]
                        [--showWiFiIP | --version | --latest-version | --upgrade | --disableOneTimeSetup | --enableOneTimeSetup | --flash <version> [<release name> ...]
                        | --showNames]

optional arguments:
  -h, --help            show this help message and exit
  --server              Starts the server (testing only)
  --setup               Goes through changing the device name, password, and
                        wifi options
  --name                Changes the device name
  --password            Changes the device password
  --wifi                Changes the wifi options
  --showWiFiIP          IP address associated with the wireless interface
  --version             Gets the current firmware version
  --latest-version      Gets the latest firmware version
  --upgrade             Downloads the latest firmware
  --disableOneTimeSetup
                        Disable one-time setup and WiFi access point
  --enableOneTimeSetup  Enable one-time setup and WiFi access point
  --flash <version> [<release name> ...]
                        Downloads and flashes an image
  --showNames           Show device name and SSID

wifi接続先を追加するときとか,Edisonの名前(SSID)変えたい時とかも使えますね.
例えばwifiの設定変更なら以下のようになります

# configure_edison --wifi