-
1Step 1
Download LuaNode and toolchains
You can download LuaNode on Linux by the following command:
git clone https://github.com/Nicholas3388/LuaNode.git
Make sure you have git installed, if not, install it by the command: sudo apt install git.
Download toolchains by: git clone https://github.com/jmattsson/nodemcu-prebuilt-toolchains.git
-
2Step 2
Download other usefull toolsESPlorer: is a Integrated Development Environment (IDE) for ESP8266 developers. LuaNode is compatible for Esplorer. Developers can use it to run and test lua program, as well as download lua code to ESP32.
Espressif flashtool (Windows): to flash the firmware, you’ll need a tool. If you are working with Windows, you can use the official flashtool and download it from the following link.
https://www.espressif.com/en/support/download/other-tools?keys=&field_type_tid%5B%5D=13
-
3Step 3
Build LuaNode (ESP32)
Change your directory to LuaNode32
* Export ESP32 toolchains by running the following command in Linux terminal, export PATH=/your_path/toolchains/esp32/bin:$PATH
* Export IDF_PATH by running the command, export IDF_PATH=/your_path/LuaNode/LuaNode_Esp32/esp-idf/, where your_path is the path your save LuaNode.
* Change directory to LuaNode32, and then compile the project, run make
The firmware is generated in the build directory. The three bins file to be flashed is: partition-luanode.bin, bootload.bin, LuaNode.bin, respectively.
-
4Step 4
Flash firmware
1 LinuxThe driver cp210x should be installed for Ubuntu (I test on Ubuntu 16.04), so you don’t have to install it again. When ESP32 dev-board plug in, the computer can auto detect the device, and you can found the device name /dev/ttyUSB0.
Make sure you have permission to write the device, you can change the /dev/ttyUSB0 permissions by: sudo chmod 777 /dev/ttyUSB0
To flash the firmware, change directory to LuaNode32, where contains a Makefile. Then run make flash if there is nothing wrong, the firmware will be start flashing.
2 WindowsIn Windows, you can install VirtualBox, and then install Linux OS on VirtualBox to build firmware as we said in 4.1 section. Then flash the bin files using official windows download tool. The flash address and other settings are shown as Fig 2.2
Note that after you click start button on the download tool, you’ll have to click the EN button on the ESP32 dev-kit to start flashing! Otherwise, the flashing progress won’t start. But in Linux you don’t have to press the EN button.
-
5Step 5
Development:
Lua code download* Run Esplorer Device com port is auto detected, so select the right port to open. The baud rate is 115200.
* Click open button on the left to select a Lua file. Also, you can copy Lua code and paste to the edit area and save it as a new file.
* Finally, click the Save to ESP button on the left bottom to download the code to device.
Lua developmentIn this section, we introduce how to use lua module to develop application. There are several lua module provided by LuaNode. They are auto loaded when power up.
See more:
https://github.com/Nicholas3388/LuaNode/tree/master/LuaNode_Esp32
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
Hi,
I am following your steps to build in Mac OS, but got the following errors, any ideas?
Thanks in advance!
Users/michaeljding/esp/LuaNode/LuaNode_Esp32/LuaNode32/components/mylibc/./c_stdio.c:606:33: note: in expansion of macro 'isdigit'
for (t = s; isdigit(*s); s++);
^
/Users/michaeljding/esp/LuaNode/LuaNode_Esp32/LuaNode32/components/mylibc/./c_stdio.c:690:6: error: conflicting types for 'dtoa'
void dtoa (char *dbuf, rtype arg, int fmtch, int width, int prec);
^
In file included from /Users/michaeljding/esp/esp-idf/components/newlib/include/stdlib.h:11:0,
from /Users/michaeljding/esp/esp-idf/components/newlib/platform_include/assert.h:21,
from /Users/michaeljding/esp/esp-idf/components/esp32/include/esp_assert.h:17,
from /Users/michaeljding/esp/esp-idf/components/soc/esp32/include/soc/soc.h:20,
from /Users/michaeljding/esp/esp-idf/components/esp32/include/rom/ets_sys.h:21,
from /Users/michaeljding/esp/esp-idf/components/esp32/include/rom/uart.h:20,
from /Users/michaeljding/esp/LuaNode/LuaNode_Esp32/LuaNode32/components/mylibc/include/c_stdio.h:8,
from /Users/michaeljding/esp/LuaNode/LuaNode_Esp32/LuaNode32/components/mylibc/./c_stdio.c:1:
/Users/michaeljding/esp/esp-idf/components/newlib/include/stdlib.h:190:15: note: previous declaration of 'dtoa' was here
char * _EXFUN(dtoa,(double, int, int, int *, int*, char**));
^
/Users/michaeljding/esp/esp-idf/components/newlib/include/_ansi.h:65:30: note: in definition of macro '_EXFUN'
#define _EXFUN(name, proto) name proto
^
make[1]: *** [c_stdio.o] Error 1
make: *** [component-mylibc-build] Error 2
J
J
Are you sure? yes | no
Docker image for ESP32 WROOM LuaNode building, https://github.com/frett27/docker-nodemcu-esp32-build . It takes me time to make it work, hope this will simplify the first steps
Are you sure? yes | no