HELP IOT and ESP32 Crashing

Im trying to create a weather station for my house on the IOT however my ESP32 Keeps Crashing. Below is the errors then the code

Rebooting...
!�!��LBa1�!�!�L�C�B@c�***** Arduino IoT Cloud - configuration info *****
Device ID: ddcf5ad1-bb1f-4c8b-9422-41c417e0c0c0
MQTT Broker: mqtts-up.iot.arduino.cc:8884
WiFi.status(): 255
Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.

Core 1 register dump:
PC : 0x400dbe8f PS : 0x00060d30 A0 : 0x800dbd4c A1 : 0x3ffb21e0
A2 : 0x00000000 A3 : 0x3ffb2208 A4 : 0x00000001 A5 : 0x00000001
A6 : 0x3ffb220c A7 : 0x00000001 A8 : 0xfa000000 A9 : 0x00000000
A10 : 0x090d0000 A11 : 0xb8000000 A12 : 0x80084073 A13 : 0x3ffb1fa0
A14 : 0x00000001 A15 : 0x3ffb0320 SAR : 0x0000001d EXCCAUSE: 0x0000001c
EXCVADDR: 0x0000000c LBEG : 0x4008482d LEND : 0x40084835 LCOUNT : 0x00000027

Backtrace: 0x400dbe8c:0x3ffb21e0 0x400dbd49:0x3ffb2200 0x400dbd5c:0x3ffb2230 0x400dbdcd:0x3ffb2250 0x400d312f:0x3ffb2270 0x400dfca1:0x3ffb2290

ELF file SHA256: 09a4d487d0984200

Rebooting...

#include "arduino_secrets.h"



/* 
  Sketch generated by the Arduino IoT Cloud Thing "Untitled"
  https://create.arduino.cc/cloud/things/79949245-2cc6-482a-8dcc-beb4c69b6f5d 

  Arduino IoT Cloud Variables description

  The following variables are automatically generated and updated when changes are made to the Thing

  float humidity;
  float pressure;
  float temperature;

  Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
  which are called when their values are changed from the Dashboard.
  These functions are generated with the Thing and added at the end of this sketch.
*/

#include "thingProperties.h"
// Adafruit BMP085 Library - Version: Latest 
#include <Adafruit_BMP085.h>

// DHT sensor library - Version: Latest 
#include <DHT.h>
#include <Wire.h>

Adafruit_BMP085 bmp;

#define DHTPIN 17
#define DHTTYPE DHT22

DHT dht(DHTPIN, DHTTYPE);

void setup() {
  // Initialize serial and wait for port to open:
  Serial.begin(9600);
  // This delay gives the chance to wait for a Serial Monitor without blocking if none is found
  delay(1500); 
   dht.begin();

  // Defined in thingProperties.h
  initProperties();

  // Connect to Arduino IoT Cloud
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  
  /*
     The following function allows you to obtain more information
     related to the state of network and IoT Cloud connection and errors
     the higher number the more granular information you’ll get.
     The default is 0 (only errors).
     Maximum is 4
 */
  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();
}

void loop() {
  ArduinoCloud.update();
  humidity = dht.readHumidity();
  temperature = dht.readTemperature(true);
  pressure = (bmp.readPressure() / 100.0F * 0.029530 + 6.11);
  ArduinoCloud.update();
  
  delay(500);
  Serial.print("humidity=");
  Serial.print(humidity);
  Serial.print("temperature=");
  Serial.print(temperature);
  Serial.print("pressure=");
  Serial.print(pressure);
  // Your code here 
  

}

I found what is causing the crash however I do not know why its crashing.
The issue is pressure = bmp.readPressure(); line of code. Any help would be greatly appreciated

#include "arduino_secrets.h"



/* 
  Sketch generated by the Arduino IoT Cloud Thing "Untitled"
  https://create.arduino.cc/cloud/things/79949245-2cc6-482a-8dcc-beb4c69b6f5d 

  Arduino IoT Cloud Variables description

  The following variables are automatically generated and updated when changes are made to the Thing

  float humidity;
  float pressure;
  float temperature;

  Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
  which are called when their values are changed from the Dashboard.
  These functions are generated with the Thing and added at the end of this sketch.
*/

#include "thingProperties.h"
#include "DHT.h"
#include "Wire.h"
#include "Adafruit_BMP085.h"

Adafruit_BMP085 bmp;

#define DHTPIN 17
#define DHTTYPE DHT22

DHT dht(DHTPIN, DHTTYPE);



void setup() {
  // Initialize serial and wait for port to open:
  Serial.begin(9600);
  // This delay gives the chance to wait for a Serial Monitor without blocking if none is found
  delay(1500); 


  // Defined in thingProperties.h
  initProperties();

  // Connect to Arduino IoT Cloud
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  
  /*
     The following function allows you to obtain more information
     related to the state of network and IoT Cloud connection and errors
     the higher number the more granular information you’ll get.
     The default is 0 (only errors).
     Maximum is 4
 */
  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();

  dht.begin();
}

void loop() {
  ArduinoCloud.update();
  humidity = dht.readHumidity();
  temperature = dht.readTemperature(true);
  pressure = bmp.readPressure();
  
  delay(500);

  // Your code here 
  

}

need something like this in your setup..

  if (!bmp.begin()) {
	Serial.println("Could not find a valid BMP085 sensor, check wiring!");
	while (1) {}
  }

good luck.. ~q

That was the issue. Thank you for the help

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.