WebRTC and IoT Devices: Not Another Talking Heads App

This is a guest post from Tsahi Levent-Levi. Tsahi works in the software communications space as an engineer, manager, marketer and CTO. He is the author and editor of bloggeek.me, which focuses on the ecosystem and business opportunities around WebRTC.


Reading this on a web browser? In theory, we could do a video call directly from the page you’re reading. All modern web browsers today support a technology called WebRTC which enables doing just that – adding realtime communications (voice, video and data) to any web application.

In 90% of cases, WebRTC is likened to use cases like Skype or Chat Roulette – services where people conduct online video calls with one another. Check out a great example of that in the how to connect WebRTC with ChatEngine tutorial.

I’d like to take a different angle – looking at how WebRTC fits in the realm of IoT. Funny enough, in 2014, I wrote that IoT and WebRTC don’t really mix. But a lot has happened since then. WebRTC has found a home in many different use cases, and a lot of them surprised me, especially in the world of IoT.

When it comes to IoT and WebRTC, there are two main use case categories: Device-to-Person and Device-to-Cloud.

WebRTC Device-to-Person

Baby monitor, video doorbell, building intercom, nanny cam, surveillance cam — these can all be viewed as IoT devices where the main purpose is to be able to receive and sometimes send real-time audio and video.

The remote control and operation of these devices take place in “signaling land” – that’s where tools like PubNub IoT Device Control plays. Letting users see or hear what’s on the other side – that’s where WebRTC plays a role.

Let’s take the building intercom use case as an example. Think of the intercom as one piece of a smart building deployment, where multiple types of sensors and automation are integrated. For the intercom, a guest would have to select an apartment or an office to ring to. The resident of the apartment will answer that ring over the intercom, from a device in the apartment or from his smartphone. The “closed loop” video, or more accurately, a video chat will take place between the guest and the resident, followed by an opening of the front door of the building.

This example can be broken down into multiple control messages flowing: ring, answer, open door, etc. The conversation itself? That’s a WebRTC session that connects the guest (via intercom device) to the resident (via a person on a mobile device).

The same functionality can be applied to a nanny cam and a parent, where neither person on the other side participates in the conversation, but there’s still a one-way video session.

WebRTC Device-to-Cloud

Switching gears, let’s move onto the device-to-cloud scenario. This one has no users in it. It’s just pure automation.

Think of an electricity service inspection company that uses drones to fly around, sending video feeds of electricity poles and towers to the cloud where the videos are analyzed in realtime to determine whether there’s any malfunction requiring human intervention. We could use other means to send the video towards the cloud service, like WebSockets for example. However, the downside of this is adding latency to the connection and reducing the realtimeliness of our service. It might not be an issue for some scenarios, but for others it might be critical.

WebRTC enables such scenarios to run in realtime – which means cloud decisions based on the video feed and telemetry of the drone can take place in near realtime and not a couple of seconds too late.

Where do we go from here?

Interested in learning more about WebRTC? Check out my online WebRTC training. The introduction module is free to learn, and should give you a better understanding of WebRTC and how it works. Who knows? Maybe it will give you an idea or two on what you can do with WebRTC and your IoT devices.

Try PubNub Today

Share this on facebookShare this on TwitterShare this on Linkedin