ESP8266 NodeMCU v3

Hi,

I have used ESP8266 v2 to monitor temperature and humidity.

Now i want to use ESP8266 v3 for the same project but it's not working.

ESP8266 is failing to read data from sensor.

What's the problem ?

Hi,

I have used ESP8266 v2 to monitor temperature and humidity.

Now i want to use ESP8266 v3 for the same project but it's not working.

ESP8266 is failing to read data from sensor.

What's the problem ?

Cross post of https://forum.arduino.cc/index.php?topic=702312.msg4719538#msg4719538

The problem is your circuit or your code or both. I hope this answer is detailed enough for you. If not, maybe read your own question again and think abut how much detail is there. Then maybe read the forum guide.

@fatmirprekupi, do not cross-post. Do not post technical questions in the tutorial section.

FIRST - WELCOME !!! GLAD TO HAVE YOU HERE !
please take a minute to read HOW TO USE THIS FORUM, it is a sticky post at the top of every forum.
item #7 is important about how to post code using CODE TAGS

I think that specific sensor has a note in the data sheet about that.
Since you did not mention what sensor, that is about all we can offer.

If you want to tell us what specific sensor you are using
and what specific pins it is connected to
and and post the specific result of what happens
and post your code.

Maybe then we can be a little more specific with answers

since most of us have used multiple temperature and humidity sensors, we should be able to help you fix the problem.

Hi,

I am using AM2301 (Temperature and Humidity sensor).

This code and this wiring is working with my old ESP8266 v2.

WIRING

SENSOR ----------> ESP8266
Power--------------> Vin
GND---------------->GND
Signal--------------> D6


CODE

#define CAYENNE_DEBUG
#define CAYENNE_PRINT Serial
#include <CayenneMQTTESP8266.h>
#include "DHT.h"
#define DHTPIN 12    // modify to the pin we connected
#define DHTTYPE AM2301   // AM2301

DHT dht(DHTPIN, DHTTYPE);

// WiFi network info.
char ssid[] = "**********";
char wifiPassword[] = "************";

// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username[] = "**********************";
char password[] = "**********************";
char clientID[] = "************************";

unsigned long lastMillis = 0;

void setup() {
Serial.begin(115200);
Cayenne.begin(username, password, clientID, ssid, wifiPassword);
dht.begin();
}

void loop() {
Cayenne.loop();

//Publish data every 10 seconds (10000 milliseconds). Change this value to publish at a different interval.
if (millis() - lastMillis > 10000) {
  lastMillis = millis();
  //Write data to Cayenne here. This example just sends the current uptime in milliseconds.
  Cayenne.virtualWrite(0, lastMillis);

  float humidity = dht.readHumidity();
  float temperature = dht.readTemperature();
  Cayenne.celsiusWrite(1, temperature);
  Cayenne.virtualWrite(2, humidity, "rel_hum", "p");
}
}

//Default function for processing actuator commands from the Cayenne Dashboard.
//You can also use functions for specific channels, e.g CAYENNE_IN(1) for channel 1 commands.
CAYENNE_IN_DEFAULT()
{
CAYENNE_LOG("CAYENNE_IN_DEFAULT(%u) - %s, %s", request.channel, getValue.getId(), getValue.asString());
//Process message here. If there is an error set an error message using getValue.setError(), e.g getValue.setError("Error message");
}

OK, so you are still not reading the forum guidelines. Go back, read them, then edit your post to include code tags and the information requested.

I am using AM2301 (Temperature and Humidity Sensor ).

This is my code.
This code is working in my old ESP8266 v2, but it doesnt read data from sensor with ESP8266 v3.

#define CAYENNE_DEBUG
#define CAYENNE_PRINT Serial
#include <CayenneMQTTESP8266.h>
#include "DHT.h"
#define DHTPIN 12    // modify to the pin we connected
#define DHTTYPE AM2301   // AM2301

DHT dht(DHTPIN, DHTTYPE);

// WiFi network info.
char ssid[] = "**********";
char wifiPassword[] = "************";

// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username[] = "**********************";
char password[] = "**********************";
char clientID[] = "************************";

unsigned long lastMillis = 0;

void setup() {
 Serial.begin(115200);
 Cayenne.begin(username, password, clientID, ssid, wifiPassword);
 dht.begin();
}

void loop() {
 Cayenne.loop();

 //Publish data every 10 seconds (10000 milliseconds). Change this value to publish at a different interval.
 if (millis() - lastMillis > 10000) {
   lastMillis = millis();
   //Write data to Cayenne here. This example just sends the current uptime in milliseconds.
   Cayenne.virtualWrite(0, lastMillis);

   float humidity = dht.readHumidity();
   float temperature = dht.readTemperature();
   Cayenne.celsiusWrite(1, temperature);
   Cayenne.virtualWrite(2, humidity, "rel_hum", "p");
 }
}

//Default function for processing actuator commands from the Cayenne Dashboard.
//You can also use functions for specific channels, e.g CAYENNE_IN(1) for channel 1 commands.
CAYENNE_IN_DEFAULT()
{
 CAYENNE_LOG("CAYENNE_IN_DEFAULT(%u) - %s, %s", request.channel, getValue.getId(), getValue.asString());
 //Process message here. If there is an error set an error message using getValue.setError(), e.g getValue.setError("Error message");
}

Thanks for using code tags in your latest post, but post #6 still has no code tags. You were asked to fix that.

Sir,

are you going to help me ?

fatmirprekupi:
Sir,

Who are you asking there?

Do not PM me again. You know I have read your question on this topic, and your PM added no extra detail. What was the point? To annoy me?

Not sure your library supports V3 but you could ask the developers or trawl through it to see if there are any conflicts with V3

@fatmirprekupi

Other post/duplicate DELETED
Please do NOT cross post / duplicate as it wastes peoples time and efforts to have more than one post for a single topic.

Continued cross posting could result in a time out from the forum.

Could you also take a few moments to Learn How To Use The Forum.
It will help you get the best out of the forum in the future.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.