Using IPFS for IoT Communications

@ChrisMatthieu
Mar 31, 2017 · 2 min read

Have you heard about the IPFS project? It’s an open source project on a mission to develop a distributed file system. It feels like BitTorrent + Git smashed together to allow anyone running the IPFS daemon to access each other’s files in a peer-to-peer (P2P) fashion.

They recently released an experimental pubsub feature on the IPFS platform. Pubsub basically lets you “subscribe” to a channel or topic allowing you to receive messages from other devices that “publish” messages to that same channel or topic.

This got me thinking… MQTT is one of the most popular IoT messaging protocols. It, too, uses a similar pubsub model. It’s downside is that it requires a broker in the cloud or on the edge of a network to manage message deliveries. If you could do the same thing but in a more resilient manner such as within a distributed network, (IPFS), your devices could interact across networks — even without the cloud or DNS!

Here’s quick, working proof-of-concept of my idea in action!

Here’s the code:

You can turn the Arduino LED on/off by publishing messages via IPFS from anywhere in the world.

> ipfs pubsub pub general on

> ipfs pubsub pub general off

You could just as easily automate the toggling of this LED using the following script for publishing messages.

I believe that IPFS has great potential in the Internet of Things domain.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store