3
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ESP32のBLEを使うための環境のセットアップ

Last updated at Posted at 2018-05-02

ESP32開発ボード

秋月電子のESP32-DevKitC ESP-WROOM-32開発ボードとAliExpressで購入したWemos Lolin32を使用します。
Wemos Lolin32のページ見たら「Retired」ってありました。購入したのは2017年秋頃なので古いボードですね。
秋月電子のボードメインで記載していこうと思います。

Arduino IDEへのセットアップ

自分はESP-WROOM-02やArduino nano, pro mini, pro microも使用しているので、ESP32も同じ環境で使用したいのでArduino IDEで使用できるようにします。プラットフォームはWindows 10です。

Arduino core for the ESP32のダウンロード

[Arduino core for the ESP32]
(https://github.com/espressif/arduino-esp32 "")ライブラリをgitから入手します。
cloneするかZIPファイルをダウンロードして展開します。

Arduino core for the ESP32の配置

今回はZIPファイルをダウンロードしました。展開する前にArduino IDEのユーザファイルが保存されているディレクトリを確認します。
自分の場合は下記ディレクトに配置しています。

C:\Users\UserName\Documents\Arduino

上記ディレクトリの「hardware」の下に「espressif」を作成し、更に「espressif」の下に「esp32」を作成します。
先程ダウンロードしたArduino core for the ESP32ライブラリを「esp32」フォルダ配下に展開します。ZIPファイルを展開するとフォルダ「arduino-esp32-master」ができますが、このフォルダ内のファイルを「esp32」の配下に配置します。

BLEライブラリのダウンロードと配置

Arduino core for the ESP32と同様にBLEライブラリ[ESP32 BLE for Arduino]
(https://github.com/nkolban/ESP32_BLE_Arduino "")をcloneかZIPファイルをダウンロードします。
展開先は先ほど配置したArduino core for the ESP32配下にある「libraries」フォルダの下の「BLE」フォルダです。

get.exeの実行

「esp32」フォルダ配下の「tools」フォルダにget.exeファイルがあります。「管理者として実行(A)」で実行します。
実行すると、ターミナル画面が表示され、ファイルの取得や更新処理が行われます。

Arduino IDEの起動と確認

Arduino IDEを起動し、ボードとしてESP32が選択できようになっている確認します。
「ESP32 Arduino」というグループに各種ボードが表示されていればOKです。
次に、「スケッチ例」を確認します。「ESP32」と「ESP32 BLE Arduino」が表示されていればOKです。

今後の予定

温度・気圧センサ(BMP280)や超音波距離センサ(HC-SR04)で取得したデータをBLE Notifyで通知し、取得できるようにしたいと思います。
Centre側で値を取得できた後、デバッグではターミナルにprint、その後はgoogle spread sheetに保存し、google data studioで可視化できればと思います。

3
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?