How to Retrieve Data from Cloud (ThingSpeak) using ESP8266?

IoT Extension
Description
Learn how to use evive and PictoBlox to retrieve data from the cloud (ThingSpeak). We will connect evive to the Internet using the ESP8266 module and use the Internet of Things extension to create a program to retrieve the data from the ThingSpeak channel.
evive Alert
Alert: If you have not done our previous tutorial on “How to Send Data to Cloud (ThingSpeak) using ESP8266?“, then complete it first. We will use it in this tutorial.

Introduction

In the last tutorial, we have seen how to send sensor data to ThingSpeak. To complete the whole Internet of Thing loop, we will now learn how to retrieve sensor data from the cloud (ThingSpeak). We will retrieve the last data sent in the previous project.

Connecting evive to the Internet

To connect evive to the internet we will use the ESP8266 module.

Connect ESP8266 Module to its header on evive:

WiFi ESP8266

ThingSpeak Parameters

You will need the following parameters from your channel to access the data:

  1. Channel ID
  2. Read and Write API
    API Keys

PictoBlox Program

In this example, we will be sending data to the potentiometer data to the ThingSpeak channel we have created.

  1. Open PictoBlox.
  2. Select the board as evive:
    Selecting Board
  3. Connect the evive.
    Select Port
  4. Add the Internet of Things extension in PictoBlox by clicking on the add extension button on the bottom left corner.
    Load Extensions
  5. Create the following script using when evive starts up block:
    Retrieving Data
  6. Upload the code onto evive:
    Upload Code

You can download the PictoBlox program from here: IoT – Receiving data to ThinkSpeak

When you start your evive, you will see two things happening:

  1. M1 LED glowing:
    1. Yellow: Connected to Wi-Fi.
    2. Red: Not connected to Wi-Fi. Check if your Wi-Fi name and password are correct.
  2. M2 LED glowing:
    1. Yellow: Connected to ThingSpeak.
    2. Red: Not connected to ThingSpeak.

Conclusion

In conclusion, this tutorial taught us how to retrieve data from the cloud (ThingSpeak) using evive and PictoBlox. We connected evive to the internet using the ESP8266 module and then used the Internet of Things extension to create a program to retrieve the data from the ThingSpeak channel. We then uploaded the program to evive and watched the LED indicators to check if the connection was established.

Table of Contents