It sounds like the dashboard still isn't displaying your ESP32 data correctly. Let's fix this with a more robust solution:
The main issue is likely that the data conversion between Firestore and your dashboard isn't working correctly. Let's implement a simpler, more direct approach.
I've completely rewritten the data handling in the dashboard to make it more robust. Here are the key improvements:
Added Debugging Tools:
If the dashboard still isn't displaying your ESP32 data correctly:
water_quality/latest)The updated dashboard is much more robust and should be able to handle a variety of data formats, so it should work with your ESP32 code without requiring changes to the ESP32 code.
It sounds like the dashboard is incorrectly showing your ESP32 as disconnected even though it's actually connected. Let's fix this issue.
I've made two important changes to fix the ESP32 connection status issue:
Improved Connection Detection Logic:
Added Manual Connection Check:
The previous code was too strict about the timestamp check. It would mark the ESP32 as disconnected if the data was more than 5 minutes old, which might not be accurate for your setup. The new code:
If you're still having issues, the "View Raw Data" button will help diagnose what's happening with the data format, particularly with the timestamp field.