{"id":995,"date":"2021-12-20T12:00:34","date_gmt":"2021-12-20T12:00:34","guid":{"rendered":"https:\/\/www.kolkataonweb.com\/code-bank\/?p=995"},"modified":"2021-12-19T14:38:47","modified_gmt":"2021-12-19T14:38:47","slug":"esp-01-serial-println-or-serial-print-not-working","status":"publish","type":"post","link":"https:\/\/www.kolkataonweb.com\/code-bank\/arduino\/esp-01-serial-println-or-serial-print-not-working\/","title":{"rendered":"ESP-01 Serial.println() or Serial.print() not working"},"content":{"rendered":"<p>I went crazy, mad trying to understand why the module is not printing anything to the Serial Monitor or receiving any AT commands.<\/p>\n<p>I went through lots of articles on the internet and was on the verge of throwing the module away. Just that my mind was not willing to believe that it is dead &#8211; because I was able to burn OS \/ Firmware to the module every time I tried and the status showed success. And my suspicion was confirmed accidentally &#8211; I put some Serial.print code in loop instead of setup and it did throw output to serial monitor. It confirmed that something is wrong with the settings of Arduino IDE.<\/p>\n<p>After lots of tweaking and trials I found that &#8211; the &#8220;Built In Led&#8221; settings of Arduino that mattered.\u00a0 The built in LED is on the TX line of the module, hence just after printing some output when I toggled the LED, the print function didn&#8217;t get enough time to write to the monitor. To solve the matter a delay can be used also.<\/p>\n<pre class='wp-code-highlight prettyprint'>void setup() {\r\n  \/\/ put your setup code here, to run once:\r\n  Serial.begin(115200);\r\n  Serial.println(\"\");\r\n  Serial.println(\"Hello\");\r\n  delay(1000);\r\n  pinMode(1, OUTPUT);\r\n}\r\n\r\nvoid loop() {\r\n  \/\/ put your main code here, to run repeatedly:\r\n  digitalWrite(1, LOW); \/\/ turn the LED on (HIGH is the voltage     level)\r\n  delay(500); \/\/ wait for a second\r\n  digitalWrite(1, HIGH); \/\/ turn the LED off by making the voltage LOW\r\n  delay(300); \r\n  digitalWrite(1, LOW); \r\n  delay(500); \/\/ wait for a second\r\n  digitalWrite(1, HIGH); \r\n  delay(2000); \r\n}<\/pre>\n<p>In my module the LED is on PIN 1.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I went crazy, mad trying to understand why the module is not printing anything to the Serial Monitor or receiving any AT commands. I went through lots of articles on the internet and was on the verge of throwing the module away. Just that my mind was not willing to believe that it is dead&hellip; <a class=\"more-link\" href=\"https:\/\/www.kolkataonweb.com\/code-bank\/arduino\/esp-01-serial-println-or-serial-print-not-working\/\">Continue reading <span class=\"screen-reader-text\">ESP-01 Serial.println() or Serial.print() not working<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,373,64],"tags":[15,14],"class_list":["post-995","post","type-post","status-publish","format-standard","hentry","category-arduino","category-electronics","category-esp-8266","tag-esp-01","tag-esp8266","entry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/995","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/comments?post=995"}],"version-history":[{"count":1,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/995\/revisions"}],"predecessor-version":[{"id":996,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/995\/revisions\/996"}],"wp:attachment":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/media?parent=995"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/categories?post=995"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/tags?post=995"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}