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
Node.js + Raspberry Piで お手軽IoT
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Masaki Koyanagi
June 05, 2017
Programming
2k
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.4k
WebHID API でリングコン のセンサー値を取得してみた
mascii
1
1.2k
Pros and Cons で考える Vue 2 Composition API
mascii
4
1.2k
Joy-ConをJavaScriptでプレゼンリモコンにした話
mascii
0
650
TypeScript で Optional Chaining を使ってみた
mascii
1
810
Vue.jsでCSS Modulesを使ってみた
mascii
0
190
不変量
mascii
1
260
Nuxt.js+Firebaseで個人サービスを作るまで
mascii
1
2.6k
JavaScriptのバージョンの話
mascii
1
2.5k
Other Decks in Programming
See All in Programming
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
350
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
300
Crash Auto Pipelines
veronikapj
1
380
PyConTW 2026 - AI Coding 不只是工具升級, 區域醫院醫療資訊系統協作開發與資訊團隊轉型實踐
cclai999
0
240
TanStack Vue Query と Pinia Colada から学ぶ非同期状態の型設計
aoshi
0
620
Getting Started with Vibe Coding
miccheng
0
180
AI-Powered Domain-Driven Design
ziobrando
0
400
Modernizing iOS Apps
seyfoyun
0
150
Rails初心者がパスキーを実装してみて大変だったこと
ktombow
0
150
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
200
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
3
1.7k
Inertia Rails: The One-Person Framework with React & Friends
skryukov
0
380
Featured
See All Featured
Writing Fast Ruby
sferik
630
63k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
970
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
810
Utilizing Notion as your number one productivity tool
mfonobong
4
640
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
670
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.6k
Heart Work Chapter 1 - Part 1
lfama
PRO
10
37k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
880
The Cult of Friendly URLs
andyhume
79
7.1k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
460
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してみてください