2018/04/27

Arduino-ESP32 - How to update to the latest Arduino-ESP32

Arduino-ESP32 is still under development and, from time to time, newer version is released with patches and/or enhancements. In the event that you encounter problem with your sketch (like the sketch works on ESP8266 but not on ESP32), aside from checking the libraries, it's a good idea to update to the latest version of Arduino-ESP32.

Here are the steps for updating to the latest Arduino-ESP32.

1. Go to https://github.com/espressif/arduino-esp32 to check for the availability of the latest version of Arduino-ESP32;

Below is a screenshot at the time of writing this post.


2.  Go to the directory where the libraries of Arduino-ESP32 are installed on your computer.

In my case, it's at C:\Users\WeiHsiungHuang\Documents\Arduino\hardware\espressif\esp32\libraries.


Make a copy of the libraries (and keep them in a safe place) that were added after Arduino-ESP32 was installed. These libraries will be put back after Arduino-ESP32 is updated.

In my case, the "WebServer-esp32-master" and "WiFiManager-esp32" are the libraries that were added after Arduino-ESP32 was installed and they need to be backup.

3. Go to the directory where Arduino-ESP32 is installed on your computer.

In my case, it's at C:\Users\WeiHsiungHuang\Documents\Arduino\hardware\espressif.

Delete the esp32 directory and everything under it.

4. Launch Command Prompt and change the working directory to where the esp32 directory was located. In my case, it's at C:\Users\WeiHsiungHuang\Documents\Arduino\hardware\espressif.

C:\>cd C:\Users\WeiHsiungHuang\Documents\Arduino\hardware\espressif


5. Assuming git has been installed on your computer, issue the command below to clone the latest Arduino-ESP32.

git clone https://github.com/espressif/arduino-esp32.git esp32

Depending on the network speed, the new Arduino-ESP32 will be cloned to your computer after a while.


If you don’t have git, click “Download” -> “Download ZIP” on the GitHub page to download the core, and unzip it to espressif/esp32 directory in your Arduino sketchbook directory.


6. Install the Xtensa and ESP32 Tools

To compile code for the ESP32, you need the Xtensa GNU compiler collection (GCC) installed on your machine. Windows users can run get.exe, found in the “esp32/tools” folder.


Double click on get.exe to execute it. Depending on network traffic it could take more than 10 minutes for the download and installation to complete.

7. Be sure to put the previously backup libraries back to where they belong (\espressif\esp32\libraries).

Reference:

Installing the ESP32 Arduino Core
https://learn.sparkfun.com/tutorials/esp32-thing-hookup-guide/installing-the-esp32-arduino-core

--------------------------------------------------------------------------------------------------------------------------

Updated on 2018/7/1

Today, I discovered that WebServer and AsyncUDP are added to the supported libraries and there is now a library for AzureIOT so I decided to update my Arduino-ESP32 to this latest version.

espressif/arduino-esp32
https://github.com/espressif/arduino-esp32


The folder list to the left is from #1316 (the previously installed Arduino-ESP32), the folder list to the right is from #1564 (the latest Arduino-ESP32 as of 2018/7/1).

For #1316, the following libraries were not part of the original libraries but were added by me for different projects.

- arduinoWebSockets-esp32
- Hash_tng
- WebServer_tng
- WifiManager-esp32


Be sure to put back the libraries needed for the projects. In my case, I need to put back the following libraries:

- arduinoWebSockets-esp32
- Hash_tng
- WifiManager-esp32


No comments:

Post a Comment