Getting Device Data to the Cloud Reliably: MQTT and AWS IoT Firmware for ESP32 and STM32
Sending data to the cloud looks easy until devices lose readings, certificates expire or the bill grows. How I build reliable device-to-cloud links.
The problem clients bring: "Our dashboard has gaps in the data, some devices stopped reporting after a few months, and our cloud bill keeps growing."
What is really going wrong
- Readings taken while offline are simply lost.
- Certificates and credentials were never planned for rotation or expiry.
- Devices send far more data than the dashboard needs.
- There is no way to change configuration remotely, so every change needs a firmware update.
How I solve it
- Buffer readings locally and upload them when the connection returns, with timestamps.
- Use mutual TLS with per-device credentials and a plan for renewing them.
- Batch and compress data, and send only what changes.
- Add remote configuration through device shadows or retained messages.
- Test the whole path with simulated network loss before anything ships.
What the client gets
Complete data, devices that stay authorised for years, and a cloud bill that grows with real value instead of wasted messages.