{"id":322,"date":"2024-10-07T13:49:04","date_gmt":"2024-10-07T13:49:04","guid":{"rendered":"https:\/\/fakler.es\/it\/?p=322"},"modified":"2024-10-07T13:52:30","modified_gmt":"2024-10-07T13:52:30","slug":"arduino-sd-card-access","status":"publish","type":"post","link":"https:\/\/fakler.es\/it\/2024\/10\/07\/arduino-sd-card-access\/","title":{"rendered":"Arduino SD card access"},"content":{"rendered":"\n<p>I have an Arduino Ethernet Shield W5500 Development Board which has a slot for a SD card. I insert a Micro SD card into the slot (FAT32 formatted)  and try executing a sketch  because Arduino should  execute the HTML file on the webserver &#8230; <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>\/\/ initialize SD card\nSerial.println(\"Initializing SD card...\");\nif (!SD.begin(4)) {\n    Serial.println(\"ERROR - SD card initialization failed!\");\n    return;    \/\/ init failed\n}\nSerial.println(\"SUCCESS - SD card initialized.\");\n\/\/ check for index.htm file\nif (!SD.exists(\"index.htm\")) {\n    Serial.println(\"ERROR - Can't find index.htm file!\");\n    return;  \/\/ can't find index file<\/code><\/code><\/pre>\n\n\n\n<p>The &#8220;index.htm&#8221; file is there. So I am quite astonished that the serial monitor complains about a missing file.<\/p>\n\n\n\n<p>I have a SD card module at hand and execute a sketch writing some lines in a testfile &#8230;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Serial.print(\"Writing to test.txt\u2026\");\nmyFile.println(\"This is a test file :)\");\nmyFile.println(\"testing 1, 2, 3.\");\nfor (int i = 0; i &lt; 20; i++) {\nmyFile.println(i);\n}\n\/\/ close the file:\nmyFile.close();\nSerial.println(\"done.\");<\/code><\/pre>\n\n\n\n<p> Now I can see in the serial monitor that there is NO error message that the &#8220;index.htm&#8221; file is not there.  And I am quite surprised that the C++ sketch has written the text into the &#8220;index.htm&#8221; file and saved it as &#8220;INDEX.HTM&#8221;.<\/p>\n\n\n\n<p>Seems to be a matter of fact that Arduino, when accessing a Micro SD card (FAT32) , expects the filename in upper cases and ignores filenames with lower case letters.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have an Arduino Ethernet Shield W5500 Development Board which has a slot for a SD card. I insert a Micro SD card into the slot (FAT32 formatted) and try executing a sketch because Arduino should execute the HTML file on the webserver &#8230; The &#8220;index.htm&#8221; file is there. So I am quite astonished that &hellip; <a href=\"https:\/\/fakler.es\/it\/2024\/10\/07\/arduino-sd-card-access\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Arduino SD card access&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[129,87],"tags":[149,150,147,148],"_links":{"self":[{"href":"https:\/\/fakler.es\/it\/wp-json\/wp\/v2\/posts\/322"}],"collection":[{"href":"https:\/\/fakler.es\/it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fakler.es\/it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fakler.es\/it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fakler.es\/it\/wp-json\/wp\/v2\/comments?post=322"}],"version-history":[{"count":6,"href":"https:\/\/fakler.es\/it\/wp-json\/wp\/v2\/posts\/322\/revisions"}],"predecessor-version":[{"id":328,"href":"https:\/\/fakler.es\/it\/wp-json\/wp\/v2\/posts\/322\/revisions\/328"}],"wp:attachment":[{"href":"https:\/\/fakler.es\/it\/wp-json\/wp\/v2\/media?parent=322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fakler.es\/it\/wp-json\/wp\/v2\/categories?post=322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fakler.es\/it\/wp-json\/wp\/v2\/tags?post=322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}