WildernessLabs / Meadow_Issues

Public repo for bugs and issues with Meadow
15 stars 0 forks source link

Cultivar silently stop sending cloud data without crashing the app #606

Closed duduita closed 1 week ago

duduita commented 4 months ago

Describe the bug It pushed logs to the cloud for ~1200 events, after that the app still is responding to button interrupts, and is still collecting sensor data, but the output looks like this:

stdout> Temperature: 30.6 | Humidity: 27.9 | Moisture: 2.3
stdout> making cloud request to /api/events with payload: {"measurements":{"TemperatureCelsius":30.630859375,"HumidityPercent":27.9277185503018,"SoilMoistureDouble":2.32912550513668},"description":"Atmospheric reading","eventId":110,"timestamp":"2024-04-17T21:59:30.054Z"}
stdout> cloud request to /api/events completed successfully
stdout> Temperature: 30.5 | Humidity: 28.9 | Moisture: 2.3
stdout> making cloud request to /api/events with payload: {"measurements":{"TemperatureCelsius":30.515625,"HumidityPercent":28.9144800926825,"SoilMoistureDouble":2.3297915058473},"description":"Atmospheric reading","eventId":110,"timestamp":"2024-04-17T22:01:30.292Z"}
stdout> Temperature: 30.7 | Humidity: 27.5 | Moisture: 2.3
stdout> Temperature: 30.7 | Humidity: 28.7 | Moisture: 2.3
stdout> Temperature: 30.7 | Humidity: 27.7 | Moisture: 2.3
stdout> Temperature: 30.8 | Humidity: 27.0 | Moisture: 2.3
stdout> Temperature: 30.8 | Humidity: 27.0 | Moisture: 2.3
stdout> Temperature: 30.9 | Humidity: 27.3 | Moisture: 2.3
stdout> Temperature: 30.9 | Humidity: 27.4 | Moisture: 2.3
stdout> Temperature: 30.9 | Humidity: 26.2 | Moisture: 2.3

So it's stopped sending cloud data. I see it did a making cloud request and then never reported error or success, and just quit reporting anything at all.

Additionally, after enabling mbedTLS native logs, I could see that it stopped during the flush output:

Meadow StdOut: ssl_msg.c:2016: => flush output
Meadow StdOut: ssl_msg.c:2034: message length: %zu, out_left: %zu
Meadow StdOut: Temperature: 37.5 | Humidity: 33.4 | Moisture: 2.3
Meadow StdOut: Temperature: 37.5 | Humidity: 33.4 | Moisture: 2.3
Meadow StdOut: Temperature: 37.5 | Humidity: 33.4 | Moisture: 2.3
Meadow StdOut: Temperature: 37.5 | Humidity: 33.6 | Moisture: 2.3
...

To Reproduce Run CultivarApp with health metrics enabled.

Expected behavior It should not deadlock, but keep running normally.

Meadow (please complete the following information as best as you can): Board Information Model: F7Micro Hardware version: F7CoreComputeV2 Device name: Cultivar

Hardware Information Processor type: STM32F777IIK6 ID: 2F-00-1F-00-12-50-33-53-32-34-31-20 Serial number: 2050346B5333 Coprocessor type: ESP32 MAC Address - WiFi: 4C:75:25:D5:28:5C

Firmware Versions OS: 1.11.0.0 Mono: 1.11.0.0 Coprocessor: 1.11.0.0 Protocol: 7

alexischr commented 4 months ago

We need to split this issue in two:

duduita commented 4 months ago

Created a separate issue focusing on make the device reset/recover when a deadlock is detected.

bryancostanich commented 1 month ago

Believe that this might be fixed. @duduita to confirm.

bryancostanich commented 1 week ago

Probably caused by the deadlock which has been fixed.