Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
M5Stack Core2とAlexaでインターフォンに自動で対応してくれるIoTデバイスを作...
Search
ufoo68
December 21, 2021
Technology
760
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
M5Stack Core2とAlexaでインターフォンに自動で対応してくれるIoTデバイスを作りたかった話
ufoo68
December 21, 2021
More Decks by ufoo68
See All by ufoo68
BlenderをCodexで動かす
ufoo68
1
650
改めて考えるOSSのあり方について
ufoo68
0
82
文法で学ばないJavaScript
ufoo68
0
93
Cookieとは?
ufoo68
1
100
今更ながら、開発現場での生成AI活用について
ufoo68
0
96
28歳独身エンジニア 婚活してみた
ufoo68
0
49
OpenAIでクッキー型を作る
ufoo68
1
82
初めて開発リーダーをやってみた話
ufoo68
0
160
M5Stack用の指紋認証デバイスを試す
ufoo68
0
950
Other Decks in Technology
See All in Technology
2026-09-10 【Snowflake World Tour Tokyo 2026】dbt Core と Snowflake で実現する多層的なデータガバナンス / Multi-Layered Data Governance Powered by dbt Core and Snowflake
civitaspo
0
110
grill-me(grilling):AI駆動開発を超助けてくれるSkill / grill me
mathbullet
0
110
AndroidでHDRメディアを「壊さずに」扱う
chigichan24
0
410
#jawssonic2026 あの時代が悪かった ~動かなかったSageMakerと共に迎えたイベント当日~
ktkn1129
0
130
エンタープライズInnerSourceと開発者ポータル
nogikazuma
1
110
Kiro Crewしか勝たん!?
miu_crescent
PRO
0
180
AIで仕事のやり方を変える
matsu7874
1
950
設計の世代交代を乗り越える、14年続くAndroidアプリの開発戦略
sansantech
PRO
1
150
Sony-DroidKaigi2026
sony
1
320
Self Healing Rollouts: Automating Production Fixes with Agentic AI
kdubois
0
160
【視聴者参加型!】AWSセキュリティアンチパターンクイズ
syoshie
0
450
Beyond the Hype: Practical AI for Your Oracle Database with MCP
thatjeffsmith
1
280
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
510
Everyday Curiosity
cassininazir
0
310
The Curse of the Amulet
leimatthew05
2
14k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
260
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
560
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
Transcript
M5Stack Core2とAlexaでインターフォンに自動 で対応してくれるIoTデバイスを作 @IoTLT vol.82
M5Stack Core2とAlexaでインターフォンに自動 で対応してくれるIoTデバイスを作 りたかった話... @IoTLT vol.82
自己紹介 • 松永勇太(27歳男性) • 滋賀県在住 • エンジニア3年生 • たまにお絵かきをする
最近の出来事1 滋賀に引っ越しました
最近の出来事2 転職しました
今回の内容 12/6のIoTLTアドベントカレンダー投稿分です
新居でやることは?? そうだね、スマートホーム化だね。
スマートホーム化のオトモ スマートリモコンとAlexa
やりたいこと こんなんをAlexaで操作したい • M5Stack Core2 • M5Stack用Servo2モジュール • サーボモーター
まずはM5Stack一式を購入 合計1万くらい (まあまあの出費)
開発編
ソースコード全容 https://github.com/ufoo68/alexa_intercom
PlatformIOを使ってみる このArduinoIDEからの卒業♪
PlatformIOのいいところ • vscode拡張なので、vscodeユーザーにとっては使い慣れたエディタでコーディング ができるので快適 • npmのような特定のプロジェクトに特定のバージョンのライブラリを依存させるよう な、モジュール管理ができる • gitでの開発がやりやすいフォルダ構造になっていて、デフォルトで.gitignoreが用 意されている
サーボモーターを動かす 基本的には公式のサンプルコードがあるのでコピペ M5.begin(true, true, true, false, kMBusModeInput); Wire.begin(21, 22); なのですが、M5Stack
Core2でServo2モジュールを使う場合は、 以下の初期設定をしよう!!
動いた
OTAで無線開発しよう OTAとは? • Over The Airのこと • アプリケーションを遠隔でアップデートをすることができる仕組み • 今回はWiFiを経由
ネット記事のコードをコピペでOK void otaSetup() { ArduinoOTA.setHostname("m5stack-core2"); ArduinoOTA .onStart([]() { String type;
if (ArduinoOTA.getCommand() == U_FLASH) type = "sketch"; else // U_SPIFFS type = "filesystem"; Serial.println("Start updating " + type); }) .onEnd([]() { Serial.println("\nEnd"); }) .onProgress([](unsigned int progress, unsigned int total) { Serial.printf("Progress: %u%%\r", (progress / (total / 100))); }) .onError([](ota_error_t error) { Serial.printf("Error[%u]: ", error); if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed"); else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed"); else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed"); else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed"); else if (error == OTA_END_ERROR) Serial.println("End Failed"); }); ArduinoOTA.begin(); } PlatformIO向けの記事でなくても 基本は動くと思います
Alexaデバイス化しよう fauxmoESPを使う • ESP32をPhilips Hue化させるライブラリ • 名目上はAlexaからHueへのライトON/OFF(もしくは明るさ)制御を利用してESP32 の周辺機器を制御する • 過去のIoTLTで紹介された有名(だと思う)ライブラリ
Alexaを騙せ!デバイス追加を騙せ! Alexa用アプリで連携する
動いた
ここから先はおまけ
オチその1 壁紙用両面テープじゃ重さに耐 えきれない🙅
オチその2 サーボモーターの固定が甘いので サーボモーター自体が浮く🙅
まとめ • PlatformIOでvscodeを使った快適なマイコン開発ができる • Servo2モジュールをM5Stack Core2で使うには初期設定の魔改造が必要 • OTAでUSBケーブルいらずのデバッグが可能に • fauxmoESPでM5StackをHue化できる
残った課題 賃貸の壁であとを残さずに、 M5Stackとサーボモーターを壁に取り付ける方法