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
Masaki Koyanagi
June 05, 2017
Programming
1.9k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Node.js + Raspberry Piで お手軽IoT
Masaki Koyanagi
June 05, 2017
More Decks by Masaki Koyanagi
See All by Masaki Koyanagi
Vitestを使った型テストの始め方
mascii
6
3.3k
WebHID API でリングコン のセンサー値を取得してみた
mascii
1
1.1k
Pros and Cons で考える Vue 2 Composition API
mascii
4
1.2k
Joy-ConをJavaScriptでプレゼンリモコンにした話
mascii
0
630
TypeScript で Optional Chaining を使ってみた
mascii
1
790
Vue.jsでCSS Modulesを使ってみた
mascii
0
170
不変量
mascii
1
230
Nuxt.js+Firebaseで個人サービスを作るまで
mascii
1
2.6k
JavaScriptのバージョンの話
mascii
1
2.4k
Other Decks in Programming
See All in Programming
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
0
140
1B+ /day規模のログを管理する技術
broadleaf
0
130
エンジニア向け会社紹介/Findy Company Profile
findyinc
6
360k
使用 Meilisearch 建立新聞搜尋工具
johnroyer
0
110
エンジニアと一緒にテストコードの設計と実装を改善した話
mototakatsu
0
250
技術記事、 専門家としてのプログラマ、 言語化
mizchi
14
7.3k
act1-costs.pdf
sumedhbala
0
170
The Bowling Game- From Imperative to Functional Programming - Part 1
philipschwarz
PRO
0
290
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
5.7k
AIキャラアプリkaiwaの低遅延音声通話基盤をどう作ったか - AWS Gravitonで支える低遅延・低コストAI Agent基盤
mogamit
0
160
音楽のための関数型プログラミング言語mimiumにおける多段階計算の活用
tomoyanonymous
1
280
Mujeres en SEO Summit 2026 - Greatest Disaster Hits en Web Performance
guaca
0
240
Featured
See All Featured
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
480
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
340
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
260
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
200
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
410
Agile that works and the tools we love
rasmusluckow
331
22k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Utilizing Notion as your number one productivity tool
mfonobong
4
350
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してみてください