I need some help with the follow tutorial:
https://learn.adafruit.com/adafruit-io- ... y?view=all
I am using a Adafruit Feather Huzzah with the Arduino IDE.
I am confident that my Huzzah is configured properly as a serial test showed that I can run a webserver.
I also managed to print temp. data from the DHT11 sensor to my serial port.
The Adafruit Arduino Library is installed. Same applies for the Adafruit Unified Sensor Library and the DHT sensor Library.
I opened the adafruit_15_temp_humidity examples and configured the config.h file to use my SSID.
I get a compiler error based on the following code:
Code: Select all
#include <AdafruitIO.h>
#include <AdafruitIO_Dashboard.h>
#include <AdafruitIO_Data.h>
#include <AdafruitIO_Definitions.h>
#include <AdafruitIO_Ethernet.h>
#include <AdafruitIO_Feed.h>
#include <AdafruitIO_FONA.h>
#include <AdafruitIO_Group.h>
#include <AdafruitIO_MQTT.h>
#include <AdafruitIO_Time.h>
#include <AdafruitIO_WiFi.h>
// Adafruit IO Temperature & Humidity Example
// Tutorial Link: https://learn.adafruit.com/adafruit-io-basics-temperature-and-humidity
//
// Adafruit invests time and resources providing this open source code.
// Please support Adafruit and open source hardware by purchasing
// products from Adafruit!
//
// Written by Todd Treece for Adafruit Industries
// Copyright (c) 2016-2017 Adafruit Industries
// Licensed under the MIT license.
//
// All text above must be included in any redistribution.
/************************** Configuration ***********************************/
// edit the config.h tab and enter your Adafruit IO credentials
// and any additional configuration needed for WiFi, cellular,
// or ethernet clients.
#include "config.h"
/************************ Example Starts Here *******************************/
#include <Adafruit_Sensor.h>
#include <DHT.h>
#include <DHT_U.h>
// pin connected to DH22 data line
#define DATA_PIN 13
// create DHT22 instance
DHT_Unified dht(DATA_PIN, DHT22);
// set up the 'temperature' and 'humidity' feeds
AdafruitIO_Feed *temperature = io.feed("temperature");
AdafruitIO_Feed *humidity = io.feed("humidity");
void setup() {
// start the serial connection
Serial.begin(115200);
// wait for serial monitor to open
while(! Serial);
// initialize dht22
dht.begin();
// connect to io.adafruit.com
Serial.print("Connecting to Adafruit IO");
io.connect();
// wait for a connection
while(io.status() < AIO_CONNECTED) {
Serial.print(".");
delay(500);
}
// we are connected
Serial.println();
Serial.println(io.statusText());
}
void loop() {
// io.run(); is required for all sketches.
// it should always be present at the top of your loop
// function. it keeps the client connected to
// io.adafruit.com, and processes any incoming data.
io.run();
sensors_event_t event;
dht.temperature().getEvent(&event);
float celsius = event.temperature;
float fahrenheit = (celsius * 1.8) + 32;
Serial.print("celsius: ");
Serial.print(celsius);
Serial.println("C");
Serial.print("fahrenheit: ");
Serial.print(fahrenheit);
Serial.println("F");
// save fahrenheit (or celsius) to Adafruit IO
temperature->save(celsius);
dht.humidity().getEvent(&event);
Serial.print("humidity: ");
Serial.print(event.relative_humidity);
Serial.println("%");
// save humidity to Adafruit IO
humidity->save(event.relative_humidity);
// wait 5 seconds (5000 milliseconds == 5 seconds)
delay(5000);
}
It shows that the program cannot find:Arduino: 1.8.5 (Windows 10), Board: "Adafruit Feather HUZZAH ESP8266, 80 MHz, 4M (3M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
In file included from C:\Users\edwin\AppData\Local\Temp\arduino_modified_sketch_341377\adafruitio_15_temp_humidity.ino:1:0:
C:\Users\edwin\Dropbox\Projects\Arduino project\Tutorial\libraries\Adafruit_IO_Arduino\src/AdafruitIO.h:16:27: fatal error: Adafruit_MQTT.h: No such file or directory
#include "Adafruit_MQTT.h"
^
compilation terminated.
exit status 1
Error compiling for board Adafruit Feather HUZZAH ESP8266.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
#include "Adafruit_MQTT.h"
I am including the complete Adafruit IO with refers to
. I noticed that the name is different. Think this is the program. How can I fixed this?#include <AdafruitIO_MQTT.h>
I search for the MQTT in the code to replace the name but I could not find it.
Thanks guys