Skip to content

Quickstart

This guide will help you to get started quickly with Sensora IoT

Setup project

Before getting started with hardware, make sure to complete the steps below.

Create new project

Project is a workspace where you can monitor, control, and analyze your IoT devices. Go to the Projects tab and look for the New Project button on the dashboard, located at the top right corner of the dashboard.

Add device template

Device template is a group of configurations that specify the characteristics of devices you plan to add to the project.

  • Template name - specify a name that is easy to remember
  • Hardware - select the board that you are using

Add device

After device template is created, click Add device now. Fill all the required fields and click Create Device.

Be careful!

Please note, the Device Token will only be shown once for security reasons. Ensure you copy and securely store the Device Token as you will need it to configure the device later. If the Device Token is lost, you will not be able to retrieve it and you may need to create a new device.

Provision device

In this process we will connect the hardware with Sensora Cloud. Read more

PlatformIO

We suggest using PlatformIO for IoT development. You can install it in your favourite editor. How to install.

  • Create new project "PlatformIO Home > New Project"
  • Update platformio.ini file and add Sensora library as a dependency.
ini
[env:myenv]
lib_deps =
  https://github.com/sensora-io/sensora-library#dev
  • Build the project and PlatformIO will automatically install dependencies.

Source code

The following code simulates a temperature and humidity sensor. Paste it into src/main.cpp and upload it to device using PlatformIO: Upload command

cpp
#include <Arduino.h>
#include <EspWifi.h>

Property temperatureProperty("temperature");
Property humidityProperty("humidity");

unsigned long lastRead = 0;
int roomTemperature = 20;
int roomHumidity = 40;

void setup() {
  Serial.begin(115200);
  temperatureProperty.setDataType(DataType::Integer).setAccessMode(AccessMode::Read);
  humidityProperty.setDataType(DataType::Integer).setAccessMode(AccessMode::Read);
  Sensora.setup();
}

void loop() {
  Sensora.loop();

  if (millis() - lastRead > 15000) {
    // simulate a value between 0 and 15 degrees
    roomTemperature = random(0, 15);
    temperatureProperty.setValue(roomTemperature);

    // simulate a value between 40 and 70 percent
    roomHumidity = random(40, 70);
    humidityProperty.setValue(roomHumidity);
    lastRead = millis();
  }
}

Provision device Chrome v89+

After the firmware is uploaded, open the Sensora Cloud and go to Devices.

  • Click Setup device and connect to the serial port of device.
  • Provide WiFi SSID , WiFi password and click Next.
    • Most of devices require WiFi frequency 2.4GHZ. Make sure the provided SSID can support that.
  • Provide device token that you copied before and click Next.
  • Wait some seconds until device is ready.

Setup widgets

Here, you will need to provide the necessary information and configure your new widget.

  • Widget Type: - select Single Metric widget
  • Device: Select the device whose property you want to associate with this widget.
  • Node & Property: After selecting the device, you'll need to choose a specific node and property of that device which this widget will be linked to. If the property is not linked to a node, it will be displayed in Standalone Properties node.
  • Widget Name: Provide a unique name for the widget. This will help in identifying the widget on your dashboard.
  • Create After you've filled out all the necessary information and configured the widget, click 'Save'. The new widget will be added to your dashboard.

Interacting with Widgets

Once you've created a widget, it will appear on your dashboard. The widgets update in real-time, showing the latest data from the associated device property.

Congratulations 🎉

You just created your IoT project