Sensirion / arduino-ble-gadget

Create your own Do-It-Yourself BLE enabled sensor gadget on the ESP32 platform.
BSD 3-Clause "New" or "Revised" License
58 stars 20 forks source link

Sporadic reboots #37

Open NetForces opened 1 month ago

NetForces commented 1 month ago

I have been having sporadic reboots when using this. It might have to do with the fact that my device sleeps, but I am not sure.

When a reboot occurs, I get the following in the console:

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 271414342, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1184
load:0x40078000,len:13232
load:0x40080400,len:3028
entry 0x400805e4

I will attempt to provide the minimal code to reproduce this situation in the next couple of days but if anyone had this issue and know a fix it would be appreciated.

LeonieFierz commented 1 month ago

Hi @NetForces

we are not aware of any issues with reboots when using the arduino-ble-gadget library. Depending on your setup and the sensor used, it might be that the power supply is not sufficient. Which sensor do you have connected?

Best, Léonie

NetForces commented 1 month ago

It's the SCD-41.

I will revalidate, but if I remove the part of my code that does the light sleep, the sporadic reboots go away. Unfortunately, light sleep is required in my application as it runs off a small battery.

LeonieFierz commented 1 month ago

As you write that you are running from a small battery, please note that the SCD41 draws up to 200mA during measurement.

Let us know how it goes and we are happy to help if you have further questions regarding the sensor.

NetForces commented 1 month ago

I doubt that it’s the power draw because without adding the arduino-ble-gadget library it is 100% stable. I know bluetooth will draw a little more current, but not that much. The battery powering my design is a 200mAh, and I'm running the SCD-41 in low power mode.

LeonieFierz commented 1 month ago

The SCD41 peak power during measurement is 200mA, the low power mode just does the measurement less often and puts the sensor to sleep in between the measurements.

We have not worked with the light sleep mode on Arduino so I do not have any experience with it, but if you wake the board up and do the measurement I could imagine that the battery voltage could drop due to the power draw from startup and measurement. To see what is happening it would make sense to measure the voltage.