メインコンテンツへスキップ

開発環境の構築

開発環境の構築

【1.開発環境のダウンロード】

https://www.arduino.cc

SOFTWARE

image.png

DOWNLOAD

1529744636.png

IDE

1529890195.png

image-1.png

該当するPC(ここではmacOS)用のIDEをダウンロードする。

image-2.png

macOS

image-3.png

ダウンロード

image-4.png

ダウンロード結果(例)
Arduino 1.8.5
arduino-1.8.5-macosx.zip Mac OS X 10.7 Lion or newer
arduino-1.8.5-windows.zip Windows app Requires Win 8.1 or 10


【2.ESP32-DevKitC用のシリアルドライバーをダウンロード】

今回使用するESP32の開発ボード
http://akizukidenshi.com/catalog/g/gM-11819/

1529745075.png

回路図からUSBシリアルの使用ICは「CP2102(Silicon Laboratories)」です。
(主な使用にも明記)

シリアル⇔USB変換チップ: CP2102(Silicon Laboratories)

1529745128.png

Silicon Laboratories社のWebページから該当PC用のUSBドライバーをダウンロードします。

CP210x USB - UART ブリッジ VCP ドライバ
https://jp.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers

image-5.png

macOS用

image-6.png

Release Dates

-------------
CP210x Macintosh OSX VCP Driver 5.0.4    - January 19, 2018
CP210x Macintosh OSX VCP Driver 5.0.3    - November 21, 2017
CP210x Macintosh OSX VCP Driver 5.0.2    - October 12, 2017
,,,,,,,,,,,,,,,,,,

ダウンロード-ドライバー
Mac_OSX_VCP_Driver.zip


【3.開発環境(Arduino)のインストール】

ダウンロードファイルの展開

1529746341.png

アプリケーションフォルダへ移動(もしくは コピー)

1529746365.png

アプリケーションの起動を確認

1529746443.png

1529746468.png

基本ライブラリを最新へUpdate。

 > 「ボードマネージャー…」を選択

1529746503.png

「アップデート可能」のライブラリを確認しすべてをアップデート

1529746528.png

最新へアップデート

1529746551.png

image-7.png


【4.ESP32-DevKitC用のドライバーをインストール】

ESP32-DevKitCを接続してUSBの状態をターミナルで確認

$ ls -l /dev/tty.*
crw-rw-rw-  1 root  wheel   32,   0  6 22 10:28 /dev/tty.Bluetooth-Incoming-Port

PC用のUSBドライバーを展開

1529746652.png

インストールの実行

1529746674.png

1529746696.png

インストール後、ターミナルで確認。

$ ls -l /dev/tty.*
crw-rw-rw-  1 root  wheel   32,   0  6 22 10:28 /dev/tty.Bluetooth-Incoming-Port
crw-rw-rw-  1 root  wheel   32,   2  6 22 12:09 /dev/tty.SLAB_USBtoUART

1529746746.png

インストール後、アプリ「Arduino」で確認。

  ツール > シリアルポート > /dev/tty.SLAB_USBtoUART

一度「終了」。


【5.EPS32関連のArduino環境をインストール】

ESP32 サイト
https://github.com/espressif/arduino-esp32

ESP32関係はArduinoのボードマネージャーではインスツールできないのでESP32のWebページのスクリプトに従ってインストールする。

1529890195.png

インストールスクリプト
https://github.com/espressif/arduino-esp32/blob/master/docs/arduino-ide/mac.md

ターミナルで次を実行

mkdir -p ~/Documents/Arduino/hardware/espressif && \
cd ~/Documents/Arduino/hardware/espressif && \
git clone https://github.com/espressif/arduino-esp32.git esp32 && \
cd esp32 && \
git submodule update --init --recursive && \
cd tools && \

python get.py

実行結果

MacBookPro13-VMWare-Arduino:~ 管理者$ mkdir -p ~/Documents/Arduino/hardware/espressif && \
> cd ~/Documents/Arduino/hardware/espressif && \
> git clone https://github.com/espressif/arduino-esp32.git esp32 && \
> cd esp32 && \
> git submodule update --init --recursive && \
> cd tools && \
> python get.py

macOSのむXcode環境でESP32に不足している場合には新しいデベロッパーツールが必要になる。

Xcodeを使用していない場合も同様。

1529746946.png

お約束の「使用許諾書」の同意。

image-8.png

ダウンロード

1529746969.png

インストール完了

1529746991.png

xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.

Xcodeのツールをインストール後に再度実行。

$ mkdir -p ~/Documents/Arduino/hardware/espressif && cd ~/Documents/Arduino/hardware/espressif && git clone https://github.com/espressif/arduino-esp32.git esp32 && cd esp32 && git submodule update --init --recursive && cd tools && python get.py
 
 
Cloning into 'esp32'...
remote: Counting objects: 8051, done.
remote: Compressing objects: 100% (60/60), done.
……..
……..
……..
Receiving objects: 100% (8051/8051), 115.51 MiB | 727.00 KiB/s, done.
Resolving deltas: 100% (4685/4685), done.
Submodule 'libraries/AzureIoT' (https://github.com/VSChina/ESP32_AzureIoT_Arduino) registered for path 'libraries/AzureIoT'
Submodule 'libraries/BLE' (https://github.com/nkolban/ESP32_BLE_Arduino.git) registered for path 'libraries/BLE'
Cloning into '/Users/管理者/Documents/Arduino/hardware/espressif/esp32/libraries/AzureIoT'...
Cloning into '/Users/管理者/Documents/Arduino/hardware/espressif/esp32/libraries/BLE'...
Submodule path 'libraries/AzureIoT': checked out '67dfa4f31ef88b0938dd87d955612100dea5562e'
Submodule path 'libraries/BLE': checked out 'af865a916795289c8e7e09b091ff2140c33fc3fe'
System: Darwin, Info: Darwin-17.6.0-x86_64-i386-64bit
Platform: x86_64-apple-darwin
Downloading xtensa-esp32-elf-osx-1.22.0-80-g6c4433a-5.2.0.tar.gz
Done
Extracting xtensa-esp32-elf-osx-1.22.0-80-g6c4433a-5.2.0.tar.gz
Downloading esptool-da31d9d-macos.tar.gz
Done
Extracting esptool-da31d9d-macos.tar.gz
Downloading mkspiffs-0.2.2-arduino-esp32-osx.tar.gz
Done
Extracting mkspiffs-0.2.2-arduino-esp32-osx.tar.gz
Renaming mkspiffs-0.2.2-arduino-esp32-osx to mkspiffs
Done
$ 

インストールの確認

「Arduino」アプリケーションを 再起動し確認

「ボードマネージャー…」に「ESP32」関連が追加されていれば成功。

1529747102.png

インストール後のフォルダ構成例

1529747130.png

【※※※※※※※※】

ここまでで、Arduino環境下でESP32を開発する環境が整った事になる。