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
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.3k
WebHID API でリングコン のセンサー値を取得してみた
mascii
1
1.1k
Pros and Cons で考える Vue 2 Composition API
mascii
4
1.2k
Joy-ConをJavaScriptでプレゼンリモコンにした話
mascii
0
640
TypeScript で Optional Chaining を使ってみた
mascii
1
800
Vue.jsでCSS Modulesを使ってみた
mascii
0
180
不変量
mascii
1
250
Nuxt.js+Firebaseで個人サービスを作るまで
mascii
1
2.6k
JavaScriptのバージョンの話
mascii
1
2.4k
Other Decks in Programming
See All in Programming
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
390
Ghostty + Neovimで作る 透明でカッコ良い開発環境
j341nono
0
150
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
6.1k
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
470
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
430
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
440
Are APIs Still Relevant in the AI Era?
soyuka
0
410
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
20
20k
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
380
iOSDC2026登壇資料.pdf
riofujimon
0
200
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
140
Androidだけじゃない、DroidKaigiで広がった私の技術スタック
akkeylab
0
110
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
sira's awesome portfolio website redesign presentation
elsirapls
0
440
Visualization
eitanlees
153
17k
Navigating Weather and Climate Data
rabernat
0
540
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
780
Crafting Experiences
bethany
1
370
How to make the Groovebox
asonas
2
2.5k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
WCS-LA-2024
lcolladotor
0
840
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
460
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
530
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してみてください