{"id":5165,"date":"2016-09-08T17:25:47","date_gmt":"2016-09-08T17:25:47","guid":{"rendered":"http:\/\/blog.bachi.net\/?p=5165"},"modified":"2016-09-21T18:03:57","modified_gmt":"2016-09-21T18:03:57","slug":"nodemcu-esp8266-with-arduino-ide","status":"publish","type":"post","link":"https:\/\/blog.bachi.net\/?p=5165","title":{"rendered":"NodeMCU (ESP8266) with Arduino IDE"},"content":{"rendered":"<p>Additional Board Manager URL: http:\/\/arduino.esp8266.com\/stable\/package_esp8266com_index.json<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\/home\/andreas\/.arduino15\/packages\/esp8266\/hardware\/esp8266\/2.3.0\r\n\/home\/andreas\/Arduino\/\r\n<\/pre>\n<h3>EspExceptionDecoder<\/h3>\n<p><a href=\"https:\/\/github.com\/me-no-dev\/EspExceptionDecoder\">github: EspExceptionDecoder<\/a><\/p>\n<h3>LED Blinky<\/h3>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nvoid setup() {\r\n    pinMode(D4, OUTPUT);\r\n    \r\n    Serial.begin(9600);\r\n}\r\n\r\nvoid loop() {\r\n    Serial.println(&quot;HIGH&quot;);\r\n    digitalWrite(D4, HIGH);\r\n    delay(1000);\r\n    \r\n    Serial.println(&quot;LOW&quot;);\r\n    digitalWrite(D4, LOW);\r\n    delay(1000);\r\n}\r\n<\/pre>\n<h3>RFID<\/h3>\n<p><a href=\"https:\/\/github.com\/Jorgen-VikingGod\/ESP8266-MFRC522\">ESP8266-MFRC522<\/a><br \/>\n<a href=\"https:\/\/github.com\/miguelbalboa\/rfid\">Arduino RFID Library for MFRC522<\/a><br \/>\n<a href=\"http:\/\/playground.arduino.cc\/Learning\/MFRC522\">Mifare MFRC522 RFID Reader\/Writer<\/a><br \/>\n<a href=\"https:\/\/www.arduino.cc\/en\/Guide\/Libraries\">Installing Additional Arduino Libraries<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nFirmware Version: 0x11 = (unknown)\r\nCard UID: 82 8B C9 55\r\nCard SAK: 08\r\nPICC type: MIFARE 1KB\r\nSector Block   0  1  2  3   4  5  6  7   8  9 10 11  12 13 14 15  AccessBits\r\n  15     63   00 00 00 00  00 00 FF 07  80 69 FF FF  FF FF FF FF  &#x5B; 0 0 1 ] \r\n         62   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  &#x5B; 0 0 0 ] \r\n         61   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  &#x5B; 0 0 0 ] \r\n         60   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  &#x5B; 0 0 0 ] \r\n  14     59   00 00 00 00  00 00 FF 07  80 69 FF FF  FF FF FF FF  &#x5B; 0 0 1 ] \r\n         58   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  &#x5B; 0 0 0 ] \r\n         57   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  &#x5B; 0 0 0 ] \r\n         56   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  &#x5B; 0 0 0 ] \r\n  13     55   00 00 00 00  00 00 FF 07  80 69 FF FF  FF FF FF FF  &#x5B; 0 0 1 ] \r\n         54   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  &#x5B; 0 0 0 ] \r\n         53   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  &#x5B; 0 0 0 ] \r\n         52   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  &#x5B; 0 0 0 ] \r\n  12     51   00 00 00 00  00 00 FF 07  80 69 FF FF  FF FF FF FF  &#x5B; 0 0 1 ] \r\n         50   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  &#x5B; 0 0 0 ] \r\n         49   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  &#x5B; 0 0 0 ] \r\n         48   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  &#x5B; 0 0 0 ] \r\n  11     47   00 00 00 00  00 00 FF 07  80 69 FF FF  FF FF FF FF  &#x5B; 0 0 1 ] \r\n         46   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  &#x5B; 0 0 0 ] \r\n         45   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  &#x5B; 0 0 0 ] \r\n         44   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  &#x5B; 0 0 0 ] \r\n  10     43   00 00 00 00  00 00 FF 07  80 69 FF FF  FF FF FF FF  &#x5B; 0 0 1 ] \r\n         42   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  &#x5B; 0 0 0 ] \r\n         41   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  &#x5B; 0 0 0 ] \r\n         40   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  &#x5B; 0 0 0 ] \r\n   9     39   00 00 00 00  00 00 FF 07  80 69 FF FF  FF FF FF FF  &#x5B; 0 0 1 ] \r\n         38   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  &#x5B; 0 0 0 ] \r\n         37   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  &#x5B; 0 0 0 ] \r\n         36   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  &#x5B; 0 0 0 ] \r\n   8     35   00 00 00 00  00 00 FF 07  80 69 FF FF  FF FF FF FF  &#x5B; 0 0 1 ] \r\n         34   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  &#x5B; 0 0 0 ] \r\n         33   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  &#x5B; 0 0 0 ] \r\n         32   00\r\nSoft WDT reset\r\n\r\nctx: cont \r\nsp: 3ffef130 end: 3ffef3e0 offset: 01b0\r\n\r\n&gt;&gt;&gt;stack&gt;&gt;&gt;\r\n3ffef2e0:  3ffef316 00000006 00000006 40203746  \r\n3ffef2f0:  00000000 00000000 40230314 40203b69  \r\n3ffef300:  3ffef317 00000007 00000007 40202f71  \r\n3ffef310:  00000000 00000000 00000000 00000000  \r\n3ffef320:  00004937 00120100 3ffe84a9 3ffef3a0  \r\n3ffef330:  00000000 00000000 0000001c 00000004  \r\n3ffef340:  00000000 00000000 3ffee2a8 3ffee2a8  \r\n3ffef350:  3ffef3a0 0000004b 3ffee394 402035ec  \r\n3ffef360:  3ffee2a8 00000010 3ffee394 3ffef3a0  \r\n3ffef370:  3ffee2a8 00000007 3ffee2a8 402031bc  \r\n3ffef380:  3ffe84a8 3ffee394 3ffee394 3ffee3b8  \r\n3ffef390:  3ffee394 3ffee2a8 3ffee2a8 40203354  \r\n3ffef3a0:  ffffffff 3ffeffff 3ffee394 40203638  \r\n3ffef3b0:  3ffe8425 3ffee394 3ffee2a8 40201c64  \r\n3ffef3c0:  3fffdad0 00000000 3ffee3b0 40203910  \r\n3ffef3d0:  feefeffe feefeffe 3ffee3c0 40100114  \r\n&lt;&lt;&lt;stack&lt;&lt;&lt;\r\n\r\nEspExceptionDecoder\r\n===================\r\n\r\nDecoding 11 results\r\n0x40203746: Print::print(unsigned long, int) at \/home\/andreas\/.arduino15\/packages\/esp8266\/hardware\/esp8266\/2.3.0\/cores\/esp8266\/Print.cpp line 84\r\n0x40230314: rijndaelKeySetupEnc at ?? line ?\r\n0x40203b69: Print::print(__FlashStringHelper const*) at \/home\/andreas\/.arduino15\/packages\/esp8266\/hardware\/esp8266\/2.3.0\/cores\/esp8266\/Print.cpp line 84\r\n0x40202f71: MFRC522::PICC_DumpMifareClassicSectorToSerial(MFRC522::Uid*, MFRC522::MIFARE_Key*, unsigned char) at \/home\/andreas\/Arduino\/libraries\/MFRC522\/MFRC522.cpp line 35\r\n0x402035ec: Print::println() at \/home\/andreas\/.arduino15\/packages\/esp8266\/hardware\/esp8266\/2.3.0\/cores\/esp8266\/Print.cpp line 84\r\n0x402031bc: MFRC522::PICC_DumpMifareClassicToSerial(MFRC522::Uid*, MFRC522::PICC_Type, MFRC522::MIFARE_Key*) at \/home\/andreas\/Arduino\/libraries\/MFRC522\/MFRC522.cpp line 35\r\n0x40203354: MFRC522::PICC_DumpToSerial(MFRC522::Uid*) at \/home\/andreas\/Arduino\/libraries\/MFRC522\/MFRC522.cpp line 35\r\n0x40203638: Print::println(char const*) at \/home\/andreas\/.arduino15\/packages\/esp8266\/hardware\/esp8266\/2.3.0\/cores\/esp8266\/Print.cpp line 84\r\n0x40201c64: loop at \/home\/andreas\/Arduino\/esp8266_rfid\/esp8266_rfid.ino line 45\r\n0x40203910: loop_wrapper at \/home\/andreas\/.arduino15\/packages\/esp8266\/hardware\/esp8266\/2.3.0\/cores\/esp8266\/core_esp8266_main.cpp line 56\r\n0x40100114: cont_norm at \/home\/andreas\/.arduino15\/packages\/esp8266\/hardware\/esp8266\/2.3.0\/cores\/esp8266\/cont.S line 109\r\n<\/pre>\n<p>Use a delay in MFRC522.cpp<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n&#x5B;...]\r\n\/**\r\n * Dumps memory contents of a sector of a MIFARE Classic PICC.\r\n * Uses PCD_Authenticate(), MIFARE_Read() and PCD_StopCrypto1.\r\n * Always uses PICC_CMD_MF_AUTH_KEY_A because only Key A can always read the sector trailer access bits.\r\n *\/\r\nvoid MFRC522::PICC_DumpMifareClassicSectorToSerial(&#x5B;...]) {\r\n  &#x5B;...]\r\n\r\n    Serial.println();\r\n    \/\/delay(50);\r\n  }\r\n  \r\n  return;\r\n} \/\/ End PICC_DumpMifareClassicSectorToSerial()\r\n&#x5B;...]\r\n<\/pre>\n<h3>Soft WDT reset<\/h3>\n<p><a href=\"https:\/\/github.com\/esp8266\/Arduino\/issues\/34\">WDT fires if setup() takes more than 1 sec #34<\/a><br \/>\n<a href=\"https:\/\/github.com\/esp8266\/Arduino\/blob\/master\/cores\/esp8266\/Esp.h#L86-L92\">cores\/esp8266\/Esp.h<\/a><br \/>\n<a href=\"https:\/\/github.com\/esp8266\/Arduino\/blob\/master\/cores\/esp8266\/cont.S#L26-L36\">cores\/esp8266\/cont.S<\/a><\/p>\n<p><a href=\"http:\/\/www.mikrocontroller.net\/topic\/394279\">NodeMCU (ESP8266) Soft WDT reset<\/a><br \/>\n<a href=\"https:\/\/github.com\/esp8266\/Arduino\/issues\/1017\">Automatic reboot after wdt reset #1017<\/a><br \/>\n<a href=\"https:\/\/github.com\/esp8266\/Arduino\/issues\/1426\">SoftwareSerial: wdt reset #1426<\/a><br \/>\n<a href=\"https:\/\/github.com\/esp8266\/Arduino\/issues\/1074\">Uploads and runs ok, but does not run after power cycle #1074<\/a><\/p>\n<h3>TLS \/ WiFiClientSecure<\/h3>\n<p><a href=\"https:\/\/nofurtherquestions.wordpress.com\/2016\/03\/14\/making-an-esp8266-web-accessible\/\">Making an ESP8266 Web-Accessible<\/a><br \/>\n<a href=\"http:\/\/www.iotforest.com\/2016\/3\/4\/esp8266-arduino-feather-huzzah-using-slack-integration\">Slack Integration using Arduino IDE and ESP8266 Adafruit Feather HUZZAH<\/a><br \/>\n<a href=\"https:\/\/www.hackster.io\/glovebox\/secure-sensor-streaming-over-https-to-azure-iot-hub-dba05d\">Secure Sensor Streaming over HTTPS to Azure IoT Hub<\/a><br \/>\n<a href=\"https:\/\/io.adafruit.com\/blog\/security\/2016\/07\/05\/adafruit-io-security-esp8266\/\">IoT Security: Connecting Your ESP8266 to Adafruit IO with SSL\/TLS<\/a><br \/>\n<a href=\"https:\/\/docs.python.org\/2\/library\/ssl.html\">Python 2.7: TLS\/SSL wrapper for socket objects<\/a><br \/>\n<a href=\"https:\/\/docs.python.org\/3.3\/library\/ssl.html\">Python 3.3: TLS\/SSL wrapper for socket objects<\/a><br \/>\n<a href=\"https:\/\/docs.fedoraproject.org\/en-US\/Fedora_Security_Team\/1\/html\/Defensive_Coding\/chap-Defensive_Coding-TLS.html\">Fedora Documentation: Transport Layer Security<\/a><br \/>\n<a href=\"https:\/\/docs.fedoraproject.org\/en-US\/Fedora_Security_Team\/1\/html\/Defensive_Coding\/sect-Defensive_Coding-TLS-Client-Python.html\">Fedora Documentation: Implementing TLS Clients With Python<\/a><\/p>\n<pre class=\"brush: plain; title: Debug Prints; notranslate\" title=\"Debug Prints\">\r\n\/home\/andreas\/.arduino15\/packages\/esp8266\/hardware\/esp8266\/2.3.0\/cores\/esp8266\/debug.h\r\nBefore:\r\n#ifndef DEBUGV\r\n#define DEBUGV(...)\r\n#endif\r\n\r\nAfter:\r\n#ifndef DEBUGV\r\n#define DEBUGV(...) ets_printf(__VA_ARGS__)\r\n#endif\r\n\r\nSketch:\r\nvoid setup() {\r\n    Serial.begin(115200);\r\n    Serial.setDebugOutput(1);\r\n}\r\n<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nconnected with BACHI.NET, channel 6\r\ndhcp client start...\r\nip:10.0.0.84,mask:255.0.0.0,gw:10.0.0.1\r\nWiFi connected\r\nIP address: \r\n10.0.0.84\r\nCard UID: D9 F8 D0 B5\r\n:ref 1\r\nplease start sntp first !\r\n:wr\r\n:sent 72\r\n:ww\r\n:rn 1460\r\n:rd 5, 1460, 0\r\n:rdi 1460, 5\r\n:rd 74, 1460, 5\r\n:rdi 1455, 74\r\n:rd 5, 1460, 79\r\n:rdi 1381, 5\r\n:rd 1376, 1460, 84\r\n:rdi 1376, 1376\r\n:c0 1376, 1460\r\n:rn 543\r\n:rd 524, 543, 0\r\n:rdi 543, 524\r\n:rd 5, 543, 524\r\n:rdi 19, 5\r\n:rd 14, 543, 529\r\n:rdi 14, 14\r\n:c0 14, 543\r\n:wr\r\n:sent 887\r\n:ww\r\n:wr\r\n:sent 267\r\n:ww\r\n:wr\r\n:sent 267\r\n:ww\r\n:wr\r\n:sent 6\r\n:ww\r\n:wr\r\n:sent 69\r\n:ww\r\n:rn 75\r\n:rd 5, 75, 0\r\n:rdi 75, 5\r\n:rd 1, 75, 5\r\n:rdi 70, 1\r\n:rd 5, 75, 6\r\n:rdi 69, 5\r\n:rd 64, 75, 11\r\n:rdi 64, 64\r\n:c0 64, 75\r\nconnection successfully\r\nVerify certificate...\r\n\r\nverify!!!\r\ndomain name: '10.0.0.89'\r\nCN: 'Server', no match\r\ncertificate doesn't match\r\n\r\nverify!!!\r\ndomain name: 'Server'\r\nCN: 'Server', no match\r\ncertificate doesn't match\r\n\r\n:wr\r\n:sent 53\r\n:rn 53\r\n:ww\r\n:wr\r\n:sent 53\r\n:rch 53, 53\r\n:ww\r\n:ur 1\r\n:close\r\n:del\r\n<\/pre>\n<pre class=\"brush: plain; title: \/home\/andreas\/.arduino15\/packages\/esp8266\/hardware\/esp8266\/2.3.0\/libraries\/ESP8266WiFi\/src\/include\/ClientContext.h; notranslate\" title=\"\/home\/andreas\/.arduino15\/packages\/esp8266\/hardware\/esp8266\/2.3.0\/libraries\/ESP8266WiFi\/src\/include\/ClientContext.h\">\r\nDEBUGV(&quot;:abort\\r\\n&quot;);\r\nDEBUGV(&quot;:close\\r\\n&quot;);\r\nDEBUGV(&quot;:tc err %d\\r\\n&quot;, err);\r\nDEBUGV(&quot;:ref %d\\r\\n&quot;, _refcnt);\r\nDEBUGV(&quot;:ur %d\\r\\n&quot;, _refcnt);\r\nDEBUGV(&quot;:del\\r\\n&quot;);\r\nDEBUGV(&quot;:rd %d, %d, %d\\r\\n&quot;, size, _rx_buf-&gt;tot_len, _rx_buf_offset);\r\nDEBUGV(&quot;:rdi %d, %d\\r\\n&quot;, buf_size, copy_size);\r\nDEBUGV(&quot;:pd %d, %d, %d\\r\\n&quot;, size, _rx_buf-&gt;tot_len, _rx_buf_offset);\r\nDEBUGV(&quot;:rpi %d, %d\\r\\n&quot;, buf_size, copy_size);\r\nDEBUGV(&quot;:wr !_pcb\\r\\n&quot;);\r\nDEBUGV(&quot;:wr !ERR_OK\\r\\n&quot;);\r\nDEBUGV(&quot;:wr\\r\\n&quot;);\r\nDEBUGV(&quot;:ww\\r\\n&quot;);\r\nDEBUGV(&quot;:sent %d\\r\\n&quot;, len);\r\nDEBUGV(&quot;:c0 %d, %d\\r\\n&quot;, size, _rx_buf-&gt;tot_len);\r\nDEBUGV(&quot;:c %d, %d, %d\\r\\n&quot;, size, _rx_buf-&gt;len, _rx_buf-&gt;tot_len);\r\nDEBUGV(&quot;:rcl\\r\\n&quot;);\r\nDEBUGV(&quot;:rch %d, %d\\r\\n&quot;, _rx_buf-&gt;tot_len, pb-&gt;tot_len);\r\nDEBUGV(&quot;:rn %d\\r\\n&quot;, pb-&gt;tot_len);\r\nDEBUGV(&quot;:er %d %d %d\\r\\n&quot;, err, _size_sent, _send_waiting);\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Additional Board Manager URL: http:\/\/arduino.esp8266.com\/stable\/package_esp8266com_index.json \/home\/andreas\/.arduino15\/packages\/esp8266\/hardware\/esp8266\/2.3.0 \/home\/andreas\/Arduino\/ EspExceptionDecoder github: EspExceptionDecoder LED Blinky void setup() { pinMode(D4, OUTPUT); Serial.begin(9600); } void loop() { Serial.println(&quot;HIGH&quot;); digitalWrite(D4, HIGH); delay(1000); Serial.println(&quot;LOW&quot;); digitalWrite(D4, LOW); delay(1000); } RFID ESP8266-MFRC522 Arduino RFID Library for MFRC522 Mifare MFRC522 RFID Reader\/Writer Installing Additional Arduino Libraries Firmware Version: 0x11 = (unknown) Card UID: 82 8B [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5165","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/5165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5165"}],"version-history":[{"count":28,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/5165\/revisions"}],"predecessor-version":[{"id":5239,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/5165\/revisions\/5239"}],"wp:attachment":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}