NodeMCU is a LUA based interactive firmware for Expressif ESP8622 Wi-Fi SoC, as well as an open source hardware board that contrary to the $3 ESP8266 Wi-Fi modules includes a CP2102 TTL to USB chip for programming and debugging, is breadboard-friendly, and can simply be powered via its micro USB port.
Let’s checkout the hardware first. The latest version of the board (V1.0) has the following specifications and features:
- Wi-Fi Module – ESP-12E module similar to ESP-12 module but with 6 extra GPIOs.
- USB – micro USB port for power, programming and debugging
- Headers – 2x 2.54mm 15-pin header with access to GPIOs, SPI, UART, ADC, and power pins
- Misc – Reset and Flash buttons
- Power – 5V via micro USB port
- Dimensions – 49 x 24.5 x 13mm
The hardware documentation for the board can be found on nodemcu-devkit repo, including schematics and PCB layout designed with Altium Designer, but they should also be compatible with the cheaper Altium CircuitStudio. Sadly, the files have not been updated for 3 to 4 months, so they don’t completely match the latest hardware shown above, and some pins were not connected in the earlier version.
NodeMCU can be purchased for $10 and up on Aliexpress or Seeed Studio. However, it’s not entirely clear which version of the board is sold… The Aliexpress shop shows hardware v0.9, but says they will send the latest version, while Seeed Studio mentions NodeMCU “v2”, and shows picture of v1.0 hardware, which should be the one you want. The new board will also be up for sale in Europe on nodemcu.eu for 15 to 18 Euros including VAT.
NodeMCU firmware is build with ESP8266 SDK v.0.9.5, based on Lua 51.4 without debug and os modules, lua-cjson, and relies on spiffs (SPI Flash File System) file system. The quick start guide is written on the bottom of the board:
- Install CP2102 driver (not needed in Linux)
- Use 9600 baud rate
- Connect Wi-Fi and enjoy!
Once you are connected, you can just type the command in the terminal. For example to connecting to your Wi-Fi router:
1 2 3 4 |
wifi.setmode(wifi.STATION) wifi.sta.config("SSID","password") print(wifi.sta.getip()) --192.168.18.110 |
You can also toggle or/and read GPIO status in a similar way to what you’d with Arduino:
1 2 3 4 5 |
pin = 1 gpio.mode(pin,gpio.OUTPUT) gpio.write(pin,gpio.HIGH) gpio.mode(pin,gpio.INPUT) print(gpio.read(pin)) |
To get the board automatically run a script right after boot is complete, you can edit init.lua as follows:
1 2 3 |
file.open("init.lua","w+") file.writeline(print("hello world")) file.close() |
You can find the firmware source code and documentation on Github, as well as nodemcu-flasher, a Windows only tools to flash the firmware to a module. There’s also a separate tool called esptool that will let you flash nodemcu from Linux. In case you find the documentation is all over the place, you might want to checkout NodeMCU video tutorial below.
Nodemcu.com is the official website for the project, but you’ll find more information on Github. You can also get answers to your questions on their BBS or ESP8622 community forums.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress
Does this model fit an breadboard properly?, I bought one similar nodemcu variant, and it fills the breadboard, so it cannot be used that way: https://instagram.com/p/1qTZeKDOuD/
@neslekkim
The latest version apparently fits in a breadboard just fine -> https://www.facebook.com/NodeMCU/photos/a.761250643957454.1073741828.760688970680288/815009511914900/?type=1&theater
@cnxsoft
Great, I have to buy an new one then :), Guess I need to order from Seeed, the ones I have, came from Aliexpress a couple of days ago.
Another ESP8266 kit with 3x AAA battery holder.
http://www.dx.com/p/esp8266-serial-port-wi-fi-stable-version-test-board-wi-fi-wireless-module-381839?Utm_rid=93072394&Utm_source=affiliate
Too bad it’s not a real enclosure.
http://www.banggood.com/NodeMcu-Lua-ESP-12E-WIFI-Development-Board-p-985891.html
$6.69 on eBay – http://www.ebay.com/itm/NEW-Version-NodeMcu-Lua-ESP8266-WIFI-Internet-Development-Board-Module-/311413475392?hash=item4881b08840
Not 100% sure of the version however. I bought one. I’ll see.
Is there any pin compatibility to any cpu-board like Arduino Uno, Nano a.s.o. ??? Or is there salad of lines nessesary in real cpu-life (out of experimental envirement)?
@cnxsoft
That eBay seller sent me the old version that can’t be used with a breadboard…
Simple fix to use previous generation NodeMCU boards with a breadboard: http://lucstechblog.blogspot.com/2015/09/nodemcu-breadboard-aid.html
@cnxsoft
Option 2, use two breadboards side by side.
https://drive.google.com/file/d/0Bx8Vnd8W0oPyTVJ4bl9WVXgwUGc/view?usp=sharing
I purchased both.
http://www.aliexpress.com/item/New-product-Wireless-module-NodeMcu-Lua-Wifi-ESP8266MOD-WIFI-Network-Development-Board-Based-ESP8266-High-quality/32497217750.html for $6.15US, Free Shipping, now it’s $4.34
and
http://www.aliexpress.com/item/V3-new-NodeMcu-WIFI-Wireless-wifi-module-IoT-diy-rc-toy-development-board-based-ESP8266-with/32366613597.html for $8.10US, now $6.69
I even managed to get this one for $4.00, now it’s $4.28
http://www.aliexpress.com/item/V3-Wireless-module-NodeMcu-4M-bytes-Lua-WIFI-Internet-of-Things-development-board-based-ESP8266-for/32532972941.html
Now I need to decide if I should switch to this for $2.96US
http://www.cnx-software.com/2015/12/14/3-compact-esp8266-board-includes-rgd-led-photo-resistor-buttons-and-a-usb-to-ttl-interface/
@neslekkim Hello I used two smaller breadboards and mounted these on either side if the NodeMcu and glued this on top of a larger breadboard. That way the pins on each side become available for more leads connected to each pin.
I got fatal exception (0) with arduino IDE. when I upload program .I post it below:
00000000
Fatal exception (0):
epc1=0x40202770, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
Fatal exception (0):
epc1=0x40202770, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
Fatal exception (0):
epc1=0x40202770, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
Fatal exception (0):
epc1=0x40202770, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
Fatal exception (0):
epc1=0x40202770, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
Fatal exception (0):
epc1=0x40202770, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
Fatal exception (0):
epc1=0x40202770, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
Fatal exception (0):
epc1=0x40202770, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
Fatal exception (0):
epc1=0x40202770, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
Fatal exception (0):
epc1=0x40202770, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
Fatal exception (0):
epc1=0x40202770, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
Fatal exception (0):
epc1=0x40202770, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00
please tell whats wrong with him?
Hi everyone,
each time I plug the nodemcu on a breadboard, each time I have got an exeption. It disapear if the nodemcu is alone, powered by USB. I think that the breadboard introduce perturbations on the inputs and provoque the calling of an non-implemented interruption. I think that a pull-down on all the pins could solve the problem.
Perhaps only few i/o are concerned, but which one ?
Looking at the above image, why is rxd1 missing, every other txdn has an rxdn (see [txd0, rxd0], [txd1, ?] , [txd2.rxd2]) I’m assuming those are serial port ? also does txd0 is the main serial output after reboot? does the board also has a watch dog timer to prevent lockup ?