Hi
Long history short, I am trying to set up an ESP8266 based chip, a D1 mini. It should send the temperature, humidity and light data so - in the future, i could accordingly dim the heater and dimmable lights.
I settled everything in the board, the temp/humidity sensor, the photoresistor, and a led to tell me when it succeeds connecting to wifi.
But I didn't manage to make this working.
So I remove everything from the board, and I commented unnecessary lines (*) from my code, and I got this error message. With unnecessary lines I meant everything related to WiFi, i mean i just want to get the signal/data in the Arduino IDE and once this is correct i will figure out about WiFi connection; step by step.
(I did NOT have this board connect to anything, just to my computer via mini USB. The esp needs 3.3 v and apparently, this board can supply it from the USB cable - afaik - (am I wrong?)
ets Jan 8 2013,rst cause:4, boot mode:(1,6)
wdt reset
http://arduino-esp8266.readthedocs.io/en/latest/boards.html#boot-messages-and-modes
rst cause 4 ---> watchdog
boot mode
3 0V 3.3V 3.3V Flash
6 3.3V 3.3V 0V SDIO
my code: (its mostly copy-pasted from different sources and afterwards modified).
/* How to use the DHT-22 sensor with Arduino uno
Temperature and humidity sensor
More info: Temperature and Humidity - DHT22 and Arduino - Ardumotive Arduino Greek Playground
Dev: Michalis Vasilakis // Date: 1/7/2015 // www.ardumotive.com *///Libraries
#include <DHT.h>
//#include <ESP8266WiFi.h>
//#include <ESP8266WiFiMulti.h>//Constants (the pins where the sensors will be connected)
#define DHTPIN 6 // what pin we're connected to
#define DHTTYPE DHT22 // DHT 22 (AM2302)
#define DHTPOWER 5
#define DHTGROUND 7
#define PRPOWER 8
#define PRREAD 2
#define PRGROUND 1
//#define WIFIOKPIN 4
//#define HOSTIFTTT "maker.ifttt.com"
//#define EVENTO "enviar_tweet"
//#define IFTTTKEY "c59f1gEzJCimUDM8ouBGj"//ESP8266WiFiMulti WiFiMulti;
//Utilizamos la conexión SSL del ESP8266
//WiFiClientSecure client;// Variable que permite ejecutar una sola vez la función
//bool ejecutado = false;//const char* ssid = "NET";
//const char* password = "vas";
//const char* ssid = "HUAWEI";
//const char* password = "FQEE";
//const char* host = MY_HOST;
//const char* hostIP = MY_HOSTIP;
//int status = WL_IDLE_STATUS;
//WiFiServer server(80);//Service Port//DHT function, neccesary to get the one of teh sensors working.
DHT dht(DHTPIN, DHTTYPE); //// Initialize DHT sensor for normal 16mhz Arduino//Variables
int chk;
float hum; //Stores humidity value
float temp; //Stores temperature value
int light; //Stores light intensity valuevoid setup()
{
pinMode(PRPOWER,OUTPUT);
pinMode(PRREAD,INPUT);
pinMode(DHTPOWER,OUTPUT);
pinMode(DHTGROUND,OUTPUT);
digitalWrite(DHTPOWER,HIGH);
digitalWrite(PRPOWER,HIGH);
digitalWrite(DHTGROUND,LOW);
// pinMode(WIFIOKPIN,OUTPUT);
// digitalWrite(WIFIOKPIN,LOW);
Serial.begin(9600);
Serial.print("aaaa");//Test, if the core arrives here, i shoudl see this at arudino ide)
dht.begin();
//WiFi.mode(WIFI_STA);
//WiFi.begin(ssid, password);// Conectamos a la red WiFi
//WiFiMulti.addAP(ssid, password);Serial.println();
Serial.println();
Serial.print("Eperando a conectar a la WiFi... ");/* while (WiFiMulti.run() != WL_CONNECTED)
{
Serial.print(".");
delay(500);
}
*/
Serial.println("");
Serial.println("WiFi conectada");
Serial.println("Direccion IP: ");
// Serial.println(WiFi.localIP());
// digitalWrite(WIFIOKPIN,HIGH);delay(500);
}void loop()
{
//Read data and store it to variables hum and temp
hum = dht.readHumidity();
temp= dht.readTemperature();
light = analogRead(PRREAD);
//Print temp and humidity values to serial monitor
Serial.print("Humidity: ");
Serial.print(hum);
Serial.print(" %, Temp: ");
Serial.print(temp);
Serial.print(" Celsius");
Serial.print(" %, light: ");
Serial.print(light);
Serial.println(" TLIU");
delay(2000); //Delay 10 sec.
}
/*if (!ejecutado)
{
// Obtenemos los valores
float hum = dht.readHumidity();
float temp= dht.readTemperature();
int light = analogRead(PRREAD);Serial.println(hum);
Serial.println(temp);
Serial.println(light);enviar_tweet(hum, temp, light);
ejecutado = true;
}
*//*void enviar_tweet(float hum, float temp, int light)
{
// Cerramos cualquier conexión anterior
if (client.connected())
{
client.stop();
}// Esperamos hasta que se hayan enviado todos los datos
client.flush();// Hacemos la petición mediante SSL
if (client.connect(HOSTIFTTT, 443)) {
// Construimos la petición HTTP
String toSend = "GET /trigger/";
toSend += EVENTO;
toSend += "/with/key/";
toSend += IFTTTKEY;
toSend += "?value1=";
toSend += hum;
toSend += "&value2=";
toSend += temp;
toSend += "&value3=";
toSend += light;
toSend += " HTTP/1.1\r\n";
toSend += "Host: ";
toSend += HOSTIFTTT;
toSend += "\r\n";
toSend += "Connection: close\r\n\r\n";client.print(toSend);
}// Esperamos hasta que se hayan enviado todos los datos
client.flush();
// Desconectamos del cliente
client.stop();
}
*/