1. Getting EMIT ready for firmware development (Arduino) - ControlBits/EMIT GitHub Wiki

The processing power of the EMIT IoT development board, is provided by a low-cost, 30-Pin ESP32 DEVKITv1 module that includes the popular Espressif ESP32-WROOM-32 wireless IoT module with integrated dual-mode Wi-Fi and Bluetooth antenna.

Firmware for the ESP32 can be developed in MicroPython or C++. This guide is focused on developing firmware for EMIT using Arduino C++.

When working with Arduino C++ on the ESP32 we have two IDEs to choose from:

  • Arduino
  • Platform IO

The Arduino IDE is available for Windows, Mac & Linux so is easily accessible to everyone. It's been actively maintained by the Arduino team so for this development guide, we'll be using Arduino.

1.1 Download and install the Arduino IDE

The first thing you'll need to do is download and install the Arduino IDE from the Arduino website: https://www.arduino.cc/en/main/software

Arduino provide detailed installation guides for each operating system; just choose and follow the guide that matches your operating system:

1.2 Download Arduino core for the ESP32

Next we will install the Arduino core for the ESP32. there are several methods to install it the easiest is through the board manager of the Arduino IDE.

  1. Start Arduino and open Preferences window, click File -> Preferences (Arduino -> Preferences on the Mac).

Arduino preferences

  1. Open the 'Additional Board Manager URLs' dialog by clicking the icon to the right of the box.

Arduino boards manager urls

  1. Copy and paste the stable release link(https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json) into Additional Board Manager URLs dialog and click 'OK' twice.

Arduino add url

  1. Open Boards Manager from Tools -> Board: -> Board Manager

Board manager

  1. In the Board Manager dialog:
    1. In the search bar type 'esp32'.
    2. choose "ESP32 by Espressif".
    3. choose the latest version and click install.

This will install the esp32 platform (and don't forget to select your ESP32 board from Tools -> Board menu after installation).

Board manager

ESP32 boards would then appear in the Tools -> Boards Menu we would choose from that menu our board which is 'DOIT ESP32 DEVKIT V1'.

doit

1.3 Flash Your First Code onto EMIT's ESP32

OK, now you've downloaded the ESP32 Arduino SDK, let's flash our first blinky code onto EMIT's ESP32. Thankfully, Arduino makes this easy!

Carefully plug the ESP32-DEVKITv1 module into the EMIT PCB, ensuring that all of the DEVKITv1 modules pins align to the socket strips in EMIT. The USB connector should be at the bottom edge of the EMIT board as shown below:

ESP32-DEVKITV1-EMIT

Connect a USB cable between the ESP32-DEVKITv1 module and your PC/Laptop.

Open the Arduino IDE and select 'Tools' -> 'Boards' from the main menu. Choose 'DOIT ESP32 DEVKIT V1'.

Then select 'Tools', port and choose the serial port the ESP32 is connected to. In my case it was '/dev/ttyUSB1'.

port

Select 'File' -> 'Examples' -> 'Basics' -> 'Blinky' to open the blinky example that simply blinks the Build in LED of the ESP32 DOIT DEVKIT V1.

blinky

After choosing the correct board and port from the 'Tools' menu, click on the upload button to compile and upload your first sketch to the ESP32.

upload

Tip: Please notice the Arduino IDE bottom console that provide the informations for the compilation and upload status.

To upload your code, you need to put the ESP32 into boot mode. This is done by pressing and holding the BOOT button on the ESP332 DOIT DEVKIT V1 board - you should click the BOOT button when you see the text 'Connecting..............' on the Arduino console.

Eventually, the Installing firmware dialog box will confirm that installation has been completed ... Success!!! If everything is okay you should see the Blue LED on the DEVKITV1 module start blinking.

Congratulations! you're now ready to move on to: 2. Writing and uploading firmware to EMIT