The onboard LED on the NodeMCU should now be blinking. Python luatool/luatool.py -port /dev/tty.SLAB_USBtoUART -src a -dest a -dofile Upload it to the NodeMCU using the following command (making sure Coolterm is disconnected first)… Gpio.write(LED_PIN, value and gpio.HIGH or gpio.LOW) To test we’ll upload a simple Lua script that will blink the NodeMCU’s onboard LED, save this as “a”. The best way to get Lua code onto the NodeMCU is to use the Python luatool. modules: adc,bit,cron,crypto,encoder,file,gpio,http,i2c,net,node,ow,pcm,sjson,sntp,spi,struct,tmr,u8g,uart,websocket,wifi,tls You should see some messy characters, then something like following (depending on what you built into your firmware)… Wrote 754992 bytes (505060 compressed) at 0x00000000 in 44.5 seconds (effective 135.6 kbit/s).Ĭonnect to it using CoolTerm, then press the “RST” button. To flash the firmware hold down “FLASH” and press “RST” on the NodeMCU, then use the following command (remembering to disconnect CoolTerm first if connected)…Įsptool.py -port /dev/tty.SLAB_USBtoUART write_flash -fm dio 0x00000 ~/Downloads/nodemcu-master-12-modules-21-24-03-float.binĪs esptool.py runs, you should see something like this…
Once you’ve build the firmware, you’ll need to install the Python esptool.py to flash the firmware to the NodeMCU. If you need to build new firmware, there is a very useful online site called that I used to build the firmware with the right modules I wanted for my project. … and Lua should echo “Hello” back to you. Tue 12:23 am 4319 Well, The nodemcu.bin needs to be downloaded from github using the raw file format.probably any other format messes up flashing the esp8266. If you are lucky you’ll get a prompt, if not you may need to build and install some new firmware. In Options, for Port select SLAB_USBtoUART, and for Baudrate select 115200. To connect to the NodeMCU, you’ll need some tools. Once installed, plug in the NodeMCU and check that the device /dev/tty.SLAB_USBtoUART exists.
The driver you need to install is the Silcon Labs CP210x USB to UART Bridge.
The Mac won’t support this by default, and you need to install a driver. You plug the NodeMCU into the Mac via USB. If you’re not using a Mac, you can skip this part. I had trouble getting it working initially, so I wanted to share how I fixed this on a Mac. This is a small ESP8266 based card with built in WiFi, MicroUSB, and a Lua interpreter that can be used for developing IoT (Internet of Things) devices.