Forum Sensor.Community

Writing to SD Card

Hi, I’m working with sensors in locations where there is no power and No Wi-Fi. 4G is available in some areas and I have used a 4G router to create a hotspot but it uses a lot of power from the battery. Sometimes I have to change the battery because the battery and / or solar panel are not big enough. Changing the battery is a hassle because it’s someone else’s property - I have to coordinate with them.

I think it would be OK to just store the readings on an SD card and an SD card reader costs like £1! I notice projects on the internet showing how to connect an SD card reader to an ESP8266 and also noticed the CSV checkbox in the Airrohr configuration. Is it possible to just write the same data to an SD Card and retrieve it later? I’m not a programmer. Thanks.

It is possible to write the csv on the SD card but the database can only get live data i think. It can’t read timestamp from the past and sort it afterwards. @ricki-z ?

The ESP8266 doesn’t have a real time clock. So after a restart there is no correct time we could use for the timestamps. But without timestamps the data wouldn’t be really useful.
Adding the code for both the SD card writing and the real time clock would make the firmware significantly larger. We would prefer to use this space for other sensors as your use case is only needed by a few users.
Instead we would prefer a solution using LoRaWAN or cellular networks for situations where no wifi network is available.

1 Like

Thanks. But the CSV checkbox will write the data to an attached SD Card? Otherwise, I don’t know what the CSV check box is for.

If the CSV checkbox is on then the values are written to the serial interface as CVS (just like the debug output, that’s why the debug level should be set to zero for this). You need to connect the sensor to a computer for this.