We will learn how web servers like thingspeak work, then we will connect the ESP8266 to upload data to the internet and vice versa.
Hey, what's up, Guys! Akarsh here from CETech.
This project of mine is more of a learning curve to understand the thingspeak platform along with the idea of MQTT and then using Thingspeak with an ESP8266.
Towards the end of the article, we will be connecting the ESP8266 with a DHT11 and will be sending the temperature and humidity data to the Thingspeak platform over the internet. We will also be looking at the code for controlling hardware over the internet again using Thingspeak.
At the end of the tutorial, we will be able to send/receive data over the internet to the ESP8266/ESP32.
Let's start with the fun now....
You must check out PCBGOGO for ordering PCBs online for cheap!
You get 10 good quality PCBs manufactured and shipped to your doorstep for 5$ and some shipping. You will also get a discount on shipping on your first order.
PCBGOGO has the capability of PCB assembly and stencil manufacture as well as keeping good quality standards.
Do check them out If you need to get PCBs manufactured or assembled.
The platform is primarily aimed towards IoT Projects and data analytics using visuals.
To get started with the free services of Thingspeak you will first need to Sign Up using your email ID, once that is done along with the email verification you will be greeted with a similar-looking page:
Now looking at some terminologies that might help you understand this better and make your work with web servers like these smoother:
1) Reading/Downloading Data: Getting data on your ESP8266/ESP32 from the server is a read operation.
2) Writing/Uploading Data: Sending data from your ESP8266/ESP32 to the server is a write operation.
3) API Key: To have data security and to prevent anyone randomly from reading/writing data to your server there needs to be some sort of security/password and the API Key is something intended towards this. API Key is a long alphanumeric key which is needed to read/data to the server. There are separate keys for reading and writing data.
4) Channel: A channel in thingspeak is a software counterpart of an IoT hardware device that you connect to Thingspeak, in our case an ESP8266 will utilise one entire channel of our bandwidth. In a free account of thingspeak, you can have a maximum of 4 channels.
5) Field: Each channel has 8 fields. A field is a variable and stores/shares a data type, for example when we send temperature and humidity from our device to the server, both the parameters will use one field each of the channel.
That's pretty much it about thingspeak!
Copy and keep the Write API Key, we will need it later while testing out the link to Thingspeak.