ESP32 - FIRST STEPS

Tomer Weller / 2016-11-28

Note: a revised version of this post has been uploaded to my blog.

Contents:

Intro

Equipment:

Basic Connectivity

Sanity Check

FreeRTOS

ESP - IDF

ESP32 ARDUINO CORE

Ring Oscillator benchmark

More Resources

Intro

ESP32, successor to the beloved ESP8266, is system on a chip (SoC) that can do everything:

Espressif, the manufacturer, have been kind enough to send some units of their new ESP32 modules for evaluation. (huge thanks to John Lee @EspressifSystem) This posts explores basic connectivity, different ways to program it and basic benchmarking.

Equipment

Note: soldering the module to the breakout board proved non-trivial, the ground plane is very large so a high wattage soldering iron is recommended for soldering the ground pads.

Basic Connectivity

VCC (ESP32)

3.3V (POWER)

GND (ESP32)

GND (POWER)

GND (ESP32)

GND (FTDI)

TX (ESP32)

RX (FTDI)

RX (ESP32)

TX (FTDI)

Sanity Check

  1. Open a terminal emulator on 115200 BAUD
  2. Hit the RESET button

⇒  miniterm.py /dev/tty.usbserial-XXXXXXXX 115200

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)

....

IDF version : master(db93bceb)

WIFI LIB version : master(934d079b)

ssc version : master(r283 4d376412)

!!!ready!!!

mode : softAP(26:0a:c4:00:27:f4)

dhcp server start:(ip: 192.168.4.1, mask: 255.255.255.0, gw: 192.168.4.1)

+WIFI:AP_START

Not only does it work, it even defaults to opening a public access point

⇒  airport -s | grep ESP

ESP_0027F4 26:0a:c4:00:27:f4 -14  1,+1    Y  -- NONE

When a device enters the network:

n:1 0, o:1 0, ap:1 1, sta:255 255, prof:1

add 1

station: 80:e6:50:27:b6:62 join, AID = 1, g, 20

+SOFTAP:STACONNECTED,80:e6:50:27:b6:62

I couldn't find any other interesting things in oem firmware.

In case you were wondering, like me, wether ESP8266's AT command-set works in this prompt, the answer is no. It's not very clear what commands work in this prompt.

FreeRTOS

Before programming this chip it's crucial to understand that, unlike other embedded systems, the ESP32 comes with a light operating system - FreeRTOS. The following methods to program this chip don't replace the FreeRTOS firmware, but rather deploy applications for it to run. I imagine that in the near future we'll see other operating systems or no-os approaches for reprogramming these chips.  

ESP - IDF

Espressif IoT Development Framework is a set of open source libraries and tools to facilitate deployment of apps to ESP32s FreeRTOS.

Example: https://github.com/tomerweller/esp32-rtos-webclient 

ESP32 ARDUINO CORE

Espressif have also been hard at work to get the maker community happy and makers love Arduino. The ESP32 arduino core integrates ESP-IDF deeply into the arduino tools. This includes providing a WiFi api that is almost 100% compatible with existing wifi shields for arduino.

Example: https://github.com/tomerweller/esp32-arduino-webclient 

Note: currently, to take advantage of the dual core setup - IDF is the way to go.

Ring Oscillator benchmark

ESP32 FreeRTOS

ESP32 Arduino Core

code: https://gist.github.com/tomerweller/7f9f202858cb064c84722c72f6c20aee

code:

https://gist.github.com/tomerweller/e50403bb18dcb6932d54e8f11edf0734

1.63MHz

1.05MHz

Note: These tests only occupy one core. The second core is free to perform other tasks, mostly networking. Example: https://github.com/tomerweller/esp32-rtos-webclient/tree/with-ring-oscillator 

More Resources

ESP32 Data Sheet

ESP-WROOM32 Data Sheet

ESP32 official forum

ESP32 Getting started (hackaday)