Skip to content

Module Search

wwitman edited this page Dec 18, 2015 · 3 revisions

Finding Zetta device drivers

If you're starting a Zetta IoT project, it's a good idea to discover if there are any existing device drivers that you can use. Zetta device drivers are available for many kinds of devices, and can be installed using NPM.

This topic explains how to locate existing Zetta device drivers that are available in the public domain.

Use the Zetta modules search page

The best way to see what's out there is to use the Zetta modules search page on the zettajs.org web site.

The search page loads all the NPM projects that have the keyword zetta or Zetta. Then, you can search for specific device names within the results page. For example, the following in the following screen shot, we searched for drivers with bonescript in the name.

Note: The search page omits some NPM projects that happen to have zetta or Zetta keywords that are not relevant to the zettajs open source project.

Tip: The module search discovers NPM projects that match the zetta or Zetta keywords, but not all matches will be device drivers. Note that by convention, Zetta device drivers follow this naming convention:

`zetta-[device name]-[platform name]-driver`

For example:

`zetta-pir-bonescript-driver`

Therefore, you might search in the modules results page for driver to get a list of all the Zetta drivers. Or, search for a specific platform, such as bonescript or edison to find platform-related drivers.

If you can't find a driver

If a driver doesn't exist for your specific device needs, you can write your own Zetta device driver. For this, you'll need to determine first if there is an existing Node.js interface for the device, such as the BoneScript library for Beaglebone devices or the node-hue-api library for the Philips Hue lighting systems.

A good way to begin a new driver project is to stand up one of the sample projects, such as the Mock LED Device project, and follow the same pattern used to write and use the sample device driver. Assuming you have a Node.js module that you can use to interact with your device, then you can implement transition functions that call the device-specific Node.js interface.

If your device does not have a Node.js library

If you're working with a device that does not have a Node.js library already, then you're faced with developing a Node.js module that can interface with your specific device. In this case, the best place to start is with the Addons topic in the Node.js documentation. Addons are dynamically-linked shared objects that can provide glue to C and C++ libraries.

Developing native Addons for Node.js is beyond the scope of the Zetta documentation.

Clone this wiki locally