{"id":3667,"date":"2021-10-25T13:34:46","date_gmt":"2021-10-25T11:34:46","guid":{"rendered":"https:\/\/www.pschatzmann.ch\/home\/?p=3667"},"modified":"2021-12-14T15:13:14","modified_gmt":"2021-12-14T14:13:14","slug":"how-to-identify-broken-examples-in-an-arduino-library","status":"publish","type":"post","link":"https:\/\/www.pschatzmann.ch\/home\/2021\/10\/25\/how-to-identify-broken-examples-in-an-arduino-library\/","title":{"rendered":"How to identify broken examples in an Arduino Library&#8230;"},"content":{"rendered":"<p>Lately I noticed that some examples in my <a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\">Arduino Audio Tools<\/a> library are not compiling any more. This is not a surprise, since the library is still evolving.<\/p>\n<p>So I was looking for a way how to <strong>identify the broken examples automatically<\/strong>.<\/p>\n<p>Fortunately <strong>Arduino<\/strong> provides a <a href=\"https:\/\/github.com\/arduino\/arduino-cli\">Command Line Interface<\/a> and I just needed to <strong>write a simple bash script<\/strong> to compile all relevant examples:<\/p>\n<pre><code>#!\/bin\/bash\n##\n# We compile all examples using arduino-cli in order to identify compile errors \n# The return code is made available in the build-examples-log.txt file.\n##\narduino-cli lib upgrade\narduino-cli lib linstall \ngit -C .. pu\ngit -C ..\/..\/ESP32-A2DP pull\n\nfunction compile_example {\n  ARCH=$1\n  FILES=$2\n  for f in $FILES\n  do\n    echo \"Processing $f ...\"\n    # take action on each file. $f store current file name\n    arduino-cli compile -b \"$ARCH\" \"$f\"\n    EC=$?\n    #if [ $EC -ne 0 ]; then\n      #break\n      echo -e \"$f -&gt; rc=$EC\" &gt;&gt; \"build-examples-log.txt\"\n    #fi\n  done\n}\n\ncompile_example \"esp32:esp32:esp32\" \"..\/examples\/examples-basic-api\/base*\"\ncompile_example \"esp32:esp32:esp32\" \"..\/examples\/examples-player\/player*\"\ncompile_example \"esp32:esp32:esp32\" \"..\/examples\/examples-webserver\/str*\"\ncompile_example \"esp32:esp32:esp32\" \"..\/examples\/tests\/test*\"\ncompile_example \"esp32:esp32:esp32\" \"..\/examples\/streams*\"\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Lately I noticed that some examples in my Arduino Audio Tools library are not compiling any more. This is not a surprise, since the library is still evolving. So I was looking for a way how to identify the broken examples automatically. Fortunately Arduino provides a Command Line Interface and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1982,"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":[30],"class_list":["post-3667","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","tag-back-to-basics"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to identify broken examples in an Arduino Library... - 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\/2021\/10\/25\/how-to-identify-broken-examples-in-an-arduino-library\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to identify broken examples in an Arduino Library... - Phil Schatzmann\" \/>\n<meta property=\"og:description\" content=\"Lately I noticed that some examples in my Arduino Audio Tools library are not compiling any more. This is not a surprise, since the library is still evolving. So I was looking for a way how to identify the broken examples automatically. Fortunately Arduino provides a Command Line Interface and [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pschatzmann.ch\/home\/2021\/10\/25\/how-to-identify-broken-examples-in-an-arduino-library\/\" \/>\n<meta property=\"og:site_name\" content=\"Phil Schatzmann\" \/>\n<meta property=\"article:published_time\" content=\"2021-10-25T11:34:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-12-14T14:13:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2020\/09\/arduino-logo.png\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\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\\\/2021\\\/10\\\/25\\\/how-to-identify-broken-examples-in-an-arduino-library\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/10\\\/25\\\/how-to-identify-broken-examples-in-an-arduino-library\\\/\"},\"author\":{\"name\":\"pschatzmann\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"headline\":\"How to identify broken examples in an Arduino Library&#8230;\",\"datePublished\":\"2021-10-25T11:34:46+00:00\",\"dateModified\":\"2021-12-14T14:13:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/10\\\/25\\\/how-to-identify-broken-examples-in-an-arduino-library\\\/\"},\"wordCount\":73,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/10\\\/25\\\/how-to-identify-broken-examples-in-an-arduino-library\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/arduino-logo.png\",\"keywords\":[\"Back to Basics\"],\"articleSection\":[\"Arduino\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/10\\\/25\\\/how-to-identify-broken-examples-in-an-arduino-library\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/10\\\/25\\\/how-to-identify-broken-examples-in-an-arduino-library\\\/\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/10\\\/25\\\/how-to-identify-broken-examples-in-an-arduino-library\\\/\",\"name\":\"How to identify broken examples in an Arduino Library... - Phil Schatzmann\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/10\\\/25\\\/how-to-identify-broken-examples-in-an-arduino-library\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/10\\\/25\\\/how-to-identify-broken-examples-in-an-arduino-library\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/arduino-logo.png\",\"datePublished\":\"2021-10-25T11:34:46+00:00\",\"dateModified\":\"2021-12-14T14:13:14+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/10\\\/25\\\/how-to-identify-broken-examples-in-an-arduino-library\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/10\\\/25\\\/how-to-identify-broken-examples-in-an-arduino-library\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/10\\\/25\\\/how-to-identify-broken-examples-in-an-arduino-library\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/arduino-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/arduino-logo.png\",\"width\":800,\"height\":600},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/10\\\/25\\\/how-to-identify-broken-examples-in-an-arduino-library\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to identify broken examples in an Arduino Library&#8230;\"}]},{\"@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":"How to identify broken examples in an Arduino Library... - 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\/2021\/10\/25\/how-to-identify-broken-examples-in-an-arduino-library\/","og_locale":"en_US","og_type":"article","og_title":"How to identify broken examples in an Arduino Library... - Phil Schatzmann","og_description":"Lately I noticed that some examples in my Arduino Audio Tools library are not compiling any more. This is not a surprise, since the library is still evolving. So I was looking for a way how to identify the broken examples automatically. Fortunately Arduino provides a Command Line Interface and [&hellip;]","og_url":"https:\/\/www.pschatzmann.ch\/home\/2021\/10\/25\/how-to-identify-broken-examples-in-an-arduino-library\/","og_site_name":"Phil Schatzmann","article_published_time":"2021-10-25T11:34:46+00:00","article_modified_time":"2021-12-14T14:13:14+00:00","og_image":[{"width":800,"height":600,"url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2020\/09\/arduino-logo.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\/2021\/10\/25\/how-to-identify-broken-examples-in-an-arduino-library\/#article","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/10\/25\/how-to-identify-broken-examples-in-an-arduino-library\/"},"author":{"name":"pschatzmann","@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"headline":"How to identify broken examples in an Arduino Library&#8230;","datePublished":"2021-10-25T11:34:46+00:00","dateModified":"2021-12-14T14:13:14+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/10\/25\/how-to-identify-broken-examples-in-an-arduino-library\/"},"wordCount":73,"commentCount":0,"publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/10\/25\/how-to-identify-broken-examples-in-an-arduino-library\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2020\/09\/arduino-logo.png","keywords":["Back to Basics"],"articleSection":["Arduino"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pschatzmann.ch\/home\/2021\/10\/25\/how-to-identify-broken-examples-in-an-arduino-library\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/10\/25\/how-to-identify-broken-examples-in-an-arduino-library\/","url":"https:\/\/www.pschatzmann.ch\/home\/2021\/10\/25\/how-to-identify-broken-examples-in-an-arduino-library\/","name":"How to identify broken examples in an Arduino Library... - Phil Schatzmann","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/10\/25\/how-to-identify-broken-examples-in-an-arduino-library\/#primaryimage"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/10\/25\/how-to-identify-broken-examples-in-an-arduino-library\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2020\/09\/arduino-logo.png","datePublished":"2021-10-25T11:34:46+00:00","dateModified":"2021-12-14T14:13:14+00:00","breadcrumb":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/10\/25\/how-to-identify-broken-examples-in-an-arduino-library\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pschatzmann.ch\/home\/2021\/10\/25\/how-to-identify-broken-examples-in-an-arduino-library\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/10\/25\/how-to-identify-broken-examples-in-an-arduino-library\/#primaryimage","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2020\/09\/arduino-logo.png","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2020\/09\/arduino-logo.png","width":800,"height":600},{"@type":"BreadcrumbList","@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/10\/25\/how-to-identify-broken-examples-in-an-arduino-library\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pschatzmann.ch\/home\/"},{"@type":"ListItem","position":2,"name":"How to identify broken examples in an Arduino Library&#8230;"}]},{"@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\/3667","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=3667"}],"version-history":[{"count":6,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/3667\/revisions"}],"predecessor-version":[{"id":3673,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/3667\/revisions\/3673"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media\/1982"}],"wp:attachment":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media?parent=3667"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/categories?post=3667"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/tags?post=3667"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}