You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* This sketch sends data via HTTP GET requests to data.sparkfun.com service.
3
-
*
4
-
* You need to get streamId and privateKey at data.sparkfun.com and paste them
5
-
* below. Or just customize this script to talk to other HTTP servers.
6
-
*
2
+
Go to thingspeak.com and create an account if you don't have one already.
3
+
After logging in, click on the "New Channel" button to create a new channel for your data. This is where your data will be stored and displayed.
4
+
Fill in the Name, Description, and other fields for your channel as desired, then click the "Save Channel" button.
5
+
Take note of the "Write API Key" located in the "API keys" tab, this is the key you will use to send data to your channel.
6
+
Replace the channelID from tab "Channel Settings" and privateKey with "Read API Keys" from "API Keys" tab.
7
+
Replace the host variable with the thingspeak server hostname "api.thingspeak.com"
8
+
Upload the sketch to your ESP32 board and make sure that the board is connected to the internet. The ESP32 should now send data to your Thingspeak channel at the intervals specified by the loop function.
9
+
Go to the channel view page on thingspeak and check the "Field1" for the new incoming data.
10
+
You can use the data visualization and analysis tools provided by Thingspeak to display and process your data in various ways.
11
+
Please note, that Thingspeak accepts only integer values.
12
+
13
+
You can later check the values at https://thingspeak.com/channels/2005329
14
+
Please note that this public channel can be accessed by anyone and it is possible that more people will write their values.
7
15
*/
8
16
9
17
#include<WiFi.h>
10
18
11
19
constchar* ssid = "your-ssid";
12
20
constchar* password = "your-password";
13
21
14
-
constchar* host = "data.sparkfun.com";
15
-
constchar* streamId = "....................";
16
-
constchar* privateKey = "....................";
22
+
constchar* host = "api.thingspeak.com";
23
+
constint httpPort = 80;
24
+
const String channelID = "2005329";
25
+
const String writeApiKey = "V6YOTILH9I7D51F9";
26
+
const String readApiKey = "34W6LGLIFXD56MPM";
27
+
28
+
// The default example accepts one data filed named "field1"
29
+
// For your own server you can ofcourse create more of them.
30
+
int field1 = 0;
31
+
32
+
int numberOfResults = 3; // Number of results to be read
33
+
int fieldNumber = 1; // Field number which will be read out
0 commit comments