Serial.print("Attempting to connect to SSID: ") Unsigned long m圜hannelNumber = YOUR CHANNEL ID Ĭonst char * myWriteAPIKey = "YOUR CHANNEL WRITE API KEY" įinal = Serial.readString() // read the incoming data as string Upload the following code on your NodeMCU.
It takes the uploading information from Arduino through the serial port and returns the status of uploading to Arduino. NodeMCU executes the task of uploading the information in this system.
How to Use DS1307 RTC Module with Arduino & Make a ReminderĪbsolute Beginner’s Guide to TFT LCD Displays by Arduino. SD Card Module w/ Arduino: How to Read/Write Data You can learn more about using an SD card, the clock module, and the LCD in the following links: Wait at least 15 seconds between each time you upload the data on the ThingSpeak panel. The same structured code is used in the attendance system for uploading data. MyStatus = String("field1 is greater than field2") ĭelay(20000) // Wait 20 seconds to update the channel againĪfter uploading the code, you will see some random numbers uploaded in fields 1 to 4 of your panel. Change this line if using open or WEP network WiFi.begin(ssid, pass) // Connect to WPA/WPA2 network. Serial.print("Attempting to connect to SSID: ") Thingspeak.begin(client) // Initialize Thingspeak Serial.begin(115200) // Initialize serial Unsigned long m圜hannelNumber = SECRET_CH_ID Ĭonst char * myWriteAPIKey = SECRET_WRITE_APIKEY Int keyIndex = 0 // your network key Index number (needed only for WEP) See for the full Thingspeak documentation.įor licensing information, see the accompanying license file.Ĭhar ssid = SECRET_SSID // your network SSID (name)Ĭhar pass = SECRET_PASS // your network password Visit to sign up for a free account and create a channel.ĭocumentation for the Thingspeak Communication Library for Arduino is in the README.md folder where the library was installed. Thingspeak ( ) is an analytic IoT platform service that allows you to aggregate, visualize, andĪnalyze live data streams in the cloud.
For WEP or WPA, change the WiFi.begin() call accordingly. This example is written for a network using WPA encryption. Select the target hardware from the Tools->Board menu Requires ESP8266WiFi library and ESP8622 board add-on. !!! IMPORTANT - Modify the secrets.h file for this project with your network connection and Thingspeak channel details.
Description: Writes values to fields 1,2,3,4 and status in a single Thingspeak update every 20 seconds.