TheMaker.it

Programmare NodeMCU

Visit Themaker.it

NODEMCU Chinese

  1. scaricare https://esp8266.ru/esplorer/
  2. scaricare il flasher https://github.com/nodemcu/nodemcu-flasher
  3. scaricare il firmware aggiornato su https://github.com/nodemcu/nodemcu-firmware/releases/tag/0.9.6-dev_20150704 oppure nodemcu_integer_0.9.5_20150318.bin
  4. scaricare app android e script LUA per la configurazione WIFI e motor shield https://github.com/SmartArduino/DoitCar/tree/master/ap

1) Connect the board by micro usb cable

2) Install the USB-TTL driver.

3) Open nodemcu flasher (find in ‘useful link’ above), in “config” section, add the nodemcu bin file on 0x0000 column

the advanced setting could be kept default as

SPI SPEED choose 40MHz

SPI MODE select DIO

FLASH SIZE select 32M

Set the COM port and baud rate 115200

Enter the board into flash mode, but this is not necessary for Nodemcu dev board

FLASH key module at this time hold down the button, then press again RST key to enter programming state, to let go.

Start flashing and done!

Re-connect the board, and use ESPlore the baudrate is either 115200 or 9600(default)

Per testare il firmware

Connect the board and run node.restart() commands to see the reboot info

NodeMCU 0.9.6 build 20150406  powered by Lua 5.1.4

lua: cannot open init.lua

Using any Serial tool, type commands, should have following reply:

print(“hello world”)

Using nodemcu Studio tool can execute lua commands more convenient

Until now the bootloader of nodemcu is working fine now!

Startup lua file init.lua

now the board does not have any codes file lua inside, which is similar to arduino sketch

when module bootup successfully, it will run lua code file init.lua in default

if we want to run a custom lua code file, we can add dofile(“yourfile.lua”) into init.lua to let the board do so

example code hello world

file.open(“init.lua”,”w+”)

file.writeline([[print(“hello world”)]])

file.close()

IMPORTANTE!!! per caricare i file .lua da esplorer

1) creare il codice sul pannello di sx,

2) salvare su file con il nome del file.lua che si vuole

3) cliccare su upload e selezionare il file.lua