openeew / openeew-firmware

Firmware for an OpenEEW sensor.
Apache License 2.0
8 stars 8 forks source link

ESP32 panic running v1.5.1 #27

Closed johnwalicki closed 3 years ago

johnwalicki commented 3 years ago

The OpenEEW device was running for many hours, silently calculating the STA/LTA algorithm. I had set the threshold very high because this is a test device. I slightly bumped the desk it was on. I noticed the device started to blink blue after it restarted and connected to the wifi network. Running v1.5.1

Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). ExException in thread rx:

--- exit ---

As I wrote up this github issue, I restarted the board. It ran for a few minutes fine. Then I bumped the USB cable. It started sending data to the cloud. I stopped it by sending it a message to send 1 second of data. Then I set the threshold high again. Similar crash a few seconds later. This log captures the entire sequence:


Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
STA/LTA = 4.002535 = 0.332290 / 0.083020 (2)
Start sending 5 minutes of live accelerometer data
Sending 10 seconds of accelerometer readings in a MQTT packet of size: 6057
Calculating STA/LTA from 352 accelerometer readings
STA/LTA = 4.244476 = 0.360995 / 0.085051 (2)
{"traces":[{"x":[]}],"device_id":"A8032A4DD5F0","device_t":1620178285}
Sending 1 second of accelerometer readings in a MQTT packet of size: 644
Calculating STA/LTA from 352 accelerometer readings
{"traces":[{"x":[]}],"device_id":"A8032A4DD5F0","device_t":1620178286}
Sending 1 second of accelerometer readings in a MQTT packet of size: 647
Calculating STA/LTA from 352 accelerometer readings
{"traces":[{"x":[]}],"device_id":"A8032A4DD5F0","device_t":1620178287}
Sending 1 second of accelerometer readings in a MQTT packet of size: 644
Calculating STA/LTA from 352 accelerometer readings
{"traces":[{"x":[]}],"device_id":"A8032A4DD5F0","device_t":1620178288}
Sending 1 second of accelerometer readings in a MQTT packet of size: 649
Calculating STA/LTA from 352 accelerometer readings
{"traces":[{"x":[]}],"device_id":"A8032A4DD5F0","device_t":1620178289}
Sending 1 second of accelerometer readings in a MQTT packet of size: 648
Calculating STA/LTA from 352 accelerometer readings
{"traces":[{"x":[]}],"device_id":"A8032A4DD5F0","device_t":1620178290}
Sending 1 second of accelerometer readings in a MQTT packet of size: 640
Calculating STA/LTA from 352 accelerometer readings
{"traces":[{"x":[]}],"device_id":"A8032A4DD5F0","device_t":1620178291}
Sending 1 second of accelerometer readings in a MQTT packet of size: 646
Calculating STA/LTA from 352 accelerometer readings
{"traces":[],"device_id":"A8032A4DD5F0","device_t":1620178292}
Sending 1 second of accelerometer readings in a MQTT packet of size: 648
Calculating STA/LTA from 352 accelerometer readings
{"traces":[{"x":[]}],"device_id":"A8032A4DD5F0","device_t":1620178293}
Sending 1 second of accelerometer readings in a MQTT packet of size: 641
Message arrived [iot-2/cmd/sendacceldata/fmt/json] : {"LiveDataDuration":1}
Send live accelometer data to the cloud (secs):1
Calculating STA/LTA from 352 accelerometer readings
{"traces":[{"x":[]}],"device_id":"A8032A4DD5F0","device_t":1620178294}
Sending 1 second of accelerometer readings in a MQTT packet of size: 645
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Message arrived [iot-2/cmd/threshold/fmt/json] : {"ThresholdOverride":30}
Previous STA/LTA Shake Threshold :  4.00
Override STA/LTA Shake Threshold : 30.00
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). ExException in thread rx:
Traceback (most recent call last):
johnwalicki commented 3 years ago

Maybe a separate issue, but if I set the threshold 10 or above, even violent shaking will not set off the STA/LTA algorithm.

johnwalicki commented 3 years ago

I think the loop() and STA/LTA algorthm gets corrupted somehow if the thresh global variable is changed while it is running.

johnwalicki commented 3 years ago

Another ESP panic.

Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Message arrived [iot-2/cmd/threshold/fmt/json] : {"ThresholdOverride":10}
Previous STA/LTA Shake Threshold :  8.00
Override STA/LTA Shake Threshold : 10.00
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). ExException in thread rx:
Traceback (most recent call last):
johnwalicki commented 3 years ago

Set the threshold to 90. A few minutes later:

Calculating STA/LTA from 352 accelerometer readings
Calculating STA/LTA from 352 accelerometer readings
Guru Meditation Error: Core  1 panic'ed (IllegalInstruction). ExException in thread rx:
Traceback (most recent call last):
johnwalicki commented 3 years ago

My OpenEEW board was defective. A new board does not show these brownout / ESP32 panics. Closing ticket.