Guru Meditation Error: Core 1 panic'ed (IntegerDivideByZero)
What it looks like
Guru Meditation Error: Core 1 panic'ed (IntegerDivideByZero). Exception was unhandled.
What it means
An integer was divided by zero, which the Xtensa chips (classic ESP32 and S3) trap. RISC-V chips such as the C3 do not trap integer division by zero; the result is simply wrong instead.
Likely causes
- Averaging over a count that can be zero, such as samples taken before the first reading.
- Dividing by a sensor value that can read 0, or by millis() differences that can be 0.
- Using % with a zero divisor.
How to fix it
- Guard every division whose divisor comes from a reading, a count or a size: if (n == 0) skip or return.
- Decode the backtrace to find the division.
Paste your full log
The lines around the error usually say more. Paste everything from the reset to the backtrace and the crash translator explains each part. It runs in your browser; nothing is sent anywhere.