Getting Started with OKdo E1, WiFi 7 Click and Weather Click

This guide teaches you how to get started using OKdo E1 devices with Atmosphere. This includes creating your first project, programming the project’s firmware into your OKdo E1, registering the device to Atmosphere, and having its data displayed on a dashboard.

This guide demonstrates a simple project that takes the sensor readings from the Weather Click and transmits them to Atmosphere using the WiFi 7 Click.

Prerequisite: You should already have an Atmosphere account. Prerequisite: You should already have an Atmosphere Client Agent installed and running.

Hardware Requirements

The WiFi 7 Click uses more current than the E1's LDO can provide which can cause brown outs of the board. If you are having issues with connectivity or the board randomly restarting please connect the WiFi 7 Click to an external 3.3v power supply.

Software Requirements

  • A web browser that is compatible with Atmosphere IoT.
  • Atmosphere IoT Agent. The Atmosphere IoT Agent is a local application that runs in the system tray and acts as an intermediary between the computer’s connectivity protocol drivers and the browser running Atmosphere, used to assist in programming your device. You can download the Atmosphere IoT Agent from its downloads page.

Step 1 of 7: Create a New Project

Navigate to Atmosphere IoT Studio from the side menu. When you visit IoT Studio for the first time in a session, you are brought to the IoT Studio Projects screen.

  1. Click the New Project button. This displays a New Project window.
  2. Select the OKdo E1 project type and give the project a name, then click Create. This opens a new project in IoT Studio. Alternatively if you’re using an ESP32 variant that has its own project type, you can create the project for that type and still use this guide.

This guide walks through the step-by-step process to perform actions in IoT Studio, but doesn't cover the in-depth aspects of IoT Studio itself. To learn more about using IoT Studio, its areas and features, and Studio elements, visit the Atmosphere Studio section.

Step 2 of 7: Create the Project’s Embedded Firmware

  1. Navigate to the OKdo E1 Embedded tab in the project and from the Element Toolbox click on Add Element and from the list select the following and press “Save”:
    • WIFI7CLICK from Microchip
    • WEATHERCLICK from MikroElektronika

You should now have these new element available in your toolbox.

  1. Add the following elements to the canvas by clicking them in the Element Toolbox:
    • Interval Element Interval element: The interval element sets the project to run at the time set in the element’s properties, which by default is set to once per second (1000 ms).
    • WeatherClick Element WeatherClick element: Provides the ability to access the data from the sensor on the WeatherClick.
    • WiFi 7 Click Element WiFi7Click: Configures the WiFi 7 Click and provides it as an option for Device Events.
    • Device Event Element Device Event element to the canvas. The Device Event element is a coupled element between the Application and Cloud tabs that enables a project’s data to be sent to Atmosphere.

Now that we have all the elements added to the workspace we can begin to wire them together to create our project’s logic.

  1. Connect all the element together
    • Connect the Interval Element to the WeatherClick this will have the interval request the Humidity be read every second
    • Connect the WeatherClick Element to the Device Event element and this will have the data sent to Atmosphere IoT to be processed by the Cloud tab of the project.

Getting Started with OKdo E1

Your project’s embedded tab should look like the above.

Step 3 of 7: Create the Project’s Cloud Connectivity

In this step we will configure the behaviour of the server for this specific project. We will want our data stored into a Cloud Storage element so that we can use it to create dashboards later.

  1. Navigate to the Cloud tab. You should already have the DeviceEvent element available for use because it was added in the embedded tab.
  2. Add a Cloud Storage Element cloud storage element to the workspace and then connect the DeviceEvent element to it.

Getting Started with OKdo E1

Your project’s embedded tab should look like the above. All device events now received from the device will now be stored within a device storage for use by dashboard widgets and reporting.

Step 4 of 7: Compile the Project

Once the project is finished, it needs to be compiled. Compiling readies the entire project’s source code for deployment.

  1. From any tab, click the Compile button in the project options menu on the top-right of the screen. You’ll see a loading message on the screen, and will be notified when the project is compiled.

Step 5 of 7: Program the OKdo E1 Developer Kit

  1. While the Embedded tab is active, click the Program Firmware button from the tab’s toolbar. This displays the Program Firmware window.
  2. Click Program to start programming. When complete, you’ll be notified that the device is programmed with the project’s embedded firmware.

Step 6 of 7: Register the New Device

With firmware installed, the device can now be recognized and connected to Atmosphere.

To register a device:

  1. Navigate to the Devices area, and click the Register Device button in the top-right of the screen to display the Scan window. When the window opens it automatically starts scanning for available devices within range.
  2. The list of available devices appears. Select your device you just programmed and click Register.
  3. You will be requested to enter credentials for a valid WiFi access point for the device connect to. Without this the device will have no way to send data to the cloud.

Step 7 of 7: View the Data the Device is Collecting

You can now look at the device’s data that is coming in by utilizing the Device Dashboard widgets to create a custom view into your data. If you want to check to see how much data the device is using you can navigate to the device’s “Storage” tab to get more details.

Optional Step: Sending Data to your AWS Lambda Service

Now that you are getting data in Atmosphere IoT you may wish to have Atmosphere IoT forward the data to a Amazon Web Services Lambda Server that you are running.

  1. Add an AWS Lambda Element AWS Lambda element: Allows you to create a hook to an external AWS Lambda resource not owned by Atmosphere
  2. You will need to provide in the properties of the element the External ID and Role ARN that was setup in your AWS account that will grant the access needed for Atmosphere IoT to access the service.
  3. Connect the DeviceEvent element to the AWSLambda element.
  4. Select the connector between the DeviceEvent element and the AWSLambda element and make sure you set the following:
    • Function Name: A string value that contains the name of the Lambda function you wish to invoke like "ProcessData"
    • Payload: Simply set this to value which will have the data that is coming from the DeviceEvent element passed directly to the lambda function
  5. From any tab, click the Compile button in the project options menu on the top-right of the screen. You’ll see a loading message on the screen, and will be notified when the project is compiled.

When your project is done re-compiling your already deployed devices will be updated automatically with the new cloud logic, but not any new embedded changes until you re-program the embedded device. In this example as we have only changed our project in the Cloud tab since the last program this won’t be necessary.

For more information about integrating your Atmosphere IoT projects with AWS services please refer to the documentation here.