ふるお〜と!- FullAuto

AI・ロボットが普及しBI(ベーシックインカム)が早急に実現されることを願う元ニートのブログ

ふるお〜と!-FullAuto

OAK IoT Deviceを試してみる

OAK IoT Deviceは現在Arduino IDEに対応していないので、
ESP-IDFをインストールする。
※Anaconda仮想環境でやるとエラー沼にハマる。やらなくてもハマる。

接続

PCとOAK-D USB(type-c)を接続する。

PCとOAKのUSB(type-B)端子(ESP32)と接続する。
ttyUSB0が現れることを確認する。

/dev/ttyUSB0

外部IN端子は使用しなくても動く。

ビルド

ESP-IDFの例にならうと ~/esp配下にプロジェクトが配置されるので、
例にならってそこへdemoをgit cloneする。

Hello World

$ cd ~/esp
$ git clone https://github.com/luxonis/esp32-spi-message-demo
$ git submodule update --init --recursive
$ cd esp32-spi-message-demo
$ cd hello_world
$ idf.py build
$ sudo chmod 666 /dev/ttyUSB0
$ idf.py -p /dev/ttyUSB0 flash monitor

「CTRL + 5」で出力を止めることができる。

Can't exit console by pressing Crtl+] (IDFGH-1930) · Issue #4129 · espressif/esp-idf · GitHub

その他のデモについて

ESP32側

jpg_webserver_demo

$ cd jpeg_webserver_demo
$ idf.py menuconfig
# go to `Example Configuration` ->
#    1. WIFI SSID: WIFI network to which your PC is also connected to.
#    2. WIFI Password: WIFI password
$ idf.py build
$ idf.py -p /dev/ttyUSB0 flash monitor

monitorに

I (5679) example_connect: - IPv4 address: 192.168.0.12

のように表示されるのでそのIPアドレスにブラウザでアクセスする。

OAK側

https://github.com/luxonis/depthai-experiments/tree/master/gen2-spi

にgen2に対応したPythonスクリプトがある。

esp32-spi-message-demoのmasterはgen1対応? なので動かないデモがいくつかある。

参考

Getting started with OAK IoT devices — DepthAI documentation | Luxonis