{"id":1874,"date":"2024-10-01T20:23:41","date_gmt":"2024-10-02T03:23:41","guid":{"rendered":"https:\/\/unixwizardry.com\/?p=1874"},"modified":"2024-10-01T20:57:43","modified_gmt":"2024-10-02T03:57:43","slug":"well-another-delay","status":"publish","type":"post","link":"https:\/\/unixwizardry.com\/index.php\/2024\/10\/01\/well-another-delay\/","title":{"rendered":"Well, another delay&#8230;"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"1874\" class=\"elementor elementor-1874\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-6d658e54 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"6d658e54\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-423067e1\" data-id=\"423067e1\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-7cea4f82 elementor-widget elementor-widget-text-editor\" data-id=\"7cea4f82\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>This time, it&#8217;s WiFi range; I was trying to get voltage measurements from roof-mounted solar cells via a test rig in my shed.\u00a0 \u00a0No signal. \ud83d\ude41\u00a0 So, yet another delay&#8230;but I&#8217;m getting closer.\u00a0 <span style=\"color: var(--sydney-text-color);\">I want to use a Wemos D1Mini Pro because of the available external antenna connector since I need more range for my remote weather station project.\u00a0 When I TRY to upload, t<\/span><span style=\"color: var(--sydney-text-color);\">he on-board LED flashes like it&#8217;s trying to load but I was eventually getting an upload error, as you can see below.\u00a0 \u00a0<\/span><\/p><p>The console looks like this:<\/p><p><strong>Processing d1_mini_pro (platform: espressif8266; board: d1_mini_pro; framework: arduino)<\/strong><br \/><strong>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/strong><br \/><strong>Verbose mode can be enabled via `-v, &#8211;verbose` option<\/strong><br \/><strong>CONFIGURATION: https:\/\/docs.platformio.org\/page\/boards\/espressif8266\/d1_mini_pro.html<\/strong><br \/><strong>PLATFORM: Espressif 8266 (3.2.0) &gt; WeMos D1 mini Pro<\/strong><br \/><strong>HARDWARE: ESP8266 80MHz, 80KB RAM, 16MB Flash<\/strong><br \/><strong>PACKAGES:<\/strong><br \/><strong>&#8211; framework-arduinoespressif8266 @ 3.30002.0 (3.0.2)<\/strong><br \/><strong>&#8211; tool-esptool @ 1.413.0 (4.13)<\/strong><br \/><strong>&#8211; tool-esptoolpy @ 1.30000.201119 (3.0.0)<\/strong><br \/><strong>&#8211; tool-mklittlefs @ 1.203.210628 (2.3)<\/strong><br \/><strong>&#8211; tool-mkspiffs @ 1.200.0 (2.0)<\/strong><br \/><strong>&#8211; toolchain-xtensa @ 2.100300.210717 (10.3.0)<\/strong><br \/><strong>LDF: Library Dependency Finder -&gt; https:\/\/bit.ly\/configure-pio-ldf<\/strong><br \/><strong>LDF Modes: Finder ~ chain, Compatibility ~ soft<\/strong><br \/><strong>Found 35 compatible libraries<\/strong><br \/><strong>Scanning dependencies&#8230;<\/strong><br \/><strong>No dependencies<\/strong><br \/><strong>Building in release mode<\/strong><br \/><strong>Retrieving maximum program size .pio\\build\\d1_mini_pro\\firmware.elf<\/strong><br \/><strong>Checking size .pio\\build\\d1_mini_pro\\firmware.elf<\/strong><br \/><strong>Advanced Memory Usage is available via &#8220;PlatformIO Home &gt; Project Inspect&#8221;<\/strong><br \/><strong>RAM: [=== ] 34.0% (used 27892 bytes from 81920 bytes)<\/strong><br \/><strong>Flash: [== ] 24.9% (used 260093 bytes from 1044464 bytes)<\/strong><br \/><strong>Configuring upload protocol&#8230;<\/strong><br \/><strong>AVAILABLE: espota, esptool<\/strong><br \/><strong>CURRENT: upload_protocol = esptool<\/strong><br \/><strong>Looking for upload port&#8230;<\/strong><br \/><strong>Auto-detected: COM4<\/strong><br \/><strong>Uploading .pio\\build\\d1_mini_pro\\firmware.bin<\/strong><br \/><strong>esptool.py v3.0<\/strong><br \/><strong>Serial port COM4<\/strong><br \/><strong>Connecting&#8230;&#8230;.._____&#8230;.._____&#8230;.._____&#8230;.._____&#8230;.._____&#8230;.._____&#8230;.._____<\/strong><\/p><p><span style=\"color: #ff0000;\">A fatal error occurred: Failed to connect to ESP8266: Timed out waiting for packet header<\/span><br \/><span style=\"color: #ff0000;\">*** [upload] Error 2<\/span><br \/>============== [FAILED] Took 26.46 seconds ====================<\/p><p>I posted my predicament to the <a href=\"https:\/\/community.platformio.org\/\">platformIO community<\/a> and it was very helpful!\u00a0 After working with a couple of PlatformIO guys with experience with ESP8266 boards on the forum, I finally got it to upload OK.\u00a0 This particular D1 Mini Pro board with a CH9102 USB-Serial converter was unlike any other ESP8266 board I have used.\u00a0 Usually, PlatformIO and esptool.py would automagically set the board to upload mode and <em>voila!<\/em> program loaded.\u00a0 Not so with this one.\u00a0 It was advised to set the monitor speed to 9600 in the platformio.ini, which I did.\u00a0 With GPIO0 grounded to upload, once it loaded, I got garbage on output:<\/p><p>[env:d1_mini_pro]<br \/>platform = espressif8266<br \/>board = d1_mini_pro<br \/>framework = arduino<br \/>monitor_speed = 9600<\/p><p>Executing task in folder Web-Server-LED-Control-AJAX: C:\\Users\\bruce.platformio\\penv\\Scripts\\platformio.exe device monitor<\/p><p>\u2014 Terminal on COM4 | 9600 8-N-1<br \/>\u2014 Available filters and text transformations: colorize, debug, default, direct, esp8266_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time<br \/>\u2014 More details at\u00a0<a class=\"inline-onebox\" href=\"https:\/\/bit.ly\/pio-monitor-filters\" rel=\"noopener nofollow ugc\">Redirecting&#8230;<\/a><br \/>\u2014 Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H<br \/>\ufffdHtx6<\/p><p>Working with user <em>sivar2311, he directed me to set the monitor_speed <\/em>to 7488, which appararently allows the bootloader to put the boot log to serial.\u00a0 So, armed with this info, I got this on booting:<\/p><p>Executing task in folder Web-Server-LED-Control-AJAX: C:\\Users\\bruce.platformio\\penv\\Scripts\\platformio.exe device monitor<br \/>\u2014 Terminal on COM4 | 76800 8-N-1<br \/>\u2014 Available filters and text transformations: colorize, debug, default, direct, esp8266_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time<br \/>\u2014 More details at\u00a0<a class=\"inline-onebox\" href=\"https:\/\/bit.ly\/pio-monitor-filters\" rel=\"noopener nofollow ugc\">Redirecting&#8230;<\/a><br \/>\u2014 Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H<br \/><span style=\"color: #ff0000;\">ets Jan 8 2013,rst cause:2, boot mode:(1,7)<\/span><\/p><p>From the Bootloader info page about esptool.py:<\/p><p><em>The ESP8266 boot rom writes a log to the UART when booting. The timing is a little bit unusual: <code class=\"docutils literal notranslate\"><span class=\"pre\">74880<\/span>\u00a0<span class=\"pre\">baud<\/span><\/code>\u00a0(see\u00a0<a class=\"reference internal\" href=\"https:\/\/docs.espressif.com\/projects\/esptool\/en\/latest\/esp8266\/esptool\/serial-connection.html#serial-port-settings\"><span class=\"std std-ref\">Serial Port Settings<\/span><\/a>).<\/em><\/p><p><em>Baud rate 74880 is what the ESP8266 bootloader uses. The apps on top of the Espressif SDK (e.g. Arduino sketch) talk at 115200 if not specified otherwise.<\/em><\/p><p>It was suggested to try different combinations of DTR and RTS and after some back-and-forth on the forum, this was the answer:<\/p><p><strong>The garbage is due to the fact that your sketch works with a baud rate of 9600, but the monitor is currently set to 76800.<\/strong><\/p><p><strong>Stay with the first one (monitor_dtr = 0 \/ monitor_rts = 0) and change the baud rate back to 9600:<\/strong><\/p><p><strong>[env:d1_mini_pro]<\/strong><br \/><strong>platform = espressif8266<\/strong><br \/><strong>board = d1_mini_pro<\/strong><br \/><strong>framework = arduino<\/strong><br \/><strong>monitor_speed = 9600<\/strong><br \/><strong>monitor_rts = 0<\/strong><br \/><strong>monitor_dtr = 0<\/strong><\/p><p>Why this was necessary and to ground GPIO0 (D3) to get this board working is beyond me.\u00a0 All of my other ESP8266 boards (except the barebones ESP01) work fine with PlatformIO to upload and none of this is needed.\u00a0 Well, now I know what to do when a board refuses to boot, thanks to the PlatformIO community forum. \ud83d\ude42\u00a0<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>This time, it&#8217;s WiFi range; I was trying to get voltage measurements from roof-mounted solar cells via a test rig in my [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25,38],"tags":[],"class_list":["post-1874","post","type-post","status-publish","format-standard","hentry","category-internet-of-things","category-weather-instruments"],"_links":{"self":[{"href":"https:\/\/unixwizardry.com\/index.php\/wp-json\/wp\/v2\/posts\/1874","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unixwizardry.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unixwizardry.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unixwizardry.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unixwizardry.com\/index.php\/wp-json\/wp\/v2\/comments?post=1874"}],"version-history":[{"count":31,"href":"https:\/\/unixwizardry.com\/index.php\/wp-json\/wp\/v2\/posts\/1874\/revisions"}],"predecessor-version":[{"id":1907,"href":"https:\/\/unixwizardry.com\/index.php\/wp-json\/wp\/v2\/posts\/1874\/revisions\/1907"}],"wp:attachment":[{"href":"https:\/\/unixwizardry.com\/index.php\/wp-json\/wp\/v2\/media?parent=1874"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unixwizardry.com\/index.php\/wp-json\/wp\/v2\/categories?post=1874"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unixwizardry.com\/index.php\/wp-json\/wp\/v2\/tags?post=1874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}