0% found this document useful (0 votes)
11 views8 pages

Cloud Interface

The document provides instructions for connecting a NodeMCU to a PC and uploading code to it. It includes code snippets for setting up a DHT sensor and connecting to WiFi using a specified API key. The setup process involves selecting the correct board, baud rate, and COM port before uploading the code to the NodeMCU.

Uploaded by

Venkat Balaji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views8 pages

Cloud Interface

The document provides instructions for connecting a NodeMCU to a PC and uploading code to it. It includes code snippets for setting up a DHT sensor and connecting to WiFi using a specified API key. The setup process involves selecting the correct board, baud rate, and COM port before uploading the code to the NodeMCU.

Uploaded by

Venkat Balaji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Cloud Interface

Interface With Cloud


Channel Settings
API Keys, mainly Write API
1.

1. Connect the NodeMCU with micro USB cable to your PC.


2. Press and hold flash button and press the reset
button once and now you leave the flash button.
3. Select the NodeMCU v1.0 as board.
4 Select 115200 as baud rate and select the correct COM port.
5 Press upload button, it may take 2 min to compile the code
and another one minute to upload to NodeMCU.
• #include <DHT.h> // Including library for dht

• #include <ESP8266WiFi.h>

• String apiKey = "xxxxxxxxxxx"; // Enter your Write API key from
ThingSpeak

• const char *ssid = "xxxxxxxxxx"; // replace with your wifi ssid and wpa2
key
• const char *pass = "YYYYY";
• const char* server = "api.thingspeak.com";

• #define DHTPIN 0 //pin where the dht11 is connected

• DHT dht(DHTPIN, DHT11);

• WiFiClient client;
• void setup()
• {
• Serial.begin(115200);
• delay(10);
• dht.begin();

• Serial.println("Connecting to ");
• Serial.println(ssid);


• WiFi.begin(ssid, pass);

• while (WiFi.status() != WL_CONNECTED)
• {
• delay(500);
• Serial.print(".");
• }
• Serial.println("");
• Serial.println("WiFi connected");

• }

You might also like