Key Concepts of MODE
As you may have seen before, an IoT system built on the MODE platform typically have the following architecture:
To build your own IoT system, you are likely going to:
- Set up a project on MODE.
- Implement device firmware that talks to MODE.
- Implement mobile app as the user interface.
Optionally, you may also integrate the system with your programs that run on a separate server. (More on this later.)
But before starting your project, you should become familiar with the following concepts:
Project and Developer
MODE provides a cloud backend for your project and you are a developer of your project. Everything you see – devices, users, etc. – belongs to your project.
A developer can configure and manage the cloud backend for the project. A project can have multiple developers.
Home, Device and Device Class
The main unit of device management is home. A home in MODE can contain multiple devices. The home can have multiple users (home members) who can control these devices.
A device represents a unit of the hardware product that you manufacture. You will manufacture thousands of units and each of them will be owned by different people. You want to assign to each unit some unique information such as access token or serial number. MODE maintains a database of devices for your project to track the information associated with each unit.
Devices that behave the same belong to a device class. When you configure a device class, all devices belonging to that class will be affected.
User and App
A user is an end-user of your product. She can control devices connected to a home that she belongs to. A user may control the devices from a mobile app or from the web. These mobile apps and web user interfaces are referred to as Apps. An app interacts with homes and devices on behalf of a user.
MODE provides the API for user registration and verification so that your app can implement user onboarding easily.
You can implement business logic for your devices using an external server running on the internet. You can configure your MODE project so that this external server is notified via webhooks when your devices emit the relevant events or when apps make certain REST API calls.
You can also provision API keys for the external server so that it can send commands to devices or emit events to homes via the REST API.
Commands and Events
Devices, apps and external servers interact with each other over a home. There are two types of communications:
Commands: Apps and external servers can send commands to devices. A command is a simple JSON object and you can define arbitrary commands for your devices.
Events: Devices can emit events. Apps that subscribe to events are notified in real time if they are online. External servers can also be notified via webhooks for events.
The Developer Console is the main tool you will be using to build your IoT system. It is where you will set up your project, test and debug your firmware and apps, and monitor usage when the project is released to your customers.
|APP||A mobile or web app that connects to the cloud to interact with your smart devices.|
|DEVICE CLASS||A logical grouping of devices, i.e. the make and model of your product.|
|DEVICE||A single instance of a device class, i.e. a single smart product bought by your customer.|
|HOME||A set of users and devices that communicate with each other.|
|EXTERNAL SERVER||A server running your business logic that is integrated to your project to send commands and receive events.|