Hi there,
I’m currently experiencing an issue with data not being correctly written to my Qwiic OpenLog with a SparkFun Qwiic Micro SAMD21. The problem is that I can observe that data is being lost when writing to the microSD card. The code responsible for writing to the OpenLog is a few simple lines:
myLog.print(rtc.stringTimeStamp());
myLog.print(",");
myLog.print(pitch);
myLog.print(",");
myLog.print(roll);
myLog.print(",");
myLog.println(heading);
myLog.syncFile();
The resulting output should include a simple header (“datetime, pitch, roll, heading”) followed by the comma separated values. Instead, the following data is recorded on the SD card at an I2C speed of 400kHz:
d
2,-593,667,-844
2,-637,705,-2.87
2,-7.15,806,-3.35
2,-8.93,797,-3.84
2,-891,1.18,-3.19
2,-869,542,-3.94
2,-1.96,576,-3.07
2,-851,521,-3.77
2,1.86,-4.29,-4.57
2,-036,-1.55,-4.04
When I decrease the I2C speeds to to 100kHz, it appears slightly more data is able to be written to the SD card:
da
2020-01-17T16:0,-22.19,50.67,-3.16
2020-0,-21.28,50.47,-4.35
20,-2.75,51.12,-4.02
20,-1.87,45.76,-7.58
2020-01-17T1,-8.85,3.09,-25.33
2020-01,-40.21,-24.71,-62.01
2020-01-17T16:04:17:11,-30.16,-10.45,-53.06
20,-4.18,-28.86,-65.46
20,-3.27,-0.96,-59.29
2020-01-17T16:04:19:28,3.82,68.11,-7.02
The Qwiic OpenLog troubleshooting steps advise to add small delays between the writes, but doing so appears not to have any effect. I have also tried a variety of microSD cards, including Class 10 cards.
Using the Example9_readVersion, I can confirm that my firmware version is 3.1 when using the Qwiic Micro SAMD21. When I use an Artemis Nano or Edge 2, the version shows as 255.255, which I assume is a bug. I should note that when using an Artemis-based board, the data is correctly written to the SD card and no loss of data is observed.
A quick scan of the SparkFun forums and GitHub repositories for the Qwiic OpenLog reveals that a number of users have encountered very similar problems over the past year. While some of these issues may be attributable to version 2.0 of the firmware, the majority of outstanding issues pertain to firmware version 3.0+.
SparkFun Forums
[/list]
GitHub
Are you able to confirm that there are known issues with the OpenLog firmware? If so, is this something that’s currently being addressed?
I’m happy to help in any way I can!
Cheers,
Adam](Characters dropped on Teensy 4.0 · Issue #6 · sparkfun/Qwiic_OpenLog · GitHub)](Incomplete println output in SD card file · Issue #3 · sparkfun/SparkFun_Qwiic_OpenLog_Arduino_Library · GitHub)](https://forum.sparkfun.com/viewtopic.php?f=105&t=50227)](https://forum.sparkfun.com/viewtopic.php?f=105&t=50900&p=207913&hilit=openlog#p207788)](https://forum.sparkfun.com/viewtopic.php?f=105&t=51056&p=208400&hilit=openlog#p208291)](https://forum.sparkfun.com/viewtopic.php?f=105&t=51667&p=210751&hilit=openlog#p210489)