Class33 ESP32 (Lolin32)

 

ESP-32 Wemos  Lolin32

Lolin32. (Click for larger view. Twice may be even larger.)
  • Dual core 32 bit CPU 240 MHz
  • Up to 26 digital pins
  • Up to 12 analog pins
  • Wifi/bluetooth. Modem
  • Lithium battery connector
  • USB programming & optional power

I will have one of these ready for all class members at first week.

Schematic diagram:  https://wiki.wemos.cc/_media/products:lolin32:sch_lolin32_v1.0.0.pdf
You can find some internet info by googling for wemos lolin32 (not the “lite”).

Today’s task – to get software running and able to program the ESP32.

We use Arduino IDE. You may have it already. Recommend latest (1.8.5). The “repository” versions in linux are too old, so linux users need one direct from Arduino website.

We add support for ESP32. The “official” method for that is messy, long and prone to mistakes. So I supply pre-compiled ESP32 extensions for you.  (ie, we cheat.)

Note re dropbox files below:

  • You should not need to sign on to dropbox. You can continue past that offer!
  • When it says “can’t be previewed” you can still download.

Windows

Install Arduino. Pref 1.85.   https://www.arduino.cc/en/Main/Software    Or you can use any existing recent arduino installation (over V 1.6).

Start arduino. Determine (from Preferences) the arduino “sketchbook” folder,  probably C:/Users/(your-name)/(my)Documents/Arduino/

Download hardware.zip from dropbox here, unzip it, and position the hardware folder inside your …/Arduino sketchbook folder.

Restart Arduino. Tools/Boards: esp32 boards should now be available. Use Wemos LOLIN32.

 

Linux (debian/mint/ubuntu)

For the linux version I supply a total pack, a new arduino executable complete with its ESP32 extras. (Any earlier arduino install will stay separate.)

We will use folder /opt, a good place to put an installation that is not quite legit!

Get a terminal positioned at /opt, and create a new folder arduino-1.8.5. (Will need sudo.)

you@yourpc  ~  $   cd /opt

you@yourpc  /opt  $  sudo  mkdir  arduino-1.8.5

Then ensure that the new folder is owned by you, not the default root

you@yourpc  /opt  $  sudo  chown  $USER  arduino-1.8.5   -v

Unzip arduino-1.8.5.tar.gz (from dropbox) to somewhere temporary like downloads or a folder on your desktop. I use “rightclick-extract here”. Abt 1GB.

Use filemanager to move whole CONTENTS OF unzipped folder arduino-1.8.5 into /opt/arduino-1.8.5

Before you start arduino, make yourself a sketchbook folder if there wasn’t one from an earlier install. Eg /home/{your-name}/Arduino

By double clicking the file /opt/arduino-1.8.5/install.sh (then choose run) it should create a proper menu item for your install. In any case Arduino can be executed by clicking /opt/arduino-1.8.5/arduino.

Arduino will probably complain (once) about sketchbook folder not being correct. Use preferences to point into your old sketchbook or the new one you created above.

ESP32 boards (and ESP8266) should now be available. Choose Wemos LOLIN32.

 The Integrated Development Environment

  • Select board used, and serial port
  • Code editor
  • Compiler
  • Uploader to our board
  • Serial terminal monitor from board

“Official” ESP32 setup for Arduino:

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

This is the official setup instruction. If you don’t like our cheat easier setup above, do it the “right” way. Good luck, we’ll be here when you come back.

Action:

We will practice a few simple GPIO functions.

“ESP32: lights on please! Green.  No, Red.”

Week 33 PPT

Week 33 SKETCH CODE