How to Upload Data to Adafruit Huzza

The Adafruit Plumage HUZZAH ESP8266 is an 'all-in-one' ESP8266 WiFi development board with built in USB and battery power supplies, including a battery charging port.

The Plumage HUZZAH has an 80 MHz ESP8266 WiFi microcontroller with 3.3V logic and is simply programmed using the Arduino IDE; click here for boosted specs on the Adafruit Feather HUZZAH ESP8266.

In the following tutorial, Ubidots volition demonstrate how to setup and program the Adafruit Feather HUZZAH with ESP8266 using the Arduino IDE and Post and Go data to/from Ubidots cloud to be utilized in your Ubidots powered App.

  • Feather HUZZAH with ESP8266

  • Arduino IDE 1.eight.2or higher

  • Ubidots library

  • Ubidots business relationship -or- STEM License

  1. Plumage HUZZAH Setup using the Arduino IDE

  2. Sending (Post) Data to Ubidots

  3. Receiving (Become) Data from Ubidots

  4. Summary

To begin working with the Adafruit Feather HUZZAH ESP8266 yous need to setup the board using the Arduino IDE. For this, delight refer to the step "three. Lath & Platform Direction" of the following guide:

  • Setting up the Arduino IDE for Ubidots

1. Now with everything configured, UPLOAD the Blink Sketch to verify that everything is working properly. Go to File > Examples > Basics > Blink and compile the code.

ii. Once the code is properly updated the builtin ruby LED will start blinking. If the red LED does non start blinking you can know yous need to reinstall the board.

iii. Download and install the Ubidots library. For a detailed caption of how to install libraries using the Arduino IDE, refer to this guide.

2. Sending (Postal service) Information to Ubidots

With the following example, you lot volition be able to simulate random readings taken from the Plumage HUZZAH ESP8266 to Ubidots

i. To brainstorm posting values to Ubidots, open the Arduino IDE and paste the sample code beneath. One time you accept pasted the code, be sure to assign the post-obit parameters:

  • SSID (WiFi Name) & Password of the available network connection.

  • Ubidots TOKEN

          /****************************************
 * Include Libraries
 ****************************************/

#include "Ubidots.h"

/****************************************
 * Define Instances and Constants
 ****************************************/

const char* UBIDOTS_TOKEN = "...";  // Put here your Ubidots TOKEN
const char* WIFI_SSID = "..."; // Put here your Wi-Fi SSID
const char* WIFI_PASS = "..."; // Put here your Wi-Fi password

Ubidots ubidots(UBIDOTS_TOKEN, UBI_HTTP);

/****************************************
 * Auxiliar Functions
 ****************************************/

// Put here your auxiliar functions

/****************************************
 * Chief Functions
 ****************************************/

void setup() {
  Serial.begin(115200);
  ubidots.wifiConnect(WIFI_SSID, WIFI_PASS);

  // ubidots.setDebug(truthful);  // Uncomment this line for printing debug messages
}

void loop() {
  float value1 = random(0, ix) * 10;
  float value2 = random(0, nine) * 100;
  bladder value3 = random(0, ix) * 1000;
  ubidots.add together("Variable_Name_One", value1);  // Alter for your variable name
  ubidots.add("Variable_Name_Two", value2);
  ubidots.add("Variable_Name_Three", value3);

  bool bufferSent = fake;
  bufferSent = ubidots.send();  // Will ship data to a device label that matches the device Id

  if (bufferSent) {
    // Do something if values were sent properly
    Serial.println("Values sent by the device");
  }

  delay(5000);
}

2. Verify your lawmaking within the Arduino IDE. To exercise this, in the height left corner of our Arduino IDE you volition encounter the "Cheque Marking" icon printing information technology to verify your code.

three. Upload the code into your Feather HUZZAH ESP8266. To exercise this, choose the "right-arrow"icon beside the check mark icon.

4. To verify the connectivity of the device, open the serial monitor by selecting the "magnifying drinking glass" icon in the top right corner of our Arduino IDE.

v. Confirm your data in Ubidots. Now y'all should run across the published information in your Ubidots account.

With the post-obit sample code you volition be able to get a value from Ubidots to get-go controlling any asset you want.

1. To begin getting values from Ubidots, open the Arduino IDE and paste the sample code beneath. Once you have pasted the lawmaking, be sure to assign the post-obit parameters:

  • SSID (WiFi Proper noun) & Countersign of the bachelor network connection.

  • Ubidots TOKEN

  • Device Label of the device which contains the variable to want to Become.

  • Variable Label of the variable you desire to Become

Notation: The device and variable characterization should exist defined in the following line of code:

          ubidots.get("a020a6133e21", "variable_name_one")        

Where the first statement defines the device's label, and the second argument the variable'due south characterization.

          get(const char* device_label, const char* variable_label)        
  • Sample code:

          /****************************************
 * Include Libraries
 ****************************************/

#include "Ubidots.h"

/****************************************
 * Ascertain Constants
 ****************************************/

const char* UBIDOTS_TOKEN = "...";  // Put here your Ubidots TOKEN
const char* WIFI_SSID = "..."; // Put hither your Wi-Fi SSID
const char* WIFI_PASS = "..."; // Put here your Wi-Fi password

Ubidots ubidots(UBIDOTS_TOKEN, UBI_HTTP);

/****************************************
 * Auxiliar Functions
 ****************************************/

// Put hither your auxiliar functions

/****************************************
 * Chief Functions
 ****************************************/

void setup() {
  Serial.begin(115200);
  ubidots.wifiConnect(WIFI_SSID, WIFI_PASS);
  // ubidots.setDebug(true); //Uncomment this line for printing debug messages
}

void loop() {
  /* Obtain last value from a variable as bladder using HTTP */
  bladder value = ubidots.get("a020a6133e21", "variable_name_one");

  // Evaluates the results obtained
  if (value != ERROR_VALUE) {
    Series.print("Value:");
    Serial.println(value);
  }
  filibuster(5000);
}

2. Verify & Upload the lawmaking into the board post-obit the same steps provided in the POST step higher up.

three. To verify the connectivity of the device and the data which is existence received, open the series monitor by selecting the "magnifying glass" icon in the top right corner of the Arduino IDE to see the connectivity logs.

Note: If no response is seen, endeavor unplugging the NodeMCU and and then plugging it over again. Make sure the baud rate of the Serial monitor is set to the same ane specified in your lawmaking 115200.

4. In the serial monitor, you lot volition be able to meet the final value received in Ubidots of the variable specified in the firmware.

With this simple tutorial we are able to Mail and GET data to/from Ubidots with the ease of the Arduino IDE and a Feather HUZZAH with an ESP8266. If your wish to find more examples to handle context or timestamp values in your asking checkout Ubidots documentation with the ESP8266 past clicking here.

Now its time to create Ubidots Dashboards to visualize your information and deploy your net continued monitoring solution!

Other readers take establish useful...

  • Connect the Adafruit FONA to Ubidots

  • Connect the Adafruit Ethernet FeatherWing to Ubidots

  • Connect the Arduino UNO with Ubidots using the Adafruit CC3000

owenswhissilther68.blogspot.com

Source: http://help.ubidots.com/en/articles/1440348-connect-an-adafruit-feather-huzzah-esp8266-to-ubidots-over-http

0 Response to "How to Upload Data to Adafruit Huzza"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel