Battery Powered ESP8266 Temperature/Humidity Monitor with DHT11


#58

Or is there anybody with nodeMCU an HTU who can copy my setup?


#59

Maybe, if you post your full sketch :wink:

Craig


#60

You will find it up there 38/58 :wink:

//#define CAYENNE_DEBUG
#define CAYENNE_PRINT Serial
// #define DHTTYPE DHT11
// #define DHTPIN  14

#include "CayenneDefines.h"
#include "BlynkSimpleEsp8266.h"
#include "CayenneWiFiClient.h"
// #include <DHT.h>
#include <SparkFunHTU21D.h>

// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token[] = "";
// Your network name and password.
char ssid[] = "";
char password[] = "";
//Variables for DHT11 values
//float h, t, hif;
float h, t;
bool Humidity = false;
bool Temperature = false;
//bool HeatIndex = false;

//DHT dht(DHTPIN, DHTTYPE);
HTU21D myHumidity;

void setup()
{
  Serial.begin(9600);
  Serial.print("Setup");
  Cayenne.begin(token, ssid, password);

  Humidity = false;
  Temperature = false;
  //HeatIndex = false;
}

void loop()
{
  //Run Cayenne Functions
  Cayenne.run();
  delay(100);
  //Check if we got all values we wanted and sleep for 10 minutes if we did
  // if (Humidity && Temperature && HeatIndex){
    if (Humidity && Temperature){
    Serial.println("Got all values - sleeping");
    delay(100);
    ESP.deepSleep(60000000, WAKE_RF_DEFAULT);
    delay(100);
  }
}

CAYENNE_OUT(V0){
  Serial.println("Entered Humidity");

  //Check if read failed and try until success
  do {
    //Read humidity (percent)
    // h = dht.readHumidity();
    h = myHumidity.readHumidity();

    delay(1000);
  } while  (isnan(h));

  Serial.print("Humidity: ");
  Serial.println(h);

  //Set Humidity to true so we know when to sleep
  Humidity = true;

  //Write to Cayenne Dashboard
  Cayenne.virtualWrite(V0, h);
}

CAYENNE_OUT(V1){
  Serial.println("Entered Temperature");
  
  //Check if read failed and try until success
  do {
    //Read temperature as Fahrenheit
    // t = dht.readTemperature(true);
    t = myHumidity.readTemperature();

    delay(1000);
  } while  (isnan(t));

  Serial.print("Temperature: ");
  Serial.println(t);

  //Set Temperature to true so we know when to sleep
  Temperature = true;

  //Write to Cayenne Dashboard
  Cayenne.virtualWrite(V1, t);
}

/*CAYENNE_OUT(V2){
  Serial.println("Entered Heat Index");

  //Check if read failed and try until success
  do {
    //Read humidity (percent)
    h = dht.readHumidity();
    //Read temperature as Fahrenheit
    t = dht.readTemperature(true);
    //Calculate Heat Index as Fahrenheit
    hif = dht.computeHeatIndex(t, h);
  } while  (isnan(t) || isnan(h));

  Serial.print("Heat Index: ");
  Serial.println(hif);

  //Set HeatIndex to true so we know when to sleep
  HeatIndex = true;

  //Write to Cayenne Dashboard
  Cayenne.virtualWrite(V2, hif);
} */

#61

Take a seat @kreggly!

Anyway…let’s try doing some serial prints to see where you’re getting caught up. Try this and post the output.

void setup()
{
  Serial.begin(9600);
  Serial.print("Setup");
  Cayenne.begin(token, ssid, password);
  Serial.print("Cayenne setup");

  Humidity = false;
  Temperature = false;
  //HeatIndex = false;
}

void loop()
{
  //Run Cayenne Functions
  Serial.print("Begin loop");
  Cayenne.run();
  Serial.print("End Cayenne.run");
  delay(100);
  //Check if we got all values we wanted and sleep for 10 minutes if we did
  // if (Humidity && Temperature && HeatIndex){
    if (Humidity && Temperature){
    Serial.println("Got all values - sleeping");
    delay(100);
    ESP.deepSleep(60000000, WAKE_RF_DEFAULT);
    delay(100);
  }
  Serial.print("End loop");
}

#62

Uhha, blasts my serial monior:

0‚~?–4“Ò¶£ÿOCAZþûSetup[253] Connecting to networxSAVE2
[3256] Connected to WiFi
[3256] My IP: 192.168.200.68
Cayenne setupBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loop[5058] Connecting to arduino.mydevices.com:8442
End Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loop[5554] Ready (ping: 201ms).
End Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.runEnd loopBegin loopEnd Cayenne.run

#63

So did you get the wdt error that time? also, lets clean that up a bit with some serial.println lol

void setup()
{
  Serial.begin(9600);
  Serial.println("Setup");
  Cayenne.begin(token, ssid, password);
  Serial.println("Cayenne setup");

  Humidity = false;
  Temperature = false;
  //HeatIndex = false;
}

void loop()
{
  //Run Cayenne Functions
  Serial.println("Begin loop");
  Cayenne.run();
  Serial.println("End Cayenne.run");
  delay(100);
  //Check if we got all values we wanted and sleep for 10 minutes if we did
  // if (Humidity && Temperature && HeatIndex){
    if (Humidity && Temperature){
    Serial.println("Got all values - sleeping");
    delay(100);
    ESP.deepSleep(60000000, WAKE_RF_DEFAULT);
    delay(100);
  }
  Serial.println("End loop");
}

#64

hmmm for me no hints …

0‚~?–4“Ò¶£ÿOCAZþûSetup
[251] Connecting to networxSAVE2
[4253] Connected to WiFi
[4253] My IP: 192.168.200.68
Cayenne setup
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
[5054] Connecting to arduino.mydevices.com:8442
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
[10360] Connecting to arduino.mydevices.com:8442
End Cayenne.run
End loop
Begin loop
[10697] Connecting to arduino.mydevices.com:8442
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
[11142] Ready (ping: 200ms).
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run
End loop
Begin loop
End Cayenne.run

#65

looking back at your first posts it’s probably something to do in the temp read function since you have:

[2264] Connected to WiFi
[2264] My IP: 192.168.200.37
[5065] Connecting to arduino.mydevices.com:8442
[5438] Ready (ping: 100ms).
Entered Temperature

Exception (28):

Try wiping out the code in your temperature read function and your humidity read function and put in the code you have in your other script that works, then just send that variable with Cayenne.virtualWrite(V0, variablenamehere);


#66

My guess is it’s something with your HTU21D driver that isn’t compatible with ESP.

Ok. Ok. I’ll sit back down.

Craig


#67

So no values are send when i integrate virtualWrite to the sample script …

What about CAYENNE_OUT(V0) or/and #define VIRTUAL_PIN V0 ?

@kreggly Why it should not compatible? As i mentioned HTU sample sketch works and i used ESP+HTU in other projects.


#68

Alrighty then :slight_smile:

I think what @adam is saying is, try something like this:

It might be that you are getting stuck too long waiting for a non NAN return. I don’t have a Sparkfun device, so can’t test myself.

Craig


#69

@kreggly’s test will work fine to eliminate errors in the CAYENNE_OUT(V1) function.

I was actually saying wipe out what you currently have in the CAYENNE_OUT(V1) function and put in the code you have that you know works and then send that value with Cayenne.virtualWrite(V1, variable);.


#70

Best practice is to eliminate bits until your program is running reliably, then add back.

If the above works, un-comment the function read and try that.

Next, add back nan check loop, and try that.

Ad nauseum.

It is tedious, but it is one of those skills that gets better with practice :wink:

Craig


#71

Only works when set both hum and temp by hand. :rage:


#72

We’re getting a bit off topic haha. Why don’t you start a new thread in the help with projects category and we’ll respond there. One way or another we’ll get you squared away…


#73

Maybe we can follow up here: http://community.mydevices.com/t/esp8266-temperature-humidity-monitor-with-htu21d/1596/3

Inserting my working function into CAYENNE_OUT(V1) will also not work, i still get an reboot. Sorry but i have absolutely no idea what causes the problem.
I think it is cayenne problem as HTU21d i not such an exotic sensor…


#74

Next upgrade to this project is solar charging:


#75

Update:

After not getting any values on my dashboard since February I thought it was about time to update my sketch and give everyone an update to the MQTT version of this project. You can find the new sketch and modified library file in the first post.

Also, the solar panel went to another project so no update there :frowning:


#76

Could you summarize your conclusions on battery powered sensor - maybe in a new topic.

I’ve tried esp-01 with separate AMS1117, but soldering that reset pin for deepsleep was beyond my skills, so that stuff is only for usb for AC power.

I’ve tried the esp-12e with builtin power regulator (and convenient usb) with 2-3 NiMH or Alkaline AA using the deepsleep mode, and also some cheap 5v usb recharge batteries, but have been having trouble with the usb recharge battery shutting off because it thought the phone was recharged.

Not sure on the ideal combination.


#77

If you want the best battery life you need a setup like I have posted above, a bare ESP module and super low drop out voltage regulator. The NodeMCU modules will drain your batteries more in deep sleep and will cut out when the battery reaches about 4 volts vs mine that cuts out around 3v.