150130 edison-ug
TRANSCRIPT
Intel® Edison勉強会概要、開発環境、Tipsなど。。
VALUE PROPOSITION
Intel® Edison開発プラットフォームは発明家、起業家、製品設計者がIoTデバ
イスやウエアラブルデバイスのラピッド・プロトタイピングを容易にします
販売形態 –秋葉原のお店でも買えるようになります
Pro-Maker &
EntrepreneurMaker
Consumer
IoT
Light Ind.
IoTNo extended
temp or life
Intel® Edison
Module
Intel® Edison Breakout
Board Kit
Intel® Edison Kit for
Arduino*
Intel®偉人シリーズ (公式な呼称ではありません。念の為w)
Intel® Galileo Gen1/2
Intel初のArduino互換プラットフォームIntel® Edison
超小型、WiFi/BT付きLinuxボードIntel® Curie™ module
今年後半に登場!?
Intel® Edison Compute Module
切手サイズ!と言い張ってますが、実際には普通の切手よりだいぶ大きいですw
Intel® Edisonメカニカル・レイアウト
Processor
and DDR
POP Memory
PMIC
70 PIN I/O
Connector
eMMC
4Gbyte
WiFi/BT 4.0
module
Embedded
2.4/5 GHz
Antenna
Antenna
COAX
USB ULPI
Transceiver
Top Side Bottom Side
25mm
35.5mm
機械的特性機械的特性機械的特性機械的特性
Form Factor Board with 70-pin connector
Dimensions 35.5 x 25.0 x 3.9 mm max
C/M/F Blue PCB with Shields / No enclosure
コネクタHirose DF40 Series (1.5mm, 2.0mm, or
3.0mm stack height)
動作温度範囲 0 – 40 degC
外部インターフェース外部インターフェース外部インターフェース外部インターフェース
Total of 40 GPIOs which can be configured as:
SD Card 1 Interface
UART2 Controllers
(1 full flow control, 1 RX/TX)
I2C 2 Controllers
SPI 1 Controller with 2 chip selects
I2S 1 Controller
GPIO Additional 12 (with 4 capable of PWM)
USB 2.0 1 OTG Controller
Clock Output 32 KHz, 19.2 MHz
電源電源電源電源
Input 3.15V – 4.5V (LiIon駆動可能)
Output 100ma @3.3V and 100ma @ 1.8V
Power
Standby (No radios): 13mW
Standby (BT 4.0): 21.5mW (BTLE.. Coming soon)
Standby (WiFi): 35 mW
Edison主要コンポーネント主要コンポーネント主要コンポーネント主要コンポーネント
SoC
22-nm Intel® SoC that includes a dual-core, dual-
threaded Intel® AtomTM CPU at 500Mhz and a 32-bit
Intel® QuarkTM microcontroller at 100 MHz
RAM1 GB LPDDR3 POP memory
(2 channel 32bits @ 800MT/sec)
Flash Storage 4 GB eMMC (v4.51 spec)
WiFi
Broadcom* 43340 802.11 a/b/g/n;
Dual-band (2.4 and 5 GHz)
On board antenna or external antenna
SKU configurations
Bluetooth BT 4.0
ファームウエアファームウエアファームウエアファームウエア / ソフトウエアソフトウエアソフトウエアソフトウエア
CPU OS Yocto Linux* v1.6
Development
Environments
Arduino* IDE
Eclipse supporting: C, C++,& Python
Intel XDK supporting: Node.JS & HTML5
MCU OS RTOS
Development
EnvironmentsMCU SDK and IDE
Intel® Edison Expansion Boards
Intel® Edison Family: Expansionボードによる幅広い応用
Intel 製製製製Expansion Boards
パートナー製パートナー製パートナー製パートナー製Expansion Boards
カスタムカスタムカスタムカスタムExpansion Boards
Intel® Edison Board for Arduino*
Market position: Arduino Yunと同様なアプリケーションと同様なアプリケーションと同様なアプリケーションと同様なアプリケーション (Sketch+WiFi/BT)
Board I/O: Arduino Uno互換(PWMは4本のみサポート)
▪ 20 digital input/output pins including 4 pins as PWM outputs
▪ 6 analog inputs
▪ 1 UART (RX/TX)
▪ 1 I2C
▪ 1 ICSP 6-pin header (SPI)
▪ Micro USB device connector OR (via mechanical switch)
dedicated standard size USB host Type-A connector
▪ Micro USB device (connected to UART)
▪ SD Card connector
▪ DC power jack (7V – 15V DC input)
Intel® Edison Breakout Board
Market position: Arduinoを使っていないユーザー向けに最低限の機能を提供
Board I/O:
▪ Edisonの1.8VのI/O端子を直接引き出しています
▪ 2.54mm (0.1”) grid I/O array of through-hole solder points
▪ USB OTG with USB Micro Type-AB connector
▪ USB OTG power switch
▪ Battery Charger
▪ USB to device UART bridge with USB Micro Type-B connector
▪ DC power supply jack (7V – 15V DC input)
Intel® Edison
Software
Visual
Programming
Edison Developer Options
Arduino*
Developer
Java script
DeveloperMCU
Developer
Embedded
Developer
Tools/
Libraries
Yocto Linux* 1.6 RTOS
Arduino* Libraries Intel XDK Intel System Studio
Arduino* IDE
Win */ Mac*
Wyliodrin*
Web
Intel XDK
Win*/ Mac*/ Linux*Eclipse
Win*/ Mac* / Linux*Win*/ Mac* / Linux*
Arduino* Sketch
C++Visual
JavascriptJavascript (Node
JS)C/ C++/Python C/C++
MCU SDKWyliodrin*
OS /
Boot Image
IDE
Programmin
g
Language
Cloud IoT Kit & Mashery*
Coming soonO
* Windows is a registered trademark of Microsoft Corporation in the United States and other
countries. Other names and brands may be claimed by the property of others by all third party
name and the notation.
Intel® Edison R2 Software Support- Coming soonFirmware
Intel IFWI (Integrated FirmWare Image) in binary
OS Loader
U-Boot version (2nd stage bootloader in source)
Kernel/BSP
Yocto Linux 1.6
Linux kernel v3.10.17
Tools
Native SDK
• Standard compiler support (GCC 4.8.2), GLIB 2.38.2
• Standard debugger support GDB 7.6.2
Custom Tools: Flash tools (DFU-Util ; XFSTK for stitching & flashing)
Middleware
Connectivity framework for simplified D2D and D2C
• Networking, Messaging, privacy/security
Connectivity Framework Enhancements
• Bluetooth Support
Expanded I/O Library Support
• JavaScript & Python Bindings, Additional Sensors
Additional Developer Tools & Environments
Arduino IDE for Mac, Windows and Linux OS
• Cross compilers for each of the host
• Core Arduino Libraries
Node.js (Supported by Intel® XDK)
Python (This package is part of BSP)
Intel Confidential
Cloud
Web Portal, Identity Management, User Profile
Device Registration; Device Data Upload/Visualization
Portal Enhancements & Back-end Integration
RESTful Device Data Access
Device Messaging & Notification with Third-Party Service Integration
OTA Software Installation & Update
Logging Features
Hosted IDE for Cloud-based Services
Online Forums
WLAN/BT Connectivity (BCM43340)
Firmware in Binary: WiFi STA and BT+LE
Drivers in source: BRCM kernel drivers, WiFi Supplicant and BlueZ
Release 2 Deltas from Release 1 in blueOther names and brands may be claimed by the property of others by
all third party name and the notation.
Audio再生/録音, MCU SDK, BTプロファイル追加(FTP, SPP, HFP, A2DP, BLE), PulseAudio
I2Sサポートも入る、らしい。。
Edison Tips
ドキュメント、コミュニティなど
Edison サポートフォーラム (English)
https://communities.intel.com/community/makers/edison/forums
Edison Lab (日本語)
http://edison-lab.jp/
インテルジャパン web site
http://www.intel.co.jp/content/www/jp/ja/do-it-yourself/edison.html
Intel Makers: web site
http://www.intel.com/content/www/us/en/do-it-yourself/maker.html
Software & Documentation (Hardware guide, Expansion board hardware guide, BSP user guide)
https://communities.intel.com/community/makers/edison/documentation
Quick Start Guide
https://communities.intel.com/docs/DOC-23147
Edisonのサポートは、Support
Forumで行っています
過去の質問も非常に参考になるので、困ったら覗いてみてください
Arduino IDE, Intel Edison Driver
https://communities.intel.com/docs/DOC-23242
CDM Driver (FTDI CDM Driver)
http://www.ftdichip.com/Drivers/D2XX.htm
PuTTY
http://www.putty.org/
Intel® XDK IoT Edition
https://software.intel.com/en-us/html5/xdk-iot
ソフトウエアのダウンロード場所
Edison + Arduino Expansion board 電力実測 (参考)
Intel製ExpansionボードのI/O
DCIN
7~17V
USB Host
USB Slave
(Arduino)
↑USB-OTG
↓切替え
Virtual COM
(Linux console)
→~3
→~6
→~10
~5←
~9←
~11←
←Digital3
←Digital6Digital5→
Digital9→
PWM Swizzler設定
MicroSD
LiIon (1 cell)
バッテリ端子(1=+, 2=GND)
バッテリチャージャーNTC Thermistor設定用。いじらない。
Shield I/O電圧2-3: 3.3V (上)
1-2: 5V (下)
AVREF
2-3: AREF(上)
1-2:V_SHIELD(下)
PWM Swizzler
DCIN
7~15V
Virtual COM
(Linux console)
USB OTG
LiIon (1 cell)
バッテリ端子(1=+, 2=GND)
バッテリチャージャーNTC Thermistor設定用。いじらない。
Power button
/dev/ttyMFD2
Edison - UART2 Tx/Rx
/dev/ttyGS0
/media/sdcard
DS3: LiIon CHG LED
DS1: 動作中LED
DS2: Digital13
ボードリセット
シールド/スケッチリセット
RM/FW ファーウエア復旧用
電源
DS3: LiIon CHG LED
DS1: 動作中LED
pin1 <- J17 -> pin14
pin1 <- J18 -> pin14
pin1 <- J19 -> pin14
pin1 <- J20 -> pin14
/dev/ttyMFD1
Edison – UART1
Tx/Rx
/dev/i2c-6
/dev/spidev5.1
Breakout board pin assignment (1.8V)pin1 <- J17 -> pin14
pin1 <- J18 -> pin14
pin1 <- J19 -> pin14
pin1 <- J20 -> pin14
Emutexのサイトに詳しい解説が出ています
http://www.emutexlabs.com/project/215-intel-edison-gpio-pin-multiplexing-guide
1. SoC (Edison内の、Atom SoC)のピンがそもそもmultiplexされている場合がある
▪ GPIO / UARTなど
▪ SoC内のレジスタで機能セレクトする。通常はSysfs経由で機能セレクトする
▪ (例) # echo mode0 > /sys/kernel/debug/gpio_debug/gpio43/current_pinmux
2. Arduino Expansionボード上で、multiplexされている場合もある
▪ DIGITALn/I2C, DIGITALn/PWMnなど
▪ Multiplexerの機能セレクトに、別のGPIOピンが使われる(GPIOで切替をコントロールする)
3. 可能な限り、MRAAなどのライブラリに任せたほうが楽
Edisonのピンマルチプレクス
Arduino Expansion Board
GPIO
UART
レジスタ
GPIO
EdisonのAtom SoC
GPIO/UART
←sysfsで操作
概念図
別の機能 GPIO/
UART/
別の機能
いろいろな 3rd Party Expansion Boards
秋月電子通商 – Edison 2.54mm
ピッチ変換基板
http://akizukidenshi.com/catalog/g/gK-08846/
基本は、インテル製Breakout boardの大型版I/Oは1.8Vのまま
Running Electronics - FRISKケースに入るEdison用ベース基板 Henry
http://www.runele.com/ca1/38/p-r-s/
Edison用小型拡張ボードUSB microから給電し、USB Host, 9DOF IMUなどを備える
SparkFun - Blocks
https://www.sparkfun.com/news/1589
Battery, 9DOF IMU, OLED, Arduino, MicroSD,
Console, UART, GPIO, PWM, Dual H-Bridge, I2C,
ADC, Base
Switch Science - Eaglet
https://www.switch-science.com/catalog/2070/
Grove互換I2Cコネクタ (3.3V)
LiPo充電回路、UART, I2C, SPI (3.3V)
USB deviceコネクタ (USB hostは使用不可)
Edison (WiFi+BT) + 3Gを搭載したIoT用GW。USB, 232C, 485, GPIO, Ethernetもサポート。Debianをポーティング済み先行開発者キットの提供が開始されています。毎週水曜日にhands-onセミナーも開催中。2月から発売開始予定http://openblocks.plathome.co.jp/products/obs_a/bx1/
製品事例:ぷらっとホーム(株) – OpenBlocks IoT BX1
ヴイストン(株)が阪大、JSTと共同で開発したコミュニケーション研究用ロボット
メインの制御にEdisonが使われています
http://www.vstone.co.jp/products/sota/
製品事例:ヴイストン(株) - Sotaくん
Edison Tips
• R1 firmwareではUSB Audio, USB Camera (UVC), I2Sなど使えません。BTプロファイルも、HID, PANしか入っていません。R2になるといろいろ使えるようになる予定です。R2もうすぐリリース予定。
• EdisonのファームウエアアップデートはOTAイメージをUSB経由でEdisonのフラッシュストレージに書き込み、EdisonのLinuxコンソールから”reboot ota”コマンドを打てば出来ます
• BSPでOTAアップデート可能なイメージの生成ができます。BSP users guideに載っています
• EdisonはUSB電源供給でも動きますが、WiFiが動くと瞬間的に消費電力が増えます。基本的に不安定なのでLiIonバッテリ駆動かACアダプタ使用を推奨
• EdisonにDebianなんか載せてる人がいるようです。apt-getも使えるようなので便利(ubiLinux)
• MRAA(むらー)というライブラリがGit hubに落ちています。Galileo / EdisonでI/Oを操作するライブラリでC/C++/Python/Node.jsなどから簡単にI/O制御できます。”opkg install libmraa0”でインストール
• Edison (Yocto)ではサービスの起動にinit.dを使っていません。systemdを使っています。自動起動などの設定はsystemdを調べてください
• Arduinoスケッチを止めたい場合は、”systemctl stop clloader”
• Edisonのもろもろの設定を行うスクリプトがついています。”configure_edison –-setup”
や”configure_edison –-wifi”で設定を行えます
Edisonその他
• WiFiを使いたい▪ “configure_edison --wifi”コマンドでWiFiのセットアップを行う
もし、WiFi接続に問題がある場合、下記コマンドを試してみてくださいifconfig usb0 down
ifconfig wlan0 down
ifconfig wlan0 up
• BlueToothを使いたい• “rfkill unblock bluetooth”をしないとBTの電波が出ません• その後、”bluetoothctl”コマンド内からデバイス検索したり、ペアリングしたり出来ます• R1 firmwareではPAN, HIDくらいしかプロファイルが入っていません。• R2 firmwareになると、A2DP, SPP, HFPなどプロファイルが追加される予定です
WiFi / BT
# bluetoothctl[bluetooth]# scan on
Discovery started
[CHG] Controller 98:4F:EE:xx:xx:xx Discovering: yes
[bluetooth]# devices[NEW] Device C8:F7:33:xx:xx:xx YSHIMUR1-MOBL
[NEW] Device C4:85:08:xx:xx:xx C4-85-08-xx-xx-xx
[NEW] Device C4:85:08:xx:xx:xx C4-85-08-xx-xx-xx
[NEW] Device C8:F7:33:xx:xx:xx C8-F7-33-xx-xx-xx
[CHG] Device C4:85:08:xx:xx:xx LegacyPairing: no[bluetooth]#
• Edison (Yocto)のパッケージマネージャはopkgです。標準ではあんまりパッケージ揃ってないです• レポジトリをいろいろ追加すると少し使いやすくなります。レポジトリは/etc/opkg/base-
feeds.confに追加するか、xxxx.confを/etc/opkgの下に作ってあげればOK• src intel-iotdk http://iotdk.intel.com/repos/1.1/intelgalactic
• src inteli586 http://iotdk.intel.com/repos/1.1/iotdk/i586
• src/gz all http://repo.opkg.net/edison/repo/all
• src/gz edison http://repo.opkg.net/edison/repo/edison
• src/gz core2-32 http://repo.opkg.net/edison/repo/core2-32
• レポジトリ追加した後はopkg updateをお忘れなく。
opkg
• Arduino IDEからSketchのダウンロードが出来ない (Windowsの場合)
-マイコンボードは”Edison”が選択されていますか? (IDE画面右下を確認)
- COMポートは正しく指定されていますか? (IDE画面右下を確認)
- “/dev/ttySxx: Permission denied”エラーが出る場合、転送に失敗したlsz.exeのプロセスが残っている場合があります。Arduino IDEをすべて終了、Edisonの電源をoff、タスクマネージャーから、bash.exeとlsz.exeを終了させてから再度試してみてください
• ArduinoのAPIが分からない“ヘルプ”-”リファレンス”を開くと、API説明のHTMLページが開きます。有志による日本語のページもありますhttp://www.musashinodenpa.com/arduino/ref/ (日本語)
• MRAAのサンプルコードがほしいGitHubに行けば、たくさんサンプルがあります。C/C++/JavaScript/Pythonなどで書かれていますhttps://github.com/intel-iot-devkit/mraa/tree/master/examples
8. 困ったら
http://www.emutexlabs.com/ubilinux
WeezyベースのEdison用Debian。Emutexが開発。
Bluetoothのプロファイルが充実していて、Bluetooth audio(A2DP)やBLEも動くらしい。
apt-getが使えるので、パッケージ追加が容易
Ubilinux – Debian on Ubuntu
http://www.pcgamer.com/watch-doom-running-on-an-intel-edison-chip/
Running Doom on the tiny Intel Edison computer
Scratch同様にブロックを組み合わせてプログラミング。開発環境はクラウドベース。Edisonだけではなく、Galileo、 などでも使用可能http://www.wyliodrin.com/
Wyliodrin
Wyliodrin Tips
• Edisonの名前(configure_edison –setupで指定した名前)と、Wyliodrinに登録するボード名は同じである必要はない。configure_edison --setupも必須ではない
• ネットワーク経由でコードを転送するのでWiFi必須。EdisonとPCは同じネットワークにいる必要はない。インターネット越しでも作業可能• セットアッセットアッセットアッセットアップで重要なのは、プで重要なのは、プで重要なのは、プで重要なのは、wyliodrin.json。このファイルが識別IDなどを含んでいるので、必ずWyliodrinでボードを登録した後にこのファイルをダウンロードする。そうしないと識別IDが一致しないのでいつまで待ってもonlineにならない。
• wyliodrin.jsonファイルはファイル名をいじってもダメ。必ずPCから見えるUSB mass storage領域に保存。• セットアップ手順。1.Wyliodrinでボード登録。2.Edison上でinstall_edison.shを実行(ネットワーク必要、何処で実行してもOK)。3.
wyliodrin.jsonファイルをUSB mass-storageのトップに置く。4.リブート。
wyliodrin.jsonの中身(例){
"jid": “[email protected]",
"password": "lepifoqojo",
"socketpassword": "faluwawihe",
"owner": “[email protected]",
"timeout": 2000,
"maxBuffer": 200,
"firewall": false,
"ping": 50,
"ssid": "PROGys",
"scan_ssid": 1,
"psk": “!”#$%&’"
}
超簡易版Getting Started Guide for Edison
ちなみに、このGSGとほぼ同じ内容のビデオがYoutubeにアップロードされていますIntel® Edison Development Platform: Getting Startedビデオhttps://www.youtube.com/watch?v=lDKM7UKUL5A#t=57
Edisonを使用する際に必要となるドライバーをインストールします (Windowsのみ)
• CDCドライバ、Edisonドライバの順にインストールします
1. PCにドライバーをインストールする
※Macユーザーはドライバ不要
EdisonをArduino拡張ボードに取り付けます
• EdisonをArduino expansionボードに取り付けるパチッとコネクタをはめ込んでください。
• 2ヶ所のナットを締めてEdisonを固定してくださいこのコネクタの耐久性は高くないので不用意な着脱は避けるようにしてください。
2. Edisonの準備
MicroUSBケーブルでEdisonをつなぎ、Edisonのストレージにイメージを転送します。その後、MicroUSBケーブルをシリアルポートに繋ぎ、アップデートコマンドを実行します。
• 電源(12V)をArduino expansionボードのパワーコネクタに接続し、電源を入れる。
• パワーコネクタに近い方のUSBコネクタ(J16)にUSBケーブルを接続するSW1=“1-C”
• Edisonがマスストレージデバイスとして見える (760MB程度の空き容量)
• LinuxイメージのzipファイルをEdisonのドライブのルートに展開する(588MBほどあるので時間がかかる)
• MicroUSBケーブルを、パワーコネクタから遠い方に差し替える (J3)
• PuTTYを立ち上げ、シリアルポート(115200bps)でシリアルターミナルを開くCOMポートはDevice Managerで調べてください (mmc devmgmt.msc)
(※Macの場合はターミナル上で以下のコマンドを実行screen /dev/tty.usbserial-A402IY3C 115200)
• Linuxのログインプロンプトで”root”でログインする (パスワード無し)
ログインプロンプトが表示されない時はEnterを数度叩いてください
• # reboot otaコマンドを発行し、EdisonのLinuxイメージを書き込む
• 再度ログインプロンプトが表示されたら、イメージの更新完了です
3. Linuxイメージの転送
Arduino IDEをインストールします。圧縮フィルを展開するだけです。インストーラの実行などは必要ありません。
• Arduino IDEをインストール (arduino-windows-1.0.3.7z)
7zipを使って展開してくださいZip版(arduino-windows-1.0.3.zip)はzipで圧縮しなおしたもので、内容は同じですが公式パッケージではありませんIDEを展開するときはできるだけルートディレクトリなど”
浅い”ディレクトリに展開してください。長いフォルダ名を
使ったりしてパス名が長くなると展開に失敗することがあります。私はC:¥arduino-1.5.3の下に”drivers”, “examples”,
“hardware”, “java”,Oのフォルダが来るように展開しています
• Macの場合はArduino IDE( arduino-macosx-
signed.1.0.3.zip)をダウンロードし、任意のディレクトリに展開してください。展開したArduino.appをアプリケーション等の任意のディレクトリに移動します
4. Arduino IDEのインストール
Arduino IDEの設定を行い、Edisonと通信できるようにします。
• MicroUSBケーブルをパワーコネクタに近い方(J16)につなぎます
• Arduino IDEを起動します (arduino.exe)
• “ツール”-”マイコンボード”を開き、”Intel® Edison”を選択
• “ツール”-”シリアルポート”を開き、COMポートはDevice Managerで調べてください (mmc devmgmt.msc)
(Macの場合は/dev/cu.usbmodemXXXX(数字の大きいほう)を選択)
5. Arduino IDEの設定
オンボードLEDを点滅させるだけの簡単なサンプルスケッチを実行させて、セットアップが正常に出来たことを確認します
• “ファイル”-”スケッチの例”-”01. Basics”-”Blink”を選択別ウインドウで”Blink.ino”サンプルスケッチが開かれる
• “マイコンボードに書き込む”ボタンを押して、コンパイル、転送を行う“ファイル”-”マイコンボードに書き込む CTRL+U”でも同じ
• ボード上のLEDが1秒おきにon/offを繰り返せば成功!
6. ArduinoでLチカ
Atom Silvermontコア x2
@500MHzのパワーでLチカ!!
Arduinoスケッチ以外のプログラム方法を試してみます。MRAA(むらーw)という、オープンソースのI/O操作ライブラリを使用しています。
1. Edisonのセットアップ“configure_edison --setup”コマンドで初期設定を行う (必須ではない)
2. WiFiのセットアップ“configure_edison --wifi”コマンドでWiFiの設定を行う
3. MRAAライブラリのインストール/アップデートを行うecho "src mraa-upm http://iotdk.intel.com/repos/1.1/intelgalactic" > /etc/opkg/mraa-upm.conf
opkg update
opkg install libmraa0
4. Node.jsでLチカ1. J3にUSBケーブルを繋ぎ、PuTTYでシリアルコンソールを立ち上げる2. “root”でログインし、viエディタでサンプルプログラムを入力 (blink.js)
3. “# node blink.js”でLEDが点滅します (実行前に “systemctl stop clloader”でスケッチの実行を止めたほうがいいでしょ
う)
7. Node.js+MRAAでLチカ
var m = require(‘mraa’); // MRAAライブラリをロードconsole.log(‘MRAA Version: ’ + m.getVersion()); // MRAAのバージョンをコンソールに表示
var myLed = new m.Gpio(13);// Digital pin 13番につながっているオンボードLEDを操作myLed.dir(m.DIR_OUT); //GPIOの方向をOUTPUTに指定var ledState = true; //LEDの状態をブーリアン値で保持
periodicActivity(); //周期実行するperiodicActivity関数を呼び出す
function periodicActivity()
{
myLed.write(ledState?1:0);//ledStateがtrueなら1, falseなら0を書くledState = !ledState; //ledStateを反転setTimeout(periodicActivity,1000); //1000ms後にperiodicActivity関数を再度呼び出す
}
blink.js
1. WiFiを使いたい1. “configure_edison --wifi”コマンドでWiFiのセットアップを行う
もし、WiFi接続に問題がある場合、下記コマンドを試してみてくださいifconfig usb0 down
ifconfig wlan0 down
ifconfig wlan0 up
2. Arduinoのスケッチを止めたい/動かしたい1. シリアルコンソールから下記のコマンドを実行 (stopをstartに変えれば再度sketchを起動
できます)systemctl stop clloader
8. その他
• Arduino IDEからSketchのダウンロードが出来ない (Windowsの場合)
-マイコンボードは”Edison”が選択されていますか? (IDE画面右下を確認)
- COMポートは正しく指定されていますか? (IDE画面右下を確認)
- “/dev/ttySxx: Permission denied”エラーが出る場合、転送に失敗したlsz.exeのプロセスが残っている場合があります。Arduino IDEをすべて終了、Edisonの電源をoff、タスクマネージャーから、bash.exeとlsz.exeを終了させてから再度試してみてください
• ArduinoのAPIが分からない“ヘルプ”-”リファレンス”を開くと、API説明のHTMLページが開きます。有志による日本語のページもありますhttp://www.musashinodenpa.com/arduino/ref/ (日本語)
• MRAAのサンプルコードがほしいGitHubに行けば、たくさんサンプルがあります。C/C++/JavaScript/Pythonなどで書かれていますhttps://github.com/intel-iot-devkit/mraa/tree/master/examples
9. 困ったら
MRAAを用いた開発環境のご紹介インテル株式会社ソフトウェア技術統括部新井雅海
MRAAとは
46
https://github.com/intel-iot-devkit/mraa
MRAAとは
47
https://github.com/intel-iot-devkit/mraa
Python/JavaScript/C++/Cから
Arduinoの端子及びEdisonのI/Oを非常に簡単に操作できるライブラリ
GPIO / JavaScript
48
varmraa = require("mraa");
var x = newmraa.Gpio(13);x.dir(mraa.DIR_OUT);x.write(1);
Analog In / Python
49
importmraa
x =mraa.Aio(0)print (x.read())
各種規格の対応状況
50
GPIO Analog In I2C PWM SPI
Galileo 〇 〇 〇 〇 〇
Galileo Gen2 〇 〇 〇 〇 〇
Edison 〇 〇(※1) 〇 〇 〇
*1:Arduino Expansion Board Only
Intel® XDK IoT Editionを用いた開発環境のご紹介インテル株式会社ソフトウェア技術統括部新井雅海
Edison/Galileo用テンプレート
52
Intel® XDK IoT Edition
53
Intel® XDK IoT Edition
54
Intel® XDK IoT Edition
55
アップロードボタン
Intel® XDK IoT Edition
56
インストールボタン
Intel® XDK IoT Edition
57
インストールボタン
Intel® XDK IoT Edition
58
停止ボタン
Intel® XDK IoT Edition
59
実行ボタン
Intel® XDK IoT Edition
60
デバッグボタン
デバッグモード
61
インストールボタン
デバッグモード
62
インストールボタン
デバッグモード
63
インストールボタン
Intel® XDK IoT Edition
64
設定ボタン
Intel® XDK IoT Edition
65
コンソールボタン
スマホ/タブレット用アプリ開発
66
Legal Disclaimer
INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR
OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT AS PROVIDED IN INTEL'S TERMS AND CONDITIONS
OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING
TO SALE AND/OR USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.
A "Mission Critical Application" is any application in which failure of the Intel Product could result, directly or indirectly, in personal injury or death. SHOULD YOU
PURCHASE OR USE INTEL'S PRODUCTS FOR ANY SUCH MISSION CRITICAL APPLICATION, YOU SHALL INDEMNIFY AND HOLD INTEL AND ITS
SUBSIDIARIES, SUBCONTRACTORS AND AFFILIATES, AND THE DIRECTORS, OFFICERS, AND EMPLOYEES OF EACH, HARMLESS AGAINST ALL CLAIMS
COSTS, DAMAGES, AND EXPENSES AND REASONABLE ATTORNEYS' FEES ARISING OUT OF, DIRECTLY OR INDIRECTLY, ANY CLAIM OF PRODUCT
LIABILITY, PERSONAL INJURY, OR DEATH ARISING IN ANY WAY OUT OF SUCH MISSION CRITICAL APPLICATION, WHETHER OR NOT INTEL OR ITS
SUBCONTRACTOR WAS NEGLIGENT IN THE DESIGN, MANUFACTURE, OR WARNING OF THE INTEL PRODUCT OR ANY OF ITS PARTS.
Intel may make changes to specifications and product descriptions at any time, without notice. Designers must not rely on the absence or characteristics of any features
or instructions marked "reserved" or "undefined". Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities
arising from future changes to them. The information here is subject to change without notice. Do not finalize a design with this information.
The products described in this document may contain design defects or errors known as errata which may cause the product to deviate from published
specifications. Current characterized errata are available on request.
Contact your local Intel sales office or your distributor to obtain the latest specifications and before placing your product order.
Copies of documents which have an order number and are referenced in this document, or other Intel literature, may be obtained by calling 1-800-548-4725, or go
to: http://www.intel.com/design/literature.htm
Intel, Quark, Look Inside and the Intel logo are trademarks of Intel Corporation in the United States and other countries.
The Bluetooth® word mark and logos are registered trademarks owned by Bluetooth SIG, Inc. and any use of such marks by Intel is under license.
Other names and brands may be claimed as the property of others.
Copyright ©2014 Intel Corporation.
Risk Factors
The above statements and any others in this document that refer to plans and expectations for the second quarter, the year and the future are forward-
looking statements that involve a number of risks and uncertainties. Words such as “anticipates,” “expects,” “intends,” “plans,” “believes,” “seeks,”
“estimates,” “may,” “will,” “should” and their variations identify forward-looking statements. Statements that refer to or are based on projections, uncertain
events or assumptions also identify forward-looking statements. Many factors could affect Intel’s actual results, and variances from Intel’s current
expectations regarding such factors could cause actual results to differ materially from those expressed in these forward-looking statements. Intel
presently considers the following to be important factors that could cause actual results to differ materially from the company’s expectations. Demand for
Intel's products is highly variable and, in recent years, Intel has experienced declining orders in the traditional PC market segment. Demand could be
different from Intel's expectations due to factors including changes in business and economic conditions; consumer confidence or income levels; customer
acceptance of Intel’s and competitors’ products; competitive and pricing pressures, including actions taken by competitors; supply constraints and other
disruptions affecting customers; changes in customer order patterns including order cancellations; and changes in the level of inventory at customers.
Intel operates in highly competitive industries and its operations have high costs that are either fixed or difficult to reduce in the short term. Intel's gross
margin percentage could vary significantly from expectations based on capacity utilization; variations in inventory valuation, including variations related to
the timing of qualifying products for sale; changes in revenue levels; segment product mix; the timing and execution of the manufacturing ramp and
associated costs; excess or obsolete inventory; changes in unit costs; defects or disruptions in the supply of materials or resources; and product
manufacturing quality/yields. Variations in gross margin may also be caused by the timing of Intel product introductions and related expenses, including
marketing expenses, and Intel's ability to respond quickly to technological developments and to introduce new products or incorporate new features into
existing products, which may result in restructuring and asset impairment charges. Intel's results could be affected by adverse economic, social, political
and physical/infrastructure conditions in countries where Intel, its customers or its suppliers operate, including military conflict and other security risks,
natural disasters, infrastructure disruptions, health concerns and fluctuations in currency exchange rates. Intel’s results could be affected by the timing of
closing of acquisitions, divestitures and other significant transactions. Intel's results could be affected by adverse effects associated with product defects
and errata (deviations from published specifications), and by litigation or regulatory matters involving intellectual property, stockholder, consumer,
antitrust, disclosure and other issues, such as the litigation and regulatory matters described in Intel's SEC filings. An unfavorable ruling could include
monetary damages or an injunction prohibiting Intel from manufacturing or selling one or more products, precluding particular business practices,
impacting Intel’s ability to design its products, or requiring other remedies such as compulsory licensing of intellectual property. A detailed discussion of
these and other factors that could affect Intel’s results is included in Intel’s SEC filings, including the company’s most recent reports on Form 10-Q, Form
10-K and earnings release.
Rev. 4/15/14