{"id":2146,"date":"2020-11-10T19:48:15","date_gmt":"2020-11-10T18:48:15","guid":{"rendered":"https:\/\/www.pschatzmann.ch\/home\/?p=2146"},"modified":"2024-03-21T12:04:19","modified_gmt":"2024-03-21T11:04:19","slug":"accessing-remote-files-from-arduino","status":"publish","type":"post","link":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/10\/accessing-remote-files-from-arduino\/","title":{"rendered":"Accessing Remote Files from an Arduino (with FTP)"},"content":{"rendered":"<p>I was looking for a <strong>Arduino library<\/strong> which would allow me to access remote files on a Linux server. Unfortunately I did not find anything that I liked. So I came up with <strong>my own solution<\/strong> which is based on FTP.<\/p>\n<p>The <a href=\"https:\/\/tools.ietf.org\/html\/rfc959\">FTP protocol<\/a> is one of oldest communication protocols: It is easy to implement and therefore rather efficient and you can find plenty of free server implementations on all platforms.<\/p>\n<p>The library provides a Stream based API for the remote files which supports<\/p>\n<ul>\n<li>The <strong>reading<\/strong> of Remote Files (File Download)<\/li>\n<li>The <strong>writing<\/strong> to Remote Files (File Upload)<\/li>\n<li>The <strong>listing<\/strong> of Remote Files and Directories<\/li>\n<li>Creation and deletion of remote <strong>directories<\/strong><\/li>\n<li>Deletion of remote files<\/li>\n<\/ul>\n<p>Reading a file is as simple as the following code:<\/p>\n<pre><code>    ArduinoFTPClient client;\n    client.begin(IPAddress(192,168,1,10), \"user\", \"password\");\n    FTPFile file = client.open(\"\/test.txt\");\n    byte buffer[100];\n    while (file.available()&gt;0){\n        int len = file.read(buffer, 100);\n        Serial.write(buffer, len);\n    }\n    file.close();\n    client.end();\n\n<\/code><\/pre>\n<p>The solution was tested with an ESP32 together with <strong>vsftpd<\/strong> running on a <strong>Ubuntu Server<\/strong>.<\/p>\n<p>Further details can be found on <a href=\"https:\/\/github.com\/pschatzmann\/ArduinoFTPClient\">Github<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was looking for a Arduino library which would allow me to access remote files on a Linux server. Unfortunately I did not find anything that I liked. So I came up with my own solution which is based on FTP. The FTP protocol is one of oldest communication protocols: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2147,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[20],"tags":[46],"class_list":["post-2146","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","tag-communications"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Accessing Remote Files from an Arduino (with FTP) - Phil Schatzmann<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/10\/accessing-remote-files-from-arduino\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Accessing Remote Files from an Arduino (with FTP) - Phil Schatzmann\" \/>\n<meta property=\"og:description\" content=\"I was looking for a Arduino library which would allow me to access remote files on a Linux server. Unfortunately I did not find anything that I liked. So I came up with my own solution which is based on FTP. The FTP protocol is one of oldest communication protocols: [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/10\/accessing-remote-files-from-arduino\/\" \/>\n<meta property=\"og:site_name\" content=\"Phil Schatzmann\" \/>\n<meta property=\"article:published_time\" content=\"2020-11-10T18:48:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-21T11:04:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2020\/11\/ftp.png\" \/>\n\t<meta property=\"og:image:width\" content=\"225\" \/>\n\t<meta property=\"og:image:height\" content=\"225\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"pschatzmann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"pschatzmann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/10\\\/accessing-remote-files-from-arduino\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/10\\\/accessing-remote-files-from-arduino\\\/\"},\"author\":{\"name\":\"pschatzmann\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"headline\":\"Accessing Remote Files from an Arduino (with FTP)\",\"datePublished\":\"2020-11-10T18:48:15+00:00\",\"dateModified\":\"2024-03-21T11:04:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/10\\\/accessing-remote-files-from-arduino\\\/\"},\"wordCount\":155,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/10\\\/accessing-remote-files-from-arduino\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/ftp.png\",\"keywords\":[\"Communications\"],\"articleSection\":[\"Arduino\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/10\\\/accessing-remote-files-from-arduino\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/10\\\/accessing-remote-files-from-arduino\\\/\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/10\\\/accessing-remote-files-from-arduino\\\/\",\"name\":\"Accessing Remote Files from an Arduino (with FTP) - Phil Schatzmann\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/10\\\/accessing-remote-files-from-arduino\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/10\\\/accessing-remote-files-from-arduino\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/ftp.png\",\"datePublished\":\"2020-11-10T18:48:15+00:00\",\"dateModified\":\"2024-03-21T11:04:19+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/10\\\/accessing-remote-files-from-arduino\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/10\\\/accessing-remote-files-from-arduino\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/10\\\/accessing-remote-files-from-arduino\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/ftp.png\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/ftp.png\",\"width\":225,\"height\":225},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2020\\\/11\\\/10\\\/accessing-remote-files-from-arduino\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Accessing Remote Files from an Arduino (with FTP)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\",\"name\":\"Phil Schatzmann Consulting\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\",\"name\":\"pschatzmann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"width\":305,\"height\":305,\"caption\":\"pschatzmann\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Accessing Remote Files from an Arduino (with FTP) - Phil Schatzmann","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/10\/accessing-remote-files-from-arduino\/","og_locale":"en_US","og_type":"article","og_title":"Accessing Remote Files from an Arduino (with FTP) - Phil Schatzmann","og_description":"I was looking for a Arduino library which would allow me to access remote files on a Linux server. Unfortunately I did not find anything that I liked. So I came up with my own solution which is based on FTP. The FTP protocol is one of oldest communication protocols: [&hellip;]","og_url":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/10\/accessing-remote-files-from-arduino\/","og_site_name":"Phil Schatzmann","article_published_time":"2020-11-10T18:48:15+00:00","article_modified_time":"2024-03-21T11:04:19+00:00","og_image":[{"width":225,"height":225,"url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2020\/11\/ftp.png","type":"image\/png"}],"author":"pschatzmann","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pschatzmann","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/10\/accessing-remote-files-from-arduino\/#article","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/10\/accessing-remote-files-from-arduino\/"},"author":{"name":"pschatzmann","@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"headline":"Accessing Remote Files from an Arduino (with FTP)","datePublished":"2020-11-10T18:48:15+00:00","dateModified":"2024-03-21T11:04:19+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/10\/accessing-remote-files-from-arduino\/"},"wordCount":155,"commentCount":1,"publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/10\/accessing-remote-files-from-arduino\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2020\/11\/ftp.png","keywords":["Communications"],"articleSection":["Arduino"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pschatzmann.ch\/home\/2020\/11\/10\/accessing-remote-files-from-arduino\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/10\/accessing-remote-files-from-arduino\/","url":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/10\/accessing-remote-files-from-arduino\/","name":"Accessing Remote Files from an Arduino (with FTP) - Phil Schatzmann","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/10\/accessing-remote-files-from-arduino\/#primaryimage"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/10\/accessing-remote-files-from-arduino\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2020\/11\/ftp.png","datePublished":"2020-11-10T18:48:15+00:00","dateModified":"2024-03-21T11:04:19+00:00","breadcrumb":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/10\/accessing-remote-files-from-arduino\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pschatzmann.ch\/home\/2020\/11\/10\/accessing-remote-files-from-arduino\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/10\/accessing-remote-files-from-arduino\/#primaryimage","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2020\/11\/ftp.png","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2020\/11\/ftp.png","width":225,"height":225},{"@type":"BreadcrumbList","@id":"https:\/\/www.pschatzmann.ch\/home\/2020\/11\/10\/accessing-remote-files-from-arduino\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pschatzmann.ch\/home\/"},{"@type":"ListItem","position":2,"name":"Accessing Remote Files from an Arduino (with FTP)"}]},{"@type":"WebSite","@id":"https:\/\/www.pschatzmann.ch\/home\/#website","url":"https:\/\/www.pschatzmann.ch\/home\/","name":"Phil Schatzmann Consulting","description":"","publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pschatzmann.ch\/home\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1","name":"pschatzmann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","width":305,"height":305,"caption":"pschatzmann"},"logo":{"@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png"}}]}},"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/2146","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/comments?post=2146"}],"version-history":[{"count":12,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/2146\/revisions"}],"predecessor-version":[{"id":2265,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/2146\/revisions\/2265"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media\/2147"}],"wp:attachment":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media?parent=2146"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/categories?post=2146"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/tags?post=2146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}