VoIP News OnSIP News Events

OnSIP Engineer Takes Over the World With WebRTC Attack Robot

by Kevin Bartley

OnSIP Principal Architect Eric Tamme attempts to take over the world (starting with ClueCon 2014) with a WebRTC-based Attack Robot.

Published: August 13, 2014

Last week at the Dangerous Demos portion of ClueCon 2014, OnSIP Principal Architect Eric Tamme wanted to show that our SIP platform can be used for reasons beyond video and audio calling. As a scalable, robust, WebRTC integrated architecture, The OnSIP Network is the perfect option for developers who want to connect people in innovative ways. But for once in his life, Eric was not interested in connecting people via real-time communications.

What Eric wanted to do was take over the world.

"I wanted to build something interesting and different," Eric said. "Everyone knows how WebRTC can be used for video chat. I hoped to build a project that would show how our SIP platform could be used for all sorts of stuff. That's how I landed on the concept of the Attack Robot."

WebRTC Attack Robot

Meet your doom, earthling! The WebRTC Attack Robot drives across the floor menacingly.

Using nothing more than a repurposed netbook, a multichannel servo controller, a wheeled platform, and a Chrome browser, Eric was able to get his Attack Robot bot to move left, right, up, down, and of course, into attack mode, using an in-browser interface with no plugins. The robot's cart was built with simple wooden wheels and a small platform for the laptop to sit on. To move the robot, Eric employed a mounted servo controller. He initially tried an embedded controller, but he found it was easier to interface with the laptop via a small multichannel servo serial controller, which is plugged into the computer's serial port.

But how could he get SIP to interface with the laptop's servo controlled serial port?

This was the basic design problem of the project. For Eric, the first step involved node.js, a cross-platform runtime environment that allows developers to use JavaScript applications outside of the browser. Eric took SIP.js, our open source JavaScript stack built for SIP-based WebRTC developers, and managed to put it 'inside' of node.js, thus giving him the full capabilities of the SIP.js library without requiring the code to be executed entirely within the browser.

WebRTC Attack Robot Rolling on Floor

The genesis of the Attack Robot was the only time it showed weakness

After setting up SIP.js in node.js, Eric now had the signaling he needed to control the hardware with SIP. This is when he set out to design the command signaling mechanism that would actually instruct the robot where to move. SIP.js pumped its commands into the custom node.js module that was built to interface with the serial port. The commands for the robot's movement were actually controlled by callable JavaScript methods that are triggered by sending custom SIP MESSAGE requests with the commands encoded as JSON message bodies. Thus the robot's movements are enabled by a simple information exchange between the node.js module (serial port) and the browser itself (WebRTC/SIP.js), both of which are connected to each other via the SIP signaling capabilities of The OnSIP Network.

Eric designed a custom webpage on the laptop that auto-answers and turns on its camera when called. After adding some custom logic into the robot webpage, audience members at ClueCon were able to manipulate the robot from their browsers as well. Each button sends a SIP MESSAGE request via SIP.js to the robot running SIP.js within node.js. SIP.js parsed the SIP MESSAGE request body and called the functions exposed via the custom node.js module to interact with the actual servo controller. This allowed Eric to move the robot in various directions. The Attack buttons cause the laptop to release a screeching robot noise from Dr. Who (which signals, among other things, immanent world domination).

WebRTC Attack Robot Controls

The interface that controls the robot directly within the browser

"I enjoyed building it," Eric said. "It was a great experience, and it showed that WebRTC can be used in a variety of relatively unconsidered ways. At its core, WebRTC is basically an effective way to exchange any sort of real-time data within an Internet browser. By leveraging SIP.js inside and outside the browser, I was able to extend the reach of WebRTC into a physical world with relatively little effort. I hope that other developers will try out SIP.js and see what they creative things they can come up with using these technologies."

World domination will have to wait for another day. But right now, Eric is happy with the results of his Attack Robot experiment. Now he can get back to expanding The OnSIP Network and building real-time communications applications that operate entirely in-browser. But one suspects the Attack Robot will always stick its head out of Eric's closet, eager for its owner to give it another chance at taking over the world.

Eric Tamme presenting WebRTC Attack Robot

Eric Tamme shares his Attack Robot at ClueCon 2014