This guide assumes that you have obtained (or built) the binary files ready to flash into your ESP32.
An archive file containing the current available ESP32-Duktape can be download at:
We will use the
esptool.py to load the binaries into the ESP32 flash memory.
The distribution consists of the following files:
esp32-duktape.bin- The primary application binary.
partitions_singleapp.bin- The partitions description for the application.
bootloader.bin- The bootloader for the application.
install_binaries.sh- A script for flashing the ESP32.
The load addresses are:
For example, on Linux with the ESP32 in flash mode, we can run the following:
$ python $IDF_PATH/components/esptool_py/esptool/esptool.py \ --chip esp32 --port "/dev/ttyUSB0" --baud 115200 write_flash --flash_mode "dio" \ --flash_freq "40m" --flash_size "4MB" --compress \ 0x1000 bootloader.bin \ 0x8000 partitions_singleapp.bin \ 0x10000 esp32-duktape.bin \ 0x180000 spiffs.img \ 0x300000 espfs.img
When all is complete, the ESP32 can be rebooted and we are ready to go.
In order to use the ESP32-Duktape program, we need to be WiFi connected (at least initially). However, in order for an application to connect to your WiFi access point we need to know its name (SSID) and the password you use to connect to it. That means that you have to supply it. Ahh ... but wait, how do you supply that information when you don't have network access?
When ESP32-Duktape boots, it looks in its flash memory for the network name and password it should use. Since on first boot, that is not present, the ESP32 itself becomes a WiFi access point. Here you can connect your phone (or other mobile device) to it and open up a browser point to the IP address of your ESP32. By default this will be http://192.168.4.1. Once there, you will see a browse screen that looks like
From there, you will be presented with the opportunity to enter a network name and password. If you want your ESP32 to connect to the access point with a dedicated IP address then you can fill in the IP address, gateway address and netmask. If you want to use an allocated (DHCP) supplied address, leave these fields blank. When you click the submit button, the data will be saved in your ESP32 which will then automatically reboot itself after a few seconds.
Now, when you reboot your ESP32, it will connect to the network using the information you provided. If the network connection fails (because you are now somewhere else or you change your password), then the ESP32 will again reset to being an access point.
It is strongly recommend that you keep the console log up while the ESP32 is running so that you can see the messages being written.
Opening up the IDE
This will load the IDE into the browser. The result will look like:
Using the IDE
Run button, causes that script to execute on
ESP32. Any console output as written by
console.log() statements will appear in the
Console area. If you merely wish to execute a single statement, you can enter that
Eval area and click the
Run button the right of the text input.
Load button will open up a list of the files found in the flash storage
of the ESP32. These are the files that are either pre-supplied or you have previously
saved. From the resulting load dialog, you can select a file to open in the editor or
execute it directly on the ESP32 without changing your current editor content.
Save button and enter
(or select) the name you wish to save it as. The file will be saved in the flash
storage of the ESP32.
Speeding up ESP32-Duktape
You will find that performance jumps dramatically but now you won't get any log output. To see the log output again, run:
Here is a summary of a set of common steps to download, install and run ESP32-Duktape:
tar -xvzf esp32-duktape-2017-01-20.tar.gz
git clone --recursive https://github.com/espressif/esp-idf.git
screenor other terminal emulator to your ESP32. (eg.
screen /dev/ttyUSB0 115200).
- Connect to network "esp32-duktape".
- Open http://192.168.4.1
- Supply parameters and hit submit. Your ESP32 will save the settings and reboot after a few seconds.
- Check that start is clean by looking at the log.
- Open browser to your IP address at port 8000 and /web/ide.html. eg. http://192.168.1.99:8000/web/ide.html