Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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
730
改めて考えるOSSのあり方について
ufoo68
0
88
文法で学ばないJavaScript
ufoo68
0
100
Cookieとは?
ufoo68
1
100
今更ながら、開発現場での生成AI活用について
ufoo68
0
100
28歳独身エンジニア 婚活してみた
ufoo68
0
56
OpenAIでクッキー型を作る
ufoo68
1
84
初めて開発リーダーをやってみた話
ufoo68
0
160
M5Stack用の指紋認証デバイスを試す
ufoo68
0
960
Other Decks in Technology
See All in Technology
メルカリにおけるAI時代の高速プロトタイピング基盤「Arca」
ryotarai
17
13k
Apache Iceberg が拓く AI 時代のオープンレイクハウス
tomtanaka
0
190
「今盗んで、後で解く」に備える ― AWSのポスト量子暗号入門
yama3133
2
270
ScotSecure West 2026 - Glasgow
raybugg
0
200
C#コードの結合を可視化する Roslyn解析による設計改善と リファクタリング判断
dora56
0
960
20260915deck.gl-raster を使ってみた
rena1208
0
140
CI/CDではもう遅い - 人とAIが迂回しないDevSecOps Verify基盤の再設計 -
kintotechdev
1
400
地方移住と都心キャリアの両立は「金・時間・人」のリソースをフル活用すれば実現できる!〜Snowflake女子会 vol.8
snowwmn0824
0
130
Azure Copilot Resiliency Agentをいろいろ試してみる
tomokusaba
0
130
.NET WebAssemblyで実現するクライアントサイドAI推論:NuGetからViteまで、2つのエコシステムを繋ぐビルド戦略
yamachu
1
1.1k
DORA_Metrics.pdf
wagnerfusca
1
120
Kiro Meetup #8 Kiro アップデート (2026/3/21〜2026/9/24)
katzueno
1
300
Featured
See All Featured
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
550
A Tale of Four Properties
chriscoyier
163
24k
Typedesign – Prime Four
hannesfritz
42
3.2k
The SEO identity crisis: Don't let AI make you average
varn
0
560
How to Talk to Developers About Accessibility
jct
2
560
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
390
How to build a perfect <img>
jonoalderson
1
6k
How Software Deployment tools have changed in the past 20 years
geshan
2
34k
KATA
mclloyd
PRO
35
16k
30 Presentation Tips
portentint
PRO
1
410
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
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とサーボモーターを壁に取り付ける方法