This project is not for the public. It is not fully documented yet. The goal is to just to play around a little with the ESP and check out how easy it is to use it for home automation.
# useful commands
nodemcu-tool terminal # now reset the device and see what comes up
nodemcu-tool upload --run file.lua
nodemcu-tool upload -k *.lua
nodemcu-tool reset && sleep 0.1
derived from this article. Check this the NodeMCU Getting Started Guide for more info.
Install Device
- Install the driver for Mac from here
- Plug in the device, then
ls /dev
should include something like:tty.usbserial-0001
andtty.SLAB_USBtoUART
Flash NodeMCU
- Goto nodemcu-build.com and build an image and save it to downloads folder (select LFS size
64KB
)1 - Install esptool via
pip3 install esptool
(install pip viabrew install python
)2 - Flash:
esptool.py erase_flash
thenesptool.py --port /dev/cu.SLAB_USBtoUART --baud 115200 write_flash -fm qio 0x00000 nodemcu-master-15-modules-2020-01-03-19-24-21-integer.bin
Upload code
- Install NodeMCU-Tool:
npm install nodemcu-tool -g
- Download test script
wget https://raw.githubusercontent.com/AndiDittrich/NodeMCU-Tool/master/helloworld.lua
- Upload test code
nodemcu-tool --port=/dev/cu.SLAB_USBtoUART upload helloworld.lua
- Run test code
nodemcu-tool --port=/dev/cu.SLAB_USBtoUART run helloworld.lua
The setup is very similar to the ESP 8266...
Follow this tutorial.
git clone --branch dev-esp32 --recurse-submodules https://github.com/nodemcu/nodemcu-firmware.git nodemcu-firmware-esp32
Follow these instructions
docker run --rm -ti -v (pwd):/opt/nodemcu-firmware:delegated marcelstoer/nodemcu-build configure-esp32
# select NodeMCU modules (e.g. JSON & Touch)
docker run --rm -ti -v (pwd):/opt/nodemcu-firmware:delegated marcelstoer/nodemcu-build build
Then flash:
esptool.py --port /dev/cu.SLAB_USBtoUART --baud 115200 erase_flash
esptool.py --port /dev/cu.SLAB_USBtoUART --baud 115200 write_flash -fm dio 0x0000 nodemcu_dev-esp32_20200105-1946.bin
# you may have to press the boot button
Footnotes
-
Alternatively to building your own image you can download the latest release from github/nodemcu-firmware and then build it using docker like here. ↩
-
Alternatively to using esptool, you can download the nodemcu flasher from nodemcu-pyflasher ↩