-
Notifications
You must be signed in to change notification settings - Fork 114
Module Search
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.
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
orZetta
keywords that are not relevant to thezettajs
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 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 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.
Need help? Visit the Zetta Discuss List !
Need help? Visit the Zetta Discuss List ! |
---|
About Zetta
Videos and webcasts
- NEW! Building with Zetta
Tutorials
- NEW! Zetta tutorial series
- Quick start
- Configure a simple device
- Build a mock LED device
- Use the browser client
- Deploy a Zetta server to Heroku
Understanding Zetta
Writing Zetta drivers
- Finding Zetta device drivers
- Create a device driver from starter code
- More coming soon...
Using streams
Reference