Jump to content
  • 0

MCC 118 Data Logger (Rasp Pi 4B) Max File Size


Rishi1

Question

Hello,

 

I am using the  MCC118 DAQHAT on a Raspberry Pi 4B to measure voltages on all 8 channels. I am using the provided data_logger example from the MCC github to log the voltages on all 8 channels at 10kS/s per channel and output to "data.csv."

I am running into an issue where the data_logger stops after data.csv reaches 2GB file size.

After spending days on research, my understanding is that this may be due to Raspberry Pi 4B bootloader required to be FAT16/FAT32 format. I bought an external 1TB SSD and have two partitions. One partition in FAT32 format for the Pi4B bootloader and the second partition in EXT4 format to store files larger than 2GB since EXT4 format allows for a single file to reach a maximum size of 16TB vs 2GB for FAT16/FAT32. Unfortunately, the data logger stills only writes values into data.csv up to 2GB and stops, which is only around ~1 hour of data. 

I am trying to log the voltages on all channels for days/weeks and have it continually write the data to a csv file until the "Stop" button is pressed. Is there any workaround for the max file size limit? Thank you.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

the following was taken from a Stackoverflow forum thread: "On Linux, write() (and similar system calls) will transfer at most 0x7ffff000 (2,147,479,552) bytes, returning the number of bytes actually transferred. (This is true on both 32-bit and 64-bit systems.)" This answer more than likely includes functions like fprintf() used by the logger example. In other words, we use 32-bit c functions for the logging to file operation, which limits the size to 2GB. 

 

Link to comment
Share on other sites

  • 0

UPDATE: the attached make file builds to a 64-bit specification allowing files greater than 2GiB. Copy it to the following folder overwriting the existing file. daqhats/examples/c/mcc118/data_logger/logger.  Use "make clean; make" to remake the executable and it will (should) create files larger than 2GiB. 

makefile

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...