Skip to content

Module Search

wwitman edited this page Dec 18, 2015 · 3 revisions

Searching for Zetta modules

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. The Zetta team and the open source community have written dozens of Zetta device drivers for many kinds of devices and made them available through NPM and, in some cases, GitHub.

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.

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.

Other ways to find drivers

You can use the repository search in GitHub to look for Zetta driver projects. The search can locate projects that are not available on NPM.

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. You can check out the node-gyp project allows you to compile native addon modules for Node.js.

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

Clone this wiki locally