Cylon 0.20.0 is out!
As part of our continued lead up to Cylon 1.0.0, we've just finished releasing Cylon 0.20.X.
This set of changes impact module developers more than users, but there's still some goodies in there to be found!
For a full changeset, see the compare page on GitHub.
For Application Developers
-
Browser & Mobile support: - Cylon.js now has full browser support, and can run on mobile devices too! We've even set up some examples for you! For more details, see our blog post that covers it in detail.
-
Log levels: - Cylon's logger now has log level support; and will automatically log anything over
info
level. This can be customized with a configuration value. -
Logger configuration: - One of the last outliers, Cylon's Logger configuration has been relocated to
Cylon#config
. For example:var CustomLogger = require('./custom-logger'); Cylon.config({ logging: { logger: CustomLogger, level: 'debug' } });
-
Test-Driven Robotics config changes: - when writing test-driven robotics, indicate you're in test mode through
Cylon#config
:Cylon.config({ testMode: true });
-
Explicitly specify modules: - when creating a robot, you can explicitly tell Cylon which module it should attempt to load Drivers/Adaptors from:
Cylon.robot({ name: 'testbot', connections: { myspark: { adaptor: 'myspark', module: 'cylon-spark' } }, devices: { led: { driver: 'led', pin: 9, module: 'cylon-gpio' } }, work: function() { } });
This isn't necessary in most cases, as Cylon.js is typically smart enough to find the module automatically. However, if you are using a custom module, or a module with multiple adaptors, this may prove helpful.
For Platform Developers
-
Registry: - this is the biggest change in
0.20.0
, and significantly simplifies how Cylon submodules are registered with Cylon. When writing the main file for a Cylon module, the previous syntax was something like the following (usingcylon-spark
as an example):var Cylon = require('cylon'), GPIO = require('cylon-gpio'); var Adaptor = require("./spark-adaptor"), Driver = require("./spark-driver.js"), VoodooSpark = require("./voodoospark-adaptor"), module.exports = { adaptor: function(args) { if (args.adaptor === 'spark') { return new Adaptor(args); } else if (args.adaptor === 'voodoospark') { return new VoodooSpark(args); } }, driver: function(args) { return new Driver(args); }, register: function(robot) { Cylon.Logger.debug("Registering Spark adaptor for " + robot.name); robot.registerAdaptor('cylon-spark', 'spark'); robot.registerAdaptor('cylon-spark', 'voodoospark'); robot.registerDriver('cylon-spark', 'spark'); GPIO.register(robot); } };
This is a bit messy, and involves loading up Cylon + Cylon-GPIO to just to register the module. Here's the new syntax:
var Adaptor = require("./spark-adaptor"), Driver = require("./spark-driver.js"), VoodooSpark = require("./voodoospark-adaptor"), module.exports = { adaptors: ['spark', 'voodoospark'], drivers: ['spark'], dependencies: ['cylon-gpio'], adaptor: function(args) { if (args.adaptor === 'spark') { return new Adaptor(args); } else if (args.adaptor === 'voodoospark') { return new VoodooSpark(args); } }, driver: function(args) { return new Driver(args); } };
Now, the module's supplied Adaptors and Drivers are presented as simple arrays, with a dependencies
array to indicate which other modules are supported by this one.
For example, cylon-firmata
indicates that cylon-gpio
and cylon-i2c
are dependencies.
This change hopefully reduces clutter for module developers, and makes it easy to see at a glance what a Cylon module provides for adaptors and drivers.
-
extraParams
removal: - all params passed in the connection/device configuration objects are now kept there, instead of put intoextraParams
.// for the connections hash: connections: { spark: { adaptor: 'spark', accountToken: 'YOUR_ACCOUNT_TOKEN', deviceId: 'YOUR_DEVICE_ID' } } // Cylon 0.19.0 - Spark adaptor constructor: opts.extraParams.accountToken // => 'YOUR_ACCOUNT_TOKEN' // Cylon 0.20.0 - Spark adaptor constructor: opts.accountToken // => 'YOUR_ACCOUNT_TOKEN'
More Hardware Support
And as always, no Cylon.JS release would be complete without additional hardware support. We're now up to 31 platforms, adding the following:
-
cylon-ble
for Bluetooth Low-Energy peripherals -
cylon-powerup
for the PowerUp glider (powered bycylon-ble
) -
cylon-wiced-sense
for the WICED Sense BLE tool from Broadcom -
cylon-mqtt
for communicating using the [MQTT protocol]
For more updates, be sure to follow us on Twitter at @CylonJS.
Posts
- Cylon.js Off And Rolling In 2016
- Cylon.js 1.2.0 - Logging and Timing and BLE! Oh my!
- Cylon.js 1.1.0 - The Big Cleanup
- Hello, Node Bebop Drone
- Cylon.js featured in Wired
- Cylon.js 1.0.0 is here!
- Using Socket.io With The Cylon.js API
- Cylon 0.22.0 - A New Year's Release
- Cylon 0.21.0 is out!
- Creating Multiplatform Precompiled Binaries for Node.js Modules
- Cylon 0.20.0 is out!
- Running Robots From Your Browser With Cylon.js
- Winning the Dreamforce 500 With Cylon.js
- With The New Cylon.js 0.19.0, You Can Be Fluent Too
- Cylon.js on Intel Edison
- Cylon Takes Off on NodeBots Day
- Cylon.js Fun With The Arduino Yun
- Control Robots From Your Pebble
- Making Moves With Intel Galileo
- The Cylon Nest
- Announcing Full Tessel Support!
- Cylon 0.15.0 is Out!
- Cylon.js in Make Magazine!
- Cylon.js At JSConf 2014
- Cylon.js Takes The Stage At MakerFaire
- Cylon.js In Scotland
- Robots Are The New Normal At NextBerlin
- Thingscon - Ich Bin Ein Cylon
- National Robotics Week at the Robotics Society of Southern California
- Functional Robots With Wisp
- Release 0.12 Is For RobotOps
- Making Waves At Makerland
- This One Goes To 0.11 Of Pure JavaScript
- Tipping SCaLE12X
- Intro Robeaux- A Universal User Interface To Robotic Devices
- ng-robots! A Fun Robot Hackathon At The First ng-conf
- Number 9! The Release In Which We Add A Web UX, More Platforms, and Tools
- Release 0.8.0 Makes 10 Platforms
- RobotsConf Was Remarkable
- Dreamforce Means Connected Devices Are A Thing
- Dreamforce Is Coming!
- Welcome, Cylon.js