-
Notifications
You must be signed in to change notification settings - Fork 17
Basic Concepts
There are some basic concepts that you should know about Eywa before you can connect your devices to it. For example, Eywa needs to know what data your device is sending, and what metadata you are sending along to describe the data. All these information should be pre-defined in something we call Channel.
Channel is a logical group of devices. These devices should share the same authentication keys, similar data schema, and the same set of metadata
Here is an example channel formatted in json for monitoring hotel rooms:
{
"name": "hotel monitoring",
"description": "This is a channel created for monitoring hotel.",
"fields": {
"brightness": "int",
"co2": "float",
"cooler": "boolean",
"humidity": "int",
"noise": "float",
"pm2_5": "int",
"temperature": "float"
},
"tags": ["building", "floor", "room", "room_type"],
"access_tokens": ["abcdefg", "1234567"]
}
What this means is that you defined a channel for monitoring hotel rooms, give it a good description so that others can understand.
The name of a channel should be unique, it doesn't make sense to have two channels share the same name but with different definitions. And this name is usually for better data visualization.
You will need to define the expected data and their types in fields. Supported data types are: int
, float
, boolean
, string
. These fields will be used for doing aggregations, stats, histograms, etc. Most fields are aligned with sensor data, for example.
Tags are interesting, it tells more information about the data. In this example, it tells Eywa that the current data is sent from which room, which floor, and what room type. So that when you query Eywa for aggregations, these tags can help filter out different results, making sure you are only looking at the data you are interested in.
Access Tokens are something you will be using to grant your device access to Eywa. In the initial handshake, Eywa will check if the request carries a registered access token in the header. Also, by changing the access token, you can turn on/off the access for a set of devices.
For more details about how to connect to Eywa, please move to Connect to Eywa
Channel management can be done via our Dashboard. However before our dashboard is released, you can use our command line tool to interactively talk to Eywa. The same tool can also help you check the status of connected devices and the indexed data sent from device for debugging.