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
Node.js + Raspberry Piで お手軽IoT
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Masaki Koyanagi
June 05, 2017
Programming
1.9k
2
Share
Node.js + Raspberry Piで お手軽IoT
Masaki Koyanagi
June 05, 2017
More Decks by Masaki Koyanagi
See All by Masaki Koyanagi
Vitestを使った型テストの始め方
mascii
6
3.2k
WebHID API でリングコン のセンサー値を取得してみた
mascii
1
1.1k
Pros and Cons で考える Vue 2 Composition API
mascii
4
1.2k
Joy-ConをJavaScriptでプレゼンリモコンにした話
mascii
0
610
TypeScript で Optional Chaining を使ってみた
mascii
1
770
Vue.jsでCSS Modulesを使ってみた
mascii
0
160
不変量
mascii
1
220
Nuxt.js+Firebaseで個人サービスを作るまで
mascii
1
2.5k
JavaScriptのバージョンの話
mascii
1
2.4k
Other Decks in Programming
See All in Programming
How We Benchmarked Quarkus: Patterns and anti-patterns
hollycummins
1
190
Making the RBS Parser Faster
soutaro
0
700
ハーネスエンジニアリングとは?
kinopeee
13
6.9k
GoogleCloudとterraform完全に理解した
terisuke
1
190
Symfony AI in Action - SymfonyLive Berlin 2026
chr_hertel
1
140
ソースコード→AST→オペコード、の旅を覗いてみる
o0h
PRO
1
130
エラー処理の温故知新 / history of error handling technic
ryotanakaya
7
1.9k
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
1.2k
ローカルLLMでどこまでコードが書けるか / How much code can be written on a local LLM
kishida
2
350
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
170
Terraform言語の静的解析 / static analysis of Terraform language
wata727
1
140
AI時代になぜ書くのか
mutsumix
0
370
Featured
See All Featured
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
230
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
350
4 Signs Your Business is Dying
shpigford
187
22k
Building AI with AI
inesmontani
PRO
1
980
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
520
エンジニアに許された特別な時間の終わり
watany
106
240k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
190
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.2k
Context Engineering - Making Every Token Count
addyosmani
9
880
ラッコキーワード サービス紹介資料
rakko
1
3.3M
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
340
Transcript
Node.js + Raspberry Piで お手軽IoT We Are JavaScripters! @8th 1st
Day Name: Koyanagi Twitter: @mascii_k
自己紹介 小柳 昌生 (こやなぎ まさき) Twitter: @mascii_k 2015/07~2017/03 Web系エンジニアインターン 2017/03
東京理科大学大学院 修了 2017/04〜 SIerシステムエンジニア
でJSも喜ぶ IoTデバイスを作った話 1
学生(インターン)時代に作ったもの 学習塾向け入退室管理機器(Raspberry Piベース) ▸ NFCカードが持つIDを活用 ▸ 開発言語はJS(Node.js) + Python 2.x
▸ JSが塾に来てカードをタッチすると親にプッシュ通知 が届く仕組み
Pythonが必要な理由 ▸ ソニーPasoriの最新型 “RC-S380”を扱えるライブラ リが”nfcpy”しかない ▹ 最新といっても 2012/10 発売 ▹
libnfc が RC-S380 に対応していない ▸ 前回IoTLTの登壇者の方もPasori利用時 は Go + Python(nfcpy) だそそうです
どんなnpmパッケージを使ったか ▸ request ▹ http / https通信を行うためのクライアント ▸ onoff ▹
GPIO上のLEDをON/OFFする ▸ python-shell (+ nfcpy) ▹ 標準入出力でJSONを受け取る {"id":"01010456789ABCDE"}
IoT≠電子工作 2
Raspberry PiとテレビをHDMI接続してテレビの ON/OFFを確認する : node-cec http://qiita.com/mascii/items/132c064c30e321dea911
IoT≠電子工作 ▸ Raspberry Pi に4Gモデム(USBデバイス)とテレビ (HDMIケーブル)を繋げるだけでもIoTできる ▹ 「電子工作をしないIoT」もある
npmパッケージを作った話 3
Node.jsでもNFCを使ってほしい! ▸ HDMIのように、配線してnpmパッケージ入れるだけ でPasoriが使えたらいいのに... ▹ JSだけ書きたい... ▹ Python 書きたくない... ▹
JSなら非同期な処理が書きやすい ▸ npmパッケージを作ってみた!
node-nfcpy-id
デモ ▸ 私のPASMOをタッチすると LEDが青色に光り、それ以外 のカードをタッチするとLEDが 赤色に光る ▸ npmパッケージ ▹ node-nfcpy-id
▹ onoff
まとめ 4
まとめ ▸ request, Express, socket.ioなどRaspberry Pi 専用でないnpmパッケージも活用できる ▸ node-nfcpy-id というnpmパッケージ作った
▹ 近日中にQiitaに記事アップします ▸ 電子工作しないIoTもできる。そう、JSならね。
THANKS! Node.js + Raspberry Piでお手軽IoTしてみてください