You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After running for about 2 and a half days, updating every 30 minutes, it suddenly will not publish anymore. I am able to connect, and I do not get a failed publish, however, the shadow is never updated.
Looking at AWS CLoudwatch Logs set to debug, there are no logs indicating that a publish was even attempted.
Let me know if there is any specific information that is needed and I'll try and get it as soon as possible.
Here is the output of the ESP32:
starting aws iot application
Attempting to connect to Wifi network: Attempting to connect to Wifi network: Connected to Wifi!
IP address: 192.168.86.44
Connected to AWS, bru
Sending data...
{"state":{"reported":{"co2":" 1647 ", "temperature":" 25.340000 ", "humidity":" 37.827148 ", "pressure":" 101369.523438 ","battery":" 3960 ", "name":" co2-sensor ", "timestamp":" 1610827693 ", "ttl": 1611259693 }}}
Going to sleep now
Here is the relevant code for publishing:
// put your main code here, to run repeatedly:
Serial.println("Sending data...");
// Turning on the LED
digitalWrite(18, HIGH);
// Getting values
float temperature = bme.readTemperature();
float humidity = bme.readHumidity();
float pressure = bme.readPressure();
int co2 = getco2();
uint16_t battery = adp.batteryVoltage();
// We want to make sure we're getting a CO2 Value
if (co2 == 0) {
adp.enableLDO(2,0);
delay(3000);
return;
}
// Making sure we got values from the BME sensor as well
// We won't update the IoT shadow without these values
if (isnan(humidity) || isnan(temperature)) {
Serial.println("Failed to read from BME sensor!");
char rule_payload[512];
time_t now = time(nullptr);
time_t delete_time = now + (5 * 24 * 60 * 60);
sprintf(rule_payload, "{\"state\":{\"reported\":{\"co2\":\" %d \",\"battery\":\" %d \", \"name\":\" co2-sensor \", \"timestamp\":\" %d \", \"ttl\": %d }}}",co2,temperature,humidity,pressure,battery,now,delete_time);
Serial.println(rule_payload);
while (hornbill.publish(TOPIC_NAME,rule_payload) != 0) {
counter++;
if (counter >= 10) {
Serial.println("Message was not published");
counter = 0;
break;
}
delay(1000);
}
counter = 0;
} else {
// Generating the JSON Payload
char rule_payload[512];
time_t now = time(nullptr);
time_t delete_time = now + (5 * 24 * 60 * 60);
sprintf(rule_payload, "{\"state\":{\"reported\":{\"co2\":\" %d \", \"temperature\":\" %f \", \"humidity\":\" %f \", \"pressure\":\" %f \",\"battery\":\" %d \", \"name\":\" co2-sensor \", \"timestamp\":\" %d \", \"ttl\": %d }}}",co2,temperature,humidity,pressure,battery,now,delete_time);
Serial.println(rule_payload);
while (hornbill.publish(TOPIC_NAME,rule_payload) != 0) {
counter++;
if (counter >= 10) {
Serial.println("Message was not published");
counter = 0;
break;
}
delay(1000);
}
counter = 0;
}
Not sure how else to title it.
After running for about 2 and a half days, updating every 30 minutes, it suddenly will not publish anymore. I am able to connect, and I do not get a failed publish, however, the shadow is never updated.
Looking at AWS CLoudwatch Logs set to debug, there are no logs indicating that a publish was even attempted.
Let me know if there is any specific information that is needed and I'll try and get it as soon as possible.
Here is the output of the ESP32:
Here is the relevant code for publishing:
AWS Logs showing it connected:
AWS Logs showing it disconnected:
The message I would expect to see, according to AWS Documentation, would be something like this:
Any help or information is much appreciated...
Thanks,
RM
The text was updated successfully, but these errors were encountered: