Control Robots From Your Phone Using Commander - The Hybrid Group

Control Robots From Your Phone Using Commander


With the ongoing evolution of the Internet of Things, your phone will become your primary source of control for the world around you. We would like to present to you our solution Commander (, a mobile app to trigger commands and receive events from robots and devices.

Cylon.js PhoneGap Spark Commander list layout Commander connection

You can have different types of user interfaces for the various interactions with your devices, depending on your needs. We currently support the following controls:

  • D-pad
  • Command list
  • Joystick

How It Works

Commander uses the Common Protocol for Programming Physical I/O to establish communication with the Cylon.js, Gobot or Artoo APIs.

It works based on layouts that can be customized to trigger custom actions for your own programs. You can easily create your own command sets that match your own robotic applications.

We have developed Commander as open source, using the fantastic PhoneGap and Ionic Framework. Checkout our site at for more information, or to checkout the source code.

Control a Sphero Using a D-pad Layout and Cylon.js

To show how Commander works, we'll show how to control a Sphero robot from your phone using Commander.

First we'll create a Cylon program to listen for commands and control the Sphero:

var Cylon = require('cylon');

  api: {
    ssl: false,
    port: '8080',
    host: '',


  name: 'sphero-dpad',
  connection: { name: 'sphero', adaptor: 'sphero', port: '/dev/tty.Sphero-YBW-RN-SPP' },
  device: { name: 'sphero', driver: 'sphero' },

  move: function(direction) {
    var my = this;

    switch (direction) {
      case "up":
        my.sphero.roll(100, 0);
      case "down":
        my.sphero.roll(100, 180);
      case "left":
        my.sphero.roll(100, 270);
      case "right":
        my.sphero.roll(100, 90);

    setTimeout(function() {
    }, 2000);

    return "ok";
  commands: function() {
    return {
      move: this.move

Then we'll install Commander from either the Google Play store, or the iTunes App store.

Commander connection Commander connection

After you open the app, go to the menu option 'Connection' and set the api host for your cylon program.


Commander connection

Next open 'Command sets' menu option and paste this URL:

Commander command set

Now click on 'Load' and after command set is loaded click on 'Use' to open it

Cylon.js PhoneGap Spark

Now you can use the D-pad controls to move the Sphero around.

Have fun!

What's next?

comments powered by Disqus