I'm sending 170 buffered samples from an ESP32 with MPU6050 to ThingSpeak, but the total entries increase inconsistently with a few samples missing in each interval.

5 visualizzazioni (ultimi 30 giorni)
I'm using an ESP32 to collect data from an MPU6050 sensor. The ESP32 buffers 170 samples at a time and uploads them to ThingSpeak using the bulk update API.
However, the data entries received on ThingSpeak are inconsistent. Here's the pattern of total entries I see on the channel after each upload:
  • After 1st upload: 170 entries (correct)
  • After 2nd upload: 338 entries (should be 340)
  • After 3rd upload: 499 entries (should be 510)
  • After 4th upload: 657 entries (should be 680)
  • After 5th upload: 818 entries (should be 850)
As you can see, the expected total should increase by 170 each time, but it's losing a few samples in each batch, and the number of missing entries increases over time. The losses are not consistent — it seems like 1 or 2 samples get dropped randomly in each interval.
Some things I’ve considered:
  • The ESP32 is collecting and sending the full buffer (verified via serial debug).
  • Could it be a payload size limit, HTTP timeout, or formatting issue?
  • Maybe ThingSpeak is silently dropping malformed lines from the bulk update?
Has anyone else run into this with buffered uploads to ThingSpeak? Any tips for debugging the exact cause of dropped samples?
Thanks for any help!
  3 Commenti
Vinod
Vinod il 17 Giu 2025
I'd recommend logging the free memory on the ESP32 to another channel. I suspect there is a memory leak in the device firmware.
Another thing to try is reduce to 50 samples per bulk update. If my memory leak theory holds, you will see that the number of samples lost per batch start off at zero, but over time you will see more samples lost.

Accedi per commentare.

Risposte (0)

Community

Più risposte nel  ThingSpeak Community

Categorie

Scopri di più su Write Data to Channel in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by