Giter Site home page Giter Site logo

hybridgroup / cylon Goto Github PK

View Code? Open in Web Editor NEW
4.0K 202.0 355.0 19.58 MB

JavaScript framework for robotics, drones, and the Internet of Things (IoT)

Home Page: https://cylonjs.com

License: Other

JavaScript 99.47% Makefile 0.53%
javascript arduino beaglebone-black raspberry-pi gpio i2c sphero chip iot internet-of-things

cylon's Introduction

Cylon.js

Cylon.js is a JavaScript framework for robotics, physical computing, and the Internet of Things (IoT).

It provides a simple, but powerful way to create solutions that incorporate multiple, different hardware devices concurrently.

Want to use Node.js for robots, drones, and IoT devices? You are in the right place.

Want to use Ruby on robots? Check out our sister project, Artoo.

Want to use Golang to power your robots? Check out our sister project, Gobot.

Build Status:

Build Status Code Climate Code Climate

Getting Started

Installation

All you need to get started on a new robot is the cylon module:

npm install cylon

With the core module installed, now install the modules for whatever hardware support you need. For the Arduino + LED blink example, we'll need the firmata, gpio, and i2c modules:

npm install cylon-firmata cylon-gpio cylon-i2c

Examples

Arduino + LED

The below example connects to an Arduino over a serial connection, and blinks an LED once per second.

The example requires that the Arduino have the Firmata sketch installed; which can be obtained either through the Ardunio IDE or the gort arduino upload firmata command available in gort.

var Cylon = require('cylon');

// define the robot
var robot = Cylon.robot({
  // change the port to the correct one for your Arduino
  connections: {
    arduino: { adaptor: 'firmata', port: '/dev/ttyACM0' }
  },

  devices: {
    led: { driver: 'led', pin: 13 }
  },

  work: function(my) {
    every((1).second(), my.led.toggle);
  }
});

// connect to the Arduino and start working
robot.start();

Parrot ARDrone 2.0

var Cylon = require('cylon');

Cylon.robot({
  connections: {
    ardrone: { adaptor: 'ardrone', port: '192.168.1.1' }
  },

  devices: {
    drone: { driver: 'ardrone' }
  },

  work: function(my) {
    my.drone.takeoff();

    after((10).seconds(), my.drone.land);
    after((15).seconds(), my.drone.stop);
  }
}).start();

Cat Toy (Leap Motion + Digispark + Servos)

var Cylon = require('cylon');

Cylon.robot({
  connections: {
    digispark: { adaptor: 'digispark' },
    leapmotion: { adaptor: 'leapmotion' }
  },

  devices: {
    servo1: { driver: 'servo', pin: 0, connection: 'digispark' },
    servo2: { driver: 'servo', pin: 1, connection: 'digispark' },
    leapmotion: { driver: 'leapmotion', connection: 'leapmotion' }
  },

  work: function(my) {
    my.x = 90;
    my.z = 90;

    my.leapmotion.on('hand', function(hand) {
      my.x = hand.palmX.fromScale(-300, 300).toScale(30, 150);
      my.z = hand.palmZ.fromScale(-300, 300).toScale(30, 150);
    });

    every(100, function() {
      my.servo1.angle(my.x);
      my.servo2.angle(my.z);

      console.log(my.servo1.currentAngle() + ", " + my.servo2.currentAngle());
    });
  }
}).start();

Multiple Spheros + HTTP API Plugin

To use the HTTP API plugin, first install it's NPM module:

$ npm install cylon-api-http

Then it can be used in scripts:

var Cylon = require('cylon');

// tell the HTTP API plugin to listen for requests at https://localhost:4000
Cylon.api("http", { port: 4000 });

var bots = [
  { port: '/dev/rfcomm0', name: 'Thelma' },
  { port: '/dev/rfcomm1', name: 'Louise' }
];

bots.forEach(function(bot) {
  Cylon.robot({
    name: bot.name,

    connections: {
      sphero: { adaptor: "sphero", port: bot.port }
    },

    devices: {
      sphero: { driver: "sphero" }
    },

    work: function(my) {
      every((1).second(), function() {
        console.log(my.name);
        my.sphero.setRandomColor();
        my.sphero.roll(60, Math.floor(Math.random() * 360));
      });
    }
  });
});

// start up all robots at once
Cylon.start();

Fluent Syntax

For those more familiar with jQuery, D3, or other fluent-style JavaScript libraries, Cylon.JS also supports a chainable syntax:

var Cylon = require('cylon');

Cylon
  .robot()
  .connection('arduino', { adaptor: 'firmata', port: '/dev/ttyACM0' })
  .device('led', { driver: 'led', pin: 13 })
  .on('ready', function(bot) {
    setInterval(function() {
      bot.led.toggle();
    }, 1000);
  });

Cylon.start();

Hardware Support

Cylon.js has an extensible syntax for connecting to multiple, different hardware devices. The following 36 platforms are currently supported:

Platform Support
ARDrone cylon-ardrone
Arduino cylon-firmata
Arduino YUN cylon-firmata
AT&T M2X cylon-m2x
Audio cylon-audio
Beaglebone Black cylon-beaglebone
Bebop cylon-bebop
Bluetooth LE cylon-ble
Crazyflie cylon-crazyflie
Digispark cylon-digispark
Electric Imp cylon-imp
Intel Edison cylon-intel-iot
Intel Galileo cylon-intel-iot
Intel IoT Analytics cylon-intel-iot-analytics
Joystick cylon-joystick
Keyboard cylon-keyboard
Leap Motion cylon-leapmotion
MiP cylon-mip
MQTT cylon-mqtt
Nest cylon-nest
Neurosky cylon-neurosky
OpenCV cylon-opencv
Phillips Hue cylon-hue
Pebble cylon-pebble
Pinoccio cylon-pinoccio
PowerUp 3.0 cylon-powerup
Rapiro cylon-rapiro
Raspberry Pi cylon-raspi
Salesforce cylon-force
Skynet cylon-skynet
Spark cylon-spark
Speech cylon-speech
Sphero cylon-sphero
Sphero BLE cylon-sphero-ble
Tessel cylon-tessel
WICED Sense cylon-wiced-sense

Our implementation of GPIO (General Purpose Input/Output) allows for a shared set of drivers supporting 14 different devices:

  • GPIO <=> Drivers
    • Analog Sensor
    • Button
    • Continuous Servo
    • Direct Pin
    • IR Range Sensor
    • LED
    • Makey Button (high-resistance button like the MakeyMakey)
    • Maxbotix Ultrasonic Range Finder
    • Motor
    • Relay
    • RGB LED
    • Servo
    • Temperature Sensor
    • TP401 Gas Sensor

We also support 14 different I2C (Inter-Integrated Circuit) devices through a shared cylon-i2c module:

  • I2C <=> Drivers
    • BlinkM RGB LED
    • BMP180 Barometric Pressure + Temperature sensor
    • Direct I2C
    • HMC6352 Digital Compass
    • JHD1313M1 LCD with RGB Backlight
    • LCD
    • LIDAR-Lite
    • LSM9DS0G 9 Degrees of Freedom IMU
    • LSM9DS0XM 9 Degrees of Freedom IMU
    • MAG3110 3-Axis Digital Magnetometer
    • MPL115A2 Digital Barometer & Thermometer
    • MPU6050 Triple Axis Accelerometer and Gyro
    • PCA9544a 4-Channel I2C Mux
    • PCA9685 16-Channel 12-bit PWM/Servo Driver

In addition to our officially supported platforms, we have the following 8 user contributed platforms:

Platform Support
APC UPS cylon-apcupsd
iBeacon cylon-beacon
Myo cylon-myo
One-Wire cylon-one-wire
Parrot Rolling Spider cylon-rolling-spider
PCDuino cylon-pcduino
Telegram cylon-telegram
WeMo cylon-wemo

We'll also have many more platforms and drivers coming soon, follow us on Twitter for updates.

Browser & Mobile Support

Cylon.js can be run directly in-browser, using the browserify NPM module. You can also run it from withing a Chrome connected app, or a PhoneGap mobile app.

For more info on browser support, and for help with different configurations, you can find more info in our docs.

API Plugins

Cylon.js has support for different API plugins that can be used to interact with your robots remotely. At this time we have support for http/https, mqtt, and socket.io with more coming in the near future.

To use an API plugin, install it alongside Cylon:

$ npm install cylon-api-http cylon-api-socketio

Then, all you need to do is call Cylon#api in your robot's script:

var Cylon = require("cylon");

// For http
Cylon.api('http');

// Or for Socket.io
Cylon.api('socketio');

Then visit https://localhost:3000/ and you are ready to control your robots from a web browser!

You can check out more information on the Cylon API in the docs here.

CLI

Cylon uses the Gort http://gort.io Command Line Interface (CLI) so you can access important features right from the command line. We call it "RobotOps", aka "DevOps For Robotics". You can scan, connect, update device firmware, and more!

Cylon also has its own CLI to generate new robots, adaptors, and drivers. You can check it out at https://github.com/hybridgroup/cylon-cli.

Documentation

We're busy adding documentation to our website, check it out at cylonjs.com/documentation.

If you want to help with documentation, you can find the code for our website at on the https://github.com/hybridgroup/cylon-site.

Contributing

For our contribution guidelines, please go to CONTRIBUTING.md.

Release History

For the release history, please go to RELEASES.md.

License

Copyright (c) 2013-2016 The Hybrid Group. Licensed under the Apache 2.0 license.

cylon's People

Contributors

ahdncordeiro avatar chrisbodhi avatar chrismatthieu avatar danhklein avatar daniellmb avatar deadprogram avatar edgarsilva avatar fabito avatar iyogeshjoshi avatar lorenwest avatar marioricalde avatar mortenf avatar pdehaan avatar rafmagana avatar stewart avatar xixebombilla avatar zankavrogin avatar zankich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cylon's Issues

TypeError: Cannot read property 'motor' of undefined

Hello, I encountered an issue while trying to run a demo from the doc.
I try to start and stop a motor on an arduino with firmata from a Raspberry Pi.
First of all, uname:
Linux raspberrypi 3.12.35+ #730 PREEMPT Fri Dec 19 18:31:24 GMT 2014 armv6l GNU/Linux
and node v0.10.36

Here's what I'm running:

var Cylon = require('cylon');

Cylon.robot({
  connections: {
    arduino: { adaptor: 'firmata', port: '/dev/ttyACM0' }
  },

  devices: {
    motor: { driver: 'motor', pin: 3 }
  },

  work: function(my) {
    my.motor.speed(100);

    after((1).seconds(), function(my) {
      my.motor.stop();
    });
  }
}).start();
pi@raspberrypi ~ $ node ppe3.js
I, [2015-02-19T01:03:42.253Z]  INFO -- : Initializing connections.
I, [2015-02-19T01:03:44.363Z]  INFO -- : Initializing devices.
I, [2015-02-19T01:03:44.493Z]  INFO -- : Starting connections.
I, [2015-02-19T01:03:47.734Z]  INFO -- : Starting devices.
I, [2015-02-19T01:03:47.743Z]  INFO -- : Working.

/home/pi/ppe3.js:16
      my.motor.stop();
        ^
TypeError: Cannot read property 'motor' of undefined
    at null._onTimeout (/home/pi/ppe3.js:16:9)
    at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)

Also...

pi@raspberrypi ~ $ npm ls
/home/pi
โ”œโ”€โ”ฌ [email protected]
โ”‚ โ””โ”€โ”€ [email protected]
โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚ โ””โ”€โ”ฌ [email protected]
โ”‚   โ”œโ”€โ”€ [email protected]
โ”‚   โ”œโ”€โ”€ [email protected]
โ”‚   โ””โ”€โ”ฌ [email protected]
โ”‚     โ”œโ”€โ”€ [email protected]
โ”‚     โ”œโ”€โ”€ [email protected]
โ”‚     โ”œโ”€โ”€ [email protected]
โ”‚     โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ”‚ โ””โ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”‚ โ”‚   โ””โ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ”‚ โ””โ”€โ”ฌ [email protected]
โ”‚     โ”‚   โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚   โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚   โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚   โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚   โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ”‚   โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚   โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚   โ”‚ โ””โ”€โ”ฌ [email protected]
โ”‚     โ”‚   โ”‚   โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚   โ”‚   โ””โ”€โ”€ [email protected]
โ”‚     โ”‚   โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚   โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚   โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚   โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚   โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚   โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚   โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ”‚   โ””โ”€โ”€ [email protected]
โ”‚     โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ””โ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”ฌ [email protected]
โ”‚ โ””โ”€โ”ฌ [email protected] (git://github.com/hybridgroup/node-opencv.git#3558be3d50f03e80b002b519762f09b18ea790a3)
โ”‚   โ”œโ”€โ”€ [email protected]
โ”‚   โ”œโ”€โ”€ [email protected]
โ”‚   โ””โ”€โ”ฌ [email protected]
โ”‚     โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”‚ โ””โ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”‚   โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚   โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚   โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚   โ””โ”€โ”€ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ”œโ”€โ”€ [email protected]
โ”‚     โ”œโ”€โ”€ [email protected]
โ”‚     โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚     โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚     โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ”‚ โ””โ”€โ”€ [email protected]
โ”‚     โ””โ”€โ”ฌ [email protected]
โ”‚       โ”œโ”€โ”€ [email protected]
โ”‚       โ”œโ”€โ”ฌ [email protected]
โ”‚       โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚       โ”‚ โ””โ”€โ”€ [email protected]
โ”‚       โ”œโ”€โ”ฌ [email protected]
โ”‚       โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚       โ”‚ โ””โ”€โ”ฌ [email protected]
โ”‚       โ”‚   โ”œโ”€โ”€ [email protected]
โ”‚       โ”‚   โ””โ”€โ”€ [email protected]
โ”‚       โ”œโ”€โ”€ [email protected]
โ”‚       โ”œโ”€โ”€ [email protected]
โ”‚       โ”œโ”€โ”ฌ [email protected]
โ”‚       โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚       โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚       โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚       โ”‚ โ””โ”€โ”€ [email protected]
โ”‚       โ”œโ”€โ”ฌ [email protected]
โ”‚       โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚       โ”‚ โ””โ”€โ”€ [email protected]
โ”‚       โ””โ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ””โ”€โ”ฌ [email protected]
  โ”œโ”€โ”€ [email protected]
  โ”œโ”€โ”ฌ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”ฌ [email protected]
  โ”‚ โ”‚ โ”œโ”€โ”ฌ [email protected]
  โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
  โ”‚ โ”‚ โ””โ”€โ”ฌ [email protected]
  โ”‚ โ”‚   โ””โ”€โ”ฌ [email protected]
  โ”‚ โ”‚     โ””โ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”ฌ [email protected]
  โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”ฌ [email protected]
  โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”ฌ [email protected]
  โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”ฌ [email protected]
  โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”ฌ [email protected]
  โ”‚ โ”‚ โ””โ”€โ”ฌ [email protected]
  โ”‚ โ”‚   โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚   โ””โ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”ฌ [email protected]
  โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”ฌ [email protected]
  โ”‚ โ”‚ โ””โ”€โ”ฌ [email protected]
  โ”‚ โ”‚   โ””โ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”ฌ [email protected]
  โ”‚ โ”‚ โ”œโ”€โ”ฌ [email protected]
  โ”‚ โ”‚ โ”‚ โ”œโ”€โ”ฌ [email protected]
  โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
  โ”‚ โ”‚ โ””โ”€โ”ฌ [email protected]
  โ”‚ โ”‚   โ””โ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”ฌ [email protected]
  โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”ฌ [email protected]
  โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”ฌ [email protected]
  โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”ฌ [email protected]
  โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”œโ”€โ”ฌ [email protected]
  โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”œโ”€โ”ฌ [email protected]
  โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”‚ โ””โ”€โ”ฌ [email protected]
  โ”‚ โ”‚ โ”‚   โ””โ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”œโ”€โ”ฌ [email protected]
  โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”œโ”€โ”ฌ [email protected]
  โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚ โ”œโ”€โ”ฌ [email protected]
  โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
  โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”ฌ [email protected]
  โ”‚ โ”‚ โ””โ”€โ”ฌ [email protected]
  โ”‚ โ”‚   โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚   โ”œโ”€โ”€ [email protected]
  โ”‚ โ”‚   โ””โ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ””โ”€โ”€ [email protected]
  โ”œโ”€โ”ฌ [email protected]
  โ”‚ โ”œโ”€โ”€ [email protected]
  โ”‚ โ””โ”€โ”€ [email protected]
  โ”œโ”€โ”€ [email protected]
  โ””โ”€โ”ฌ [email protected]
    โ”œโ”€โ”ฌ [email protected]
    โ”‚ โ””โ”€โ”€ [email protected]
    โ”œโ”€โ”ฌ [email protected]
    โ”‚ โ”œโ”€โ”€ [email protected]
    โ”‚ โ”œโ”€โ”€ [email protected]
    โ”‚ โ””โ”€โ”ฌ [email protected]
    โ”‚   โ””โ”€โ”€ [email protected]
    โ””โ”€โ”ฌ [email protected]
      โ”œโ”€โ”€ [email protected]
      โ””โ”€โ”€ [email protected]

So, the motor is working but I don't manage to stop it...

Thank you. :)

API Not working in 0.22

The API was split out for v0.22, so I'm getting this when I try using the API:

E, [2015-01-19T07:27:05.554Z] ERROR -- : The HTTP API is no longer included in Cylon by default.
E, [2015-01-19T07:27:05.557Z] ERROR -- : To use it, install the plugin module: `npm install cylon-api-http`

That's a helpful error message, but unfortunately npm install cylon-api-http gives an error because it hasn't yet been published.

Hopefully publishing cylon-api-http to npm will resolve the issue.

Error running Arduino example code

I've previously uploaded (with official Arduino IDE 1.0.5) the sketch "StandardFirmata"- When I try to execute the example title "Arduino + LED" from your README.md, I get these errors :

I, [2014-11-19T16:10:24.237Z] INFO -- : Initializing connections.
I, [2014-11-19T16:10:24.239Z] INFO -- : Initializing connection 'arduino'.
I, [2014-11-19T16:10:24.296Z] INFO -- : Initializing devices.
I, [2014-11-19T16:10:24.296Z] INFO -- : Initializing device 'led'.
I, [2014-11-19T16:10:24.297Z] INFO -- : Starting connections.
I, [2014-11-19T16:10:24.298Z] INFO -- : Connecting to 'arduino' on port /dev/ttyACM0.
*** Error in `node': malloc(): memory corruption (fast): 0x0000000002e88a10 ***
======= Backtrace: =========
/lib64/libc.so.6[0x3669c75a4f]
/lib64/libc.so.6[0x3669c7b8a7]
/lib64/libc.so.6[0x3669c7e7d4]
/lib64/libc.so.6(__libc_malloc+0x5c)[0x3669c7fcfc]
node(_ZN2v88internal8Malloced3NewEm+0xd)[0x7497bd]
node(_ZN2v88internal2IC19UpdatePolymorphicICENS0_6HandleINS0_8TypeImplINS0_14HeapTypeConfigEEEEENS2_INS0_6StringEEENS2_INS0_4CodeEEE+0x595)[0x8d16c5]
node(_ZN2v88internal2IC10PatchCacheENS0_6HandleINS0_8TypeImplINS0_14HeapTypeConfigEEEEENS2_INS0_6StringEEENS2_INS0_4CodeEEE+0x75)[0x8d2635]
node(_ZN2v88internal6LoadIC12UpdateCachesEPNS0_12LookupResultENS0_6HandleINS0_6ObjectEEENS4_INS0_6StringEEE+0xb4)[0x8d2804]
node(_ZN2v88internal11LoadIC_MissEiPPNS0_6ObjectEPNS0_7IsolateE+0x60c)[0x8d3d8c]
[0x9b81cf060a2]
======= Memory map: ========
00400000-00e98000 r-xp 00000000 08:01 924989 /home/q2dg/node/bin/node
01098000-010af000 rwxp 00a98000 08:01 924989 /home/q2dg/node/bin/node
010af000-010b9000 rwxp 00000000 00:00 0
02e15000-03064000 rwxp 00000000 00:00 0 [heap]
3669800000-3669820000 r-xp 00000000 08:01 3277169 /usr/lib64/ld-2.18.so
3669a1f000-3669a20000 r-xp 0001f000 08:01 3277169 /usr/lib64/ld-2.18.so
3669a20000-3669a21000 rwxp 00020000 08:01 3277169 /usr/lib64/ld-2.18.so
3669a21000-3669a22000 rwxp 00000000 00:00 0
3669c00000-3669db4000 r-xp 00000000 08:01 3277301 /usr/lib64/libc-2.18.so
3669db4000-3669fb3000 ---p 001b4000 08:01 3277301 /usr/lib64/libc-2.18.so
3669fb3000-3669fb7000 r-xp 001b3000 08:01 3277301 /usr/lib64/libc-2.18.so
3669fb7000-3669fb9000 rwxp 001b7000 08:01 3277301 /usr/lib64/libc-2.18.so
3669fb9000-3669fbe000 rwxp 00000000 00:00 0
366a000000-366a003000 r-xp 00000000 08:01 3277333 /usr/lib64/libdl-2.18.so
366a003000-366a202000 ---p 00003000 08:01 3277333 /usr/lib64/libdl-2.18.so
366a202000-366a203000 r-xp 00002000 08:01 3277333 /usr/lib64/libdl-2.18.so
366a203000-366a204000 rwxp 00003000 08:01 3277333 /usr/lib64/libdl-2.18.so
366a400000-366a418000 r-xp 00000000 08:01 3277460 /usr/lib64/libpthread-2.18.so
366a418000-366a617000 ---p 00018000 08:01 3277460 /usr/lib64/libpthread-2.18.so
366a617000-366a618000 r-xp 00017000 08:01 3277460 /usr/lib64/libpthread-2.18.so
366a618000-366a619000 rwxp 00018000 08:01 3277460 /usr/lib64/libpthread-2.18.so
366a619000-366a61d000 rwxp 00000000 00:00 0
366a800000-366a905000 r-xp 00000000 08:01 3277559 /usr/lib64/libm-2.18.so
366a905000-366ab05000 ---p 00105000 08:01 3277559 /usr/lib64/libm-2.18.so
366ab05000-366ab06000 r-xp 00105000 08:01 3277559 /usr/lib64/libm-2.18.so
366ab06000-366ab07000 rwxp 00106000 08:01 3277559 /usr/lib64/libm-2.18.so
366b000000-366b015000 r-xp 00000000 08:01 3281182 /usr/lib64/libgcc_s-4.8.3-20140911.so.1
366b015000-366b214000 ---p 00015000 08:01 3281182 /usr/lib64/libgcc_s-4.8.3-20140911.so.1
366b214000-366b215000 r-xp 00014000 08:01 3281182 /usr/lib64/libgcc_s-4.8.3-20140911.so.1
366b215000-366b216000 rwxp 00015000 08:01 3281182 /usr/lib64/libgcc_s-4.8.3-20140911.so.1
366c000000-366c007000 r-xp 00000000 08:01 3281154 /usr/lib64/librt-2.18.so
366c007000-366c206000 ---p 00007000 08:01 3281154 /usr/lib64/librt-2.18.so
366c206000-366c207000 r-xp 00006000 08:01 3281154 /usr/lib64/librt-2.18.so
366c207000-366c208000 rwxp 00007000 08:01 3281154 /usr/lib64/librt-2.18.so
366d800000-366d8e9000 r-xp 00000000 08:01 3291695 /usr/lib64/libstdc++.so.6.0.19
366d8e9000-366dae9000 ---p 000e9000 08:01 3291695 /usr/lib64/libstdc++.so.6.0.19
366dae9000-366daf1000 r-xp 000e9000 08:01 3291695 /usr/lib64/libstdc++.so.6.0.19
366daf1000-366daf3000 rwxp 000f1000 08:01 3291695 /usr/lib64/libstdc++.so.6.0.19
366daf3000-366db08000 rwxp 00000000 00:00 0
3a1d5700000-3a1d5800000 rwxp 00000000 00:00 0
89136100000-89136135000 rwxp 00000000 00:00 0
9b81cb4e000-9b81cc00000 ---p 00000000 00:00 0
9b81cc00000-9b81cc05000 rwxp 00000000 00:00 0
9b81cc05000-9b81cc06000 ---p 00000000 00:00 0
9b81cc06000-9b81cc07000 rwxp 00000000 00:00 0
9b81cc07000-9b81cd00000 ---p 00000000 00:00 0
9b81cd00000-9b81cd05000 rwxp 00000000 00:00 0
9b81cd05000-9b81cd06000 ---p 00000000 00:00 0
9b81cd06000-9b81cd07000 rwxp 00000000 00:00 0
9b81cd07000-9b81ce00000 ---p 00000000 00:00 0
9b81ce00000-9b81ce05000 rwxp 00000000 00:00 0
9b81ce05000-9b81ce06000 ---p 00000000 00:00 0
9b81ce06000-9b81ce07000 rwxp 00000000 00:00 0
9b81ce07000-9b81cf00000 ---p 00000000 00:00 0
9b81cf00000-9b81cf05000 rwxp 00000000 00:00 0
9b81cf05000-9b81cf06000 ---p 00000000 00:00 0
9b81cf06000-9b81cfff000 rwxp 00000000 00:00 0
9b81cfff000-9b81d000000 ---p 00000000 00:00 0
9b81d000000-9b81d005000 rwxp 00000000 00:00 0
9b81d005000-9b81d006000 ---p 00000000 00:00 0
9b81d006000-9b81d0ff000 rwxp 00000000 00:00 0
9b81d0ff000-9b83cb4e000 ---p 00000000 00:00 0
c7802000000-c7802200000 rwxp 00000000 00:00 0
c7802200000-c7803000000 ---p 00000000 00:00 0
c7803000000-c7803200000 rwxp 00000000 00:00 0
c7803200000-c7804000000 ---p 00000000 00:00 0
1342bd596000-1342bd597000 r-xp 00000000 00:00 0
16972e600000-16972e615000 rwxp 00000000 00:00 0
176acc800000-176acc825000 rwxp 00000000 00:00 0
188e72c00000-188e72cc5000 rwxp 00000000 00:00 0
24dcee96e000-24dcee980000 ---p 00000000 00:00 0
24dcee980000-24dcee9a0000 rwxp 00000000 00:00 0
24dcee9a0000-24dcee9ce000 ---p 00000000 00:00 0
2969e6400000-2969e6500000 rwxp 00000000 00:00 0
297c51700000-297c51725000 rwxp 00000000 00:00 0
2a1987600000-2a1987700000 rwxp 00000000 00:00 0
348147200000-348147300000 rwxp 00000000 00:00 0
371bd7232000-371bd7252000 rwxp 00000000 00:00 0
371bd7252000-371bd7432000 ---p 00000000 00:00 0
3fa674000000-3fa674100000 rwxp 00000000 00:00 0
7f9e10000000-7f9e10054000 rwxp 00000000 00:00 0
7f9e10054000-7f9e14000000 ---p 00000000 00:00 0
7f9e142cb000-7f9e142cc000 ---p 00000000 00:00 0
7f9e142cc000-7f9e14acc000 rwxp 00000000 00:00 0 [stack:4326]
7f9e14acc000-7f9e14acd000 ---p 00000000 00:00 0
7f9e14acd000-7f9e152cd000 rwxp 00000000 00:00 0 [stack:4325]
7f9e152cd000-7f9e152ce000 ---p 00000000 00:00 0
7f9e152ce000-7f9e15ace000 rwxp 00000000 00:00 0 [stack:4324]
7f9e15ace000-7f9e15acf000 ---p 00000000 00:00 0
7f9e15acf000-7f9e162cf000 rwxp 00000000 00:00 0 [stack:4323]
7f9e162cf000-7f9e162d8000 r-xp 00000000 08:01 2911789 /home/q2dg/node_modules/cylon-firmata/node_modules/firmata/node_modules/serialport/build/serialport/v1.4.6/Release/node-v14-linux-x64/serialport.node
7f9e162d8000-7f9e164d8000 ---p 00009000 08:01 2911789 /home/q2dg/node_modules/cylon-firmata/node_modules/firmata/node_modules/serialport/build/serialport/v1.4.6/Release/node-v14-linux-x64/serialport.node
7f9e164d8000-7f9e164d9000 r-xp 00009000 08:01 2911789 /home/q2dg/node_modules/cylon-firmata/node_modules/firmata/node_modules/serialport/build/serialport/v1.4.6/Release/node-v14-linux-x64/serialport.node
7f9e164d9000-7f9e164da000 rwxp 0000a000 08:01 2911789 /home/q2dg/node_modules/cylon-firmata/node_modules/firmata/node_modules/serialport/build/serialport/v1.4.6/Release/node-v14-linux-x64/serialport.node
7f9e164da000-7f9e164db000 ---p 00000000 00:00 0
7f9e164db000-7f9e164eb000 rwxp 00000000 00:00 0 [stack:4322]
7f9e164eb000-7f9e164ec000 ---p 00000000 00:00 0
7f9e164ec000-7f9e16cf2000 rwxp 00000000 00:00 0 [stack:4319]
7f9e16cfe000-7f9e16cff000 rwxp 00000000 00:00 0
7f9e16cff000-7f9e16d00000 ---p 00000000 00:00 0
7f9e16d00000-7f9e16d10000 rwxp 00000000 00:00 0 [stack:4321]
7f9e16d10000-7f9e16d11000 ---p 00000000 00:00 0
7f9e16d11000-7f9e16d22000 rwxp 00000000 00:00 0 [stack:4320]
7fff4a9b0000-7fff4a9d1000 rwxp 00000000 00:00 0 [stack]
7fff4a9fc000-7fff4a9fe000 r--p 00000000 00:00 0 [vvar]
7fff4a9fe000-7fff4aa00000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]

I'm running Node v0.11.14 on Fedora 20 64 bits
Thanks

start events not propagated to all devices

The start event is not sent to all devices, only the last one that's defined.

"use strict";

var Cylon = require("cylon");

var bum = Cylon.robot({
    name: "Bum",
    connections: [
        { name: "digispark", adaptor: "digispark" }
    ],
    devices: [
        { name: "blinky", driver: "led",    pin: 1 },
        { name: "door1",  driver: "button", pin: 4 },
        { name: "door2",  driver: "button", pin: 5 },
    ],
    work: function(my) {
        my.door1.on("start",  function() { console.log("door1 started");  } );
        my.door2.on("start",  function() { console.log("door2 started");  } );
        my.blinky.on("start", function() { console.log("blinky started"); } );

        every(100, function() {
            my.blinky.toggle();
        });
    }
});

bum.on("working", function() { console.log("bum working"); });

Cylon.start();

In the console output I should see the <device name> started message for each device, but instead I only see it for door2. If I re-order the devices array, the last one is the one that gets the started event.

Problems when running node.js with cylon.js as service in Intel Edison

I've made this script to run a robot. The script itself runs fine, but if I want to use it as a service, it always fails. The following code starts the problem:

_index.js_

var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);

var Cylon = require('cylon');

//The following part kills the servive
var rbt=Cylon.robot({
  connections: {
    edison:{adaptor: 'intel-iot'}
  },

  devices: {
    servoL: { driver: 'servo', pin: 20 },
    servoR: { driver: 'servo', pin: 14 },
    button: { driver: 'button', pin: 15 },
  },
});

_/etc/systemd/system/robotserver.service_

[Unit]
Description=robotserver startup
After=network.service

[Service]
ExecStart=/bin/sh -c "/usr/bin/node /home/root/robotServer/index.js"
Restart=always
RestartSec=10s

[Install]
WantedBy=multi-user.target

And I've executed the following commands in terminal:

systemctl daemon-reload
systemctl start robotserver.service

If I run "systemctl status robotserver.service", the following message will show up:

โ— robotserver.service - robotserver startup
   Loaded: loaded (/etc/systemd/system/robotserver.service; disabled)
   Active: failed (Result: exit-code) since Fri 2015-03-13 09:14:39 UTC; 9s ago
  Process: 276 ExecStart=/usr/bin/node /home/root/robotServer/index.js (code=exited, status=143)
 Main PID: 276 (code=exited, status=143)

Mar 13 09:14:35 edison systemd[1]: Started robotserver startup.
Mar 13 09:14:38 edison node[276]: I, [2015-03-13T09:14:38.911Z]  INFO -- : [Robot 60097] - Initializing connections.
Mar 13 09:14:39 edison node[276]: Cannot find the 'cylon-intel-iot' module.
Mar 13 09:14:39 edison node[276]: This problem might be fixed by installing it with 'npm install cylon-intel-iot' and trying again.
Mar 13 09:14:39 edison systemd[1]: robotserver.service: main process exited, code=exited, status=143/n/a
Mar 13 09:14:39 edison systemd[1]: Unit robotserver.service entered failed state.

The script runs fine itself, so I don't understand why it's asking for cylon-intel-iot module when it's already installed.
Wondering if it's a bug or I did something wrong here?

The original post can be seen at https://communities.intel.com/thread/61262

Cylon API - events.js throw er

Hi, I am having strange behaviour running Cylon API on Beaglebone Black.
Script runs on Beaglebone Black itself.
BeagleBone Black runs Cloud9 IDE on port:3000.

When I use API to control Firmata devices it works as expected.

Console output:

root@beaglebone:/var/lib/cloud9/examples/cylon# node app.js 
I, [2015-01-22T02:30:04.503Z]  INFO -- : Initializing connections.
I, [2015-01-22T02:30:08.174Z]  INFO -- : Initializing devices.
I, [2015-01-22T02:30:08.264Z]  INFO -- : Starting connections.
I, [2015-01-22T02:30:08.294Z]  INFO -- : Starting devices.
I, [2015-01-22T02:30:08.319Z]  INFO -- : Working.
beagle says relax
running app.js
Cylon API Server is now online.
Listening at https://127.0.0.1:4321

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: listen EADDRINUSE
    at errnoException (net.js:904:11)
    at Server._listen2 (net.js:1042:14)
    at listen (net.js:1064:10)
    at net.js:1146:9
    at dns.js:72:18
    at process._tickCallback (node.js:419:13)
    at Function.Module.runMain (module.js:499:11)
    at startup (node.js:119:16)
    at node.js:906:3

here is the script:
file: beaglebone_commands.js

var Cylon = require('cylon');

function MyBeagle() {

var self = this;
Cylon.api(
  {
  port: '4321',
  }
);
Cylon.api();

Cylon.robot({
  name: "beagle",

  connections: {
    beaglebone: { 
      name: 'beagle',
        adaptor: 'beaglebone', 
    },

  },

  devices: {
    led_blue: { driver: 'led', pin: 'P9_16' },
    led_red: {driver: 'led', pin: 'P9_14'},
    button: {driver: 'button', pin: 'P8_19'},
    led_orange: {driver: 'led', pin: 'P9_17'}
  },


  work: function(my)  {
    // every((0.2).second(), my.led.toggle);
    // every((0.2).second(), my.led_red.toggle);
    console.log( this.name + " says relax");
  },


   commands: function() {
    var commands = {};

    commands.do_a_thing = this.doAThing;
    commands.blink_red = this.blinkRed;
    commands.say_relax = this.sayRelax;

    return commands;
  },

  doAThing: function() {
    console.log("I did a thing!");
  },

    blinkRed: function() {
      this.led_red.toggle();
    // every((0.2).second(), this.led_red.toggle);
    console.log('blinkred');
  },
  sayRelax: function() {
   console.log( this.name + " says relax");
  }

}).start();

}

MyBeagle.prototype.flashRed = function() {
  console.log('flashing Red');
  setInterval(function() {
    Cylon.robots.beagle.devices.led_red.toggle();
  },1000);

};

MyBeagle.prototype.sayHi = function() {
  console.log('Aloha...');
  // setInterval(function() {
  //   Cylon.robots.beagle.devices.led_red.toggle();
  // },1000);

};


// Export the module
module.exports = exports = new MyBeagle();

file: app.js

var mybeagle = require('./beaglebone_commands');

var alarm = false;

setTimeout(function() {
    alarm = true;
},15000);

console.log('running app.js');
mybeagle.sayHi();

if (alarm) {
    mybeagle.flashRed();
    console.log('alarm - flashing red');
}

Question on using API

I am new to cylon and trying to get the api working. I was not able to get the default unconfigured API address to connect at: https://127.0.0.1:3000. In Firefox, I get the following error message:
SSL received a record that exceeded the maximum permissible length.

I cobbled together the following robot:

var Cylon = require('cylon');
Cylon.api({
  host: '127.0.0.1',
  port: '1234',
  ssl:  false
});

Cylon.robot({
  name: "TestBot",

  connections: [
    //{ name: 'leapmotion', adaptor: 'leapmotion', port: '127.0.0.1:6437' },
    { name: 'arduino', adaptor: 'firmata', port: '/dev/ttyACM0' }
  ],

  devices: [
    //{ name: 'leapmotion', driver: 'leapmotion', connection: 'leapmotion' },
    { name: 'led', driver: 'led', pin: 13, connection: 'arduino' }
  ],

  commands: ["hello"],

  work: function(my) {
    every((10).seconds(), my.led.toggle);
  },

  hello: function(greeting) {
    return greeting + " world";
  }
});

When I go to http://127.0.0.1:1234 I see robeaux, but it does not display TestBot.

Questions:

  1. What am I doing wrong in that Robeax does not see the robot?
  2. Why couldn't I connect to https://127.0.0.1:3000? I did not include the Cylon.api changes for that test.

Is it possible to dynamically create a device?

Can the API dynamically create or specify a device based upon parameters passed in by a call to the API?

Here is what I mean:

My client application does not know ahead of time, how the board is being configured. I am allowing the user to wire things up in a random custom fashion. So for example, the user may decide to place a button on pins 8 and 49 of an Arduino Mega, but I would not know that until after the API is running.

If the call to my API command handler accepts a device name and pin number as parameters, can the API create that device on the fly using the variables?

help with leap and led

i was successful in testing the led on off with cylon.js but i am having difficulties to start of with how to control led by moving the hand forward and backward or sidewards .. anyone who can guide me

Problem to use the button drive.

The Cylon requests the cylon-button, but this module can't be found on npm registry.

Mac-mini:cylon-test matheusmariano$ node app.js
I, [2014-07-11T06:53:18.129Z]  INFO -- : Initializing connections.
I, [2014-07-11T06:53:18.130Z]  INFO -- : Initializing devices.
I, [2014-07-11T06:53:18.131Z]  INFO -- : Initializing device 'button'.
D, [2014-07-11T06:53:18.131Z] DEBUG -- : Loading driver 'button'.
Cannot find the 'cylon-button' module. Please install it with 'npm install cylon-button' and try again.
Mac-mini:cylon-test matheusmariano$ npm install cylon-button
npm ERR! 404 404 Not Found: cylon-button
npm ERR! 404 
npm ERR! 404 'cylon-button' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "cylon-button"
npm ERR! cwd /Users/matheusmariano/Desktop/cylon-test
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code E404
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/matheusmariano/Desktop/cylon-test/npm-debug.log
npm ERR! not ok code 0

Develop new Driver(s)

Is there somewhere guidelines I could follow to develop drivers for PCBs, like the one used for the BMP180?
Any link or advice welcome, thank you!

Kill ESRCH exception

Hi

I'm not sure where to put so I start here. I'm trying to add handler to my ardrone, which would make drone hover/land when I'm doing emergency exit from my drone steering program or in case of unexpected exception. I hope that this will let me reconnect to it using either my library or a mobile application and regain control.

Anyways - when pressing [CTRL] + C I'm getting this exception:

I, [2014-03-24T19:34:01.637Z]  INFO -- : Mon Mar 24 2014 20:34:01 GMT+0100 (ลšrod
kowoeuropejski czas stand.)

node.js:729
        throw errnoException(process._errno, 'kill');
              ^
Error: kill ESRCH
    at errnoException (node.js:540:13)
    at process.kill (node.js:729:15)
    at process.<anonymous> (C:\Users\marek.bedkowski\Documents\github-code\drone
-leap\node_modules\cylon\lib\cylon.js:60:17)
    at process.EventEmitter.emit (events.js:117:20)
    at Interface.<anonymous> (C:\Users\marek.bedkowski\Documents\github-code\dro
ne-leap\node_modules\cylon\lib\cylon.js:54:19)
    at Interface.EventEmitter.emit (events.js:92:17)
    at Interface._ttyWrite (readline.js:620:16)
    at ReadStream.onkeypress (readline.js:99:10)
    at ReadStream.EventEmitter.emit (events.js:117:20)
    at emitKey (readline.js:1095:12)

Which comes from cylon.js - it tries to issue process.kill with no PID (at least that's how it looks like). This is the reason why I decided to put it here. I can see that Cylon is disconnecting all robot instances which leaves me no option to jump in and let my handler do that one last thing before loosing control.

It'd be nice to have either an event e.g. halt or a callback that could be fired when before disconnecting.

Cleaner events

Since a lot of the work that I do in the work function is to setup events, it might be nicer to follow the same approach of Backbone.View so that I could easily define them as follows:

Cylon = require('cylon')

Cylon.robot({
  connection: {
    name: 'keyboard'
    adaptor: 'keyboard'
  }

  device: {
    name: 'keyboard'
    driver: 'keyboard'
  }

  events: {
    'a': 'pressedA'
    'b': (key) -> console.log('B PRESSED!')
  }

  pressedA: (key) ->
    console.log('A PRESSED!')
}).start()

I don't know if it is already, but the work would be best as optional with a no-op default function value. Also, events registered in this way should be invoked in the context of the robot.

Additionally, a standard of having a catch-all special error event would be good for error handling.

gort scan serial - not returning anything on Windows 7

I've got an Arduino Uno plugged into my Win7 PC. Arduino IDE recognises and hows on COM3. However gort scan serial return nothing.

C:\Windows\system32>gort scan serial
Connected serialport devices:

Running the following works

gort arduino upload fermata COM3

And then running node cylone scripts (e.g. led blink) works.

Any ideas?

Plural driver names

I have a driver with a plural name, and it's preventing cylon from loading the robot. I've found the problem, it's at https://github.com/hybridgroup/cylon/blob/master/lib/registry.js#L72 which it seems you've fixed (0.22.1 tests plurality in the name, not the prop), but haven't pushed that fix to npm.

Would you mind bumping the version and pushing that fix to npm? I'm having to manually change the cylon code after installing until then.

Thank you,
-Loren

Help for connecting Arduino to Windows

I'm new to CylonJS and would like to use Arduino with Windows. However, there aren't instructions on the site/GitHub. Can you please post basic directions for doing so? Thanks!

Driver MPU6050

Hello!
I'm starting with Cylon, I'm testing with arduino and mpu6050, but I am getting this error below. Any idea?


C: \ Users \ Marcelo \ node_modules \ cylon-i2c \ lib \ mpu6050.js: 84
ย ย ย ย  var x = makeSignedInteger (data [0], data [1]),
ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย  ^
TypeError: Can not read property '0 'of null
ย ย ย ย  at C: \ Users \ Marcelo \ node_modules \ cylon-i2c \ lib \ mpu6050.js: 84:36
ย ย ย ย  at null (C:. \ Users \ Marcelo \ node_modules \ cylon-Firmata \ lib \ Firmata
. js: 103:5)
ย ย ย ย  at g (Events.js: 180:16)
ย ย ย ย  emit at (Events.js: 95:17)
ย ย ย ย  at Object.SYSEX_RESPONSE (anonymous function) [the 119](C:. Users Marcelo nod
e_modules cylon-Firmata node_modules Firmata lib firmata.js: 259:11)
ย ย ย ย  at SerialPort (C:. \ Users \ Marcelo \ node_modules \ cylon-Firmata \ node_
modules \ Firmata \ lib \ firmata.js: 444:59)
ย ย ย ย  at SerialPort.emit (Events.js: 95:17)
ย ย ย ย  Object.module.exports.raw at [the parser](C: Users Marcelo node_modules cylo
n-Firmata node_modules Firmata node_modules serialport parsers.js: 8:13)
ย ย ย ย  at SerialPort.options.dataCallback (C: \ Users \ Marcelo \ node_modules \ cylon-firm
ata \ node_modules \ Firmata \ node_modules \ serialport \ serialport.js: 145:15)


I'm sorry if you're making a mistake in the form to request help for this error.

cyclon socket IO demo error net::ERR_CONNECTION_REFUSED on client

Hi.
Following this demo here exactly. The only difference is that I am using an edison instead of arduino.

http://cylonjs.com/blog/2015/02/05/using-socketio-with-cylonjs-api/

This is my server code.

var Cylon = require('cylon');
 Cylon.robot({
    name: 'chappie',
    connections: {
        edison: { adaptor: 'intel-iot' }//,
  },

   devices: {
        maxbotix: { driver: 'maxbotix', pin: '0' },
        led: { driver: 'led', pin: 13 }
    },
    work: function (my) {
    /*
    STUFF TO DO!
  */
    }    
    })  
Cylon.api(
'socketio',
{
    host: '0.0.0.0',//Is this correct??
    port: '3000'
 });

Cylon.start();

The 'blink-client' is exactly the same as in the demo except I am hardcoding the actual IP to the edison where we define the device. ie

device = io('http://<ip of edison>:3000/api/robots/chappie/devices/led');

When I runn app.js, the socketIO server correctly launches and I see

[2015-02-17T20:04:12.813Z]  INFO -- : Initializing connections.
[2015-02-17T20:04:13.116Z]  INFO -- : Initializing devices.
 [2015-02-17T20:04:14.646Z]  INFO -- : Starting connections.
[2015-02-17T20:04:14.650Z]  INFO -- : Starting devices.
[2015-02-17T20:04:14.667Z]  INFO -- : Working.
[2015-02-17T20:04:14.703Z]  INFO -- : Cylon API Server is now online.
[2015-02-17T20:04:14.704Z]  INFO -- : Listening at https://127.0.0.1:3000

But when I try and run the blink-client.html in a browser on a PC on the same network I get the ERR_CONNECTION_REFUSED

I am using cylon-api-socketio version "0.2.2" and nodejs version 0.10.28.

In the client PC in a browser if I simply go to
http://actual ip of edison
I correctly see the default page for the edison showing me that I have the correct IP and my app.js is running.

fix for arduino/cyclon article (support windows)

we can remove the unix only line. found at [http://cylonjs.com/documentation/platforms/arduino/]
it worked for me on windows with the NODE windows installer and the following NPM
$ npm install cylon cylon-firmata cylon-gpio cylon-i2c

Connections mixed up when using leapmotion with sphero

The following code highlights the issue:

 require('cylon').robot({
  connections: {
    sphero: { adaptor: 'sphero', port: '/dev/tty.Sphero-PGP-AMP-SPP' },
    leapmotion: { adaptor: 'leapmotion' }
  },

  devices: {
    sphero: { driver: 'sphero' },
    leapmotion: { driver: 'leapmotion' }
  },

  work: function(my) {
    var leapMotionConnectionName = my.leapmotion.connection.name;
    console.log("\n# Expected leapmotion but got", leapMotionConnectionName, "#\n");
  }
}).start();

The output is:

I, [2015-05-15T10:29:37.951Z]  INFO -- : [Robot 57715] - Initializing connections.
I, [2015-05-15T10:29:38.019Z]  INFO -- : [Robot 57715] - Initializing devices.
I, [2015-05-15T10:29:38.024Z]  INFO -- : [Robot 57715] - Starting connections.
I, [2015-05-15T10:29:38.025Z]  INFO -- : Connecting to Sphero 'sphero'...
I, [2015-05-15T10:29:38.060Z]  INFO -- : [Robot 57715] - Starting devices.
I, [2015-05-15T10:29:38.063Z]  INFO -- : [Robot 57715] - Working.

# Expected leapmotion but got sphero #

Optimized for desktop usage.

ESC control, no way to go backwards.

I have my brushless motors working with the ESC using your servo library, where the "angle" I provide is actually the speed the motors should run. This is the behavior I would expect coming from other libraries that did the same.

However, with cylon, I cannot seem to get the motor to spin backwards. Setting a negative number, or anything below 90 just stops the wheels.

With 90 as neutral, I would expect 0-89 as backwards movement, and 91-180 as forward movement.

Connecting multiple drones

Hi,
I was just wandering if there is a way of connecting two bebop drones when using cylon-bebop and how it would be done if possible? Also do you have any module for navigation using the gps of the bebop drone.

Error

Hi All, good day to you all, I had a bit of problems with the firmata included with Cylon.

As shown below, the board was initialised and started by cylon but could not complete due to the errors below;
TypeError: Cannot set property 'mode' of undefined

I have pasted the actual screen-dump of the error. The board used is Arduino UNO, tried Learnado but same error repeated. Firmata standard latest was on the board. Node.js is v0.10.29; O/S is Windows 8.1; Arduino on my system is: v1.5.3.

showcase@SHOWCASE1 /c/Compilers/nodejs/CylonSamples
$ node arduinoledblink1.js
I, [2014-12-07T14:13:26.936Z] INFO -- : Initializing connections.
I, [2014-12-07T14:13:27.127Z] INFO -- : Initializing devices.
I, [2014-12-07T14:13:27.129Z] INFO -- : Starting connections.
I, [2014-12-07T14:13:27.132Z] INFO -- : Starting devices.
I, [2014-12-07T14:13:27.133Z] INFO -- : Working.

TypeError: Cannot set property 'mode' of undefined
at Board.pinMode (c:\Compilers\nodejs\node_modules\cylon-firmata\node_modules\firmata\lib\firmata.js:658:23)
at Adaptor.pinMode (c:\Compilers\nodejs\node_modules\cylon-firmata\lib\firmata.js:126:14)
at Adaptor.digitalWrite (c:\Compilers\nodejs\node_modules\cylon-firmata\lib\firmata.js:65:8)
at Led.turnOn (c:\Compilers\nodejs\node_modules\cylon-gpio\lib\led.js:52:19)
at Led.toggle (c:\Compilers\nodejs\node_modules\cylon-gpio\lib\led.js:71:10)
at wrapper as _onTimeout
at Timer.listOnTimeout as ontimeout

showcase@SHOWCASE1 /c/Compilers/nodejs/CylonSamples
$

Please help me!

God blesses!!!

Best regards,
Sanyaade

cylonjs not connecting to completely to JY-MCU bluetooth on Arduino

hi all i am facing trouble connecting to the JY-MCU bluetooth on Arduino here are my snap shots

here form the image you can see it gets stuck at that point and never goes forward

img-20140814-wa0024

from the image below i had an error when i tried changing baudrate for the bluetooth

img-20140814-wa0028

snapshot below shows the code works fine if i am connected to Arduino through USB
urgent help needed :(

serialport not compiling properly

I'm trying to get cylon to work with node-webkit to talk to my arduino.

When I try to run node-webkit, I get the following error:

[1044:0204/170108:INFO:CONSOLE(27)] ""It looks like serialport didn't compile properly. This is a common problem and its fix is well documented here https://github.com/voodootikigod/node-serialport#to-install"", source: /Users/ryan/Documents/active/panels/node_modules/cylon-firmata/node_modules/firmata/lib/firmata.js (27)

Unfortunately, the fix is not documented at all at the github link provided.

Any suggestions on how to fix?

Raspi I2C

Hi, Your Cylon libraries are great. Used the GPIO and PWM ones so far. I've started using the I2c one to control an LCD, but am having problems. I have followed all the instructions for changing the configuration files and am using your example below. It gives me the error
TypeError: Failed to set address
at i2c.setAddress (/home/pi/node_modules/cylon-raspi/node_modules/i2c/lib/i2c.coffee:61:12
and some similar lines. Can you advise me what I'm doing wrong please.
Thanks
Alastair

Cylon = require('cylon');
Cylon.robot({
connections: {
raspi: { adaptor: 'raspi', port: '/dev/ttyACM0' }
},
devices: {
lcd: { driver: 'lcd' }
},
work: function(my) {
my.lcd.on('start', function(){
my.lcd.print("Hello!");
});
}
}).start()

monkey punching and globals in utils.js

I started reading through the sauce after talking to y'all at jsconf! Neat stuff.

Anyways: I was looking through https://github.com/hybridgroup/cylon/blob/master/lib/utils.js and noticed that it creates a bunch of globals and punches method prototypes by default. I appreciate the rationale for trying to emulate existing artoo idioms for sure, but some people are also really picky about this sort of thing. I think what would be most "idiomatic" way to handle this is to return everything attached to module.exports and allow users to turn on globals and core types punching manually, something like:

var expect = require('chai').expect;

var utils = require('./lib/utils');

expect(utils.every).to.exist;
expect(global.every).to.not.exist;
expect(Number.prototype.seconds).to.not.exist;

expect.bootstrap();

expect(global.every).to.exist;
expect(Number.prototype.seconds).to.exist;

I suspect this is a pretty easy change. Is a PR for this something you'd be interested in?

Support asynchronous robot commands

Robot interactions with the real world sometimes require asynchronous calls to subsystems. The existing command system, however, expects results to be returned immediately upon return from the command.

Instead of supporting an alternate command/callback syntax, I propose with pull request #247 a mechanism of returning promises for asynchronous commands. Adding this support turned out to be a fairly simple change in the API comand processor.

error installing [email protected]

root@raspberrypi:/home/pi/Desktop/rishi# npm install cylon cylon-pebble
npm WARN [email protected] package.json: bugs['name'] should probably be bugs['url']
npm http GET http://registry.npmjs.org/cylon-pebble
npm http GET http://registry.npmjs.org/cylon
npm http 304 http://registry.npmjs.org/cylon-pebble
npm http 304 http://registry.npmjs.org/cylon
npm http GET http://registry.npmjs.org/cylon
npm http 304 http://registry.npmjs.org/cylon
npm ERR! error installing [email protected]

npm ERR! Error: No compatible version found: cylon@'>=1.1.0- <1.2.0-'
npm ERR! Valid install targets:
npm ERR! ["0.0.0","0.1.0","0.2.0","0.3.0","0.4.0","0.5.0","0.6.0","0.6.1","0.7.0","0.8.0","0.9.0","0.9.2","0.10.0","0.10.1","0.10.2","0.10.3","0.10.4","0.11.0","0.11.1","0.11.2","0.12.0"]
npm ERR! at installTargetsError (/usr/share/npm/lib/cache.js:488:10)
npm ERR! at next_ (/usr/share/npm/lib/cache.js:438:17)
npm ERR! at next (/usr/share/npm/lib/cache.js:415:44)
npm ERR! at /usr/share/npm/lib/cache.js:408:5
npm ERR! at saved (/usr/share/npm/lib/utils/npm-registry-client/get.js:147:7)
npm ERR! at Object.oncomplete (/usr/lib/nodejs/graceful-fs.js:230:7)
npm ERR! You may report this log at:
npm ERR!
npm ERR! or use
npm ERR! reportbug --attach /home/pi/Desktop/rishi/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.18.11-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "cylon" "cylon-pebble"
npm ERR! cwd /home/pi/Desktop/rishi
npm ERR! node -v v0.6.19
npm ERR! npm -v 1.1.4
npm ERR! message No compatible version found: cylon@'>=1.1.0- <1.2.0-'
npm ERR! message Valid install targets:
npm ERR! message ["0.0.0","0.1.0","0.2.0","0.3.0","0.4.0","0.5.0","0.6.0","0.6.1","0.7.0","0.8.0","0.9.0","0.9.2","0.10.0","0.10.1","0.10.2","0.10.3","0.10.4","0.11.0","0.11.1","0.11.2","0.12.0"]
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/Desktop/rishi/npm-debug.log
npm not ok

i have a problem with install

npm http GET https://registry.npmjs.org/cylon-firmata
npm http 304 https://registry.npmjs.org/cylon-firmata
npm http GET https://registry.npmjs.org/firmata
npm http 304 https://registry.npmjs.org/firmata
npm http GET https://registry.npmjs.org/object-assign
npm http GET https://registry.npmjs.org/serialport
npm http GET https://registry.npmjs.org/browser-serialport
npm http 304 https://registry.npmjs.org/object-assign
npm http 304 https://registry.npmjs.org/browser-serialport
npm http 304 https://registry.npmjs.org/serialport
npm ERR! Error: No compatible version found: object-assign@'^1.0.0'
npm ERR! Valid install targets:
npm ERR! ["0.1.0","0.1.1","0.1.2","0.2.0","0.2.1","0.2.2","0.3.0","0.3.1","0.4.0","1.0.0"]
npm ERR! at installTargetsError (/home/pi/node-v0.10.2-linux-arm-pi/lib/node_modules/npm/lib/cache.js:685:10)
npm ERR! at /home/pi/node-v0.10.2-linux-arm-pi/lib/node_modules/npm/lib/cache.js:607:10
npm ERR! at saved (/home/pi/node-v0.10.2-linux-arm-pi/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:138:7)
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]

npm ERR! System Linux 3.12.28+
npm ERR! command "/home/pi/node-v0.10.2-linux-arm-pi/bin/node" "/home/pi/node-v0.10.2-linux-arm-pi/bin/npm" "install" "cylon-firmata"
npm ERR! cwd /home/pi
npm ERR! node -v v0.10.2
npm ERR! npm -v 1.2.15
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/npm-debug.log
npm ERR! not ok code 0

CylonJS + SparkCore+ Servo != work

I am trying to get Cylon to control a servo with a sparkcore.
I have remove the token/deviceids..but have verified that the sparkcore will activate the servo with its native code.
Here is a quick sample-
var Cylon = require('cylon');

Cylon.robot({
connections: [
{ name: 'spark', adaptor: 'spark', accessToken: 'xxxxxx', deviceId: '5xxxxx' }
],

devices: [

    {name:'led', driver:'led', pin:'D7', connection:'spark'},
    {name:'servo', driver:'servo', pin:'D1', connection:'spark'}

],

work: function(my) {
    every((1).second(), function() {my.led.toggle()});
   my.servo.angle(180);

}

}).start();

Also-
I added the led to make sure the code was actually talking to the sparkcore..but even without the LED code-The servo will not activate.

Help-

i2c version of the pca9685

I would like to request a driver for the i2c version of the pca9685 (available as a module for Arduino and Raspberry Pi).
Currently there is only a driver for the Tessel pca9685 which doesn't seem to be compatible with the Arduino and Raspberry Pi device.

Some question about cylon.

Hello!, I have watched this video demonstration (https://vimeo.com/96477741) about Cylon
and I think it not the same as Johnny-Five do. I have question to make me confirm that it doesn't like Johnny-Five.

When I run cylon (node myscript.js) it will upload the code to my Arduino ? So when me put my USB off the code also in my Arduino and when I give my Arduino the Power adapter my Arduino will run my old script (myscript.js) that right ?

Error while running The "Hello, World" Of Things example

Hi,

I have the following error while running the following error while running the hello world example:

nimbus-image-1435240702576

Im on elementaryos which is based on ubuntu.

I executed:
sudo apt-get update && sudo apt-get install arduino arduino-core as mentioned in this article

Then
npm install cylon-firmata cylon-gpio cylon-i2c as mentioned in the cylon website. Is this a known issue?

I can't install the "cylon-firmata" package.

> [email protected] install /Users/matheusmariano/Desktop/Display (cylon)/node_modules/cylon-firmata/node_modules/firmata/node_modules/serialport
> node-pre-gyp install --fallback-to-build

node-pre-gyp http GET https://node-serialport.s3.amazonaws.com/serialport/v1.4.2/Release/node-v11-darwin-x64.tar.gz
node-pre-gyp http 404 https://node-serialport.s3.amazonaws.com/serialport/v1.4.2/Release/node-v11-darwin-x64.tar.gz
node-pre-gyp http Pre-built binary not available for your system (falling back to source compile with node-gyp) 
  CXX(target) Release/obj.target/serialport/src/serialport.o
  CXX(target) Release/obj.target/serialport/src/serialport_unix.o
  CXX(target) Release/obj.target/serialport/src/serialport_poller.o
  SOLINK_MODULE(target) Release/serialport.node
  SOLINK_MODULE(target) Release/serialport.node: Finished
  COPY /Users/matheusmariano/Desktop/Display (cylon)/node_modules/cylon-firmata/node_modules/firmata/node_modules/serialport/build/serialport/v1.4.2/Release/node-v11-darwin-x64/serialport.node
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `printf '%s\n' 'cmd_/Users/matheusmariano/Desktop/Display?(cylon)/node_modules/cylon-firmata/node_modules/firmata/node_modules/serialport/build/serialport/v1.4.2/Release/node-v11-darwin-x64/serialport.node := rm -rf "/Users/matheusmariano/Desktop/Display (cylon)/node_modules/cylon-firmata/node_modules/firmata/node_modules/serialport/build/serialport/v1.4.2/Release/node-v11-darwin-x64/serialport.node" && cp -af "Release/serialport.node" "/Users/matheusmariano/Desktop/Display (cylon)/node_modules/cylon-firmata/node_modules/firmata/node_modules/serialport/build/serialport/v1.4.2/Release/node-v11-darwin-x64/serialport.node"' > ./Release/.deps//Users/matheusmariano/Desktop/Display?(cylon)/node_modules/cylon-firmata/node_modules/firmata/node_modules/serialport/build/serialport/v1.4.2/Release/node-v11-darwin-x64/serialport.node.d'
make: *** [/Users/matheusmariano/Desktop/Display (cylon)/node_modules/cylon-firmata/node_modules/firmata/node_modules/serialport/build/serialport/v1.4.2/Release/node-v11-darwin-x64/serialport.node] Error 2
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:807:12)
gyp ERR! System Darwin 13.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--name=serialport" "--configuration=Release" "--module_name=serialport" "--version=1.4.2" "--major=1" "--minor=4" "--patch=2" "--runtime=node" "--node_abi=node-v11" "--platform=darwin" "--target_platform=darwin" "--arch=x64" "--target_arch=x64" "--module_main=./serialport" "--host=https://node-serialport.s3.amazonaws.com/" "--module_path=/Users/matheusmariano/Desktop/Display (cylon)/node_modules/cylon-firmata/node_modules/firmata/node_modules/serialport/build/serialport/v1.4.2/Release/node-v11-darwin-x64" "--remote_path=./serialport/v1.4.2/Release/" "--package_name=node-v11-darwin-x64.tar.gz" "--staged_tarball=build/stage/serialport/v1.4.2/Release/node-v11-darwin-x64.tar.gz" "--hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.2/Release/" "--hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.2/Release/node-v11-darwin-x64.tar.gz"
gyp ERR! cwd /Users/matheusmariano/Desktop/Display (cylon)/node_modules/cylon-firmata/node_modules/firmata/node_modules/serialport
gyp ERR! node -v v0.10.28
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node rebuild --name=serialport --configuration=Release --module_name=serialport --version=1.4.2 --major=1 --minor=4 --patch=2 --runtime=node --node_abi=node-v11 --platform=darwin --target_platform=darwin --arch=x64 --target_arch=x64 --module_main=./serialport --host=https://node-serialport.s3.amazonaws.com/ --module_path=/Users/matheusmariano/Desktop/Display (cylon)/node_modules/cylon-firmata/node_modules/firmata/node_modules/serialport/build/serialport/v1.4.2/Release/node-v11-darwin-x64 --remote_path=./serialport/v1.4.2/Release/ --package_name=node-v11-darwin-x64.tar.gz --staged_tarball=build/stage/serialport/v1.4.2/Release/node-v11-darwin-x64.tar.gz --hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.2/Release/ --hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.2/Release/node-v11-darwin-x64.tar.gz' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/matheusmariano/Desktop/Display (cylon)/node_modules/cylon-firmata/node_modules/firmata/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:76:29)
node-pre-gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
node-pre-gyp ERR! stack     at maybeClose (child_process.js:753:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:5)
node-pre-gyp ERR! System Darwin 13.3.0
node-pre-gyp ERR! command "node" "/Users/matheusmariano/Desktop/Display (cylon)/node_modules/cylon-firmata/node_modules/firmata/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/matheusmariano/Desktop/Display (cylon)/node_modules/cylon-firmata/node_modules/firmata/node_modules/serialport
node-pre-gyp ERR! node -v v0.10.28
node-pre-gyp ERR! node-pre-gyp -v v0.5.19
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/node rebuild --name=serialport --configuration=Release --module_name=serialport --version=1.4.2 --major=1 --minor=4 --patch=2 --runtime=node --node_abi=node-v11 --platform=darwin --target_platform=darwin --arch=x64 --target_arch=x64 --module_main=./serialport --host=https://node-serialport.s3.amazonaws.com/ --module_path=/Users/matheusmariano/Desktop/Display (cylon)/node_modules/cylon-firmata/node_modules/firmata/node_modules/serialport/build/serialport/v1.4.2/Release/node-v11-darwin-x64 --remote_path=./serialport/v1.4.2/Release/ --package_name=node-v11-darwin-x64.tar.gz --staged_tarball=build/stage/serialport/v1.4.2/Release/node-v11-darwin-x64.tar.gz --hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.2/Release/ --hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.2/Release/node-v11-darwin-x64.tar.gz' (1)
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the serialport package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR!     npm owner ls serialport
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "cylon-firmata"
npm ERR! cwd /Users/matheusmariano/Desktop/Display (cylon)
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/matheusmariano/Desktop/Display (cylon)/npm-debug.log
npm ERR! not ok code 0

Possible issue with multiple devices using the same driver

Configured devices

Cylon.robot
  devices:
    [
      { name: 'green', pin: 12, driver: 'led' },
      { name: 'red', pin: 7, driver: 'led' }
    ]

Log output

Starting devices...
Starting device 'green' on pin 12
LED on pin 12 started
Starting device 'red' on pin 7
LED on pin 12 started

Problem

Only the first LED is initialized, if I reorder the lines, then the other LED is initialized instead.

Button Driver Not Working As Expected

I am trying to run the following button driver example on my Raspberry Pi model B but even without connecting the button the program starts giving button push events continuosly.

Raspberry Pi Revision:

| Revision | Release Date | Model       | PCB Revision | Memory | Notes                     |
|--------- | ------------ | ----------- | ------------ | ------ | ---------------------------
| 0003     | Q3 2012      | B (ECN0001) | 1.0          | 256MB  | Fuses mod and D14 removed | 

Node:
v0.10.0

cylon-raspi:
0.11.0

Program:
cylon-example

Logs:
cylon-example-log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.