Just signed up for this board in the hope that someone can help me out.
I have been experimenting the last three days using many sources (also this one) as a guidance to get my ESP8266-01 working nicely.
What I have:
- Arduino UNO
- ESP-01 (firmware 1.5.4)
- DHT22 temp/humidity sensor.
What I’m trying to achieve:
Periodically capture the data coming from my sensor, and send it via Wifi to my MQTT server. I’m using this URL :
Temperature upload over MQTT using Arduino UNO, ESP8266 and DHT22 sensor | ThingsBoard Community Edition to get it working.
What goes wrong:
I honestly do not know…
Whenever I load the BareMinimum sketch, and I use the AT commands on 115200 baud, I can connect with my Wifi router without any problems. Even when the external power is not connected to the Arduino !
For this piece of code I use AT+CIOBAUD=9600 to force the ESP-01 to talk on 9600 baud.
The relevant code in the project is :
Serial.begin(9600); dht.begin(); InitWiFi();
in setup(), and:
soft.begin(9600); WiFi.init(&soft); Serial.println(WIFI_AP); status = WiFi.begin(WIFI_AP, WIFI_PASSWORD);
Of course, WIFI_AP and WIFI_PASSWORD are defined elsewhere in the code…
The header files used are:
#include "DHT.h" #include <WiFiEspClient.h> #include <WiFiEsp.h> #include <WiFiEspUdp.h> #include <PubSubClient.h> #include "SoftwareSerial.h"
Whatever I try, no connection is ever made to my AP:
[WiFiEsp] Initializing ESP module [WiFiEsp] >>> TIMEOUT >>> [WiFiEsp] >>> TIMEOUT >>> [WiFiEsp] >>> TIMEOUT >>> [WiFiEsp] >>> TIMEOUT >>> [WiFiEsp] >>> TIMEOUT >>> [WiFiEsp] Cannot initialize ESP module [WiFiEsp] >>> TIMEOUT >>> [WiFiEsp] No tag found WiFi shield not present
Can someone please explain why manually issuing AT commands works, but using WiFi libraries in a sketch does not ?
Would be most grateful…