• I have started measurement with solarpanel and batteries attached so I can see how it behaves under various conditions.

    I have made logging for RAM and for SD card. For RAM everything is logged fine however, using SD card gives me some troubles. If connected writing to SD card is no problem however if entering the deep sleep mode, writing will fail and "ERROR: Unable to read file : DISK_ERR" will be reported. Is more power required for SD card operations? Below is what is measured in deep sleep mode, e.g. 2,93265214797:

    Sun Nov 2 2014 10:46:21 GMT+0000;2,93265214797
    Sun Nov 2 2014 10:46:31 GMT+0000;2,93090339892
    Sun Nov 2 2014 10:46:41 GMT+0000;2,92566964285
    Sun Nov 2 2014 10:46:51 GMT+0000;2,92566964285

    Thanks...

  • Just a few details about sd cards and data logging:
    a-All SD cards have an internal controller that, totally transparently, manages, eventually bad flash sectors, as well as strategies to speed up apparent writes to the card. It does take time to finish the writes internally. They, for instance, can be grouped by this controller.
    Furthermore, there is no way for the 'host' MCU to now about the real moment the operations ended. So the worst thing to do is to cut off power, or pull out the sd card, too soon: You get randomly unreliable results because the writes were not really finished by the controller.

    A delay of a few seconds, somes wrote 30 s, seems to solve it.

    The Raspberry Pi forum has tons of discussions about it.
    I solved it, on a Raspberry Pi, by using:
    1-an overlayfs which places a ramdisk for writes only, and some sub-trees only, above the flash memory,
    2-a crontab task that copied, every 4 hours, the overlayfs ramdisk to the SD card..... Which means that I accept to, eventually, loose 4 hours of data measurements.

    b-Another problem is consequent of the 10 000 maximum writes on the same flash sector: It systematically happens when you append to the same file. The directory containing this file is updated at each and every write to the file.
    This kills very efficiently an SD card in a few days, 8 to 10 days on my Raspberry Pi. Raspbian, ext4fs, groups writes per 5 seconds blocks. This parameter can be increased but it becomes system wide which is not safe at all.

    A simple solution is to use sub-directories which are written to a limited number of times to their contained files. Indeed, this is why photo cameras are using /DCIM/xxxx/yyy.jpg tree structure for saving to the SD card.

About