Difference between revisions of "Arduino Setup for ESP32"
(9 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
[[category:ESP32 Arduino]] | [[category:ESP32 Arduino]] | ||
− | After the [[Overview of ESP32 features. What do they practically mean?|brief overview of Esp32]], its time to setup the arduino for ESP32 and run some sample examples. | + | After the [[Overview of ESP32 features. What do they practically mean?|brief overview of Esp32]], its time to setup the arduino for ESP32 and run some sample examples. This will install support Horbill ESP32 Dev, Hornbill ESP32 Minima and other ESP32 boards as well. |
− | Download and install the [https://www.arduino.cc/en/ | + | =Windows= |
+ | * Download and install the [https://www.arduino.cc/en/main/software latest version of Arduino IDE.] | ||
+ | * Download/Clone the latest esp32 files from the [https://github.com/espressif/arduino-esp32 espressif repo]. | ||
+ | * Create a directory/folder named '''espressif''' under '''''Documents/Arduino/Hardware''''' and extract the contents of files downloaded. It should like so: | ||
+ | [[File:esp32-extract-repo.jpg|center]] | ||
+ | * The setup uses python for various things like uploading the binary file to the board. So we download and install python 2.7.x next. Get it [https://www.python.org/downloads/release/python-2712/ from python.org] | ||
+ | * During installation remember to add '''Python to the PATH variable'''. This will enable python to be run from any directory on your computer. | ||
+ | * Open the command prompt and change the directory '''''cd Documents\Arduino\hardware\espressif\esp32\tools'''''. and hit the command '''python get.py''' | ||
+ | [[File:esp32-get-toolchain.jpg]] | ||
+ | |||
+ | <br> | ||
+ | ''This will download and install the tool chain required to compile the code. If you get an error stating "command python not found". Ensure that the '''''you've added python to the path'''''. If not sure what this means, do comment below.'' | ||
+ | * Now go ahead and open the Arduino IDE, select the board from the '''tools Menu''' like so., | ||
+ | [[File:esp32-select-board.jpg]] | ||
+ | * The Hornbill Series of ESP32 boards use '''CP2102''' as the USB to serial converter chip. Install the drivers for it with the [[Cp2102_Usb-to-Serial_Driver_Installation| help of this tutorial]] and note down the '''COM''' port number. | ||
+ | * Upload any of the example codes. Hornbill ESP32 Dev has a LED on pin 13, so I did a blinky. | ||
+ | [[File:0_esp32_upload_example.JPG]] | ||
+ | |||
+ | =Debian/Ubuntu Linux= | ||
+ | The setup could not have been more seamless, at-least till we have support for the Arduino board manager. | ||
+ | * Download and install the latest Arduino IDE | ||
+ | * Open the terminal and copy/paste the command below: | ||
+ | <syntaxhighlight> | ||
+ | sudo usermod -a -G dialout $USER && \ | ||
+ | sudo apt-get install git && \ | ||
+ | wget https://bootstrap.pypa.io/get-pip.py && \ | ||
+ | sudo python get-pip.py && \ | ||
+ | sudo pip install pyserial && \ | ||
+ | mkdir -p ~/Arduino/hardware/espressif && \ | ||
+ | cd ~/Arduino/hardware/espressif && \ | ||
+ | git clone https://github.com/espressif/arduino-esp32.git esp32 && \ | ||
+ | cd esp32/tools/ && \ | ||
+ | python get.py | ||
+ | </syntaxhighlight> | ||
+ | * If there are no errors, open the Arduino IDE and compile and upload a simple sketch and you should be ready to go. | ||
+ | ==Notes== | ||
+ | When I ran the above commands, it error-ed out on the the last command '''python get-py'' with the following error: | ||
+ | <syntaxhighlight> | ||
+ | Traceback (most recent call last): | ||
+ | File "get.py", line 18, in <module> | ||
+ | import requests | ||
+ | ImportError: No module named requests | ||
+ | </syntaxhighlight> | ||
+ | The '''requests''' python module was not installed on my computer, I installed it by running: <br> | ||
+ | '''''$ sudo pip install requests''''' <br> | ||
+ | Open the IDE and it worked, like so: | ||
+ | [[File:esp32-ubuntu-upload.png]] | ||
+ | =References= | ||
+ | * Instructions on the [https://github.com/espressif/arduino-esp32|arduino-esp32 repo] | ||
+ | If you'ld like to hear more about our ESP32 exploration, do sign up [https://docs.google.com/forms/d/e/1FAIpQLSctDit51-u4OmfBGbxc0enECy7_3mYRsQswM52lOBp-lfIoNw/viewform here]. | ||
+ | Do comment below, if you've any questions or errors about the installation, we will be glad to help! | ||
+ | {{DISQUS}} |
Latest revision as of 11:57, 17 January 2017
After the brief overview of Esp32, its time to setup the arduino for ESP32 and run some sample examples. This will install support Horbill ESP32 Dev, Hornbill ESP32 Minima and other ESP32 boards as well.
Windows
- Download and install the latest version of Arduino IDE.
- Download/Clone the latest esp32 files from the espressif repo.
- Create a directory/folder named espressif under Documents/Arduino/Hardware and extract the contents of files downloaded. It should like so:
- The setup uses python for various things like uploading the binary file to the board. So we download and install python 2.7.x next. Get it from python.org
- During installation remember to add Python to the PATH variable. This will enable python to be run from any directory on your computer.
- Open the command prompt and change the directory cd Documents\Arduino\hardware\espressif\esp32\tools. and hit the command python get.py
This will download and install the tool chain required to compile the code. If you get an error stating "command python not found". Ensure that the you've added python to the path. If not sure what this means, do comment below.
- Now go ahead and open the Arduino IDE, select the board from the tools Menu like so.,
- The Hornbill Series of ESP32 boards use CP2102 as the USB to serial converter chip. Install the drivers for it with the help of this tutorial and note down the COM port number.
- Upload any of the example codes. Hornbill ESP32 Dev has a LED on pin 13, so I did a blinky.
Debian/Ubuntu Linux
The setup could not have been more seamless, at-least till we have support for the Arduino board manager.
- Download and install the latest Arduino IDE
- Open the terminal and copy/paste the command below:
sudo usermod -a -G dialout $USER && \ sudo apt-get install git && \ wget https://bootstrap.pypa.io/get-pip.py && \ sudo python get-pip.py && \ sudo pip install pyserial && \ mkdir -p ~/Arduino/hardware/espressif && \ cd ~/Arduino/hardware/espressif && \ git clone https://github.com/espressif/arduino-esp32.git esp32 && \ cd esp32/tools/ && \ python get.py
- If there are no errors, open the Arduino IDE and compile and upload a simple sketch and you should be ready to go.
Notes
When I ran the above commands, it error-ed out on the the last command 'python get-py with the following error:
Traceback (most recent call last): File "get.py", line 18, in <module> import requests ImportError: No module named requests
The requests python module was not installed on my computer, I installed it by running:
$ sudo pip install requests
Open the IDE and it worked, like so:
References
- Instructions on the repo
If you'ld like to hear more about our ESP32 exploration, do sign up here. Do comment below, if you've any questions or errors about the installation, we will be glad to help!