JavaScript goes beyond the Web in 2014

A translation of the article by Patrick Catanzariti, the original can be found here .

JavaScript, evolving, has stepped far from its original role in DHTML sites of the 90s. He quickly takes a leading position as a candidate for the role of a universal language for the Internet of Things. And while it's too early to speculate whether JavaScript will win this contest, I believe that it definitely has an important role to play in the ever-expanding space of the Internet of Things.

Last year, I wrote a review about technologies that could seriously interest JavaScript developers - JavaScript Beyond the Web. Since then, many new devices and capabilities have appeared, so I want to write a review about the changes that have occurred in the JavaScript world and among interconnected devices during 2014.

The list of devices capable of interacting via JavaScript is growing every month. We've got both official JavaScript APIs released by device manufacturers, as well as community efforts aimed at making JavaScript features accessible to others.

Ninjasphere




Ninja Sphere - a new generation of home automation, created by the same team that gave the world Ninja Blocks. Ninja Sphere has replaced the original Ninja Blocks set and has a group of new features, now it supports Bluetooth Smart devices and ZigBee framework . It looks like a luminous smooth technological ball from a sci-fi movie, is initially compatible with a dozen new devices and even supports gesture control.

Apply JavaScript Skills


  • Node.js library NinjaSphere - applications for NinjaSphere, completely written using their official library Node.js. Even drivers and device definitions for the sphere are collected in the form of JavaScript files. This is a fantastic dream for fans of JavaScript and IoT.


Leapmotion




LeapMotion is an amazing instance of technology that allows you to control applications and devices using hand gestures. It tracks both hands and all ten fingers, while developers get a futuristic alternative to an ordinary mouse and keyboard.

Over the past year, there have been changes in the world of LeapMotion towards exciting new opportunities. They ( approx lane.. - I suppose it is a question of the development team) appeared V2 beta to capture hand movements - can be made to fine-tune the capture, making it much safer. Now they can determine the characteristic bones of each of the fingers!

V2 also provides a new, amazing application of LeapMotion - in the world of virtual reality. Virtual reality is an amazing thing, but the fact that you can’t see your hands there is a little discouraging. Get the new LeapMotion mount for Oculus and you can connect your LeapMotion to the Oculus VR helmet, this will allow you to interact with the virtual worlds with your own hands.

As for JavaScript, the LeapMotion team provided the JavaScript SDK of the highest standard with excellent documentation and examples - it has already been updated with a lot of V2 functionality.

Apply JavaScript Skills


  • LeapMotion JavaScript framework - portes almost all LeapMotion features to web applications and Node. You can already use most of the V2 beta functionality in JavaScript development, we only expect the capture capabilities for BP to come out (when mounted on the head), we hope that they will appear soon.

Pebble Watches




Oh, a Pebble watch ... don't let me get carried away by laudatory odes to this device. I’m a genuine Pebble enthusiast and I strongly advocate that people choose this particular watch. At a time when the Apple Watch and Android Wear had not yet appeared, the Pebble team was a pioneer in creating incredible functionality, easy-to-use smart watches that can connect via Bluetooth with both IPhone (s) and Android devices. They use an e-paper display, thanks to which you can read in direct sunlight without difficulty, as well as a resource battery that holds a charge for about a week.

This year, Pebble SDK version 2.0 was released, along with the Pebble Appstore, a set of new features and, most amazingly, the PebbleKit JavaScript framework.

Apply JavaScript Skills


  • PebbleKit JavaScript Framework- This framework allows you to execute JavaScript on your phone to receive data from the web, while gaining rich experience in web-development of the front interfaces of watches (in the original - watchfaces) and applications. He also has access to the location data of your phone, so you can create Web API applications that work with location data. The watch application, as such, still involves writing code in C, but those of you who do not have sufficient experience with C can take a watchface sample, make minimal changes that do not require extensive knowledge of C, and then write most of the amazing functionality in javascript! If you cannot stand the development of Pebble, then in the two articles below on SitePoint I talked about where to start,
  • JavaScript development for Pebble watches is my first article on the basics;
  • Advanced Pebble clock configuration - how to add configuration options for Pebble applications using JavaScript framework;
  • Pebble.js is the official framework for writing Pebble applications, although it is still in beta, it is completely written in JavaScript ! Expect in the coming months.


Oculus rift




The Oculus Rift helmet has made virtual reality more accessible for us than before. Not so long ago, Developer Kit 2 appeared this year , and new versions of the helmet loomed on the horizon - the Crescent Bay prototype and Samsung Gear VR working with the Samsung Galaxy Note 4.

Although there are still no official JavaScript APIs for Oculus Rift, there are several Opportunities to create new sensations from using Oculus with JavaScript.

Apply JavaScript Skills


  • OculusBridge is a desktop application and JavaScript library for creating OculusRift web entertainment built on Three.js. There are installers for both Windows and MacOS, it works on Chrome28, Safari 6 and Firefox22. IE is not mentioned, so I'm not sure if it is supported. This is the JS library that I made relatively easy to work on my MacBook;
  • vr.js is a plug-in for Chrome and Firefox that provides access to the OculusRift helmet, however it runs using NPAPIs that are not supported in Chrome , so this may not work as a long-term solution. Instead, I experimented with OculusBridge;
  • Babylon.js and IE11 - if you got a computer with IE11, you can create a 3D environment using Babylon.js , and then, using the driver and one single line of code, select the orientation of the device. This way you will get experience with OculusRift VR! It's no secret that it doesn’t work with Chrome right now, but we’ll cross our fingers in the hope that this will change soon.


Cylon




Cylon.js is a very useful JavaScript API that has reached maturity this year; it is a framework for robotics and the Internet of Things. Allowing us to program for a number of devices using the same API structures, it helps JavaScript bridge the gap between these devices; and in this regard o succeeded. He does all this in a way that is easy to understand, so programming for devices is becoming a really simple task. Cylon.js works with several modules, which supports an ever-growing list of devices, including LeapMotion, Pebble watches, Andruinos, Raspberry Pis and others.

Arduino YUN



Until now, we could send commands from remote Node servers to Arduino devices in many different ways through Node. It has always been assumed that Arduino runs its own C code, which “understands” how to interact with the Node server. The new Arduino, the Arduino YUN , was introduced this year . This is the first Arduino with pre-installed Linux on board, i.e. you can install and run a web server on your Arduino that can interact with it (with Arduino) directly, eliminating the need to run commands from the main server, which is located elsewhere.

Apply JavaScript Skills


  • Installing Node.js on Arduino YUN - for JS developers, thanks to pre-installed Linux, you can install Node.js directly on Arduino and store a huge amount of executable code right on board. In essence - your Arduino can execute JavaScript!
  • Cylon.js module - also has its own Cylon.js module, which can be installed on YUN


Spark OS



Spark OS is an operating system in the cloud that allows devices with Internet access to interact with each other. They are built on Spark Cores - similar to Arduino (but much smaller in size than Arduino Uno) microcontroller boards with Wi-Fi support. By connecting the device to a Wi-Fi network, you can send commands to its Spark Core board via a cloud platform. This is the easiest installation process for the IoT device I have dealt with, and it is also the simplest device in terms of connectivity and regular use.

Apply JavaScript Skills




Tessel



Tessel also entered the world this year . Tessel is a microcontroller similar to Arduino and SparkCore, however it is designed specifically for JavaScript developers, because the platform itself runs JavaScript. It is compatible with thousands of thousands of Node.js packages (but Node itself doesn’t execute) that are designed to harness the full potential of the JavaScript ecosystem and its developers.

Apply JavaScript Skills




Espruino



In the same year, but earlier, another microcontroller was released that also runs JavaScript - this is Espruino . It is a tiny platform that runs on a single chip and is so energy efficient that it can run on battery power for almost a year. It does not execute Node modules, but instead it works through an event-oriented system where the device is able to execute your JavaScript command in real time. You execute the code on the device, sending it from your computer, then, having enjoyed it, you execute the command on Espruino, which saves the current functions and configurations. This is a model that is fundamentally different from the one where the code needs to be unloaded with every change, as happens on Arduino and Tessel.

Apply JavaScript Skills




Intel Galileo



The Intel Galileo board is a microcontroller board that uses its own Intel components, but the contact structure is borrowed from Arduino Uno, thanks to this you can use screens from Arduino. Galileo, like Arduino YUN, runs Linux on board. However, the volume of the Linux image used is very limited, a larger Linux image can be installed by connecting an SD card. This fairly complete Linux contains Node.js with all its JavaScript capabilities (along with many other non-JS features).

Apply JavaScript Skills


  • The “larger” Linux image with Node.js is SparkFun’s guide on how to get started with the SD card option for Linux. This is definitely the most important opportunity with the greatest potential. This does not cover the use of the Node.js server, since the bias goes towards Python, but this is the starting point (approx.
  • Intel Galileo programming on JavaScript and Node.js - this article describes in more detail how to work with Node on the platform, shows how to install the Johny-Five module on the platform itself
  • Cylon - the Cylon module works if you have an SD card with full Linux installed
  • Galileo-IO module for Johny-Five - in the same way that Arduino is controlled through the Johny-Five module, JavaScript control (in this case) is carried out through the Node server, which is located outside


Google Cardboard Box



This year, a very strange but still promising idea was presented on Google I / O - a Google cardboard box . These are cardboard glasses of virtual reality with your own hands that can be connected to an Android device and get a relatively inexpensive VR experience. The documentation focuses on native Android development, but experiments are also shown for Chrome; the latter reflects the web-based potential of virtual reality, which is animated by JavaScript.

Apply JavaScript Skills


  • Chrome Cardboard Experiments - Contains a collection of “demos” and sample code. The source code of the demo programs is given in order to have a visual representation of how this works.


Myo armband



Myo Armband uses the electrical activity of your muscles to control applications through hand gestures completely wirelessly. This is a relatively new device and today pre-ordered copies are being delivered. We will have a group of new developers who will try to give it a boost during the year, and we will see how well this new device works. I look forward to my copy. This technology definitely has enormous potential.

Apply JavaScript Skills


  • MyoJS is an unofficial JavaScript framework for Myo. Unfortunately, official support does not yet exist.


Nest



The Nest team currently has two smart devices: Nest thermostat and Nest protect (smoke and carbon monoxide detector). This year they opened their Nest Developer Program and Nest API to the public. Although they do not have a specific JavaScript API, they show examples of how to access the Nest API through JavaScript.

Apply JavaScript Skills




Conclusion


As you can see, one way or another, but the number of devices with JavaScript support is growing. In addition to what I can list in an article of justifiable size, there is still a lot of interesting things! JavaScript developers from all over the world, those of you who have not dealt with an IoT device yet, have enormous potential to realize all your skills - get a device for yourself and start experimenting!

Also popular now: