{"id":30487,"date":"2021-02-20T20:07:20","date_gmt":"2021-02-20T18:07:20","guid":{"rendered":"http:\/\/cornay.co.za\/wp\/?p=30487"},"modified":"2021-02-20T20:07:20","modified_gmt":"2021-02-20T18:07:20","slug":"it-aint-broke-but-should-i-fix-it-3","status":"publish","type":"post","link":"http:\/\/cornay.co.za\/wp\/2021\/02\/20\/it-aint-broke-but-should-i-fix-it-3\/","title":{"rendered":"It Ain\u2019t Broke, But Should I Fix It?"},"content":{"rendered":"<p>Five years ago, I wrote a <a href=\"https:\/\/hackaday.com\/tag\/minimal-mqtt\/\">series on getting started with your own MQTT-based home information\/automation network<\/a>. Five years is a long while in Hackaday time. Back then, the ESP8266 was a lot newer, and the 8266 Arduino port wasn&#8217;t fully in shape yet, and the easiest software framework to get MQTT up and running was NodeMCU; so that&#8217;s what I used for the article series, and as a consequence a handful of devices around my house run minor modifications of that basic &#8220;hello world&#8221;, but doing useful stuff.<\/p>\n<p>Since then, NodeMCU has changed a bunch of its libraries and the ESP32 has replaced the ESP8266 in my parts drawer. If you tried to run my code, you&#8217;d find that it won&#8217;t run on an ESP8266 without porting or compiling an old version of NodeMCU for yourself anyway, and it won&#8217;t run on an ESP32 at all. When [Chris Lott] tried to follow my guide, <a href=\"https:\/\/hackaday.com\/2021\/02\/17\/minimal-mqtt-with-micropython\/\">he discovered that Micropython is probably a better language choice in 2021<\/a>. To minimize lines of code, I&#8217;d agree, although the Arduino and Espressif&#8217;s own native IDF have grown into the job just about as well. In short, anything but NodeMCU.<\/p>\n<figure id=\"attachment_462025\" aria-describedby=\"caption-attachment-462025\" style=\"width: 400px\" class=\"wp-caption alignleft\"><a href=\"https:\/\/hackaday.com\/wp-content\/uploads\/2021\/02\/DSCF2299_thumbnail.png\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" data-attachment-id=\"462025\" data-permalink=\"https:\/\/hackaday.com\/2021\/02\/20\/it-aint-broke-but-should-i-fix-it\/dscf2299_thumbnail\/\" data-orig-file=\"https:\/\/hackaday.com\/wp-content\/uploads\/2021\/02\/DSCF2299_thumbnail.png\" data-orig-size=\"1200,1200\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"DSCF2299_thumbnail\" data-image-description=\"\" data-medium-file=\"https:\/\/hackaday.com\/wp-content\/uploads\/2021\/02\/DSCF2299_thumbnail.png?w=400\" data-large-file=\"https:\/\/hackaday.com\/wp-content\/uploads\/2021\/02\/DSCF2299_thumbnail.png?w=625\" class=\"size-medium wp-image-462025 lazyload\" data-src=\"https:\/\/hackaday.com\/wp-content\/uploads\/2021\/02\/DSCF2299_thumbnail.png?w=400\" alt=\"\" width=\"400\" height=\"400\" data-srcset=\"https:\/\/hackaday.com\/wp-content\/uploads\/2021\/02\/DSCF2299_thumbnail.png 1200w, https:\/\/hackaday.com\/wp-content\/uploads\/2021\/02\/DSCF2299_thumbnail.png?resize=250,250 250w, https:\/\/hackaday.com\/wp-content\/uploads\/2021\/02\/DSCF2299_thumbnail.png?resize=400,400 400w, https:\/\/hackaday.com\/wp-content\/uploads\/2021\/02\/DSCF2299_thumbnail.png?resize=625,625 625w\" data-sizes=\"auto, (max-width: 400px) 100vw, 400px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 400px; --smush-placeholder-aspect-ratio: 400\/400;\" \/><\/a><figcaption id=\"caption-attachment-462025\" class=\"wp-caption-text\">Built in an hour, survived for five years.<\/figcaption><\/figure>\n<p>But my home automation system doesn&#8217;t care. Those little guys are running 24\/7, flipping bits like it was still 2016. Thermometers, light sensors, and power meters haven&#8217;t changed much in five years, and although I&#8217;ve revamped the databasing, display, and user control a number of times since then, using a fixed communication transport protocol means that they&#8217;re still talking the same language. Indeed, even if NodeMCU is dead to me, the MQTT content of my original series is all still valid, and installing a broker on a Raspberry Pi has only become easier in the intervening five years.<\/p>\n<p>So I&#8217;ve got a bunch of legacy code running within the walls of my own home, and it makes me nervous. If the devices fail, or maybe <em>when<\/em> they eventually fail, it&#8217;s not going to be &#8220;just flash another ESP8266 and replace it&#8221;, because even though I have some ancient NodeMCU binaries sitting around, I know when to throw in the towel. But there&#8217;s no good reason to pull them down and start reflashing either. Except that it makes me a little bit itchy, just knowing that there&#8217;s orphaned, dead-end code running all around me. Surrounding me. Staring deep into my hacker&#8217;s heart.<\/p>\n<p>I know better than to tear down a running system, even though I could do it one device at a time, and each module would surely be a simple, independent fix; even though I&#8217;d love the excuse to play around with Micropython and its MQTT implementation on the ESP8266, or maybe even swap some of them out for ESP32s; even though these were all temporary quick hacks that have somehow served for five (5!) years. I certainly know better, right? (Right?)<\/p>\n<div id=\"sidebar-mobile-1\" class=\"widget_text widget widget_custom_html amr_widget\">\n<div class=\"textwidget custom-html-widget\">\n<div id=\"newsletter-blurb\">\nThis article is part of the Hackaday.com newsletter, delivered every seven days for each of the last 200+ weeks. It also includes our favorite articles from the last seven days that you can see on <a href=\"https:\/\/mailchi.mp\/hackaday.com\/hackaday-newsletter-649368\" target=\"_blank\" rel=\"noopener\">the web version of the newsletter<\/a>.<\/p>\n<p>Want this type of article to hit your inbox every Friday morning? <a href=\"http:\/\/eepurl.com\/gTMxQf\" target=\"_blank\" rel=\"noopener\">You should sign up<\/a>!<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>source <a href=\"https:\/\/hackaday.com\/2021\/02\/20\/it-aint-broke-but-should-i-fix-it\/\">https:\/\/hackaday.com\/2021\/02\/20\/it-aint-broke-but-should-i-fix-it\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Five years ago, I wrote a series on getting started with your own MQTT-based home information\/automation network. Five years is a long while in Hackaday time. Back then, the ESP8266 was a lot newer, and the 8266 Arduino port wasn&#8217;t<span class=\"ellipsis\">&hellip;<\/span><\/p>\n<div class=\"read-more\"><a href=\"http:\/\/cornay.co.za\/wp\/2021\/02\/20\/it-aint-broke-but-should-i-fix-it-3\/\">Read more <span class=\"screen-reader-text\">It Ain\u2019t Broke, But Should I Fix It?<\/span><span class=\"meta-nav\"> &#8250;<\/span><\/a><\/div>\n<p><!-- end of .read-more --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[66],"tags":[],"class_list":["post-30487","post","type-post","status-publish","format-standard","hentry","category-news-2"],"_links":{"self":[{"href":"http:\/\/cornay.co.za\/wp\/wp-json\/wp\/v2\/posts\/30487","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/cornay.co.za\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/cornay.co.za\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/cornay.co.za\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/cornay.co.za\/wp\/wp-json\/wp\/v2\/comments?post=30487"}],"version-history":[{"count":1,"href":"http:\/\/cornay.co.za\/wp\/wp-json\/wp\/v2\/posts\/30487\/revisions"}],"predecessor-version":[{"id":30488,"href":"http:\/\/cornay.co.za\/wp\/wp-json\/wp\/v2\/posts\/30487\/revisions\/30488"}],"wp:attachment":[{"href":"http:\/\/cornay.co.za\/wp\/wp-json\/wp\/v2\/media?parent=30487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/cornay.co.za\/wp\/wp-json\/wp\/v2\/categories?post=30487"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/cornay.co.za\/wp\/wp-json\/wp\/v2\/tags?post=30487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}