{"id":3125,"date":"2020-03-11T21:55:13","date_gmt":"2020-03-11T12:55:13","guid":{"rendered":"https:\/\/programresource.net\/?p=3125"},"modified":"2020-03-11T21:55:22","modified_gmt":"2020-03-11T12:55:22","slug":"declaration-of-softwareserial-causes-build-error","status":"publish","type":"post","link":"https:\/\/programresource.net\/en\/2020\/03\/11\/3125.html","title":{"rendered":"Declaration of SoftwareSerial causes build error"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/programresource.net\/images\/2020\/03\/P_20200311_004624_vHDR_Auto-1024x577.jpg\" alt=\"\" class=\"wp-image-3122\" srcset=\"https:\/\/programresource.net\/images\/2020\/03\/P_20200311_004624_vHDR_Auto-1024x577.jpg 1024w, https:\/\/programresource.net\/images\/2020\/03\/P_20200311_004624_vHDR_Auto-300x169.jpg 300w, https:\/\/programresource.net\/images\/2020\/03\/P_20200311_004624_vHDR_Auto-768x433.jpg 768w, https:\/\/programresource.net\/images\/2020\/03\/P_20200311_004624_vHDR_Auto.jpg 1366w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>With board package ESP8266 newer than 2.5.0, declaration of SoftwareSerial like below causes build error.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nSoftwareSerial cameraconnection = SoftwareSerial(PIN_D3, PIN_D8);\n<\/pre><\/div>\n\n\n<p>Above type declaration can be found in sample sketch for Adafruit VC0706 serial jpeg camera.<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/adafruit\/Adafruit-VC0706-Serial-Camera-Library\/blob\/master\/examples\/Snapshot\/Snapshot.ino\">https:\/\/github.com\/adafruit\/Adafruit-VC0706-Serial-Camera-Library\/blob\/master\/examples\/Snapshot\/Snapshot.ino<\/a><\/p>\n\n\n\n<p>Resulting error message.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; gutter: false; title: ; notranslate\" title=\"\">\nuse of deleted function 'SoftwareSerial::SoftwareSerial(const SoftwareSerial&amp;)'\n<\/pre><\/div>\n\n\n<p>To fix this issue, change declaration to below.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nSoftwareSerial cameraconnection(PIN_D3, PIN_D8);\n<\/pre><\/div>\n\n\n<p>Latest ESP8266 SoftwareSerial library uses EspSoftwareSerial from Peter Lerup; you can also code like below.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSoftwareSerial swserial;\n...\nsetup(){\n swserial.begin(9600, SWSERIAL_8N1, PIN_D3, PIN_D8, false, 256);\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>With board package ESP8266 newer than 2.5.0, declaration of SoftwareSerial like below causes build error. Above type declaration can be found in sample sketch for Adafruit VC0706 serial jpeg camera. https:\/\/github.com\/adafruit\/Adafruit-VC0706-Serial-Camera-Library\/blob\/master\/examples\/Snapshot\/Snapshot.ino Resulting error message. To fix this issue, change declaration to below. Latest ESP8266 SoftwareSerial library uses EspSoftwareSerial from Peter Lerup; you can also code like below.<\/p>\n","protected":false},"author":2,"featured_media":3123,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[866],"tags":[862,952,953,894,955],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/programresource.net\/images\/2020\/03\/P_20200311_004624_vHDR_Auto.jpg","jetpack_shortlink":"https:\/\/wp.me\/p3pJyQ-Op","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/programresource.net\/en\/wp-json\/wp\/v2\/posts\/3125"}],"collection":[{"href":"https:\/\/programresource.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/programresource.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/programresource.net\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/programresource.net\/en\/wp-json\/wp\/v2\/comments?post=3125"}],"version-history":[{"count":1,"href":"https:\/\/programresource.net\/en\/wp-json\/wp\/v2\/posts\/3125\/revisions"}],"predecessor-version":[{"id":3126,"href":"https:\/\/programresource.net\/en\/wp-json\/wp\/v2\/posts\/3125\/revisions\/3126"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/programresource.net\/en\/wp-json\/wp\/v2\/media\/3123"}],"wp:attachment":[{"href":"https:\/\/programresource.net\/en\/wp-json\/wp\/v2\/media?parent=3125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/programresource.net\/en\/wp-json\/wp\/v2\/categories?post=3125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/programresource.net\/en\/wp-json\/wp\/v2\/tags?post=3125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}