0
0

More than 3 years have passed since last update.

toio準備1

Last updated at Posted at 2020-05-01

[概要]
node.js/nodist/noble/yarnなどのインストール
Bluetoothのドライバ更新
Bluetooth機器の検出


機材
TOIOセット(バリューパックがよい)
Bluetoothドングル (リストにあるもの)
スイッチサイエンス開発者用シート


(あ) conda でpython2.7環境を作る
conda create -n py27 python=2.7 anaconda
 
(い)
Node.js をインストール
 node -v v12.16.3
nodist 0.9.1 //nodist は Node.js のバージョンを管理するツール。
 → npm -v 6.14.4 も入る。

noble : Node.jsでBluetooth LEを扱うためのモジュールです。

追記:npm config set msvs_version 2015 とVisualStudioのVERを明示した方がよいそう。
npm install noble : エラーでる →Powershell 管理者モードでおこなう
npm install --global windows-build-tools :
npm install noble : 再確認
(参考)
◆ Windows10にnobleをインストールする https://qiita.com/s_nkg/items/3f27328e108d7fa8d076
◆ [Windowsでnpm installしてnode-gypでつまずいた時対処方法] https://qiita.com/AkihiroTakamura/items/25ba516f8ec624e66ee7

(う)
Bluetoothアダプタのデバイスドライバを、ZadigというツールでWinUSBというドライバに書き換える必要があります。
image.png
確認:Node.jsから周辺のBLEデバイスを探すサンプル

npm init -y
npm i --save noble

node app.js

手順まとめ
npm install noble
npm install --global windows-build-tools
npm install noble
デバイスドライバの差し替え

npm init -y
npm i --save noble
node app.js

これでbluetoothデバイスを認識するところまでいけた。

image.png

0
0
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
0
0