educ8s / Arduino-Color-E-Paper-Weather-Station

ESP32 Arduino Color E Paper Weather Station project
41 stars 6 forks source link

Sketch fails with no sensors attached. #4

Closed b-morgan closed 7 months ago

b-morgan commented 8 months ago

While waiting for my sensor(s) to arrive, I made the edits required to use openweathermap API and my WiFi and attempted to test with just those changes. Instead of the expected results I got an error as shown below. I believe it would be useful to add code that will detect if the sensors exist and do something that doesn't result in an "IntegerDivideByZero".

Rebooting...

ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)

configsip: 0, SPIWP:0xee

clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00

mode:DIO, clock div:1

load:0x3fff0030,len:1344

load:0x40078000,len:13864

load:0x40080400,len:3608

entry 0x400805f0

Bootup count: 0

Guru Meditation Error: Core  1 panic'ed (IntegerDivideByZero). Exception was unhandled.

Core  1 register dump:

PC      : 0x400d634e  PS      : 0x00060e30  A0      : 0x800d6110  A1      : 0x3ffb27a0

A2      : 0x3ffcc040  A3      : 0x00000000  A4      : 0x0000000a  A5      : 0x00000000

A6      : 0x3ffba4ec  A7      : 0x00000000  A8      : 0x00000000  A9      : 0x00000000

A10     : 0x0007ffff  A11     : 0x00fffff4  A12     : 0x38000000  A13     : 0x00000000

A14     : 0x00000381  A15     : 0x40240000  SAR     : 0x00000005  EXCCAUSE: 0x00000006

EXCVADDR: 0x00000000  LBEG    : 0x4008b30c  LEND    : 0x4008b322  LCOUNT  : 0xffffffff

Backtrace:0x400d634b:0x3ffb27a00x400d610d:0x3ffb27c0 0x400d5f3d:0x3ffb27e0 0x400e0b5a:0x3ffb2820

ELF file SHA256: 0000000000000000
b-morgan commented 7 months ago

Attached is a zip file containing updated sensors.h and sensors.cpp. I have added #define and #ifdef statements to allow three configurations of sensors, "BMP085 and DHT22" (the original code), "BME280", and none.

I have tested the none case and the BME280 case but have only verified that the original sensors case compiles as I don't have those sensors to test with.

epaper_weather_station.zip